From 5af6c92b3b54d23af60866752a4143d0f8a6257a Mon Sep 17 00:00:00 2001 From: wxc <191104855@qq.com> Date: Tue, 17 Dec 2024 18:03:49 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=AE=8C=E5=96=84=E6=8F=90=E9=86=92?= =?UTF-8?q?=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/20241217.sql | 5 +++++ .../work/AlarmNotificationController.java | 6 ++++++ .../flow/action/ApplyCompletionAction.java | 9 ++++++-- .../java/com/biutag/supervision/job/Job.java | 20 +++++++++++------- .../pojo/entity/AlarmNotification.java | 9 +++----- .../supervision/pojo/entity/Negative.java | 3 +++ .../pojo/model/PoliceNegativeModel.java | 1 + .../service/AlarmNotificationService.java | 3 --- .../resources/mapper/ProfilePoliceMapper.xml | 2 ++ .../resources/mapper/RiskPersonalMapper.xml | 3 ++- .../templates/《处理反馈表》.doc | Bin 27136 -> 27136 bytes 11 files changed, 41 insertions(+), 20 deletions(-) create mode 100644 sql/20241217.sql diff --git a/sql/20241217.sql b/sql/20241217.sql new file mode 100644 index 0000000..55a96a5 --- /dev/null +++ b/sql/20241217.sql @@ -0,0 +1,5 @@ +ALTER TABLE `negative`.`negative` + ADD COLUMN `handle_time` datetime NULL COMMENT '申请办结时间' AFTER `handle_timeout`; + +ALTER TABLE `negative`.`alarm_notification` + ADD COLUMN `reply_limit` int NULL COMMENT '通知回复时限' AFTER `request_reply`; \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/controller/work/AlarmNotificationController.java b/src/main/java/com/biutag/supervision/controller/work/AlarmNotificationController.java index 18ad74d..641d444 100644 --- a/src/main/java/com/biutag/supervision/controller/work/AlarmNotificationController.java +++ b/src/main/java/com/biutag/supervision/controller/work/AlarmNotificationController.java @@ -6,10 +6,12 @@ import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.entity.AlarmFile; import com.biutag.supervision.pojo.entity.AlarmNotification; import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.SupDepart; import com.biutag.supervision.pojo.enums.NotificationType; import com.biutag.supervision.pojo.param.AlarmParam; import com.biutag.supervision.service.AlarmNotificationService; import com.biutag.supervision.service.ProblemSourceService; +import com.biutag.supervision.service.SupDepartService; import com.biutag.supervision.util.CompletableUtils.CompletableFutureUtil; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -36,6 +38,8 @@ public class AlarmNotificationController { private final AlarmNotificationService notificationService; + private final SupDepartService departService; + /** * 预警通知分页查询 * @param param 请求参数 @@ -92,6 +96,8 @@ public class AlarmNotificationController { } String alarmType = Optional.ofNullable(NotificationType.contains(data.getAlarmTypeId())) .orElseThrow(() -> new RuntimeException("未知提醒类型")); + SupDepart depart = departService.getById(data.getNotificationDepartId()); + data.setNotificationDepartName(depart.getShortName()); data.setAlarmTime(LocalDateTime.now()); data.setAlarmType(alarmType); data.setReplyState(0); diff --git a/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java b/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java index d0e41bd..63b5f63 100644 --- a/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java @@ -11,6 +11,7 @@ import com.biutag.supervision.pojo.dto.ActionDto; import com.biutag.supervision.pojo.dto.flow.VerifyData; import com.biutag.supervision.pojo.entity.*; import com.biutag.supervision.service.*; +import com.biutag.supervision.util.TimeUtil; import jakarta.validation.Validator; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -55,13 +56,17 @@ public class ApplyCompletionAction implements Action { // 是否是本级办理 negative.getIsSecondHandle() ? RoleCodeEnum.FIRST_ADMIN.getCode() : RoleCodeEnum.SECOND_ADMIN.getCode(), negative); - addApprove(negative); + + Long remainingDuration = TimeUtil.getRemainingDuration(negative.getFirstDistributeTime(), negative.getMaxSignDuration(), negative.getMaxHandleDuration(), negative.getExtensionDays(), negative.getFlowKey()); + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() .eq(Negative::getId, actionDto.getNegativeId()) .set(Negative::getFlowKey, negative.getIsSecondHandle() ? FlowNodeEnum.FIRST_APPROVE.getKey() : FlowNodeEnum.SECOND_APPROVE.getKey()) // 当前处理对象 - .set(Negative::getCurrentProcessingObject, negative.getIsSecondHandle() ? "市局专班" : String.format("%s专班", negative.getHandleSecondDepartName())); + .set(Negative::getCurrentProcessingObject, negative.getIsSecondHandle() ? "市局专班" : String.format("%s专班", negative.getHandleSecondDepartName())) + .set(Negative::getHandleTime, LocalDateTime.now()) + .set(Negative::getHandleTimeout, Objects.isNull(remainingDuration) || remainingDuration >= 0 ? 0 : -remainingDuration); negativeService.update(updateWrapper); } diff --git a/src/main/java/com/biutag/supervision/job/Job.java b/src/main/java/com/biutag/supervision/job/Job.java index c5f0c99..88aaa51 100644 --- a/src/main/java/com/biutag/supervision/job/Job.java +++ b/src/main/java/com/biutag/supervision/job/Job.java @@ -1,5 +1,6 @@ package com.biutag.supervision.job; +import cn.hutool.core.util.NumberUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.biutag.supervision.constants.enums.ProcessingStatusEnum; @@ -17,6 +18,8 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; +import static com.biutag.supervision.util.TimeUtil.SECONDS_OF_A_DAY; + @RequiredArgsConstructor @Component public class Job { @@ -63,19 +66,20 @@ public class Job { } // 更新办理超时 -// @Scheduled(fixedRate = 600000) + @Scheduled(fixedRate = 600000) public void updateHandleTimeout() { List list = negativeService.list(new LambdaQueryWrapper() .isNotNull(Negative::getCompleteDate) .isNotNull(Negative::getCrtTime) - .isNull(Negative::getFlowKey)); + .isNotNull(Negative::getMaxHandleDuration) + .isNotNull(Negative::getMaxExtensionDuration) + .eq(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()) + .isNull(Negative::getHandleTimeout)); list.forEach(item -> { - long remainingDuration = TimeUtil.getRemainingDuration(item.getCrtTime(), item.getCompleteDate(), 3 * 24 * 60 * 60L); - if (remainingDuration < 0) { - negativeService.update(new LambdaUpdateWrapper() - .set(Negative::getHandleTimeout, -remainingDuration) - .eq(Negative::getId, item.getId())); - } + long remainingDuration = TimeUtil.getRemainingDuration(item.getCrtTime(), item.getCompleteDate(), NumberUtil.mul(item.getMaxHandleDuration(), SECONDS_OF_A_DAY).longValue()) + NumberUtil.mul(item.getMaxExtensionDuration(), SECONDS_OF_A_DAY).longValue(); + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getHandleTimeout, remainingDuration >= 0 ? 0: -remainingDuration) + .eq(Negative::getId, item.getId())); }); } diff --git a/src/main/java/com/biutag/supervision/pojo/entity/AlarmNotification.java b/src/main/java/com/biutag/supervision/pojo/entity/AlarmNotification.java index 1735cd8..44350a1 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/AlarmNotification.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/AlarmNotification.java @@ -46,12 +46,6 @@ public class AlarmNotification implements Serializable { @TableField("`alarm_type`") String alarmType; - /** - * 被通知单位机构代码 - */ - @TableField("`notification_depart_code`") - String notificationDepartCode; - /** * 被通知单位ID */ @@ -160,4 +154,7 @@ public class AlarmNotification implements Serializable { @TableField(exist = false) List files; + // 通知回复时限 + private Integer replyLimit; + } diff --git a/src/main/java/com/biutag/supervision/pojo/entity/Negative.java b/src/main/java/com/biutag/supervision/pojo/entity/Negative.java index 5d55040..35eeb09 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/Negative.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/Negative.java @@ -252,6 +252,9 @@ public class Negative { // 办理超时(秒) private Long handleTimeout; + // 申请办结时间 + private LocalDateTime handleTime; + // 当前处理对象 private String currentProcessingObject; diff --git a/src/main/java/com/biutag/supervision/pojo/model/PoliceNegativeModel.java b/src/main/java/com/biutag/supervision/pojo/model/PoliceNegativeModel.java index b5a3b13..0983b69 100644 --- a/src/main/java/com/biutag/supervision/pojo/model/PoliceNegativeModel.java +++ b/src/main/java/com/biutag/supervision/pojo/model/PoliceNegativeModel.java @@ -29,6 +29,7 @@ public class PoliceNegativeModel { // 查实问题数 private Integer verifySize; private String departName; + private String departId; private String parentDepartName; private BigDecimal score; diff --git a/src/main/java/com/biutag/supervision/service/AlarmNotificationService.java b/src/main/java/com/biutag/supervision/service/AlarmNotificationService.java index c8eb66a..71616a9 100644 --- a/src/main/java/com/biutag/supervision/service/AlarmNotificationService.java +++ b/src/main/java/com/biutag/supervision/service/AlarmNotificationService.java @@ -49,9 +49,6 @@ public class AlarmNotificationService extends ServiceImpl diff --git a/src/main/resources/static/templates/《处理反馈表》.doc b/src/main/resources/static/templates/《处理反馈表》.doc index 221743ac0956c09a2530003c2c85a7326480e9c4..af55fe91d898a7757d1e9d23313f69676e74e90d 100644 GIT binary patch delta 1057 zcmYk4T}TvB6vyu!XU19GU3YfXw#BWTin7g*{2-GGR$D4GL`p&|7Tt{$@}WQ~G|YPF zB_Z<^gh^WYRDssrh@uCJ2%?}K?1Owz!pgqzp&N4m>*Mry}-3d8bHyV}Xe=%?C2Jq;=y(FToF#Ag$U1O*hYA)VwVq)%y8IH@Kp z^;NH-Dmo|K2=XB+GD?c3apC~qffF#!SO$y%>w=$nq`4z!^9;agpHKxHQ@P({p_vo1K4n6m^EN8|S#N6nW4ZOeyLLdyb zfEr;1C%9Duw-&U6PS6ETfb*aa^v|XB!@USDgPR}@UV_))515@xn}zF4M`PdvIUpAV zK>-L0YwZO0hv9Aqb)W(40TJ--$*l|LAlku2u;gu~_Fn1}=C&Db{*#GNCc0z`vkKvb z>M9Wq&xPkjN@Yhur!Z?~_~L~Elj3kBRSk;8wI6uaAY3U>ij%^m8kfl0@tK=0OeaN2 zK~hYfFzaTxEf22L6%n>wKT>EkJw)-0M$y=ir)S9zAa7S*ovb89N9a;x%rCXb!R3^4 zB-vLskkuk&HP!K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