OA流程
备用金报销逻辑修改
This commit is contained in:
parent
4f26e1ec87
commit
a42144739a
@ -18,7 +18,7 @@ public interface BpmOAImprestMapper extends BaseMapperX<BpmOAImprestDO> {
|
|||||||
default BpmOAImprestDO selectByUserId(Long userId, Integer status){
|
default BpmOAImprestDO selectByUserId(Long userId, Integer status){
|
||||||
|
|
||||||
return selectOne(new LambdaQueryWrapperX<BpmOAImprestDO>().eq(BpmOAImprestDO::getUserId, userId)
|
return selectOne(new LambdaQueryWrapperX<BpmOAImprestDO>().eq(BpmOAImprestDO::getUserId, userId)
|
||||||
.eq(BpmOAImprestDO::getResult, BpmProcessInstanceResultEnum.APPROVE.getResult())
|
.eq(BpmOAImprestDO::getResult, BpmProcessInstanceResultEnum.PROCESS.getResult())
|
||||||
.eq(BpmOAImprestDO::getStatus, status));
|
.eq(BpmOAImprestDO::getStatus, status));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ public class BpmOAImprestServiceImpl extends BpmOABaseService implements BpmOAIm
|
|||||||
|
|
||||||
//插入OA 备用金申请
|
//插入OA 备用金申请
|
||||||
BpmOAImprestDO imprest = BpmOAImprestConvert.INSTANCE.convert(createReqVO).setUserId(userId)
|
BpmOAImprestDO imprest = BpmOAImprestConvert.INSTANCE.convert(createReqVO).setUserId(userId)
|
||||||
|
.setStatus(BpmOAImprestDO.FLAG_FALSE)
|
||||||
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||||
imprestMapper.insert(imprest) ;
|
imprestMapper.insert(imprest) ;
|
||||||
|
|
||||||
|
@ -98,10 +98,29 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
|||||||
BpmOAImprestDO bpmOAImprestDO = bpmOAImprestMapper.selectByUserId(Long.valueOf(instance.getStartUserId()), BpmOAImprestDO.IN_PROGRESS);
|
BpmOAImprestDO bpmOAImprestDO = bpmOAImprestMapper.selectByUserId(Long.valueOf(instance.getStartUserId()), BpmOAImprestDO.IN_PROGRESS);
|
||||||
|
|
||||||
if (instance.isEnded() && bpmOAImprestDO != null) {
|
if (instance.isEnded() && bpmOAImprestDO != null) {
|
||||||
|
|
||||||
|
//将相应备用金申请状态改为 已报销
|
||||||
bpmOAImprestMapper.updateById(new BpmOAImprestDO().setId(bpmOAImprestDO.getId()).setStatus(BpmOAImprestDO.FLAG_TRUE));
|
bpmOAImprestMapper.updateById(new BpmOAImprestDO().setId(bpmOAImprestDO.getId()).setStatus(BpmOAImprestDO.FLAG_TRUE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// -- 自己取消
|
||||||
|
// -- 审核拒绝
|
||||||
|
//所有关联的采购申请改为 未支付状态
|
||||||
|
if (BpmProcessInstanceResultEnum.REJECT.getResult().equals(result)
|
||||||
|
|| BpmProcessInstanceResultEnum.CANCEL.getResult().equals(result)
|
||||||
|
|| BpmProcessInstanceResultEnum.BACK.getResult().equals(result)) {
|
||||||
|
|
||||||
|
ProcessInstance instance = bpmProcessInstanceService.getProcessInstance(processInstanceId);
|
||||||
|
BpmOAImprestDO bpmOAImprestDO = bpmOAImprestMapper.selectByUserId(Long.valueOf(instance.getStartUserId()), BpmOAImprestDO.IN_PROGRESS);
|
||||||
|
|
||||||
|
if (bpmOAImprestDO != null) {
|
||||||
|
|
||||||
|
//将相应备用金申请状态改为 未报销
|
||||||
|
bpmOAImprestMapper.updateById(new BpmOAImprestDO().setId(bpmOAImprestDO.getId()).setStatus(BpmOAImprestDO.FLAG_FALSE));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
reimbursementMapper.updateById(new BpmOAReimbursementDO().setId(id).setResult(result));
|
reimbursementMapper.updateById(new BpmOAReimbursementDO().setId(id).setResult(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user