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"