30 changed files with 2238 additions and 0 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,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