Browse Source

BUG 修复

master
wxc 2 years ago
parent
commit
baa25e34be
  1. 4
      mailbox-common/src/main/java/com/biutag/enums/RoleEnum.java
  2. 25
      mailbox-lan/src/main/java/com/biutag/lan/controller/NoticeController.java
  3. 13
      mailbox-lan/src/main/java/com/biutag/lan/controller/system/DeptController.java
  4. 9
      mailbox-lan/src/main/java/com/biutag/lan/controller/system/PoliceUserController.java
  5. 2
      mailbox-lan/src/main/java/com/biutag/lan/controller/work/WorkController.java
  6. 34
      mailbox-lan/src/main/java/com/biutag/lan/domain/SmsSend.java
  7. 2
      mailbox-lan/src/main/java/com/biutag/lan/enums/WorkType.java
  8. 2
      mailbox-lan/src/main/java/com/biutag/lan/flow/FlowConfig.java
  9. 2
      mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNameEnum.java
  10. 3
      mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNodeEnum.java
  11. 2
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/CoHandlingFlow.java
  12. 4
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstSignFlow.java
  13. 8
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondDistributeFlow.java
  14. 11
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondSignFlow.java
  15. 23
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeSignFlow.java
  16. 40
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeVerifyFlow.java
  17. 2
      mailbox-lan/src/main/java/com/biutag/lan/mapper/PoliceUserMapper.java
  18. 7
      mailbox-lan/src/main/java/com/biutag/lan/mapper/SmsSendMapper.java
  19. 2
      mailbox-lan/src/main/java/com/biutag/lan/service/IDeptService.java
  20. 2
      mailbox-lan/src/main/java/com/biutag/lan/service/IPoliceUserService.java
  21. 2
      mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java
  22. 14
      mailbox-lan/src/main/java/com/biutag/lan/service/NoticeService.java
  23. 23
      mailbox-lan/src/main/java/com/biutag/lan/service/SmsService.java
  24. 16
      mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java
  25. 46
      mailbox-lan/src/main/java/com/biutag/lan/service/impl/DeptServiceImpl.java
  26. 8
      mailbox-lan/src/main/java/com/biutag/lan/service/impl/PoliceUserServiceImpl.java
  27. 44
      mailbox-lan/src/main/java/com/biutag/lan/util/SmsLan.java
  28. 6
      mailbox-outer/src/main/java/com/biutag/outer/job/Job.java

4
mailbox-common/src/main/java/com/biutag/enums/RoleEnum.java

@ -40,4 +40,8 @@ public enum RoleEnum {
return null; return null;
} }
public static boolean isClasses(Integer roleId) {
return MUNICIPAL_DEPT_CLASSES.getRoleId().equals(roleId) || SECOND_DEPT_CLASSES.getRoleId().equals(roleId) || THREE_DEPT_CLASSES.getRoleId().equals(roleId);
}
} }

25
mailbox-lan/src/main/java/com/biutag/lan/controller/NoticeController.java

