|
|
|
|
@ -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<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>() |
|
|
|
|
.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) { |
|
|
|
|
|