diff --git a/mailbox-common/src/main/java/com/biutag/constants/AppConstants.java b/mailbox-common/src/main/java/com/biutag/constants/AppConstants.java index 3b4a1a2..c2c91e4 100644 --- a/mailbox-common/src/main/java/com/biutag/constants/AppConstants.java +++ b/mailbox-common/src/main/java/com/biutag/constants/AppConstants.java @@ -1,5 +1,7 @@ package com.biutag.constants; +import java.time.LocalDateTime; + /** * Created by oumyye on 2019/1/18. */ @@ -48,4 +50,5 @@ public class AppConstants { */ public static final String CHANGSHA_DEPT_ID = "430100000000"; + public static final LocalDateTime BEGIN_TIME = LocalDateTime.of(2025, 9, 13, 0, 0, 0); } diff --git a/mailbox-lan/sql/20250917.sql b/mailbox-lan/sql/20250917.sql new file mode 100644 index 0000000..a95923f --- /dev/null +++ b/mailbox-lan/sql/20250917.sql @@ -0,0 +1,7 @@ +ALTER TABLE "mailbox"."mail_mark" +DROP COLUMN "mail_time", + ADD COLUMN "mail_time" date; + +COMMENT ON COLUMN "mailbox"."mail_mark"."mail_time" IS '来信时间'; + +update mail_mark mm set mm.mail_time = m.mail_time from mail m where mm.mail_id = m.id; \ No newline at end of file diff --git a/mailbox-lan/src/main/java/com/biutag/lan/controller/HomeController.java b/mailbox-lan/src/main/java/com/biutag/lan/controller/HomeController.java index d5be7a7..a03dfbe 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/controller/HomeController.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/controller/HomeController.java @@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.biutag.aop.NotPower; +import com.biutag.constants.AppConstants; import com.biutag.core.AjaxResult; import com.biutag.enums.DeptTypeEnum; import com.biutag.enums.MailState; @@ -15,13 +16,12 @@ import com.biutag.lan.domain.MailMark; import com.biutag.lan.domain.Work; import com.biutag.lan.domain.bo.MailTotal; import com.biutag.lan.domain.vo.DutyView; +import com.biutag.lan.domain.vo.system.DeptVo; import com.biutag.lan.flow.FlowNameEnum; import com.biutag.lan.flow.FlowNodeEnum; import com.biutag.lan.mapper.DataScreenMapper; -import com.biutag.lan.service.IDutyService; -import com.biutag.lan.service.MailMarkService; -import com.biutag.lan.service.MailService; -import com.biutag.lan.service.WorkService; +import com.biutag.lan.service.*; +import com.biutag.mapper.system.DutyMapper; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; @@ -29,6 +29,7 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.time.LocalDateTime; import java.util.*; @Tag(name = "首页") @@ -122,7 +123,8 @@ public class HomeController { Long mailToday = mailService.countTodayByCurrent(); // 今日办结 long completedToday = mailMarkService.countByCompleted(today); - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .ge(MailMark::getMailTime, AppConstants.BEGIN_TIME); Integer roleId = AdminThreadLocal.getRoleId(); if (RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId().equals(roleId)) { queryWrapper.eq(MailMark::getFirstDeptId, AdminThreadLocal.getDeptId()); @@ -146,36 +148,41 @@ public class HomeController { "thankTotal", thankTotal)); } - private final IDutyService dutyService; - private final DataScreenMapper dataScreenMapper; + private final IDeptService deptService; + @Operation(summary = "今日值班") @NotPower @GetMapping("duty") public AjaxResult> duty() { Integer roleId = AdminThreadLocal.getRoleId(); if (RoleEnum.PROVINCIAL_CLASSES.getRoleId().equals(roleId)) { - DutyView dutyView = new DutyView("省厅专班", dutyService.listByToday(DeptTypeEnum.ST_TYPE.getType(), null)); - DutyView dutyView1 = new DutyView("市州专班", dutyService.listByToday(DeptTypeEnum.SJ_TYPE.getType(), null)); + DutyView dutyView = new DutyView("省厅专班", dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.ST_TYPE.getType(), null)); + DutyView dutyView1 = new DutyView("市州专班", dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.SJ_TYPE.getType(), null)); return AjaxResult.success(List.of(dutyView, dutyView1)); } if (RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId().equals(roleId)) { String deptId = AdminThreadLocal.getDeptId(); - DutyView dutyView = new DutyView("市州专班", dataScreenMapper.getToFjDuty(DeptTypeEnum.SJ_TYPE.getType(), deptId)); - DutyView dutyView1 = new DutyView("县市区专班", dutyService.listByToday(DeptTypeEnum.FJ_TYPE.getType(), deptId)); - return AjaxResult.success(List.of(dutyView, dutyView1)); + DutyView dutyView = new DutyView("省厅专班", dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.ST_TYPE.getType(), null)); + DutyView dutyView1 = new DutyView("市州专班", dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.SJ_TYPE.getType(), deptId)); + DutyView dutyView2 = new DutyView("县市区专班", dataScreenMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.FJ_TYPE.getType(), deptId)); + return AjaxResult.success(List.of(dutyView, dutyView1, dutyView2)); } if (RoleEnum.SECOND_DEPT_CLASSES.getRoleId().equals(roleId)) { String deptId = AdminThreadLocal.getDeptId(); - DutyView dutyView = new DutyView("县市区专班", dataScreenMapper.getToFjDuty(DeptTypeEnum.FJ_TYPE.getType(), deptId)); - DutyView dutyView1 = new DutyView("所队专班", dutyService.listByToday(DeptTypeEnum.PCS_TYPE.getType(), deptId)); - return AjaxResult.success(List.of(dutyView, dutyView1)); + DeptVo deptVo = deptService.detail(deptId); + DutyView dutyView = new DutyView("市州专班", dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.SJ_TYPE.getType(), deptVo.getPid())); + DutyView dutyView1 = new DutyView("县市区专班", dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.FJ_TYPE.getType(), deptId)); + DutyView dutyView2 = new DutyView("所队专班", dataScreenMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.PCS_TYPE.getType(), deptId)); + return AjaxResult.success(List.of(dutyView, dutyView1, dutyView2)); } if (RoleEnum.THREE_DEPT_CLASSES.getRoleId().equals(roleId)) { String deptId = AdminThreadLocal.getDeptId(); - DutyView dutyView = new DutyView("所队专班", dataScreenMapper.getToFjDuty(DeptTypeEnum.PCS_TYPE.getType(), deptId)); - return AjaxResult.success(List.of(dutyView)); + DeptVo deptVo = deptService.detail(deptId); + DutyView dutyView = new DutyView("县市区专班", dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.FJ_TYPE.getType(), deptVo.getPid())); + DutyView dutyView1 = new DutyView("所队专班", dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.PCS_TYPE.getType(), deptId)); + return AjaxResult.success(List.of(dutyView, dutyView1)); } return AjaxResult.success(new ArrayList<>()); } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java b/mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java index 5cd3675..3e683d2 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java @@ -5,8 +5,6 @@ import com.biutag.aop.NotLogin; import com.biutag.aop.NotPower; import com.biutag.core.AjaxResult; import com.biutag.enums.DeptTypeEnum; -import com.biutag.enums.RoleEnum; -import com.biutag.lan.config.AdminThreadLocal; import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.vo.DutyView; import com.biutag.lan.domain.vo.MailDatavStats; @@ -16,10 +14,8 @@ import com.biutag.lan.domain.vo.system.DeptVo; import com.biutag.lan.mapper.DataScreenMapper; import com.biutag.lan.service.DataScreenService; import com.biutag.lan.service.IDeptService; -import com.biutag.lan.service.IDutyService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.annotation.Resource; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; @@ -43,8 +39,6 @@ public class DataScreenController { private final DataScreenMapper dataScreenMapper; - private final IDutyService dutyService; - private final IDeptService deptService; @NotLogin @@ -84,19 +78,19 @@ public class DataScreenController { @Operation(summary = "今日值班") public AjaxResult> dutyDay(String id) { if (StrUtil.isBlank(id)) { - DutyView dutyView = new DutyView("省厅专班", dutyService.listByToday(DeptTypeEnum.ST_TYPE.getType(), null)); - DutyView dutyView1 = new DutyView("市州专班", dutyService.listByToday(DeptTypeEnum.SJ_TYPE.getType(), null)); + DutyView dutyView = new DutyView("省厅专班", dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.ST_TYPE.getType(), null)); + DutyView dutyView1 = new DutyView("市州专班", dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.SJ_TYPE.getType(), null)); return AjaxResult.success(List.of(dutyView, dutyView1)); } DeptVo deptVo = deptService.detail(id); if (deptVo.getLevel() == 1) { - DutyView dutyView = new DutyView("市州专班", dataScreenMapper.getToFjDuty(DeptTypeEnum.SJ_TYPE.getType(), id)); - DutyView dutyView1 = new DutyView("县市区专班", dutyService.listByToday(DeptTypeEnum.FJ_TYPE.getType(), id)); + DutyView dutyView = new DutyView("本单位", dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.SJ_TYPE.getType(), id)); + DutyView dutyView1 = new DutyView("县市区专班", dataScreenMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.FJ_TYPE.getType(), id)); return AjaxResult.success(List.of(dutyView, dutyView1)); } if (deptVo.getLevel() == 2) { - DutyView dutyView = new DutyView("县市区专班", dataScreenMapper.getToFjDuty(DeptTypeEnum.FJ_TYPE.getType(), id)); - DutyView dutyView1 = new DutyView("所队专班", dutyService.listByToday(DeptTypeEnum.PCS_TYPE.getType(), id)); + DutyView dutyView = new DutyView("本单位", dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.FJ_TYPE.getType(), id)); + DutyView dutyView1 = new DutyView("所队专班", dataScreenMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.PCS_TYPE.getType(), id)); return AjaxResult.success(List.of(dutyView, dutyView1)); } return AjaxResult.success(new ArrayList<>()); diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/MailMark.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/MailMark.java index 7408766..c5e4dfd 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/domain/MailMark.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/MailMark.java @@ -53,6 +53,9 @@ public class MailMark { */ private String threeDeptName; + // + private LocalDateTime mailTime; + /** * 办结时间 */ diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstDistributeFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstDistributeFlow.java index b5bade6..081c961 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstDistributeFlow.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstDistributeFlow.java @@ -99,6 +99,7 @@ public class FirstDistributeFlow extends Flow { MailMark mailMark = new MailMark() .setMailId(mailId) + .setMailTime(mail.getMailTime()) .setFirstDeptId(mail.getFirstDeptId()) .setSecondDeptId(mail.getSecondDeptId()) .setSecondDeptName(mail.getSecondDeptName()) diff --git a/mailbox-lan/src/main/java/com/biutag/lan/mapper/DataScreenMapper.java b/mailbox-lan/src/main/java/com/biutag/lan/mapper/DataScreenMapper.java index 24c116f..0ad444f 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/mapper/DataScreenMapper.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/mapper/DataScreenMapper.java @@ -88,12 +88,6 @@ public interface DataScreenMapper { */ Map getAllResolvedRate(); - /** - * 全长沙解决率 - * @return - */ - Map getAllResolvedRate(@Param("deptId") String deptId); - /** * 全长沙办结率 * @return @@ -131,9 +125,6 @@ public interface DataScreenMapper { - List getToDayDuty(@Param("depatType") String depatType, @Param("deptId") String deptId); - - MailDetail getMailDetail(Map params); @@ -155,5 +146,7 @@ public interface DataScreenMapper { List> getOtherResolvedRate(); - List getToFjDuty(@Param("depatType") String depatType,@Param("deptId") String deptId); + List selectDutyListByTodayAndDeptPId(@Param("deptType") String deptType, @Param("deptPId") String deptPId); + + List selectDutyListByTodayAndDeptId(@Param("deptType") String deptType, @Param("deptId") String deptId); } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/DataScreenService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/DataScreenService.java index 0bdcbd2..66e1d07 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/DataScreenService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/DataScreenService.java @@ -137,10 +137,17 @@ public class DataScreenService { String todayStr = DateUtil.format(new Date(), DatePattern.NORM_DATE_FORMAT); if (StrUtil.isBlank(deptId)) { Long today = mailSourceService.count(todayStr); - Long total = mailMarkService.count(); - Long completedCases = mailMarkService.count(new LambdaQueryWrapper().eq(MailMark::getCompleted, AppConstants.TRUE)); - Long resolvedCases = mailMarkService.count(new LambdaQueryWrapper().eq(MailMark::getResolved, AppConstants.TRUE)); - Long satisfiedCases = mailMarkService.count(new LambdaQueryWrapper().eq(MailMark::getSatisfied, AppConstants.TRUE)); + Long total = mailMarkService.count(new LambdaQueryWrapper() + .ge(MailMark::getMailTime, AppConstants.BEGIN_TIME)); + Long completedCases = mailMarkService.count(new LambdaQueryWrapper() + .ge(MailMark::getMailTime, AppConstants.BEGIN_TIME) + .eq(MailMark::getCompleted, AppConstants.TRUE)); + Long resolvedCases = mailMarkService.count(new LambdaQueryWrapper() + .ge(MailMark::getMailTime, AppConstants.BEGIN_TIME) + .eq(MailMark::getResolved, AppConstants.TRUE)); + Long satisfiedCases = mailMarkService.count(new LambdaQueryWrapper() + .ge(MailMark::getMailTime, AppConstants.BEGIN_TIME) + .eq(MailMark::getSatisfied, AppConstants.TRUE)); MailDatavStats stats = new MailDatavStats() .setToday(today) .setTotal(total) @@ -153,37 +160,39 @@ public class DataScreenService { return stats; } else { DeptVo deptVo = deptService.detail(deptId); - Long today = mailSourceService.count(new QueryWrapper().eq("TO_CHAR(mail_time, 'YYYY-MM-DD')", todayStr)); + Long today = mailSourceService.count(new QueryWrapper() + .eq("TO_CHAR(mail_time, 'YYYY-MM-DD')", todayStr)); + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .ge(MailMark::getMailTime, AppConstants.BEGIN_TIME); + + LambdaQueryWrapper completedCasesQueryWrapper = new LambdaQueryWrapper() + .ge(MailMark::getMailTime, AppConstants.BEGIN_TIME) + .eq(MailMark::getCompleted, AppConstants.TRUE); + + LambdaQueryWrapper satisfiedCasesQueryWrapper = new LambdaQueryWrapper() + .ge(MailMark::getMailTime, AppConstants.BEGIN_TIME) + .eq(MailMark::getSatisfied, AppConstants.TRUE); + + LambdaQueryWrapper resolvedCasesQueryWrapper = new LambdaQueryWrapper() + .ge(MailMark::getMailTime, AppConstants.BEGIN_TIME) + .eq(MailMark::getResolved, AppConstants.TRUE); - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); if (deptVo.getLevel() == 1) { queryWrapper.eq(MailMark::getFirstDeptId, deptId); - } else if (deptVo.getLevel() == 2) { - queryWrapper.eq(MailMark::getSecondDeptId, deptId); - } - Long total = mailMarkService.count(queryWrapper); - LambdaQueryWrapper completedCasesQueryWrapper = new LambdaQueryWrapper().eq(MailMark::getCompleted, AppConstants.TRUE); - if (deptVo.getLevel() == 1) { completedCasesQueryWrapper.eq(MailMark::getFirstDeptId, deptId); - } else if (deptVo.getLevel() == 2) { - completedCasesQueryWrapper.eq(MailMark::getSecondDeptId, deptId); - } - Long completedCases = mailMarkService.count(completedCasesQueryWrapper); - - LambdaQueryWrapper resolvedCasesQueryWrapper = new LambdaQueryWrapper().eq(MailMark::getResolved, AppConstants.TRUE); - if (deptVo.getLevel() == 1) { resolvedCasesQueryWrapper.eq(MailMark::getFirstDeptId, deptId); + satisfiedCasesQueryWrapper.eq(MailMark::getFirstDeptId, deptId); } else if (deptVo.getLevel() == 2) { + queryWrapper.eq(MailMark::getSecondDeptId, deptId); + completedCasesQueryWrapper.eq(MailMark::getSecondDeptId, deptId); resolvedCasesQueryWrapper.eq(MailMark::getSecondDeptId, deptId); + satisfiedCasesQueryWrapper.eq(MailMark::getSecondDeptId, deptId); } + Long total = mailMarkService.count(queryWrapper); + Long completedCases = mailMarkService.count(completedCasesQueryWrapper); Long resolvedCases = mailMarkService.count(resolvedCasesQueryWrapper); - LambdaQueryWrapper satisfiedCasesQueryWrapper = new LambdaQueryWrapper().eq(MailMark::getSatisfied, AppConstants.TRUE); - if (deptVo.getLevel() == 1) { - satisfiedCasesQueryWrapper.eq(MailMark::getFirstDeptId, deptId); - } else if (deptVo.getLevel() == 2) { - satisfiedCasesQueryWrapper.eq(MailMark::getSecondDeptId, deptId); - } Long satisfiedCases = mailMarkService.count(satisfiedCasesQueryWrapper); MailDatavStats stats = new MailDatavStats() .setToday(today) @@ -299,10 +308,10 @@ public class DataScreenService { public Map getToDayDuty(Map params) { Map map = new HashMap<>(); if (params.size() == 0) { - List dutySjList = baseMapper.getToDayDuty("0", null); - List dutyFjList = baseMapper.getToDayDuty(DeptTypeEnum.SJ_TYPE.getType(), null); - List dutyZdList = baseMapper.getToDayDuty(DeptTypeEnum.ZD_TYPE.getType(), null); - List dutyBwList = baseMapper.getToDayDuty(DeptTypeEnum.BW_TYPE.getType(), null); + List dutySjList = baseMapper.selectDutyListByTodayAndDeptPId("0", null); + List dutyFjList = baseMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.SJ_TYPE.getType(), null); + List dutyZdList = baseMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.ZD_TYPE.getType(), null); + List dutyBwList = baseMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.BW_TYPE.getType(), null); map.put("dutySjList", dutySjList); map.put("dutyFjList", dutyFjList); map.put("dutyZdList", dutyZdList); @@ -314,10 +323,10 @@ public class DataScreenService { public Map getToIndexDuty() { Map map = new HashMap<>(); String deptId = AdminThreadLocal.getDeptId(); - List dutySjList = baseMapper.getToDayDuty(DeptTypeEnum.SJ_TYPE.getType(), null); - List dutyFjList = baseMapper.getToDayDuty(DeptTypeEnum.FJ_TYPE.getType(), deptId); - List dutyPcsList = baseMapper.getToDayDuty(DeptTypeEnum.PCS_TYPE.getType(), deptId); - List dutyDdList = baseMapper.getToDayDuty(DeptTypeEnum.DD_TYPE.getType(), deptId); + List dutySjList = baseMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.SJ_TYPE.getType(), null); + List dutyFjList = baseMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.FJ_TYPE.getType(), deptId); + List dutyPcsList = baseMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.PCS_TYPE.getType(), deptId); + List dutyDdList = baseMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.DD_TYPE.getType(), deptId); map.put("dutySjList", dutySjList); map.put("dutyFjList", dutyFjList); map.put("dutyPcsList", dutyPcsList); diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/IDutyService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/IDutyService.java index ff7603c..85de70a 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/IDutyService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/IDutyService.java @@ -62,6 +62,5 @@ public interface IDutyService { boolean saveBatch(List list); - List listByToday(String deptTyp, String deptId); } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/MailMarkService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/MailMarkService.java index 767f73b..099980b 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/MailMarkService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/MailMarkService.java @@ -18,7 +18,9 @@ import java.util.List; public class MailMarkService extends ServiceImpl { public Long countByCompleted() { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().eq(MailMark::getCompleted, AppConstants.TRUE); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .ge(MailMark::getMailTime, LocalDateTime.of(2025, 9, 13, 0, 0, 0)) + .eq(MailMark::getCompleted, AppConstants.TRUE); Integer roleId = AdminThreadLocal.getRoleId(); if (RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId().equals(roleId)) { queryWrapper.eq(MailMark::getFirstDeptId, AdminThreadLocal.getDeptId()); diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/PoliceWeChatMessage.java b/mailbox-lan/src/main/java/com/biutag/lan/service/PoliceWeChatMessage.java index 5052d22..972b6bd 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/PoliceWeChatMessage.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/PoliceWeChatMessage.java @@ -40,7 +40,7 @@ public class PoliceWeChatMessage { List policeUsers = policeUserMapper.selectList(new LambdaQueryWrapper() .eq(PoliceUser::getRoleIds, roleId) .eq(PoliceUser::getDataDeptId, deptId)); - List dutys = dataScreenMapper.getToFjDuty(null, deptId); + List dutys = dataScreenMapper.selectDutyListByTodayAndDeptId(null, deptId); try { dutys.stream().filter(item -> PhoneUtil.isPhone(item.getMobile())) .forEach(item -> { diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DeptServiceImpl.java b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DeptServiceImpl.java index f750e75..d986189 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DeptServiceImpl.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DeptServiceImpl.java @@ -1,8 +1,6 @@ package com.biutag.lan.service.impl; import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.lang.tree.TreeNode; -import cn.hutool.core.lang.tree.TreeUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -415,17 +413,17 @@ class DeptServiceImpl implements IDeptService { Duty duty = dutyMapper.selectOne(new QueryWrapper().eq("depart_id",deptId).last("limit 1")); if(duty==null){ } else if (duty.getDeptType().equals(DeptTypeEnum.FJ_TYPE.getType())){ - dutyFjList = dataScreenMapper.getToFjDuty(DeptTypeEnum.FJ_TYPE.getType(), deptId); + dutyFjList = dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.FJ_TYPE.getType(), deptId); }else if (duty.getDeptType().equals(DeptTypeEnum.ZD_TYPE.getType())){ - dutyFjList = dataScreenMapper.getToFjDuty(DeptTypeEnum.ZD_TYPE.getType(), deptId); + dutyFjList = dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.ZD_TYPE.getType(), deptId); }else if (duty.getDeptType().equals(DeptTypeEnum.BW_TYPE.getType())){ - dutyFjList = dataScreenMapper.getToFjDuty(DeptTypeEnum.BW_TYPE.getType(), deptId); + dutyFjList = dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.BW_TYPE.getType(), deptId); } map.put("dutyFjList", dutyFjList); - dutySjList = dataScreenMapper.getToDayDuty(DeptTypeEnum.SJ_TYPE.getType(), null); - dutyPcsList = dataScreenMapper.getToDayDuty(DeptTypeEnum.PCS_TYPE.getType(), deptId); - dutyDdList = dataScreenMapper.getToDayDuty(DeptTypeEnum.DD_TYPE.getType(), deptId); - dutyOtList = dataScreenMapper.getToDayDuty(DeptTypeEnum.OT_TYPE.getType(), deptId); + dutySjList = dataScreenMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.SJ_TYPE.getType(), null); + dutyPcsList = dataScreenMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.PCS_TYPE.getType(), deptId); + dutyDdList = dataScreenMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.DD_TYPE.getType(), deptId); + dutyOtList = dataScreenMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.OT_TYPE.getType(), deptId); map.put("dutySjList", dutySjList); map.put("dutyPcsList", dutyPcsList); map.put("dutyDdList", dutyDdList); @@ -435,24 +433,24 @@ class DeptServiceImpl implements IDeptService { Duty duty = dutyMapper.selectOne(new QueryWrapper().eq("depart_id",dept.getPid()).last("limit 1")); if (duty == null){ }else if (duty.getDeptType().equals(DeptTypeEnum.FJ_TYPE.getType())){ - dutyFjList = dataScreenMapper.getToFjDuty(DeptTypeEnum.FJ_TYPE.getType(), dept.getPid()); + dutyFjList = dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.FJ_TYPE.getType(), dept.getPid()); }else if (duty.getDeptType().equals(DeptTypeEnum.ZD_TYPE.getType())){ - dutyFjList = dataScreenMapper.getToFjDuty(DeptTypeEnum.ZD_TYPE.getType(), dept.getPid()); + dutyFjList = dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.ZD_TYPE.getType(), dept.getPid()); }else if (duty.getDeptType().equals(DeptTypeEnum.BW_TYPE.getType())){ - dutyFjList = dataScreenMapper.getToFjDuty(DeptTypeEnum.BW_TYPE.getType(), dept.getPid()); + dutyFjList = dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.BW_TYPE.getType(), dept.getPid()); } map.put("dutyFjList", dutyFjList); - dutySjList = dataScreenMapper.getToDayDuty(DeptTypeEnum.SJ_TYPE.getType(), null); + dutySjList = dataScreenMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.SJ_TYPE.getType(), null); map.put("dutySjList", dutySjList); Duty dutyByDeptid = dutyMapper.selectOne(new QueryWrapper().eq("depart_id",dept.getId()).last("limit 1")); if (dutyByDeptid == null){ } else if (dutyByDeptid.getDeptType().equals(DeptTypeEnum.PCS_TYPE.getType())){ - dutyPcsList = dataScreenMapper.getToFjDuty(DeptTypeEnum.PCS_TYPE.getType(), deptId); + dutyPcsList = dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.PCS_TYPE.getType(), deptId); }else if (dutyByDeptid.getDeptType().equals(DeptTypeEnum.DD_TYPE.getType())){ - dutyPcsList = dataScreenMapper.getToFjDuty(DeptTypeEnum.DD_TYPE.getType(), deptId); + dutyPcsList = dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.DD_TYPE.getType(), deptId); }else if (dutyByDeptid.getDeptType().equals(DeptTypeEnum.OT_TYPE.getType())){ - dutyPcsList = dataScreenMapper.getToFjDuty(DeptTypeEnum.OT_TYPE.getType(), deptId); + dutyPcsList = dataScreenMapper.selectDutyListByTodayAndDeptId(DeptTypeEnum.OT_TYPE.getType(), deptId); } map.put("dutyPcsList", dutyPcsList); } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DutyServiceImpl.java b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DutyServiceImpl.java index 8b28e5c..874d2c7 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DutyServiceImpl.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DutyServiceImpl.java @@ -17,21 +17,17 @@ import com.biutag.lan.domain.validate.system.DutySearchValidate; import com.biutag.lan.domain.validate.system.DutyUpdateValidate; import com.biutag.lan.domain.vo.system.DutyDetailVo; import com.biutag.lan.domain.vo.system.DutyListedVo; -import com.biutag.lan.mapper.DataScreenMapper; import com.biutag.lan.mapper.PoliceUserMapper; import com.biutag.lan.service.IDeptService; import com.biutag.lan.service.IDutyService; import com.biutag.mapper.setting.DictDataMapper; import com.biutag.mapper.system.DeptMapper; import com.biutag.mapper.system.DutyMapper; -import com.biutag.util.TimeUtils; import jakarta.annotation.Resource; import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.Assert; -import java.util.Date; import java.util.List; /** @@ -215,12 +211,4 @@ public class DutyServiceImpl implements IDutyService { return true; } - @Autowired - private DataScreenMapper dataScreenMapper; - - @Override - public List listByToday(String deptTyp, String deptId) { - return dataScreenMapper.getToDayDuty(deptTyp, deptId); - } - } diff --git a/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml b/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml index 4c14e50..cf6552c 100644 --- a/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml +++ b/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml @@ -353,25 +353,25 @@ limit 1 - select distinct on (a.depart_id, a.emp_no,b.sort) a.* from duty a inner join dept b on a.depart_id=b.id where now() BETWEEN to_date(a.start_time) + interval '9 H' and (to_date(a.end_time) + interval '33 H') - - and a.dept_type=#{depatType} + + and a.dept_type=#{deptType} - - and b.pid=#{deptId} + + and b.pid=#{deptPId} order by b.sort asc - select distinct on (a.depart_id, a.emp_no,b.sort) a.* from duty a inner join dept b on a.depart_id=b.id where now() BETWEEN to_date(a.start_time) + interval '9 H' and (to_date(a.end_time) + interval '33 H') - - and a.dept_type=#{depatType} + + and a.dept_type=#{deptType} and b.id=#{deptId} diff --git a/mailbox-lan/src/main/resources/templates/《处理反馈表》.docx b/mailbox-lan/src/main/resources/templates/《处理反馈表》.docx index cac64d9..7d672bb 100644 Binary files a/mailbox-lan/src/main/resources/templates/《处理反馈表》.docx and b/mailbox-lan/src/main/resources/templates/《处理反馈表》.docx differ