diff --git a/mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java b/mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java index 928c4c8..9b562fb 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java @@ -30,4 +30,15 @@ public class MailController { return AjaxResult.success(mailService.next(action)); } + /** + * 无效类、终止类信件办结 + * @param action + * @return + */ + @NotPower + @PostMapping("flow/invalid/completion") + public AjaxResult completion(@RequestBody @Valid FlowAction action) { + return AjaxResult.success(mailService.next(action)); + } + } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/bo/InvalidCompletion.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/bo/InvalidCompletion.java new file mode 100644 index 0000000..e4bf112 --- /dev/null +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/bo/InvalidCompletion.java @@ -0,0 +1,17 @@ +package com.biutag.lan.domain.bo; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class InvalidCompletion { + + + private String mailCategory; + + private String mailFirstCategory; + + private String mailLevel; + +} diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/bo/TodoQuery.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/bo/TodoQuery.java index e579f37..cb45a75 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/domain/bo/TodoQuery.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/bo/TodoQuery.java @@ -27,7 +27,7 @@ public class TodoQuery { private String mailCategory; - private String handlingDeptName; + private String threeDeptName; private String flowKey; diff --git a/mailbox-lan/src/main/java/com/biutag/lan/enums/MailCategory.java b/mailbox-lan/src/main/java/com/biutag/lan/enums/MailCategory.java new file mode 100644 index 0000000..c2e45ca --- /dev/null +++ b/mailbox-lan/src/main/java/com/biutag/lan/enums/MailCategory.java @@ -0,0 +1,17 @@ +package com.biutag.lan.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public enum MailCategory { + + COMPLAINT("投诉类"), + CONSULTATION_AND_ASSISTANCE("咨询求助类"), + WORK_SUGGESTIONS("工作建议类"), + INVALID("无效类"), + TERMINATION("终止类"); + + private String name; +} diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstSignFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstSignFlow.java index c48dbc6..daded42 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstSignFlow.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstSignFlow.java @@ -7,6 +7,7 @@ import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.MailMark; import com.biutag.lan.domain.MailSource; import com.biutag.lan.domain.Work; +import com.biutag.lan.enums.MailCategory; import com.biutag.lan.enums.MailState; import com.biutag.lan.flow.Flow; import com.biutag.lan.service.MailMarkService; @@ -16,6 +17,7 @@ import com.biutag.lan.service.WorkService; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.Assert; import java.time.LocalDateTime; import java.util.Collections; @@ -37,13 +39,23 @@ public class FirstSignFlow extends Flow { @Override @Transactional(rollbackFor = Exception.class) public Flow next(String nextActionKey, String mailId, JSONObject data) { - String empNo = AdminThreadLocal.getEmpNo(); + String mailFirstCategory = data.getString("mailFirstCategory"); + Assert.hasText(mailFirstCategory, "参数错误"); + if (mailFirstCategory.equals(MailCategory.INVALID.getName()) || + mailFirstCategory.equals(MailCategory.TERMINATION.getName())) { + throw new BusinessException("参数错误"); + } + if (mailFirstCategory.equals(MailCategory.CONSULTATION_AND_ASSISTANCE.getName()) || + mailFirstCategory.equals(MailCategory.WORK_SUGGESTIONS.getName())) { + Assert.notNull(data.getBoolean("simpleFlowFlag"), "参数错误"); + } Integer roleId = AdminThreadLocal.getRoleIds().get(0); Integer deptId = AdminThreadLocal.getDeptId(); Work work = workService.getxByUnSign(mailId, roleId ,deptId); if (work == null) { throw new BusinessException("该信件已被其他人签收"); } + String empNo = AdminThreadLocal.getEmpNo(); // 更新我的工作 work.setPoliceEmpNo(empNo) .setUpdateTime(LocalDateTime.now()); @@ -53,7 +65,7 @@ public class FirstSignFlow extends Flow { .setSignFlag(true); mailSourceService.updateById(mailSource); Flow nextNode = next.get(nextActionKey); - String mailFirstCategory = data.getString("mailFirstCategory"); + String mailSecondCategory = data.getString("mailSecondCategory"); String mailThreeCategory = data.getString("mailThreeCategory"); String mailCategory = data.getString("mailCategory"); @@ -65,6 +77,7 @@ public class FirstSignFlow extends Flow { .setMailThreeCategory(mailThreeCategory) .setMailCategory(mailCategory) .setMailLevel(data.getString("mailLevel")) + .setSimpleFlowFlag(data.getBoolean("simpleFlowFlag")) .setFlowKey(nextNode.getFlowNode().getKey()) .setFlowBeforeName(nextNode.getFlowNode().getBeforeName()) .setFlowLimitedLastHandlerTime(mailSource.getCreateTime()); diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java index d52938f..cc03f4e 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java @@ -114,7 +114,7 @@ public class WorkService extends ServiceImpl { .eq(StrUtil.isNotBlank(todoQuery.getSource()), "m.source", todoQuery.getSource()) .eq(StrUtil.isNotBlank(todoQuery.getMailLevel()), "m.mail_level", todoQuery.getMailLevel()) .eq(StrUtil.isNotBlank(todoQuery.getMailCategory()), "m.mail_category", todoQuery.getMailCategory()) - .like(StrUtil.isNotBlank(todoQuery.getHandlingDeptName()), "m.handling_dept_name", todoQuery.getHandlingDeptName()) + .like(StrUtil.isNotBlank(todoQuery.getThreeDeptName()), "m.three_dept_name", todoQuery.getThreeDeptName()) .eq(StrUtil.isNotBlank(todoQuery.getFlowKey()), "m.flow_key", todoQuery.getFlowKey()); Integer roleId = AdminThreadLocal.getRoleId(); // 与角色相关的件