@ -5,9 +5,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.aop.NotPower; import com.biutag.aop.NotPower;
import com.biutag.core.AjaxResult; import com.biutag.core.AjaxResult;
import com.biutag.enums.RoleEnum;
import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.Notice; import com.biutag.lan.domain.Notice;
import com.biutag.lan.domain.Work; import com.biutag.lan.domain.Work;
import com.biutag.lan.domain.bo.MailQuery;
import com.biutag.lan.domain.vo.NoticeTotalVo; import com.biutag.lan.domain.vo.NoticeTotalVo;
import com.biutag.lan.domain.vo.QueryMailVo;
import com.biutag.lan.domain.vo.WorkVo;
import com.biutag.lan.flow.FlowNameEnum; import com.biutag.lan.flow.FlowNameEnum;
import com.biutag.lan.service.NoticeService; import com.biutag.lan.service.NoticeService;
import com.biutag.lan.service.WorkService; import com.biutag.lan.service.WorkService;
@ -28,14 +33,28 @@ public class NoticeController {
@NotPower @NotPower
@GetMapping("total") @GetMapping("total")
public AjaxResult<NoticeTotalVo> total() { public AjaxResult<NoticeTotalVo> total() {
IPage<Notice> noticeIPage = noticeService.pageByCurrentUser(new Page<>(1, 1)); Page<WorkVo> workVoPage = workService.page(Work.State.todo.name(), new Page<>(1, 1), new MailQuery());
return AjaxResult.success(new NoticeTotalVo().setTotal(noticeIPage.getTotal()).setNotice(noticeIPage.getRecords().stream().findFirst().orElse(null))); NoticeTotalVo vo = new NoticeTotalVo().setTotal(workVoPage.getTotal());
if (vo.getTotal() > 0) {
IPage<Notice> noticeIPage = noticeService.pageByCurrentUser(new Page<>(1, 1));
vo.setNotice(noticeIPage.getRecords().stream().findFirst().orElse(null));
}
return AjaxResult.success(vo);
} }
@NotPower @NotPower
@GetMapping("newMailAudio") @GetMapping("newMailAudio")
public AjaxResult<Boolean> newMailAudio() { public AjaxResult<Boolean> newMailAudio() {
long count = workService.count(new LambdaQueryWrapper<Work>().eq(Work::getFlowName, FlowNameEnum.PENDING_SIGN.getName()).eq(Work::getWorkState, Work.State.todo.name())); Integer roleId = AdminThreadLocal.getRoleId();
if (!RoleEnum.isClasses(roleId)) {
return AjaxResult.success(false);
}
LambdaQueryWrapper<Work> queryWrapper = new LambdaQueryWrapper<Work>()
.eq(Work::getFlowName, FlowNameEnum.PENDING_SIGN.getName())
.eq(Work::getWorkState, Work.State.todo.name())
.eq(Work::getSignDeptId, AdminThreadLocal.getDeptId())
.eq(Work::getSignRoleId, roleId);
long count = workService.count(queryWrapper);
return AjaxResult.success(count > 0); return AjaxResult.success(count > 0);
} }

13
mailbox-lan/src/main/java/com/biutag/lan/controller/system/DeptController.java

@ -2,6 +2,7 @@ package com.biutag.lan.controller.system;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.biutag.aop.NotPower; import com.biutag.aop.NotPower;
import com.biutag.core.AjaxResult;
import com.biutag.entity.system.Dept; import com.biutag.entity.system.Dept;
import com.biutag.lan.service.IDeptService; import com.biutag.lan.service.IDeptService;
import com.biutag.lan.validate.commons.IdValidate; import com.biutag.lan.validate.commons.IdValidate;
@ -9,21 +10,19 @@ import com.biutag.lan.validate.system.DeptCreateValidate;
import com.biutag.lan.validate.system.DeptSearchValidate; import com.biutag.lan.validate.system.DeptSearchValidate;
import com.biutag.lan.validate.system.DeptUpdateValidate; import com.biutag.lan.validate.system.DeptUpdateValidate;
import com.biutag.lan.vo.system.DeptVo; import com.biutag.lan.vo.system.DeptVo;
import com.biutag.core.AjaxResult;
import com.biutag.validator.annotation.IDMust; import com.biutag.validator.annotation.IDMust;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import java.util.List; import java.util.List;
@RestController @RestController
@RequestMapping("api/system/dept") @RequestMapping("api/system/dept")
@Api(tags = "系统部门管理") @Api(tags = "系统部门管理")
public class DeptController { public class DeptController {
@Resource @Resource
IDeptService iDeptService; IDeptService iDeptService;
@ -35,6 +34,14 @@ public class DeptController {
return AjaxResult.success(list); return AjaxResult.success(list);
} }
@NotPower
@GetMapping("/all/tree")
@ApiOperation(value="部门树结构")
public AjaxResult<JSONArray> allTree() {
JSONArray list = iDeptService.allTree();
return AjaxResult.success(list);
}
@NotPower @NotPower
@GetMapping("/list") @GetMapping("/list")
@ApiOperation(value="部门列表") @ApiOperation(value="部门列表")

9
mailbox-lan/src/main/java/com/biutag/lan/controller/system/PoliceUserController.java

@ -154,9 +154,16 @@ public class PoliceUserController {
@GetMapping("/listByCurrentEmpNo") @GetMapping("/listByCurrentEmpNo")
@ApiOperation(value="当前人员信息") @ApiOperation(value="当前人员信息")
public AjaxResult<List<PoliceUser>> listByCurrentEmpNo(String departId ,String EmpNo) { public AjaxResult<List<PoliceUser>> listByCurrentEmpNo(String departId ,String EmpNo) {
return AjaxResult.success(iPoliceUserService.listByCurrentEmpNo(departId,EmpNo)); return AjaxResult.success(iPoliceUserService.listByCurrentEmpNo(departId,EmpNo));
} }
@NotPower
@GetMapping("/listByCoHanding")
@ApiOperation(value="")
public AjaxResult<List<PoliceUser>> listByCoHanding() {
return AjaxResult.success(iPoliceUserService.listByCoHanding());
}
} }

2
mailbox-lan/src/main/java/com/biutag/lan/controller/work/WorkController.java

@ -82,7 +82,7 @@ public class WorkController {
@NotPower @NotPower
@NotLogin @NotLogin
@GetMapping("send") @GetMapping("send")
public String getFlow(@RequestParam String msg) { public String getFlow(@RequestParam String msg) throws Exception {
return SmsLan.send("15973160301", msg, "TEST01"); return SmsLan.send("15973160301", msg, "TEST01");
} }

34
mailbox-lan/src/main/java/com/biutag/lan/domain/SmsSend.java

@ -0,0 +1,34 @@
package com.biutag.lan.domain;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
@Accessors(chain = true)
@Setter
@Getter
public class SmsSend {
private Integer id;
/**
* 手机号
*/
private String phone;
/**
* 内容
*/
private String content;
/**
*
*/
private LocalDateTime createTime;
/**
*
*/
private String mailId;
private Boolean success;
}

2
mailbox-lan/src/main/java/com/biutag/lan/enums/WorkType.java

@ -10,6 +10,6 @@ public enum WorkType {
extension_approval, extension_approval,
// 协办 // 协办
co_organizers; co_handling;
} }

2
mailbox-lan/src/main/java/com/biutag/lan/flow/FlowConfig.java

@ -181,7 +181,7 @@ public class FlowConfig {
.setFlowNode(getFlowNode(flowNodes, FlowNodeEnum.COUNTERSIGN)); .setFlowNode(getFlowNode(flowNodes, FlowNodeEnum.COUNTERSIGN));
coHandlingFlow.setFlowNode(getFlowNode(flowNodes, FlowNodeEnum.CO_HANDLING)) coHandlingFlow.setFlowNode(getFlowNode(flowNodes, FlowNodeEnum.SECONDARY_VERIFY))
.setActions(Collections.singletonList(coReportAction)); .setActions(Collections.singletonList(coReportAction));
} }

2
mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNameEnum.java

