update 修复流程办理完成之后状态为改变问题

2.X
gssong 8 months ago
parent aba0ecdab3
commit 8649df0ca0

@ -85,6 +85,9 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
@Override @Override
public TestLeaveVo insertByBo(TestLeaveBo bo) { public TestLeaveVo insertByBo(TestLeaveBo bo) {
TestLeave add = MapstructUtils.convert(bo, TestLeave.class); TestLeave add = MapstructUtils.convert(bo, TestLeave.class);
if (StringUtils.isBlank(add.getStatus())) {
add.setStatus(BusinessStatusEnum.DRAFT.getStatus());
}
boolean flag = baseMapper.insert(add) > 0; boolean flag = baseMapper.insert(add) > 0;
if (flag) { if (flag) {
bo.setId(add.getId()); bo.setId(add.getId());
@ -115,13 +118,16 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
/** /**
* (: 退 ) * (: 退 )
* 使#processEvent.key=='leave1'
* 便使startsWithkey
* *
* @param processEvent * @param processEvent
*/ */
@EventListener(condition = "#processEvent.key=='leave1'") @EventListener(condition = "#processEvent.key.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());
if (processEvent.isSubmit()) { if (processEvent.isSubmit()) {
testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus()); testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
} }
@ -140,6 +146,4 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus()); testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
baseMapper.updateById(testLeave); baseMapper.updateById(testLeave);
} }
} }

Loading…
Cancel
Save