修改现金支出、报销的逻辑处理
This commit is contained in:
parent
ec41d2c9f1
commit
56b5828177
@ -58,7 +58,12 @@ public class BpmOAImprestController {
|
|||||||
//根据user 查询审批通过并且未报销得表单。
|
//根据user 查询审批通过并且未报销得表单。
|
||||||
BpmOAImprestDO imprest = imprestService.getImprestByUserId(userId);
|
BpmOAImprestDO imprest = imprestService.getImprestByUserId(userId);
|
||||||
|
|
||||||
return success(BpmOAImprestConvert.INSTANCE.convert(imprest));
|
BpmOAImprestRespVO respVO = BpmOAImprestConvert.INSTANCE.convert(imprest);
|
||||||
|
if (!respVO.getStatus().equals(BpmOAImprestDO.FLAG_FALSE)) {
|
||||||
|
respVO.setNote("您有一笔备用金报销正在处理中!");
|
||||||
|
}
|
||||||
|
|
||||||
|
return success(respVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/getByProcessInstanceId")
|
@GetMapping("/getByProcessInstanceId")
|
||||||
|
@ -48,6 +48,9 @@ public class BpmOAImprestRespVO extends BpmOABaseRespVO {
|
|||||||
@NotNull(message = "报销状态不能为空")
|
@NotNull(message = "报销状态不能为空")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String note;
|
||||||
|
|
||||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
private List<UploadUserFile> fileItems;
|
private List<UploadUserFile> fileItems;
|
||||||
}
|
}
|
||||||
|
@ -17,10 +17,10 @@ import java.util.List;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface BpmOAImprestMapper extends BaseMapperX<BpmOAImprestDO> {
|
public interface BpmOAImprestMapper extends BaseMapperX<BpmOAImprestDO> {
|
||||||
|
|
||||||
default BpmOAImprestDO selectByUserId(Long userId, List<Integer> status){
|
default BpmOAImprestDO selectByUserId(Long userId){
|
||||||
|
|
||||||
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.APPROVE.getResult())
|
||||||
.notIn(BpmOAImprestDO::getStatus, status));
|
.ne(BpmOAImprestDO::getStatus, BpmOAImprestDO.FLAG_TRUE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -166,6 +166,8 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
|||||||
// 获得现金支出业务数据
|
// 获得现金支出业务数据
|
||||||
BpmOACashDO cash = validateLeaveExists(id);
|
BpmOACashDO cash = validateLeaveExists(id);
|
||||||
|
|
||||||
|
cashMapper.updateById(new BpmOACashDO().setId(id).setResult(result));
|
||||||
|
|
||||||
// 获取现金支出明细
|
// 获取现金支出明细
|
||||||
List<BpmOACashItemDO> cashItemDOs = getCashItem(id);
|
List<BpmOACashItemDO> cashItemDOs = getCashItem(id);
|
||||||
|
|
||||||
@ -283,8 +285,6 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cashMapper.updateById(new BpmOACashDO().setId(id).setResult(result));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private BpmOACashDO validateLeaveExists(Long id) {
|
private BpmOACashDO validateLeaveExists(Long id) {
|
||||||
|
@ -142,7 +142,7 @@ public class BpmOAImprestServiceImpl extends BpmOABaseService implements BpmOAIm
|
|||||||
public BpmOAImprestDO getImprestByUserId(Long userId) {
|
public BpmOAImprestDO getImprestByUserId(Long userId) {
|
||||||
|
|
||||||
//根据user 查询审批通过并且未报销得表单。
|
//根据user 查询审批通过并且未报销得表单。
|
||||||
return imprestMapper.selectByUserId(userId, Arrays.asList(BpmOAImprestDO.FLAG_TRUE, BpmOAImprestDO.IN_PROGRESS));
|
return imprestMapper.selectByUserId(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -157,6 +157,9 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
|||||||
public void updateReimbursementResult(String processInstanceId, Long id, Integer result) {
|
public void updateReimbursementResult(String processInstanceId, Long id, Integer result) {
|
||||||
|
|
||||||
BpmOAReimbursementDO bpmOAReimbursementDO = validateLeaveExists(id);
|
BpmOAReimbursementDO bpmOAReimbursementDO = validateLeaveExists(id);
|
||||||
|
|
||||||
|
reimbursementMapper.updateById(new BpmOAReimbursementDO().setId(id).setResult(result));
|
||||||
|
|
||||||
//审核通过 (最后节点)
|
//审核通过 (最后节点)
|
||||||
if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) {
|
if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) {
|
||||||
|
|
||||||
@ -293,7 +296,6 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reimbursementMapper.updateById(new BpmOAReimbursementDO().setId(id).setResult(result));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private BpmOAReimbursementDO validateLeaveExists(Long id) {
|
private BpmOAReimbursementDO validateLeaveExists(Long id) {
|
||||||
|
Loading…
Reference in New Issue
Block a user