@ -28,7 +28,7 @@ public enum FlowNameEnum {
MAIL_RETURN("信件退回", "信件退回"), MAIL_RETURN("信件退回", "信件退回"),
RETURN_RECTIFICATION("退回整改", "退回整改"), RETURN_RECTIFICATION("退回整改", "退回整改"),
CO_HANDLING("协查办理", "协查办理"); SECONDARY_VERIFY("协办核查", "协办核查");
private String name; private String name;

3
mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNodeEnum.java

@ -24,10 +24,9 @@ public enum FlowNodeEnum {
FIRST_APPROVAL("first_approval", "市局专班认定办结", 15), FIRST_APPROVAL("first_approval", "市局专班认定办结", 15),
COUNTERSIGN("countersign", "部门会签", 16), COUNTERSIGN("countersign", "部门会签", 16),
COMPLETION("completion", "已办结", 17), COMPLETION("completion", "已办结", 17),
CO_HANDLING("co_handling", "协查办理", 18), SECONDARY_VERIFY("co_handling", "协办核查", 18),
CHANGE_TODO("change_todo", "转为待办", 19); CHANGE_TODO("change_todo", "转为待办", 19);
private String key; private String key;
private String fullName; private String fullName;

2
mailbox-lan/src/main/java/com/biutag/lan/flow/node/CoHandlingFlow.java

@ -38,7 +38,7 @@ public class CoHandlingFlow extends Flow {
.setCreateTime(now) .setCreateTime(now)
.setVerifyDetails(verifyDetails) .setVerifyDetails(verifyDetails)
.setVerifyAttachments(verifyAttachments.toJSONString()) .setVerifyAttachments(verifyAttachments.toJSONString())
.setCoType(WorkType.co_organizers.name().equals(work.getWorkType()) ? CoType.co_organizers.name() : CoType.secondary.name()); .setCoType(CoType.secondary.name());
mailCoHandlingService.save(mailCoHandling); mailCoHandlingService.save(mailCoHandling);
work.setWorkState(Work.State.done.name()).setUpdateTime(now); work.setWorkState(Work.State.done.name()).setUpdateTime(now);

4
mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstSignFlow.java

@ -32,6 +32,7 @@ public class FirstSignFlow extends Flow {
private final MailApprovalService mailApprovalService; private final MailApprovalService mailApprovalService;
private final MailExtensionApprovalService mailExtensionApprovalService; private final MailExtensionApprovalService mailExtensionApprovalService;
private final MailCountersignService mailCountersignService; private final MailCountersignService mailCountersignService;
private final NoticeService noticeService;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@ -88,6 +89,7 @@ public class FirstSignFlow extends Flow {
.setFlowName(nextNode.getFlowNode().getBeforeName()) .setFlowName(nextNode.getFlowNode().getBeforeName())
.setFlowLimitedLastHandlerTime(mailSource.getCreateTime()); .setFlowLimitedLastHandlerTime(mailSource.getCreateTime());
mailService.save(mail); mailService.save(mail);
noticeService.sendNoticeDoneByRole();
return nextNode; return nextNode;
} }
@ -112,6 +114,7 @@ public class FirstSignFlow extends Flow {
mailService.save(mail); mailService.save(mail);
// 更新为已办 // 更新为已办
workService.updateDoneByRole(mailId, null); workService.updateDoneByRole(mailId, null);
noticeService.sendNoticeDoneByRole();
return null; return null;
} }
@ -133,6 +136,7 @@ public class FirstSignFlow extends Flow {
mailService.save(mail); mailService.save(mail);
// 更新为已办 // 更新为已办
workService.updateDoneByRole(mailId, null); workService.updateDoneByRole(mailId, null);
noticeService.sendNoticeDoneByRole();
return null; return null;
} }

8
mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondDistributeFlow.java

@ -62,15 +62,15 @@ public class SecondDistributeFlow extends Flow {
} else { } else {
// 非主责 // 非主责
workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), mainDeptId, now, false, workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), mainDeptId, now, false,
FlowNameEnum.CO_HANDLING.getName(), FlowNameEnum.SECONDARY_VERIFY.getName(),
FlowNodeEnum.CO_HANDLING.getKey()); FlowNodeEnum.VERIFY.getKey());
} }
Integer secondDeptId1 = data.getInteger("secondDeptId1"); Integer secondDeptId1 = data.getInteger("secondDeptId1");
if (Objects.nonNull(secondDeptId1)) { if (Objects.nonNull(secondDeptId1)) {
// 下发信件(次责单位1) // 下发信件(次责单位1)
workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), secondDeptId1, now, false, workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), secondDeptId1, now, false,
FlowNameEnum.PENDING_SIGN_CO.getName(), FlowNameEnum.PENDING_SIGN_CO.getName(),
FlowNodeEnum.CO_HANDLING.getKey()); FlowNodeEnum.VERIFY.getKey());
secondDistributeInfo.put("secondDept1", JSONObject.of("id", secondDeptId1)); secondDistributeInfo.put("secondDept1", JSONObject.of("id", secondDeptId1));
} }
Integer secondDeptId2 = data.getInteger("secondDeptId2"); Integer secondDeptId2 = data.getInteger("secondDeptId2");
@ -78,7 +78,7 @@ public class SecondDistributeFlow extends Flow {
// 下发信件(次责单位2) // 下发信件(次责单位2)
workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), secondDeptId2, now, false, workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), secondDeptId2, now, false,
FlowNameEnum.PENDING_SIGN_CO.getName(), FlowNameEnum.PENDING_SIGN_CO.getName(),
FlowNodeEnum.CO_HANDLING.getKey()); FlowNodeEnum.VERIFY.getKey());
secondDistributeInfo.put("secondDept2", JSONObject.of("id", secondDeptId2)); secondDistributeInfo.put("secondDept2", JSONObject.of("id", secondDeptId2));
} }
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);

11
mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondSignFlow.java

@ -11,10 +11,7 @@ import com.biutag.lan.flow.ActionEnum;
import com.biutag.lan.flow.Flow; import com.biutag.lan.flow.Flow;
import com.biutag.lan.flow.FlowNameEnum; import com.biutag.lan.flow.FlowNameEnum;
import com.biutag.lan.flow.FlowNodeEnum; import com.biutag.lan.flow.FlowNodeEnum;
import com.biutag.lan.service.MailMarkService; import com.biutag.lan.service.*;
import com.biutag.lan.service.MailReturnService;
import com.biutag.lan.service.MailService;
import com.biutag.lan.service.WorkService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -38,6 +35,8 @@ public class SecondSignFlow extends Flow {
private final MailMarkService mailMarkService; private final MailMarkService mailMarkService;
private final NoticeService noticeService;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Flow next(String nextActionKey, String mailId, JSONObject data) { public Flow next(String nextActionKey, String mailId, JSONObject data) {
@ -93,6 +92,8 @@ public class SecondSignFlow extends Flow {
mailService.updateById(mail); mailService.updateById(mail);
// 删除统计表 // 删除统计表
mailMarkService.removeById(mailId); mailMarkService.removeById(mailId);
// 通知
noticeService.sendNoticeDoneByRole();
return null; return null;
} }
@ -125,6 +126,8 @@ public class SecondSignFlow extends Flow {
.setFlowName(nextNode.getFlowNode().getBeforeName()); .setFlowName(nextNode.getFlowNode().getBeforeName());
mailService.updateById(mail); mailService.updateById(mail);
} }
// 通知
noticeService.sendNoticeDoneByRole();
return nextNode; return nextNode;
} }

