增加日志
parent
35dab3a0cf
commit
3a08c117a8
|
|
@ -43,7 +43,7 @@ public class EightworkInfoController {
|
|||
return eightworkInfoService.add(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("分页")
|
||||
@ApiOperation("台账相关web-手机端-分页")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<EightworkInfoCO> page(@RequestBody EightworkInfoPageQry qry) {
|
||||
// qry.setEqDepartmentId(AuthContext.getOrgId());
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class TaskLogController {
|
|||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("分页")
|
||||
@ApiOperation("流程步骤节点分页")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<TaskLogCO> page(@RequestBody TaskLogPageQry qry) {
|
||||
qry.setEqStatus(0);
|
||||
|
|
|
|||
|
|
@ -167,12 +167,16 @@ public class TaskLogUpdateExe {
|
|||
// 强制终止检查:status为998时强制结束工作流
|
||||
if (FORCE_TERMINATE_STATUS.equals(cmd.getStatus())) {
|
||||
handleForceTerminate(cmd);
|
||||
log.info("强制结束工作流,结束处理步骤流转: workId={}, stepId={}, status={}",
|
||||
cmd.getWorkId(), cmd.getStepId(), cmd.getStatus());
|
||||
return;
|
||||
}
|
||||
|
||||
// 打回检查:status为2时打回到申请步骤
|
||||
if (TaskLogStatus.REJECTED.equalsCode(cmd.getStatus())) {
|
||||
handleReject(cmd);
|
||||
log.info("打回到申请步骤,结束处理步骤流转: workId={}, stepId={}, status={}",
|
||||
cmd.getWorkId(), cmd.getStepId(), cmd.getStatus());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -198,6 +202,7 @@ public class TaskLogUpdateExe {
|
|||
|
||||
// 2. 判断是否通过,通过才流转
|
||||
if (TaskLogStatus.APPROVED.equalsCode(cmd.getStatus())) {
|
||||
log.info("通过,开始处理步骤流转: workId={}, stepId={}, status={}",cmd.getWorkId(), cmd.getStepId(), cmd.getStatus());
|
||||
// 3. 先设置后续签字人(在激活步骤之前设置,避免状态覆盖问题)
|
||||
handleSignStepsIfNeeded(currentLog, cmd, actionLogs, logs);
|
||||
|
||||
|
|
@ -208,12 +213,16 @@ public class TaskLogUpdateExe {
|
|||
handleOtherMeasuresIfNeeded(currentLog, cmd);
|
||||
// 6. 判断是否可以流转到下一步
|
||||
if (canProceedToNext(currentLog, logs, cmd)) {
|
||||
log.info("可以流转到下一步,开始处理步骤流转: workId={}, stepId={}, status={}",
|
||||
cmd.getWorkId(), cmd.getStepId(), cmd.getStatus());
|
||||
|
||||
// 7. 在流转到下一步之前,检查是否被持续步骤阻塞(双重验证)
|
||||
checkBlockingStepBeforeProceed(currentLog, logs);
|
||||
|
||||
// 8. 流转到下一步
|
||||
if (shouldProceed) {
|
||||
log.info("可以继续流转,开始处理步骤流转: workId={}, stepId={}, status={}",
|
||||
cmd.getWorkId(), cmd.getStepId(), cmd.getStatus());
|
||||
proceedToNextStep(currentLog, actionLogs, logs);
|
||||
}
|
||||
}
|
||||
|
|
@ -466,6 +475,7 @@ public class TaskLogUpdateExe {
|
|||
* 当 steps.measuresStepFlag == 1 时,允许添加其他安全措施
|
||||
*/
|
||||
private void handleOtherMeasuresIfNeeded(TaskLogE currentLog, TaskLogNextCmd cmd) {
|
||||
log.info("处理其他安全措施步骤");
|
||||
if (MEASURES_STEP_FLAG.equals(currentLog.getMeasuresStepFlag())) {
|
||||
String otherMeasures = cmd.getOthers() != null ? cmd.getOthers().getString("otherMeasures") : null;
|
||||
if (StringUtils.isNotBlank(otherMeasures)) {
|
||||
|
|
@ -500,6 +510,8 @@ public class TaskLogUpdateExe {
|
|||
nextSteps != null ? nextSteps.size() : 0);
|
||||
|
||||
if (CollectionUtil.isEmpty(nextSteps)) {
|
||||
log.info("没有找到下一步,流程结束: workId={}, currentStepId={}, currentStepName={}",
|
||||
currentLog.getWorkId(), currentLog.getStepId(), currentLog.getStepName());
|
||||
// 没有下一步,流程结束
|
||||
completeWorkflow(currentLog);
|
||||
return;
|
||||
|
|
@ -658,6 +670,7 @@ public class TaskLogUpdateExe {
|
|||
}
|
||||
|
||||
for (TaskLogE next : nextSteps) {
|
||||
log.info("激活下一步:workId={},步骤={}",workId, next.getStepName());
|
||||
|
||||
// 激活步骤
|
||||
next.setStatus(TaskLogStatus.IN_PROGRESS.getCode());
|
||||
|
|
@ -667,13 +680,14 @@ public class TaskLogUpdateExe {
|
|||
sendTodoAddEvent(workId, next, currentLog.getWorkType());
|
||||
|
||||
messageNotice(next.getActUser(),next, currentLog);
|
||||
log.info("已激活下一步: {}", next.getStepName());
|
||||
log.info("已激活下一步:workId={},步骤={}",workId, next.getStepName());
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 如果有步骤被激活,更新作业当前步骤
|
||||
if (!actionLogs.isEmpty()) {
|
||||
log.info("有步骤被激活,更新作业当前步骤:workId={},步骤={}",workId, nextSteps.get(0).getStepName());
|
||||
// 找到第一个被激活的步骤
|
||||
TaskLogDO firstActivated = actionLogs.stream()
|
||||
.filter(log -> log.getTaskLogId().equals(nextSteps.get(0).getTaskLogId()))
|
||||
|
|
@ -1119,6 +1133,7 @@ public class TaskLogUpdateExe {
|
|||
List<TaskLogDO> actionLogs, List<TaskLogE> allLogs) {
|
||||
List<TaskSignStepInfoCmd> signLogs = cmd.getSignLogs();
|
||||
if (CollectionUtil.isEmpty(signLogs)) {
|
||||
log.info("未设置签字人,跳过设置签字人: workId={}", currentLog.getWorkId());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1146,6 +1161,7 @@ public class TaskLogUpdateExe {
|
|||
boolean isMultipleSign = MULTIPLE_FLAG.equals(firstLog.getMultipleFlag());
|
||||
|
||||
if (isMultipleSign) {
|
||||
log.info("已找到多人签字步骤: stepId={}", stepId);
|
||||
// 多人签字步骤:需要确保记录数等于签字人数
|
||||
handleMultipleSignStep(firstLog, existingLogs, stepSignInfos, actionLogs, allLogs);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue