Browse Source

优化完善,BUG修复

厅长信箱
wxc 2 months ago
parent
commit
c12f3c4021
  1. 3
      mailbox-common/src/main/java/com/biutag/constants/AppConstants.java
  2. 7
      mailbox-lan/sql/20250917.sql
  3. 41
      mailbox-lan/src/main/java/com/biutag/lan/controller/HomeController.java
  4. 18
      mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java
  5. 3
      mailbox-lan/src/main/java/com/biutag/lan/domain/MailMark.java
  6. 1
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstDistributeFlow.java
  7. 13
      mailbox-lan/src/main/java/com/biutag/lan/mapper/DataScreenMapper.java
  8. 75
      mailbox-lan/src/main/java/com/biutag/lan/service/DataScreenService.java
  9. 1
      mailbox-lan/src/main/java/com/biutag/lan/service/IDutyService.java
  10. 4
      mailbox-lan/src/main/java/com/biutag/lan/service/MailMarkService.java
  11. 2
      mailbox-lan/src/main/java/com/biutag/lan/service/PoliceWeChatMessage.java
  12. 30
      mailbox-lan/src/main/java/com/biutag/lan/service/impl/DeptServiceImpl.java
  13. 12
      mailbox-lan/src/main/java/com/biutag/lan/service/impl/DutyServiceImpl.java
  14. 16
      mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml
  15. BIN
      mailbox-lan/src/main/resources/templates/《处理反馈表》.docx

3
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);
}

7
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;

41
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<MailMark> queryWrapper = new LambdaQueryWrapper<>();
LambdaQueryWrapper<MailMark> queryWrapper = new LambdaQueryWrapper<MailMark>()
.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<List<DutyView>> 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<>());
}

18
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<List<DutyView>> 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<>());

3
mailbox-lan/src/main/java/com/biutag/lan/domain/MailMark.java

@ -53,6 +53,9 @@ public class MailMark {
*/
private String threeDeptName;
//
private LocalDateTime mailTime;
/**
* 办结时间
*/

1
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())

13
mailbox-lan/src/main/java/com/biutag/lan/mapper/DataScreenMapper.java

