From 309db3e0db9320711174eb23fd890f3b7c0a8502 Mon Sep 17 00:00:00 2001 From: 21819 Date: Thu, 14 Mar 2024 16:56:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=A1=E4=BB=B6=E6=9F=A5=E8=AF=A2=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E9=83=A8=E5=88=86=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lan/controller/work/WorkController.java | 4 +- .../com/biutag/lan/domain/bo/MailQuery.java | 4 ++ .../com/biutag/lan/mapper/WorkMapper.java | 2 +- .../com/biutag/lan/service/WorkService.java | 38 +++++++-------- .../src/main/resources/mapper/WorkMapper.xml | 46 +++++++++++-------- 5 files changed, 53 insertions(+), 41 deletions(-) diff --git a/mailbox-lan/src/main/java/com/biutag/lan/controller/work/WorkController.java b/mailbox-lan/src/main/java/com/biutag/lan/controller/work/WorkController.java index 6ebd14f..077a99e 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/controller/work/WorkController.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/controller/work/WorkController.java @@ -39,8 +39,8 @@ public class WorkController { @NotPower @GetMapping("query") - public AjaxResult> list(Page page, MailQuery todoQuery) { - return AjaxResult.success(workService.queryPage(page, todoQuery)); + public AjaxResult> list(Page page, MailQuery mailQuery) { + return AjaxResult.success(workService.queryPage(page, mailQuery)); } @NotPower diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/bo/MailQuery.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/bo/MailQuery.java index 627589d..b4b5de9 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/domain/bo/MailQuery.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/bo/MailQuery.java @@ -56,6 +56,10 @@ public class MailQuery { * Work表 签收部门id */ private Integer signDeptId; + /** + * 信件查询界面新建统计字段 + */ + private String countMails; public List handleMailLabels() { if (mailLabels == null) { diff --git a/mailbox-lan/src/main/java/com/biutag/lan/mapper/WorkMapper.java b/mailbox-lan/src/main/java/com/biutag/lan/mapper/WorkMapper.java index 06484cc..eb8520f 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/mapper/WorkMapper.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/mapper/WorkMapper.java @@ -17,7 +17,7 @@ public interface WorkMapper extends BaseMapper { Page selectPageBy(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); - Page selectQueryPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + Page selectQueryPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper, @Param("countMails") String countMails); Page selectDissatisfiedPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); 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 de3c392..85da926 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 @@ -376,23 +376,25 @@ public class WorkService extends ServiceImpl { .eq(Objects.nonNull(mailQuery.getSignRoleId()), "w.sign_role_id", mailQuery.getSignRoleId()) .eq(Objects.nonNull(mailQuery.getSignDeptId()), "w.sign_dept_id", mailQuery.getSignDeptId()); - //剔除终止操作的信件类别方便统计 -// if (StrUtil.isNotBlank(mailQuery.getMailState())) { -// switch (mailQuery.getMailState()) { -// case "terminated": -// queryWrapper.nested(i -> i.eq("m.mail_first_category", "终止类") -// .or().eq("m.mail_first_category", "感谢信类") -// .or().eq("m.mail_first_category", "无效类")); -// break; -// case "completion": -// queryWrapper.ne("m.mail_first_category", "终止类") -// .ne("m.mail_first_category", "感谢信类") -// .ne("m.mail_first_category", "无效类"); -// break; -// default: -// queryWrapper.eq("m.mail_state", mailQuery.getMailState()); -// } -// } + if (StrUtil.isNotBlank(mailQuery.getCountMails())) { + switch (mailQuery.getCountMails()) { + case "1": + queryWrapper.and(i -> i.ne("m.flow_key","first_sign")//防止二级专班退回市局专班的信件未被签收,但是仍然存在于mail表中 + .ne("m.mail_first_category","无效类") + .ne("m.mail_first_category","终止类") + .ne("m.mail_first_category","感谢信类")); + break; + case "2": + queryWrapper.nested(i->i.eq("mm.completed", "1")); + break; + case "3": + queryWrapper.nested(i->i.eq("mm.satisfied", "1")); + break; + case "4": + queryWrapper.nested(i->i.eq("mm.resolved", "1")); + break; + } + } if (StrUtil.isNotBlank(mailQuery.getFlowKey())) { List flowKeyList = StrUtil.split(mailQuery.getFlowKey(), ',', true, true); @@ -433,7 +435,7 @@ public class WorkService extends ServiceImpl { } // 排序 queryWrapper.orderByDesc("m.mail_time"); - Page result = baseMapper.selectQueryPage(page, queryWrapper); + Page result = baseMapper.selectQueryPage(page, queryWrapper, mailQuery.getCountMails()); for (QueryMailVo workVo : result.getRecords()) { List labelNames = mailLabelMapper.selectList(null); if (StrUtil.isNotBlank(workVo.getMailLabels())) { diff --git a/mailbox-lan/src/main/resources/mapper/WorkMapper.xml b/mailbox-lan/src/main/resources/mapper/WorkMapper.xml index 103664b..554cee9 100644 --- a/mailbox-lan/src/main/resources/mapper/WorkMapper.xml +++ b/mailbox-lan/src/main/resources/mapper/WorkMapper.xml @@ -45,28 +45,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"