23
mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeSignFlow.java

@ -15,6 +15,7 @@ import com.biutag.lan.flow.FlowNameEnum;
import com.biutag.lan.flow.FlowNodeEnum; import com.biutag.lan.flow.FlowNodeEnum;
import com.biutag.lan.service.MailReturnService; import com.biutag.lan.service.MailReturnService;
import com.biutag.lan.service.MailService; import com.biutag.lan.service.MailService;
import com.biutag.lan.service.NoticeService;
import com.biutag.lan.service.WorkService; import com.biutag.lan.service.WorkService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
@ -40,6 +41,8 @@ public class ThreeSignFlow extends Flow {
private final MailReturnService mailReturnService; private final MailReturnService mailReturnService;
private final NoticeService noticeService;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Flow next(String nextActionKey, String mailId, JSONObject data) { public Flow next(String nextActionKey, String mailId, JSONObject data) {
@ -51,16 +54,14 @@ public class ThreeSignFlow extends Flow {
public Flow mailReturn(String mailId, JSONObject data) { public Flow mailReturn(String mailId, JSONObject data) {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
Integer roleId = AdminThreadLocal.getRoleId();
Integer deptId = AdminThreadLocal.getDeptId(); Integer deptId = AdminThreadLocal.getDeptId();
Work work = workService.getOne(mailId, roleId ,deptId); Work work = workService.getOne(mailId, RoleEnum.THREE_DEPT_CLASSES.getRoleId(),deptId);
if (work.getWorkState().equals(Work.State.done.name())) { if (work.getWorkState().equals(Work.State.done.name())) {
throw new BusinessException("该信件已被其他专班处理"); throw new BusinessException("该信件已被其他专班处理");
} }
String reason = data.getString("reason"); String reason = data.getString("reason");
Assert.hasText(reason, "参数错误"); Assert.hasText(reason, "参数错误");
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
MailReturn mailReturn = new MailReturn() MailReturn mailReturn = new MailReturn()
.setMailId(mailId) .setMailId(mailId)
.setReason(reason) .setReason(reason)
@ -73,6 +74,8 @@ public class ThreeSignFlow extends Flow {
// 更新已办 // 更新已办
work.setUpdateTime(now).setWorkState(Work.State.done.name()).setFlowName(FlowNameEnum.MAIL_RETURN.getDoneName()); work.setUpdateTime(now).setWorkState(Work.State.done.name()).setFlowName(FlowNameEnum.MAIL_RETURN.getDoneName());
workService.updateById(work); workService.updateById(work);
// 将所有协办的待办更新为已办
workService.updateDoneByCoHandling(mailId);
// 更新二级机构专班的待办 // 更新二级机构专班的待办
workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), mail.getSecondDeptId(), FlowNameEnum.MAIL_RETURN.getName()); workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), mail.getSecondDeptId(), FlowNameEnum.MAIL_RETURN.getName());
// 更新信件 // 更新信件
@ -80,6 +83,8 @@ public class ThreeSignFlow extends Flow {
.setFlowKey(FlowNodeEnum.SECOND_DISTRIBUTE.getKey()) .setFlowKey(FlowNodeEnum.SECOND_DISTRIBUTE.getKey())
.setFlowName(FlowNameEnum.MAIL_RETURN.getName()); .setFlowName(FlowNameEnum.MAIL_RETURN.getName());
mailService.updateById(mail); mailService.updateById(mail);
// 通知
noticeService.sendNoticeDoneByRole();
return null; return null;
} }
@ -104,6 +109,8 @@ public class ThreeSignFlow extends Flow {
.setFlowKey(nextNode.getFlowNode().getKey()) .setFlowKey(nextNode.getFlowNode().getKey())
.setFlowName(nextNode.getFlowNode().getBeforeName()); .setFlowName(nextNode.getFlowNode().getBeforeName());
mailService.updateById(mail); mailService.updateById(mail);
// 通知
noticeService.sendNoticeDoneByRole();
return nextNode; return nextNode;
} }
@ -114,7 +121,11 @@ public class ThreeSignFlow extends Flow {
if (Objects.nonNull(coHandlingPolices) && coHandlingPolices.size() > 0) { if (Objects.nonNull(coHandlingPolices) && coHandlingPolices.size() > 0) {
for (Object coHandingPolice : coHandlingPolices) { for (Object coHandingPolice : coHandlingPolices) {
Map obj = (LinkedHashMap) coHandingPolice; Map obj = (LinkedHashMap) coHandingPolice;
String empNo = obj.get("empNo").toString(); Object empNoObj = obj.get("empNo");
if (Objects.isNull(empNoObj)) {
continue;
}
String empNo = empNoObj.toString();
Work coWork = workService.getOne(mail.getId(), empNo); Work coWork = workService.getOne(mail.getId(), empNo);
if (Objects.nonNull(coWork)) { if (Objects.nonNull(coWork)) {
continue; continue;
@ -125,9 +136,7 @@ public class ThreeSignFlow extends Flow {
.setPoliceEmpNo(empNo) .setPoliceEmpNo(empNo)
.setCreateTime(now) .setCreateTime(now)
.setWorkState(Work.State.todo.name()) .setWorkState(Work.State.todo.name())
.setFlowName(FlowNameEnum.CO_HANDLING.getName()) .setWorkType(WorkType.co_handling.name());
.setWorkType(WorkType.co_organizers.name())
.setFlowKey(FlowNodeEnum.CO_HANDLING.getKey()).setUpdateTime(now);
workService.save(work); workService.save(work);
} }
} }

40
mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeVerifyFlow.java

@ -18,6 +18,7 @@ import com.biutag.lan.enums.WorkType;
import com.biutag.lan.flow.ActionEnum; import com.biutag.lan.flow.ActionEnum;
import com.biutag.lan.flow.Flow; import com.biutag.lan.flow.Flow;
import com.biutag.lan.flow.FlowNameEnum; import com.biutag.lan.flow.FlowNameEnum;
import com.biutag.lan.flow.FlowNodeEnum;
import com.biutag.lan.service.IPoliceUserService; import com.biutag.lan.service.IPoliceUserService;
import com.biutag.lan.service.MailService; import com.biutag.lan.service.MailService;
import com.biutag.lan.service.SmsService; import com.biutag.lan.service.SmsService;
@ -87,12 +88,6 @@ public class ThreeVerifyFlow extends Flow {
} }
public Flow save(String mailId, JSONObject data) { public Flow save(String mailId, JSONObject data) {
JSONObject verifyFollowupPoliceObj = data.getJSONObject("verifyFollowupPolice");
Assert.notNull(verifyFollowupPoliceObj, "请填写回访人信息");
String verifyFollowupPolice = JSONObject
.of("name", verifyFollowupPoliceObj.getString("name"),
"empNo", verifyFollowupPoliceObj.getString("empNo"),
"mobile", verifyFollowupPoliceObj.getString("mobile")).toJSONString();
JSONObject contactPolice = data.getJSONObject("contactPolice"); JSONObject contactPolice = data.getJSONObject("contactPolice");
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
Mail source = new Mail() Mail source = new Mail()
@ -120,14 +115,20 @@ public class ThreeVerifyFlow extends Flow {
.setVerifyPunish(data.getString("verifyPunish")) .setVerifyPunish(data.getString("verifyPunish"))
.setVerifyIsResolved(data.getBoolean("verifyIsResolved")) .setVerifyIsResolved(data.getBoolean("verifyIsResolved"))
.setVerifyFeedback(data.getString("verifyFeedback")) .setVerifyFeedback(data.getString("verifyFeedback"))
.setVerifyFollowupPolice(verifyFollowupPolice)
.setVerifyAttachments(data.getString("verifyAttachments")); .setVerifyAttachments(data.getString("verifyAttachments"));
JSONObject verifyFollowupPoliceObj = data.getJSONObject("verifyFollowupPolice");
if (Objects.nonNull(verifyFollowupPoliceObj)) {
String verifyFollowupPolice = JSONObject
.of("name", verifyFollowupPoliceObj.getString("name"),
"empNo", verifyFollowupPoliceObj.getString("empNo"),
"mobile", verifyFollowupPoliceObj.getString("mobile")).toJSONString();
source.setVerifyFollowupPolice(verifyFollowupPolice);
}
BeanUtil.copyProperties(source, mail, CopyOptions.create().setIgnoreNullValue(true)); BeanUtil.copyProperties(source, mail, CopyOptions.create().setIgnoreNullValue(true));
// 处理协办民警
threeSignFlow.saveCoHandling(mail, data);
JSONArray coHandlingPolices = data.getJSONArray("coHandlingPolices"); JSONArray coHandlingPolices = data.getJSONArray("coHandlingPolices");
if (Objects.nonNull(coHandlingPolices) && !coHandlingPolices.isEmpty()) { if (Objects.nonNull(coHandlingPolices) && !coHandlingPolices.isEmpty()) {
// 处理协办民警
threeSignFlow.saveCoHandling(mail, data);
mail.setCoHandlingPolices(coHandlingPolices.toJSONString()); mail.setCoHandlingPolices(coHandlingPolices.toJSONString());
} }
mailService.updateById(mail); mailService.updateById(mail);
@ -135,11 +136,13 @@ public class ThreeVerifyFlow extends Flow {
} }
public void applicationCompleted(String nextActionKey, Mail mail, JSONObject data, LocalDateTime now) { public void applicationCompleted(String nextActionKey, Mail mail, JSONObject data, LocalDateTime now) {
// 校验信件流程环节
if (!mail.getFlowKey().equals(FlowNodeEnum.VERIFY.getKey())) {
throw new BusinessException("该信件已被其他人处理,请刷新后重试");
}
JSONObject verifyFollowupPoliceObj = data.getJSONObject("verifyFollowupPolice"); JSONObject verifyFollowupPoliceObj = data.getJSONObject("verifyFollowupPolice");
Assert.notNull(verifyFollowupPoliceObj, "参数异常"); Assert.notNull(verifyFollowupPoliceObj, "参数异常");
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);
JSONObject contactPolice = data.getJSONObject("contactPolice"); JSONObject contactPolice = data.getJSONObject("contactPolice");
String verifyFollowupPolice = JSONObject String verifyFollowupPolice = JSONObject
.of("name", verifyFollowupPoliceObj.getString("name"), .of("name", verifyFollowupPoliceObj.getString("name"),
@ -186,19 +189,14 @@ public class ThreeVerifyFlow extends Flow {
PoliceUser policeUser = policeUserService.getOneByEmpNo(leaderEmpNo); PoliceUser policeUser = policeUserService.getOneByEmpNo(leaderEmpNo);
mail.setCurrentOperator(String.format("%s %s", mail.getThreeDeptName(), policeUser.getName())); mail.setCurrentOperator(String.format("%s %s", mail.getThreeDeptName(), policeUser.getName()));
} }
// 将本人下的件改为已办 // 将本人下的件改为已办
workService.updateDoneByRole(mail.getId(), FlowNameEnum.VERIFY.getDoneName()); workService.updateDoneByRole(mail.getId(), RoleEnum.THREE_DEPT_CLASSES.getRoleId(), FlowNameEnum.VERIFY.getDoneName());
// 处理协办民警 // 将所有协办改为已办
threeSignFlow.saveCoHandling(mail, data); workService.updateDoneByCoHandling(mail.getId());
JSONArray coHandlingPolices = data.getJSONArray("coHandlingPolices");
if (Objects.nonNull(coHandlingPolices) && !coHandlingPolices.isEmpty()) {
mail.setCoHandlingPolices(coHandlingPolices.toJSONString());
}
// 更新信件 // 更新信件
mailService.updateById(mail); mailService.updateById(mail);
// 发送通知短信 // 发送通知短信
smsService.sendNotification(mail.getContactPhone()); smsService.sendNotification(mail.getContactPhone(), mail.getId());
} }
public Flow offline(String nextActionKey, String mailId, JSONObject data) { public Flow offline(String nextActionKey, String mailId, JSONObject data) {

2
mailbox-lan/src/main/java/com/biutag/lan/mapper/PoliceUserMapper.java

@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.core.basics.IBaseMapper; import com.biutag.core.basics.IBaseMapper;
import com.biutag.entity.system.PoliceUser; import com.biutag.entity.system.PoliceUser;
import com.biutag.lan.vo.system.PoliceUserListedVo; import com.biutag.lan.vo.system.PoliceUserListedVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
@ -15,7 +14,6 @@ import java.util.List;
/** /**
* 系统管理员Mapper * 系统管理员Mapper
*/ */
@Mapper
public interface PoliceUserMapper extends IBaseMapper<PoliceUser> { public interface PoliceUserMapper extends IBaseMapper<PoliceUser> {
/** /**

7
mailbox-lan/src/main/java/com/biutag/lan/mapper/SmsSendMapper.java

@ -0,0 +1,7 @@
package com.biutag.lan.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.lan.domain.SmsSend;
public interface SmsSendMapper extends BaseMapper<SmsSend> {
}

2
mailbox-lan/src/main/java/com/biutag/lan/service/IDeptService.java

@ -23,6 +23,8 @@ public interface IDeptService {
*/ */
List<DeptVo> all(); List<DeptVo> all();
JSONArray allTree();
/** /**
* 部门列表 * 部门列表
* *

2
mailbox-lan/src/main/java/com/biutag/lan/service/IPoliceUserService.java

@ -166,4 +166,6 @@ public interface IPoliceUserService {
List<PoliceUser> listByCurrentDeptAndDeptPid(String departId ,String name); List<PoliceUser> listByCurrentDeptAndDeptPid(String departId ,String name);
List<PoliceUser> listByCurrentEmpNo(String departId ,String EmpNo); List<PoliceUser> listByCurrentEmpNo(String departId ,String EmpNo);
List<PoliceUser> listByCoHanding();
} }

2
mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java

@ -184,7 +184,7 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
public MailFlowDetail getMailFlowDetailByWork(String mailId, Integer workId) { public MailFlowDetail getMailFlowDetailByWork(String mailId, Integer workId) {
MailFlowDetail mailDetail = getMailFlowDetailByWork(mailId); MailFlowDetail mailDetail = getMailFlowDetailByWork(mailId);
Work work = workService.getById(workId); Work work = workService.getById(workId);
if (!work.getMainDeptFlag() || work.getWorkType().equals(WorkType.co_organizers.name())) { if (!work.getMainDeptFlag()) {
Flow flow = flowNodes.stream() Flow flow = flowNodes.stream()
.filter(item -> work.getFlowKey().equals(item.getFlowNode().getKey())) .filter(item -> work.getFlowKey().equals(item.getFlowNode().getKey()))
.findFirst().orElseThrow(() -> new BusinessException("没有该流程节点")); .findFirst().orElseThrow(() -> new BusinessException("没有该流程节点"));

14
mailbox-lan/src/main/java/com/biutag/lan/service/NoticeService.java

@ -29,7 +29,7 @@ public class NoticeService extends ServiceImpl<NoticeMapper, Notice> {
public void save(Integer roleId, Integer deptId, String content, Integer workId) { public void save(Integer roleId, Integer deptId, String content, Integer workId) {
Notice notice = new Notice().setRoleId(roleId).setDeptId(deptId).setContent(content).setCreateTime(LocalDateTime.now()).setReadFlag(AppConstants.NO).setWorkId(workId); Notice notice = new Notice().setRoleId(roleId).setDeptId(deptId).setContent(content).setCreateTime(LocalDateTime.now()).setReadFlag(AppConstants.NO).setWorkId(workId);
save(notice); save(notice);
messagingTemplate.convertAndSend(String.format("/topic/role/%s/%s", roleId, deptId), ""); messagingTemplate.convertAndSend(String.format("/topic/role/%s/%s", roleId, deptId), Work.State.todo.name());
log.info("发送通知:{}", String.format("/topic/role/%s/%s", roleId, deptId)); log.info("发送通知:{}", String.format("/topic/role/%s/%s", roleId, deptId));
} }
@ -37,10 +37,18 @@ public class NoticeService extends ServiceImpl<NoticeMapper, Notice> {
public void save(String empNo, String content, Integer workId) { public void save(String empNo, String content, Integer workId) {
Notice notice = new Notice().setEmpNo(empNo).setContent(content).setCreateTime(LocalDateTime.now()).setReadFlag(AppConstants.NO).setWorkId(workId); Notice notice = new Notice().setEmpNo(empNo).setContent(content).setCreateTime(LocalDateTime.now()).setReadFlag(AppConstants.NO).setWorkId(workId);
save(notice); save(notice);
messagingTemplate.convertAndSend(String.format("/topic/user/%s", empNo), ""); messagingTemplate.convertAndSend(String.format("/topic/user/%s", empNo), Work.State.todo.name());
log.info("发送通知:{}", String.format("/topic/user/%s", empNo)); log.info("发送通知:{}", String.format("/topic/user/%s", empNo));
} }
@Async
public void sendNoticeDoneByRole() {
Integer roleId = AdminThreadLocal.getRoleId();
Integer deptId = AdminThreadLocal.getDeptId();
log.info("发送通知:{}", String.format("/topic/role/%s/%s", roleId, deptId));
messagingTemplate.convertAndSend(String.format("/topic/role/%s/%s", roleId, deptId), Work.State.done.name());
}
public void save(Work work, String content) { public void save(Work work, String content) {
if (Objects.nonNull(work.getSignRoleId())) { if (Objects.nonNull(work.getSignRoleId())) {
save(work.getSignRoleId(), work.getSignDeptId(), content, work.getId()); save(work.getSignRoleId(), work.getSignDeptId(), content, work.getId());
@ -52,7 +60,7 @@ public class NoticeService extends ServiceImpl<NoticeMapper, Notice> {
public IPage<Notice> pageByCurrentUser(IPage<Notice> page) { public IPage<Notice> pageByCurrentUser(IPage<Notice> page) {
LambdaQueryWrapper<Notice> queryWrapper = new LambdaQueryWrapper<Notice>().eq(Notice::getReadFlag, AppConstants.NO); LambdaQueryWrapper<Notice> queryWrapper = new LambdaQueryWrapper<Notice>().eq(Notice::getReadFlag, AppConstants.NO);
Integer roleId = AdminThreadLocal.getRoleId(); Integer roleId = AdminThreadLocal.getRoleId();
if (roleId.equals(RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId()) || roleId.equals(RoleEnum.SECOND_DEPT_CLASSES.getRoleId()) || roleId.equals(RoleEnum.THREE_DEPT_CLASSES.getRoleId())) { if (RoleEnum.isClasses(roleId)) {
queryWrapper.eq(Notice::getRoleId, roleId).eq(Notice::getDeptId, AdminThreadLocal.getDeptId()); queryWrapper.eq(Notice::getRoleId, roleId).eq(Notice::getDeptId, AdminThreadLocal.getDeptId());
} else { } else {
queryWrapper.eq(Notice::getEmpNo, AdminThreadLocal.getEmpNo()); queryWrapper.eq(Notice::getEmpNo, AdminThreadLocal.getEmpNo());

23
mailbox-lan/src/main/java/com/biutag/lan/service/SmsService.java

@ -1,19 +1,38 @@
package com.biutag.lan.service; package com.biutag.lan.service;
import cn.hutool.core.util.PhoneUtil; import cn.hutool.core.util.PhoneUtil;
import com.biutag.lan.domain.SmsSend;
import com.biutag.lan.mapper.SmsSendMapper;
import com.biutag.lan.util.SmsLan; import com.biutag.lan.util.SmsLan;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
@Slf4j
@RequiredArgsConstructor
@Component @Component
public class SmsService { public class SmsService {
private final SmsSendMapper smsSendMapper;
@Async @Async
public void sendNotification(String phone) { public void sendNotification(String phone, String mailId) {
if (!PhoneUtil.isPhone(phone)) { if (!PhoneUtil.isPhone(phone)) {
return; return;
} }
SmsLan.send(phone, "请您及时登录局长信箱即接即办,并对您写的信件进行满意度评价,谢谢您的支持!"); String content = "请您及时登录局长信箱即接即办,并对您写的信件进行满意度评价,谢谢您的支持!";
try {
SmsLan.send(phone, content);
SmsSend smsSend = new SmsSend().setPhone(phone).setMailId(mailId).setContent(content).setCreateTime(LocalDateTime.now()).setSuccess(true);
smsSendMapper.insert(smsSend);
} catch (Exception e) {
SmsSend smsSend = new SmsSend().setPhone(phone).setMailId(mailId).setContent(content).setCreateTime(LocalDateTime.now()).setSuccess(false);
smsSendMapper.insert(smsSend);
log.error(e.getMessage(), e);
}
} }
} }

16
mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java

@ -171,7 +171,11 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
} }
public boolean updateDoneByRole(String mailId, String flowName) { public boolean updateDoneByRole(String mailId, String flowName) {
Work work = getOne(mailId, AdminThreadLocal.getRoleId(), AdminThreadLocal.getDeptId()); return updateDoneByRole(mailId, AdminThreadLocal.getRoleId(), flowName);
}
public boolean updateDoneByRole(String mailId, Integer roleId, String flowName) {
Work work = getOne(mailId, roleId, AdminThreadLocal.getDeptId());
if (work.getWorkState().equals(Work.State.done.name())) { if (work.getWorkState().equals(Work.State.done.name())) {
throw new BusinessException("该信件已被其他专班处理"); throw new BusinessException("该信件已被其他专班处理");
} }
@ -179,6 +183,16 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
return updateById(work); return updateById(work);
} }
public boolean updateDoneByCoHandling(String mailId) {
LambdaQueryWrapper<Work> queryWrapper = new LambdaQueryWrapper<Work>().eq(Work::getMailId, mailId)
.eq(Work::getWorkType, WorkType.co_handling.name())
.eq(Work::getWorkState, Work.State.todo.name());
List<Work> works = list(queryWrapper);
works.forEach(item -> {
item.setWorkState(Work.State.done.name()).setUpdateTime(LocalDateTime.now());
});
return updateBatchById(works);
}
public boolean updateDone(String mailId, String empNo, String flowName) { public boolean updateDone(String mailId, String empNo, String flowName) {
Work work = getOne(mailId, empNo); Work work = getOne(mailId, empNo);

46
mailbox-lan/src/main/java/com/biutag/lan/service/impl/DeptServiceImpl.java

@ -1,6 +1,7 @@
package com.biutag.lan.service.impl; package com.biutag.lan.service.impl;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Assert; import com.baomidou.mybatisplus.core.toolkit.Assert;
@ -55,18 +56,7 @@ class DeptServiceImpl implements IDeptService {
.gt("pid", 0) .gt("pid", 0)
.eq("is_delete", 0) .eq("is_delete", 0)
.orderByAsc((Arrays.asList("sort", "id"))); .orderByAsc((Arrays.asList("sort", "id")));
Integer roleId = AdminThreadLocal.getRoleId();
Integer deptId = AdminThreadLocal.getDeptId();
if (RoleEnum.SECOND_DEPT_CLASSES.getRoleId().equals(roleId)) {
queryWrapper.and(query -> {
query.eq("id", deptId).or().eq("pid", deptId);
});
}
if (RoleEnum.THREE_DEPT_CLASSES.getRoleId().equals(roleId)) {
queryWrapper.eq("id", deptId);
}
List<Dept> DeptList = deptMapper.selectList(queryWrapper); List<Dept> DeptList = deptMapper.selectList(queryWrapper);
List<DeptVo> list = new ArrayList<>(); List<DeptVo> list = new ArrayList<>();
for (Dept dept : DeptList) { for (Dept dept : DeptList) {
DeptVo vo = new DeptVo(); DeptVo vo = new DeptVo();
@ -78,6 +68,40 @@ class DeptServiceImpl implements IDeptService {
return list; return list;
} }
@Override
public JSONArray allTree() {
QueryWrapper<Dept> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_delete", 0);
queryWrapper.orderByAsc(Arrays.asList("sort", "id"));
queryWrapper.select(Dept.class, info ->
!info.getColumn().equals("is_delete") &&
!info.getColumn().equals("delete_time"));
deptMapper.setSearch(queryWrapper, new JSONObject(), new String[]{
"like:name:str",
"=:isStop@is_stop:int"
});
List<Dept> DeptList = deptMapper.selectList(queryWrapper);
List<DictData> dictDataList = dictDataMapper.selectList(new QueryWrapper<DictData>()
.select("id,type_id,name,value,remark,sort,status,create_time,update_time")
.eq("type_id", AppConstants.DEPT_TYPE_CATEGORY)//机构类型
.eq("is_delete", 0).orderByAsc("sort"));
List<DeptVo> list = new LinkedList<>();
for (Dept dept : DeptList) {
DeptVo vo = new DeptVo();
BeanUtils.copyProperties(dept, vo);
if(StringUtils.isNotEmpty(dept.getCategory()) ){
vo.setCategoryName(dictDataList.stream().filter(entity ->
entity.getValue().equals(dept.getCategory())).findFirst().get().getName()); ;
}
vo.setCreateTime(TimeUtils.timestampToDate(dept.getCreateTime()));
vo.setUpdateTime(TimeUtils.timestampToDate(dept.getUpdateTime()));
list.add(vo);
}
JSONArray jsonArray = JSONArray.parseArray(JSONArray.toJSONString(list));
return ListUtils.listToTree(jsonArray, "id", "pid", "children");
}
/** /**
* 部门列表 * 部门列表
* *

8
mailbox-lan/src/main/java/com/biutag/lan/service/impl/PoliceUserServiceImpl.java

@ -615,4 +615,12 @@ public class PoliceUserServiceImpl implements IPoliceUserService {
} }
@Override
public List<PoliceUser> listByCoHanding() {
LambdaQueryWrapper<PoliceUser> queryWrapper = new LambdaQueryWrapper<PoliceUser>()
.eq(PoliceUser::getDataDeptId, AdminThreadLocal.getDeptId())
.eq(PoliceUser::getRoleIds, RoleEnum.NORMAL_POLICE.getRoleId());
return policeUserMapper.selectList(queryWrapper);
}
} }

44
mailbox-lan/src/main/java/com/biutag/lan/util/SmsLan.java

@ -27,7 +27,7 @@ public class SmsLan {
private SmsLan() { private SmsLan() {
} }
public static String send(String mobile, String content) { public static String send(String mobile, String content) throws Exception {
return send(mobile, content, IdUtil.fastSimpleUUID()); return send(mobile, content, IdUtil.fastSimpleUUID());
} }
@ -105,29 +105,25 @@ public class SmsLan {
* @param orderNo 批次号 必填 * @param orderNo 批次号 必填
* @return * @return
*/ */
public static String send(String mobiles, String content, String orderNo) { public static String send(String mobiles, String content, String orderNo) throws Exception {
try { Map<String, Object> dataMap = new HashMap<>();
Map<String, Object> dataMap = new HashMap<>(); long timeStamp = System.currentTimeMillis() / 1000;
long timeStamp = System.currentTimeMillis() / 1000; dataMap.put("timeStamp", timeStamp);
dataMap.put("timeStamp", timeStamp); log.info("timeStamp: {}", timeStamp);
log.info("timeStamp: {}", timeStamp); dataMap.put("mobiles", mobiles);
dataMap.put("mobiles", mobiles); dataMap.put("content", content);
dataMap.put("content", content); dataMap.put("orderNo", orderNo);
dataMap.put("orderNo", orderNo); dataMap.put("appendID", "");
dataMap.put("appendID", ""); dataMap.put("sendTime", "");
dataMap.put("sendTime", ""); dataMap.put("validTime", "");
dataMap.put("validTime", ""); String jsonStr = JSON.toJSONString(dataMap);
String jsonStr = JSON.toJSONString(dataMap); log.info("jsonStr: {}", jsonStr);
log.info("jsonStr: {}", jsonStr); String key = encrypt(jsonStr, PASSWORD);
String key = encrypt(jsonStr, PASSWORD); key = URLEncoder.encode(key, "UTF-8");
key = URLEncoder.encode(key, "UTF-8"); log.info("key: {}", key);
log.info("key: {}", key); String response = httpUtilPost(BASE_URL, "userid=" + USERNAME + "&key=" + key);
String response = httpUtilPost(BASE_URL, "userid=" + USERNAME + "&key=" + key); log.info(response);
log.info(response); return response;
} catch (Exception e) {
e.printStackTrace();
}
return null;
} }
/** /**

6
mailbox-outer/src/main/java/com/biutag/outer/job/Job.java

@ -51,7 +51,7 @@ public class Job {
private final String key = "mailbox"; private final String key = "mailbox";
// 30s // 30s
@Scheduled(fixedRate = 30000) @Scheduled(fixedRate = 10000)
public void pushMailData() { public void pushMailData() {
System.out.println(LocalDateTime.now()); System.out.println(LocalDateTime.now());
List<Mail> mails = mailMapper.listByMailEtl(); List<Mail> mails = mailMapper.listByMailEtl();
@ -125,9 +125,9 @@ public class Job {
} }
/** /**
* 更新信件状态 30分钟 * 更新信件状态 30s
*/ */
@Scheduled(fixedRate = 1800000) @Scheduled(fixedRate = 30000)
public void updateMailState() { public void updateMailState() {
List<Mail> mails = mailMapper.listByMailState(); List<Mail> mails = mailMapper.listByMailState();
for (Mail mail : mails) { for (Mail mail : mails) {

Loading…
Cancel
Save