diff --git a/mailbox-lan/sql/0329.sql b/mailbox-lan/sql/0329.sql new file mode 100644 index 0000000..651bf68 --- /dev/null +++ b/mailbox-lan/sql/0329.sql @@ -0,0 +1,4 @@ +update mailbox.mail_mark mm set mm.three_dept_id = m.three_dept_id, mm.three_dept_name = m.three_dept_name + from mailbox.mail m where m.id = mm.mail_id and mm.three_dept_id is null; + +update mailbox.mail_mark mm set mm.completion_time = null where mm.completed = 0; \ No newline at end of file diff --git a/mailbox-lan/src/main/java/com/biutag/lan/cache/UserCatch.java b/mailbox-lan/src/main/java/com/biutag/lan/cache/UserCatch.java index 0d69f9b..1527330 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/cache/UserCatch.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/cache/UserCatch.java @@ -8,8 +8,8 @@ import java.util.concurrent.TimeUnit; public class UserCatch { private static final Cache cache = Caffeine.newBuilder() - // 8 * 60分钟 - .expireAfterWrite(480, TimeUnit.MINUTES) // 设置写入后过期时间 + // 24 小时 + .expireAfterWrite(24, TimeUnit.HOURS) // 设置写入后过期时间 .maximumSize(1000) // 最多1000人 .build(); public static Integer set(Integer key, LoginUser user) { 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 92754df..554b20d 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 @@ -72,6 +72,11 @@ public class MailQuery { private String timeout; + /** + * 办结时间 + */ + private List completionTime = new ArrayList<>(); + public List handleMailLabels() { if (mailLabels == null) { return null; diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/LedgerExcel.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/LedgerExcel.java index 5f9638e..603b2af 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/LedgerExcel.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/LedgerExcel.java @@ -24,10 +24,18 @@ public class LedgerExcel { @ExcelProperty({"局长信箱即接即办工作汇总台账", "线索来源"}) private String source; + @DateTimeFormat("yyyy/MM/dd HH:mm") + @ExcelProperty({"局长信箱即接即办工作汇总台账", "来信时间"}) + private LocalDateTime mailTime; + @DateTimeFormat("yyyy/MM/dd HH:mm") @ExcelProperty({"局长信箱即接即办工作汇总台账", "受理时间"}) private LocalDateTime createTime; + @DateTimeFormat("yyyy/MM/dd HH:mm") + @ExcelProperty({"局长信箱即接即办工作汇总台账", "办结时间"}) + private LocalDateTime completionTime; + @ExcelProperty({"局长信箱即接即办工作汇总台账", "信访人姓名"}) private String contactName; diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/QueryMailVo.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/QueryMailVo.java index fe54aab..61cf140 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/QueryMailVo.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/QueryMailVo.java @@ -144,4 +144,9 @@ public class QueryMailVo { * 延期天数 */ private Integer extensionDays; + + /** + * 办结时间 + */ + private LocalDateTime completionTime; } 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 d47b9b3..decaad7 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 @@ -90,8 +90,7 @@ public class FirstDistributeFlow extends Flow { .setMailId(mailId) .setSecondDeptId(mail.getSecondDeptId()) .setSecondDeptName(mail.getSecondDeptName()) - .setCompleted(AppConstants.FALSE) - .setCompletionTime(now); + .setCompleted(AppConstants.FALSE); mailMarkService.save(mailMark); return nextNode; } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondDistributeFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondDistributeFlow.java index 506faac..31611bd 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondDistributeFlow.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondDistributeFlow.java @@ -6,12 +6,14 @@ import com.alibaba.fastjson2.JSONObject; 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.flow.ActionEnum; import com.biutag.lan.flow.Flow; import com.biutag.lan.flow.FlowNameEnum; import com.biutag.lan.flow.FlowNodeEnum; import com.biutag.lan.service.IDeptService; +import com.biutag.lan.service.MailMarkService; import com.biutag.lan.service.MailService; import com.biutag.lan.service.WorkService; import com.biutag.lan.vo.system.DeptVo; @@ -31,6 +33,7 @@ public class SecondDistributeFlow extends Flow { private final WorkService workService; private final IDeptService deptService; private final SecondSignFlow secondSignFlow; + private final MailMarkService mailMarkService; @Override @Transactional(rollbackFor = Exception.class) @@ -77,7 +80,8 @@ public class SecondDistributeFlow extends Flow { workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), secondDeptId1, now, false, FlowNameEnum.PENDING_SIGN_CO.getName(), FlowNodeEnum.SECONDARY_VERIFY.getKey()); - secondDistributeInfo.put("secondDept1", JSONObject.of("id", secondDeptId1)); + DeptVo secondDept = deptService.detail(secondDeptId1); + secondDistributeInfo.put("secondDept1", JSONObject.of("id", secondDeptId1, "name", secondDept.getName())); } Integer secondDeptId2 = data.getInteger("secondDeptId2"); if (Objects.nonNull(secondDeptId2)) { @@ -85,7 +89,8 @@ public class SecondDistributeFlow extends Flow { workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), secondDeptId2, now, false, FlowNameEnum.PENDING_SIGN_CO.getName(), FlowNodeEnum.SECONDARY_VERIFY.getKey()); - secondDistributeInfo.put("secondDept2", JSONObject.of("id", secondDeptId2)); + DeptVo secondDept2 = deptService.detail(secondDeptId2); + secondDistributeInfo.put("secondDept2", JSONObject.of("id", secondDeptId2, "name", secondDept2.getName())); } Flow nextNode = next.get(nextActionKey); mail.setSecondDistributeInfo(secondDistributeInfo.toJSONString()); @@ -102,6 +107,9 @@ public class SecondDistributeFlow extends Flow { if (Objects.nonNull(mainDeptLevel)) { mail.setMainDeptLevel(mainDeptLevel); } + MailMark mailMark = mailMarkService.getById(mailId); + mailMark.setThreeDeptId(mainDeptId).setThreeDeptName(deptVo.getName()); + mailMarkService.updateById(mailMark); } mailService.updateById(mail); return null; 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 f4c82b2..6bb963e 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 @@ -482,6 +482,11 @@ public class WorkService extends ServiceImpl { break; } } + // 办结时间 + if (!mailQuery.getCompletionTime().isEmpty()) { + queryWrapper.ge("mm.completion_time", mailQuery.getCompletionTime().get(0)) + .le("mm.completion_time", mailQuery.getCompletionTime().get(1)); + } // 排序 queryWrapper.orderByDesc("m.mail_time"); @@ -693,7 +698,6 @@ public class WorkService extends ServiceImpl { List mailList = mailMapper.selectBatchIds(mailIds); List appealList = mailAppealMapper.selectList(null); List dictData = dictDataMapper.selectList(null); - List list = new ArrayList<>(); int i = 1; for (QueryMailVo q : data) { @@ -704,6 +708,7 @@ public class WorkService extends ServiceImpl { ledgerExcel.setSource((dictData.stream() .filter(r -> r.getValue().equals(nullToEmpty(q.getSource()))) .collect(Collectors.toList()).get(0).getName())); + ledgerExcel.setMailTime(m.getMailTime()); ledgerExcel.setCreateTime(m.getCreateTime()); ledgerExcel.setContactName(nullToEmpty(q.getContactName())); ledgerExcel.setContactPhone(nullToEmpty(q.getContactPhone())); diff --git a/mailbox-lan/src/main/resources/application.yml b/mailbox-lan/src/main/resources/application.yml index 24909a0..be13e8b 100644 --- a/mailbox-lan/src/main/resources/application.yml +++ b/mailbox-lan/src/main/resources/application.yml @@ -30,7 +30,7 @@ mybatis-plus: # Sa-token配置 sa-token: token-name: admin # token的名称 - timeout: 28800 # token有效期单位s(默认30天,-1代表永不过期) + timeout: 86400 # token有效期单位s 默认24小时(24 * 60 * 60) active-timeout: -1 # token临时有效期(指定时间无操作掉线) is-concurrent: false # 是否允许同一账号并发登录 is-share: false # 多人同登账号共用token @@ -38,7 +38,6 @@ sa-token: is-print: false # 打印版本字符画 is-log: false # 是否输出操作日志 - logging: level: root: INFO diff --git a/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml b/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml index 82ab301..27ab07a 100644 --- a/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml +++ b/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml @@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" COUNT ( b.mail_id ) SUM, CASE WHEN SUM = 0 THEN - 0 ELSE ROUND( SUM * 100 / SUM, 0 ) + 0 ELSE ROUND( SUM ( COALESCE ( b.completed, 0 ) ) * 100 / SUM, 0 ) END rateNumber, CONCAT ( rateNumber, '%' ) rate from dept a left join mail_mark b on a.id=b.three_dept_id where a.pid=#{deptId}