Browse Source

信件主流程

dev_ycq
wxc 2 years ago
parent
commit
13ed65139c
  1. 12
      mailbox-lan/src/main/java/com/biutag/lan/controller/HomeController.java
  2. 5
      mailbox-lan/src/main/java/com/biutag/lan/domain/Mail.java
  3. 7
      mailbox-lan/src/main/java/com/biutag/lan/domain/Work.java
  4. 12
      mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailVo.java
  5. 18
      mailbox-lan/src/main/java/com/biutag/lan/domain/vo/WorkVo.java
  6. 33
      mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNameEnum.java
  7. 2
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/CountersignFlow.java
  8. 3
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstApprovalFlow.java
  9. 16
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstDistributeFlow.java
  10. 3
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstSignFlow.java
  11. 5
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondApprovalFlow.java
  12. 3
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondDeputyApprovalFlow.java
  13. 7
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondDistributeFlow.java
  14. 3
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondLeaderApprovalFlow.java
  15. 3
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondReportingFlow.java
  16. 8
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondSignFlow.java
  17. 11
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeContactWriterFlow.java
  18. 18
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeInterviewWriterFlow.java
  19. 5
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeLeaderApprovalFlow.java
  20. 6
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeSignFlow.java
  21. 13
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeVerifyFlow.java
  22. 8
      mailbox-lan/src/main/java/com/biutag/lan/mapper/WorkMapper.java
  23. 15
      mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java
  24. 49
      mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java
  25. 8
      mailbox-lan/src/main/java/com/biutag/lan/service/impl/PoliceUserServiceImpl.java
  26. 2
      mailbox-lan/src/main/java/com/biutag/lan/validate/system/PoliceUserUpdateValidate.java
  27. 2
      mailbox-lan/src/main/java/com/biutag/lan/vo/system/PoliceUserDetailVo.java
  28. 4
      mailbox-lan/src/main/resources/application.yml
  29. 17
      mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml
  30. 13
      mailbox-lan/src/main/resources/mapper/WorkMapper.xml

12
mailbox-lan/src/main/java/com/biutag/lan/controller/HomeController.java

@ -53,13 +53,21 @@ public class HomeController {
Integer contactWriterTotal = workService.count(FlowNodeEnum.CONTACT_WRITER.getKey(), deptId); Integer contactWriterTotal = workService.count(FlowNodeEnum.CONTACT_WRITER.getKey(), deptId);
Integer interviewWriterTotal = workService.count(FlowNodeEnum.INTERVIEW_WRITER.getKey(), deptId); Integer interviewWriterTotal = workService.count(FlowNodeEnum.INTERVIEW_WRITER.getKey(), deptId);
Integer verifyTotal = workService.count(FlowNodeEnum.VERIFY.getKey(), deptId); Integer verifyTotal = workService.count(FlowNodeEnum.VERIFY.getKey(), deptId);
// 已申请延期
Integer extensionTotal = workService.count(true, deptId);
Integer approvalTotal = workService.count(Arrays.asList(FlowNodeEnum.THREE_LEADER_APPROVAL.getKey(),
FlowNodeEnum.SECOND_DEPUTY_APPROVAL.getKey(),
FlowNodeEnum.SECOND_LEADER_APPROVAL.getKey(),
FlowNodeEnum.SECOND_REPORTING.getKey(),
FlowNodeEnum.FIRST_APPROVAL.getKey(),
FlowNodeEnum.COUNTERSIGN.getKey()), deptId);
return AjaxResult.success(Arrays.asList(MailTotal.of("未签收", "un_sign", unSignTotal), return AjaxResult.success(Arrays.asList(MailTotal.of("未签收", "un_sign", unSignTotal),
MailTotal.of("联系群众", "contact_writer", contactWriterTotal), MailTotal.of("联系群众", "contact_writer", contactWriterTotal),
MailTotal.of("待接访群众", "interview_writer", interviewWriterTotal), MailTotal.of("待接访群众", "interview_writer", interviewWriterTotal),
MailTotal.of("待核查办理", "verify", verifyTotal), MailTotal.of("待核查办理", "verify", verifyTotal),
// TODO // TODO
MailTotal.of("申请延期", "extension", 0), MailTotal.of("申请延期", "extension", extensionTotal),
MailTotal.of("待办结审批", "approval", 0) MailTotal.of("待办结审批", "approval", approvalTotal)
)); ));
} }

5
mailbox-lan/src/main/java/com/biutag/lan/domain/Mail.java

@ -349,4 +349,9 @@ public class Mail {
*/ */
private String secondDistributeInfo; private String secondDistributeInfo;
/**
* 主办层级
*/
private Integer mainDeptLevel;
} }

7
mailbox-lan/src/main/java/com/biutag/lan/domain/Work.java

