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 221743a..af55fe9 100644 Binary files a/src/main/resources/static/templates/《处理反馈表》.doc and b/src/main/resources/static/templates/《处理反馈表》.doc differ