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