From b763cf9321b65fba133769e046f0eab450287a9b Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Wed, 1 Apr 2026 18:32:06 +0800 Subject: [PATCH 01/16] =?UTF-8?q?feat:=E5=89=A5=E7=A6=BB=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biutag/supervision/flow/FlowService.java | 1 + .../flow/action/ApplyCompletionAction.java | 7 +++- .../action/ConfirmationCompletionAction.java | 23 +++++++++++- .../flow/action/FirstApproveReturnAction.java | 5 ++- .../flow/action/SecondApproveAction.java | 20 ++++++++-- .../action/SecondApproveReturnAction.java | 2 + .../supervision/pojo/entity/Negative.java | 37 +++++++++++++++++++ .../com/biutag/supervision/util/TimeUtil.java | 31 ++++++++++++++++ 8 files changed, 120 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/biutag/supervision/flow/FlowService.java b/src/main/java/com/biutag/supervision/flow/FlowService.java index efa9c64..78f81ce 100644 --- a/src/main/java/com/biutag/supervision/flow/FlowService.java +++ b/src/main/java/com/biutag/supervision/flow/FlowService.java @@ -74,6 +74,7 @@ public class FlowService { } catch (RuntimeException e) { history.setCrtName("模型超市"); } +// System.out.println(1/0); return negativeHistoryService.save(history); } 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 33a7e2d..91412b6 100644 --- a/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java @@ -70,7 +70,12 @@ public class ApplyCompletionAction implements Action { .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) - .set(Negative::getVerifyTime, LocalDateTime.now()); + .set(Negative::getVerifyTime, LocalDateTime.now()) + // 设置审批开始时间 + // 二级审批开始时间:isSecondHandle=false(3级提交本级办理)时设置, 如果不是二级办理,此时是提交到二级,需要记录二级审批开始时间 + .set(Negative::getSecondApproveStartTime, negative.getIsSecondHandle() ? null : LocalDateTime.now()) + // 市局审批开始时间:isSecondHandle=true(2级提交本级办理)时设置,如果是二级办理,此时是提交到市局,需要记录市局审批开始时间 + .set(Negative::getFirstApproveStartTime, negative.getIsSecondHandle() ? LocalDateTime.now() : null); negativeService.update(updateWrapper); } diff --git a/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java b/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java index ead16c8..df09bb5 100644 --- a/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java @@ -20,6 +20,8 @@ import org.springframework.stereotype.Component; import java.time.LocalDateTime; import java.util.List; +import com.biutag.supervision.util.TimeUtil; + /** * @author wxc * @date 2024/11/8 @@ -98,6 +100,8 @@ public class ConfirmationCompletionAction implements Action { } public void updateNegative(String negativeId, ConfirmationCompletionData completionData) { + Negative negative = negativeService.getById(negativeId); + LocalDateTime now = LocalDateTime.now(); LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() .eq(Negative::getId, negativeId) .set(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()) @@ -107,7 +111,24 @@ public class ConfirmationCompletionAction implements Action { .set(StrUtil.isNotEmpty(completionData.getReportId()),Negative::getReportId,completionData.getReportId()) .set(StrUtil.isNotEmpty(completionData.getReportNumber()),Negative::getReportNumber,completionData.getReportNumber()) .set(Negative::getFlowKey, FlowNodeEnum.COMPLETED.getKey()) - .set(Negative::getUpdTime, LocalDateTime.now()); + .set(Negative::getUpdTime, now); + + // 计算并累加市局审批时长(仅三级审批流程) + if (FlowNodeEnum.FIRST_APPROVE.getKey().equals(negative.getFlowKey()) + && negative.getFirstApproveStartTime() != null) { + long currentDuration = TimeUtil.calculateWorkdayDuration(negative.getFirstApproveStartTime(), now); + long accumulatedDuration = (negative.getFirstApproveDuration() == null ? 0 : negative.getFirstApproveDuration()) + currentDuration; + updateWrapper.set(Negative::getFirstApproveDuration, accumulatedDuration); + } + + // 计算并累加二级审批时长 + if (FlowNodeEnum.SECOND_APPROVE.getKey().equals(negative.getFlowKey()) + && negative.getSecondApproveStartTime() != null) { + long currentDuration = TimeUtil.calculateWorkdayDuration(negative.getSecondApproveStartTime(), now); + long accumulatedDuration = (negative.getSecondApproveDuration() == null ? 0 : negative.getSecondApproveDuration()) + currentDuration; + updateWrapper.set(Negative::getSecondApproveDuration, accumulatedDuration); + } + negativeService.update(updateWrapper); } public void doneWork(Integer workId, String negativeId) { diff --git a/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java b/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java index 80b39b1..b59b416 100644 --- a/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java @@ -44,11 +44,14 @@ public class FirstApproveReturnAction implements Action { public void updateNegative(String negativeId, String nextFlowKey) { Negative negative = negativeService.getById(negativeId); + LocalDateTime now = LocalDateTime.now(); negativeService.update(new LambdaUpdateWrapper() .set(Negative::getFlowKey, negative.getIsSecondHandle() ? FlowNodeEnum.VERIFY.getKey() : nextFlowKey) - .set(Negative::getUpdTime, LocalDateTime.now()) + .set(Negative::getUpdTime, now) // 当前处理对象 .set(Negative::getCurrentProcessingObject, String.format("%s专班", negative.getHandleSecondDepartName())) + // 退回整改后,重新设置二级审批开始时间,下次二级审批完成后继续累加 + .set(Negative::getSecondApproveStartTime, now) .eq(Negative::getId, negativeId)); } diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java index 000916a..0849d15 100644 --- a/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java @@ -20,6 +20,8 @@ import org.springframework.stereotype.Component; import java.time.LocalDateTime; +import com.biutag.supervision.util.TimeUtil; + /** * 二级机构审批通过 */ @@ -50,18 +52,30 @@ public class SecondApproveAction implements Action { } public void updateNegative(String negativeId, String nextFlowKey) { + Negative negative = negativeService.getById(negativeId); + LocalDateTime now = LocalDateTime.now(); LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() .set(Negative::getFlowKey, nextFlowKey) .set(Negative::getUpdTime, LocalDateTime.now()) .eq(Negative::getId, negativeId); - Negative negative = negativeService.getById(negativeId); + + // 计算并累加二级审批时长 + if (negative.getSecondApproveStartTime() != null) { + long currentDuration = TimeUtil.calculateWorkdayDuration(negative.getSecondApproveStartTime(), now); + + long accumulatedDuration = (negative.getSecondApproveDuration() == null ? 0 : negative.getSecondApproveDuration()) + currentDuration; + updateWrapper.set(Negative::getSecondApproveDuration, accumulatedDuration); + } + if (ApprovalFlowEnum.SECOND_APPROVAL.getValue().equals(negative.getApprovalFlow())) { updateWrapper.set(Negative::getFlowKey, FlowNodeEnum.COMPLETED.getKey()) .set(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()) - .set(Negative::getCompleteDate, LocalDateTime.now()); + .set(Negative::getCompleteDate, now); } else { updateWrapper.set(Negative::getFlowKey, nextFlowKey) - .set(Negative::getCurrentProcessingObject, "市局专班"); + .set(Negative::getCurrentProcessingObject, "市局专班") + // 二级审批通过后流转到市局审批,设置市局审批开始时间 + .set(Negative::getFirstApproveStartTime, LocalDateTime.now()); } negativeService.update(updateWrapper); } diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java index d22f116..b543ea7 100644 --- a/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java @@ -51,6 +51,8 @@ public class SecondApproveReturnAction implements Action { .set(Negative::getProcessingStatus, ProcessingStatusEnum.processing.name()) // 当前处理对象 .set(Negative::getCurrentProcessingObject, String.format("%s专班", negative.getHandleThreeDepartName())) + // 退回整改后,重新设置二级审批开始时间,下次二级审批完成后继续累加 + .set(Negative::getSecondApproveStartTime, LocalDateTime.now()) .eq(Negative::getId, negativeId)); } 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 dc8114f..ce5a777 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/Negative.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/Negative.java @@ -370,4 +370,41 @@ public class Negative { @Schema(description = "下发单位名字") @TableField("issuingDepartName") private String issuingDepartName; + + // ==================== 审批时长统计字段 ==================== + + /** + * 二级审批开始时间(最近一次开始审批的时间) + * 触发条件:isSecondHandle=false 且 3级提交后 + */ + @Schema(description = "二级审批开始时间") + @TableField("second_approve_start_time") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime secondApproveStartTime; + + /** + * 二级审批累计时长(秒) + * 累加规则:每次二级审批完成(包括通过/退回)后累加 + * 不计入:本级办理不计入 + */ + @Schema(description = "二级审批累计时长(秒)") + @TableField("second_approve_duration") + private Long secondApproveDuration; + + /** + * 市局审批开始时间(最近一次开始审批的时间) + * 触发条件:approvalFlow="3" 且 2级提交后 + */ + @Schema(description = "市局审批开始时间") + @TableField("first_approve_start_time") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime firstApproveStartTime; + + /** + * 市局审批累计时长(秒) + * 累加规则:每次市局审批完成(包括通过/退回)后累加 + */ + @Schema(description = "市局审批累计时长(秒)") + @TableField("first_approve_duration") + private Long firstApproveDuration; } diff --git a/src/main/java/com/biutag/supervision/util/TimeUtil.java b/src/main/java/com/biutag/supervision/util/TimeUtil.java index 2a0019d..1adfeaa 100644 --- a/src/main/java/com/biutag/supervision/util/TimeUtil.java +++ b/src/main/java/com/biutag/supervision/util/TimeUtil.java @@ -109,4 +109,35 @@ public class TimeUtil { public static String formatDate(Date date) { return new SimpleDateFormat("yyyy年MM月dd日").format(date); } + + + /** + * 计算两个时间之间的工作日时长(秒) + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return 工作日时长(秒) + */ + public static long calculateWorkdayDuration(LocalDateTime beginTime, LocalDateTime endTime) { + if (Objects.isNull(beginTime) || Objects.isNull(endTime)) { + return 0; + } + HolidayService holidayService = SpringUtil.getBean(HolidayService.class); + long duration = 0; + for (LocalDateTime time = beginTime; time.isBefore(endTime.with(LocalTime.MAX)); time = time.plusDays(1)) { + if (holidayService.isHoliday(DatePattern.NORM_DATE_FORMATTER.format(time))) { + continue; + } + if (beginTime.toLocalDate().equals(endTime.toLocalDate())) { + duration += ChronoUnit.SECONDS.between(beginTime, endTime); + } else if (time.equals(beginTime)) { + duration += ChronoUnit.SECONDS.between(time, time.with(LocalTime.MAX)); + } else if (time.toLocalDate().equals(endTime.toLocalDate())) { + duration += ChronoUnit.SECONDS.between(time.with(LocalTime.MIN), endTime); + } else { + duration += SECONDS_OF_A_DAY; + } + } + return duration; + } + } From afc0140d258eafe12aad2faf93b3311f22a3bf7d Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Wed, 1 Apr 2026 18:33:05 +0800 Subject: [PATCH 02/16] =?UTF-8?q?fix:=E5=88=A0=E9=99=A4=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/biutag/supervision/flow/FlowService.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/biutag/supervision/flow/FlowService.java b/src/main/java/com/biutag/supervision/flow/FlowService.java index 78f81ce..efa9c64 100644 --- a/src/main/java/com/biutag/supervision/flow/FlowService.java +++ b/src/main/java/com/biutag/supervision/flow/FlowService.java @@ -74,7 +74,6 @@ public class FlowService { } catch (RuntimeException e) { history.setCrtName("模型超市"); } -// System.out.println(1/0); return negativeHistoryService.save(history); } From f5da13af72cd2b904dbe22e11a5364d325ec3526 Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Thu, 2 Apr 2026 00:48:19 +0800 Subject: [PATCH 03/16] =?UTF-8?q?fix:=E9=87=8D=E6=96=B0=E5=89=A5=E7=A6=BB?= =?UTF-8?q?=E5=87=BA=E5=AE=A1=E6=89=B9=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flow/action/ApplyCompletionAction.java | 30 +++++++++++++++- .../action/ConfirmationCompletionAction.java | 27 ++++++++++++++ .../flow/action/FirstApproveReturnAction.java | 22 ++++++++++++ .../flow/action/SecondApproveAction.java | 29 +++++++++++++-- .../action/SecondApproveReturnAction.java | 17 +++++++++ .../supervision/pojo/entity/Negative.java | 36 +++++++++++++++++++ .../com/biutag/supervision/util/TimeUtil.java | 31 ++++++++++++++++ 7 files changed, 189 insertions(+), 3 deletions(-) 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 33a7e2d..b285cf3 100644 --- a/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java @@ -70,7 +70,35 @@ public class ApplyCompletionAction implements Action { .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) - .set(Negative::getVerifyTime, LocalDateTime.now()); + .set(Negative::getVerifyTime, LocalDateTime.now()) + // 【审批时长统计】3级专班提交时,设置2级审批开始时间 + // 触发条件:isSecondHandle=false(3级提交案件,需要2级审批) + // 设置时机:任务从3级流转到2级时(2级待审批任务创建时) + // 业务含义:2级开始审批的计时起点,不是2级打开待办的时间 + // 后续使用:SecondApproveAction 计算(T1-T0)时长,SecondApproveReturnAction 退回时也计算时长 + .set(negative.getIsSecondHandle() == false, Negative::getSecondApproveStartTime, LocalDateTime.now()) + // 【审批时长统计】二级本级办理时,设置市局审批开始时间 + // 触发条件:isSecondHandle=true(本级办理)且 approvalFlow="3"(需要市局审批) + // 设置时机:二级本级办理提交到市局时 + // 后续使用:ConfirmationCompletionAction 计算市局审批时长,FirstApproveReturnAction 退回时也计算时长 + .set(negative.getIsSecondHandle() == true && ApprovalFlowEnum.THREE_APPROVAL.getValue().equals(negative.getApprovalFlow()), + Negative::getFirstApproveStartTime, LocalDateTime.now()); + // todo 如果 是二级办理,并且从市局退回后,二级重新办理的时间算审批时间的话 + // 【审批时长统计】本级办理场景:市局退回后整改提交时,累加二级整改时长 + // 触发条件:isSecondHandle=true 且 approvalFlow="3" 且 secondApproveStartTime != null + // 计算逻辑:(当前时间 - secondApproveStartTime),累加到 secondApproveDuration + // 业务含义:市局退回后,二级整改并重新提交的总时长 + // if (negative.getIsSecondHandle() == true && + // ApprovalFlowEnum.THREE_APPROVAL.getValue().equals(negative.getApprovalFlow()) && + // negative.getSecondApproveStartTime() != null) { + // LocalDateTime now = LocalDateTime.now(); + // long duration = TimeUtil.calculateWorkdayDuration(negative.getSecondApproveStartTime(), now); + // Long totalDuration = negative.getSecondApproveDuration() == null ? duration : negative.getSecondApproveDuration() + duration; + // negativeService.update(new LambdaUpdateWrapper() + // .eq(Negative::getId, negative.getId()) + // .set(Negative::getSecondApproveDuration, totalDuration) + // .set(Negative::getSecondApproveStartTime, null)); + // } negativeService.update(updateWrapper); } diff --git a/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java b/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java index ead16c8..a66ee2a 100644 --- a/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java @@ -14,6 +14,7 @@ import com.biutag.supervision.pojo.entity.NegativeScorePolice; import com.biutag.supervision.pojo.entity.NegativeWork; import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.service.*; +import com.biutag.supervision.util.TimeUtil; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -98,6 +99,32 @@ public class ConfirmationCompletionAction implements Action { } public void updateNegative(String negativeId, ConfirmationCompletionData completionData) { + Negative negative = negativeService.getById(negativeId); + LocalDateTime now = LocalDateTime.now(); + + // 【审批时长统计】计算市局审批时长并累加 + // 计算范围:firstApproveStartTime(市局开始审批时设置)到 now(当前办结时间) + // 触发时机:市局点击【审批通过】完成办结时 + // 累加规则:duration += (当前时间 - 开始时间) + // 注意事项:二级审批流程(approvalFlow="2")时,firstApproveStartTime 为null,不会进入此逻辑 + if (negative.getFirstApproveStartTime() != null) { + long duration = TimeUtil.calculateWorkdayDuration(negative.getFirstApproveStartTime(), now); + Long totalDuration = negative.getFirstApproveDuration() == null ? duration : negative.getFirstApproveDuration() + duration; + negativeService.update(new LambdaUpdateWrapper() + .eq(Negative::getId, negativeId) + .set(Negative::getFirstApproveDuration, totalDuration) + .set(Negative::getFirstApproveStartTime, null)); + } + if (negative.getSecondApproveStartTime() != null) { + long duration = TimeUtil.calculateWorkdayDuration(negative.getSecondApproveStartTime(), now); + Long totalDuration = negative.getSecondApproveDuration() == null ? duration : negative.getSecondApproveDuration() + duration; + negativeService.update(new LambdaUpdateWrapper() + .eq(Negative::getId, negativeId) + .set(Negative::getSecondApproveDuration, totalDuration) + .set(Negative::getSecondApproveStartTime, null)); + } + + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() .eq(Negative::getId, negativeId) .set(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()) diff --git a/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java b/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java index 80b39b1..894c5a6 100644 --- a/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java @@ -14,6 +14,7 @@ import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.service.NegativeApproveService; import com.biutag.supervision.service.NegativeService; import com.biutag.supervision.service.NegativeWorkService; +import com.biutag.supervision.util.TimeUtil; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -44,11 +45,32 @@ public class FirstApproveReturnAction implements Action { public void updateNegative(String negativeId, String nextFlowKey) { Negative negative = negativeService.getById(negativeId); + LocalDateTime now = LocalDateTime.now(); + + // 【审批时长统计】计算市局审批时长并累加,然后重置开始时间 + // 计算范围:firstApproveStartTime(市局开始审批时设置)到 now(当前退回时间) + // 触发时机:市局点击【退回整改】时(退回也是一种审批操作) + // 累加规则:duration += (当前时间 - 开始时间) + // 重置说明:退回后任务回到2级,firstApproveStartTime设为null + if (negative.getFirstApproveStartTime() != null) { + long duration = TimeUtil.calculateWorkdayDuration(negative.getFirstApproveStartTime(), now); + Long totalDuration = negative.getFirstApproveDuration() == null ? duration : negative.getFirstApproveDuration() + duration; + negativeService.update(new LambdaUpdateWrapper() + .eq(Negative::getId, negativeId) + .set(Negative::getFirstApproveDuration, totalDuration) + .set(Negative::getFirstApproveStartTime, null)); + } + + // 【审批时长统计】市局退回后任务回到2级,需要重新设置2级审批开始时间 + // 设置时机:市局退回操作完成后,2级待审批任务重新激活时 + // 业务含义:2级重新开始审批的计时起点 + // 后续使用:SecondApproveAction/SecondApproveReturnAction 中计算新一轮2级审批时长 negativeService.update(new LambdaUpdateWrapper() .set(Negative::getFlowKey, negative.getIsSecondHandle() ? FlowNodeEnum.VERIFY.getKey() : nextFlowKey) .set(Negative::getUpdTime, LocalDateTime.now()) // 当前处理对象 .set(Negative::getCurrentProcessingObject, String.format("%s专班", negative.getHandleSecondDepartName())) + .set(Negative::getSecondApproveStartTime, LocalDateTime.now()) .eq(Negative::getId, negativeId)); } diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java index 000916a..c1f5949 100644 --- a/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java @@ -15,6 +15,7 @@ import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.service.NegativeApproveService; import com.biutag.supervision.service.NegativeService; import com.biutag.supervision.service.NegativeWorkService; +import com.biutag.supervision.util.TimeUtil; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -50,18 +51,42 @@ public class SecondApproveAction implements Action { } public void updateNegative(String negativeId, String nextFlowKey) { + Negative negative = negativeService.getById(negativeId); + LocalDateTime now = LocalDateTime.now(); + + // 【审批时长统计】计算2级审批时长并累加 + // 计算范围:secondApproveStartTime(3级提交时设置)到 now(当前审批时间) + // 触发时机:2级点击【审批通过】或【退回整改】时 + // 累加规则:duration += (当前时间 - 开始时间),退回后再审批会继续累加 + // 注意事项:本级办理(isSecondHandle=true)时,secondApproveStartTime 为null,不会进入此逻辑 + if (negative.getSecondApproveStartTime() != null) { + long duration = TimeUtil.calculateWorkdayDuration(negative.getSecondApproveStartTime(), now); + Long totalDuration = negative.getSecondApproveDuration() == null ? duration : negative.getSecondApproveDuration() + duration; + negativeService.update(new LambdaUpdateWrapper() + .eq(Negative::getId, negativeId) + .set(Negative::getSecondApproveDuration, totalDuration) + .set(Negative::getSecondApproveStartTime, null)); + } + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() .set(Negative::getFlowKey, nextFlowKey) .set(Negative::getUpdTime, LocalDateTime.now()) .eq(Negative::getId, negativeId); - Negative negative = negativeService.getById(negativeId); +// Negative negative = negativeService.getById(negativeId); if (ApprovalFlowEnum.SECOND_APPROVAL.getValue().equals(negative.getApprovalFlow())) { + // 二级审批流程,直接办结(无需市局审批,不设置firstApproveStartTime) updateWrapper.set(Negative::getFlowKey, FlowNodeEnum.COMPLETED.getKey()) .set(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()) .set(Negative::getCompleteDate, LocalDateTime.now()); } else { + // 【审批时长统计】三级审批流程,设置市局审批开始时间 + // 触发条件:approvalFlow="3"(三级审批),且2级审批通过 + // 设置时机:2级提交到市局时(市局待审批任务创建时) + // 业务含义:市局开始审批的计时起点 + // 后续使用:ConfirmationCompletionAction 计算市局审批时长,FirstApproveReturnAction 退回时也计算时长 updateWrapper.set(Negative::getFlowKey, nextFlowKey) - .set(Negative::getCurrentProcessingObject, "市局专班"); + .set(Negative::getCurrentProcessingObject, "市局专班") + .set(Negative::getFirstApproveStartTime, now); } negativeService.update(updateWrapper); } diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java index d22f116..d50e60f 100644 --- a/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java @@ -15,6 +15,7 @@ import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.service.NegativeApproveService; import com.biutag.supervision.service.NegativeService; import com.biutag.supervision.service.NegativeWorkService; +import com.biutag.supervision.util.TimeUtil; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -45,6 +46,22 @@ public class SecondApproveReturnAction implements Action { public void updateNegative(String negativeId, String nextFlowKey) { Negative negative = negativeService.getById(negativeId); + LocalDateTime now = LocalDateTime.now(); + + // 【审批时长统计】计算2级审批时长并累加,然后重置开始时间 + // 计算范围:secondApproveStartTime(3级提交时设置)到 now(当前退回时间) + // 触发时机:2级点击【退回整改】时(退回也是一种审批操作) + // 累加规则:duration += (当前时间 - 开始时间) + // 重置说明:退回后任务回到3级,secondApproveStartTime设为null,等待3级重新提交时再设置 + if (negative.getSecondApproveStartTime() != null) { + long duration = TimeUtil.calculateWorkdayDuration(negative.getSecondApproveStartTime(), now); + Long totalDuration = negative.getSecondApproveDuration() == null ? duration : negative.getSecondApproveDuration() + duration; + negativeService.update(new LambdaUpdateWrapper() + .eq(Negative::getId, negativeId) + .set(Negative::getSecondApproveDuration, totalDuration) + .set(Negative::getSecondApproveStartTime, null)); + } + negativeService.update(new LambdaUpdateWrapper() .set(Negative::getFlowKey, nextFlowKey) .set(Negative::getUpdTime, LocalDateTime.now()) 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 dc8114f..af3bdc1 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/Negative.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/Negative.java @@ -370,4 +370,40 @@ public class Negative { @Schema(description = "下发单位名字") @TableField("issuingDepartName") private String issuingDepartName; + + /** + * 2级审批开始时间 + * 设置时机:3级专班提交时(ApplyCompletionAction),或市局退回后任务回到2级时(FirstApproveReturnAction) + * 重置时机:2级审批完成或退回时(SecondApproveAction/SecondApproveReturnAction) + * 用途:计算2级审批累计时长 + */ + @TableField("second_approve_start_time") + private LocalDateTime secondApproveStartTime; + + /** + * 2级审批累计时长(秒) + * 计算公式:每次2级审批完成时累加 duration += (当前时间 - secondApproveStartTime) + * 包含场景:正常审批时长 + 退回后再审批时长 + * 不包含:本级办理(isSecondHandle=true) + */ + @TableField("second_approve_duration") + private Long secondApproveDuration; + + /** + * 市局审批开始时间 + * 设置时机:2级提交到市局时(SecondApproveAction) + * 重置时机:市局审批完成或退回时(ConfirmationCompletionAction/FirstApproveReturnAction) + * 用途:计算市局审批累计时长 + */ + @TableField("first_approve_start_time") + private LocalDateTime firstApproveStartTime; + + /** + * 市局审批累计时长(秒) + * 计算公式:每次市局审批完成时累加 duration += (当前时间 - firstApproveStartTime) + * 包含场景:正常审批时长 + 退回后再审批时长 + * 不包含:二级审批流程(approvalFlow="2") + */ + @TableField("first_approve_duration") + private Long firstApproveDuration; } diff --git a/src/main/java/com/biutag/supervision/util/TimeUtil.java b/src/main/java/com/biutag/supervision/util/TimeUtil.java index 2a0019d..1adfeaa 100644 --- a/src/main/java/com/biutag/supervision/util/TimeUtil.java +++ b/src/main/java/com/biutag/supervision/util/TimeUtil.java @@ -109,4 +109,35 @@ public class TimeUtil { public static String formatDate(Date date) { return new SimpleDateFormat("yyyy年MM月dd日").format(date); } + + + /** + * 计算两个时间之间的工作日时长(秒) + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return 工作日时长(秒) + */ + public static long calculateWorkdayDuration(LocalDateTime beginTime, LocalDateTime endTime) { + if (Objects.isNull(beginTime) || Objects.isNull(endTime)) { + return 0; + } + HolidayService holidayService = SpringUtil.getBean(HolidayService.class); + long duration = 0; + for (LocalDateTime time = beginTime; time.isBefore(endTime.with(LocalTime.MAX)); time = time.plusDays(1)) { + if (holidayService.isHoliday(DatePattern.NORM_DATE_FORMATTER.format(time))) { + continue; + } + if (beginTime.toLocalDate().equals(endTime.toLocalDate())) { + duration += ChronoUnit.SECONDS.between(beginTime, endTime); + } else if (time.equals(beginTime)) { + duration += ChronoUnit.SECONDS.between(time, time.with(LocalTime.MAX)); + } else if (time.toLocalDate().equals(endTime.toLocalDate())) { + duration += ChronoUnit.SECONDS.between(time.with(LocalTime.MIN), endTime); + } else { + duration += SECONDS_OF_A_DAY; + } + } + return duration; + } + } From 68b11b71934a1c662dae683ad3b893048abd909f Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Thu, 2 Apr 2026 15:28:53 +0800 Subject: [PATCH 04/16] =?UTF-8?q?fix:=E9=87=8D=E6=96=B0=E5=89=A5=E7=A6=BB?= =?UTF-8?q?=E5=87=BA=E5=AE=A1=E6=89=B9=E6=97=B6=E9=97=B4--lastTime?= =?UTF-8?q?=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flow/action/ApplyCompletionAction.java | 3 +- .../action/ConfirmationCompletionAction.java | 10 +++++- .../flow/action/FirstApproveReturnAction.java | 10 +++++- .../flow/action/SecondApproveAction.java | 11 ++++++- .../action/SecondApproveReturnAction.java | 7 +++++ .../supervision/pojo/entity/Negative.java | 28 +++++++++++++++++ .../com/biutag/supervision/util/TimeUtil.java | 31 +++++++++++++++++++ 7 files changed, 96 insertions(+), 4 deletions(-) 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 33a7e2d..c23a097 100644 --- a/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java @@ -70,7 +70,8 @@ public class ApplyCompletionAction implements Action { .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) - .set(Negative::getVerifyTime, LocalDateTime.now()); + .set(Negative::getVerifyTime, LocalDateTime.now()) + .set(Negative::getLatestProcessTime, LocalDateTime.now()); negativeService.update(updateWrapper); } diff --git a/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java b/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java index ead16c8..eb8a468 100644 --- a/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java @@ -14,6 +14,7 @@ import com.biutag.supervision.pojo.entity.NegativeScorePolice; import com.biutag.supervision.pojo.entity.NegativeWork; import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.service.*; +import com.biutag.supervision.util.TimeUtil; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -98,6 +99,12 @@ public class ConfirmationCompletionAction implements Action { } public void updateNegative(String negativeId, ConfirmationCompletionData completionData) { + Negative negative = negativeService.getById(negativeId); + LocalDateTime now = LocalDateTime.now(); + Long firstApproveTime = negative.getFirstApproveTime() == null ? 0L : negative.getFirstApproveTime(); + if (negative.getLatestProcessTime() != null) { + firstApproveTime = firstApproveTime + TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now); + } LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() .eq(Negative::getId, negativeId) .set(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()) @@ -107,7 +114,8 @@ public class ConfirmationCompletionAction implements Action { .set(StrUtil.isNotEmpty(completionData.getReportId()),Negative::getReportId,completionData.getReportId()) .set(StrUtil.isNotEmpty(completionData.getReportNumber()),Negative::getReportNumber,completionData.getReportNumber()) .set(Negative::getFlowKey, FlowNodeEnum.COMPLETED.getKey()) - .set(Negative::getUpdTime, LocalDateTime.now()); + .set(Negative::getUpdTime, LocalDateTime.now()) + .set(Negative::getFirstApproveTime, firstApproveTime); negativeService.update(updateWrapper); } public void doneWork(Integer workId, String negativeId) { diff --git a/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java b/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java index 80b39b1..85d220b 100644 --- a/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java @@ -14,6 +14,7 @@ import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.service.NegativeApproveService; import com.biutag.supervision.service.NegativeService; import com.biutag.supervision.service.NegativeWorkService; +import com.biutag.supervision.util.TimeUtil; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -44,12 +45,19 @@ public class FirstApproveReturnAction implements Action { public void updateNegative(String negativeId, String nextFlowKey) { Negative negative = negativeService.getById(negativeId); + LocalDateTime now = LocalDateTime.now(); + Long firstApproveTime = negative.getFirstApproveTime() == null ? 0L : negative.getFirstApproveTime(); + if (negative.getLatestProcessTime() != null) { + firstApproveTime = firstApproveTime + TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now); + } negativeService.update(new LambdaUpdateWrapper() .set(Negative::getFlowKey, negative.getIsSecondHandle() ? FlowNodeEnum.VERIFY.getKey() : nextFlowKey) .set(Negative::getUpdTime, LocalDateTime.now()) // 当前处理对象 .set(Negative::getCurrentProcessingObject, String.format("%s专班", negative.getHandleSecondDepartName())) - .eq(Negative::getId, negativeId)); + .eq(Negative::getId, negativeId) + .set(Negative::getFirstApproveTime, firstApproveTime) + .set(Negative::getLatestProcessTime, now)); } public void addApprove(String negativeId, String comments, Integer workId) { diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java index 000916a..64e8da7 100644 --- a/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java @@ -15,6 +15,7 @@ import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.service.NegativeApproveService; import com.biutag.supervision.service.NegativeService; import com.biutag.supervision.service.NegativeWorkService; +import com.biutag.supervision.util.TimeUtil; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -50,17 +51,25 @@ public class SecondApproveAction implements Action { } public void updateNegative(String negativeId, String nextFlowKey) { + Negative negative = negativeService.getById(negativeId); + LocalDateTime now = LocalDateTime.now(); + Long secondApprovalTime = negative.getSecondApprovalTime() == null ? 0L : negative.getSecondApprovalTime(); + if (negative.getLatestProcessTime() != null) { + secondApprovalTime = secondApprovalTime + TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now); + } LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() .set(Negative::getFlowKey, nextFlowKey) .set(Negative::getUpdTime, LocalDateTime.now()) + .set(Negative::getSecondApprovalTime, secondApprovalTime) .eq(Negative::getId, negativeId); - Negative negative = negativeService.getById(negativeId); +// Negative negative = negativeService.getById(negativeId); if (ApprovalFlowEnum.SECOND_APPROVAL.getValue().equals(negative.getApprovalFlow())) { updateWrapper.set(Negative::getFlowKey, FlowNodeEnum.COMPLETED.getKey()) .set(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()) .set(Negative::getCompleteDate, LocalDateTime.now()); } else { updateWrapper.set(Negative::getFlowKey, nextFlowKey) + .set(Negative::getLatestProcessTime, now) .set(Negative::getCurrentProcessingObject, "市局专班"); } negativeService.update(updateWrapper); diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java index d22f116..5ac468d 100644 --- a/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java @@ -15,6 +15,7 @@ import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.service.NegativeApproveService; import com.biutag.supervision.service.NegativeService; import com.biutag.supervision.service.NegativeWorkService; +import com.biutag.supervision.util.TimeUtil; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -45,12 +46,18 @@ public class SecondApproveReturnAction implements Action { public void updateNegative(String negativeId, String nextFlowKey) { Negative negative = negativeService.getById(negativeId); + LocalDateTime now = LocalDateTime.now(); + Long secondApprovalTime = negative.getSecondApprovalTime() == null ? 0L : negative.getSecondApprovalTime(); + if (negative.getLatestProcessTime() != null) { + secondApprovalTime = secondApprovalTime + TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now); + } negativeService.update(new LambdaUpdateWrapper() .set(Negative::getFlowKey, nextFlowKey) .set(Negative::getUpdTime, LocalDateTime.now()) .set(Negative::getProcessingStatus, ProcessingStatusEnum.processing.name()) // 当前处理对象 .set(Negative::getCurrentProcessingObject, String.format("%s专班", negative.getHandleThreeDepartName())) + .set(Negative::getSecondApprovalTime, secondApprovalTime) .eq(Negative::getId, negativeId)); } 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 dc8114f..7a6d081 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/Negative.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/Negative.java @@ -370,4 +370,32 @@ public class Negative { @Schema(description = "下发单位名字") @TableField("issuingDepartName") private String issuingDepartName; + + /** + * 2级审批开始时间 + * 设置时机:3级专班提交时(ApplyCompletionAction),或市局退回后任务回到2级时(FirstApproveReturnAction) + * 重置时机:2级审批完成或退回时(SecondApproveAction/SecondApproveReturnAction) + * 用途:计算2级审批累计时长 + */ + @TableField("latest_process_time") + private LocalDateTime latestProcessTime; + + /** + * 2级审批累计时长(秒) + * 计算公式:每次2级审批完成时累加 duration += (当前时间 - secondApproveStartTime) + * 包含场景:正常审批时长 + 退回后再审批时长 + * 不包含:本级办理(isSecondHandle=true) + */ + @TableField("second_approval_time") + private Long secondApprovalTime; + + + /** + * 市局审批累计时长(秒) + * 计算公式:每次市局审批完成时累加 duration += (当前时间 - firstApproveStartTime) + * 包含场景:正常审批时长 + 退回后再审批时长 + * 不包含:二级审批流程(approvalFlow="2") + */ + @TableField("first_approve_time") + private Long firstApproveTime; } diff --git a/src/main/java/com/biutag/supervision/util/TimeUtil.java b/src/main/java/com/biutag/supervision/util/TimeUtil.java index 2a0019d..1adfeaa 100644 --- a/src/main/java/com/biutag/supervision/util/TimeUtil.java +++ b/src/main/java/com/biutag/supervision/util/TimeUtil.java @@ -109,4 +109,35 @@ public class TimeUtil { public static String formatDate(Date date) { return new SimpleDateFormat("yyyy年MM月dd日").format(date); } + + + /** + * 计算两个时间之间的工作日时长(秒) + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return 工作日时长(秒) + */ + public static long calculateWorkdayDuration(LocalDateTime beginTime, LocalDateTime endTime) { + if (Objects.isNull(beginTime) || Objects.isNull(endTime)) { + return 0; + } + HolidayService holidayService = SpringUtil.getBean(HolidayService.class); + long duration = 0; + for (LocalDateTime time = beginTime; time.isBefore(endTime.with(LocalTime.MAX)); time = time.plusDays(1)) { + if (holidayService.isHoliday(DatePattern.NORM_DATE_FORMATTER.format(time))) { + continue; + } + if (beginTime.toLocalDate().equals(endTime.toLocalDate())) { + duration += ChronoUnit.SECONDS.between(beginTime, endTime); + } else if (time.equals(beginTime)) { + duration += ChronoUnit.SECONDS.between(time, time.with(LocalTime.MAX)); + } else if (time.toLocalDate().equals(endTime.toLocalDate())) { + duration += ChronoUnit.SECONDS.between(time.with(LocalTime.MIN), endTime); + } else { + duration += SECONDS_OF_A_DAY; + } + } + return duration; + } + } From 2d0040c4398ecb00a2c82b170428f28661ab387f Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Thu, 2 Apr 2026 15:30:53 +0800 Subject: [PATCH 05/16] =?UTF-8?q?fix:=E6=B3=A8=E9=87=8A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/biutag/supervision/pojo/entity/Negative.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) 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 7a6d081..31f8772 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/Negative.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/Negative.java @@ -372,19 +372,13 @@ public class Negative { private String issuingDepartName; /** - * 2级审批开始时间 - * 设置时机:3级专班提交时(ApplyCompletionAction),或市局退回后任务回到2级时(FirstApproveReturnAction) - * 重置时机:2级审批完成或退回时(SecondApproveAction/SecondApproveReturnAction) - * 用途:计算2级审批累计时长 + * 最后一次审批节点操作时间 */ @TableField("latest_process_time") private LocalDateTime latestProcessTime; /** * 2级审批累计时长(秒) - * 计算公式:每次2级审批完成时累加 duration += (当前时间 - secondApproveStartTime) - * 包含场景:正常审批时长 + 退回后再审批时长 - * 不包含:本级办理(isSecondHandle=true) */ @TableField("second_approval_time") private Long secondApprovalTime; @@ -392,9 +386,6 @@ public class Negative { /** * 市局审批累计时长(秒) - * 计算公式:每次市局审批完成时累加 duration += (当前时间 - firstApproveStartTime) - * 包含场景:正常审批时长 + 退回后再审批时长 - * 不包含:二级审批流程(approvalFlow="2") */ @TableField("first_approve_time") private Long firstApproveTime; From d6b5171c8e3328c539c3a07633a352862beb1902 Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Thu, 2 Apr 2026 15:57:36 +0800 Subject: [PATCH 06/16] =?UTF-8?q?feat=EF=BC=9A=E5=89=8D=E7=AB=AF=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=AE=A1=E6=89=B9=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supervision/pojo/vo/NegativeQueryVo.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/com/biutag/supervision/pojo/vo/NegativeQueryVo.java b/src/main/java/com/biutag/supervision/pojo/vo/NegativeQueryVo.java index 466e481..62a8e66 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/NegativeQueryVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/NegativeQueryVo.java @@ -212,4 +212,18 @@ public class NegativeQueryVo { @Schema(description = "二级部门ID") private String secondInvolveDepartId; + + @Schema(description = "最后一次审批节点操作时间") + @TableField("latest_process_time") + private LocalDateTime latestProcessTime; + + @Schema(description = "2级审批累计时长(秒)") + @TableField("second_approval_time") + private Long secondApprovalTime; + + + @Schema(description = "市局审批累计时长(秒)") + @TableField("first_approve_time") + private Long firstApproveTime; + } From 9b4f30c0db13c9b5a8d6adbc6aefda95f4ebcc03 Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Thu, 2 Apr 2026 16:24:46 +0800 Subject: [PATCH 07/16] =?UTF-8?q?feat=EF=BC=9A=E5=AF=BC=E5=87=BA=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E5=8A=A0=E4=B8=8A=E5=AE=A1=E6=89=B9=E7=94=A8=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supervision/pojo/vo/ExportNegativeVo.java | 9 ++++ .../service/NegativeTaskService.java | 3 ++ .../com/biutag/supervision/util/TimeUtil.java | 42 +++++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeVo.java b/src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeVo.java index d527fc4..13398f0 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeVo.java @@ -132,4 +132,13 @@ public class ExportNegativeVo { @ExcelProperty({"","办理超时情况"}) private String handleTimeout; + + @ExcelProperty({"核办情况","分局审批时长"}) + private String secondApprovalTime; + + // 问题类型 + @ExcelProperty({"核办情况","市局审批时长"}) + private String firstApproveTime; + + } diff --git a/src/main/java/com/biutag/supervision/service/NegativeTaskService.java b/src/main/java/com/biutag/supervision/service/NegativeTaskService.java index 068addd..21b5a8f 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeTaskService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeTaskService.java @@ -24,6 +24,7 @@ import com.biutag.supervision.pojo.vo.ExportNegativeBlameLeaderVo; import com.biutag.supervision.pojo.vo.ExportNegativeBlameVo; import com.biutag.supervision.pojo.vo.ExportNegativeVo; import com.biutag.supervision.pojo.vo.NegativeQueryVo; +import com.biutag.supervision.util.TimeUtil; import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; import org.springframework.scheduling.annotation.Async; @@ -204,6 +205,8 @@ public class NegativeTaskService extends ServiceImpl 0 表示剩余时间,diff < 0 表示超出时间 + if (diff >= 0) { + return "未超时/" + formatDuration(diff); + } else { + return "已超时/" + formatDuration(-diff); + } + } + } From 3b2bcbf1617008b4029fe68f14ef529bdea76bed Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Thu, 2 Apr 2026 17:43:59 +0800 Subject: [PATCH 08/16] =?UTF-8?q?fix--=E5=BE=85=E5=8A=9E=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/biutag/supervision/service/NegativeWorkService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/biutag/supervision/service/NegativeWorkService.java b/src/main/java/com/biutag/supervision/service/NegativeWorkService.java index 2c52bd2..3e90d98 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeWorkService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeWorkService.java @@ -38,9 +38,9 @@ public class NegativeWorkService extends ServiceImpl page(NegativeQueryParam param, String workStatus) { UserAuth user = UserContextHolder.getCurrentUser(); -// if (user.getRoleCodes().isEmpty() || user.getAuthDepartIds().isEmpty() || user.getAuthSources().isEmpty()) { -// return new Page().setTotal(0).setRecords(new ArrayList<>()); -// } + if (user.getRoleCodes().isEmpty() || user.getAuthDepartIds().isEmpty() || user.getAuthSources().isEmpty()) { + return new Page().setTotal(0).setRecords(new ArrayList<>()); + } QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.in("w.role_code", user.getRoleCodes()) .in("w.depart_id", user.getAuthDepartIds()) From 7d2626cfcc07ba2d9b9914050ff35e9eaa9f5424 Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Thu, 2 Apr 2026 17:51:03 +0800 Subject: [PATCH 09/16] =?UTF-8?q?feat:=E6=9F=A5=E8=AF=A2=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=E8=B6=85=E6=97=B6=E6=9D=A1=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pojo/param/NegativeQueryParam.java | 4 +++ .../service/NegativeQueryService.java | 31 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java index 4569db6..a6cc988 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java @@ -117,6 +117,9 @@ public class NegativeQueryParam extends BasePage { @TableField("issuingDepartName") private String issuingDepartName; + @Schema(description = "审批超时状态集合: city_timeout/city_normal/branch_timeout/branch_normal") + private List approvalTimeoutStatus; + private UserAuth currentUser; @@ -135,6 +138,7 @@ public class NegativeQueryParam extends BasePage { target.setThreeLevelCode(this.threeLevelCode == null ? null : new ArrayList<>(this.threeLevelCode)); target.setProblemSourcesCode(this.problemSourcesCode == null ? null : new ArrayList<>(this.problemSourcesCode)); target.setInvolveDepartIds(this.involveDepartIds == null ? null : Set.copyOf(this.involveDepartIds)); + target.setApprovalTimeoutStatus(this.approvalTimeoutStatus == null ? null : new ArrayList<>(this.approvalTimeoutStatus)); return target; } diff --git a/src/main/java/com/biutag/supervision/service/NegativeQueryService.java b/src/main/java/com/biutag/supervision/service/NegativeQueryService.java index bd1f51c..e42a42a 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeQueryService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeQueryService.java @@ -204,6 +204,20 @@ public class NegativeQueryService { ); queryWrapper.in(Negative::getProcessingStatus,List.of("completed", "approval")); } + // 审批超时查询(支持多选) + if (CollectionUtil.isNotEmpty(param.getApprovalTimeoutStatus())) { + queryWrapper.and(wrapper -> { + List statuses = param.getApprovalTimeoutStatus(); + for (int i = 0; i < statuses.size(); i++) { + String status = statuses.get(i); + if (i == 0) { + wrapper.and(q -> buildTimeoutCondition(q, status)); + } else { + wrapper.or(q -> buildTimeoutCondition(q, status)); + } + } + }); + } // 排序 queryWrapper.orderBy("crtTime".equals(param.getOrderProp()), OrderEnum.ascending.name().equals(param.getOrder()), Negative::getCrtTime) .orderBy("discoveryTime".equals(param.getOrderProp()), OrderEnum.ascending.name().equals(param.getOrder()), Negative::getDiscoveryTime);; @@ -223,4 +237,21 @@ public class NegativeQueryService { return new Page().setRecords(list).setTotal(page.getTotal()); } + private void buildTimeoutCondition(LambdaQueryWrapper queryWrapper, String status) { + switch (status) { + case "city_timeout": + queryWrapper.gt(Negative::getFirstApproveTime, TimeUtil.SECONDS_OF_A_DAY); + break; + case "city_normal": + queryWrapper.le(Negative::getFirstApproveTime, TimeUtil.SECONDS_OF_A_DAY).or().isNull(Negative::getFirstApproveTime); + break; + case "branch_timeout": + queryWrapper.gt(Negative::getSecondApprovalTime, TimeUtil.SECONDS_OF_A_DAY); + break; + case "branch_normal": + queryWrapper.le(Negative::getSecondApprovalTime, TimeUtil.SECONDS_OF_A_DAY).or().isNull(Negative::getSecondApprovalTime); + break; + } + } + } From 6691407b919e73a7169ef89ec3f79dc1a053c42d Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Thu, 2 Apr 2026 17:55:31 +0800 Subject: [PATCH 10/16] =?UTF-8?q?fix:=E8=A7=86=E9=A2=91=E7=9D=A3=E5=AF=9F?= =?UTF-8?q?=E6=9F=A5=E5=AE=9E=E9=97=AE=E9=A2=98=E6=95=B0=E5=8F=96=E5=8A=9E?= =?UTF-8?q?=E7=BB=93=E5=90=8E=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supervision/service/datav/DatavServiceImpl.java | 10 ++++++---- .../service/subDatav/SubDatavServiceImpl.java | 11 ++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java b/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java index 312a039..e2e9832 100644 --- a/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java @@ -421,15 +421,16 @@ public class DatavServiceImpl implements DatavService { negativeQueryParam.setProblemSourcesCode(List.of(SPDC.getValue())); negativeQueryParam.setCrtTime(List.of(request.getBeginTime(), request.getEndTime())); List negatives = negativeResourceService.query(negativeQueryParam); - List ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); +// List ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); List completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList(); + List njssList = completedList.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); // 使用统一的问责次数统计口径,便于核对大屏与导出逻辑差异 AccountabilityCountUtil.AccountabilityCountResult accountabilityCountResult = accountabilityCountUtil.buildAccountabilityCountResult(negatives); VideoSuperviseCountVo overview = new VideoSuperviseCountVo(); overview.setTotal(negatives.size()); overview.setCompletionProblem((long) completedList.size()); - overview.setDiscoverProblem((long) ssList.size()); + overview.setDiscoverProblem((long) njssList.size()); overview.setRelativeOrg(accountabilityCountResult.newUnitCount()); overview.setRelativePer(accountabilityCountResult.newPersonTotalCount()); JSONObject data = new JSONObject().fluentPut("overview", overview); @@ -449,14 +450,15 @@ public class DatavServiceImpl implements DatavService { for (SupDepart fxsj : fxsjDw) { List negatives = negativeMapper.getNegativeListData(fxsj.getId(), request.getBeginTime(), request.getEndTime(), proCode); - List ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); +// List ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); List completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList(); + List njssList = completedList.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); // 使用统一的问责次数统计口径,便于核对大屏与导出逻辑差异 AccountabilityCountUtil.AccountabilityCountResult accountabilityCountResult = accountabilityCountUtil.buildAccountabilityCountResult(negatives); VideoSuperviseMapIconVo videoSuperviseMapIconVo = new VideoSuperviseMapIconVo(); videoSuperviseMapIconVo.setName(fxsj.getShortName()); videoSuperviseMapIconVo.setDepartId(fxsj.getId()); - videoSuperviseMapIconVo.setDiscoverProblem(ssList.size()); + videoSuperviseMapIconVo.setDiscoverProblem(njssList.size()); videoSuperviseMapIconVo.setCompletionProblem(completedList.size()); videoSuperviseMapIconVo.setRelativeOrg(Math.toIntExact(accountabilityCountResult.newUnitCount())); videoSuperviseMapIconVo.setRelativePer(Math.toIntExact(accountabilityCountResult.newPersonTotalCount())); diff --git a/src/main/java/com/biutag/supervision/service/subDatav/SubDatavServiceImpl.java b/src/main/java/com/biutag/supervision/service/subDatav/SubDatavServiceImpl.java index a33c4bc..b7cf566 100644 --- a/src/main/java/com/biutag/supervision/service/subDatav/SubDatavServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/subDatav/SubDatavServiceImpl.java @@ -471,15 +471,16 @@ public class SubDatavServiceImpl implements SubDatavService { @Override public Result getSubOneAllVideoSuperviseCount(SubDataVRequest request) { List negatives = negativeMapper.getNegativeListData(request.getDepartId(), request.getBeginTime(), request.getEndTime(), List.of(SPDC.getValue())); - List ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); +// List ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); List completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList(); + List njssList = completedList.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); // 与 DatavServiceImpl 保持一致:按“有效问题 + 多处理结果拆分 + negativeId/对象/处理结果去重”的口径统计。 AccountabilityCountUtil.AccountabilityCountResult accountabilityCountResult = accountabilityCountUtil.buildAccountabilityCountResult(negatives); VideoSuperviseCountVo overview = new VideoSuperviseCountVo(); overview.setTotal(negatives.size()); overview.setCompletionProblem((long) completedList.size()); - overview.setDiscoverProblem((long) ssList.size()); + overview.setDiscoverProblem((long) njssList.size()); overview.setRelativeOrg(accountabilityCountResult.newUnitCount()); overview.setRelativePer(accountabilityCountResult.newPersonTotalCount()); JSONObject data = new JSONObject().fluentPut("overview", overview); @@ -503,15 +504,15 @@ public class SubDatavServiceImpl implements SubDatavService { List negatives = negativeMapper.getNegativeListData(pcs.getId(), request.getBeginTime(), request.getEndTime(), proCode); - List ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); +// List ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); List completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList(); // 与 DatavServiceImpl 保持一致:按“有效问题 + 多处理结果拆分 + negativeId/对象/处理结果去重”的口径统计。 AccountabilityCountUtil.AccountabilityCountResult accountabilityCountResult = accountabilityCountUtil.buildAccountabilityCountResult(negatives); - + List njssList = completedList.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); VideoSuperviseMapIconVo videoSuperviseMapIconVo = new VideoSuperviseMapIconVo(); videoSuperviseMapIconVo.setName(pcs.getShortName()); videoSuperviseMapIconVo.setDepartId(pcs.getId()); - videoSuperviseMapIconVo.setDiscoverProblem(ssList.size()); + videoSuperviseMapIconVo.setDiscoverProblem(njssList.size()); videoSuperviseMapIconVo.setCompletionProblem(completedList.size()); videoSuperviseMapIconVo.setRelativeOrg(Math.toIntExact(accountabilityCountResult.newUnitCount())); videoSuperviseMapIconVo.setRelativePer(Math.toIntExact(accountabilityCountResult.newPersonTotalCount())); From d0708ecb830eddbad64c54b22e1fe62886075241 Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Thu, 2 Apr 2026 18:31:12 +0800 Subject: [PATCH 11/16] =?UTF-8?q?fix:=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/biutag/supervision/util/TimeUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/biutag/supervision/util/TimeUtil.java b/src/main/java/com/biutag/supervision/util/TimeUtil.java index 73ae9af..77145eb 100644 --- a/src/main/java/com/biutag/supervision/util/TimeUtil.java +++ b/src/main/java/com/biutag/supervision/util/TimeUtil.java @@ -176,9 +176,9 @@ public class TimeUtil { long limit = SECONDS_OF_A_DAY; // 86400秒 = 1天 long diff = limit - usedSeconds; // diff > 0 表示剩余时间,diff < 0 表示超出时间 if (diff >= 0) { - return "未超时/" + formatDuration(diff); + return "未超时/用时:" + formatDuration(usedSeconds); } else { - return "已超时/" + formatDuration(-diff); + return "已超时/用时:" + formatDuration(usedSeconds); } } From 485202454a316b34e81efa6e0b5c8d459f40b4dc Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Fri, 3 Apr 2026 10:17:31 +0800 Subject: [PATCH 12/16] =?UTF-8?q?fix:=E6=A8=A1=E5=9E=8B=E9=A2=84=E8=AD=A6?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E6=89=8B=E5=8A=A8=E4=B8=8B=E5=8F=91=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E7=BB=9F=E4=B8=80=E5=A4=B1=E8=B4=A5=E6=88=96=E6=88=90?= =?UTF-8?q?=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/biutag/supervision/service/ModelClueService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/biutag/supervision/service/ModelClueService.java b/src/main/java/com/biutag/supervision/service/ModelClueService.java index fe42203..503d1b5 100644 --- a/src/main/java/com/biutag/supervision/service/ModelClueService.java +++ b/src/main/java/com/biutag/supervision/service/ModelClueService.java @@ -115,6 +115,7 @@ public class ModelClueService extends ServiceImpl { } // 手动下发 + @Transactional(rollbackFor = Exception.class) public boolean distributionByManuel(ModelClueTaskDistribute taskDistribute) { List modelClues = taskDistribute.getModelClues(); Model model = modelMapper.selectById(modelClues.get(0).getModelId()); From b0d4ec8c7ab73ec7a9811ccec8a7786f56a978dc Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Fri, 3 Apr 2026 10:24:04 +0800 Subject: [PATCH 13/16] =?UTF-8?q?fix:=E7=BB=BC=E5=90=88=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/biutag/supervision/service/NegativeTaskService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/biutag/supervision/service/NegativeTaskService.java b/src/main/java/com/biutag/supervision/service/NegativeTaskService.java index 21b5a8f..b1c5c66 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeTaskService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeTaskService.java @@ -3,6 +3,7 @@ package com.biutag.supervision.service; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.ExcelWriter; @@ -205,8 +206,8 @@ public class NegativeTaskService extends ServiceImpl Date: Fri, 3 Apr 2026 16:16:49 +0800 Subject: [PATCH 14/16] =?UTF-8?q?feat:=E7=94=A8=E5=BD=95=E5=85=A5=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=AE=A1=E7=AE=97=E5=88=9D=E6=A0=B8=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ComplaintCollectionPageRequest.java | 5 +++++ .../ComplaintCollectionServiceImpl.java | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionPageRequest.java b/src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionPageRequest.java index 2a8229c..1cdb700 100644 --- a/src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionPageRequest.java +++ b/src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionPageRequest.java @@ -82,6 +82,11 @@ public class ComplaintCollectionPageRequest extends BasePage implements ParamChe @Schema(description = "涉嫌问题List") private List involveProblemIdList = new ArrayList<>(); + @Schema(description = "录入时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List crtTime = new ArrayList<>(); + + @Override public void check() { if (CollectionUtil.isNotEmpty(discoveryTimeList)){ diff --git a/src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java b/src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java index 751fdde..f98e612 100644 --- a/src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java @@ -351,7 +351,7 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic collectionUpdateParam.setStatus("1"); // 更新初核 if (complaint.getGwf2() == null ) { - LocalDateTime discoveryTime = complaint.getDiscoveryTime(); + LocalDateTime discoveryTime = complaint.getCreateTime(); long maxSeconds = CHECK_LIMIT_DAYS * TimeUtil.SECONDS_OF_A_DAY; long remainingAtInitial = TimeUtil.getRemainingDuration(discoveryTime, LocalDateTime.now(), maxSeconds); String initialReviewStatus = (remainingAtInitial < 0) ? @@ -716,7 +716,7 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic ComplaintCollection complaintCollection = complaintCollectionList.get(0); // 有附件 + 有核查情况 = 初核 if (StrUtil.isBlank(complaintCollection.getGwf2()) && request.getCheckStatusCode() != null && CollectionUtil.isNotEmpty(request.getFiles())) { - LocalDateTime discoveryTime = complaintCollection.getDiscoveryTime(); + LocalDateTime discoveryTime = complaintCollection.getCreateTime(); long maxSeconds = CHECK_LIMIT_DAYS * TimeUtil.SECONDS_OF_A_DAY; long remainingAtInitial = TimeUtil.getRemainingDuration(discoveryTime, LocalDateTime.now(), maxSeconds); String initialReviewStatus = (remainingAtInitial < 0) ? @@ -760,7 +760,7 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic complaintCollectionQueryParam.setId(request.getComplaintId()); List complaintCollectionList = complaintCollectionResourceService.query(complaintCollectionQueryParam); ComplaintCollection complaintCollection = complaintCollectionList.get(0); - LocalDateTime discoveryTime = complaintCollection.getDiscoveryTime(); + LocalDateTime discoveryTime = complaintCollection.getCrtTime(); long maxSeconds = CHECK_LIMIT_DAYS * TimeUtil.SECONDS_OF_A_DAY; long remainingAtInitial = TimeUtil.getRemainingDuration(discoveryTime, LocalDateTime.now(), maxSeconds); String initialReviewStatus = (remainingAtInitial < 0) ? @@ -1158,7 +1158,7 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic if (dto == null || StrUtil.isBlank(dto.getId())) { return; } - LocalDateTime discoveryTime = dto.getDiscoveryTime(); + LocalDateTime discoveryTime = dto.getCreateTime(); if (discoveryTime == null) { dto.setRemainingDuration(null); return; From cd3c9527058fb180c413d23169371302b6a38067 Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Fri, 3 Apr 2026 16:49:33 +0800 Subject: [PATCH 15/16] =?UTF-8?q?fix:=E7=94=A8=E5=BD=95=E5=85=A5=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=AE=A1=E7=AE=97=E5=88=9D=E6=A0=B8=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../complaintCollection/ComplaintCollectionServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java b/src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java index f98e612..ed5d5db 100644 --- a/src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java @@ -760,7 +760,7 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic complaintCollectionQueryParam.setId(request.getComplaintId()); List complaintCollectionList = complaintCollectionResourceService.query(complaintCollectionQueryParam); ComplaintCollection complaintCollection = complaintCollectionList.get(0); - LocalDateTime discoveryTime = complaintCollection.getCrtTime(); + LocalDateTime discoveryTime = complaintCollection.getCreateTime(); long maxSeconds = CHECK_LIMIT_DAYS * TimeUtil.SECONDS_OF_A_DAY; long remainingAtInitial = TimeUtil.getRemainingDuration(discoveryTime, LocalDateTime.now(), maxSeconds); String initialReviewStatus = (remainingAtInitial < 0) ? From 5063781980b46b2aef2427584a870da4110f3a03 Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Fri, 3 Apr 2026 17:33:00 +0800 Subject: [PATCH 16/16] =?UTF-8?q?fix:=E5=8A=A0=E4=B8=8A=E5=BD=95=E5=85=A5?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ComplaintCollection/ComplaintCollectionQueryParam.java | 7 +++++++ .../ComplaintCollectionPageRequest.java | 2 +- .../ComplaintCollectionResourceService.java | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/biutag/supervision/pojo/param/ComplaintCollection/ComplaintCollectionQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/ComplaintCollection/ComplaintCollectionQueryParam.java index dc9307d..d0e2ff7 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/ComplaintCollection/ComplaintCollectionQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/ComplaintCollection/ComplaintCollectionQueryParam.java @@ -2,6 +2,7 @@ package com.biutag.supervision.pojo.param.ComplaintCollection; import com.biutag.supervision.pojo.enums.complaintCollection.ComplaintCollectionSourceTableEnum; import com.biutag.supervision.pojo.param.BasePage; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Getter; import lombok.Setter; @@ -112,6 +113,12 @@ public class ComplaintCollectionQueryParam extends BasePage { private List involveProblemIdList = new ArrayList<>(); + @Schema(description = "录入时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List createTimeList = new ArrayList<>(); + + + // @Schema(description = "部门ID集合") // private Set secondDepartIds; diff --git a/src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionPageRequest.java b/src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionPageRequest.java index 1cdb700..7686ccf 100644 --- a/src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionPageRequest.java +++ b/src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionPageRequest.java @@ -84,7 +84,7 @@ public class ComplaintCollectionPageRequest extends BasePage implements ParamChe @Schema(description = "录入时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private List crtTime = new ArrayList<>(); + private List createTimeList = new ArrayList<>(); @Override diff --git a/src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java b/src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java index b6338cf..6ec5044 100644 --- a/src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java +++ b/src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java @@ -66,6 +66,9 @@ public class ComplaintCollectionResourceService extends BaseDAO { && param.getDiscoveryTimeList().get(1) != null) { qw.between(ComplaintCollection::getDiscoveryTime, param.getDiscoveryTimeList().get(0), param.getDiscoveryTimeList().get(1)); } + if (CollectionUtil.size(param.getCreateTimeList()) == 2){ + qw.between(ComplaintCollection::getCreateTime, param.getCreateTimeList().get(0), param.getCreateTimeList().get(1)); + } // 来件人信息 if (StrUtil.isNotBlank(param.getPersonInfo())) { String kw = param.getPersonInfo();