@ -88,12 +88,6 @@ public interface DataScreenMapper {
*/
Map<String,Object> getAllResolvedRate();
/**
* 全长沙解决率
* @return
*/
Map<String,Object> getAllResolvedRate(@Param("deptId") String deptId);
/**
* 全长沙办结率
* @return
@ -131,9 +125,6 @@ public interface DataScreenMapper {
List<Duty> getToDayDuty(@Param("depatType") String depatType, @Param("deptId") String deptId);
MailDetail getMailDetail(Map<String,Object> params);
@ -155,5 +146,7 @@ public interface DataScreenMapper {
List<Map<String, String>> getOtherResolvedRate();
List<Duty> getToFjDuty(@Param("depatType") String depatType,@Param("deptId") String deptId);
List<Duty> selectDutyListByTodayAndDeptPId(@Param("deptType") String deptType, @Param("deptPId") String deptPId);
List<Duty> selectDutyListByTodayAndDeptId(@Param("deptType") String deptType, @Param("deptId") String deptId);
}

75
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<MailMark>().eq(MailMark::getCompleted, AppConstants.TRUE));
Long resolvedCases = mailMarkService.count(new LambdaQueryWrapper<MailMark>().eq(MailMark::getResolved, AppConstants.TRUE));
Long satisfiedCases = mailMarkService.count(new LambdaQueryWrapper<MailMark>().eq(MailMark::getSatisfied, AppConstants.TRUE));
Long total = mailMarkService.count(new LambdaQueryWrapper<MailMark>()
.ge(MailMark::getMailTime, AppConstants.BEGIN_TIME));
Long completedCases = mailMarkService.count(new LambdaQueryWrapper<MailMark>()
.ge(MailMark::getMailTime, AppConstants.BEGIN_TIME)
.eq(MailMark::getCompleted, AppConstants.TRUE));
Long resolvedCases = mailMarkService.count(new LambdaQueryWrapper<MailMark>()
.ge(MailMark::getMailTime, AppConstants.BEGIN_TIME)
.eq(MailMark::getResolved, AppConstants.TRUE));
Long satisfiedCases = mailMarkService.count(new LambdaQueryWrapper<MailMark>()
.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<MailSource>().eq("TO_CHAR(mail_time, 'YYYY-MM-DD')", todayStr));
Long today = mailSourceService.count(new QueryWrapper<MailSource>()
.eq("TO_CHAR(mail_time, 'YYYY-MM-DD')", todayStr));
LambdaQueryWrapper<MailMark> queryWrapper = new LambdaQueryWrapper<MailMark>()
.ge(MailMark::getMailTime, AppConstants.BEGIN_TIME);
LambdaQueryWrapper<MailMark> completedCasesQueryWrapper = new LambdaQueryWrapper<MailMark>()
.ge(MailMark::getMailTime, AppConstants.BEGIN_TIME)
.eq(MailMark::getCompleted, AppConstants.TRUE);
LambdaQueryWrapper<MailMark> satisfiedCasesQueryWrapper = new LambdaQueryWrapper<MailMark>()
.ge(MailMark::getMailTime, AppConstants.BEGIN_TIME)
.eq(MailMark::getSatisfied, AppConstants.TRUE);
LambdaQueryWrapper<MailMark> resolvedCasesQueryWrapper = new LambdaQueryWrapper<MailMark>()
.ge(MailMark::getMailTime, AppConstants.BEGIN_TIME)
.eq(MailMark::getResolved, AppConstants.TRUE);
LambdaQueryWrapper<MailMark> queryWrapper = new LambdaQueryWrapper<MailMark>();
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<MailMark> completedCasesQueryWrapper = new LambdaQueryWrapper<MailMark>().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<MailMark> resolvedCasesQueryWrapper = new LambdaQueryWrapper<MailMark>().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<MailMark> satisfiedCasesQueryWrapper = new LambdaQueryWrapper<MailMark>().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<String, Object> getToDayDuty(Map<String, String> params) {
Map<String, Object> map = new HashMap<>();
if (params.size() == 0) {
List<Duty> dutySjList = baseMapper.getToDayDuty("0", null);
List<Duty> dutyFjList = baseMapper.getToDayDuty(DeptTypeEnum.SJ_TYPE.getType(), null);
List<Duty> dutyZdList = baseMapper.getToDayDuty(DeptTypeEnum.ZD_TYPE.getType(), null);
List<Duty> dutyBwList = baseMapper.getToDayDuty(DeptTypeEnum.BW_TYPE.getType(), null);
List<Duty> dutySjList = baseMapper.selectDutyListByTodayAndDeptPId("0", null);
List<Duty> dutyFjList = baseMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.SJ_TYPE.getType(), null);
List<Duty> dutyZdList = baseMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.ZD_TYPE.getType(), null);
List<Duty> 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<String, Object> getToIndexDuty() {
Map<String, Object> map = new HashMap<>();
String deptId = AdminThreadLocal.getDeptId();
List<Duty> dutySjList = baseMapper.getToDayDuty(DeptTypeEnum.SJ_TYPE.getType(), null);
List<Duty> dutyFjList = baseMapper.getToDayDuty(DeptTypeEnum.FJ_TYPE.getType(), deptId);
List<Duty> dutyPcsList = baseMapper.getToDayDuty(DeptTypeEnum.PCS_TYPE.getType(), deptId);
List<Duty> dutyDdList = baseMapper.getToDayDuty(DeptTypeEnum.DD_TYPE.getType(), deptId);
List<Duty> dutySjList = baseMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.SJ_TYPE.getType(), null);
List<Duty> dutyFjList = baseMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.FJ_TYPE.getType(), deptId);
List<Duty> dutyPcsList = baseMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.PCS_TYPE.getType(), deptId);
List<Duty> dutyDdList = baseMapper.selectDutyListByTodayAndDeptPId(DeptTypeEnum.DD_TYPE.getType(), deptId);
map.put("dutySjList", dutySjList);
map.put("dutyFjList", dutyFjList);
map.put("dutyPcsList", dutyPcsList);

1
mailbox-lan/src/main/java/com/biutag/lan/service/IDutyService.java

@ -62,6 +62,5 @@ public interface IDutyService {
boolean saveBatch(List<Duty> list);
List<Duty> listByToday(String deptTyp, String deptId);
}

4
mailbox-lan/src/main/java/com/biutag/lan/service/MailMarkService.java

@ -18,7 +18,9 @@ import java.util.List;
public class MailMarkService extends ServiceImpl<MailMarkMapper, MailMark> {
public Long countByCompleted() {
LambdaQueryWrapper<MailMark> queryWrapper = new LambdaQueryWrapper<MailMark>().eq(MailMark::getCompleted, AppConstants.TRUE);
LambdaQueryWrapper<MailMark> queryWrapper = new LambdaQueryWrapper<MailMark>()
.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());

2
mailbox-lan/src/main/java/com/biutag/lan/service/PoliceWeChatMessage.java

@ -40,7 +40,7 @@ public class PoliceWeChatMessage {
List<PoliceUser> policeUsers = policeUserMapper.selectList(new LambdaQueryWrapper<PoliceUser>()
.eq(PoliceUser::getRoleIds, roleId)
.eq(PoliceUser::getDataDeptId, deptId));
List<Duty> dutys = dataScreenMapper.getToFjDuty(null, deptId);
List<Duty> dutys = dataScreenMapper.selectDutyListByTodayAndDeptId(null, deptId);
try {
dutys.stream().filter(item -> PhoneUtil.isPhone(item.getMobile()))
.forEach(item -> {

30
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<Duty>().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<Duty>().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<Duty>().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);
}

12
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<Duty> listByToday(String deptTyp, String deptId) {
return dataScreenMapper.getToDayDuty(deptTyp, deptId);
}
}

16
mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml

@ -353,25 +353,25 @@
limit 1
</select>
<select id="getToDayDuty" resultType="com.biutag.entity.system.Duty">
<select id="selectDutyListByTodayAndDeptPId" resultType="com.biutag.entity.system.Duty">
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')
<if test="depatType!=null and depatType!=''">
and a.dept_type=#{depatType}
<if test="deptType!=null and deptType!=''">
and a.dept_type=#{deptType}
</if>
<if test="deptId != null">
and b.pid=#{deptId}
<if test="deptPId != null">
and b.pid=#{deptPId}
</if>
order by b.sort asc
</select>
<select id="getToFjDuty" resultType="com.biutag.entity.system.Duty">
<select id="selectDutyListByTodayAndDeptId" resultType="com.biutag.entity.system.Duty">
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')
<if test="depatType!=null and depatType!=''">
and a.dept_type=#{depatType}
<if test="deptType!=null and deptType!=''">
and a.dept_type=#{deptType}
</if>
<if test="deptId!=null">
and b.id=#{deptId}

BIN
mailbox-lan/src/main/resources/templates/《处理反馈表》.docx

Binary file not shown.
Loading…
Cancel
Save