diff --git a/mailbox-lan/sql/0315.sql b/mailbox-lan/sql/0315.sql new file mode 100644 index 0000000..99c2529 --- /dev/null +++ b/mailbox-lan/sql/0315.sql @@ -0,0 +1,9 @@ +ALTER TABLE "mailbox"."mail_return" + ADD COLUMN "sign_flag" bool DEFAULT true; + +COMMENT ON COLUMN "mailbox"."mail_return"."sign_flag" IS '是否是签收退回'; + +update mail_return set sign_flag = true where handler_name is null; +update mail_return set sign_flag = false where handler_name is not null; + +INSERT INTO "mailbox"."menu"("id", "pid", "menu_type", "menu_name", "menu_icon", "menu_sort", "perms", "paths", "component", "selected", "params", "is_cache", "is_show", "is_disable", "create_time", "update_time") VALUES (813, 500, 'C', '操作手册', NULL, 0, NULL, 'operatingManual', 'setting/OperatingManual', NULL, NULL, 0, 1, 0, 1710472924, 1710473042); diff --git a/mailbox-lan/src/main/java/com/biutag/lan/controller/FileController.java b/mailbox-lan/src/main/java/com/biutag/lan/controller/FileController.java index 267cdec..a39ba8f 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/controller/FileController.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/controller/FileController.java @@ -88,4 +88,22 @@ public class FileController { os.close(); } + @NotPower + @GetMapping("pdf/template/{filename}") + public void pdf(@PathVariable String filename, HttpServletResponse response) throws IOException { + InputStream is = getClass().getResourceAsStream(String.format("/templates/%s", filename)); + if (Objects.isNull(is)) { + return; + } + response.setContentType("application/pdf"); + ServletOutputStream os = response.getOutputStream(); + byte[] buffer = new byte[1024]; + int bytesRead; + while ((bytesRead = is.read(buffer, 0, buffer.length)) != -1) { + os.write(buffer, 0, bytesRead); + } + is.close(); + os.close(); + } + } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/MailReturn.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/MailReturn.java index 46afdaa..a33349a 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/domain/MailReturn.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/MailReturn.java @@ -56,4 +56,9 @@ public class MailReturn { */ private String attachments; + /** + * 签收退回 + */ + private Boolean signFlag; + } \ No newline at end of file diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailExcel.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailExcel.java index 1968ad0..a08b5b8 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailExcel.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailExcel.java @@ -1,5 +1,6 @@ package com.biutag.lan.domain.vo; +import com.alibaba.excel.annotation.ExcelProperty; import lombok.Getter; import lombok.Setter; @@ -429,6 +430,8 @@ public class MailExcel { // */ // @ExcelProperty("信件后续审批流程") // private String returnOperate; + + @ExcelProperty("") private String id; /** 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 f038c29..fe54aab 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 @@ -134,4 +134,14 @@ public class QueryMailVo { * 当前操作人 */ private String currentOperator; + + /** + * 是否申请延期 + */ + private Boolean extensionFlag; + + /** + * 延期天数 + */ + private Integer extensionDays; } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/WorkVo.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/WorkVo.java index 6ad0ce3..9d7221d 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/WorkVo.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/WorkVo.java @@ -129,5 +129,15 @@ public class WorkVo { * 当前操作人 */ private String currentOperator; + + /** + * 是否申请延期 + */ + private Boolean extensionFlag; + + /** + * 延期天数 + */ + private Integer extensionDays; } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNodeEnum.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNodeEnum.java index b3e74b1..3e9e20a 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNodeEnum.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNodeEnum.java @@ -42,4 +42,13 @@ public enum FlowNodeEnum { return null; } + public static boolean isSignReturn(String key) { + for (FlowNodeEnum value : values()) { + if (value.getKey().equals(key)) { + return value.getIndex() < THREE_SIGN.index; + } + } + return false; + } + } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstApprovalFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstApprovalFlow.java index cc783aa..2775a50 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstApprovalFlow.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstApprovalFlow.java @@ -112,6 +112,7 @@ public class FirstApprovalFlow extends Flow { .setHandlerName(AdminThreadLocal.getPoliceName()) .setHandlerDeptId(AdminThreadLocal.getDeptId()) .setHandlerDeptName(AdminThreadLocal.getDeptName()) + .setSignFlag(false) .setCreateTime(now); mailReturnService.save(mailReturn); // 更新二级机构专班的待办 diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondApprovalFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondApprovalFlow.java index d2c23e8..963ebbd 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondApprovalFlow.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondApprovalFlow.java @@ -67,6 +67,7 @@ public class SecondApprovalFlow extends Flow { .setHandlerName(AdminThreadLocal.getPoliceName()) .setHandlerDeptId(AdminThreadLocal.getDeptId()) .setHandlerDeptName(AdminThreadLocal.getDeptName()) + .setSignFlag(false) .setCreateTime(now); mailReturnService.save(mailReturn); // 更新已办 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 7d38390..d449a17 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 @@ -63,6 +63,7 @@ public class SecondSignFlow extends Flow { .setHandlerDeptId(deptId) .setHandlerDeptName(AdminThreadLocal.getDeptName()) .setAttachments(data.getString("attachments")) + .setSignFlag(true) .setCreateTime(now); mailReturnService.save(mailReturn); // 更新已办 diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeContactWriterFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeContactWriterFlow.java index 3d8fd09..ee89af1 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeContactWriterFlow.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeContactWriterFlow.java @@ -61,7 +61,6 @@ public class ThreeContactWriterFlow extends Flow { .setContactPolicePost(contactPolice.getString("post")) .setContactTime(DateUtil.parseLocalDateTime(contactTime, DatePattern.NORM_DATETIME_PATTERN)) .setContactDuration(data.getLong("contactDuration")) - .setContactPoliceEmpNo(data.getString("contactDuration")) .setContactFlag(data.getBoolean("contactFlag")) .setFlowKey(nextNode.getFlowNode().getKey()) .setFlowName(nextNode.getFlowNode().getBeforeName()) diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeLeaderApprovalFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeLeaderApprovalFlow.java index 49f6041..179d5b5 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeLeaderApprovalFlow.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeLeaderApprovalFlow.java @@ -69,6 +69,7 @@ public class ThreeLeaderApprovalFlow extends Flow { .setHandlerName(AdminThreadLocal.getPoliceName()) .setHandlerDeptId(AdminThreadLocal.getDeptId()) .setHandlerDeptName(AdminThreadLocal.getDeptName()) + .setSignFlag(false) .setCreateTime(now); mailReturnService.save(mailReturn); // 更新已办 diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeSignFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeSignFlow.java index f2d5a98..84a61c7 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeSignFlow.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeSignFlow.java @@ -69,6 +69,7 @@ public class ThreeSignFlow extends Flow { .setHandlerDeptId(AdminThreadLocal.getDeptId()) .setHandlerDeptName(AdminThreadLocal.getDeptName()) .setAttachments(data.getString("attachments")) + .setSignFlag(true) .setCreateTime(now); mailReturnService.save(mailReturn); // 更新已办 diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/IHolidayService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/IHolidayService.java index 8824653..f5d1342 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/IHolidayService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/IHolidayService.java @@ -64,6 +64,6 @@ public interface IHolidayService { */ void del(Integer id); - long getFlowRemainingTime(long limitedTime, LocalDateTime flowLimitedLastHandlerTime); + long getFlowRemainingTime(long limitedTime, LocalDateTime flowLimitedLastHandlerTime, Boolean extensionFlag, Integer extensionDays); } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/MailReturnService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/MailReturnService.java index a3037b2..3ab454c 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/MailReturnService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/MailReturnService.java @@ -16,4 +16,12 @@ public class MailReturnService extends ServiceImpl .orderByDesc(MailReturn::getCreateTime); return list(queryWrapper); } + + public List listBySignReturn(String mailId, boolean signReturn) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().eq(MailReturn::getMailId, mailId) + .eq(MailReturn::getSignFlag, signReturn) + .orderByDesc(MailReturn::getCreateTime); + return list(queryWrapper); + } + } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java index 39f9ca4..56ab029 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java @@ -138,7 +138,7 @@ public class MailService extends ServiceImpl { limitedTime += mail.getExtensionDays() * 24 * 60 * 60; } // 剩余时间 - long flowRemainingTime = holidayService.getFlowRemainingTime(limitedTime, mail.getFlowLimitedLastHandlerTime()); + long flowRemainingTime = holidayService.getFlowRemainingTime(limitedTime, mail.getFlowLimitedLastHandlerTime(), mail.getExtensionFlag(), mail.getExtensionDays()); // 剩余时间百分比 int flowRemainingTimePercentage = flowRemainingTime <= 0 ? 0 : Long.valueOf(flowRemainingTime * 100 / limitedTime).intValue(); @@ -151,7 +151,7 @@ public class MailService extends ServiceImpl { } // 退回件 if (!flows.isEmpty() && ActionEnum.mailReturn.getValue().equals(flows.get(0).getActionKey())) { - flowDetail.setMailReturns(mailReturnService.list(mailId)); + flowDetail.setMailReturns(mailReturnService.listBySignReturn(mailId, FlowNodeEnum.isSignReturn(mail.getFlowKey()))); } // 申请延期 if (StrUtil.isNotBlank(mail.getExtensionState())) { diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/SmsService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/SmsService.java index 531c3e9..b2812f3 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/SmsService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/SmsService.java @@ -25,6 +25,7 @@ public class SmsService { } String content = "请您及时登录局长信箱即接即办,并对您写的信件进行满意度评价,谢谢您的支持!"; try { + log.info("发送短信[{}]:{}", phone, content); SmsLan.send(phone, content); SmsSend smsSend = new SmsSend().setPhone(phone).setMailId(mailId).setContent(content).setCreateTime(LocalDateTime.now()).setSuccess(true); smsSendMapper.insert(smsSend); 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 1fa4e05..3692ce2 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 @@ -319,10 +319,10 @@ public class WorkService extends ServiceImpl { } } if (Objects.nonNull(item.getLimitedTime())) { - item.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTime(item.getLimitedTime(), item.getFlowLimitedLastHandlerTime())); + item.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTime(item.getLimitedTime(), item.getFlowLimitedLastHandlerTime(), item.getExtensionFlag(), item.getExtensionDays())); } else { Flow flow = SpringUtil.getBean(FirstSignFlow.class); - item.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTime(flow.getFlowNode().getLimitedTime(), item.getCreateTime())); + item.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTime(flow.getFlowNode().getLimitedTime(), item.getCreateTime(), item.getExtensionFlag(), item.getExtensionDays())); } }); return workVoPage; @@ -467,10 +467,10 @@ public class WorkService extends ServiceImpl { } if (Objects.nonNull(workVo.getLimitedTime())) { - workVo.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTime(workVo.getLimitedTime(), workVo.getFlowLimitedLastHandlerTime())); + workVo.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTime(workVo.getLimitedTime(), workVo.getFlowLimitedLastHandlerTime(), workVo.getExtensionFlag(), workVo.getExtensionDays())); } else { Flow flow = SpringUtil.getBean(FirstSignFlow.class); - workVo.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTime(flow.getFlowNode().getLimitedTime(), workVo.getCreateTime())); + workVo.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTime(flow.getFlowNode().getLimitedTime(), workVo.getCreateTime(), workVo.getExtensionFlag(), workVo.getExtensionDays())); } } return result; @@ -608,10 +608,10 @@ public class WorkService extends ServiceImpl { break; } if (Objects.nonNull(workVo.getLimitedTime())) { - workVo.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTime(workVo.getLimitedTime(), workVo.getFlowLimitedLastHandlerTime())); + workVo.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTime(workVo.getLimitedTime(), workVo.getFlowLimitedLastHandlerTime(), workVo.getExtensionFlag(), workVo.getExtensionDays())); } else { Flow flow = SpringUtil.getBean(FirstSignFlow.class); - workVo.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTime(flow.getFlowNode().getLimitedTime(), workVo.getCreateTime())); + workVo.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTime(flow.getFlowNode().getLimitedTime(), workVo.getCreateTime(), workVo.getExtensionFlag(), workVo.getExtensionDays())); } } return result; diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/HolidayServiceImpl.java b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/HolidayServiceImpl.java index 382ed8e..b12bd84 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/HolidayServiceImpl.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/HolidayServiceImpl.java @@ -158,24 +158,29 @@ public class HolidayServiceImpl implements IHolidayService { * 获取剩余时间 * @return */ - public long getFlowRemainingTime(long limitedTime, LocalDateTime flowLimitedLastHandlerTime) { + public long getFlowRemainingTime(long limitedTime, LocalDateTime flowLimitedLastHandlerTime, Boolean extensionFlag, Integer extensionDays) { // 86400 s 一天 if (limitedTime < 86400) { return limitedTime - Duration.between(flowLimitedLastHandlerTime, LocalDateTime.now()).getSeconds(); } - LocalDateTime now = LocalDateTime.now(); - String nowDate = now.format(DatePattern.NORM_DATE_FORMATTER); - ArrayList dates = new ArrayList<>(); - for (LocalDateTime dateTime = flowLimitedLastHandlerTime; dateTime.isBefore(now); dateTime = dateTime.plusDays(1)) { - dates.add(dateTime.format(DatePattern.NORM_DATE_FORMATTER)); + if (extensionFlag) { + return limitedTime + (extensionDays * 86400) - Duration.between(flowLimitedLastHandlerTime, LocalDateTime.now()).getSeconds(); + } else { + LocalDateTime now = LocalDateTime.now(); + String nowDate = now.format(DatePattern.NORM_DATE_FORMATTER); + ArrayList dates = new ArrayList<>(); + for (LocalDateTime dateTime = flowLimitedLastHandlerTime; dateTime.isBefore(now); dateTime = dateTime.plusDays(1)) { + dates.add(dateTime.format(DatePattern.NORM_DATE_FORMATTER)); + } + List list = list(dates); + long holidays = list.stream().filter(item -> item.getHolidayFlag().equals(AppConstants.YES) && !item.getDate().equals(nowDate)).count(); + long todaySeconds = list.stream().anyMatch(item -> item.getHolidayFlag().equals(AppConstants.YES) && item.getDate().equals(nowDate)) ? 0 : + // 当天的时间差 + Duration.between(now, now.toLocalDate().atStartOfDay()).getSeconds(); + limitedTime += 86400 * holidays + todaySeconds; + return limitedTime - Duration.between(flowLimitedLastHandlerTime, LocalDateTime.now()).getSeconds(); } - List list = list(dates); - long holidays = list.stream().filter(item -> item.getHolidayFlag().equals(AppConstants.YES) && !item.getDate().equals(nowDate)).count(); - long todaySeconds = list.stream().anyMatch(item -> item.getHolidayFlag().equals(AppConstants.YES) && item.getDate().equals(nowDate)) ? 0 : - // 当天的时间差 - Duration.between(now, now.toLocalDate().atStartOfDay()).getSeconds(); - limitedTime += 86400 * holidays + todaySeconds; - return limitedTime - Duration.between(flowLimitedLastHandlerTime, LocalDateTime.now()).getSeconds(); + } } diff --git a/mailbox-lan/src/main/resources/templates/长沙市公安局局长信箱即接即办系统平台-操作手册V1.3.pdf b/mailbox-lan/src/main/resources/templates/长沙市公安局局长信箱即接即办系统平台-操作手册V1.3.pdf new file mode 100644 index 0000000..c85d07e Binary files /dev/null and b/mailbox-lan/src/main/resources/templates/长沙市公安局局长信箱即接即办系统平台-操作手册V1.3.pdf differ