diff --git a/src/main/java/com/biutag/supervision/controller/sensitiveperception/ModelClueController.java b/src/main/java/com/biutag/supervision/controller/sensitiveperception/ModelClueController.java index 82c8435..65807ba 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitiveperception/ModelClueController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitiveperception/ModelClueController.java @@ -8,7 +8,9 @@ import com.biutag.supervision.pojo.dto.ModelClueTaskDistribute; import com.biutag.supervision.pojo.entity.ModelClue; import com.biutag.supervision.pojo.model.ModelClueModel; import com.biutag.supervision.pojo.param.ModelClueQueryParam; +import com.biutag.supervision.pojo.request.modelClue.ModelCheckUntrueRequest; import com.biutag.supervision.service.ModelClueService; +import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; import org.springframework.web.bind.annotation.*; @@ -55,4 +57,12 @@ public class ModelClueController { return Result.success(modelClueService.update(updateWrapper)); } + @Operation(description = "查否|恢复接口") + @PostMapping("/checkUntrue") + public Result checkUntrue(@RequestBody ModelCheckUntrueRequest request ) { + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() + .eq(ModelClue::getId, request.getId()) + .set(ModelClue::getDistributionState, request.getDistributionState()); + return Result.success(modelClueService.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 e08bca2..781daed 100644 --- a/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java @@ -107,13 +107,14 @@ 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); + Long firstApproveTime = negative.getFirstApproveTime(); + // 覆盖制:每次重新计算,超时锁定则不更新 + if (TimeUtil.canUpdateApproveTime(firstApproveTime) && negative.getLatestProcessTime() != null) { + firstApproveTime = TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now); } - Long secondApprovalTime = negative.getSecondApprovalTime() == null ? 0L : negative.getSecondApprovalTime(); - if (negative.getLatestProcessTime() != null) { - secondApprovalTime = secondApprovalTime + TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now); + Long secondApprovalTime = negative.getSecondApprovalTime(); + if (TimeUtil.canUpdateApproveTime(secondApprovalTime) && negative.getLatestProcessTime() != null) { + secondApprovalTime = TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now); } LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() .eq(Negative::getId, negativeId) @@ -126,10 +127,16 @@ public class ConfirmationCompletionAction implements Action { .set(Negative::getFlowKey, FlowNodeEnum.COMPLETED.getKey()) .set(Negative::getUpdTime, LocalDateTime.now()); if ("2".equals(negative.getApprovalFlow())){ - updateWrapper.set(Negative::getSecondApprovalTime, secondApprovalTime); + // 超时锁定时,不更新审批时长字段 + if (TimeUtil.canUpdateApproveTime(secondApprovalTime)) { + updateWrapper.set(Negative::getSecondApprovalTime, secondApprovalTime); + } } if ("3".equals(negative.getApprovalFlow())){ - updateWrapper.set(Negative::getFirstApproveTime, firstApproveTime); + // 超时锁定时,不更新审批时长字段 + if (TimeUtil.canUpdateApproveTime(firstApproveTime)) { + updateWrapper.set(Negative::getFirstApproveTime, firstApproveTime); + } } negativeService.update(updateWrapper); } 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 85d220b..ae54e5c 100644 --- a/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java @@ -46,9 +46,10 @@ 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); + Long firstApproveTime = negative.getFirstApproveTime(); + // 覆盖制:每次重新计算,超时锁定则不更新 + if (TimeUtil.canUpdateApproveTime(firstApproveTime) && negative.getLatestProcessTime() != null) { + firstApproveTime = TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now); } negativeService.update(new LambdaUpdateWrapper() .set(Negative::getFlowKey, negative.getIsSecondHandle() ? FlowNodeEnum.VERIFY.getKey() : nextFlowKey) @@ -56,7 +57,7 @@ public class FirstApproveReturnAction implements Action { // 当前处理对象 .set(Negative::getCurrentProcessingObject, String.format("%s专班", negative.getHandleSecondDepartName())) .eq(Negative::getId, negativeId) - .set(Negative::getFirstApproveTime, firstApproveTime) + .set(TimeUtil.canUpdateApproveTime(firstApproveTime), Negative::getFirstApproveTime, firstApproveTime) .set(Negative::getLatestProcessTime, now)); } 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 64e8da7..3b80972 100644 --- a/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java @@ -53,15 +53,19 @@ 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); + Long secondApprovalTime = negative.getSecondApprovalTime(); + // 覆盖制:每次重新计算,超时锁定则不更新 + if (TimeUtil.canUpdateApproveTime(secondApprovalTime) && negative.getLatestProcessTime() != null) { + 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); + // 超时锁定时,不更新审批时长字段 + if (TimeUtil.canUpdateApproveTime(secondApprovalTime)) { + updateWrapper.set(Negative::getSecondApprovalTime, secondApprovalTime); + } // Negative negative = negativeService.getById(negativeId); if (ApprovalFlowEnum.SECOND_APPROVAL.getValue().equals(negative.getApprovalFlow())) { updateWrapper.set(Negative::getFlowKey, FlowNodeEnum.COMPLETED.getKey()) 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 5ac468d..68f2d15 100644 --- a/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java @@ -47,9 +47,10 @@ 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); + Long secondApprovalTime = negative.getSecondApprovalTime(); + // 覆盖制:每次重新计算,超时锁定则不更新 + if (TimeUtil.canUpdateApproveTime(secondApprovalTime) && negative.getLatestProcessTime() != null) { + secondApprovalTime = TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now); } negativeService.update(new LambdaUpdateWrapper() .set(Negative::getFlowKey, nextFlowKey) @@ -57,7 +58,7 @@ public class SecondApproveReturnAction implements Action { .set(Negative::getProcessingStatus, ProcessingStatusEnum.processing.name()) // 当前处理对象 .set(Negative::getCurrentProcessingObject, String.format("%s专班", negative.getHandleThreeDepartName())) - .set(Negative::getSecondApprovalTime, secondApprovalTime) + .set(TimeUtil.canUpdateApproveTime(secondApprovalTime), Negative::getSecondApprovalTime, secondApprovalTime) .eq(Negative::getId, negativeId)); } diff --git a/src/main/java/com/biutag/supervision/pojo/entity/ModelClue.java b/src/main/java/com/biutag/supervision/pojo/entity/ModelClue.java index 667febc..0d387cb 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/ModelClue.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/ModelClue.java @@ -41,7 +41,7 @@ public class ModelClue { @TableField("thing_desc") private String thingDesc; - // 状态 默认 0-未分发 1-已分发 2-已处理 + // 状态 默认 0-未分发 1-已分发 2-已处理 3-查否 @TableField("distribution_state") private String distributionState; diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeHistory.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeHistory.java index 7d98895..a4b7fcc 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/NegativeHistory.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeHistory.java @@ -47,4 +47,8 @@ public class NegativeHistory { private String departName; + @TableField(exist = false) + // 节点耗时(剔除节假日的秒数) + private Long duration; + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/request/modelClue/ModelCheckUntrueRequest.java b/src/main/java/com/biutag/supervision/pojo/request/modelClue/ModelCheckUntrueRequest.java new file mode 100644 index 0000000..5449586 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/request/modelClue/ModelCheckUntrueRequest.java @@ -0,0 +1,28 @@ +package com.biutag.supervision.pojo.request.modelClue; + +import com.biutag.supervision.aop.ParamChecked; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +@Schema(description = "查否请求") +@Getter +@Setter +public class ModelCheckUntrueRequest implements ParamChecked { + + @Schema(description = "线索id") + private String id; + + @Schema(description = "变更的状态") + private String distributionState; + + @Override + public void check() { + if (distributionState == null) { + throw new IllegalArgumentException("请检查要变更的状态"); + } + if (id == null) { + throw new IllegalArgumentException("线索id为空"); + } + } +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeBlameVo.java b/src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeBlameVo.java index a7d554f..8618bc7 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeBlameVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeBlameVo.java @@ -104,4 +104,13 @@ public class ExportNegativeBlameVo { // 问题类型 @ExcelProperty({"问题类型"}) private String problemType; + + + @ExcelProperty("督察措施") + private String superviseMeasuresName; + + + @ExcelProperty({"禁闭时长"}) + private String confinementTime; + } diff --git a/src/main/java/com/biutag/supervision/service/NegativeQueryService.java b/src/main/java/com/biutag/supervision/service/NegativeQueryService.java index e42a42a..b7b3b84 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeQueryService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeQueryService.java @@ -70,7 +70,10 @@ public class NegativeQueryService { // 案件编号 .like(StrUtil.isNotBlank(param.getCaseNumber()), Negative::getCaseNumber, param.getCaseNumber()) // 内容 - .like(StrUtil.isNotBlank(param.getThingDesc()), Negative::getThingDesc, param.getThingDesc()) +// .like(StrUtil.isNotBlank(param.getThingDesc()), Negative::getThingDesc, param.getThingDesc()) + .and(StrUtil.isNotBlank(param.getThingDesc()), (qw) -> { + qw.like(Negative::getThingDesc, param.getThingDesc()).or().like(Negative::getCheckStatusDesc, param.getThingDesc()); + }) // 问题来源 .in(CollectionUtil.isNotEmpty(param.getProblemSourcesCode()), Negative::getProblemSourcesCode, param.getProblemSourcesCode()) // 业务类型 diff --git a/src/main/java/com/biutag/supervision/service/NegativeService.java b/src/main/java/com/biutag/supervision/service/NegativeService.java index fb2bd72..c286351 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeService.java @@ -129,6 +129,12 @@ public class NegativeService extends ServiceImpl { if (StrUtil.isNotBlank(vo.getProblemSourcesCode())) { vo.setFileClasses(fileClassService.list(vo.getProblemSourcesCode())); } + // 计算每个节点的用时(剔除节假日) + for (int i = 0; i < flows.size(); i++) { + LocalDateTime currentTime = flows.get(i).getCrtTime(); + LocalDateTime previousTime = i == 0 ? negative.getCrtTime() : flows.get(i - 1).getCrtTime(); + flows.get(i).setDuration(TimeUtil.calculateWorkdayDuration(previousTime, currentTime)); + } NegativeDetail detail = new NegativeDetail() .setNegative(vo) .setActionHistory(flows) diff --git a/src/main/java/com/biutag/supervision/service/NegativeTaskService.java b/src/main/java/com/biutag/supervision/service/NegativeTaskService.java index b1c5c66..9685c51 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeTaskService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeTaskService.java @@ -63,6 +63,8 @@ public class NegativeTaskService extends ServiceImpl page(NegativeTaskQueryParam param) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() @@ -203,7 +205,11 @@ public class NegativeTaskService extends ServiceImpl=86400秒) + */ + public static boolean canUpdateApproveTime(Long currentDuration) { + return currentDuration == null || currentDuration < APPROVAL_LOCK_THRESHOLD; + } + /** * * @param beginTime @@ -176,9 +188,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(usedSeconds); + return "未超时"; } else { - return "已超时/用时:" + formatDuration(usedSeconds); + return "已超时"; } }