|
|
|
|
@ -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<Mail> extensionQw = new LambdaQueryWrapper<Mail>() |
|
|
|
|
.eq(Mail::getMailState, MailState.delayed.getValue()); |
|
|
|
|
if (roleId.equals(RoleEnum.PROVINCIAL_CLASSES.getRoleId())) { |
|
|
|
|
unSignTotal = (int) workService.count(new LambdaQueryWrapper<Work>().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<Work> queryWrapper = new LambdaQueryWrapper<Work>() |
|
|
|
|
.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<Work>().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<Mail>().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<MailMark> 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(); |
|
|
|
|
// 累计办结
|
|
|
|
|
|