@ -89,10 +89,15 @@ public class Work {
private String content; private String content;
/** /**
* * 工作类型
*/ */
private String workType; private String workType;
/**
*
*/
private String flowName;
@AllArgsConstructor @AllArgsConstructor
public enum State { public enum State {
todo, todo,

12
mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailVo.java

@ -223,6 +223,8 @@ public class MailVo {
*/ */
private Integer threeDeptId; private Integer threeDeptId;
private String threeDeptName;
/** /**
* 涉及单位ID * 涉及单位ID
*/ */
@ -308,6 +310,16 @@ public class MailVo {
*/ */
private JSONObject secondDistributeInfo; private JSONObject secondDistributeInfo;
/**
* 办结方式
*/
private String completeMethod;
/**
* 主办层级
*/
private Integer mainDeptLevel;
/** /**
* 部门会签 * 部门会签
*/ */

18
mailbox-lan/src/main/java/com/biutag/lan/domain/vo/WorkVo.java

@ -78,12 +78,6 @@ public class WorkVo {
@ExcelProperty("流程节点ID") @ExcelProperty("流程节点ID")
private String flowKey; private String flowKey;
/**
* 信件当前流程节点
*/
@ExcelProperty("流程节点")
private String flowBeforeName;
/** /**
* 当前流程剩余多少时间 * 当前流程剩余多少时间
*/ */
@ -110,4 +104,16 @@ public class WorkVo {
*/ */
@ExcelProperty("信件标签") @ExcelProperty("信件标签")
private String mailLabels; private String mailLabels;
private String flowName;
/**
* 会签部门总数
*/
private Integer countersignTotal;
/**
* 会签完成部门数量
*/
private Integer countersignCompleted;
} }

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

@ -0,0 +1,33 @@
package com.biutag.lan.flow;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
public enum FlowNameEnum {
PENDING_SIGN("待签收"),
PENDING_SIGN_CO("待签收(协办)"),
PENDING_DISTRIBUTE("待下发"),
PENDING_DISTRIBUTE_CO("待下发(协办)"),
CONTACT_WRITER("联系群众"),
INTERVIEW_WRITER("接访群众"),
VERIFY("核查办理"),
PENDING_APPROVAL("待审批"),
PENDING_REPORT("待呈报"),
COUNTERSIGNING("会签中"),
PENDING_COUNTERSIGN("待会签"),
MAIL_RETURN("信件退回"),
RETURN_RECTIFICATION("退回整改");
@Getter
private String name;
}

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

@ -32,7 +32,6 @@ public class CountersignFlow extends Flow {
public Flow next(String nextActionKey, String mailId, JSONObject data) { public Flow next(String nextActionKey, String mailId, JSONObject data) {
String comments = data.getString("comments"); String comments = data.getString("comments");
Assert.hasText(comments, "参数错误"); Assert.hasText(comments, "参数错误");
Integer deptId = AdminThreadLocal.getDeptId(); Integer deptId = AdminThreadLocal.getDeptId();
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
List<MailCountersign> list = mailCountersignService.list(mailId); List<MailCountersign> list = mailCountersignService.list(mailId);
@ -49,7 +48,6 @@ public class CountersignFlow extends Flow {
workService.updateById(work); workService.updateById(work);
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
mail.setCountersignCompleted(count + 1).setUpdateTime(now); mail.setCountersignCompleted(count + 1).setUpdateTime(now);
if (mail.getCountersignCompleted() < mail.getCountersignTotal()) { if (mail.getCountersignCompleted() < mail.getCountersignTotal()) {
mailService.updateById(mail); mailService.updateById(mail);
return null; return null;

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

@ -11,6 +11,7 @@ import com.biutag.lan.domain.MailReturn;
import com.biutag.lan.enums.MailState; import com.biutag.lan.enums.MailState;
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.FlowNodeEnum; import com.biutag.lan.flow.FlowNodeEnum;
import com.biutag.lan.service.MailMarkService; import com.biutag.lan.service.MailMarkService;
import com.biutag.lan.service.MailReturnService; import com.biutag.lan.service.MailReturnService;
@ -103,7 +104,7 @@ public class FirstApprovalFlow extends Flow {
// 更新已办 // 更新已办
workService.updateDone(mailId, AdminThreadLocal.getEmpNo(), now); workService.updateDone(mailId, AdminThreadLocal.getEmpNo(), now);
// 更新三级机构专班的待办 // 更新三级机构专班的待办
workService.updateTodo(mailId, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), now); workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now, FlowNameEnum.RETURN_RECTIFICATION.getName());
// 更新信件 // 更新信件
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
mail.setUpdateTime(now) mail.setUpdateTime(now)

16
mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstDistributeFlow.java

@ -2,13 +2,10 @@ package com.biutag.lan.flow.node;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.biutag.enums.RoleEnum; import com.biutag.enums.RoleEnum;
import com.biutag.exception.BusinessException;
import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.MailMark;
import com.biutag.lan.domain.Work;
import com.biutag.lan.flow.Flow; import com.biutag.lan.flow.Flow;
import com.biutag.lan.flow.FlowNameEnum;
import com.biutag.lan.service.IDeptService; import com.biutag.lan.service.IDeptService;
import com.biutag.lan.service.MailMarkService;
import com.biutag.lan.service.MailService; import com.biutag.lan.service.MailService;
import com.biutag.lan.service.WorkService; import com.biutag.lan.service.WorkService;
import com.biutag.lan.vo.system.DeptVo; import com.biutag.lan.vo.system.DeptVo;
@ -38,6 +35,8 @@ public class FirstDistributeFlow extends Flow {
public Flow next(String nextActionKey, String mailId, JSONObject data) { public Flow next(String nextActionKey, String mailId, JSONObject data) {
Integer mainDeptId = data.getInteger("mainDeptId"); Integer mainDeptId = data.getInteger("mainDeptId");
Assert.notNull(mainDeptId, "未选择主责单位"); Assert.notNull(mainDeptId, "未选择主责单位");
Integer mainDeptLevel = data.getInteger("mainDeptLevel");
Assert.notNull(mainDeptId, "未选择主办层级");
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
// 将我的工作待办改成已办 // 将我的工作待办改成已办
@ -47,17 +46,17 @@ public class FirstDistributeFlow extends Flow {
JSONObject firstDistributeInfo = JSONObject.of("mainDept", JSONObject.of("id", mainDeptId), JSONObject firstDistributeInfo = JSONObject.of("mainDept", JSONObject.of("id", mainDeptId),
"secondDept", secondDept); "secondDept", secondDept);
// 下发信件(主责单位) // 下发信件(主责单位)
workService.saveOrUpdate(mail, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), mainDeptId, now, true); workService.saveOrUpdate(mail, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), mainDeptId, now, true, FlowNameEnum.PENDING_SIGN.getName());
Integer secondDeptId1 = data.getInteger("secondDeptId1"); Integer secondDeptId1 = data.getInteger("secondDeptId1");
if (Objects.nonNull(secondDeptId1)) { if (Objects.nonNull(secondDeptId1)) {
// 下发信件(次责单位1) // 下发信件(次责单位1)
workService.saveOrUpdate(mail, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), secondDeptId1, now, false); workService.saveOrUpdate(mail, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), secondDeptId1, now, false, FlowNameEnum.PENDING_SIGN_CO.getName());
firstDistributeInfo.put("secondDept1", JSONObject.of("id", secondDeptId1)); firstDistributeInfo.put("secondDept1", JSONObject.of("id", secondDeptId1));
} }
Integer secondDeptId2 = data.getInteger("secondDeptId2"); Integer secondDeptId2 = data.getInteger("secondDeptId2");
if (Objects.nonNull(secondDeptId2)) { if (Objects.nonNull(secondDeptId2)) {
// 下发信件(次责单位2) // 下发信件(次责单位2)
workService.saveOrUpdate(mail, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), secondDeptId2, now, false); workService.saveOrUpdate(mail, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), secondDeptId2, now, false, FlowNameEnum.PENDING_SIGN_CO.getName());
firstDistributeInfo.put("secondDept2", JSONObject.of("id", secondDeptId2)); firstDistributeInfo.put("secondDept2", JSONObject.of("id", secondDeptId2));
} }
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);
@ -69,7 +68,8 @@ public class FirstDistributeFlow extends Flow {
.setFlowLimitedLastHandlerTime(now) .setFlowLimitedLastHandlerTime(now)
.setSecondDeptId(mainDeptId) .setSecondDeptId(mainDeptId)
.setSecondDeptName(deptVo.getName()) .setSecondDeptName(deptVo.getName())
.setFirstDistributeInfo(firstDistributeInfo.toJSONString()); .setFirstDistributeInfo(firstDistributeInfo.toJSONString())
.setMainDeptLevel(mainDeptLevel);
mailService.updateById(mail); mailService.updateById(mail);
return nextNode; return nextNode;
} }

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

@ -9,6 +9,7 @@ import com.biutag.lan.domain.Work;
import com.biutag.lan.enums.MailCategory; import com.biutag.lan.enums.MailCategory;
import com.biutag.lan.enums.MailState; import com.biutag.lan.enums.MailState;
import com.biutag.lan.flow.Flow; import com.biutag.lan.flow.Flow;
import com.biutag.lan.flow.FlowNameEnum;
import com.biutag.lan.flow.FlowNodeEnum; import com.biutag.lan.flow.FlowNodeEnum;
import com.biutag.lan.service.MailService; import com.biutag.lan.service.MailService;
import com.biutag.lan.service.MailSourceService; import com.biutag.lan.service.MailSourceService;
@ -63,6 +64,7 @@ public class FirstSignFlow extends Flow {
String empNo = AdminThreadLocal.getEmpNo(); String empNo = AdminThreadLocal.getEmpNo();
// 更新我的工作 // 更新我的工作
work.setPoliceEmpNo(empNo) work.setPoliceEmpNo(empNo)
.setFlowName(FlowNameEnum.PENDING_DISTRIBUTE.getName())
.setUpdateTime(LocalDateTime.now()); .setUpdateTime(LocalDateTime.now());
workService.updateById(work); workService.updateById(work);
@ -84,7 +86,6 @@ public class FirstSignFlow extends Flow {
.setFlowBeforeName(nextNode.getFlowNode().getBeforeName()) .setFlowBeforeName(nextNode.getFlowNode().getBeforeName())
.setFlowLimitedLastHandlerTime(mailSource.getCreateTime()); .setFlowLimitedLastHandlerTime(mailSource.getCreateTime());
mailService.save(mail); mailService.save(mail);
return nextNode; return nextNode;
} }

5
mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondApprovalFlow.java

@ -9,6 +9,7 @@ import com.biutag.lan.domain.MailReturn;
import com.biutag.lan.enums.CompleteMethod; import com.biutag.lan.enums.CompleteMethod;
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.FlowNodeEnum; import com.biutag.lan.flow.FlowNodeEnum;
import com.biutag.lan.service.MailApprovalService; import com.biutag.lan.service.MailApprovalService;
import com.biutag.lan.service.MailReturnService; import com.biutag.lan.service.MailReturnService;
@ -70,7 +71,7 @@ public class SecondApprovalFlow extends Flow {
// 更新已办 // 更新已办
workService.updateDone(mailId, AdminThreadLocal.getEmpNo(), now); workService.updateDone(mailId, AdminThreadLocal.getEmpNo(), now);
// 更新三级机构专班的待办 // 更新三级机构专班的待办
workService.updateTodo(mailId, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), now); workService.updateTodo(mailId, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), now, FlowNameEnum.RETURN_RECTIFICATION.getName());
// 更新信件 // 更新信件
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
mail.setUpdateTime(now) mail.setUpdateTime(now)
@ -89,7 +90,7 @@ public class SecondApprovalFlow extends Flow {
// 将二级专班角色的信件改为已办 // 将二级专班角色的信件改为已办
workService.updateDone(mail.getId(), RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now); workService.updateDone(mail.getId(), RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now);
// 将市局专班信件改为待办 // 将市局专班信件改为待办
workService.updateTodo(mail.getId(), RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId(), now); workService.updateTodo(mail.getId(), RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId(), now, FlowNameEnum.PENDING_APPROVAL.getName());
// 更新信件 // 更新信件
mail.setUpdateTime(now) mail.setUpdateTime(now)
.setFlowKey(FlowNodeEnum.FIRST_APPROVAL.getKey()) .setFlowKey(FlowNodeEnum.FIRST_APPROVAL.getKey())

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

@ -6,6 +6,7 @@ import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.Mail;
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.FlowNodeEnum; import com.biutag.lan.flow.FlowNodeEnum;
import com.biutag.lan.service.MailApprovalService; import com.biutag.lan.service.MailApprovalService;
import com.biutag.lan.service.MailService; import com.biutag.lan.service.MailService;
@ -69,7 +70,7 @@ public class SecondDeputyApprovalFlow extends Flow {
// 将我的信件改为已办 // 将我的信件改为已办
workService.updateDone(mailId, AdminThreadLocal.getEmpNo(), now); workService.updateDone(mailId, AdminThreadLocal.getEmpNo(), now);
// 更新二级机构专班的待办 // 更新二级机构专班的待办
workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now); workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now, FlowNameEnum.PENDING_APPROVAL.getName());
// 更新信件 // 更新信件
mail.setUpdateTime(now) mail.setUpdateTime(now)
.setFlowKey(FlowNodeEnum.SECOND_APPROVAL.getKey()) .setFlowKey(FlowNodeEnum.SECOND_APPROVAL.getKey())

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

@ -7,6 +7,7 @@ import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.Work; import com.biutag.lan.domain.Work;
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.service.IDeptService; import com.biutag.lan.service.IDeptService;
import com.biutag.lan.service.MailService; import com.biutag.lan.service.MailService;
import com.biutag.lan.service.WorkService; import com.biutag.lan.service.WorkService;
@ -56,18 +57,18 @@ public class SecondDistributeFlow extends Flow {
JSONObject secondDistributeInfo = JSONObject.of("mainDept", JSONObject.of("id", mainDeptId), JSONObject secondDistributeInfo = JSONObject.of("mainDept", JSONObject.of("id", mainDeptId),
"secondDept", secondDept); "secondDept", secondDept);
// 下发信件(主责单位) // 下发信件(主责单位)
workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), mainDeptId, now, true); workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), mainDeptId, now, true, FlowNameEnum.PENDING_SIGN.getName());
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());
secondDept.add(JSONObject.of("id", secondDeptId1)); secondDept.add(JSONObject.of("id", secondDeptId1));
} }
Integer secondDeptId2 = data.getInteger("secondDeptId2"); Integer secondDeptId2 = data.getInteger("secondDeptId2");
if (Objects.nonNull(secondDeptId2)) { if (Objects.nonNull(secondDeptId2)) {
// 下发信件(次责单位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());
secondDept.add(JSONObject.of("id", secondDeptId1)); secondDept.add(JSONObject.of("id", secondDeptId1));
} }
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);

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

