Browse Source

信件主流程

dev_ycq
wxc 2 years ago
parent
commit
295b085897
  1. 4
      mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java
  2. 5
      mailbox-lan/src/main/java/com/biutag/lan/domain/Mail.java
  3. 39
      mailbox-lan/src/main/java/com/biutag/lan/domain/MailCoHandling.java
  4. 2
      mailbox-lan/src/main/java/com/biutag/lan/domain/Work.java
  5. 11
      mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailVo.java
  6. 2
      mailbox-lan/src/main/java/com/biutag/lan/domain/vo/WorkVo.java
  7. 10
      mailbox-lan/src/main/java/com/biutag/lan/enums/CoType.java
  8. 7
      mailbox-lan/src/main/java/com/biutag/lan/enums/ReturnOperate.java
  9. 5
      mailbox-lan/src/main/java/com/biutag/lan/enums/WorkType.java
  10. 8
      mailbox-lan/src/main/java/com/biutag/lan/flow/FlowConfig.java
  11. 4
      mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNameEnum.java
  12. 3
      mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNodeEnum.java
  13. 49
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/CoHandlingFlow.java
  14. 8
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstApprovalFlow.java
  15. 9
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstDistributeFlow.java
  16. 2
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondApprovalFlow.java
  17. 2
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondDeputyApprovalFlow.java
  18. 47
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondDistributeFlow.java
  19. 5
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondSignFlow.java
  20. 7
      mailbox-lan/src/main/java/com/biutag/lan/mapper/MailCoHandlingMapper.java
  21. 11
      mailbox-lan/src/main/java/com/biutag/lan/service/MailCoHandlingService.java
  22. 19
      mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java
  23. 15
      mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java
  24. 4
      mailbox-lan/src/main/resources/application-prod.yml

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

@ -24,8 +24,8 @@ public class MailController {
@NotPower @NotPower
@GetMapping("{id}") @GetMapping("{id}")
public AjaxResult<MailFlowDetail> get(@PathVariable String id) { public AjaxResult<MailFlowDetail> get(@PathVariable String id, @RequestParam Integer workId) {
return AjaxResult.success(mailService.getMailFlowDetail(id)); return AjaxResult.success(mailService.getMailFlowDetail(id, workId));
} }
@SaCheckPermission("mail:add") @SaCheckPermission("mail:add")

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

@ -354,4 +354,9 @@ public class Mail {
*/ */
private Integer mainDeptLevel; private Integer mainDeptLevel;
/**
* 信件后续审批流程
*/
private String returnOperate;
} }

39
mailbox-lan/src/main/java/com/biutag/lan/domain/MailCoHandling.java

@ -0,0 +1,39 @@
package com.biutag.lan.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
@Setter
@Getter
@Accessors(chain = true)
public class MailCoHandling {
@TableId(type = IdType.AUTO)
private Integer id;
/**
*
*/
private String mailId;
/**
* 协办类型
*/
private String coType;
/**
* 核办情况
*/
private String verifyDetails;
/**
* 核办附件
*/
private String verifyAttachments;
/**
*
*/
private LocalDateTime createTime;
}

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

