update 调整请假案例

This commit is contained in:
gssong 2024-12-14 18:58:42 +08:00
parent 603d7a7a71
commit a2273beae9

View File

@ -125,13 +125,13 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
* *
* @param processEvent 参数 * @param processEvent 参数
*/ */
@EventListener(condition = "#processEvent.flowCode.startsWith('leaveFlow-serial1')") @EventListener(condition = "#processEvent.flowCode.startsWith('leave')")
public void processHandler(ProcessEvent processEvent) { public void processHandler(ProcessEvent processEvent) {
log.info("当前任务执行了{}", processEvent.toString()); log.info("当前任务执行了{}", processEvent.toString());
TestLeave testLeave = baseMapper.selectById(Long.valueOf(processEvent.getBusinessKey())); TestLeave testLeave = baseMapper.selectById(Long.valueOf(processEvent.getBusinessKey()));
testLeave.setStatus(processEvent.getStatus()); testLeave.setStatus(processEvent.getStatus());
if (processEvent.isSubmit()) { if (processEvent.isSubmit()) {
testLeave.setStatus(FlowStatus.APPROVAL.getKey()); testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
} }
baseMapper.updateById(testLeave); baseMapper.updateById(testLeave);
} }
@ -140,21 +140,17 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
* 执行办理任务监听 * 执行办理任务监听
* 示例也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断 * 示例也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
* 在方法中判断流程节点key * 在方法中判断流程节点key
* if ("xxx".equals(processTaskEvent.getTaskDefinitionKey())) { * if ("xxx".equals(processTaskEvent.getNodeCode())) {
* //执行业务逻辑 * //执行业务逻辑
* } * }
* *
* @param processTaskEvent 参数 * @param processTaskEvent 参数
*/ */
@EventListener(condition = "#processTaskEvent.flowCode=='leaveFlow-serial1'") @EventListener(condition = "#processTaskEvent.flowCode=='leave'")
public void processTaskHandler(ProcessTaskEvent processTaskEvent) { public void processTaskHandler(ProcessTaskEvent processTaskEvent) {
// 所有demo案例的申请人节点id log.info("当前任务执行了{}", processTaskEvent.toString());
String[] ids = {"0", "1", "2", "3", "4", "5", "6"}; TestLeave testLeave = baseMapper.selectById(Long.valueOf(processTaskEvent.getBusinessKey()));
if (StringUtils.equalsAny(processTaskEvent.getNodeCode(), ids)) { testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
log.info("当前任务执行了{}", processTaskEvent.toString()); baseMapper.updateById(testLeave);
TestLeave testLeave = baseMapper.selectById(Long.valueOf(processTaskEvent.getBusinessKey()));
testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
baseMapper.updateById(testLeave);
}
} }
} }