@ -6,6 +6,7 @@ import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.Mail;
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.service.MailApprovalService; import com.biutag.lan.service.MailApprovalService;
import com.biutag.lan.service.MailService; import com.biutag.lan.service.MailService;
import com.biutag.lan.service.WorkService; import com.biutag.lan.service.WorkService;
@ -43,7 +44,7 @@ public class SecondLeaderApprovalFlow extends Flow {
// 将我的信件改为已办 // 将我的信件改为已办
workService.updateDone(mailId, AdminThreadLocal.getEmpNo(), now); workService.updateDone(mailId, AdminThreadLocal.getEmpNo(), now);
// 转给二级专班 // 转给二级专班
workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now); workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now, FlowNameEnum.PENDING_REPORT.getName());
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);
// 更新信件 // 更新信件
mail.setUpdateTime(now) mail.setUpdateTime(now)

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

@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONObject;
import com.biutag.enums.RoleEnum; import com.biutag.enums.RoleEnum;
import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.Mail;
import com.biutag.lan.flow.Flow; import com.biutag.lan.flow.Flow;
import com.biutag.lan.flow.FlowNameEnum;
import com.biutag.lan.service.MailService; import com.biutag.lan.service.MailService;
import com.biutag.lan.service.WorkService; import com.biutag.lan.service.WorkService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -26,7 +27,7 @@ public class SecondReportingFlow extends Flow {
// 将二级专班信件改为已办 // 将二级专班信件改为已办
workService.updateDone(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now); workService.updateDone(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now);
// 将市局专班信件改为待办 // 将市局专班信件改为待办
workService.updateTodo(mailId, RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId(), now); workService.updateTodo(mailId, RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId(), now, FlowNameEnum.PENDING_APPROVAL.getName());
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);
// 更新信件 // 更新信件
mail.setUpdateTime(now) mail.setUpdateTime(now)

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

