62 changed files with 3618 additions and 22 deletions
@ -0,0 +1,20 @@ |
|||||
|
package org.dromara.system.api; |
||||
|
|
||||
|
import org.dromara.common.core.domain.R; |
||||
|
import org.dromara.system.api.domain.vo.RemoteClientVo; |
||||
|
|
||||
|
/** |
||||
|
* 客户端服务 |
||||
|
* |
||||
|
* @author Michelle.Chung |
||||
|
*/ |
||||
|
public interface RemoteSubmailConfigService { |
||||
|
|
||||
|
/** |
||||
|
* 根据客户端id获取客户端详情 |
||||
|
* |
||||
|
* @return 客户端对象 |
||||
|
*/ |
||||
|
R<String> remoteCmdSend(String code, String multiParam ); |
||||
|
|
||||
|
} |
@ -0,0 +1,68 @@ |
|||||
|
package org.dromara.sample.common.util; |
||||
|
|
||||
|
import org.slf4j.Logger; |
||||
|
import org.slf4j.LoggerFactory; |
||||
|
|
||||
|
import java.nio.charset.StandardCharsets; |
||||
|
import java.security.MessageDigest; |
||||
|
|
||||
|
/** |
||||
|
* Md5加密方法 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
*/ |
||||
|
public class Md5Utils |
||||
|
{ |
||||
|
private static final Logger log = LoggerFactory.getLogger(Md5Utils.class); |
||||
|
|
||||
|
private static byte[] md5(String s) |
||||
|
{ |
||||
|
MessageDigest algorithm; |
||||
|
try |
||||
|
{ |
||||
|
algorithm = MessageDigest.getInstance("MD5"); |
||||
|
algorithm.reset(); |
||||
|
algorithm.update(s.getBytes("UTF-8")); |
||||
|
byte[] messageDigest = algorithm.digest(); |
||||
|
return messageDigest; |
||||
|
} |
||||
|
catch (Exception e) |
||||
|
{ |
||||
|
log.error("MD5 Error...", e); |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
private static final String toHex(byte hash[]) |
||||
|
{ |
||||
|
if (hash == null) |
||||
|
{ |
||||
|
return null; |
||||
|
} |
||||
|
StringBuffer buf = new StringBuffer(hash.length * 2); |
||||
|
int i; |
||||
|
|
||||
|
for (i = 0; i < hash.length; i++) |
||||
|
{ |
||||
|
if ((hash[i] & 0xff) < 0x10) |
||||
|
{ |
||||
|
buf.append("0"); |
||||
|
} |
||||
|
buf.append(Long.toString(hash[i] & 0xff, 16)); |
||||
|
} |
||||
|
return buf.toString(); |
||||
|
} |
||||
|
|
||||
|
public static String hash(String s) |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
return new String(toHex(md5(s)).getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8); |
||||
|
} |
||||
|
catch (Exception e) |
||||
|
{ |
||||
|
log.error("not supported charset...{}", e); |
||||
|
return s; |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,87 @@ |
|||||
|
package org.dromara.sample.manage.controller; |
||||
|
|
||||
|
import com.alibaba.nacos.common.utils.CollectionUtils; |
||||
|
import com.fasterxml.jackson.databind.JsonNode; |
||||
|
import io.swagger.v3.oas.annotations.Operation; |
||||
|
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.dromara.common.satoken.utils.LoginHelper; |
||||
|
import org.dromara.common.sdk.common.HttpResultResponse; |
||||
|
import org.dromara.common.sdk.common.PaginationData; |
||||
|
import org.dromara.common.sdk.exception.CloudSDKErrorEnum; |
||||
|
import org.dromara.common.sdk.mqtt.property.PropertySetReplyResultEnum; |
||||
|
import org.dromara.sample.manage.model.dto.CallBackDTO; |
||||
|
import org.dromara.sample.manage.model.dto.DeviceDTO; |
||||
|
import org.dromara.sample.manage.model.dto.DeviceFirmwareUpgradeDTO; |
||||
|
import org.dromara.sample.manage.model.dto.EventsDTO; |
||||
|
import org.dromara.sample.manage.model.entity.WarningRecordEntity; |
||||
|
import org.dromara.sample.manage.service.IDeviceService; |
||||
|
import org.dromara.sample.manage.service.IEngineRecordService; |
||||
|
import org.dromara.sample.manage.service.IWarningRecordService; |
||||
|
import org.dromara.system.api.model.LoginUser; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.Optional; |
||||
|
|
||||
|
/** |
||||
|
* @author sean.zhou |
||||
|
* @version 0.1 |
||||
|
* @date 2021/11/15 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@Slf4j |
||||
|
@RequestMapping("${url.manage.prefix}${url.manage.version}/engineRecord") |
||||
|
@Tag(name = "无人机设备模块") |
||||
|
public class EngineRecordController { |
||||
|
|
||||
|
@Autowired |
||||
|
private IEngineRecordService engineRecordService; |
||||
|
@Autowired |
||||
|
private IWarningRecordService warningRecordService; |
||||
|
|
||||
|
/** |
||||
|
* 启动星罗引擎。 |
||||
|
* Get the topology list of all online devices in one workspace. |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/startEngine") |
||||
|
@Operation(summary = "启动星罗引擎。", description = "启动星罗引擎") |
||||
|
public HttpResultResponse<Map<String,Object>> startEngine(@RequestBody Map<String,Object> objectMap) { |
||||
|
return HttpResultResponse.success(engineRecordService.startEngine(objectMap)); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("/closeEngine") |
||||
|
@Operation(summary = "关闭星罗引擎。", description = "关闭星罗引擎") |
||||
|
public HttpResultResponse closeEngine(@RequestBody Map<String,Object> objectMap) { |
||||
|
engineRecordService.closeEngine(objectMap); |
||||
|
return HttpResultResponse.success(); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("/some") |
||||
|
@Operation(summary = "存储推流的预警(对外接口)。", description = "存储推流的预警(对外接口)。") |
||||
|
public void some(@RequestBody CallBackDTO callBackVo){ |
||||
|
WarningRecordEntity warningRecord = new WarningRecordEntity(); |
||||
|
List<WarningRecordEntity> list = new ArrayList<>(); |
||||
|
if (CollectionUtils.isNotEmpty(callBackVo.getEvents())){ |
||||
|
for (EventsDTO eventsVo :callBackVo.getEvents()){ |
||||
|
warningRecord.setTaskId(callBackVo.getTaskId()); |
||||
|
warningRecord.setAlgoId(eventsVo.getAlgoId()); |
||||
|
warningRecord.setEventId(eventsVo.getEventId()); |
||||
|
warningRecord.setExtraType(eventsVo.getExtraType()); |
||||
|
warningRecord.setPicUrl(eventsVo.getPicUrl()); |
||||
|
warningRecord.setTimestamp(eventsVo.getTimestamp()); |
||||
|
list.add(warningRecord); |
||||
|
} |
||||
|
warningRecordService.saveBatch(list); |
||||
|
System.out.println(callBackVo); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package org.dromara.sample.manage.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.dromara.sample.manage.model.entity.DeviceEntity; |
||||
|
import org.dromara.sample.manage.model.entity.EngineRecordEntity; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @author sean.zhou |
||||
|
* @date 2021/11/10 |
||||
|
* @version 0.1 |
||||
|
*/ |
||||
|
public interface IEngineRecordMapper extends BaseMapper<EngineRecordEntity> { |
||||
|
|
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package org.dromara.sample.manage.mapper; |
||||
|
|
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.dromara.sample.manage.model.entity.WarningRecordEntity; |
||||
|
|
||||
|
/** |
||||
|
* 设备对象-》用于存储设备Mapper接口 |
||||
|
* |
||||
|
* @author wuyuan |
||||
|
* @date 2022-10-25 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface WarningRecordMapper extends BaseMapper<WarningRecordEntity> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,30 @@ |
|||||
|
package org.dromara.sample.manage.model.dto; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.experimental.Accessors; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 设备对象-》用于存储设备对象 iot_device |
||||
|
* |
||||
|
* @author wuyuan |
||||
|
* @date 2022-10-25 |
||||
|
*/ |
||||
|
@TableName("iot_device") |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@Accessors(chain = true) |
||||
|
public class CallBackDTO implements Serializable { |
||||
|
//任务 id
|
||||
|
private String taskId; |
||||
|
|
||||
|
//检测事件列表
|
||||
|
private List<EventsDTO> events; |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
package org.dromara.sample.manage.model.dto; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Builder; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* The entity class of the device |
||||
|
* |
||||
|
* @author sean.zhou |
||||
|
* @version 0.1 |
||||
|
* @date 2021/11/10 |
||||
|
*/ |
||||
|
@Data |
||||
|
@Builder |
||||
|
@NoArgsConstructor |
||||
|
@AllArgsConstructor |
||||
|
public class Engine implements Serializable { |
||||
|
|
||||
|
|
||||
|
|
||||
|
private String task_id; |
||||
|
|
||||
|
private String mission_batch; |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
package org.dromara.sample.manage.model.dto; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Builder; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* The entity class of the device |
||||
|
* |
||||
|
* @author sean.zhou |
||||
|
* @version 0.1 |
||||
|
* @date 2021/11/10 |
||||
|
*/ |
||||
|
@Data |
||||
|
@Builder |
||||
|
@NoArgsConstructor |
||||
|
@AllArgsConstructor |
||||
|
public class EngineResponse implements Serializable { |
||||
|
|
||||
|
private Long code; |
||||
|
|
||||
|
private String message; |
||||
|
|
||||
|
private Engine data; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,45 @@ |
|||||
|
package org.dromara.sample.manage.model.dto; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.experimental.Accessors; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 设备对象-》用于存储设备对象 iot_device |
||||
|
* |
||||
|
* @author wuyuan |
||||
|
* @date 2022-10-25 |
||||
|
*/ |
||||
|
@TableName("iot_device") |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@Accessors(chain = true) |
||||
|
public class EventsDTO implements Serializable { |
||||
|
//算法 id")
|
||||
|
private Integer algoId; |
||||
|
|
||||
|
//算法类型字符串")
|
||||
|
private String extraType; |
||||
|
|
||||
|
|
||||
|
//分配的事件 id")
|
||||
|
private String eventId; |
||||
|
|
||||
|
|
||||
|
//保存后图片的 url")
|
||||
|
private String picUrl; |
||||
|
|
||||
|
|
||||
|
//事件时间戳,单位:毫秒")
|
||||
|
private Integer timestamp; |
||||
|
|
||||
|
//检测事件列表")
|
||||
|
private List<ObjectsDTO> objects; |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
package org.dromara.sample.manage.model.dto; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Builder; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* The entity class of the device |
||||
|
* |
||||
|
* @author sean.zhou |
||||
|
* @version 0.1 |
||||
|
* @date 2021/11/10 |
||||
|
*/ |
||||
|
@Data |
||||
|
@Builder |
||||
|
@NoArgsConstructor |
||||
|
@AllArgsConstructor |
||||
|
public class ExtraType implements Serializable { |
||||
|
|
||||
|
private Long id; |
||||
|
|
||||
|
private String sence; |
||||
|
|
||||
|
private String type; |
||||
|
|
||||
|
private String extra_type; |
||||
|
|
||||
|
private String model; |
||||
|
|
||||
|
private String user; |
||||
|
|
||||
|
private int difficult; |
||||
|
|
||||
|
private int if_open; |
||||
|
|
||||
|
private int sence_id; |
||||
|
|
||||
|
private Double conf; |
||||
|
|
||||
|
private int aiConfig; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
package org.dromara.sample.manage.model.dto; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Builder; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* The entity class of the device |
||||
|
* |
||||
|
* @author sean.zhou |
||||
|
* @version 0.1 |
||||
|
* @date 2021/11/10 |
||||
|
*/ |
||||
|
@Data |
||||
|
@Builder |
||||
|
@NoArgsConstructor |
||||
|
@AllArgsConstructor |
||||
|
public class ExtraTypeResponse implements Serializable { |
||||
|
|
||||
|
private Long code; |
||||
|
|
||||
|
private String message; |
||||
|
|
||||
|
private List<ExtraType> data; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,49 @@ |
|||||
|
package org.dromara.sample.manage.model.dto; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.experimental.Accessors; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 设备对象-》用于存储设备对象 iot_device |
||||
|
* |
||||
|
* @author wuyuan |
||||
|
* @date 2022-10-25 |
||||
|
*/ |
||||
|
@TableName("iot_device") |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@Accessors(chain = true) |
||||
|
public class ObjectsDTO implements Serializable { |
||||
|
//画面运动方向角度,-180度 到 180度")
|
||||
|
private String anglePx; |
||||
|
|
||||
|
//属性截图,base64编码")
|
||||
|
private String attrImage; |
||||
|
|
||||
|
//属性名称,车牌,人脸,或其他")
|
||||
|
private String attrName; |
||||
|
|
||||
|
//属性文字")
|
||||
|
private String attrText; |
||||
|
|
||||
|
//类别唯一ID")
|
||||
|
private String classId; |
||||
|
|
||||
|
//画面像素速度,单位(像素/秒)")
|
||||
|
private Integer speedPx; |
||||
|
|
||||
|
//追踪ID")
|
||||
|
private String trackId; |
||||
|
|
||||
|
//目标中心X")
|
||||
|
private Integer x; |
||||
|
|
||||
|
//目标中心Y")
|
||||
|
private Integer y; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
package org.dromara.sample.manage.model.dto; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonInclude; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author sean.zhou |
||||
|
* @version 0.1 |
||||
|
* @date 2021/11/23 |
||||
|
*/ |
||||
|
@Data |
||||
|
@JsonInclude(JsonInclude.Include.NON_NULL) |
||||
|
public class StreamTypeDTO { |
||||
|
private String jobId; |
||||
|
|
||||
|
private String jobName; |
||||
|
|
||||
|
private String labelCn; |
||||
|
|
||||
|
|
||||
|
private String labelEn; |
||||
|
|
||||
|
private Long deptId; |
||||
|
|
||||
|
private String deptName; |
||||
|
|
||||
|
private String deviceSn; |
||||
|
|
||||
|
private String lat; |
||||
|
|
||||
|
private String lng; |
||||
|
|
||||
|
private String images; |
||||
|
|
||||
|
} |
@ -0,0 +1,48 @@ |
|||||
|
package org.dromara.sample.manage.model.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Builder; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.time.LocalDateTime; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* The entity class of the EngineRecord |
||||
|
* |
||||
|
* @author sean.zhou |
||||
|
* @version 0.1 |
||||
|
* @date 2021/11/10 |
||||
|
*/ |
||||
|
@Data |
||||
|
@Builder |
||||
|
@NoArgsConstructor |
||||
|
@AllArgsConstructor |
||||
|
@TableName(value = "engine_record") |
||||
|
public class EngineRecordEntity implements Serializable { |
||||
|
|
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Integer id; |
||||
|
|
||||
|
@TableField(value = "device_sn") |
||||
|
private String deviceSn; |
||||
|
|
||||
|
@TableField(value = "extra_type") |
||||
|
private String extraType; |
||||
|
|
||||
|
@TableField(value = "task_id") |
||||
|
private String taskId; |
||||
|
|
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private Date createTime; |
||||
|
|
||||
|
@TableField(fill = FieldFill.INSERT_UPDATE) |
||||
|
private Date updateTime; |
||||
|
|
||||
|
@TableField(value = "push_url") |
||||
|
private String pushUrl; |
||||
|
|
||||
|
} |
@ -0,0 +1,55 @@ |
|||||
|
package org.dromara.sample.manage.model.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.experimental.Accessors; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 设备对象-》用于存储设备对象 iot_device |
||||
|
* |
||||
|
* @author wuyuan |
||||
|
* @date 2022-10-25 |
||||
|
*/ |
||||
|
@TableName("warning_record") |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@Accessors(chain = true) |
||||
|
public class WarningRecordEntity implements Serializable { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private String id; |
||||
|
|
||||
|
@TableField(value = "task_id") |
||||
|
private String taskId; |
||||
|
|
||||
|
@TableField(value = "algo_id") |
||||
|
//算法 id")
|
||||
|
private Integer algoId; |
||||
|
|
||||
|
@TableField(value = "extra_type") |
||||
|
//算法类型字符串")
|
||||
|
private String extraType; |
||||
|
|
||||
|
@TableField(value = "event_id") |
||||
|
//分配的事件 id")
|
||||
|
private String eventId; |
||||
|
|
||||
|
@TableField(value = "pic_url") |
||||
|
//保存后图片的 url")
|
||||
|
private String picUrl; |
||||
|
|
||||
|
@TableField(value = "timestamp") |
||||
|
//事件时间戳,单位:毫秒")
|
||||
|
private Integer timestamp; |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
package org.dromara.sample.manage.service; |
||||
|
|
||||
|
import com.fasterxml.jackson.core.JsonProcessingException; |
||||
|
import com.fasterxml.jackson.databind.JsonNode; |
||||
|
import org.dromara.common.sdk.cloudapi.device.ControlSourceEnum; |
||||
|
import org.dromara.common.sdk.cloudapi.device.DeviceOsdHost; |
||||
|
import org.dromara.common.sdk.cloudapi.device.DockModeCodeEnum; |
||||
|
import org.dromara.common.sdk.cloudapi.device.DroneModeCodeEnum; |
||||
|
import org.dromara.common.sdk.common.HttpResultResponse; |
||||
|
import org.dromara.common.sdk.common.PaginationData; |
||||
|
import org.dromara.common.sdk.config.version.GatewayManager; |
||||
|
import org.dromara.common.websocket.dto.BizCodeEnum; |
||||
|
import org.dromara.sample.manage.model.dto.DeviceDTO; |
||||
|
import org.dromara.sample.manage.model.dto.DeviceFirmwareUpgradeDTO; |
||||
|
import org.dromara.sample.manage.model.dto.TopologyDeviceDTO; |
||||
|
import org.dromara.sample.manage.model.param.DeviceQueryParam; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.Optional; |
||||
|
|
||||
|
/** |
||||
|
* @author sean.zhou |
||||
|
* @date 2021/11/10 |
||||
|
* @version 0.1 |
||||
|
*/ |
||||
|
public interface IEngineRecordService { |
||||
|
|
||||
|
Map<String,Object> startEngine(Map<String,Object> objectMap); |
||||
|
|
||||
|
void closeEngine(Map<String,Object> objectMap); |
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package org.dromara.sample.manage.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import org.dromara.sample.manage.model.entity.WarningRecordEntity; |
||||
|
|
||||
|
/** |
||||
|
* 设备对象-》用于存储设备Service接口 |
||||
|
* |
||||
|
* @author wuyuan |
||||
|
* @date 2022-10-25 |
||||
|
*/ |
||||
|
public interface IWarningRecordService extends IService<WarningRecordEntity>{ |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,246 @@ |
|||||
|
package org.dromara.sample.manage.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.fasterxml.jackson.core.JsonProcessingException; |
||||
|
import com.fasterxml.jackson.databind.JsonMappingException; |
||||
|
import com.fasterxml.jackson.databind.JsonNode; |
||||
|
import com.fasterxml.jackson.databind.ObjectMapper; |
||||
|
import io.seata.common.util.StringUtils; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.http.client.methods.CloseableHttpResponse; |
||||
|
import org.apache.http.client.methods.HttpGet; |
||||
|
import org.apache.http.client.methods.HttpPost; |
||||
|
import org.apache.http.client.utils.URIBuilder; |
||||
|
import org.apache.http.entity.StringEntity; |
||||
|
import org.apache.http.impl.client.CloseableHttpClient; |
||||
|
import org.apache.http.impl.client.HttpClients; |
||||
|
import org.apache.http.util.EntityUtils; |
||||
|
import org.dromara.common.sdk.cloudapi.device.*; |
||||
|
import org.dromara.common.sdk.cloudapi.firmware.*; |
||||
|
import org.dromara.common.sdk.cloudapi.firmware.api.AbstractFirmwareService; |
||||
|
import org.dromara.common.sdk.cloudapi.property.api.AbstractPropertyService; |
||||
|
import org.dromara.common.sdk.cloudapi.tsa.DeviceIconUrl; |
||||
|
import org.dromara.common.sdk.cloudapi.tsa.TopologyDeviceModel; |
||||
|
import org.dromara.common.sdk.common.*; |
||||
|
import org.dromara.common.sdk.config.version.GatewayManager; |
||||
|
import org.dromara.common.sdk.exception.CloudSDKException; |
||||
|
import org.dromara.common.sdk.mqtt.IMqttTopicService; |
||||
|
import org.dromara.common.sdk.mqtt.MqttGatewayPublish; |
||||
|
import org.dromara.common.sdk.mqtt.events.EventsSubscribe; |
||||
|
import org.dromara.common.sdk.mqtt.osd.OsdSubscribe; |
||||
|
import org.dromara.common.sdk.mqtt.property.PropertySetReplyResultEnum; |
||||
|
import org.dromara.common.sdk.mqtt.property.PropertySetSubscribe; |
||||
|
import org.dromara.common.sdk.mqtt.requests.RequestsSubscribe; |
||||
|
import org.dromara.common.sdk.mqtt.services.ServicesReplyData; |
||||
|
import org.dromara.common.sdk.mqtt.services.ServicesSubscribe; |
||||
|
import org.dromara.common.sdk.mqtt.services.TopicServicesResponse; |
||||
|
import org.dromara.common.sdk.mqtt.state.StateSubscribe; |
||||
|
import org.dromara.common.sdk.mqtt.status.StatusSubscribe; |
||||
|
import org.dromara.common.websocket.dto.BizCodeEnum; |
||||
|
import org.dromara.sample.common.error.CommonErrorEnum; |
||||
|
import org.dromara.sample.common.util.Md5Utils; |
||||
|
import org.dromara.sample.component.mqtt.model.EventsReceiver; |
||||
|
import org.dromara.sample.control.model.enums.DroneAuthorityEnum; |
||||
|
import org.dromara.sample.manage.mapper.IDeviceMapper; |
||||
|
import org.dromara.sample.manage.mapper.IDeviceProMapper; |
||||
|
import org.dromara.sample.manage.mapper.IEngineRecordMapper; |
||||
|
import org.dromara.sample.manage.model.dto.*; |
||||
|
import org.dromara.sample.manage.model.entity.DeviceEntity; |
||||
|
import org.dromara.sample.manage.model.entity.DeviceProEntity; |
||||
|
import org.dromara.sample.manage.model.entity.EngineRecordEntity; |
||||
|
import org.dromara.sample.manage.model.enums.DeviceFirmwareStatusEnum; |
||||
|
import org.dromara.sample.manage.model.enums.PropertySetFieldEnum; |
||||
|
import org.dromara.sample.manage.model.enums.UserTypeEnum; |
||||
|
import org.dromara.sample.manage.model.param.DeviceQueryParam; |
||||
|
import org.dromara.sample.manage.model.receiver.BasicDeviceProperty; |
||||
|
import org.dromara.sample.manage.service.*; |
||||
|
import org.dromara.sample.websocket.service.IWebSocketMessageService; |
||||
|
import org.json.JSONObject; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
import org.springframework.util.CollectionUtils; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.net.URI; |
||||
|
import java.net.URISyntaxException; |
||||
|
import java.time.LocalDateTime; |
||||
|
import java.util.*; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
import static org.apache.commons.compress.utils.ArchiveUtils.sanitize; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @author sean.zhou |
||||
|
* @version 0.1 |
||||
|
* @date 2021/11/10 |
||||
|
*/ |
||||
|
@Service |
||||
|
@Slf4j |
||||
|
@Transactional |
||||
|
public class EngineRecordServiceImpl implements IEngineRecordService { |
||||
|
@Resource |
||||
|
IEngineRecordMapper mapper; |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public Map<String, Object> startEngine(Map<String, Object> objectMap){ |
||||
|
EngineRecordEntity record = new EngineRecordEntity(); |
||||
|
//获取token
|
||||
|
//设置请求Header和Body(如JSON)
|
||||
|
String md5 = Md5Utils.hash("xuzhou_ai"); |
||||
|
JSONObject jsonObj = new JSONObject(); |
||||
|
jsonObj.put("username", sanitize("xuzhou_ai")); // sanitize函数见下文
|
||||
|
jsonObj.put("password", sanitize(md5)); |
||||
|
String responseBody = PostRequest(jsonObj, "http://60.204.247.65:8100/Third/Login"); |
||||
|
JSONObject jsonObject = new JSONObject(responseBody); |
||||
|
// 逐层获取 data -> token
|
||||
|
JSONObject data = jsonObject.getJSONObject("data"); |
||||
|
String token = data.getString("token"); |
||||
|
String sceneResponseBody = null; |
||||
|
String algorithmResponseBody = null; |
||||
|
//查询用户开通的场景
|
||||
|
if (StringUtils.isNotEmpty(token)){ |
||||
|
try { |
||||
|
URI uri = new URIBuilder("http://60.204.247.65:8100/V2/AI/WX/User/Scene") |
||||
|
.build(); |
||||
|
sceneResponseBody = GetRequest(uri, token); |
||||
|
} catch (URISyntaxException e) { |
||||
|
throw new RuntimeException(e); |
||||
|
} |
||||
|
JSONObject jsonObject1 = new JSONObject(sceneResponseBody); |
||||
|
// 逐层获取 data -> token
|
||||
|
JSONObject data1 = jsonObject.getJSONObject("data"); |
||||
|
String scene = data1.getString("scene"); |
||||
|
|
||||
|
//查询场景算法
|
||||
|
List<String> extra_type_list = new ArrayList<>(); |
||||
|
try { |
||||
|
URI uri = new URIBuilder("http://60.204.247.65:8100/V2/AI/WX/User/ExtraType/Get") |
||||
|
.addParameter("scene",scene) |
||||
|
.addParameter("if_open","1") |
||||
|
.build(); |
||||
|
algorithmResponseBody = GetRequest(uri, token); |
||||
|
ObjectMapper mapper = new ObjectMapper(); |
||||
|
ExtraTypeResponse response = mapper.readValue(algorithmResponseBody,ExtraTypeResponse.class); |
||||
|
List<ExtraType> list = response.getData(); |
||||
|
for (ExtraType extraType : list) { |
||||
|
extra_type_list.add(extraType.getExtra_type()); |
||||
|
break; |
||||
|
} |
||||
|
} catch (URISyntaxException | JsonProcessingException e) { |
||||
|
throw new RuntimeException(e); |
||||
|
} |
||||
|
|
||||
|
JSONObject jsonObj2 = new JSONObject(); |
||||
|
jsonObj2.put("scene", scene); // sanitize函数见下文
|
||||
|
jsonObj2.put("callback_url", objectMap.get("callback_url")); |
||||
|
jsonObj2.put("input_url", objectMap.get("input_url")); |
||||
|
jsonObj2.put("push_url", objectMap.get("push_url")); |
||||
|
jsonObj2.put("play_url", objectMap.get("play_url")); |
||||
|
String responseBody2 = PostRequest(jsonObj2, "http://60.204.247.65:8100/Third/Engine/Start"); |
||||
|
ObjectMapper mapper1 = new ObjectMapper(); |
||||
|
EngineResponse response = null; |
||||
|
try { |
||||
|
response = mapper1.readValue(responseBody2, EngineResponse.class); |
||||
|
} catch (JsonProcessingException e) { |
||||
|
throw new RuntimeException(e); |
||||
|
} |
||||
|
objectMap.put("task_id",response.getData().getTask_id()); |
||||
|
record.setPushUrl(objectMap.get("push_url").toString()); |
||||
|
record.setDeviceSn(objectMap.get("device_sn").toString()); |
||||
|
record.setTaskId(response.getData().getTask_id()); |
||||
|
record.setExtraType(String.join(",", extra_type_list)); |
||||
|
} |
||||
|
Map<String, Object> map = new HashMap(); |
||||
|
map.put("callback_url", objectMap.get("callback_url")); |
||||
|
map.put("input_url", objectMap.get("input_url")); |
||||
|
map.put("push_url", objectMap.get("push_url")); |
||||
|
map.put("play_url", objectMap.get("play_url")); |
||||
|
map.put("task_id", objectMap.get("task_id")); |
||||
|
//添加启动引擎记录
|
||||
|
mapper.insert(record); |
||||
|
return map; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void closeEngine(Map<String, Object> objectMap) { |
||||
|
JSONObject jsonObj2 = new JSONObject(); |
||||
|
EngineRecordEntity record = mapper.selectOne(new LambdaQueryWrapper<EngineRecordEntity>().eq(EngineRecordEntity::getDeviceSn, objectMap.get("device_sn"))); |
||||
|
if (record == null){ |
||||
|
throw new RuntimeException("关闭引擎失败!"); |
||||
|
} |
||||
|
jsonObj2.put("task_id", record.getTaskId()); // sanitize函数见下文
|
||||
|
String responseBody2 = PostRequest(jsonObj2, "http://60.204.247.65:8100/Third/Engine/Stop"); |
||||
|
JSONObject json = new JSONObject(responseBody2); |
||||
|
// 方式2:安全获取(先判空再转换)
|
||||
|
Object dataObj = json.get("data"); |
||||
|
if(dataObj != null && dataObj instanceof Integer) { |
||||
|
int data = (Integer) dataObj; |
||||
|
if (data ==1){ |
||||
|
mapper.delete(new LambdaQueryWrapper<EngineRecordEntity>().eq(EngineRecordEntity::getDeviceSn, objectMap.get("device_sn"))); |
||||
|
}else { |
||||
|
throw new RuntimeException("关闭引擎失败!"); |
||||
|
} |
||||
|
} else { |
||||
|
throw new RuntimeException("关闭引擎失败!"); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
public String PostRequest( JSONObject jsonObj, String url |
||||
|
) { |
||||
|
try (CloseableHttpClient httpClient = HttpClients.createDefault()) { |
||||
|
// 1. 创建POST请求对象
|
||||
|
HttpPost post = new HttpPost(url); |
||||
|
StringEntity requestEntity = new StringEntity(jsonObj.toString(), "UTF-8"); |
||||
|
requestEntity.setContentType("application/json"); |
||||
|
post.setEntity(requestEntity); |
||||
|
post.setHeader("Accept", "application/json"); |
||||
|
// 3. 执行请求并获取响应
|
||||
|
try (CloseableHttpResponse response = httpClient.execute(post)) { |
||||
|
String responseBody = EntityUtils.toString(response.getEntity()); |
||||
|
if (response.getStatusLine().getStatusCode() == 200) { |
||||
|
return responseBody; |
||||
|
} else { |
||||
|
throw new RuntimeException("第三方接口调用失败!"); |
||||
|
} |
||||
|
} |
||||
|
} catch (Exception e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
return null; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String GetRequest(URI uri, String token |
||||
|
) { |
||||
|
try (CloseableHttpClient httpClient = HttpClients.createDefault()) { |
||||
|
// URI uri = new URIBuilder("https://api.example.com/data")
|
||||
|
// .addParameter("param1", "value1")
|
||||
|
// .addParameter("param2", "value2")
|
||||
|
// .build();
|
||||
|
HttpGet httpGet = new HttpGet(uri); |
||||
|
httpGet.setHeader("token",token); |
||||
|
try (CloseableHttpResponse response = httpClient.execute(httpGet)) { |
||||
|
// 处理响应
|
||||
|
String responseBody = EntityUtils.toString(response.getEntity()); |
||||
|
if (response.getStatusLine().getStatusCode() == 200){ |
||||
|
return responseBody; |
||||
|
}else { |
||||
|
throw new RuntimeException("第三方接口调用失败!"); |
||||
|
} |
||||
|
} |
||||
|
} catch (Exception e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
return null; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package org.dromara.sample.manage.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.dromara.sample.manage.mapper.WarningRecordMapper; |
||||
|
import org.dromara.sample.manage.model.entity.WarningRecordEntity; |
||||
|
import org.dromara.sample.manage.service.IWarningRecordService; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* 设备对象-》用于存储设备Service业务层处理 |
||||
|
* |
||||
|
* @author wuyuan |
||||
|
* @date 2022-10-25 |
||||
|
*/ |
||||
|
@Service |
||||
|
@Slf4j |
||||
|
public class WarningRecordServiceImpl extends ServiceImpl<WarningRecordMapper, WarningRecordEntity> implements IWarningRecordService { |
||||
|
|
||||
|
} |
@ -0,0 +1,211 @@ |
|||||
|
package org.dromara.sample.storage.domain; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
import org.apache.commons.lang3.builder.ToStringStyle; |
||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity; |
||||
|
|
||||
|
/** |
||||
|
* 系统上传文件对象 sys_upload_file |
||||
|
* |
||||
|
* @author tom |
||||
|
* @date 2024-12-21 |
||||
|
*/ |
||||
|
@TableName("sys_upload_file") |
||||
|
public class SysUploadFile extends BaseEntity |
||||
|
{ |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** ID */ |
||||
|
@TableId(value="id",type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
/** 删除标记 */ |
||||
|
@TableField("del_flag") |
||||
|
private Long delFlag; |
||||
|
|
||||
|
/** 文件名称 */ |
||||
|
@TableField("name") |
||||
|
private String name; |
||||
|
|
||||
|
/** 上传时文件名 */ |
||||
|
@TableField("file_name") |
||||
|
private String fileName; |
||||
|
|
||||
|
/** 物理路径 */ |
||||
|
@TableField("path") |
||||
|
private String path; |
||||
|
|
||||
|
/** 文件URL */ |
||||
|
@TableField("url") |
||||
|
private String url; |
||||
|
|
||||
|
/** 文件扩展名 */ |
||||
|
@TableField("extend") |
||||
|
private String extend; |
||||
|
|
||||
|
/** 文件类型 */ |
||||
|
@TableField("dict_file_type") |
||||
|
private Long dictFileType; |
||||
|
|
||||
|
/** 关联对象ID */ |
||||
|
@TableField("object_id") |
||||
|
private Long objectId; |
||||
|
|
||||
|
/** 关联对象类型 */ |
||||
|
@TableField("object_type") |
||||
|
private String objectType; |
||||
|
|
||||
|
/** 关联对象ID */ |
||||
|
@TableField("object_link_id") |
||||
|
private String objectLinkId; |
||||
|
|
||||
|
/** 排序 */ |
||||
|
@TableField("sort") |
||||
|
private Long sort; |
||||
|
|
||||
|
/** 标签 */ |
||||
|
@TableField("tags") |
||||
|
private String tags; |
||||
|
|
||||
|
public void setId(Long id) |
||||
|
{ |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public Long getId() |
||||
|
{ |
||||
|
return id; |
||||
|
} |
||||
|
public void setDelFlag(Long delFlag) |
||||
|
{ |
||||
|
this.delFlag = delFlag; |
||||
|
} |
||||
|
|
||||
|
public Long getDelFlag() |
||||
|
{ |
||||
|
return delFlag; |
||||
|
} |
||||
|
public void setName(String name) |
||||
|
{ |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public String getName() |
||||
|
{ |
||||
|
return name; |
||||
|
} |
||||
|
public void setFileName(String fileName) |
||||
|
{ |
||||
|
this.fileName = fileName; |
||||
|
} |
||||
|
|
||||
|
public String getFileName() |
||||
|
{ |
||||
|
return fileName; |
||||
|
} |
||||
|
public void setPath(String path) |
||||
|
{ |
||||
|
this.path = path; |
||||
|
} |
||||
|
|
||||
|
public String getPath() |
||||
|
{ |
||||
|
return path; |
||||
|
} |
||||
|
public void setUrl(String url) |
||||
|
{ |
||||
|
this.url = url; |
||||
|
} |
||||
|
|
||||
|
public String getUrl() |
||||
|
{ |
||||
|
return url; |
||||
|
} |
||||
|
public void setExtend(String extend) |
||||
|
{ |
||||
|
this.extend = extend; |
||||
|
} |
||||
|
|
||||
|
public String getExtend() |
||||
|
{ |
||||
|
return extend; |
||||
|
} |
||||
|
public void setDictFileType(Long dictFileType) |
||||
|
{ |
||||
|
this.dictFileType = dictFileType; |
||||
|
} |
||||
|
|
||||
|
public Long getDictFileType() |
||||
|
{ |
||||
|
return dictFileType; |
||||
|
} |
||||
|
public void setObjectId(Long objectId) |
||||
|
{ |
||||
|
this.objectId = objectId; |
||||
|
} |
||||
|
|
||||
|
public Long getObjectId() |
||||
|
{ |
||||
|
return objectId; |
||||
|
} |
||||
|
public void setObjectType(String objectType) |
||||
|
{ |
||||
|
this.objectType = objectType; |
||||
|
} |
||||
|
|
||||
|
public String getObjectType() |
||||
|
{ |
||||
|
return objectType; |
||||
|
} |
||||
|
|
||||
|
public String getObjectLinkId() { |
||||
|
return objectLinkId; |
||||
|
} |
||||
|
|
||||
|
public void setObjectLinkId(String objectLinkId) { |
||||
|
this.objectLinkId = objectLinkId; |
||||
|
} |
||||
|
|
||||
|
public void setSort(Long sort) |
||||
|
{ |
||||
|
this.sort = sort; |
||||
|
} |
||||
|
|
||||
|
public Long getSort() |
||||
|
{ |
||||
|
return sort; |
||||
|
} |
||||
|
|
||||
|
public String getTags() { |
||||
|
return tags; |
||||
|
} |
||||
|
|
||||
|
public void setTags(String tags) { |
||||
|
this.tags = tags; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
||||
|
.append("id", getId()) |
||||
|
.append("createBy", getCreateBy()) |
||||
|
.append("createTime", getCreateTime()) |
||||
|
.append("updateBy", getUpdateBy()) |
||||
|
.append("updateTime", getUpdateTime()) |
||||
|
.append("delFlag", getDelFlag()) |
||||
|
.append("name", getName()) |
||||
|
.append("fileName", getFileName()) |
||||
|
.append("path", getPath()) |
||||
|
.append("url", getUrl()) |
||||
|
.append("extend", getExtend()) |
||||
|
.append("dictFileType", getDictFileType()) |
||||
|
.append("objectId", getObjectId()) |
||||
|
.append("objectType", getObjectType()) |
||||
|
.append("sort", getSort()) |
||||
|
.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,106 @@ |
|||||
|
package org.dromara.system.controller; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import jakarta.servlet.http.HttpServletResponse; |
||||
|
import jakarta.validation.constraints.*; |
||||
|
import cn.dev33.satoken.annotation.SaCheckPermission; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit; |
||||
|
import org.dromara.common.log.annotation.Log; |
||||
|
import org.dromara.common.web.core.BaseController; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import org.dromara.common.core.domain.R; |
||||
|
import org.dromara.common.core.validate.AddGroup; |
||||
|
import org.dromara.common.core.validate.EditGroup; |
||||
|
import org.dromara.common.log.enums.BusinessType; |
||||
|
import org.dromara.common.excel.utils.ExcelUtil; |
||||
|
import org.dromara.system.domain.vo.SysSubmailConfigUserVo; |
||||
|
import org.dromara.system.domain.bo.SysSubmailConfigUserBo; |
||||
|
import org.dromara.system.service.ISysSubmailConfigUserService; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务配置用户 |
||||
|
* 前端访问路由地址为:/system/sysSubmailConfigUser |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
@Validated |
||||
|
@RequiredArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("/sysSubmailConfigUser") |
||||
|
public class SysSubmailConfigUserController extends BaseController { |
||||
|
|
||||
|
private final ISysSubmailConfigUserService sysSubmailConfigUserService; |
||||
|
|
||||
|
/** |
||||
|
* 查询赛邮服务配置用户列表 |
||||
|
*/ |
||||
|
@SaCheckPermission("system:sysSubmailConfigUser:list") |
||||
|
@GetMapping("/list") |
||||
|
public TableDataInfo<SysSubmailConfigUserVo> list(SysSubmailConfigUserBo bo, PageQuery pageQuery) { |
||||
|
return sysSubmailConfigUserService.queryPageList(bo, pageQuery); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 导出赛邮服务配置用户列表 |
||||
|
*/ |
||||
|
@SaCheckPermission("system:sysSubmailConfigUser:export") |
||||
|
@Log(title = "赛邮服务配置用户", businessType = BusinessType.EXPORT) |
||||
|
@PostMapping("/export") |
||||
|
public void export(SysSubmailConfigUserBo bo, HttpServletResponse response) { |
||||
|
List<SysSubmailConfigUserVo> list = sysSubmailConfigUserService.queryList(bo); |
||||
|
ExcelUtil.exportExcel(list, "赛邮服务配置用户", SysSubmailConfigUserVo.class, response); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取赛邮服务配置用户详细信息 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
*/ |
||||
|
@SaCheckPermission("system:sysSubmailConfigUser:query") |
||||
|
@GetMapping("/{id}") |
||||
|
public R<SysSubmailConfigUserVo> getInfo(@NotNull(message = "主键不能为空") |
||||
|
@PathVariable Long id) { |
||||
|
return R.ok(sysSubmailConfigUserService.queryById(id)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增赛邮服务配置用户 |
||||
|
*/ |
||||
|
@SaCheckPermission("system:sysSubmailConfigUser:add") |
||||
|
@Log(title = "赛邮服务配置用户", businessType = BusinessType.INSERT) |
||||
|
@RepeatSubmit() |
||||
|
@PostMapping() |
||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysSubmailConfigUserBo bo) { |
||||
|
return toAjax(sysSubmailConfigUserService.insertByBo(bo)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改赛邮服务配置用户 |
||||
|
*/ |
||||
|
@SaCheckPermission("system:sysSubmailConfigUser:edit") |
||||
|
@Log(title = "赛邮服务配置用户", businessType = BusinessType.UPDATE) |
||||
|
@RepeatSubmit() |
||||
|
@PutMapping() |
||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysSubmailConfigUserBo bo) { |
||||
|
return toAjax(sysSubmailConfigUserService.updateByBo(bo)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除赛邮服务配置用户 |
||||
|
* |
||||
|
* @param ids 主键串 |
||||
|
*/ |
||||
|
@SaCheckPermission("system:sysSubmailConfigUser:remove") |
||||
|
@Log(title = "赛邮服务配置用户", businessType = BusinessType.DELETE) |
||||
|
@DeleteMapping("/{ids}") |
||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
||||
|
@PathVariable Long[] ids) { |
||||
|
return toAjax(sysSubmailConfigUserService.deleteWithValidByIds(List.of(ids), true)); |
||||
|
} |
||||
|
} |
@ -0,0 +1,217 @@ |
|||||
|
package org.dromara.system.controller.system; |
||||
|
|
||||
|
import java.nio.file.CopyOption; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import cn.hutool.core.bean.copier.CopyOptions; |
||||
|
import cn.hutool.core.util.BooleanUtil; |
||||
|
import cn.hutool.core.util.StrUtil; |
||||
|
import cn.hutool.http.HttpRequest; |
||||
|
import cn.hutool.http.HttpUtil; |
||||
|
import cn.hutool.json.JSONArray; |
||||
|
import cn.hutool.json.JSONObject; |
||||
|
import cn.hutool.json.JSONUtil; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import jakarta.servlet.http.HttpServletResponse; |
||||
|
import jakarta.validation.constraints.*; |
||||
|
import cn.dev33.satoken.annotation.SaCheckPermission; |
||||
|
import org.dromara.common.core.utils.SpringUtils; |
||||
|
import org.dromara.system.domain.SysSubmailConfigUser; |
||||
|
import org.dromara.system.domain.SysSubmailLog; |
||||
|
import org.dromara.system.domain.SysUser; |
||||
|
import org.dromara.system.domain.bo.SysSubmailConfigUserBo; |
||||
|
import org.dromara.system.domain.bo.SysSubmailLogBo; |
||||
|
import org.dromara.system.domain.vo.SysSubmailConfigUserVo; |
||||
|
import org.dromara.system.service.ISysConfigService; |
||||
|
import org.dromara.system.service.ISysSubmailConfigUserService; |
||||
|
import org.dromara.system.service.ISysSubmailLogService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit; |
||||
|
import org.dromara.common.log.annotation.Log; |
||||
|
import org.dromara.common.web.core.BaseController; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import org.dromara.common.core.domain.R; |
||||
|
import org.dromara.common.core.validate.AddGroup; |
||||
|
import org.dromara.common.core.validate.EditGroup; |
||||
|
import org.dromara.common.log.enums.BusinessType; |
||||
|
import org.dromara.common.excel.utils.ExcelUtil; |
||||
|
import org.dromara.system.domain.vo.SysSubmailConfigVo; |
||||
|
import org.dromara.system.domain.bo.SysSubmailConfigBo; |
||||
|
import org.dromara.system.service.ISysSubmailConfigService; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务配置 |
||||
|
* 前端访问路由地址为:/system/sysSubmailConfig |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
@Validated |
||||
|
@RequiredArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("/submailConfig") |
||||
|
public class SysSubmailConfigController extends BaseController { |
||||
|
|
||||
|
private final ISysSubmailConfigService sysSubmailConfigService; |
||||
|
|
||||
|
@Autowired |
||||
|
private ISysSubmailConfigUserService sysSubmailConfigUserService; |
||||
|
|
||||
|
/** |
||||
|
* 查询赛邮服务配置列表 |
||||
|
*/ |
||||
|
@SaCheckPermission("system:sysSubmailConfig:list") |
||||
|
@GetMapping("/list") |
||||
|
public TableDataInfo<SysSubmailConfigVo> list(SysSubmailConfigBo bo, PageQuery pageQuery) { |
||||
|
TableDataInfo<SysSubmailConfigVo> sysSubmailConfigVoTableDataInfo = sysSubmailConfigService.queryPageList(bo, pageQuery); |
||||
|
List<SysSubmailConfigVo> rows = sysSubmailConfigVoTableDataInfo.getRows(); |
||||
|
List<Long> configIds = rows.stream().map(SysSubmailConfigVo::getId).toList(); |
||||
|
|
||||
|
List<SysSubmailConfigUserVo> sysSubmailConfigUserVoList = sysSubmailConfigUserService.selectConfigUserByConfigIds(configIds); |
||||
|
for (SysSubmailConfigVo configVo : rows) { |
||||
|
List<SysSubmailConfigUserVo> collect = sysSubmailConfigUserVoList.stream().filter(item -> item.getSubmailConfigId().equals(configVo.getId())).collect(Collectors.toList()); |
||||
|
configVo.setConfigUserList(collect); |
||||
|
} |
||||
|
return sysSubmailConfigVoTableDataInfo; |
||||
|
} |
||||
|
|
||||
|
@SaCheckPermission("system:sysSubmailConfig:list") |
||||
|
@GetMapping("/listAll") |
||||
|
public List<SysSubmailConfigVo> listAll(SysSubmailConfigBo bo) { |
||||
|
return sysSubmailConfigService.queryList(bo); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 导出赛邮服务配置列表 |
||||
|
*/ |
||||
|
@SaCheckPermission("system:sysSubmailConfig:export") |
||||
|
@Log(title = "赛邮服务配置", businessType = BusinessType.EXPORT) |
||||
|
@PostMapping("/export") |
||||
|
public void export(SysSubmailConfigBo bo, HttpServletResponse response) { |
||||
|
List<SysSubmailConfigVo> list = sysSubmailConfigService.queryList(bo); |
||||
|
ExcelUtil.exportExcel(list, "赛邮服务配置", SysSubmailConfigVo.class, response); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取赛邮服务配置详细信息 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
*/ |
||||
|
@SaCheckPermission("system:sysSubmailConfig:query") |
||||
|
@GetMapping("/{id}") |
||||
|
public R<SysSubmailConfigVo> getInfo(@NotNull(message = "主键不能为空") |
||||
|
@PathVariable Long id) { |
||||
|
return R.ok(sysSubmailConfigService.queryById(id)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增赛邮服务配置 |
||||
|
*/ |
||||
|
@SaCheckPermission("system:sysSubmailConfig:add") |
||||
|
@Log(title = "赛邮服务配置", businessType = BusinessType.INSERT) |
||||
|
@RepeatSubmit() |
||||
|
@PostMapping() |
||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysSubmailConfigBo bo) { |
||||
|
return toAjax(sysSubmailConfigService.insertByBo(bo)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改赛邮服务配置 |
||||
|
*/ |
||||
|
@SaCheckPermission("system:sysSubmailConfig:edit") |
||||
|
@Log(title = "赛邮服务配置", businessType = BusinessType.UPDATE) |
||||
|
@RepeatSubmit() |
||||
|
@PutMapping() |
||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysSubmailConfigBo bo) { |
||||
|
return toAjax(sysSubmailConfigService.updateByBo(bo)); |
||||
|
} |
||||
|
|
||||
|
//配置
|
||||
|
@SaCheckPermission("system:sysSubmailConfig:edit") |
||||
|
@Log(title = "配置赛邮服务配置用户", businessType = BusinessType.UPDATE) |
||||
|
@RepeatSubmit() |
||||
|
@PutMapping("/configUser") |
||||
|
public R<Void> configUser(@Validated(EditGroup.class) @RequestBody SysSubmailConfigBo bo) { |
||||
|
|
||||
|
//删除旧配置
|
||||
|
SysSubmailConfigUserBo userBo = new SysSubmailConfigUserBo(); |
||||
|
userBo.setSubmailConfigId(bo.getId()); |
||||
|
List<SysSubmailConfigUserVo> sysSubmailConfigUserVoList = sysSubmailConfigUserService.queryList(userBo); |
||||
|
List<Long> configUserIds = sysSubmailConfigUserVoList.stream().map(SysSubmailConfigUserVo::getId).toList(); |
||||
|
sysSubmailConfigUserService.deleteWithValidByIds(configUserIds,true); |
||||
|
|
||||
|
//保留新配置
|
||||
|
for (SysUser sysUser : bo.getConfigUserList()) { |
||||
|
SysSubmailConfigUserBo sysSubmailConfigUser = new SysSubmailConfigUserBo(); |
||||
|
sysSubmailConfigUser.setSubmailConfigId(bo.getId()); |
||||
|
sysSubmailConfigUser.setUserId(sysUser.getUserId()); |
||||
|
sysSubmailConfigUser.setName(sysUser.getNickName()); |
||||
|
sysSubmailConfigUser.setPhonenumber(sysUser.getPhonenumber()); |
||||
|
sysSubmailConfigUserService.insertByBo(sysSubmailConfigUser); |
||||
|
} |
||||
|
|
||||
|
return toAjax(1); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除赛邮服务配置 |
||||
|
* |
||||
|
* @param ids 主键串 |
||||
|
*/ |
||||
|
@SaCheckPermission("system:sysSubmailConfig:remove") |
||||
|
@Log(title = "赛邮服务配置", businessType = BusinessType.DELETE) |
||||
|
@DeleteMapping("/{ids}") |
||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
||||
|
@PathVariable Long[] ids) { |
||||
|
return toAjax(sysSubmailConfigService.deleteWithValidByIds(List.of(ids), true)); |
||||
|
} |
||||
|
|
||||
|
//发送测试
|
||||
|
|
||||
|
@Autowired |
||||
|
private ISysSubmailLogService sysSubmailLogService; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param code 必须传参:smsMultixsend |
||||
|
* @param multiParam 前台传参 JSON.stringfy( {"jobName":"翟山街道华盛","labelCn":"普通垃圾","labelEn":"garbage","deptName":"翟山街道","lat":"34.20994348014929","lng":"117.2054671683176"}) |
||||
|
* @return |
||||
|
*/ |
||||
|
@RepeatSubmit() |
||||
|
@PostMapping("/cmdSend") |
||||
|
public R<String> cmdSend(@RequestParam("code") String code, @RequestParam("multiParam") String multiParam) { |
||||
|
if(StrUtil.isBlank(code)){ |
||||
|
return R.fail("发送类型为空"); |
||||
|
} |
||||
|
return sysSubmailConfigService.cmdSend(code, multiParam); |
||||
|
} |
||||
|
|
||||
|
//发送测试
|
||||
|
@RepeatSubmit() |
||||
|
@PostMapping("/autoSend") |
||||
|
public R<String> autoSend(@Validated(AddGroup.class) @RequestBody SysSubmailConfigBo bo) { |
||||
|
|
||||
|
//判断是否配置用户
|
||||
|
SysSubmailConfigUserBo mailUserQuery = new SysSubmailConfigUserBo(); |
||||
|
mailUserQuery.setSubmailConfigId(bo.getId()); |
||||
|
List<SysSubmailConfigUserVo> sysSubmailConfigUserVoList = sysSubmailConfigUserService.queryList(mailUserQuery); |
||||
|
List<SysSubmailConfigUserVo> configUserVoList = sysSubmailConfigUserVoList.stream().filter(item -> StrUtil.isNotBlank(item.getPhonenumber())).collect(Collectors.toList()); |
||||
|
if(configUserVoList.size() <= 0) { |
||||
|
return R.fail("暂无配置有效用户"); |
||||
|
} |
||||
|
|
||||
|
String result = sysSubmailConfigService.submailSendUtil(bo, configUserVoList); |
||||
|
|
||||
|
return R.ok(result); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,106 @@ |
|||||
|
package org.dromara.system.controller.system; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import jakarta.servlet.http.HttpServletResponse; |
||||
|
import jakarta.validation.constraints.*; |
||||
|
import cn.dev33.satoken.annotation.SaCheckPermission; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit; |
||||
|
import org.dromara.common.log.annotation.Log; |
||||
|
import org.dromara.common.web.core.BaseController; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import org.dromara.common.core.domain.R; |
||||
|
import org.dromara.common.core.validate.AddGroup; |
||||
|
import org.dromara.common.core.validate.EditGroup; |
||||
|
import org.dromara.common.log.enums.BusinessType; |
||||
|
import org.dromara.common.excel.utils.ExcelUtil; |
||||
|
import org.dromara.system.domain.vo.SysSubmailLogVo; |
||||
|
import org.dromara.system.domain.bo.SysSubmailLogBo; |
||||
|
import org.dromara.system.service.ISysSubmailLogService; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务发送log |
||||
|
* 前端访问路由地址为:/system/sysSubmailLog |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
@Validated |
||||
|
@RequiredArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("/submailLog") |
||||
|
public class SysSubmailLogController extends BaseController { |
||||
|
|
||||
|
private final ISysSubmailLogService sysSubmailLogService; |
||||
|
|
||||
|
/** |
||||
|
* 查询赛邮服务发送log列表 |
||||
|
*/ |
||||
|
@SaCheckPermission("system:sysSubmailLog:list") |
||||
|
@GetMapping("/list") |
||||
|
public TableDataInfo<SysSubmailLogVo> list(SysSubmailLogBo bo, PageQuery pageQuery) { |
||||
|
return sysSubmailLogService.queryPageList(bo, pageQuery); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 导出赛邮服务发送log列表 |
||||
|
*/ |
||||
|
@SaCheckPermission("system:sysSubmailLog:export") |
||||
|
@Log(title = "赛邮服务发送log", businessType = BusinessType.EXPORT) |
||||
|
@PostMapping("/export") |
||||
|
public void export(SysSubmailLogBo bo, HttpServletResponse response) { |
||||
|
List<SysSubmailLogVo> list = sysSubmailLogService.queryList(bo); |
||||
|
ExcelUtil.exportExcel(list, "赛邮服务发送log", SysSubmailLogVo.class, response); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取赛邮服务发送log详细信息 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
*/ |
||||
|
@SaCheckPermission("system:sysSubmailLog:query") |
||||
|
@GetMapping("/{id}") |
||||
|
public R<SysSubmailLogVo> getInfo(@NotNull(message = "主键不能为空") |
||||
|
@PathVariable Long id) { |
||||
|
return R.ok(sysSubmailLogService.queryById(id)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增赛邮服务发送log |
||||
|
*/ |
||||
|
@SaCheckPermission("system:sysSubmailLog:add") |
||||
|
@Log(title = "赛邮服务发送log", businessType = BusinessType.INSERT) |
||||
|
@RepeatSubmit() |
||||
|
@PostMapping() |
||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysSubmailLogBo bo) { |
||||
|
return toAjax(sysSubmailLogService.insertByBo(bo)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改赛邮服务发送log |
||||
|
*/ |
||||
|
@SaCheckPermission("system:sysSubmailLog:edit") |
||||
|
@Log(title = "赛邮服务发送log", businessType = BusinessType.UPDATE) |
||||
|
@RepeatSubmit() |
||||
|
@PutMapping() |
||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysSubmailLogBo bo) { |
||||
|
return toAjax(sysSubmailLogService.updateByBo(bo)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除赛邮服务发送log |
||||
|
* |
||||
|
* @param ids 主键串 |
||||
|
*/ |
||||
|
@SaCheckPermission("system:sysSubmailLog:remove") |
||||
|
@Log(title = "赛邮服务发送log", businessType = BusinessType.DELETE) |
||||
|
@DeleteMapping("/{ids}") |
||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
||||
|
@PathVariable Long[] ids) { |
||||
|
return toAjax(sysSubmailLogService.deleteWithValidByIds(List.of(ids), true)); |
||||
|
} |
||||
|
} |
@ -0,0 +1,92 @@ |
|||||
|
package org.dromara.system.domain; |
||||
|
|
||||
|
import org.dromara.common.tenant.core.TenantEntity; |
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务配置对象 sys_submail_config |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@TableName("sys_submail_config") |
||||
|
public class SysSubmailConfig extends TenantEntity { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 字典编码 |
||||
|
*/ |
||||
|
@TableId(value = "id") |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 接口名称 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 接口编码 |
||||
|
*/ |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮类型(Mail, Message,Voice,Internationalsms,Mobiledata) |
||||
|
*/ |
||||
|
private String type; |
||||
|
|
||||
|
/** |
||||
|
* 接口Url |
||||
|
*/ |
||||
|
private String url; |
||||
|
|
||||
|
/** |
||||
|
* AppId |
||||
|
*/ |
||||
|
private String appid; |
||||
|
|
||||
|
/** |
||||
|
* signature |
||||
|
*/ |
||||
|
private String signature; |
||||
|
private String project; //模板编码
|
||||
|
|
||||
|
/** |
||||
|
* tag参数 |
||||
|
*/ |
||||
|
private String tag; |
||||
|
|
||||
|
/** |
||||
|
* UNIX 时间戳 |
||||
|
*/ |
||||
|
private String timestamp; |
||||
|
|
||||
|
/** |
||||
|
* API 授权模式(normal) |
||||
|
*/ |
||||
|
private String signType; |
||||
|
|
||||
|
/** |
||||
|
* signature加密计算方式 |
||||
|
*/ |
||||
|
private String signVersion; |
||||
|
|
||||
|
/** |
||||
|
* 最新反馈状态(1是 0否) |
||||
|
*/ |
||||
|
private String latestResStatus; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String remark; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,52 @@ |
|||||
|
package org.dromara.system.domain; |
||||
|
|
||||
|
import org.dromara.common.tenant.core.TenantEntity; |
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务配置用户对象 sys_submail_config_user |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@TableName("sys_submail_config_user") |
||||
|
public class SysSubmailConfigUser extends TenantEntity { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
@TableId(value = "id") |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮配置ID |
||||
|
*/ |
||||
|
private Long submailConfigId; |
||||
|
private Long userId; |
||||
|
|
||||
|
/** |
||||
|
* 用户名称 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 手机号 |
||||
|
*/ |
||||
|
private String phonenumber; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String remark; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,109 @@ |
|||||
|
package org.dromara.system.domain; |
||||
|
|
||||
|
import org.dromara.common.tenant.core.TenantEntity; |
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务发送log对象 sys_submail_log |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@TableName("sys_submail_log") |
||||
|
public class SysSubmailLog extends TenantEntity { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 字典编码 |
||||
|
*/ |
||||
|
@TableId(value = "id") |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮配置ID |
||||
|
*/ |
||||
|
private Long submailConfigId; |
||||
|
|
||||
|
/** |
||||
|
* 接口名称 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 接口编码 |
||||
|
*/ |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 接口Url |
||||
|
*/ |
||||
|
private String url; |
||||
|
|
||||
|
/** |
||||
|
* 接收人 |
||||
|
*/ |
||||
|
// @TableField("to_receiver")
|
||||
|
private String toReceiver; |
||||
|
|
||||
|
/** |
||||
|
* 内容 |
||||
|
*/ |
||||
|
private String content; |
||||
|
|
||||
|
/** |
||||
|
* 模板编码 |
||||
|
*/ |
||||
|
private String project; |
||||
|
|
||||
|
/** |
||||
|
* 整合文本 |
||||
|
*/ |
||||
|
private String multi; |
||||
|
|
||||
|
/** |
||||
|
* 动态变量 |
||||
|
*/ |
||||
|
private String vars; |
||||
|
|
||||
|
/** |
||||
|
* tag参数 |
||||
|
*/ |
||||
|
private String tag; |
||||
|
|
||||
|
/** |
||||
|
* UNIX 时间戳 |
||||
|
*/ |
||||
|
private String timestamp; |
||||
|
|
||||
|
/** |
||||
|
* API 授权模式(normal) |
||||
|
*/ |
||||
|
private String signType; |
||||
|
|
||||
|
/** |
||||
|
* signature加密计算方式 |
||||
|
*/ |
||||
|
private String signVersion; |
||||
|
|
||||
|
/** |
||||
|
* 最新反馈状态(1是 0否) |
||||
|
*/ |
||||
|
private String latestResStatus; |
||||
|
|
||||
|
private String result; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String remark; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,117 @@ |
|||||
|
package org.dromara.system.domain.bo; |
||||
|
|
||||
|
import org.dromara.system.domain.SysSubmailConfig; |
||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity; |
||||
|
import org.dromara.common.core.validate.AddGroup; |
||||
|
import org.dromara.common.core.validate.EditGroup; |
||||
|
import io.github.linpeilie.annotations.AutoMapper; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import jakarta.validation.constraints.*; |
||||
|
import org.dromara.system.domain.SysUser; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务配置业务对象 sys_submail_config |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@AutoMapper(target = SysSubmailConfig.class, reverseConvertGenerate = false) |
||||
|
public class SysSubmailConfigBo extends BaseEntity { |
||||
|
|
||||
|
/** |
||||
|
* 字典编码 |
||||
|
*/ |
||||
|
@NotNull(message = "ID不能为空", groups = { EditGroup.class }) |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 接口名称 |
||||
|
*/ |
||||
|
@NotBlank(message = "接口名称不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 接口编码 |
||||
|
*/ |
||||
|
@NotBlank(message = "接口编码不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮类型(Mail, Message,Voice,Internationalsms,Mobiledata) |
||||
|
*/ |
||||
|
@NotBlank(message = "赛邮类型(Mail, Message,Voice,Internationalsms,Mobiledata)不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String type; |
||||
|
|
||||
|
/** |
||||
|
* 接口Url |
||||
|
*/ |
||||
|
@NotBlank(message = "接口Url不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String url; |
||||
|
|
||||
|
/** |
||||
|
* AppId |
||||
|
*/ |
||||
|
@NotBlank(message = "AppId不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String appid; |
||||
|
|
||||
|
/** |
||||
|
* signature |
||||
|
*/ |
||||
|
@NotBlank(message = "signature不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String signature; |
||||
|
private String project; //模板编码
|
||||
|
|
||||
|
/** |
||||
|
* tag参数 |
||||
|
*/ |
||||
|
// @NotBlank(message = "tag参数不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
private String tag; |
||||
|
|
||||
|
/** |
||||
|
* UNIX 时间戳 |
||||
|
*/ |
||||
|
// @NotBlank(message = "UNIX 时间戳不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
private String timestamp; |
||||
|
|
||||
|
/** |
||||
|
* API 授权模式(normal) |
||||
|
*/ |
||||
|
// @NotBlank(message = "API 授权模式(normal)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
private String signType; |
||||
|
|
||||
|
/** |
||||
|
* signature加密计算方式 |
||||
|
*/ |
||||
|
// @NotBlank(message = "signature加密计算方式不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
private String signVersion; |
||||
|
|
||||
|
/** |
||||
|
* 最新反馈状态(1是 0否) |
||||
|
*/ |
||||
|
// @NotBlank(message = "最新反馈状态(1是 0否)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
private String latestResStatus; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
// @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
private String remark; |
||||
|
|
||||
|
|
||||
|
|
||||
|
//发送传参
|
||||
|
private String to; //接收人
|
||||
|
private String content; //内容
|
||||
|
private String multi; //整合文本
|
||||
|
private String multiParam; //整合文本-单个参数(适合批量发送)
|
||||
|
private String vars; //动态变量
|
||||
|
private Long[] configUserIds; //动态变量
|
||||
|
private List<SysUser> configUserList; //动态变量
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,58 @@ |
|||||
|
package org.dromara.system.domain.bo; |
||||
|
|
||||
|
import org.dromara.system.domain.SysSubmailConfigUser; |
||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity; |
||||
|
import org.dromara.common.core.validate.AddGroup; |
||||
|
import org.dromara.common.core.validate.EditGroup; |
||||
|
import io.github.linpeilie.annotations.AutoMapper; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import jakarta.validation.constraints.*; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务配置用户业务对象 sys_submail_config_user |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@AutoMapper(target = SysSubmailConfigUser.class, reverseConvertGenerate = false) |
||||
|
public class SysSubmailConfigUserBo extends BaseEntity { |
||||
|
|
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
@NotNull(message = "ID不能为空", groups = { EditGroup.class }) |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮配置ID |
||||
|
*/ |
||||
|
@NotNull(message = "赛邮配置ID不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private Long submailConfigId; |
||||
|
|
||||
|
@NotNull(message = "用户ID不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private Long userId; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 用户名称 |
||||
|
*/ |
||||
|
@NotBlank(message = "用户名称不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 手机号 |
||||
|
*/ |
||||
|
@NotBlank(message = "手机号不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String phonenumber; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
@NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String remark; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,126 @@ |
|||||
|
package org.dromara.system.domain.bo; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import org.dromara.system.domain.SysSubmailLog; |
||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity; |
||||
|
import org.dromara.common.core.validate.AddGroup; |
||||
|
import org.dromara.common.core.validate.EditGroup; |
||||
|
import io.github.linpeilie.annotations.AutoMapper; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import jakarta.validation.constraints.*; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务发送log业务对象 sys_submail_log |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@AutoMapper(target = SysSubmailLog.class, reverseConvertGenerate = false) |
||||
|
public class SysSubmailLogBo extends BaseEntity { |
||||
|
|
||||
|
/** |
||||
|
* 字典编码 |
||||
|
*/ |
||||
|
@NotNull(message = "字典编码不能为空", groups = { EditGroup.class }) |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮配置ID |
||||
|
*/ |
||||
|
@NotNull(message = "赛邮配置ID不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private Long submailConfigId; |
||||
|
|
||||
|
/** |
||||
|
* 接口名称 |
||||
|
*/ |
||||
|
@NotBlank(message = "接口名称不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 接口编码 |
||||
|
*/ |
||||
|
// @NotBlank(message = "接口编码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 接口Url |
||||
|
*/ |
||||
|
@NotBlank(message = "接口Url不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String url; |
||||
|
|
||||
|
/** |
||||
|
* 接收人 |
||||
|
*/ |
||||
|
// @NotBlank(message = "接收人不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
// @TableField("to_receiver")
|
||||
|
// private String to;
|
||||
|
private String toReceiver; |
||||
|
|
||||
|
/** |
||||
|
* 内容 |
||||
|
*/ |
||||
|
// @NotBlank(message = "内容不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
private String content; |
||||
|
|
||||
|
/** |
||||
|
* 模板编码 |
||||
|
*/ |
||||
|
// @NotBlank(message = "模板编码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
private String project; |
||||
|
|
||||
|
/** |
||||
|
* 整合文本 |
||||
|
*/ |
||||
|
// @NotBlank(message = "整合文本不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
private String multi; |
||||
|
|
||||
|
/** |
||||
|
* 动态变量 |
||||
|
*/ |
||||
|
// @NotBlank(message = "动态变量不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
private String vars; |
||||
|
|
||||
|
/** |
||||
|
* tag参数 |
||||
|
*/ |
||||
|
// @NotBlank(message = "tag参数不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
private String tag; |
||||
|
|
||||
|
/** |
||||
|
* UNIX 时间戳 |
||||
|
*/ |
||||
|
// @NotBlank(message = "UNIX 时间戳不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
private String timestamp; |
||||
|
|
||||
|
/** |
||||
|
* API 授权模式(normal) |
||||
|
*/ |
||||
|
// @NotBlank(message = "API 授权模式(normal)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
private String signType; |
||||
|
|
||||
|
/** |
||||
|
* signature加密计算方式 |
||||
|
*/ |
||||
|
// @NotBlank(message = "signature加密计算方式不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
private String signVersion; |
||||
|
|
||||
|
/** |
||||
|
* 最新反馈状态(1是 0否) |
||||
|
*/ |
||||
|
// @NotBlank(message = "最新反馈状态(1是 0否)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
private String latestResStatus; |
||||
|
|
||||
|
private String result; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
// @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
|
private String remark; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,67 @@ |
|||||
|
package org.dromara.system.domain.vo; |
||||
|
|
||||
|
import org.dromara.system.domain.SysSubmailConfigUser; |
||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||
|
import org.dromara.common.excel.annotation.ExcelDictFormat; |
||||
|
import org.dromara.common.excel.convert.ExcelDictConvert; |
||||
|
import io.github.linpeilie.annotations.AutoMapper; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务配置用户视图对象 sys_submail_config_user |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ExcelIgnoreUnannotated |
||||
|
@AutoMapper(target = SysSubmailConfigUser.class) |
||||
|
public class SysSubmailConfigUserVo implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
@ExcelProperty(value = "ID") |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮配置ID |
||||
|
*/ |
||||
|
@ExcelProperty(value = "赛邮配置ID") |
||||
|
private Long submailConfigId; |
||||
|
|
||||
|
|
||||
|
@ExcelProperty(value = "用户ID") |
||||
|
private Long userId; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 用户名称 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "用户名称") |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 手机号 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "手机号") |
||||
|
private String phonenumber; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "备注") |
||||
|
private String remark; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,115 @@ |
|||||
|
package org.dromara.system.domain.vo; |
||||
|
|
||||
|
import org.dromara.system.domain.SysSubmailConfig; |
||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||
|
import org.dromara.common.excel.annotation.ExcelDictFormat; |
||||
|
import org.dromara.common.excel.convert.ExcelDictConvert; |
||||
|
import io.github.linpeilie.annotations.AutoMapper; |
||||
|
import lombok.Data; |
||||
|
import org.dromara.system.domain.SysUser; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务配置视图对象 sys_submail_config |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ExcelIgnoreUnannotated |
||||
|
@AutoMapper(target = SysSubmailConfig.class) |
||||
|
public class SysSubmailConfigVo implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 字典编码 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "字典编码") |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 接口名称 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "接口名称") |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 接口编码 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "接口编码") |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮类型(Mail, Message,Voice,Internationalsms,Mobiledata) |
||||
|
*/ |
||||
|
@ExcelProperty(value = "赛邮类型(Mail, Message,Voice,Internationalsms,Mobiledata)") |
||||
|
private String type; |
||||
|
|
||||
|
/** |
||||
|
* 接口Url |
||||
|
*/ |
||||
|
@ExcelProperty(value = "接口Url") |
||||
|
private String url; |
||||
|
|
||||
|
/** |
||||
|
* AppId |
||||
|
*/ |
||||
|
@ExcelProperty(value = "AppId") |
||||
|
private String appid; |
||||
|
|
||||
|
/** |
||||
|
* signature |
||||
|
*/ |
||||
|
@ExcelProperty(value = "signature") |
||||
|
private String signature; |
||||
|
private String project; //模板编码
|
||||
|
/** |
||||
|
* tag参数 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "tag参数") |
||||
|
private String tag; |
||||
|
|
||||
|
/** |
||||
|
* UNIX 时间戳 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "UNIX 时间戳") |
||||
|
private String timestamp; |
||||
|
|
||||
|
/** |
||||
|
* API 授权模式(normal) |
||||
|
*/ |
||||
|
@ExcelProperty(value = "API 授权模式(normal)") |
||||
|
private String signType; |
||||
|
|
||||
|
/** |
||||
|
* signature加密计算方式 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "signature加密计算方式") |
||||
|
private String signVersion; |
||||
|
|
||||
|
/** |
||||
|
* 最新反馈状态(1是 0否) |
||||
|
*/ |
||||
|
@ExcelProperty(value = "最新反馈状态", converter = ExcelDictConvert.class) |
||||
|
@ExcelDictFormat(dictType = "sys_yes_no") |
||||
|
private String latestResStatus; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "备注") |
||||
|
private String remark; |
||||
|
|
||||
|
private Long[] configUserIds; //动态变量
|
||||
|
private List<SysSubmailConfigUserVo> configUserList; //动态变量
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,134 @@ |
|||||
|
package org.dromara.system.domain.vo; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import org.dromara.system.domain.SysSubmailLog; |
||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||
|
import org.dromara.common.excel.annotation.ExcelDictFormat; |
||||
|
import org.dromara.common.excel.convert.ExcelDictConvert; |
||||
|
import io.github.linpeilie.annotations.AutoMapper; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务发送log视图对象 sys_submail_log |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ExcelIgnoreUnannotated |
||||
|
@AutoMapper(target = SysSubmailLog.class) |
||||
|
public class SysSubmailLogVo implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 字典编码 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "字典编码") |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮配置ID |
||||
|
*/ |
||||
|
@ExcelProperty(value = "赛邮配置ID") |
||||
|
private Long submailConfigId; |
||||
|
|
||||
|
/** |
||||
|
* 接口名称 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "接口名称") |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 接口编码 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "接口编码") |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 接口Url |
||||
|
*/ |
||||
|
@ExcelProperty(value = "接口Url") |
||||
|
private String url; |
||||
|
|
||||
|
/** |
||||
|
* 接收人 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "接收人") |
||||
|
// @TableField("to_receiver")
|
||||
|
private String toReceiver; |
||||
|
|
||||
|
/** |
||||
|
* 内容 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "内容") |
||||
|
private String content; |
||||
|
|
||||
|
/** |
||||
|
* 模板编码 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "模板编码") |
||||
|
private String project; |
||||
|
|
||||
|
/** |
||||
|
* 整合文本 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "整合文本") |
||||
|
private String multi; |
||||
|
|
||||
|
/** |
||||
|
* 动态变量 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "动态变量") |
||||
|
private String vars; |
||||
|
|
||||
|
/** |
||||
|
* tag参数 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "tag参数") |
||||
|
private String tag; |
||||
|
|
||||
|
/** |
||||
|
* UNIX 时间戳 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "UNIX 时间戳") |
||||
|
private String timestamp; |
||||
|
|
||||
|
/** |
||||
|
* API 授权模式(normal) |
||||
|
*/ |
||||
|
@ExcelProperty(value = "API 授权模式(normal)") |
||||
|
private String signType; |
||||
|
|
||||
|
/** |
||||
|
* signature加密计算方式 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "signature加密计算方式") |
||||
|
private String signVersion; |
||||
|
|
||||
|
/** |
||||
|
* 最新反馈状态(1是 0否) |
||||
|
*/ |
||||
|
@ExcelProperty(value = "最新反馈状态", converter = ExcelDictConvert.class) |
||||
|
@ExcelDictFormat(dictType = "sys_yes_no") |
||||
|
private String latestResStatus; |
||||
|
|
||||
|
@ExcelProperty(value = "返回结果") |
||||
|
private String result; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "备注") |
||||
|
private String remark; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,39 @@ |
|||||
|
package org.dromara.system.dubbo; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import org.apache.dubbo.config.annotation.DubboService; |
||||
|
import org.dromara.common.core.domain.R; |
||||
|
import org.dromara.system.api.RemoteClientService; |
||||
|
import org.dromara.system.api.RemoteSubmailConfigService; |
||||
|
import org.dromara.system.api.domain.vo.RemoteClientVo; |
||||
|
import org.dromara.system.domain.vo.SysClientVo; |
||||
|
import org.dromara.system.service.ISysClientService; |
||||
|
import org.dromara.system.service.ISysSubmailConfigService; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* 客户端服务 |
||||
|
* |
||||
|
* @author Michelle.Chung |
||||
|
*/ |
||||
|
@RequiredArgsConstructor |
||||
|
@Service |
||||
|
@DubboService |
||||
|
public class RemoteSubmailConfigServiceImpl implements RemoteSubmailConfigService { |
||||
|
|
||||
|
|
||||
|
private final ISysSubmailConfigService sysSubmailConfigService; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param code 必须传参:smsMultixsend |
||||
|
* @param multiParam 前台传参 JSON.stringfy( {"jobName":"翟山街道华盛","labelCn":"普通垃圾","labelEn":"garbage","deptName":"翟山街道","lat":"34.20994348014929","lng":"117.2054671683176"}) |
||||
|
* @return |
||||
|
*/ |
||||
|
@Override |
||||
|
public R<String> remoteCmdSend(String code, String multiParam) { |
||||
|
return sysSubmailConfigService.cmdSend(code, multiParam); |
||||
|
} |
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package org.dromara.system.mapper; |
||||
|
|
||||
|
import org.dromara.system.domain.SysSubmailConfig; |
||||
|
import org.dromara.system.domain.vo.SysSubmailConfigVo; |
||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务配置Mapper接口 |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
public interface SysSubmailConfigMapper extends BaseMapperPlus<SysSubmailConfig, SysSubmailConfigVo> { |
||||
|
|
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package org.dromara.system.mapper; |
||||
|
|
||||
|
import org.dromara.system.domain.SysSubmailConfigUser; |
||||
|
import org.dromara.system.domain.vo.SysSubmailConfigUserVo; |
||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务配置用户Mapper接口 |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
public interface SysSubmailConfigUserMapper extends BaseMapperPlus<SysSubmailConfigUser, SysSubmailConfigUserVo> { |
||||
|
|
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package org.dromara.system.mapper; |
||||
|
|
||||
|
import org.dromara.system.domain.SysSubmailLog; |
||||
|
import org.dromara.system.domain.vo.SysSubmailLogVo; |
||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务发送logMapper接口 |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
public interface SysSubmailLogMapper extends BaseMapperPlus<SysSubmailLog, SysSubmailLogVo> { |
||||
|
|
||||
|
} |
@ -0,0 +1,75 @@ |
|||||
|
package org.dromara.system.service; |
||||
|
|
||||
|
import org.dromara.common.core.domain.R; |
||||
|
import org.dromara.system.domain.SysSubmailConfig; |
||||
|
import org.dromara.system.domain.vo.SysSubmailConfigUserVo; |
||||
|
import org.dromara.system.domain.vo.SysSubmailConfigVo; |
||||
|
import org.dromara.system.domain.bo.SysSubmailConfigBo; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
|
||||
|
import java.util.Collection; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务配置Service接口 |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
public interface ISysSubmailConfigService { |
||||
|
|
||||
|
/** |
||||
|
* 查询赛邮服务配置 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
* @return 赛邮服务配置 |
||||
|
*/ |
||||
|
SysSubmailConfigVo queryById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 分页查询赛邮服务配置列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @param pageQuery 分页参数 |
||||
|
* @return 赛邮服务配置分页列表 |
||||
|
*/ |
||||
|
TableDataInfo<SysSubmailConfigVo> queryPageList(SysSubmailConfigBo bo, PageQuery pageQuery); |
||||
|
|
||||
|
/** |
||||
|
* 查询符合条件的赛邮服务配置列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @return 赛邮服务配置列表 |
||||
|
*/ |
||||
|
List<SysSubmailConfigVo> queryList(SysSubmailConfigBo bo); |
||||
|
|
||||
|
/** |
||||
|
* 新增赛邮服务配置 |
||||
|
* |
||||
|
* @param bo 赛邮服务配置 |
||||
|
* @return 是否新增成功 |
||||
|
*/ |
||||
|
Boolean insertByBo(SysSubmailConfigBo bo); |
||||
|
|
||||
|
/** |
||||
|
* 修改赛邮服务配置 |
||||
|
* |
||||
|
* @param bo 赛邮服务配置 |
||||
|
* @return 是否修改成功 |
||||
|
*/ |
||||
|
Boolean updateByBo(SysSubmailConfigBo bo); |
||||
|
|
||||
|
/** |
||||
|
* 校验并批量删除赛邮服务配置信息 |
||||
|
* |
||||
|
* @param ids 待删除的主键集合 |
||||
|
* @param isValid 是否进行有效性校验 |
||||
|
* @return 是否删除成功 |
||||
|
*/ |
||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
||||
|
|
||||
|
R<String> cmdSend(String code, String multiParam); |
||||
|
|
||||
|
String submailSendUtil(SysSubmailConfigBo bo, List<SysSubmailConfigUserVo> configUserVoList); |
||||
|
} |
@ -0,0 +1,73 @@ |
|||||
|
package org.dromara.system.service; |
||||
|
|
||||
|
import org.dromara.system.domain.SysSubmailConfigUser; |
||||
|
import org.dromara.system.domain.bo.SysSubmailConfigBo; |
||||
|
import org.dromara.system.domain.vo.SysSubmailConfigUserVo; |
||||
|
import org.dromara.system.domain.bo.SysSubmailConfigUserBo; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
|
||||
|
import java.util.Collection; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务配置用户Service接口 |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
public interface ISysSubmailConfigUserService { |
||||
|
|
||||
|
/** |
||||
|
* 查询赛邮服务配置用户 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
* @return 赛邮服务配置用户 |
||||
|
*/ |
||||
|
SysSubmailConfigUserVo queryById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 分页查询赛邮服务配置用户列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @param pageQuery 分页参数 |
||||
|
* @return 赛邮服务配置用户分页列表 |
||||
|
*/ |
||||
|
TableDataInfo<SysSubmailConfigUserVo> queryPageList(SysSubmailConfigUserBo bo, PageQuery pageQuery); |
||||
|
|
||||
|
/** |
||||
|
* 查询符合条件的赛邮服务配置用户列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @return 赛邮服务配置用户列表 |
||||
|
*/ |
||||
|
List<SysSubmailConfigUserVo> queryList(SysSubmailConfigUserBo bo); |
||||
|
|
||||
|
/** |
||||
|
* 新增赛邮服务配置用户 |
||||
|
* |
||||
|
* @param bo 赛邮服务配置用户 |
||||
|
* @return 是否新增成功 |
||||
|
*/ |
||||
|
Boolean insertByBo(SysSubmailConfigUserBo bo); |
||||
|
|
||||
|
/** |
||||
|
* 修改赛邮服务配置用户 |
||||
|
* |
||||
|
* @param bo 赛邮服务配置用户 |
||||
|
* @return 是否修改成功 |
||||
|
*/ |
||||
|
Boolean updateByBo(SysSubmailConfigUserBo bo); |
||||
|
|
||||
|
/** |
||||
|
* 校验并批量删除赛邮服务配置用户信息 |
||||
|
* |
||||
|
* @param ids 待删除的主键集合 |
||||
|
* @param isValid 是否进行有效性校验 |
||||
|
* @return 是否删除成功 |
||||
|
*/ |
||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
||||
|
|
||||
|
List<SysSubmailConfigUserVo> selectConfigUserByConfigIds(List<Long> configIds); |
||||
|
|
||||
|
} |
@ -0,0 +1,69 @@ |
|||||
|
package org.dromara.system.service; |
||||
|
|
||||
|
import org.dromara.system.domain.SysSubmailLog; |
||||
|
import org.dromara.system.domain.vo.SysSubmailLogVo; |
||||
|
import org.dromara.system.domain.bo.SysSubmailLogBo; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
|
||||
|
import java.util.Collection; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务发送logService接口 |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
public interface ISysSubmailLogService { |
||||
|
|
||||
|
/** |
||||
|
* 查询赛邮服务发送log |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
* @return 赛邮服务发送log |
||||
|
*/ |
||||
|
SysSubmailLogVo queryById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 分页查询赛邮服务发送log列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @param pageQuery 分页参数 |
||||
|
* @return 赛邮服务发送log分页列表 |
||||
|
*/ |
||||
|
TableDataInfo<SysSubmailLogVo> queryPageList(SysSubmailLogBo bo, PageQuery pageQuery); |
||||
|
|
||||
|
/** |
||||
|
* 查询符合条件的赛邮服务发送log列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @return 赛邮服务发送log列表 |
||||
|
*/ |
||||
|
List<SysSubmailLogVo> queryList(SysSubmailLogBo bo); |
||||
|
|
||||
|
/** |
||||
|
* 新增赛邮服务发送log |
||||
|
* |
||||
|
* @param bo 赛邮服务发送log |
||||
|
* @return 是否新增成功 |
||||
|
*/ |
||||
|
Boolean insertByBo(SysSubmailLogBo bo); |
||||
|
|
||||
|
/** |
||||
|
* 修改赛邮服务发送log |
||||
|
* |
||||
|
* @param bo 赛邮服务发送log |
||||
|
* @return 是否修改成功 |
||||
|
*/ |
||||
|
Boolean updateByBo(SysSubmailLogBo bo); |
||||
|
|
||||
|
/** |
||||
|
* 校验并批量删除赛邮服务发送log信息 |
||||
|
* |
||||
|
* @param ids 待删除的主键集合 |
||||
|
* @param isValid 是否进行有效性校验 |
||||
|
* @return 是否删除成功 |
||||
|
*/ |
||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
||||
|
} |
@ -0,0 +1,272 @@ |
|||||
|
package org.dromara.system.service.impl; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import cn.hutool.core.bean.copier.CopyOptions; |
||||
|
import cn.hutool.core.util.BooleanUtil; |
||||
|
import cn.hutool.core.util.StrUtil; |
||||
|
import cn.hutool.http.HttpUtil; |
||||
|
import cn.hutool.json.JSONArray; |
||||
|
import cn.hutool.json.JSONObject; |
||||
|
import cn.hutool.json.JSONUtil; |
||||
|
import org.dromara.common.core.domain.R; |
||||
|
import org.dromara.common.core.utils.MapstructUtils; |
||||
|
import org.dromara.common.core.utils.SpringUtils; |
||||
|
import org.dromara.common.core.utils.StringUtils; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import org.dromara.system.domain.bo.SysSubmailConfigUserBo; |
||||
|
import org.dromara.system.domain.bo.SysSubmailLogBo; |
||||
|
import org.dromara.system.domain.vo.SysSubmailConfigUserVo; |
||||
|
import org.dromara.system.service.ISysConfigService; |
||||
|
import org.dromara.system.service.ISysSubmailConfigUserService; |
||||
|
import org.dromara.system.service.ISysSubmailLogService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.dromara.system.domain.bo.SysSubmailConfigBo; |
||||
|
import org.dromara.system.domain.vo.SysSubmailConfigVo; |
||||
|
import org.dromara.system.domain.SysSubmailConfig; |
||||
|
import org.dromara.system.mapper.SysSubmailConfigMapper; |
||||
|
import org.dromara.system.service.ISysSubmailConfigService; |
||||
|
|
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.Collection; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务配置Service业务层处理 |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
@RequiredArgsConstructor |
||||
|
@Service |
||||
|
public class SysSubmailConfigServiceImpl implements ISysSubmailConfigService { |
||||
|
|
||||
|
private final SysSubmailConfigMapper baseMapper; |
||||
|
|
||||
|
@Autowired |
||||
|
private ISysSubmailConfigUserService sysSubmailConfigUserService; |
||||
|
@Autowired |
||||
|
private ISysSubmailLogService sysSubmailLogService; |
||||
|
|
||||
|
/** |
||||
|
* 查询赛邮服务配置 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
* @return 赛邮服务配置 |
||||
|
*/ |
||||
|
@Override |
||||
|
public SysSubmailConfigVo queryById(Long id){ |
||||
|
return baseMapper.selectVoById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 分页查询赛邮服务配置列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @param pageQuery 分页参数 |
||||
|
* @return 赛邮服务配置分页列表 |
||||
|
*/ |
||||
|
@Override |
||||
|
public TableDataInfo<SysSubmailConfigVo> queryPageList(SysSubmailConfigBo bo, PageQuery pageQuery) { |
||||
|
LambdaQueryWrapper<SysSubmailConfig> lqw = buildQueryWrapper(bo); |
||||
|
Page<SysSubmailConfigVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
||||
|
return TableDataInfo.build(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询符合条件的赛邮服务配置列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @return 赛邮服务配置列表 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<SysSubmailConfigVo> queryList(SysSubmailConfigBo bo) { |
||||
|
LambdaQueryWrapper<SysSubmailConfig> lqw = buildQueryWrapper(bo); |
||||
|
return baseMapper.selectVoList(lqw); |
||||
|
} |
||||
|
|
||||
|
private LambdaQueryWrapper<SysSubmailConfig> buildQueryWrapper(SysSubmailConfigBo bo) { |
||||
|
Map<String, Object> params = bo.getParams(); |
||||
|
LambdaQueryWrapper<SysSubmailConfig> lqw = Wrappers.lambdaQuery(); |
||||
|
lqw.like(StringUtils.isNotBlank(bo.getName()), SysSubmailConfig::getName, bo.getName()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getCode()), SysSubmailConfig::getCode, bo.getCode()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getType()), SysSubmailConfig::getType, bo.getType()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getUrl()), SysSubmailConfig::getUrl, bo.getUrl()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getAppid()), SysSubmailConfig::getAppid, bo.getAppid()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSignature()), SysSubmailConfig::getSignature, bo.getSignature()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getTag()), SysSubmailConfig::getTag, bo.getTag()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getTimestamp()), SysSubmailConfig::getTimestamp, bo.getTimestamp()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSignType()), SysSubmailConfig::getSignType, bo.getSignType()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSignVersion()), SysSubmailConfig::getSignVersion, bo.getSignVersion()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getLatestResStatus()), SysSubmailConfig::getLatestResStatus, bo.getLatestResStatus()); |
||||
|
return lqw; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增赛邮服务配置 |
||||
|
* |
||||
|
* @param bo 赛邮服务配置 |
||||
|
* @return 是否新增成功 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Boolean insertByBo(SysSubmailConfigBo bo) { |
||||
|
SysSubmailConfig add = MapstructUtils.convert(bo, SysSubmailConfig.class); |
||||
|
validEntityBeforeSave(add); |
||||
|
boolean flag = baseMapper.insert(add) > 0; |
||||
|
if (flag) { |
||||
|
bo.setId(add.getId()); |
||||
|
} |
||||
|
return flag; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改赛邮服务配置 |
||||
|
* |
||||
|
* @param bo 赛邮服务配置 |
||||
|
* @return 是否修改成功 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Boolean updateByBo(SysSubmailConfigBo bo) { |
||||
|
SysSubmailConfig update = MapstructUtils.convert(bo, SysSubmailConfig.class); |
||||
|
validEntityBeforeSave(update); |
||||
|
return baseMapper.updateById(update) > 0; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 保存前的数据校验 |
||||
|
*/ |
||||
|
private void validEntityBeforeSave(SysSubmailConfig entity){ |
||||
|
//TODO 做一些数据校验,如唯一约束
|
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 校验并批量删除赛邮服务配置信息 |
||||
|
* |
||||
|
* @param ids 待删除的主键集合 |
||||
|
* @param isValid 是否进行有效性校验 |
||||
|
* @return 是否删除成功 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
||||
|
if(isValid){ |
||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
|
} |
||||
|
return baseMapper.deleteByIds(ids) > 0; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public R<String> cmdSend(String code, String multiParam) { |
||||
|
|
||||
|
//找到生效配置
|
||||
|
SysSubmailConfigBo bo = new SysSubmailConfigBo(); |
||||
|
bo.setCode(code); |
||||
|
List<SysSubmailConfigVo> sysSubmailConfigVoTempList = this.queryList(bo); |
||||
|
if (sysSubmailConfigVoTempList.size() <= 0) { |
||||
|
return R.fail("暂无有效配置"); |
||||
|
} |
||||
|
SysSubmailConfigVo firstConfigVo = sysSubmailConfigVoTempList.get(0); |
||||
|
|
||||
|
BeanUtil.copyProperties(firstConfigVo,bo); |
||||
|
bo.setMultiParam(multiParam); |
||||
|
|
||||
|
//判断是否配置用户
|
||||
|
SysSubmailConfigUserBo mailUserQuery = new SysSubmailConfigUserBo(); |
||||
|
mailUserQuery.setSubmailConfigId(bo.getId()); |
||||
|
List<SysSubmailConfigUserVo> sysSubmailConfigUserVoList = sysSubmailConfigUserService.queryList(mailUserQuery); |
||||
|
List<SysSubmailConfigUserVo> configUserVoList = sysSubmailConfigUserVoList.stream().filter(item -> StrUtil.isNotBlank(item.getPhonenumber())).collect(Collectors.toList()); |
||||
|
if(configUserVoList.size() <= 0) { |
||||
|
return R.fail("暂无配置有效用户"); |
||||
|
} |
||||
|
|
||||
|
String result = submailSendUtil(bo, configUserVoList); |
||||
|
return R.ok(result); |
||||
|
} |
||||
|
|
||||
|
public String submailSendUtil(SysSubmailConfigBo bo, List<SysSubmailConfigUserVo> configUserVoList) { |
||||
|
String subMailSaveFlag = SpringUtils.getBean(ISysConfigService.class).selectConfigByKey("submail.log.save"); |
||||
|
HashMap<String, Object> postParam = new HashMap<>(); |
||||
|
postParam.put("appid", bo.getAppid()); |
||||
|
postParam.put("signature", bo.getSignature()); |
||||
|
|
||||
|
String phonenumber = configUserVoList.get(0).getPhonenumber(); |
||||
|
String result = ""; |
||||
|
switch (bo.getCode()){ |
||||
|
case "smsSend": //短信发送 to/content
|
||||
|
postParam.put("to", phonenumber); |
||||
|
postParam.put("content", bo.getContent()); |
||||
|
result = HttpUtil.post(bo.getUrl(), postParam); //JSONUtil.parseObj(result).getStr("status")
|
||||
|
saveConfigLog(bo, subMailSaveFlag, phonenumber, result); |
||||
|
break; |
||||
|
case "smsXsend": //短信模板发送 to/project
|
||||
|
postParam.put("to", phonenumber); |
||||
|
postParam.put("project", bo.getProject()); |
||||
|
postParam.put("vars", bo.getVars()); |
||||
|
result = HttpUtil.post(bo.getUrl(), postParam); |
||||
|
saveConfigLog(bo, subMailSaveFlag, phonenumber, result); |
||||
|
break; |
||||
|
case "smsMultisend": //短信一对多发送 multi
|
||||
|
// postParam.put("to", phonenumber);
|
||||
|
// postParam.put("project", bo.getProject());
|
||||
|
// postParam.put("vars", bo.getVars());
|
||||
|
// result = HttpUtil.post(bo.getUrl(), postParam);
|
||||
|
// saveConfigLog(bo, subMailSaveFlag, phonenumber, result);
|
||||
|
break; |
||||
|
case "smsMultixsend": //短信模板一对多发送 project/multi
|
||||
|
postParam.put("to", phonenumber); |
||||
|
postParam.put("project", bo.getProject()); |
||||
|
// 拼接multi
|
||||
|
JSONArray multiJson = new JSONArray(); |
||||
|
for (SysSubmailConfigUserVo sysSubmailConfigUserVo : configUserVoList) { |
||||
|
JSONObject entries = new JSONObject(); |
||||
|
entries.set("to",sysSubmailConfigUserVo.getPhonenumber()); |
||||
|
entries.set("vars", JSONUtil.parseObj(bo.getMultiParam())); |
||||
|
multiJson.add(entries); |
||||
|
} |
||||
|
String multiJsonStr = multiJson.toString(); |
||||
|
// postParam.put("multi", multiJson.toString());
|
||||
|
postParam.put("multi", multiJsonStr); |
||||
|
|
||||
|
result = HttpUtil.post(bo.getUrl(), postParam); |
||||
|
saveConfigLog(bo, subMailSaveFlag, phonenumber, result); |
||||
|
break; |
||||
|
} |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
//保存config发送log
|
||||
|
private void saveConfigLog(SysSubmailConfigBo bo, String subMailSaveFlag, String phonenumber, String result) { |
||||
|
String [] ignoreProp = {"id","createBy","createTime","updateBy","updateTime","remark"}; |
||||
|
|
||||
|
if(BooleanUtil.toBoolean(subMailSaveFlag)){ |
||||
|
SysSubmailLogBo sysSubmailLog = new SysSubmailLogBo(); |
||||
|
BeanUtil.copyProperties(bo, sysSubmailLog, CopyOptions.create().setIgnoreProperties(ignoreProp)); |
||||
|
sysSubmailLog.setSubmailConfigId(bo.getId()); |
||||
|
sysSubmailLog.setToReceiver(phonenumber); |
||||
|
sysSubmailLog.setContent(bo.getContent()); |
||||
|
String latestStatus = ""; |
||||
|
if(JSONUtil.isTypeJSONArray(result)) { |
||||
|
latestStatus = new JSONObject(JSONUtil.parseArray(result).get(0)).getStr("status"); |
||||
|
}else{ |
||||
|
latestStatus = JSONUtil.parseObj(result).getStr("status"); |
||||
|
} |
||||
|
boolean successFlag = "success".equals(latestStatus); |
||||
|
String latestResStatus = successFlag ? "Y" : "N"; |
||||
|
sysSubmailLog.setLatestResStatus(latestResStatus); |
||||
|
sysSubmailLog.setResult(result); |
||||
|
sysSubmailLogService.insertByBo(sysSubmailLog); |
||||
|
|
||||
|
//更新状态
|
||||
|
SysSubmailConfigBo sysSubmailConfigBo = new SysSubmailConfigBo(); |
||||
|
sysSubmailConfigBo.setId(bo.getId()); |
||||
|
sysSubmailConfigBo.setLatestResStatus(latestResStatus); |
||||
|
this.updateByBo(sysSubmailConfigBo); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,140 @@ |
|||||
|
package org.dromara.system.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import org.dromara.common.core.utils.MapstructUtils; |
||||
|
import org.dromara.common.core.utils.StringUtils; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.dromara.system.domain.bo.SysSubmailConfigUserBo; |
||||
|
import org.dromara.system.domain.vo.SysSubmailConfigUserVo; |
||||
|
import org.dromara.system.domain.SysSubmailConfigUser; |
||||
|
import org.dromara.system.mapper.SysSubmailConfigUserMapper; |
||||
|
import org.dromara.system.service.ISysSubmailConfigUserService; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.Collection; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务配置用户Service业务层处理 |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
@RequiredArgsConstructor |
||||
|
@Service |
||||
|
public class SysSubmailConfigUserServiceImpl implements ISysSubmailConfigUserService { |
||||
|
|
||||
|
private final SysSubmailConfigUserMapper baseMapper; |
||||
|
|
||||
|
/** |
||||
|
* 查询赛邮服务配置用户 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
* @return 赛邮服务配置用户 |
||||
|
*/ |
||||
|
@Override |
||||
|
public SysSubmailConfigUserVo queryById(Long id){ |
||||
|
return baseMapper.selectVoById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 分页查询赛邮服务配置用户列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @param pageQuery 分页参数 |
||||
|
* @return 赛邮服务配置用户分页列表 |
||||
|
*/ |
||||
|
@Override |
||||
|
public TableDataInfo<SysSubmailConfigUserVo> queryPageList(SysSubmailConfigUserBo bo, PageQuery pageQuery) { |
||||
|
LambdaQueryWrapper<SysSubmailConfigUser> lqw = buildQueryWrapper(bo); |
||||
|
Page<SysSubmailConfigUserVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
||||
|
return TableDataInfo.build(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询符合条件的赛邮服务配置用户列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @return 赛邮服务配置用户列表 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<SysSubmailConfigUserVo> queryList(SysSubmailConfigUserBo bo) { |
||||
|
LambdaQueryWrapper<SysSubmailConfigUser> lqw = buildQueryWrapper(bo); |
||||
|
return baseMapper.selectVoList(lqw); |
||||
|
} |
||||
|
|
||||
|
private LambdaQueryWrapper<SysSubmailConfigUser> buildQueryWrapper(SysSubmailConfigUserBo bo) { |
||||
|
Map<String, Object> params = bo.getParams(); |
||||
|
LambdaQueryWrapper<SysSubmailConfigUser> lqw = Wrappers.lambdaQuery(); |
||||
|
lqw.eq(bo.getSubmailConfigId() != null, SysSubmailConfigUser::getSubmailConfigId, bo.getSubmailConfigId()); |
||||
|
lqw.like(StringUtils.isNotBlank(bo.getName()), SysSubmailConfigUser::getName, bo.getName()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getPhonenumber()), SysSubmailConfigUser::getPhonenumber, bo.getPhonenumber()); |
||||
|
return lqw; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增赛邮服务配置用户 |
||||
|
* |
||||
|
* @param bo 赛邮服务配置用户 |
||||
|
* @return 是否新增成功 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Boolean insertByBo(SysSubmailConfigUserBo bo) { |
||||
|
SysSubmailConfigUser add = MapstructUtils.convert(bo, SysSubmailConfigUser.class); |
||||
|
validEntityBeforeSave(add); |
||||
|
boolean flag = baseMapper.insert(add) > 0; |
||||
|
if (flag) { |
||||
|
bo.setId(add.getId()); |
||||
|
} |
||||
|
return flag; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改赛邮服务配置用户 |
||||
|
* |
||||
|
* @param bo 赛邮服务配置用户 |
||||
|
* @return 是否修改成功 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Boolean updateByBo(SysSubmailConfigUserBo bo) { |
||||
|
SysSubmailConfigUser update = MapstructUtils.convert(bo, SysSubmailConfigUser.class); |
||||
|
validEntityBeforeSave(update); |
||||
|
return baseMapper.updateById(update) > 0; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 保存前的数据校验 |
||||
|
*/ |
||||
|
private void validEntityBeforeSave(SysSubmailConfigUser entity){ |
||||
|
//TODO 做一些数据校验,如唯一约束
|
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 校验并批量删除赛邮服务配置用户信息 |
||||
|
* |
||||
|
* @param ids 待删除的主键集合 |
||||
|
* @param isValid 是否进行有效性校验 |
||||
|
* @return 是否删除成功 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
||||
|
if(isValid){ |
||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
|
} |
||||
|
return baseMapper.deleteByIds(ids) > 0; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<SysSubmailConfigUserVo> selectConfigUserByConfigIds(List<Long> configIds) { |
||||
|
LambdaQueryWrapper<SysSubmailConfigUser> lambdaQueryWrapper = new LambdaQueryWrapper(); |
||||
|
lambdaQueryWrapper.in(SysSubmailConfigUser::getSubmailConfigId,configIds); |
||||
|
List<SysSubmailConfigUserVo> sysSubmailConfigUserVoList = baseMapper.selectVoList(lambdaQueryWrapper); |
||||
|
return sysSubmailConfigUserVoList; |
||||
|
} |
||||
|
} |
@ -0,0 +1,144 @@ |
|||||
|
package org.dromara.system.service.impl; |
||||
|
|
||||
|
import org.dromara.common.core.utils.MapstructUtils; |
||||
|
import org.dromara.common.core.utils.StringUtils; |
||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.dromara.system.domain.bo.SysSubmailLogBo; |
||||
|
import org.dromara.system.domain.vo.SysSubmailLogVo; |
||||
|
import org.dromara.system.domain.SysSubmailLog; |
||||
|
import org.dromara.system.mapper.SysSubmailLogMapper; |
||||
|
import org.dromara.system.service.ISysSubmailLogService; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.Collection; |
||||
|
|
||||
|
/** |
||||
|
* 赛邮服务发送logService业务层处理 |
||||
|
* |
||||
|
* @author szs |
||||
|
* @date 2025-05-11 |
||||
|
*/ |
||||
|
@RequiredArgsConstructor |
||||
|
@Service |
||||
|
public class SysSubmailLogServiceImpl implements ISysSubmailLogService { |
||||
|
|
||||
|
private final SysSubmailLogMapper baseMapper; |
||||
|
|
||||
|
/** |
||||
|
* 查询赛邮服务发送log |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
* @return 赛邮服务发送log |
||||
|
*/ |
||||
|
@Override |
||||
|
public SysSubmailLogVo queryById(Long id){ |
||||
|
return baseMapper.selectVoById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 分页查询赛邮服务发送log列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @param pageQuery 分页参数 |
||||
|
* @return 赛邮服务发送log分页列表 |
||||
|
*/ |
||||
|
@Override |
||||
|
public TableDataInfo<SysSubmailLogVo> queryPageList(SysSubmailLogBo bo, PageQuery pageQuery) { |
||||
|
LambdaQueryWrapper<SysSubmailLog> lqw = buildQueryWrapper(bo); |
||||
|
lqw.orderByDesc(BaseEntity::getCreateTime); |
||||
|
Page<SysSubmailLogVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
||||
|
return TableDataInfo.build(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询符合条件的赛邮服务发送log列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @return 赛邮服务发送log列表 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<SysSubmailLogVo> queryList(SysSubmailLogBo bo) { |
||||
|
LambdaQueryWrapper<SysSubmailLog> lqw = buildQueryWrapper(bo); |
||||
|
return baseMapper.selectVoList(lqw); |
||||
|
} |
||||
|
|
||||
|
private LambdaQueryWrapper<SysSubmailLog> buildQueryWrapper(SysSubmailLogBo bo) { |
||||
|
Map<String, Object> params = bo.getParams(); |
||||
|
LambdaQueryWrapper<SysSubmailLog> lqw = Wrappers.lambdaQuery(); |
||||
|
lqw.eq(bo.getSubmailConfigId() != null, SysSubmailLog::getSubmailConfigId, bo.getSubmailConfigId()); |
||||
|
lqw.like(StringUtils.isNotBlank(bo.getName()), SysSubmailLog::getName, bo.getName()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getCode()), SysSubmailLog::getCode, bo.getCode()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getUrl()), SysSubmailLog::getUrl, bo.getUrl()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getToReceiver()), SysSubmailLog::getToReceiver, bo.getToReceiver()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getContent()), SysSubmailLog::getContent, bo.getContent()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getProject()), SysSubmailLog::getProject, bo.getProject()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getMulti()), SysSubmailLog::getMulti, bo.getMulti()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getVars()), SysSubmailLog::getVars, bo.getVars()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getTag()), SysSubmailLog::getTag, bo.getTag()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getTimestamp()), SysSubmailLog::getTimestamp, bo.getTimestamp()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSignType()), SysSubmailLog::getSignType, bo.getSignType()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSignVersion()), SysSubmailLog::getSignVersion, bo.getSignVersion()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getLatestResStatus()), SysSubmailLog::getLatestResStatus, bo.getLatestResStatus()); |
||||
|
return lqw; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增赛邮服务发送log |
||||
|
* |
||||
|
* @param bo 赛邮服务发送log |
||||
|
* @return 是否新增成功 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Boolean insertByBo(SysSubmailLogBo bo) { |
||||
|
SysSubmailLog add = MapstructUtils.convert(bo, SysSubmailLog.class); |
||||
|
validEntityBeforeSave(add); |
||||
|
boolean flag = baseMapper.insert(add) > 0; |
||||
|
if (flag) { |
||||
|
bo.setId(add.getId()); |
||||
|
} |
||||
|
return flag; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改赛邮服务发送log |
||||
|
* |
||||
|
* @param bo 赛邮服务发送log |
||||
|
* @return 是否修改成功 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Boolean updateByBo(SysSubmailLogBo bo) { |
||||
|
SysSubmailLog update = MapstructUtils.convert(bo, SysSubmailLog.class); |
||||
|
validEntityBeforeSave(update); |
||||
|
return baseMapper.updateById(update) > 0; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 保存前的数据校验 |
||||
|
*/ |
||||
|
private void validEntityBeforeSave(SysSubmailLog entity){ |
||||
|
//TODO 做一些数据校验,如唯一约束
|
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 校验并批量删除赛邮服务发送log信息 |
||||
|
* |
||||
|
* @param ids 待删除的主键集合 |
||||
|
* @param isValid 是否进行有效性校验 |
||||
|
* @return 是否删除成功 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
||||
|
if(isValid){ |
||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
|
} |
||||
|
return baseMapper.deleteByIds(ids) > 0; |
||||
|
} |
||||
|
} |
@ -0,0 +1,7 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper |
||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="org.dromara.system.mapper.SysSubmailConfigMapper"> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,7 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper |
||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="org.dromara.system.mapper.SysSubmailConfigUserMapper"> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,7 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper |
||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="org.dromara.system.mapper.SysSubmailLogMapper"> |
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue