Browse Source

局长信箱(内网端) 线下流程和简易流程

dev_ycq
wxc 2 years ago
parent
commit
29e10900fd
  1. 2
      mailbox-lan/src/main/java/com/biutag/lan/aop/aspect/LogAspect.java
  2. 2
      mailbox-lan/src/main/java/com/biutag/lan/config/AdminInterceptor.java
  3. 2
      mailbox-lan/src/main/java/com/biutag/lan/config/AdminThreadLocal.java
  4. 1
      mailbox-lan/src/main/java/com/biutag/lan/config/WebMvcConfig.java
  5. 2
      mailbox-lan/src/main/java/com/biutag/lan/config/stp/StpInterConfig.java
  6. 1
      mailbox-lan/src/main/java/com/biutag/lan/controller/FileController.java
  7. 2
      mailbox-lan/src/main/java/com/biutag/lan/controller/HomeController.java
  8. 5
      mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java
  9. 9
      mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java
  10. 4
      mailbox-lan/src/main/java/com/biutag/lan/controller/system/MenuController.java
  11. 2
      mailbox-lan/src/main/java/com/biutag/lan/controller/system/PoliceUserController.java
  12. 18
      mailbox-lan/src/main/java/com/biutag/lan/domain/Mail.java
  13. 76
      mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailVo.java
  14. 1
      mailbox-lan/src/main/java/com/biutag/lan/flow/ActionEnum.java
  15. 4
      mailbox-lan/src/main/java/com/biutag/lan/flow/FlowConfig.java
  16. 2
      mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNodeEnum.java
  17. 2
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/CountersignFlow.java
  18. 2
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstApprovalFlow.java
  19. 11
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstDistributeFlow.java
  20. 2
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstSignFlow.java
  21. 69
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondApprovalFlow.java
  22. 4
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondDeputyApprovalFlow.java
  23. 14
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondDistributeFlow.java
  24. 2
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondLeaderApprovalFlow.java
  25. 27
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondSignFlow.java
  26. 8
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeContactWriterFlow.java
  27. 2
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeLeaderApprovalFlow.java
  28. 2
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeSignFlow.java
  29. 147
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeVerifyFlow.java
  30. 3
      mailbox-lan/src/main/java/com/biutag/lan/service/FavoriteService.java
  31. 2
      mailbox-lan/src/main/java/com/biutag/lan/service/MailApprovalService.java
  32. 2
      mailbox-lan/src/main/java/com/biutag/lan/service/MailExtensionApprovalService.java
  33. 26
      mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java
  34. 2
      mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java
  35. 3
      mailbox-lan/src/main/java/com/biutag/lan/service/impl/DeptServiceImpl.java
  36. 2
      mailbox-lan/src/main/java/com/biutag/lan/service/impl/MenuServiceImpl.java
  37. 2
      mailbox-lan/src/main/java/com/biutag/lan/service/impl/PoliceUserServiceImpl.java
  38. 2
      mailbox-lan/src/main/resources/application-prod.yml
  39. 2
      mailbox-lan/src/main/resources/mapper/FavoriteMapper.xml
  40. 17
      mailbox-lan/src/test/java/com/biutag/lan/BeanUtilsTest.java
  41. 6
      truncate.sql

2
mailbox-lan/src/main/java/com/biutag/lan/aop/aspect/LogAspect.java

@ -1,7 +1,7 @@
package com.biutag.lan.aop.aspect; package com.biutag.lan.aop.aspect;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
import com.biutag.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.aop.Log; import com.biutag.lan.aop.Log;
import com.biutag.entity.system.SystemLogOperate; import com.biutag.entity.system.SystemLogOperate;
import com.biutag.mapper.system.SystemLogOperateMapper; import com.biutag.mapper.system.SystemLogOperateMapper;

2
mailbox-lan/src/main/java/com/biutag/lan/AdminInterceptor.java → mailbox-lan/src/main/java/com/biutag/lan/config/AdminInterceptor.java

@ -1,4 +1,4 @@
package com.biutag.lan; package com.biutag.lan.config;
import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;

2
mailbox-lan/src/main/java/com/biutag/lan/AdminThreadLocal.java → mailbox-lan/src/main/java/com/biutag/lan/config/AdminThreadLocal.java

@ -1,4 +1,4 @@
package com.biutag.lan; package com.biutag.lan.config;

1
mailbox-lan/src/main/java/com/biutag/lan/config/WebMvcConfig.java

@ -2,7 +2,6 @@ package com.biutag.lan.config;
import com.biutag.config.GlobalConfig; import com.biutag.config.GlobalConfig;
import com.biutag.lan.AdminInterceptor;
import com.biutag.util.YmlUtils; import com.biutag.util.YmlUtils;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;

2
mailbox-lan/src/main/java/com/biutag/lan/config/stp/StpInterConfig.java

@ -2,7 +2,7 @@ package com.biutag.lan.config.stp;
import cn.dev33.satoken.stp.StpInterface; import cn.dev33.satoken.stp.StpInterface;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.biutag.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.entity.system.Menu; import com.biutag.entity.system.Menu;
import com.biutag.entity.system.Perm; import com.biutag.entity.system.Perm;
import com.biutag.mapper.system.MenuMapper; import com.biutag.mapper.system.MenuMapper;

1
mailbox-lan/src/main/java/com/biutag/lan/controller/FileController.java

