From 58b4863ce0acdc22514453cda0e16a80efc20e7a Mon Sep 17 00:00:00 2001 From: wxc <191104855@qq.com> Date: Thu, 11 Sep 2025 17:21:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biutag/lan/controller/HomeController.java | 38 +++++++++++++------ .../biutag/lan/controller/MailController.java | 6 ++- .../lan/controller/system/DeptController.java | 7 ++++ .../biutag/lan/flow/node/FirstSignFlow.java | 3 ++ .../biutag/lan/flow/node/SecondSignFlow.java | 3 +- .../biutag/lan/service/MailMarkService.java | 26 ++++++++++++- .../src/main/resources/application.yml | 2 +- 7 files changed, 68 insertions(+), 17 deletions(-) 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 84b1312..d5be7a7 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 @@ -6,25 +6,25 @@ import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.biutag.aop.NotPower; import com.biutag.core.AjaxResult; -import com.biutag.entity.system.Duty; import com.biutag.enums.DeptTypeEnum; +import com.biutag.enums.MailState; import com.biutag.enums.RoleEnum; import com.biutag.lan.config.AdminThreadLocal; import com.biutag.lan.domain.Mail; +import com.biutag.lan.domain.MailMark; import com.biutag.lan.domain.Work; import com.biutag.lan.domain.bo.MailTotal; -import com.biutag.enums.MailState; import com.biutag.lan.domain.vo.DutyView; import com.biutag.lan.flow.FlowNameEnum; import com.biutag.lan.flow.FlowNodeEnum; import com.biutag.lan.mapper.DataScreenMapper; -import com.biutag.lan.service.*; -import com.biutag.lan.service.impl.DutyServiceImpl; -import com.biutag.mapper.system.DutyMapper; +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 io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -37,8 +37,6 @@ import java.util.*; @RequiredArgsConstructor public class HomeController { - private final MailSourceService mailSourceService; - private final WorkService workService; private final MailService mailService; @@ -52,6 +50,8 @@ public class HomeController { int unSignTotal = 0; Integer roleId = AdminThreadLocal.getRoleId(); String deptId = AdminThreadLocal.getDeptId(); + LambdaQueryWrapper extensionQw = new LambdaQueryWrapper() + .eq(Mail::getMailState, MailState.delayed.getValue()); if (roleId.equals(RoleEnum.PROVINCIAL_CLASSES.getRoleId())) { unSignTotal = (int) workService.count(new LambdaQueryWrapper().in(Work::getFlowName, // 待签收、待下发、信件退回 @@ -68,8 +68,9 @@ public class HomeController { .eq(Work::getSignRoleId, roleId) .eq(Work::getSignDeptId, deptId) .eq(Work::getWorkState, Work.State.todo.name())); + extensionQw.eq(Mail::getFirstDeptId, deptId); } - if (roleId.equals(RoleEnum.SECOND_DEPT_CLASSES.getRoleId())) { + if (roleId.equals(RoleEnum.SECOND_DEPT_CLASSES.getRoleId()) || roleId.equals(RoleEnum.SECOND_DEPT_LEADER.getRoleId())) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() .in(Work::getFlowName, // 待签收、待下发、信件退回 @@ -77,21 +78,23 @@ public class HomeController { .eq(Work::getSignRoleId, roleId) .eq(Work::getSignDeptId, deptId) .eq(Work::getWorkState, Work.State.todo.name()); + extensionQw.eq(Mail::getSecondDeptId, deptId); unSignTotal = (int) workService.count(queryWrapper); } - if (roleId.equals(RoleEnum.THREE_DEPT_CLASSES.getRoleId())) { + if (roleId.equals(RoleEnum.THREE_DEPT_CLASSES.getRoleId()) || roleId.equals(RoleEnum.THREE_DEPT_LEADER.getRoleId())) { unSignTotal = (int) workService.count(new LambdaQueryWrapper().in(Work::getFlowName, // 待签收 Collections.singletonList(FlowNameEnum.PENDING_SIGN.getName())) .eq(Work::getSignRoleId, roleId) .eq(Work::getSignDeptId, deptId) .eq(Work::getWorkState, Work.State.todo.name())); + extensionQw.eq(Mail::getThreeDeptId, deptId); } Integer contactWriterTotal = workService.count(FlowNodeEnum.CONTACT_WRITER.getKey(), deptId); Integer interviewWriterTotal = workService.count(FlowNodeEnum.INTERVIEW_WRITER.getKey(), deptId); Integer verifyTotal = workService.count(FlowNodeEnum.VERIFY.getKey(), deptId); // 申请延期中 - int extensionTotal = Long.valueOf(mailService.count(new LambdaQueryWrapper().eq(Mail::getMailState, MailState.delayed.getValue()))).intValue(); + int extensionTotal = Long.valueOf(mailService.count(extensionQw)).intValue(); Integer approvalTotal = workService.count(Arrays.asList( FlowNodeEnum.THREE_LEADER_APPROVAL.getKey(), FlowNodeEnum.SECOND_APPROVAL.getKey(), @@ -119,8 +122,19 @@ public class HomeController { Long mailToday = mailService.countTodayByCurrent(); // 今日办结 long completedToday = mailMarkService.countByCompleted(today); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + Integer roleId = AdminThreadLocal.getRoleId(); + if (RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId().equals(roleId)) { + queryWrapper.eq(MailMark::getFirstDeptId, AdminThreadLocal.getDeptId()); + } + if (RoleEnum.SECOND_DEPT_CLASSES.getRoleId().equals(roleId) || RoleEnum.SECOND_DEPT_LEADER.getRoleId().equals(roleId)) { + queryWrapper.eq(MailMark::getSecondDeptId, AdminThreadLocal.getDeptId()); + } + if (RoleEnum.THREE_DEPT_CLASSES.getRoleId().equals(roleId) || RoleEnum.THREE_DEPT_LEADER.getRoleId().equals(roleId)) { + queryWrapper.eq(MailMark::getThreeDeptId, AdminThreadLocal.getDeptId()); + } // 累计来信 - long mailTotal = mailMarkService.count(); + long mailTotal = mailMarkService.count(queryWrapper); // 累计办结 long completedTotal = mailMarkService.countByCompleted(); // 累计办结 diff --git a/mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java b/mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java index 04b3bd7..616c4d1 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java @@ -80,8 +80,10 @@ public class MailController { @Log(title="信件:办理信件") @NotPower @PostMapping("flow/next") - public AjaxResult next(@RequestBody @Valid FlowAction action) { - return AjaxResult.success(mailService.next(action)); + public AjaxResult next(@RequestBody @Valid FlowAction action) { + mailService.next(action); + Mail mail = mailService.getById(action.getMailId()); + return AjaxResult.success("", Optional.ofNullable(mail).map(Mail::getCurrentOperator).orElse(null)); } @Operation(summary = "删除信件") diff --git a/mailbox-lan/src/main/java/com/biutag/lan/controller/system/DeptController.java b/mailbox-lan/src/main/java/com/biutag/lan/controller/system/DeptController.java index 5a9d33b..9150d1e 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/controller/system/DeptController.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/controller/system/DeptController.java @@ -46,6 +46,13 @@ public class DeptController { return AjaxResult.success(iDeptService.allTree()); } + @NotPower + @GetMapping("/tree") + @Operation(summary = "部门树结构") + public AjaxResult> tree(String id) { + return AjaxResult.success(iDeptService.treeByDeptId(id)); + } + @NotPower @GetMapping("/tree/auth") @Operation(summary = "部门树结构") diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstSignFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstSignFlow.java index 1adeece..8fd9bc1 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstSignFlow.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstSignFlow.java @@ -135,6 +135,9 @@ public class FirstSignFlow extends Flow { .set(Mail::getSecondDeptName, null) .set(Mail::getThreeDeptId, null) .set(Mail::getThreeDeptName, null) + .set(Mail::getFirstDistributeInfo, null) + .set(Mail::getSecondDistributeInfo, null) + .set(Mail::getCurrentOperator, "省厅专班") ); return null; } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondSignFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondSignFlow.java index 9a7f109..0e55e9b 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondSignFlow.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondSignFlow.java @@ -39,7 +39,7 @@ public class SecondSignFlow extends Flow { private final NoticeService noticeService; - private final MailSourceService mailSourceService; + private final IDeptService deptService; @Override @Transactional(rollbackFor = Exception.class) @@ -90,6 +90,7 @@ public class SecondSignFlow extends Flow { .set(Mail::getSecondDeptName, null) .set(Mail::getThreeDeptId, null) .set(Mail::getThreeDeptName, null) + .set(Mail::getCurrentOperator, String.format("%s专班", deptService.detail(mail.getFirstDeptId()).getShortName())) ); } else { 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 a74017c..767f73b 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 @@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.biutag.constants.AppConstants; +import com.biutag.enums.RoleEnum; +import com.biutag.lan.config.AdminThreadLocal; +import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.MailMark; import com.biutag.lan.mapper.MailMarkMapper; import org.springframework.stereotype.Service; @@ -15,13 +18,34 @@ import java.util.List; public class MailMarkService extends ServiceImpl { public Long countByCompleted() { - return count(new LambdaQueryWrapper().eq(MailMark::getCompleted, AppConstants.TRUE)); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().eq(MailMark::getCompleted, AppConstants.TRUE); + Integer roleId = AdminThreadLocal.getRoleId(); + if (RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId().equals(roleId)) { + queryWrapper.eq(MailMark::getFirstDeptId, AdminThreadLocal.getDeptId()); + } + if (RoleEnum.SECOND_DEPT_CLASSES.getRoleId().equals(roleId) || RoleEnum.SECOND_DEPT_LEADER.getRoleId().equals(roleId)) { + queryWrapper.eq(MailMark::getSecondDeptId, AdminThreadLocal.getDeptId()); + } + if (RoleEnum.THREE_DEPT_CLASSES.getRoleId().equals(roleId) || RoleEnum.THREE_DEPT_LEADER.getRoleId().equals(roleId)) { + queryWrapper.eq(MailMark::getThreeDeptId, AdminThreadLocal.getDeptId()); + } + return count(queryWrapper); } public Long countByCompleted(String completionTime) { QueryWrapper queryWrapper = new QueryWrapper() .eq("completed", AppConstants.TRUE) .eq("TO_CHAR(completion_time, 'YYYY-MM-DD')", completionTime); + Integer roleId = AdminThreadLocal.getRoleId(); + if (RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId().equals(roleId)) { + queryWrapper.eq("first_dept_id", AdminThreadLocal.getDeptId()); + } + if (RoleEnum.SECOND_DEPT_CLASSES.getRoleId().equals(roleId) || RoleEnum.SECOND_DEPT_LEADER.getRoleId().equals(roleId)) { + queryWrapper.eq("second_dept_id", AdminThreadLocal.getDeptId()); + } + if (RoleEnum.THREE_DEPT_CLASSES.getRoleId().equals(roleId) || RoleEnum.THREE_DEPT_LEADER.getRoleId().equals(roleId)) { + queryWrapper.eq("three_dept_id", AdminThreadLocal.getDeptId()); + } return count(queryWrapper); } diff --git a/mailbox-lan/src/main/resources/application.yml b/mailbox-lan/src/main/resources/application.yml index 56736cd..9ebedb3 100644 --- a/mailbox-lan/src/main/resources/application.yml +++ b/mailbox-lan/src/main/resources/application.yml @@ -38,7 +38,7 @@ sa-token: timeout: 18144000 # token有效期单位s 默认7天(7 * 24 * 60 * 60 * 30) active-timeout: -1 # token临时有效期(指定时间无操作掉线) is-concurrent: true # 是否允许同一账号并发登录 - is-share: false # 多人同登账号共用token + is-share: true # 多人同登账号共用token token-style: random-64 # token生成的风格 is-print: false # 打印版本字符画 is-log: true # 是否输出操作日志