@ -98,6 +98,8 @@ public class Work {
*/ */
private String flowName; private String flowName;
private String flowKey;
@AllArgsConstructor @AllArgsConstructor
public enum State { public enum State {
todo, todo,

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

@ -320,6 +320,11 @@ public class MailVo {
*/ */
private Integer mainDeptLevel; private Integer mainDeptLevel;
/**
* 信件后续审批流程
*/
private String returnOperate;
/** /**
* 部门会签 * 部门会签
*/ */
@ -365,14 +370,14 @@ public class MailVo {
// 下发信息 // 下发信息
if (StrUtil.isNotBlank(mail.getFirstDistributeInfo())) { if (StrUtil.isNotBlank(mail.getFirstDistributeInfo())) {
JSONObject jsonObject = JSON.parseObject(mail.getFirstDistributeInfo()); JSONObject jsonObject = JSON.parseObject(mail.getFirstDistributeInfo());
mailVo.setFirstDistributeInfo(JSON.parseObject(mail.getFirstDistributeInfo())); mailVo.setFirstDistributeInfo(jsonObject);
mailVo.setSecondaryResponsibleFlag(jsonObject.getJSONArray("secondDept").size() > 0); mailVo.setSecondaryResponsibleFlag(jsonObject.size() > 1);
} }
// 下发信息 // 下发信息
if (StrUtil.isNotBlank(mail.getSecondDistributeInfo())) { if (StrUtil.isNotBlank(mail.getSecondDistributeInfo())) {
JSONObject jsonObject = JSON.parseObject(mail.getSecondDistributeInfo()); JSONObject jsonObject = JSON.parseObject(mail.getSecondDistributeInfo());
mailVo.setSecondDistributeInfo(jsonObject); mailVo.setSecondDistributeInfo(jsonObject);
mailVo.setSecondaryResponsibleFlag(jsonObject.getJSONArray("secondDept").size() > 0); mailVo.setSecondaryResponsibleFlag(jsonObject.size() > 1);
} }
return mailVo; return mailVo;
} }

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

@ -11,7 +11,7 @@ import java.time.LocalDateTime;
@Getter @Getter
public class WorkVo { public class WorkVo {
@ExcelProperty("工作ID") @ExcelProperty("工作ID")
private Integer id; private Integer id;
/** /**

10
mailbox-lan/src/main/java/com/biutag/lan/enums/CoType.java

@ -0,0 +1,10 @@
package com.biutag.lan.enums;
public enum CoType {
// 次责单位
secondary,
// 协办人员
co_organizers;
}

7
mailbox-lan/src/main/java/com/biutag/lan/enums/ReturnOperate.java

@ -0,0 +1,7 @@
package com.biutag.lan.enums;
public enum ReturnOperate {
revise,
continue_flow;
}

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

@ -7,6 +7,9 @@ public enum WorkType {
dept_countersign, dept_countersign,
// 延期审批 // 延期审批
extension_approval; extension_approval,
// 协办
co_organizers;
} }

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

@ -32,7 +32,8 @@ public class FlowConfig {
SecondLeaderApprovalFlow secondLeaderApprovalFlow, SecondLeaderApprovalFlow secondLeaderApprovalFlow,
SecondReportingFlow secondReportingFlow, SecondReportingFlow secondReportingFlow,
FirstApprovalFlow firstApprovalFlow, FirstApprovalFlow firstApprovalFlow,
CountersignFlow countersignFlow) { CountersignFlow countersignFlow,
CoHandlingFlow coHandlingFlow) {
List<FlowNode> flowNodes = flowNodeService.list(); List<FlowNode> flowNodes = flowNodeService.list();
// 所有操作 // 所有操作
Action signAction = Action.of("sign", "确认签收", "primary", false, "已签收"); Action signAction = Action.of("sign", "确认签收", "primary", false, "已签收");
@ -72,6 +73,8 @@ public class FlowConfig {
Action applicationCompletedAction = Action.of("applicationCompleted", "申请办结", "primary", false); Action applicationCompletedAction = Action.of("applicationCompleted", "申请办结", "primary", false);
// 申请延期 // 申请延期
Action applyExtensionAction = Action.of("applyExtension", "申请延期", "primary", true); Action applyExtensionAction = Action.of("applyExtension", "申请延期", "primary", true);
// 上传协查报告
Action coReportAction = Action.of("coReport", "上传协查报告", "primary", false);
// 市局专班签收 // 市局专班签收
firstSignFlow firstSignFlow
@ -177,6 +180,9 @@ public class FlowConfig {
countersignFlow countersignFlow
.setFlowNode(getFlowNode(flowNodes, FlowNodeEnum.COUNTERSIGN)); .setFlowNode(getFlowNode(flowNodes, FlowNodeEnum.COUNTERSIGN));
coHandlingFlow.setFlowNode(getFlowNode(flowNodes, FlowNodeEnum.CO_HANDLING))
.setActions(Collections.singletonList(coReportAction));
} }
private FlowNode getFlowNode(List<FlowNode> flowNodes, FlowNodeEnum flowNodeEnum) { private FlowNode getFlowNode(List<FlowNode> flowNodes, FlowNodeEnum flowNodeEnum) {

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

@ -25,7 +25,9 @@ public enum FlowNameEnum {
PENDING_COUNTERSIGN("待会签"), PENDING_COUNTERSIGN("待会签"),
MAIL_RETURN("信件退回"), MAIL_RETURN("信件退回"),
RETURN_RECTIFICATION("退回整改"); RETURN_RECTIFICATION("退回整改"),
CO_HANDLING("协查办理");
@Getter @Getter
private String name; private String name;

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

@ -23,7 +23,8 @@ public enum FlowNodeEnum {
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),
CO_HANDLING("co_handling", "协查办理", 18);
private String key; private String key;

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

@ -0,0 +1,49 @@
package com.biutag.lan.flow.node;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.biutag.lan.domain.MailCoHandling;
import com.biutag.lan.domain.Work;
import com.biutag.lan.enums.CoType;
import com.biutag.lan.enums.WorkType;
import com.biutag.lan.flow.Flow;
import com.biutag.lan.service.MailCoHandlingService;
import com.biutag.lan.service.WorkService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;
import java.time.LocalDateTime;
@RequiredArgsConstructor
@Component
public class CoHandlingFlow extends Flow {
private final MailCoHandlingService mailCoHandlingService;
private final WorkService workService;
@Override
public Flow next(String nextActionKey, String mailId, JSONObject data) {
LocalDateTime now = LocalDateTime.now();
String verifyDetails = data.getString("verifyDetails");
Assert.hasText(verifyDetails, "参数错误");
JSONArray verifyAttachments = data.getJSONArray("verifyAttachments");
Assert.notNull(verifyAttachments, "参数错误");
Integer workId = data.getInteger("workId");
Assert.notNull(workId, "参数错误");
Work work = workService.getById(workId);
MailCoHandling mailCoHandling = new MailCoHandling()
.setMailId(mailId)
.setCreateTime(now)
.setVerifyDetails(verifyDetails)
.setVerifyAttachments(verifyAttachments.toJSONString())
.setCoType(WorkType.co_organizers.name().equals(work.getWorkType()) ? CoType.co_organizers.name() : CoType.secondary.name());
mailCoHandlingService.save(mailCoHandling);
work.setWorkState(Work.State.done.name()).setUpdateTime(now);
workService.updateById(work);
return null;
}
}

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

@ -90,6 +90,8 @@ public class FirstApprovalFlow extends Flow {
public Flow mailReturn(String mailId, JSONObject data) { public Flow mailReturn(String mailId, JSONObject data) {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
String returnOperate = data.getString("returnOperate");
Assert.hasText(returnOperate, "参数错误");
String reason = data.getString("reason"); String reason = data.getString("reason");
Assert.hasText(reason, "参数错误"); Assert.hasText(reason, "参数错误");
MailReturn mailReturn = new MailReturn() MailReturn mailReturn = new MailReturn()
@ -103,13 +105,13 @@ public class FirstApprovalFlow extends Flow {
mailReturnService.save(mailReturn); mailReturnService.save(mailReturn);
// 更新已办 // 更新已办
workService.updateDone(mailId, AdminThreadLocal.getEmpNo(), now); workService.updateDone(mailId, AdminThreadLocal.getEmpNo(), now);
// 更新级机构专班的待办 // 更新级机构专班的待办
workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now, FlowNameEnum.RETURN_RECTIFICATION.getName()); 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)
.setFlowKey(FlowNodeEnum.VERIFY.getKey()) .setFlowKey(FlowNodeEnum.SECOND_APPROVAL.getKey())
.setFlowBeforeName("信件退回"); .setReturnOperate(returnOperate);
mailService.updateById(mail); mailService.updateById(mail);
return null; return null;
} }

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

@ -5,6 +5,7 @@ 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.flow.FlowNameEnum;
import com.biutag.lan.flow.FlowNodeEnum;
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;
@ -50,13 +51,17 @@ public class FirstDistributeFlow extends Flow {
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, FlowNameEnum.PENDING_SIGN_CO.getName()); workService.saveOrUpdate(mail, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), secondDeptId1, now, false,
FlowNameEnum.PENDING_SIGN_CO.getName(),
FlowNodeEnum.SECOND_SIGN.getKey());
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, FlowNameEnum.PENDING_SIGN_CO.getName()); workService.saveOrUpdate(mail, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), secondDeptId2, now, false,
FlowNameEnum.PENDING_SIGN_CO.getName(),
FlowNodeEnum.SECOND_SIGN.getKey());
firstDistributeInfo.put("secondDept2", JSONObject.of("id", secondDeptId2)); firstDistributeInfo.put("secondDept2", JSONObject.of("id", secondDeptId2));
} }
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);

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

@ -110,7 +110,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.save(mail, leaderEmpNo, now); workService.save(mail, leaderEmpNo, now, FlowNameEnum.PENDING_APPROVAL.getName());
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);
// 更新信件 // 更新信件
mail.setUpdateTime(now) mail.setUpdateTime(now)

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

@ -53,7 +53,7 @@ public class SecondDeputyApprovalFlow extends Flow {
// 将我的信件改为已办 // 将我的信件改为已办
workService.updateDone(mailId, AdminThreadLocal.getEmpNo(), now); workService.updateDone(mailId, AdminThreadLocal.getEmpNo(), now);
// 给二级机构正职领导新增待办 // 给二级机构正职领导新增待办
workService.save(mail, leaderEmpNo, now); workService.save(mail, leaderEmpNo, now, FlowNameEnum.PENDING_APPROVAL.getName());
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);
// 更新信件 // 更新信件
mail.setUpdateTime(now) mail.setUpdateTime(now)

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

@ -8,11 +8,13 @@ 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.FlowNameEnum;
import com.biutag.lan.flow.FlowNodeEnum;
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;
import com.biutag.lan.vo.system.DeptVo; import com.biutag.lan.vo.system.DeptVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert; import org.springframework.util.Assert;
@ -56,33 +58,46 @@ public class SecondDistributeFlow extends Flow {
List<JSONObject> secondDept = new ArrayList<>(); List<JSONObject> secondDept = new ArrayList<>();
JSONObject secondDistributeInfo = JSONObject.of("mainDept", JSONObject.of("id", mainDeptId), JSONObject secondDistributeInfo = JSONObject.of("mainDept", JSONObject.of("id", mainDeptId),
"secondDept", secondDept); "secondDept", secondDept);
// 下发信件(主责单位) if (myWork.getMainDeptFlag()) {
workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), mainDeptId, now, true, FlowNameEnum.PENDING_SIGN.getName()); // 下发信件(主责单位)
workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), mainDeptId, now, true, FlowNameEnum.PENDING_SIGN.getName());
} else {
// 非主责
workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), mainDeptId, now, false,
FlowNameEnum.CO_HANDLING.getName(),
FlowNodeEnum.CO_HANDLING.getKey());
secondDept.add(JSONObject.of("id", mainDeptId));
}
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, FlowNameEnum.PENDING_SIGN_CO.getName()); workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), secondDeptId1, now, false,
FlowNameEnum.PENDING_SIGN_CO.getName(),
FlowNodeEnum.CO_HANDLING.getKey());
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, FlowNameEnum.PENDING_SIGN_CO.getName()); workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), secondDeptId2, now, false,
FlowNameEnum.PENDING_SIGN_CO.getName(),
FlowNodeEnum.CO_HANDLING.getKey());
secondDept.add(JSONObject.of("id", secondDeptId1)); secondDept.add(JSONObject.of("id", secondDeptId1));
} }
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);
// 更新信件 if (myWork.getMainDeptFlag()) {
DeptVo deptVo = deptService.detail(mainDeptId); // 更新信件
mail.setUpdateTime(now) DeptVo deptVo = deptService.detail(mainDeptId);
.setFlowKey(nextNode.getFlowNode().getKey()) mail.setUpdateTime(now)
.setFlowBeforeName(nextNode.getFlowNode().getBeforeName()) .setFlowKey(nextNode.getFlowNode().getKey())
.setFlowLimitedLastHandlerTime(now) .setFlowBeforeName(nextNode.getFlowNode().getBeforeName())
.setThreeDeptId(mainDeptId) .setFlowLimitedLastHandlerTime(now)
.setThreeDeptName(deptVo.getName()) .setThreeDeptId(mainDeptId)
.setSecondDistributeInfo(secondDistributeInfo.toJSONString()); .setThreeDeptName(deptVo.getName())
mailService.updateById(mail); .setSecondDistributeInfo(secondDistributeInfo.toJSONString());
return nextNode; mailService.updateById(mail);
}
return null;
} }
} }

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

@ -104,6 +104,11 @@ public class SecondSignFlow extends Flow {
work.setPoliceEmpNo(empNo) work.setPoliceEmpNo(empNo)
.setUpdateTime(now) .setUpdateTime(now)
.setFlowName(FlowNameEnum.PENDING_DISTRIBUTE.getName()); .setFlowName(FlowNameEnum.PENDING_DISTRIBUTE.getName());
// 非主责单位
if (!work.getMainDeptFlag()) {
work.setFlowName(FlowNameEnum.PENDING_DISTRIBUTE_CO.getName())
.setFlowKey(FlowNodeEnum.SECOND_DISTRIBUTE.getKey());
}
workService.updateById(work); workService.updateById(work);
// 更新信件 // 更新信件
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);

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

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

11
mailbox-lan/src/main/java/com/biutag/lan/service/MailCoHandlingService.java

@ -0,0 +1,11 @@
package com.biutag.lan.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.lan.domain.MailCoHandling;
import com.biutag.lan.mapper.MailCoHandlingMapper;
import org.springframework.stereotype.Service;
@Service
public class MailCoHandlingService extends ServiceImpl<MailCoHandlingMapper, MailCoHandling> {
}

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

@ -70,10 +70,12 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
@Autowired @Autowired
private FlowConfig flowConfig; private FlowConfig flowConfig;
public MailFlowDetail getMailFlowDetail(String mailId) { public MailFlowDetail getMailFlowDetail(String mailId, Integer workId) {
MailSource mailSource = mailSourceService.getById(mailId); MailSource mailSource = mailSourceService.getById(mailId);
Flow flow = null; Flow flow = null;
Mail mail; Mail mail;
MailFlowDetail flowDetail = new MailFlowDetail();
Work work = workService.getById(workId);
if (!mailSource.getSignFlag()) { if (!mailSource.getSignFlag()) {
flow = SpringUtil.getBean(FirstSignFlow.class); flow = SpringUtil.getBean(FirstSignFlow.class);
mail = mailSource.toMail(); mail = mailSource.toMail();
@ -86,6 +88,11 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
.filter(item -> mail.getFlowKey().equals(item.getFlowNode().getKey())) .filter(item -> mail.getFlowKey().equals(item.getFlowNode().getKey()))
.findFirst().orElseThrow(() -> new BusinessException("没有该流程节点")); .findFirst().orElseThrow(() -> new BusinessException("没有该流程节点"));
} }
if (!work.getMainDeptFlag()) {
flow = flowNodes.stream()
.filter(item -> work.getFlowKey().equals(item.getFlowNode().getKey()))
.findFirst().orElseThrow(() -> new BusinessException("没有该流程节点"));
}
} }
MailVo mailVo = MailVo.of(mail); MailVo mailVo = MailVo.of(mail);
@ -95,7 +102,7 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
// 时间倒叙 // 时间倒叙
.stream().sorted(Comparator.comparing(MailFlow::getCreateTime).reversed()).collect(Collectors.toList()); .stream().sorted(Comparator.comparing(MailFlow::getCreateTime).reversed()).collect(Collectors.toList());
MailFlowDetail flowDetail = new MailFlowDetail().setMail(mailVo) flowDetail.setMail(mailVo)
.setIsFav(Objects.nonNull(favoriteService.get(mailId, AdminThreadLocal.getEmpNo()))) .setIsFav(Objects.nonNull(favoriteService.get(mailId, AdminThreadLocal.getEmpNo())))
.setFlows(flows); .setFlows(flows);
// 部门会签 // 部门会签
@ -156,12 +163,14 @@ 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 (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();
mailVo.setMainDeptSignTime(mainDeptSignTime); mailVo.setMainDeptSignTime(mainDeptSignTime);
} }
if (!work.getMainDeptFlag()) {
mailVo.setSecondaryResponsibleFlag(true);
}
return flowDetail; return flowDetail;
} }
@ -290,12 +299,12 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
workService.updateById(work); workService.updateById(work);
if (!returnFlag) { if (!returnFlag) {
// 给市局机构增加待办 // 给市局机构增加待办
return workService.updateTodo(mailId, RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId(), WorkType.extension_approval.name(), now); return workService.updateTodo(mailId, RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId(), WorkType.extension_approval.name(), now, FlowNameEnum.PENDING_APPROVAL.getName());
} }
} else { } else {
// 市局 // 市局
Work work = workService.getByMunicipal(mailId); Work work = workService.getByMunicipal(mailId);
work.setUpdateTime(now).setWorkState(Work.State.done.name()).setWorkType(WorkType.processing.name()); work.setUpdateTime(now).setWorkState(Work.State.done.name()).setWorkType(WorkType.processing.name()).setFlowName(FlowNameEnum.PENDING_APPROVAL.getName());
workService.updateById(work); workService.updateById(work);
if (!returnFlag) { if (!returnFlag) {
Mail mail = getById(mailId); Mail mail = getById(mailId);

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

@ -77,17 +77,22 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
return saveBatch(list); return saveBatch(list);
} }
public boolean save(Mail mail, String empNo, LocalDateTime time) { public boolean save(Mail mail, String empNo, LocalDateTime time, String flowName) {
Work work = new Work(); Work work = new Work();
BeanUtils.copyProperties(mail, work); BeanUtils.copyProperties(mail, work);
work.setMailId(mail.getId()) work.setMailId(mail.getId())
.setPoliceEmpNo(empNo) .setPoliceEmpNo(empNo)
.setCreateTime(time) .setCreateTime(time)
.setUpdateTime(time); .setUpdateTime(time)
.setFlowName(flowName);
return save(work); return save(work);
} }
public boolean saveOrUpdate(Mail mail, Integer roleId, Integer deptId, LocalDateTime time, Boolean mainDeptFlag, String flowName) { public boolean saveOrUpdate(Mail mail, Integer roleId, Integer deptId, LocalDateTime time, Boolean mainDeptFlag, String flowName) {
return saveOrUpdate(mail, roleId, deptId, time, mainDeptFlag, flowName, null);
}
public boolean saveOrUpdate(Mail mail, Integer roleId, Integer deptId, LocalDateTime time, Boolean mainDeptFlag, String flowName, String flowKey) {
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();
@ -95,9 +100,11 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
work.setMailId(mail.getId()) work.setMailId(mail.getId())
.setSignRoleId(roleId) .setSignRoleId(roleId)
.setSignDeptId(deptId) .setSignDeptId(deptId)
.setCreateTime(time); .setCreateTime(time)
.setFlowName(flowName)
.setFlowKey(flowKey);
} }
work.setWorkState(Work.State.todo.name()).setUpdateTime(time).setMainDeptFlag(mainDeptFlag).setFlowName(flowName); work.setWorkState(Work.State.todo.name()).setUpdateTime(time).setMainDeptFlag(mainDeptFlag).setFlowName(flowName).setFlowKey(flowKey);
return saveOrUpdate(work); return saveOrUpdate(work);
} }

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

@ -8,6 +8,6 @@ oss:
minio: minio:
enable: true enable: true
endpoint: http://65.47.60.182:9001 endpoint: http://65.47.60.182:9001
accessKey: E2djtF6OKJtduYzzSKK4 accessKey: SVQJlBBf0R9qSWx22KZ5
secretKey: er5t3VxQP3KluD9Q1zgxuiyiS1PzQhAOThpwm9do secretKey: UsPqCASkOVTFC406GLPp5GBNO3EHPA4mlgSJZ7Ep
bucketName: mailbox bucketName: mailbox

Loading…
Cancel
Save