@ -1,7 +1,6 @@
package com.biutag.lan.flow.node; package com.biutag.lan.flow.node;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.biutag.enums.RoleEnum; import com.biutag.enums.RoleEnum;
import com.biutag.exception.BusinessException; import com.biutag.exception.BusinessException;
@ -11,6 +10,7 @@ import com.biutag.lan.domain.MailReturn;
import com.biutag.lan.domain.Work; import com.biutag.lan.domain.Work;
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.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;
@ -21,7 +21,6 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects; import java.util.Objects;
/** /**
@ -68,7 +67,7 @@ public class SecondSignFlow extends Flow {
work.setUpdateTime(now).setWorkState(Work.State.done.name()); work.setUpdateTime(now).setWorkState(Work.State.done.name());
workService.updateById(work); workService.updateById(work);
// 更新市局专班的待办 // 更新市局专班的待办
workService.updateTodo(mailId, RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId(), now); workService.updateTodo(mailId, RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId(), now, FlowNameEnum.MAIL_RETURN.getName());
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
// 主责单位 // 主责单位
if (work.getMainDeptFlag()) { if (work.getMainDeptFlag()) {
@ -103,7 +102,8 @@ public class SecondSignFlow extends Flow {
String empNo = AdminThreadLocal.getEmpNo(); String empNo = AdminThreadLocal.getEmpNo();
// 更新我的工作 // 更新我的工作
work.setPoliceEmpNo(empNo) work.setPoliceEmpNo(empNo)
.setUpdateTime(now); .setUpdateTime(now)
.setFlowName(FlowNameEnum.PENDING_DISTRIBUTE.getName());
workService.updateById(work); workService.updateById(work);
// 更新信件 // 更新信件
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);

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

@ -3,11 +3,16 @@ package com.biutag.lan.flow.node;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.biutag.enums.RoleEnum;
import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.Work;
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.FlowNodeEnum; import com.biutag.lan.flow.FlowNodeEnum;
import com.biutag.lan.service.MailService; 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;
@ -24,6 +29,8 @@ public class ThreeContactWriterFlow extends Flow {
private final MailService mailService; private final MailService mailService;
private final WorkService workService;
private final ThreeSignFlow threeSignFlow; private final ThreeSignFlow threeSignFlow;
@Override @Override
@ -61,6 +68,10 @@ public class ThreeContactWriterFlow extends Flow {
.setFlowBeforeName(FlowNodeEnum.VERIFY.getFullName()); .setFlowBeforeName(FlowNodeEnum.VERIFY.getFullName());
} }
mailService.updateById(mail); mailService.updateById(mail);
// 更新我的工作
Work work = workService.getOne(mailId, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), AdminThreadLocal.getDeptId());
work.setFlowName(FlowNameEnum.INTERVIEW_WRITER.getName()).setUpdateTime(now);
workService.updateById(work);
return nextNode; return nextNode;
} }

18
mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeInterviewWriterFlow.java

@ -1,9 +1,15 @@
package com.biutag.lan.flow.node; package com.biutag.lan.flow.node;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.biutag.enums.RoleEnum;
import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.Work;
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.service.MailService; 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;
@ -17,9 +23,21 @@ import java.time.LocalDateTime;
public class ThreeInterviewWriterFlow extends Flow { public class ThreeInterviewWriterFlow extends Flow {
private final MailService mailService; private final MailService mailService;
private final WorkService workService;
private final ThreeSignFlow threeSignFlow;
@Override @Override
public Flow next(String nextActionKey, String mailId, JSONObject data) { public Flow next(String nextActionKey, String mailId, JSONObject data) {
if (ActionEnum.mailReturn.getValue().equals(nextActionKey)) {
return threeSignFlow.mailReturn(mailId, data);
}
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
// 更新我的工作
Work work = workService.getOne(mailId, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), AdminThreadLocal.getDeptId());
work.setFlowName(FlowNameEnum.VERIFY.getName()).setUpdateTime(now);
workService.updateById(work);
// 更新信件 // 更新信件
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);

5
mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeLeaderApprovalFlow.java

@ -7,6 +7,7 @@ import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.MailReturn; import com.biutag.lan.domain.MailReturn;
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.FlowNodeEnum; import com.biutag.lan.flow.FlowNodeEnum;
import com.biutag.lan.service.MailApprovalService; import com.biutag.lan.service.MailApprovalService;
import com.biutag.lan.service.MailReturnService; import com.biutag.lan.service.MailReturnService;
@ -43,7 +44,7 @@ public class ThreeLeaderApprovalFlow extends Flow {
// 将我的信件改为已办 // 将我的信件改为已办
workService.updateDone(mailId, empNo, now); workService.updateDone(mailId, empNo, now);
// 将二级专班的信件改为待办 // 将二级专班的信件改为待办
workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now); workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now, FlowNameEnum.PENDING_APPROVAL.getName());
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);
// 更新信件 // 更新信件
mail.setUpdateTime(now) mail.setUpdateTime(now)
@ -69,7 +70,7 @@ public class ThreeLeaderApprovalFlow extends Flow {
// 更新已办 // 更新已办
workService.updateDone(mailId, AdminThreadLocal.getEmpNo(), now); workService.updateDone(mailId, AdminThreadLocal.getEmpNo(), now);
// 更新三级机构专班的待办 // 更新三级机构专班的待办
workService.updateTodo(mailId, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), now); workService.updateTodo(mailId, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), now, FlowNameEnum.RETURN_RECTIFICATION.getName());
// 更新信件 // 更新信件
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
mail.setUpdateTime(now) mail.setUpdateTime(now)

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

@ -9,6 +9,7 @@ import com.biutag.lan.domain.MailReturn;
import com.biutag.lan.domain.Work; import com.biutag.lan.domain.Work;
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.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;
@ -64,7 +65,7 @@ public class ThreeSignFlow extends Flow {
work.setUpdateTime(now).setWorkState(Work.State.done.name()); work.setUpdateTime(now).setWorkState(Work.State.done.name());
workService.updateById(work); workService.updateById(work);
// 更新二级机构专班的待办 // 更新二级机构专班的待办
workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now); workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now, FlowNameEnum.MAIL_RETURN.getName());
// 更新信件 // 更新信件
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
mail.setUpdateTime(now) mail.setUpdateTime(now)
@ -85,7 +86,8 @@ public class ThreeSignFlow extends Flow {
} }
// 更新我的工作 // 更新我的工作
work.setPoliceEmpNo(empNo) work.setPoliceEmpNo(empNo)
.setUpdateTime(now); .setUpdateTime(now)
.setFlowName(FlowNameEnum.CONTACT_WRITER.getName());
workService.updateById(work); workService.updateById(work);
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);

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

@ -13,6 +13,7 @@ import com.biutag.lan.enums.ExtensionState;
import com.biutag.lan.enums.WorkType; 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.service.MailService; import com.biutag.lan.service.MailService;
import com.biutag.lan.service.WorkService; import com.biutag.lan.service.WorkService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -57,7 +58,7 @@ public class ThreeVerifyFlow extends Flow {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
// 给二级机构增加待办 // 给二级机构增加待办
workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), WorkType.extension_approval.name(), now); workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), WorkType.extension_approval.name(), now, FlowNameEnum.PENDING_APPROVAL.getName());
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
mail.setUpdateTime(now) mail.setUpdateTime(now)
@ -86,7 +87,7 @@ public class ThreeVerifyFlow extends Flow {
.setContactDuration(data.getLong("contactDuration")) .setContactDuration(data.getLong("contactDuration"))
.setContactPoliceEmpNo(data.getString("contactDuration")) .setContactPoliceEmpNo(data.getString("contactDuration"))
.setContactFlag(data.getBoolean("contactFlag")) .setContactFlag(data.getBoolean("contactFlag"))
// 群众接访 // 接访群众
.setInterviewType(data.getString("interviewType")) .setInterviewType(data.getString("interviewType"))
.setInterviewIsLeader(data.getBoolean("interviewIsLeader")) .setInterviewIsLeader(data.getBoolean("interviewIsLeader"))
.setInterviewPoliceEmpNo(data.getString("interviewPoliceEmpNo")) .setInterviewPoliceEmpNo(data.getString("interviewPoliceEmpNo"))
@ -110,11 +111,9 @@ 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) {
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");
@ -131,7 +130,7 @@ public class ThreeVerifyFlow extends Flow {
.setContactDuration(data.getLong("contactDuration")) .setContactDuration(data.getLong("contactDuration"))
.setContactPoliceEmpNo(data.getString("contactDuration")) .setContactPoliceEmpNo(data.getString("contactDuration"))
.setContactFlag(data.getBoolean("contactFlag")) .setContactFlag(data.getBoolean("contactFlag"))
// 群众接访 // 接访群众
.setInterviewType(data.getString("interviewType")) .setInterviewType(data.getString("interviewType"))
.setInterviewIsLeader(data.getBoolean("interviewIsLeader")) .setInterviewIsLeader(data.getBoolean("interviewIsLeader"))
.setInterviewPoliceEmpNo(data.getString("interviewPoliceEmpNo")) .setInterviewPoliceEmpNo(data.getString("interviewPoliceEmpNo"))
@ -166,7 +165,7 @@ public class ThreeVerifyFlow extends Flow {
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
applicationCompleted(nextActionKey, mail, data, now); applicationCompleted(nextActionKey, mail, data, now);
// 给二级机构专班增加待办 // 给二级机构专班增加待办
workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now); workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now, FlowNameEnum.PENDING_APPROVAL.getName());
return null; return null;
} }
@ -178,7 +177,7 @@ public class ThreeVerifyFlow extends Flow {
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
applicationCompleted(nextActionKey, mail, data, now); applicationCompleted(nextActionKey, mail, data, now);
// 给三级部门领导增加待办 // 给三级部门领导增加待办
workService.saveOrUpdate(mail, leaderEmpNo, now); workService.saveOrUpdate(mail, leaderEmpNo, now, FlowNameEnum.PENDING_APPROVAL.getName());
return null; return null;
} }

8
mailbox-lan/src/main/java/com/biutag/lan/mapper/WorkMapper.java

@ -9,13 +9,21 @@ import com.biutag.lan.domain.vo.WorkVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.Collection;
import java.util.List;
public interface WorkMapper extends BaseMapper<Work> { public interface WorkMapper extends BaseMapper<Work> {
Page<WorkVo> selectPageTodo(@Param("page") Page<Work> page, @Param(Constants.WRAPPER) QueryWrapper<Work> queryWrapper); Page<WorkVo> selectPageTodo(@Param("page") Page<Work> page, @Param(Constants.WRAPPER) QueryWrapper<Work> queryWrapper);
Integer selectCountByFlowKey(Collection<String> flowKeys, Integer deptId);
@Select("select count(w.id) from work w left join mail m on w.mail_id = m.id where m.flow_key = #{flowKey} and w.sign_dept_id = #{deptId}") @Select("select count(w.id) from work w left join mail m on w.mail_id = m.id where m.flow_key = #{flowKey} and w.sign_dept_id = #{deptId}")
Integer selectCount(String flowKey, Integer deptId); Integer selectCount(String flowKey, Integer deptId);
@Select("select count(w.id) from work w left join mail m on w.mail_id = m.id where m.extension_flag = #{extensionFlag} and w.sign_dept_id = #{deptId}")
Integer selectCountByExtensionFlag(Boolean extensionFlag, Integer deptId);
@Select("select count(w.mail_id) from work w where w.mail_id = #{mailId}") @Select("select count(w.mail_id) from work w where w.mail_id = #{mailId}")
Integer countByFilter(String mailId); Integer countByFilter(String mailId);
} }

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

@ -21,10 +21,7 @@ import com.biutag.lan.enums.CompleteMethod;
import com.biutag.lan.enums.ExtensionState; import com.biutag.lan.enums.ExtensionState;
import com.biutag.lan.enums.MailState; import com.biutag.lan.enums.MailState;
import com.biutag.lan.enums.WorkType; import com.biutag.lan.enums.WorkType;
import com.biutag.lan.flow.ActionEnum; import com.biutag.lan.flow.*;
import com.biutag.lan.flow.Flow;
import com.biutag.lan.flow.FlowConfig;
import com.biutag.lan.flow.FlowNodeEnum;
import com.biutag.lan.flow.node.FirstSignFlow; import com.biutag.lan.flow.node.FirstSignFlow;
import com.biutag.lan.mapper.MailMapper; import com.biutag.lan.mapper.MailMapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -239,6 +236,16 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
.setCountersignCompleted(0); .setCountersignCompleted(0);
updateById(mail); updateById(mail);
Integer roleId = AdminThreadLocal.getRoleId();
Work work;
if (RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId().equals(roleId) || RoleEnum.SECOND_DEPT_CLASSES.getRoleId().equals(roleId)) {
work = workService.getxByUnSign(mailId, roleId, AdminThreadLocal.getDeptId());
} else {
work = workService.getOne(mailId, AdminThreadLocal.getEmpNo());
}
work.setFlowName(FlowNameEnum.COUNTERSIGNING.getName()).setUpdateTime(now);
workService.updateById(work);
// 给相关部门新增会签待办 // 给相关部门新增会签待办
workService.saveByCountersign(mail, countersignDeptIds, now); workService.saveByCountersign(mail, countersignDeptIds, now);

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

@ -17,6 +17,8 @@ import com.biutag.lan.domain.Work;
import com.biutag.lan.domain.bo.MailQuery; import com.biutag.lan.domain.bo.MailQuery;
import com.biutag.lan.domain.vo.WorkVo; import com.biutag.lan.domain.vo.WorkVo;
import com.biutag.lan.enums.WorkType; import com.biutag.lan.enums.WorkType;
import com.biutag.lan.flow.FlowNameEnum;
import com.biutag.lan.flow.FlowNodeEnum;
import com.biutag.lan.mapper.MailLabelMapper; import com.biutag.lan.mapper.MailLabelMapper;
import com.biutag.lan.mapper.WorkMapper; import com.biutag.lan.mapper.WorkMapper;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
@ -30,6 +32,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.IOException; import java.io.IOException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -56,7 +59,8 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
.setSignRoleId(RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId()) .setSignRoleId(RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId())
.setMainDeptFlag(true) .setMainDeptFlag(true)
.setCreateTime(now) .setCreateTime(now)
.setUpdateTime(now); .setUpdateTime(now)
.setFlowName(FlowNameEnum.PENDING_SIGN.getName());
return work; return work;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return saveBatch(list); return saveBatch(list);
@ -64,7 +68,6 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean saveExcelBatch(List<WorkVo> mailSources) { public boolean saveExcelBatch(List<WorkVo> mailSources) {
LocalDateTime now = LocalDateTime.now();
List<Work> list = mailSources.stream().map(mail -> { List<Work> list = mailSources.stream().map(mail -> {
Work work = new Work(); Work work = new Work();
BeanUtils.copyProperties(mail, work); BeanUtils.copyProperties(mail, work);
@ -84,7 +87,7 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
return save(work); return save(work);
} }
public boolean saveOrUpdate(Mail mail, Integer roleId, Integer deptId, LocalDateTime time, Boolean mainDeptFlag) { public boolean saveOrUpdate(Mail mail, Integer roleId, Integer deptId, LocalDateTime time, Boolean mainDeptFlag, String flowName) {
Work work = getOne(mail.getId(), roleId, deptId); Work work = getOne(mail.getId(), roleId, deptId);
if (Objects.isNull(work)) { if (Objects.isNull(work)) {
work = new Work(); work = new Work();
@ -94,11 +97,11 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
.setSignDeptId(deptId) .setSignDeptId(deptId)
.setCreateTime(time); .setCreateTime(time);
} }
work.setWorkState(Work.State.todo.name()).setUpdateTime(time).setMainDeptFlag(mainDeptFlag); work.setWorkState(Work.State.todo.name()).setUpdateTime(time).setMainDeptFlag(mainDeptFlag).setFlowName(flowName);
return saveOrUpdate(work); return saveOrUpdate(work);
} }
public boolean saveOrUpdate(Mail mail, String empNo, LocalDateTime time) { public boolean saveOrUpdate(Mail mail, String empNo, LocalDateTime time, String flowName) {
Work work = getOne(mail.getId(), empNo); Work work = getOne(mail.getId(), empNo);
if (Objects.isNull(work)) { if (Objects.isNull(work)) {
work = new Work(); work = new Work();
@ -107,7 +110,7 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
.setPoliceEmpNo(empNo) .setPoliceEmpNo(empNo)
.setCreateTime(time); .setCreateTime(time);
} }
work.setWorkState(Work.State.todo.name()).setUpdateTime(time); work.setWorkState(Work.State.todo.name()).setUpdateTime(time).setFlowName(flowName);
return saveOrUpdate(work); return saveOrUpdate(work);
} }
@ -124,7 +127,8 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
.setCreateTime(time) .setCreateTime(time)
.setUpdateTime(time) .setUpdateTime(time)
// 部门会签 // 部门会签
.setWorkType(WorkType.dept_countersign.name()); .setWorkType(WorkType.dept_countersign.name())
.setFlowName(FlowNameEnum.PENDING_COUNTERSIGN.getName());
return work; return work;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return saveBatch(collect); return saveBatch(collect);
@ -160,15 +164,15 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
} }
public boolean updateTodo(String mailId, Integer roleId, LocalDateTime time) { public boolean updateTodo(String mailId, Integer roleId, LocalDateTime time, String flowName) {
Work work = getByRoleId(mailId, roleId); Work work = getByRoleId(mailId, roleId);
work.setUpdateTime(time).setWorkState(Work.State.todo.name()).setPoliceEmpNo(null); work.setUpdateTime(time).setWorkState(Work.State.todo.name()).setPoliceEmpNo(null).setFlowName(flowName);
return updateById(work); return updateById(work);
} }
public boolean updateTodo(String mailId, Integer roleId, String workType, LocalDateTime time) { public boolean updateTodo(String mailId, Integer roleId, String workType, LocalDateTime time, String flowName) {
Work work = getByRoleId(mailId, roleId); Work work = getByRoleId(mailId, roleId);
work.setUpdateTime(time).setWorkState(Work.State.todo.name()).setPoliceEmpNo(null).setWorkType(workType); work.setUpdateTime(time).setWorkState(Work.State.todo.name()).setPoliceEmpNo(null).setWorkType(workType).setFlowName(flowName);
return updateById(work); return updateById(work);
} }
@ -181,7 +185,10 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
.eq(StrUtil.isNotBlank(todoQuery.getMailLevel()), "m.mail_level", todoQuery.getMailLevel()) .eq(StrUtil.isNotBlank(todoQuery.getMailLevel()), "m.mail_level", todoQuery.getMailLevel())
.eq(StrUtil.isNotBlank(todoQuery.getMailCategory()), "m.mail_category", todoQuery.getMailCategory()) .eq(StrUtil.isNotBlank(todoQuery.getMailCategory()), "m.mail_category", todoQuery.getMailCategory())
.like(StrUtil.isNotBlank(todoQuery.getThreeDeptName()), "m.three_dept_name", todoQuery.getThreeDeptName()) .like(StrUtil.isNotBlank(todoQuery.getThreeDeptName()), "m.three_dept_name", todoQuery.getThreeDeptName())
.eq(StrUtil.isNotBlank(todoQuery.getFlowKey()), "m.flow_key", todoQuery.getFlowKey()); .eq(StrUtil.isNotBlank(todoQuery.getFlowKey()), "m.flow_key", todoQuery.getFlowKey())
.and(query -> {
query.isNull("m.flow_key").or().ne("m.flow_key", FlowNodeEnum.COMPLETION.getKey());
});
Integer roleId = AdminThreadLocal.getRoleId(); Integer roleId = AdminThreadLocal.getRoleId();
// 与角色相关的件 // 与角色相关的件
if (roleId.equals(RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId()) || if (roleId.equals(RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId()) ||
@ -210,7 +217,14 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
} }
// 排序 // 排序
queryWrapper.orderByDesc("w.update_time"); queryWrapper.orderByDesc("w.update_time");
return baseMapper.selectPageTodo(page, queryWrapper); Page<WorkVo> workVoPage = baseMapper.selectPageTodo(page, queryWrapper);
workVoPage.getRecords().forEach(item -> {
// 会签中
if (FlowNameEnum.COUNTERSIGNING.getName().equals(item.getFlowName())) {
item.setFlowName(String.format("%s(%s/%s)", item.getFlowName(), item.getCountersignCompleted(), item.getCountersignTotal()));
}
});
return workVoPage;
} }
public Work getOne(String mailId, String empNo) { public Work getOne(String mailId, String empNo) {
@ -253,7 +267,6 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
public Work getxByUnSign(String mailId, Integer roleId, Integer deptId) { public Work getxByUnSign(String mailId, Integer roleId, Integer deptId) {
LambdaQueryWrapper<Work> queryWrapper = new LambdaQueryWrapper<Work>() LambdaQueryWrapper<Work> queryWrapper = new LambdaQueryWrapper<Work>()
.eq(Work::getMailId, mailId) .eq(Work::getMailId, mailId)
.isNull(Work::getPoliceEmpNo)
.eq(Work::getSignRoleId, roleId) .eq(Work::getSignRoleId, roleId)
// 如果不是市局专班,则需要查询签收部门ID // 如果不是市局专班,则需要查询签收部门ID
.eq(!RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId().equals(roleId), Work::getSignDeptId, deptId); .eq(!RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId().equals(roleId), Work::getSignDeptId, deptId);
@ -264,6 +277,14 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
return baseMapper.selectCount(flowKey, deptId); return baseMapper.selectCount(flowKey, deptId);
} }
public Integer count(Collection<String> flowKeys, Integer deptId) {
return baseMapper.selectCountByFlowKey(flowKeys, deptId);
}
public Integer count(Boolean extensionFlag, Integer deptId) {
return baseMapper.selectCountByExtensionFlag(extensionFlag, deptId);
}
public List<Work> list(String mailId, Integer roleId, String workType) { public List<Work> list(String mailId, Integer roleId, String workType) {
return list(new LambdaQueryWrapper<Work>().eq(Work::getMailId, mailId).eq(Work::getSignRoleId, roleId).eq(Work::getWorkType, workType)); return list(new LambdaQueryWrapper<Work>().eq(Work::getMailId, mailId).eq(Work::getSignRoleId, roleId).eq(Work::getWorkType, workType));
} }

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

@ -294,7 +294,7 @@ public class PoliceUserServiceImpl implements IPoliceUserService {
PoliceUserDetailVo vo = new PoliceUserDetailVo(); PoliceUserDetailVo vo = new PoliceUserDetailVo();
BeanUtils.copyProperties(sysAdmin, vo); BeanUtils.copyProperties(sysAdmin, vo);
if(StringUtils.isNotNull(sysAdmin.getRoleIds())) { if(StringUtils.isNotNull(sysAdmin.getRoleIds())) {
vo.setRoleIds(ListUtils.stringToListAsInt(sysAdmin.getRoleIds(), ",")); vo.setRoleIds(Integer.parseInt(sysAdmin.getRoleIds()));
} }
if(StringUtils.isNotNull(sysAdmin.getDeptIds())) { if(StringUtils.isNotNull(sysAdmin.getDeptIds())) {
vo.setDeptIds(ListUtils.stringToListAsInt(sysAdmin.getDeptIds(), ",")); vo.setDeptIds(ListUtils.stringToListAsInt(sysAdmin.getDeptIds(), ","));
@ -397,10 +397,10 @@ public class PoliceUserServiceImpl implements IPoliceUserService {
Assert.notNull(policeUser, "警号已存在换一个吧!"); Assert.notNull(policeUser, "警号已存在换一个吧!");
PoliceUser model = new PoliceUser(); PoliceUser model = new PoliceUser();
model.setId(updateValidate.getId()); model.setId(updateValidate.getId());
if(StringUtils.isNotNull(updateValidate.getRoleIds())) { if(Objects.nonNull(updateValidate.getRoleIds())) {
model.setRoleIds(ListUtils.listToStringByInt(updateValidate.getRoleIds(), ",")); model.setRoleIds(updateValidate.getRoleIds().toString());
if(!policeUser.getRoleIds().equals(model.getRoleIds())){ if(!policeUser.getRoleIds().equals(model.getRoleIds())){
this.batchSaveRoleByEmpNo(updateValidate.getEmpNo(),updateValidate.getRoleIds()); this.batchSaveRoleByEmpNo(updateValidate.getEmpNo(), Collections.singletonList(updateValidate.getRoleIds()));
} }
} }

2
mailbox-lan/src/main/java/com/biutag/lan/validate/system/PoliceUserUpdateValidate.java

@ -68,7 +68,7 @@ public class PoliceUserUpdateValidate implements Serializable {
@NotNull(message = "请选择角色") @NotNull(message = "请选择角色")
@ApiModelProperty(value = "角色ID") @ApiModelProperty(value = "角色ID")
private List<Integer> roleIds; private Integer roleIds;
@ApiModelProperty(value = "部门ID") @ApiModelProperty(value = "部门ID")
private List<Integer> deptIds; private List<Integer> deptIds;

2
mailbox-lan/src/main/java/com/biutag/lan/vo/system/PoliceUserDetailVo.java

@ -17,7 +17,7 @@ public class PoliceUserDetailVo implements Serializable {
private Integer id; private Integer id;
@ApiModelProperty(value = "角色ID") @ApiModelProperty(value = "角色ID")
private List<Integer> roleIds; private Integer roleIds;
@ApiModelProperty(value = "部门ID") @ApiModelProperty(value = "部门ID")
private List<Integer> deptIds; private List<Integer> deptIds;

4
mailbox-lan/src/main/resources/application.yml

@ -18,6 +18,10 @@ spring:
pool-name: DateSourceHikariCP # 连接池名称 pool-name: DateSourceHikariCP # 连接池名称
max-lifetime: 1800000 # 连接的生命时长(毫秒),超时而且没被使用则被释放,默认30分钟(1800000ms) max-lifetime: 1800000 # 连接的生命时长(毫秒),超时而且没被使用则被释放,默认30分钟(1800000ms)
connection-init-sql: SELECT 1 # 连接时发起SQL测试脚本 connection-init-sql: SELECT 1 # 连接时发起SQL测试脚本
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
# Sa-token配置 # Sa-token配置
sa-token: sa-token:

17
mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml

@ -17,26 +17,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="getCompletedRate" resultType="java.util.Map"> <select id="getCompletedRate" resultType="java.util.Map">
select b.second_dept_name name,CONCAT(ROUND(sum(COALESCE(b.completed, 0))*100/count(1),0),'%') rate, select a.name,CONCAT(ROUND(sum(COALESCE(b.completed, 0))*100/count(1),0),'%') rate,
ROUND(sum(COALESCE(b.completed, 0))*100/count(1),0) rateNumber, ROUND(sum(COALESCE(b.completed, 0))*100/count(1),0) rateNumber,
SUM(COALESCE(b.completed, 0)) completed,count(1) sum SUM(COALESCE(b.completed, 0)) completed,count(1) sum
from dept a inner join mail_mark b on a.id=b.second_dept_id where a.category='2' from dept a left join mail_mark b on a.id=b.second_dept_id where a.category='2'
GROUP BY second_dept_name order by rateNumber desc limit 10 GROUP BY a.name order by rateNumber desc limit 10
</select> </select>
<select id="getResolvedRate" resultType="java.util.Map"> <select id="getResolvedRate" resultType="java.util.Map">
select b.second_dept_name name, select a.name,
CONCAT(ROUND(sum(COALESCE(b.resolved, 0))*100/count(1),0),'%') rate, CONCAT(ROUND(sum(COALESCE(b.resolved, 0))*100/count(1),0),'%') rate,
ROUND(sum(COALESCE(b.resolved, 0))*100/count(1),0) rateNumber, ROUND(sum(COALESCE(b.resolved, 0))*100/count(1),0) rateNumber,
SUM(COALESCE(b.resolved, 0)) resolved,count(1) sum SUM(COALESCE(b.resolved, 0)) resolved,count(1) sum
from dept a inner join mail_mark b on a.id=b.second_dept_id where a.category='2' from dept a left join mail_mark b on a.id=b.second_dept_id where a.category='2'
GROUP BY second_dept_name order by rateNumber desc limit 10 GROUP BY a.name order by rateNumber desc limit 10
</select> </select>
<select id="getSatisfiedRate" resultType="java.util.Map"> <select id="getSatisfiedRate" resultType="java.util.Map">
select b.second_dept_name name,CONCAT(ROUND(sum(COALESCE(b.satisfied, 0))*100/count(1),0),'%') rate, select a.name,CONCAT(ROUND(sum(COALESCE(b.satisfied, 0))*100/count(1),0),'%') rate,
ROUND(sum(COALESCE(b.satisfied, 0))*100/count(1),0) rateNumber, ROUND(sum(COALESCE(b.satisfied, 0))*100/count(1),0) rateNumber,
SUM(COALESCE(b.satisfied, 0)) satisfied,count(1) sum SUM(COALESCE(b.satisfied, 0)) satisfied,count(1) sum
from dept a inner join mail_mark b on a.id=b.second_dept_id where a.category='2' GROUP BY second_dept_name order by rateNumber desc limit 10 from dept a inner join mail_mark b on a.id=b.second_dept_id where a.category='2' GROUP BY a.name order by rateNumber desc limit 10
</select> </select>

13
mailbox-lan/src/main/resources/mapper/WorkMapper.xml

@ -5,8 +5,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.biutag.lan.mapper.WorkMapper"> <mapper namespace="com.biutag.lan.mapper.WorkMapper">
<select id="selectPageTodo" resultType="com.biutag.lan.domain.vo.WorkVo"> <select id="selectPageTodo" resultType="com.biutag.lan.domain.vo.WorkVo">
select w.id, w.contact_name, w.contact_phone, w.contact_id_card, w.content, w.source, w.mail_time, w.mail_id, w.work_type, select w.id, w.contact_name, w.contact_phone, w.contact_id_card, w.content, w.source, w.mail_time, w.mail_id, w.work_type, w.flow_name,
m.mail_state, m.mail_category, m.mail_level, m.three_dept_id, m.three_dept_name, m.flow_key, m.flow_before_name,m.mail_labels, m.mail_state, m.mail_category, m.mail_level, m.three_dept_id, m.three_dept_name, m.flow_key, m.mail_labels, m.countersign_total, m.countersign_completed,
<!-- 当前流程剩余多少时间(秒) --> <!-- 当前流程剩余多少时间(秒) -->
f.limited_time - ROUND(EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - m.flow_limited_last_handler_time))) flow_limited_remaining_time f.limited_time - ROUND(EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - m.flow_limited_last_handler_time))) flow_limited_remaining_time
from work w from work w
@ -15,4 +15,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
${ew.getCustomSqlSegment} ${ew.getCustomSqlSegment}
</select> </select>
<select id="selectCountByFlowKey" resultType="int">
select count(w.id) from work w left join mail m on w.mail_id = m.id where m.flow_key in
<foreach collection="flowKeys" item="flow_key" index="index"
open="(" close=")" separator=",">
#{flow_key}
</foreach>
and w.sign_dept_id = #{deptId}
</select>
</mapper> </mapper>

Loading…
Cancel
Save