@ -30,6 +30,7 @@ public class FileController {
return AjaxResult.success(JSONObject.of("filepath", filepath)); return AjaxResult.success(JSONObject.of("filepath", filepath));
} }
@NotPower
@ResponseBody @ResponseBody
@PostMapping("upload/base64") @PostMapping("upload/base64")
public AjaxResult<JSONObject> upload(@RequestBody JSONObject file) { public AjaxResult<JSONObject> upload(@RequestBody JSONObject file) {

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

@ -6,7 +6,7 @@ import com.alibaba.fastjson2.JSONObject;
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.enums.RoleEnum;
import com.biutag.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.bo.MailTotal; import com.biutag.lan.domain.bo.MailTotal;
import com.biutag.lan.flow.FlowNodeEnum; import com.biutag.lan.flow.FlowNodeEnum;
import com.biutag.lan.service.MailMarkService; import com.biutag.lan.service.MailMarkService;

5
mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java

@ -1,13 +1,12 @@
package com.biutag.lan.controller; package com.biutag.lan.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.biutag.aop.NotPower; import com.biutag.aop.NotPower;
import com.biutag.core.AjaxResult; import com.biutag.core.AjaxResult;
import com.biutag.lan.domain.MailSource;
import com.biutag.lan.domain.bo.FlowAction; import com.biutag.lan.domain.bo.FlowAction;
import com.biutag.lan.domain.bo.InvalidCompletion; import com.biutag.lan.domain.bo.InvalidCompletion;
import com.biutag.lan.domain.bo.MailOuter; import com.biutag.lan.domain.bo.MailOuter;
import com.biutag.lan.domain.bo.MailSourceBo;
import com.biutag.lan.domain.vo.MailFlowDetail; import com.biutag.lan.domain.vo.MailFlowDetail;
import com.biutag.lan.service.MailService; import com.biutag.lan.service.MailService;
import jakarta.validation.Valid; import jakarta.validation.Valid;
@ -29,7 +28,7 @@ public class MailController {
return AjaxResult.success(mailService.getMailFlowDetail(id)); return AjaxResult.success(mailService.getMailFlowDetail(id));
} }
@NotPower @SaCheckPermission("mail:add")
@PostMapping("add") @PostMapping("add")
public AjaxResult<Boolean> add(@RequestBody @Valid MailOuter mail) { public AjaxResult<Boolean> add(@RequestBody @Valid MailOuter mail) {
return AjaxResult.success(mailService.save(mail)); return AjaxResult.success(mailService.save(mail));

9
mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java

@ -3,20 +3,11 @@ package com.biutag.lan.controller.datascreen;
import com.biutag.aop.NotLogin; import com.biutag.aop.NotLogin;
import com.biutag.aop.NotPower; import com.biutag.aop.NotPower;
import com.biutag.core.AjaxResult; import com.biutag.core.AjaxResult;
import com.biutag.entity.system.Duty;
import com.biutag.enums.DeptTypeEnum;
import com.biutag.lan.AdminThreadLocal;
import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.MailSource;
import com.biutag.lan.domain.vo.MailDetail; import com.biutag.lan.domain.vo.MailDetail;
import com.biutag.lan.domain.vo.MailFlowDetail;
import com.biutag.lan.service.DataScreenService; import com.biutag.lan.service.DataScreenService;
import com.biutag.lan.service.IDutyService; import com.biutag.lan.service.IDutyService;
import com.biutag.lan.service.IIndexService;
import com.biutag.lan.service.MailService; import com.biutag.lan.service.MailService;
import com.biutag.util.DateUtils;
import com.biutag.util.StringUtils;
import com.google.gson.JsonObject;
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 jakarta.annotation.Resource;

4
mailbox-lan/src/main/java/com/biutag/lan/controller/system/MenuController.java

@ -1,8 +1,7 @@
package com.biutag.lan.controller.system; package com.biutag.lan.controller.system;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.biutag.aop.NotLogin; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.AdminThreadLocal;
import com.biutag.lan.aop.Log; import com.biutag.lan.aop.Log;
import com.biutag.aop.NotPower; import com.biutag.aop.NotPower;
import com.biutag.lan.service.IMenuService; import com.biutag.lan.service.IMenuService;
@ -18,7 +17,6 @@ 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 java.util.ArrayList;
import java.util.List; import java.util.List;
@RestController @RestController

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

@ -4,7 +4,7 @@ import com.biutag.aop.NotPower;
import com.biutag.core.AjaxResult; import com.biutag.core.AjaxResult;
import com.biutag.core.PageResult; import com.biutag.core.PageResult;
import com.biutag.entity.system.PoliceUser; import com.biutag.entity.system.PoliceUser;
import com.biutag.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.aop.Log; import com.biutag.lan.aop.Log;
import com.biutag.lan.service.IPoliceUserService; import com.biutag.lan.service.IPoliceUserService;
import com.biutag.lan.validate.commons.IdValidate; import com.biutag.lan.validate.commons.IdValidate;

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

@ -138,6 +138,12 @@ public class Mail {
* 联系民警 * 联系民警
*/ */
private String contactPoliceEmpNo; private String contactPoliceEmpNo;
/**
* 联系民警职位
*/
private String contactPolicePost;
/** /**
* 联系群众时间 * 联系群众时间
*/ */
@ -151,7 +157,7 @@ public class Mail {
/** /**
* 是否联系群众 * 是否联系群众
*/ */
private String contactFlag; private Boolean contactFlag;
/** /**
* 接访形式 * 接访形式
@ -333,4 +339,14 @@ public class Mail {
*/ */
private String invalidationReason; private String invalidationReason;
/**
* 市局下发信息
*/
private String firstDistributeInfo;
/**
* 二级单位下发信息
*/
private String secondDistributeInfo;
} }

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

@ -4,9 +4,13 @@ import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.biutag.enums.RoleEnum;
import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.MailCountersign; import com.biutag.lan.domain.MailCountersign;
import com.biutag.lan.domain.MailExtensionApproval; import com.biutag.lan.domain.MailExtensionApproval;
import com.biutag.lan.domain.Work;
import com.biutag.lan.enums.WorkType;
import com.biutag.lan.flow.FlowNodeEnum;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@ -86,6 +90,11 @@ public class MailVo {
*/ */
private String mailLevel; private String mailLevel;
/**
* 信件当前流程
*/
private String flowKey;
/** /**
* 流程限时最后操作时间 * 流程限时最后操作时间
*/ */
@ -107,12 +116,40 @@ public class MailVo {
*/ */
private Integer flowLimitedTime; private Integer flowLimitedTime;
private String secondDeptName;
/** /**
* 协办核查民警String * 协办核查民警json
*/ */
private String coHandlingPolices; private JSONArray coHandlingPolices;
private String secondDeptName; /**
* 联系民警名称
*/
private String contactPoliceName;
/**
* 联系民警
*/
private String contactPoliceEmpNo;
/**
* 联系民警职位
*/
private String contactPolicePost;
/**
* 联系群众时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime contactTime;
/**
* 是否联系群众
*/
private Boolean contactFlag;
/** /**
* 接访形式 * 接访形式
@ -256,6 +293,21 @@ public class MailVo {
*/ */
private Long contactDuration; private Long contactDuration;
/**
* 是否是简易流程
*/
private Boolean simpleFlowFlag;
/**
* 市局下发信息
*/
private JSONObject firstDistributeInfo;
/**
* 二级单位下发信息
*/
private JSONObject secondDistributeInfo;
/** /**
* 部门会签 * 部门会签
*/ */
@ -268,6 +320,11 @@ public class MailVo {
BeanUtils.copyProperties(mail, mailVo); BeanUtils.copyProperties(mail, mailVo);
// 附件 // 附件
mailVo.setAttachments(Optional.ofNullable(mail.getAttachments()).map(JSON::parseArray).orElse(new JSONArray())); mailVo.setAttachments(Optional.ofNullable(mail.getAttachments()).map(JSON::parseArray).orElse(new JSONArray()));
// 协办民警
if (StrUtil.isNotBlank(mail.getCoHandlingPolices())) {
mailVo.setCoHandlingPolices(JSON.parseArray(mail.getCoHandlingPolices()));
}
// 接访附件(佐证材料) // 接访附件(佐证材料)
if (StrUtil.isNotBlank(mail.getInterviewAttachments())) { if (StrUtil.isNotBlank(mail.getInterviewAttachments())) {
mailVo.setInterviewAttachments(JSON.parseArray(mail.getInterviewAttachments())); mailVo.setInterviewAttachments(JSON.parseArray(mail.getInterviewAttachments()));
@ -292,6 +349,19 @@ public class MailVo {
if (StrUtil.isNotBlank(mail.getVerifyAttachments())) { if (StrUtil.isNotBlank(mail.getVerifyAttachments())) {
mailVo.setVerifyAttachments(JSON.parseArray(mail.getVerifyAttachments())); mailVo.setVerifyAttachments(JSON.parseArray(mail.getVerifyAttachments()));
} }
// 下发信息
if (StrUtil.isNotBlank(mail.getFirstDistributeInfo())) {
JSONObject jsonObject = JSON.parseObject(mail.getFirstDistributeInfo());
mailVo.setFirstDistributeInfo(JSON.parseObject(mail.getFirstDistributeInfo()));
mailVo.setSecondaryResponsibleFlag(jsonObject.getJSONArray("secondDept").size() > 0);
}
// 下发信息
if (StrUtil.isNotBlank(mail.getSecondDistributeInfo())) {
JSONObject jsonObject = JSON.parseObject(mail.getSecondDistributeInfo());
mailVo.setSecondDistributeInfo(jsonObject);
mailVo.setSecondaryResponsibleFlag(jsonObject.getJSONArray("secondDept").size() > 0);
}
return mailVo; return mailVo;
} }

1
mailbox-lan/src/main/java/com/biutag/lan/flow/ActionEnum.java

@ -6,6 +6,7 @@ import lombok.Getter;
@Getter @Getter
@AllArgsConstructor @AllArgsConstructor
public enum ActionEnum { public enum ActionEnum {
save("save", "确认保存"),
offline("offline", "线下审批"), offline("offline", "线下审批"),
online("online", "线上审批"), online("online", "线上审批"),
countersign("countersign", "发起会签"), countersign("countersign", "发起会签"),

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

@ -45,8 +45,6 @@ public class FlowConfig {
Action onlineAction = Action.of("online", "提交办结", "primary", false, "提交线上办结"); Action onlineAction = Action.of("online", "提交办结", "primary", false, "提交线上办结");
Action approvedSumbitAction = Action.of("approvedSubmit", "审批通过", "primary", false, "审批通过"); Action approvedSumbitAction = Action.of("approvedSubmit", "审批通过", "primary", false, "审批通过");
Action reportAction = Action.of("report", "呈报市局", "primary", false, "呈报市局"); Action reportAction = Action.of("report", "呈报市局", "primary", false, "呈报市局");
@ -129,7 +127,7 @@ public class FlowConfig {
// 线上申请办结 // 线上申请办结
.next("online", threeLeaderApprovalFlow) .next("online", threeLeaderApprovalFlow)
// 线下申请办结 // 线下申请办结
.next("offline", threeLeaderApprovalFlow); .next("offline", secondApprovalFlow);
// 三级机构领导审批 // 三级机构领导审批
threeLeaderApprovalFlow threeLeaderApprovalFlow

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

@ -21,7 +21,7 @@ public enum FlowNodeEnum {
SECOND_DEPUTY_APPROVAL("second_deputy_approval", "二级机构分管领导审批", 12), SECOND_DEPUTY_APPROVAL("second_deputy_approval", "二级机构分管领导审批", 12),
SECOND_LEADER_APPROVAL("second_leader_approval", "二级机构正职领导审批", 13), SECOND_LEADER_APPROVAL("second_leader_approval", "二级机构正职领导审批", 13),
SECOND_REPORTING("second_reporting", "二级机构专班呈报", 14), SECOND_REPORTING("second_reporting", "二级机构专班呈报", 14),
FIRST_APPROVAL("first_approval", "市局专班审批", 15), FIRST_APPROVAL("first_approval", "审批", 15),
COUNTERSIGN("countersign", "部门会签", 16), COUNTERSIGN("countersign", "部门会签", 16),
COMPLETION("completion", "已办结", 17); COMPLETION("completion", "已办结", 17);

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

@ -2,7 +2,7 @@ package com.biutag.lan.flow.node;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.biutag.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.*; import com.biutag.lan.domain.*;
import com.biutag.lan.flow.Flow; import com.biutag.lan.flow.Flow;
import com.biutag.lan.service.*; import com.biutag.lan.service.*;

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

@ -4,7 +4,7 @@ import com.alibaba.fastjson2.JSONObject;
import com.biutag.constants.AppConstants; import com.biutag.constants.AppConstants;
import com.biutag.enums.RoleEnum; import com.biutag.enums.RoleEnum;
import com.biutag.exception.BusinessException; import com.biutag.exception.BusinessException;
import com.biutag.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.MailMark; import com.biutag.lan.domain.MailMark;
import com.biutag.lan.domain.MailReturn; import com.biutag.lan.domain.MailReturn;

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

@ -18,6 +18,8 @@ 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.ArrayList;
import java.util.List;
import java.util.Objects; import java.util.Objects;
/** /**
@ -40,17 +42,23 @@ public class FirstDistributeFlow extends Flow {
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
// 将我的工作待办改成已办 // 将我的工作待办改成已办
workService.updateDone(mailId, RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId(),now); workService.updateDone(mailId, RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId(),now);
List<JSONObject> secondDept = new ArrayList<>();
JSONObject firstDistributeInfo = JSONObject.of("mainDept", JSONObject.of("id", mainDeptId),
"secondDept", secondDept);
// 下发信件(主责单位) // 下发信件(主责单位)
workService.saveOrUpdate(mail, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), mainDeptId, now, true); workService.saveOrUpdate(mail, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), mainDeptId, now, true);
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);
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);
firstDistributeInfo.put("secondDept2", JSONObject.of("id", secondDeptId2));
} }
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);
// 更新信件 // 更新信件
@ -60,7 +68,8 @@ public class FirstDistributeFlow extends Flow {
.setFlowBeforeName(nextNode.getFlowNode().getBeforeName()) .setFlowBeforeName(nextNode.getFlowNode().getBeforeName())
.setFlowLimitedLastHandlerTime(now) .setFlowLimitedLastHandlerTime(now)
.setSecondDeptId(mainDeptId) .setSecondDeptId(mainDeptId)
.setSecondDeptName(deptVo.getName()); .setSecondDeptName(deptVo.getName())
.setFirstDistributeInfo(firstDistributeInfo.toJSONString());
mailService.updateById(mail); mailService.updateById(mail);
return nextNode; return nextNode;
} }

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

@ -2,7 +2,7 @@ package com.biutag.lan.flow.node;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.biutag.exception.BusinessException; import com.biutag.exception.BusinessException;
import com.biutag.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.MailSource; import com.biutag.lan.domain.MailSource;
import com.biutag.lan.domain.Work; import com.biutag.lan.domain.Work;

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

@ -2,9 +2,11 @@ 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.lan.AdminThreadLocal; import com.biutag.exception.BusinessException;
import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.MailReturn; import com.biutag.lan.domain.MailReturn;
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.FlowNodeEnum; import com.biutag.lan.flow.FlowNodeEnum;
@ -40,24 +42,16 @@ public class SecondApprovalFlow extends Flow {
return mailService.countersign(next.get(nextActionKey), mailId, data.getString("countersignRequirement"), return mailService.countersign(next.get(nextActionKey), mailId, data.getString("countersignRequirement"),
data.getList("countersignDeptIds", Integer.class)); data.getList("countersignDeptIds", Integer.class));
} }
String leaderEmpNo = data.getString("leaderEmpNo");
Assert.hasText(leaderEmpNo, "参数错误");
LocalDateTime now = LocalDateTime.now();
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
// 审批意见 // 线下
mailApprovalService.saveOrUpdate(mailId, mail.getFlowKey(), data.getString("approvalComment"), leaderEmpNo, now); if (mail.getCompleteMethod().equals(CompleteMethod.offline.name())) {
// 将二级专班角色的信件改为已办 return offlineApproval(mail, data);
workService.updateDone(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now); }
// 将二级副职领导新增信件 // 线上
workService.save(mail, leaderEmpNo, now); if (mail.getCompleteMethod().equals(CompleteMethod.online.name())) {
Flow nextNode = next.get(nextActionKey); return onlineApproval(nextActionKey, mail, data);
// 更新信件 }
mail.setUpdateTime(now) throw new BusinessException();
.setFlowKey(nextNode.getFlowNode().getKey())
.setFlowBeforeName(nextNode.getFlowNode().getBeforeName());
mailService.updateById(mail);
return nextNode;
} }
public Flow mailReturn(String mailId, JSONObject data) { public Flow mailReturn(String mailId, JSONObject data) {
@ -86,4 +80,43 @@ public class SecondApprovalFlow extends Flow {
return null; return null;
} }
public Flow offlineApproval(Mail mail, JSONObject data) {
String approvalComment = data.getString("approvalComment");
Assert.hasText(approvalComment, "审批意见不能为空");
LocalDateTime now = LocalDateTime.now();
// 审批意见
mailApprovalService.saveOrUpdate(mail.getId(), mail.getFlowKey(), data.getString("approvalComment"), null, now);
// 将二级专班角色的信件改为已办
workService.updateDone(mail.getId(), RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now);
// 将市局专班信件改为待办
workService.updateTodo(mail.getId(), RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId(), now);
// 更新信件
mail.setUpdateTime(now)
.setFlowKey(FlowNodeEnum.FIRST_APPROVAL.getKey())
.setFlowBeforeName(FlowNodeEnum.FIRST_APPROVAL.getFullName());
mailService.updateById(mail);
return null;
}
public Flow onlineApproval(String nextActionKey, Mail mail, JSONObject data) {
String leaderEmpNo = data.getString("leaderEmpNo");
Assert.hasText(leaderEmpNo, "参数错误");
String approvalComment = data.getString("approvalComment");
Assert.hasText(approvalComment, "审批意见不能为空");
LocalDateTime now = LocalDateTime.now();
// 审批意见
mailApprovalService.saveOrUpdate(mail.getId(), mail.getFlowKey(), data.getString("approvalComment"), leaderEmpNo, now);
// 将二级专班角色的信件改为已办
workService.updateDone(mail.getId(), RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now);
// 将二级副职领导新增信件
workService.save(mail, leaderEmpNo, now);
Flow nextNode = next.get(nextActionKey);
// 更新信件
mail.setUpdateTime(now)
.setFlowKey(nextNode.getFlowNode().getKey())
.setFlowBeforeName(nextNode.getFlowNode().getBeforeName());
mailService.updateById(mail);
return nextNode;
}
} }

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

@ -2,7 +2,7 @@ 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.lan.AdminThreadLocal; 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;
@ -15,8 +15,6 @@ import org.springframework.stereotype.Component;
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.stream.Collectors;
@RequiredArgsConstructor @RequiredArgsConstructor
@Component @Component

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

@ -2,14 +2,12 @@ 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.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
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.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.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;
@ -19,6 +17,8 @@ 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.ArrayList;
import java.util.List;
import java.util.Objects; import java.util.Objects;
@RequiredArgsConstructor @RequiredArgsConstructor
@ -52,6 +52,9 @@ public class SecondDistributeFlow extends Flow {
myWork.setWorkState(Work.State.done.name()).setUpdateTime(now); myWork.setWorkState(Work.State.done.name()).setUpdateTime(now);
workService.updateById(myWork); workService.updateById(myWork);
List<JSONObject> secondDept = new ArrayList<>();
JSONObject secondDistributeInfo = JSONObject.of("mainDept", JSONObject.of("id", mainDeptId),
"secondDept", secondDept);
// 下发信件(主责单位) // 下发信件(主责单位)
workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), mainDeptId, now, true); workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), mainDeptId, now, true);
@ -59,11 +62,13 @@ public class SecondDistributeFlow extends Flow {
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);
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);
secondDept.add(JSONObject.of("id", secondDeptId1));
} }
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);
// 更新信件 // 更新信件
@ -73,7 +78,8 @@ public class SecondDistributeFlow extends Flow {
.setFlowBeforeName(nextNode.getFlowNode().getBeforeName()) .setFlowBeforeName(nextNode.getFlowNode().getBeforeName())
.setFlowLimitedLastHandlerTime(now) .setFlowLimitedLastHandlerTime(now)
.setThreeDeptId(mainDeptId) .setThreeDeptId(mainDeptId)
.setThreeDeptName(deptVo.getName()); .setThreeDeptName(deptVo.getName())
.setSecondDistributeInfo(secondDistributeInfo.toJSONString());
mailService.updateById(mail); mailService.updateById(mail);
return nextNode; return nextNode;
} }

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

@ -2,7 +2,7 @@ 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.lan.AdminThreadLocal; 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;

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

@ -1,9 +1,11 @@
package com.biutag.lan.flow.node; package com.biutag.lan.flow.node;
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;
import com.biutag.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.MailReturn; import com.biutag.lan.domain.MailReturn;
import com.biutag.lan.domain.Work; import com.biutag.lan.domain.Work;
@ -19,6 +21,8 @@ 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;
/** /**
* 二级机构签收 * 二级机构签收
@ -56,7 +60,7 @@ public class SecondSignFlow extends Flow {
.setMailId(mailId) .setMailId(mailId)
.setReason(reason) .setReason(reason)
.setHandlerEmpNo(AdminThreadLocal.getEmpNo()) .setHandlerEmpNo(AdminThreadLocal.getEmpNo())
.setHandlerDeptId(AdminThreadLocal.getDeptId()) .setHandlerDeptId(deptId)
.setHandlerDeptName(AdminThreadLocal.getDeptName()) .setHandlerDeptName(AdminThreadLocal.getDeptName())
.setCreateTime(now); .setCreateTime(now);
mailReturnService.save(mailReturn); mailReturnService.save(mailReturn);
@ -65,11 +69,25 @@ public class SecondSignFlow extends Flow {
workService.updateById(work); workService.updateById(work);
// 更新市局专班的待办 // 更新市局专班的待办
workService.updateTodo(mailId, RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId(), now); workService.updateTodo(mailId, RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId(), now);
// 更新信件
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
// 主责单位
if (work.getMainDeptFlag()) {
mail.setUpdateTime(now) mail.setUpdateTime(now)
.setFlowKey(FlowNodeEnum.FIRST_DISTRIBUTE.getKey()) .setFlowKey(FlowNodeEnum.FIRST_DISTRIBUTE.getKey())
.setFlowBeforeName("信件退回"); .setFlowBeforeName("信件退回");
} else {
JSONObject firstDistributeInfo = JSON.parseObject(mail.getFirstDistributeInfo());
JSONObject secondDept1 = firstDistributeInfo.getJSONObject("secondDept1");
if (Objects.nonNull(secondDept1) && secondDept1.getInteger("id").equals(deptId)) {
secondDept1.put("returnFlag", true);
}
JSONObject secondDept2 = firstDistributeInfo.getJSONObject("secondDept2");
if (Objects.nonNull(secondDept2) && secondDept2.getInteger("id").equals(deptId)) {
secondDept2.put("returnFlag", true);
}
mail.setFirstDistributeInfo(firstDistributeInfo.toJSONString());
}
// 更新信件
mailService.updateById(mail); mailService.updateById(mail);
return null; return null;
} }
@ -90,10 +108,13 @@ public class SecondSignFlow extends Flow {
// 更新信件 // 更新信件
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);
// 主责单位
if (work.getMainDeptFlag()) {
mail.setUpdateTime(now) mail.setUpdateTime(now)
.setFlowKey(nextNode.getFlowNode().getKey()) .setFlowKey(nextNode.getFlowNode().getKey())
.setFlowBeforeName(nextNode.getFlowNode().getBeforeName()); .setFlowBeforeName(nextNode.getFlowNode().getBeforeName());
mailService.updateById(mail); mailService.updateById(mail);
}
return nextNode; return nextNode;
} }

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

@ -6,6 +6,7 @@ import com.alibaba.fastjson2.JSONObject;
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.FlowNodeEnum;
import com.biutag.lan.service.MailService; import com.biutag.lan.service.MailService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -46,12 +47,19 @@ public class ThreeContactWriterFlow extends Flow {
mail.setUpdateTime(now) mail.setUpdateTime(now)
.setContactPoliceName(contactPolice.getString("name")) .setContactPoliceName(contactPolice.getString("name"))
.setContactPoliceEmpNo(contactPolice.getString("empNo")) .setContactPoliceEmpNo(contactPolice.getString("empNo"))
.setContactPolicePost(contactPolice.getString("post"))
.setContactTime(DateUtil.parseLocalDateTime(contactTime, DatePattern.NORM_DATETIME_PATTERN)) .setContactTime(DateUtil.parseLocalDateTime(contactTime, DatePattern.NORM_DATETIME_PATTERN))
.setContactDuration(data.getLong("contactDuration")) .setContactDuration(data.getLong("contactDuration"))
.setContactPoliceEmpNo(data.getString("contactDuration")) .setContactPoliceEmpNo(data.getString("contactDuration"))
.setContactFlag(data.getBoolean("contactFlag"))
.setFlowKey(nextNode.getFlowNode().getKey()) .setFlowKey(nextNode.getFlowNode().getKey())
.setFlowBeforeName(nextNode.getFlowNode().getBeforeName()) .setFlowBeforeName(nextNode.getFlowNode().getBeforeName())
.setFlowLimitedLastHandlerTime(now); .setFlowLimitedLastHandlerTime(now);
// 如果是简易流程
if (mail.getSimpleFlowFlag()) {
mail.setFlowKey(FlowNodeEnum.VERIFY.getKey())
.setFlowBeforeName(FlowNodeEnum.VERIFY.getFullName());
}
mailService.updateById(mail); mailService.updateById(mail);
return nextNode; return nextNode;
} }

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

@ -2,7 +2,7 @@ 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.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.Mail; 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;

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

@ -3,7 +3,7 @@ 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.exception.BusinessException;
import com.biutag.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.MailReturn; import com.biutag.lan.domain.MailReturn;
import com.biutag.lan.domain.Work; import com.biutag.lan.domain.Work;

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

@ -1,12 +1,14 @@
package com.biutag.lan.flow.node; package com.biutag.lan.flow.node;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
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;
import com.biutag.lan.AdminThreadLocal; 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.enums.CompleteMethod;
import com.biutag.lan.enums.ExtensionState; 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;
@ -18,6 +20,7 @@ import org.springframework.stereotype.Component;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Optional;
@RequiredArgsConstructor @RequiredArgsConstructor
@Component @Component
@ -30,7 +33,7 @@ public class ThreeVerifyFlow extends Flow {
public Flow next(String nextActionKey, String mailId, JSONObject data) { public Flow next(String nextActionKey, String mailId, JSONObject data) {
// 线下 // 线下
if (ActionEnum.offline.name().equals(nextActionKey)) { if (ActionEnum.offline.name().equals(nextActionKey)) {
throw new BusinessException("功能开发中..."); return offline(nextActionKey, mailId, data);
} }
// 线上 // 线上
if (ActionEnum.online.name().equals(nextActionKey)) { if (ActionEnum.online.name().equals(nextActionKey)) {
@ -40,23 +43,102 @@ public class ThreeVerifyFlow extends Flow {
if (ActionEnum.applyExtensionSubmit.name().equals(nextActionKey)) { if (ActionEnum.applyExtensionSubmit.name().equals(nextActionKey)) {
return applyExtensionSubmit(mailId, data); return applyExtensionSubmit(mailId, data);
} }
// 确认保存
if (ActionEnum.save.name().equals(nextActionKey)) {
return save(mailId, data);
}
throw new BusinessException(); throw new BusinessException();
} }
public Flow applyExtensionSubmit(String mailId, JSONObject data) {
Integer extensionDays = data.getInteger("extensionDays");
Assert.notNull(extensionDays, "延期时长不能为空");
String reason = data.getString("extensionReason");
Assert.hasText(reason, "延期理由不能为空");
LocalDateTime now = LocalDateTime.now();
public Flow online(String nextActionKey, String mailId, JSONObject data) { // 给二级机构增加待办
String leaderEmpNo = data.getString("leaderEmpNo"); workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), WorkType.extension_approval.name(), now);
Assert.hasText(leaderEmpNo, "未选择上级领导!");
Mail mail = mailService.getById(mailId);
mail.setUpdateTime(now)
.setExtensionDays(extensionDays)
.setExtensionReason(reason)
.setExtensionState(ExtensionState.applying.name());
mailService.updateById(mail);
return null;
}
public Flow save(String mailId, JSONObject data) {
JSONObject verifyFollowupPoliceObj = data.getJSONObject("verifyFollowupPolice"); JSONObject verifyFollowupPoliceObj = data.getJSONObject("verifyFollowupPolice");
Assert.notNull(verifyFollowupPoliceObj, "参数异常"); Assert.notNull(verifyFollowupPoliceObj, "请填写回访人信息");
LocalDateTime now = LocalDateTime.now(); String verifyFollowupPolice = JSONObject
// 更新信件 .of("name", verifyFollowupPoliceObj.getString("name"),
"empNo", verifyFollowupPoliceObj.getString("empNo"),
"phone", verifyFollowupPoliceObj.getString("phone")).toJSONString();
JSONObject contactPolice = data.getJSONObject("contactPolice");
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
Mail source = new Mail()
// 联系群众
.setContactPoliceName(Optional.ofNullable(contactPolice).map(item -> item.getString("name")).orElse(null))
.setContactPoliceEmpNo(Optional.ofNullable(contactPolice).map(item -> item.getString("empNo")).orElse(null))
.setContactPolicePost(Optional.ofNullable(contactPolice).map(item -> item.getString("post")).orElse(null))
.setContactTime(Optional.ofNullable(data.getString("contactTime")).map(item -> DateUtil.parseLocalDateTime(item, DatePattern.NORM_DATETIME_PATTERN)).orElse(null))
.setContactDuration(data.getLong("contactDuration"))
.setContactPoliceEmpNo(data.getString("contactDuration"))
.setContactFlag(data.getBoolean("contactFlag"))
// 群众接访
.setInterviewType(data.getString("interviewType"))
.setInterviewIsLeader(data.getBoolean("interviewIsLeader"))
.setInterviewPoliceEmpNo(data.getString("interviewPoliceEmpNo"))
.setInterviewPoliceName(data.getString("interviewPoliceName"))
.setInterviewDetails(data.getString("interviewDetails"))
.setInterviewAttachments(data.getString("interviewAttachments"))
// 核查办理
.setVerifyDetails(data.getString("verifyDetails"))
.setVerifyIsTrue(data.getString("verifyIsTrue"))
.setVerifyReportedPolices(data.getString("verifyReportedPolices"))
.setVerifyProblem(data.getString("verifyProblem"))
.setVerifyNeedAccountability(data.getBoolean("verifyNeedAccountability"))
.setVerifyPunish(data.getString("verifyPunish"))
.setVerifyIsResolved(data.getBoolean("verifyIsResolved"))
.setVerifyFeedback(data.getString("verifyFeedback"))
.setVerifyFollowupPolice(verifyFollowupPolice)
.setVerifyAttachments(data.getString("verifyAttachments"));
BeanUtil.copyProperties(source, mail, CopyOptions.create().setIgnoreNullValue(true));
mailService.updateById(mail);
return null;
}
public void applicationCompleted(String nextActionKey, Mail mail, JSONObject data, LocalDateTime now) {
JSONObject verifyFollowupPoliceObj = data.getJSONObject("verifyFollowupPolice");
Assert.notNull(verifyFollowupPoliceObj, "参数异常");
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);
String verifyFollowupPolice = JSONObject.of("name", verifyFollowupPoliceObj.getString("name"), JSONObject contactPolice = data.getJSONObject("contactPolice");
String verifyFollowupPolice = JSONObject
.of("name", verifyFollowupPoliceObj.getString("name"),
"empNo", verifyFollowupPoliceObj.getString("empNo"), "empNo", verifyFollowupPoliceObj.getString("empNo"),
"phone", verifyFollowupPoliceObj.getString("phone")).toJSONString(); "phone", verifyFollowupPoliceObj.getString("phone")).toJSONString();
mail.setUpdateTime(now) Mail source = new Mail()
// 联系群众
.setContactPoliceName(Optional.ofNullable(contactPolice).map(item -> item.getString("name")).orElse(null))
.setContactPoliceEmpNo(Optional.ofNullable(contactPolice).map(item -> item.getString("empNo")).orElse(null))
.setContactPolicePost(Optional.ofNullable(contactPolice).map(item -> item.getString("post")).orElse(null))
.setContactTime(Optional.ofNullable(data.getString("contactTime")).map(item -> DateUtil.parseLocalDateTime(item, DatePattern.NORM_DATETIME_PATTERN)).orElse(null))
.setContactDuration(data.getLong("contactDuration"))
.setContactPoliceEmpNo(data.getString("contactDuration"))
.setContactFlag(data.getBoolean("contactFlag"))
// 群众接访
.setInterviewType(data.getString("interviewType"))
.setInterviewIsLeader(data.getBoolean("interviewIsLeader"))
.setInterviewPoliceEmpNo(data.getString("interviewPoliceEmpNo"))
.setInterviewPoliceName(data.getString("interviewPoliceName"))
.setInterviewDetails(data.getString("interviewDetails"))
.setInterviewAttachments(data.getString("interviewAttachments"))
// 核查办理
.setVerifyDetails(data.getString("verifyDetails")) .setVerifyDetails(data.getString("verifyDetails"))
.setVerifyIsTrue(data.getString("verifyIsTrue")) .setVerifyIsTrue(data.getString("verifyIsTrue"))
.setVerifyReportedPolices(data.getString("verifyReportedPolices")) .setVerifyReportedPolices(data.getString("verifyReportedPolices"))
@ -66,37 +148,38 @@ public class ThreeVerifyFlow extends Flow {
.setVerifyIsResolved(data.getBoolean("verifyIsResolved")) .setVerifyIsResolved(data.getBoolean("verifyIsResolved"))
.setVerifyFeedback(data.getString("verifyFeedback")) .setVerifyFeedback(data.getString("verifyFeedback"))
.setVerifyFollowupPolice(verifyFollowupPolice) .setVerifyFollowupPolice(verifyFollowupPolice)
.setVerifyAttachments(data.getString("verifyAttachments")) .setVerifyAttachments(data.getString("verifyAttachments"));
BeanUtil.copyProperties(source, mail, CopyOptions.create().setIgnoreNullValue(true));
mail.setUpdateTime(now)
// 申请办结 // 申请办结
.setCompleteMethod(data.getString("completeMethod")) .setCompleteMethod(data.getString("completeMethod"))
.setFlowKey(nextNode.getFlowNode().getKey()) .setFlowKey(nextNode.getFlowNode().getKey())
.setFlowBeforeName(nextNode.getFlowNode().getBeforeName()); .setFlowBeforeName(nextNode.getFlowNode().getBeforeName());
mailService.updateById(mail); mailService.updateById(mail);
workService.saveOrUpdate(mail, leaderEmpNo, now);
// 将本人下的件改为已办 // 将本人下的件改为已办
Work work = workService.getOne(mailId, AdminThreadLocal.getEmpNo()); workService.updateDone(mail.getId(), AdminThreadLocal.getRoleId(), now);
work.setWorkState(Work.State.done.name()).setUpdateTime(now);
workService.updateById(work);
return nextNode;
} }
public Flow applyExtensionSubmit(String mailId, JSONObject data) { public Flow offline(String nextActionKey, String mailId, JSONObject data) {
Integer extensionDays = data.getInteger("extensionDays");
Assert.notNull(extensionDays, "延期时长不能为空");
String reason = data.getString("extensionReason");
Assert.hasText(reason, "延期理由不能为空");
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
// 更新信件
Mail mail = mailService.getById(mailId);
applicationCompleted(nextActionKey, mail, data, now);
// 给二级机构专班增加待办
workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now);
return null;
}
// 给二级机构增加待办 public Flow online(String nextActionKey, String mailId, JSONObject data) {
workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), WorkType.extension_approval.name(), now); String leaderEmpNo = data.getString("leaderEmpNo");
Assert.hasText(leaderEmpNo, "未选择上级领导!");
LocalDateTime now = LocalDateTime.now();
// 更新信件
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
mail.setUpdateTime(now) applicationCompleted(nextActionKey, mail, data, now);
.setExtensionDays(extensionDays) // 给三级部门领导增加待办
.setExtensionReason(reason) workService.saveOrUpdate(mail, leaderEmpNo, now);
.setExtensionState(ExtensionState.applying.name());
mailService.updateById(mail);
return null; return null;
} }
} }

3
mailbox-lan/src/main/java/com/biutag/lan/service/FavoriteService.java

@ -5,10 +5,9 @@ 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.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.Favorite; import com.biutag.lan.domain.Favorite;
import com.biutag.lan.domain.MailSource; import com.biutag.lan.domain.MailSource;
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.FavoriteVo; import com.biutag.lan.domain.vo.FavoriteVo;
import com.biutag.lan.mapper.FavoriteMapper; import com.biutag.lan.mapper.FavoriteMapper;

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

@ -2,7 +2,7 @@ package com.biutag.lan.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.MailApproval; import com.biutag.lan.domain.MailApproval;
import com.biutag.lan.mapper.MailApprovalMapper; import com.biutag.lan.mapper.MailApprovalMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;

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

@ -2,7 +2,7 @@ package com.biutag.lan.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.MailExtensionApproval; import com.biutag.lan.domain.MailExtensionApproval;
import com.biutag.lan.mapper.MailExtensionApprovalMapper; import com.biutag.lan.mapper.MailExtensionApprovalMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;

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

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.entity.system.Dept; import com.biutag.entity.system.Dept;
import com.biutag.enums.RoleEnum; import com.biutag.enums.RoleEnum;
import com.biutag.exception.BusinessException; import com.biutag.exception.BusinessException;
import com.biutag.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.*; import com.biutag.lan.domain.*;
import com.biutag.lan.domain.bo.FlowAction; import com.biutag.lan.domain.bo.FlowAction;
import com.biutag.lan.domain.bo.InvalidCompletion; import com.biutag.lan.domain.bo.InvalidCompletion;
@ -105,6 +105,19 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
mailVo.setCountersigns(mailCountersignService.list(mailId)); mailVo.setCountersigns(mailCountersignService.list(mailId));
if (!list.isEmpty()) { if (!list.isEmpty()) {
// 线下
if (CompleteMethod.offline.name().equals(mail.getCompleteMethod())) {
List<MailApprovalVo> approvalVos = Arrays.asList(FlowNodeEnum.SECOND_APPROVAL).stream().map(item -> {
MailApprovalVo vo = new MailApprovalVo();
list.stream().filter(approval -> item.getKey().equals(approval.getFlowKey())).findFirst().ifPresent(approval -> {
BeanUtils.copyProperties(approval, vo);
vo.setApproved(true);
});
return vo;
}).collect(Collectors.toList());
flowDetail.setApprovals(approvalVos);
}
// 线上
if (CompleteMethod.online.name().equals(mail.getCompleteMethod())) { if (CompleteMethod.online.name().equals(mail.getCompleteMethod())) {
List<MailApprovalVo> approvalVos = Arrays.asList(FlowNodeEnum.THREE_LEADER_APPROVAL, FlowNodeEnum.SECOND_APPROVAL, FlowNodeEnum.SECOND_DEPUTY_APPROVAL, List<MailApprovalVo> approvalVos = Arrays.asList(FlowNodeEnum.THREE_LEADER_APPROVAL, FlowNodeEnum.SECOND_APPROVAL, FlowNodeEnum.SECOND_DEPUTY_APPROVAL,
FlowNodeEnum.SECOND_LEADER_APPROVAL).stream().map(item -> { FlowNodeEnum.SECOND_LEADER_APPROVAL).stream().map(item -> {
@ -146,11 +159,7 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
if (ExtensionState.applying.name().equals(mail.getExtensionState())) { if (ExtensionState.applying.name().equals(mail.getExtensionState())) {
mailVo.setExtensionApprovals(mailExtensionApprovalService.list(mailId)); mailVo.setExtensionApprovals(mailExtensionApprovalService.list(mailId));
} }
// 判断是否选择了次责单位
if (FlowNodeEnum.SECOND_DISTRIBUTE.getKey().equals(mail.getFlowKey())) {
List<Work> works = workService.list(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), WorkType.processing.name());
mailVo.setSecondaryResponsibleFlag(works.size() > 1);
}
if (Objects.nonNull(mail.getFlowKey()) && FlowNodeEnum.get(mail.getFlowKey()).getIndex() >= FlowNodeEnum.THREE_LEADER_APPROVAL.getIndex()) { if (Objects.nonNull(mail.getFlowKey()) && FlowNodeEnum.get(mail.getFlowKey()).getIndex() >= FlowNodeEnum.THREE_LEADER_APPROVAL.getIndex()) {
// 主单位签收时长 // 主单位签收时长
long mainDeptSignTime = flows.stream().filter(item -> item.getFlowKey().contains("_sign") || item.getFlowKey().contains("_distribute")).mapToLong(MailFlow::getConsumingTime).sum(); long mainDeptSignTime = flows.stream().filter(item -> item.getFlowKey().contains("_sign") || item.getFlowKey().contains("_distribute")).mapToLong(MailFlow::getConsumingTime).sum();
@ -283,8 +292,9 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
workService.updateById(work); workService.updateById(work);
if (!returnFlag) { if (!returnFlag) {
Mail mail = getById(mailId); Mail mail = getById(mailId);
// 驳回 mail.setExtensionState(ExtensionState.completion.name()).setExtensionFlag(true)
mail.setExtensionState(ExtensionState.completion.name()).setExtensionFlag(true); // 信件状态(已延期)
.setMailState(MailState.delayed.name());
return updateById(mail); return updateById(mail);
} }
} }

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

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.core.AjaxResult; import com.biutag.core.AjaxResult;
import com.biutag.enums.RoleEnum; import com.biutag.enums.RoleEnum;
import com.biutag.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.MailLabel; import com.biutag.lan.domain.MailLabel;
import com.biutag.lan.domain.MailSource; import com.biutag.lan.domain.MailSource;

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

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Assert; import com.baomidou.mybatisplus.core.toolkit.Assert;
import com.biutag.constants.AppConstants; import com.biutag.constants.AppConstants;
import com.biutag.entity.setting.DictData; import com.biutag.entity.setting.DictData;
import com.biutag.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.service.IDeptService; import com.biutag.lan.service.IDeptService;
import com.biutag.lan.validate.system.DeptCreateValidate; import com.biutag.lan.validate.system.DeptCreateValidate;
import com.biutag.lan.validate.system.DeptSearchValidate; import com.biutag.lan.validate.system.DeptSearchValidate;
@ -26,7 +26,6 @@ import org.springframework.stereotype.Service;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 系统部门服务实现类 * 系统部门服务实现类

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

@ -3,7 +3,7 @@ package com.biutag.lan.service.impl;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
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;
import com.biutag.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.service.IMenuService; import com.biutag.lan.service.IMenuService;
import com.biutag.lan.service.IPermService; import com.biutag.lan.service.IPermService;
import com.biutag.lan.validate.system.MenuCreateValidate; import com.biutag.lan.validate.system.MenuCreateValidate;

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

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.core.PageResult; import com.biutag.core.PageResult;
import com.biutag.entity.system.*; import com.biutag.entity.system.*;
import com.biutag.exception.OperateException; import com.biutag.exception.OperateException;
import com.biutag.lan.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.enums.PostEnums; import com.biutag.lan.enums.PostEnums;
import com.biutag.lan.service.IPermService; import com.biutag.lan.service.IPermService;
import com.biutag.lan.service.IPoliceUserService; import com.biutag.lan.service.IPoliceUserService;

2
mailbox-lan/src/main/resources/application-prod.yml

@ -7,7 +7,7 @@ spring:
oss: oss:
minio: minio:
enable: true enable: true
endpoint: http://65.47.60.182:9090 endpoint: http://65.47.60.182:9001
accessKey: E2djtF6OKJtduYzzSKK4 accessKey: E2djtF6OKJtduYzzSKK4
secretKey: er5t3VxQP3KluD9Q1zgxuiyiS1PzQhAOThpwm9do secretKey: er5t3VxQP3KluD9Q1zgxuiyiS1PzQhAOThpwm9do
bucketName: mailbox bucketName: mailbox

2
mailbox-lan/src/main/resources/mapper/FavoriteMapper.xml

@ -9,7 +9,7 @@
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.flow_before_name,m.mail_labels
from favorite f from favorite f
left join mail m on f.mail_id = m.id left join mail m on f.mail_id = m.id
left join flow_node f on m.flow_key = f.key left join flow_node n on m.flow_key = n.key
${ew.getCustomSqlSegment} ${ew.getCustomSqlSegment}
</select> </select>

17
mailbox-lan/src/test/java/com/biutag/lan/BeanUtilsTest.java

@ -0,0 +1,17 @@
package com.biutag.lan;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.biutag.lan.domain.Mail;
import org.junit.jupiter.api.Test;
public class BeanUtilsTest {
@Test
public void copyPropertiesTest() {
Mail source = new Mail().setId("1");
Mail target = new Mail().setId("2").setContactName("testName");
BeanUtil.copyProperties(source, target, CopyOptions.create().setIgnoreNullValue(true));
System.out.println(target);
}
}

6
truncate.sql

@ -5,7 +5,13 @@ truncate table mail;
truncate table mail_flow; truncate table mail_flow;
truncate table mail_approval; truncate table mail_approval;
truncate table mail_extension_approval; truncate table mail_extension_approval;
truncate table mail_countersign;
truncate table mail_return;
truncate table mail_label;
truncate table work; truncate table work;
truncate table favorite; truncate table favorite;
truncate table mail_mark; truncate table mail_mark;
truncate table system_log_operate;
truncate table system_log_login;

Loading…
Cancel
Save