From 6c27138fd120b809fa56aa7162820352d766c5dc Mon Sep 17 00:00:00 2001 From: 21819 Date: Sun, 10 Mar 2024 15:26:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E9=98=B6=E6=AE=B5=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E5=8A=9F=E8=83=BD=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/FlowNodeController.java | 38 +++++++++++++++++++ .../com/biutag/lan/domain/vo/FlowNodeVo.java | 12 ++++++ .../com/biutag/lan/service/WorkService.java | 24 ++++++------ 3 files changed, 61 insertions(+), 13 deletions(-) create mode 100644 mailbox-lan/src/main/java/com/biutag/lan/controller/system/FlowNodeController.java create mode 100644 mailbox-lan/src/main/java/com/biutag/lan/domain/vo/FlowNodeVo.java diff --git a/mailbox-lan/src/main/java/com/biutag/lan/controller/system/FlowNodeController.java b/mailbox-lan/src/main/java/com/biutag/lan/controller/system/FlowNodeController.java new file mode 100644 index 0000000..b2c3e91 --- /dev/null +++ b/mailbox-lan/src/main/java/com/biutag/lan/controller/system/FlowNodeController.java @@ -0,0 +1,38 @@ +package com.biutag.lan.controller.system; + +import com.biutag.aop.NotPower; +import com.biutag.core.AjaxResult; +import com.biutag.lan.domain.FlowNode; +import com.biutag.lan.domain.vo.FlowNodeVo; +import com.biutag.lan.service.FlowNodeService; +import io.swagger.annotations.Api; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.List; + +@RestController +@RequestMapping("api/system/flowNode") +@Api(tags = "流程节点获取") +@RequiredArgsConstructor +public class FlowNodeController { + private final FlowNodeService flowNodeService; + + @NotPower + @GetMapping("/list") + public AjaxResult> list() { + List list = flowNodeService.list(); + List result = new ArrayList<>(); + for (FlowNode flowNode : list) { + FlowNodeVo flowNodeVo = new FlowNodeVo(); + flowNodeVo.setKey(flowNode.getKey()); + flowNodeVo.setName(flowNode.getBeforeName()); + flowNodeVo.setFullName(flowNode.getFullName()); + result.add(flowNodeVo); + } + return AjaxResult.success(result); + } +} diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/FlowNodeVo.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/FlowNodeVo.java new file mode 100644 index 0000000..fad3660 --- /dev/null +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/FlowNodeVo.java @@ -0,0 +1,12 @@ +package com.biutag.lan.domain.vo; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class FlowNodeVo { + private String key; + private String name; + private String fullName; +} 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 0cd1b2f..bf136f3 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 @@ -350,8 +350,12 @@ public class WorkService extends ServiceImpl { .le(StrUtil.isNotBlank(mailQuery.getMailTimeStartEnd()), "TO_CHAR(m.mail_time, 'YYYY-MM-DD')", mailQuery.getMailTimeStartEnd()) .eq(StrUtil.isNotBlank(mailQuery.getSource()), "m.source", mailQuery.getSource()) .eq(StrUtil.isNotBlank(mailQuery.getMailLevel()), "m.mail_level", mailQuery.getMailLevel()) - .eq(StrUtil.isNotBlank(mailQuery.getMailState()), "m.mail_state", mailQuery.getMailState()) - .eq(StrUtil.isNotBlank(mailQuery.getFlowKey()), "m.flow_key", mailQuery.getFlowKey()); + .eq(StrUtil.isNotBlank(mailQuery.getMailState()), "m.mail_state", mailQuery.getMailState()); + if (StrUtil.isNotBlank(mailQuery.getFlowKey())) { + // 使用 StrUtil 或其他工具类将字符串拆分为列表 + List flowKeyList = StrUtil.split(mailQuery.getFlowKey(), ',', true, true); + queryWrapper.in("m.flow_key", flowKeyList); + } mailCategorySearch(mailQuery, queryWrapper); deptSearch(mailQuery, queryWrapper); if (StrUtil.isNotBlank(mailQuery.getMailLabels())) { @@ -455,8 +459,8 @@ public class WorkService extends ServiceImpl { .eq(StrUtil.isNotBlank(mailQuery.getSource()), "m.source", mailQuery.getSource()) .eq(StrUtil.isNotBlank(mailQuery.getMailLevel()), "m.mail_level", mailQuery.getMailLevel()) .nested(i -> - i.eq("m.satisfaction_status", "不满意") - .or().eq("m.verify_feedback", "不满意") + i.nested(q -> q.eq("m.satisfaction_status", "不满意") + .or().eq("m.verify_feedback", "不满意")) .or().apply("m.id = ma.mail_id") ); mailCategorySearch(mailQuery, queryWrapper); @@ -514,19 +518,13 @@ public class WorkService extends ServiceImpl { } else if (roleId.equals(RoleEnum.SECOND_DEPT_LEADER.getRoleId()) || roleId.equals(RoleEnum.SECOND_DEPT_CLASSES.getRoleId())) { //数据,领导只能看到自己管辖的部门 Integer deptId = AdminThreadLocal.getDeptId(); - queryWrapper.and(i -> - i.eq("m.second_dept_id", deptId) - ); + queryWrapper.eq("m.second_dept_id", deptId); } else if (roleId.equals(RoleEnum.THREE_DEPT_LEADER.getRoleId()) || roleId.equals(RoleEnum.THREE_DEPT_CLASSES.getRoleId())) { Integer deptId = AdminThreadLocal.getDeptId(); - queryWrapper.and(i -> - i.eq("m.three_dept_id", deptId) - ); + queryWrapper.eq("m.three_dept_id", deptId); } else { String empNo = AdminThreadLocal.getEmpNo(); - queryWrapper.and(i -> - i.eq("w.police_emp_no", empNo) - ); + queryWrapper.eq("w.police_emp_no", empNo); } }