|
@@ -193,6 +193,27 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
|
|
|
expenseInfo.setStatusFlag(StatusEnum.TO_BE_CONFIRMED.getFlag());
|
|
|
expenseInfo.setStatus(StatusEnum.TO_BE_CONFIRMED.getName());
|
|
|
this.insert(expenseInfo);
|
|
|
+ //合同费用
|
|
|
+ if ("1".equals(expenseInfo.getExpensesPurpose())){
|
|
|
+ //查是否有分配数据
|
|
|
+ ExpenseAllocationInfo expenseAllocationInfo=expenseAllocationInfoService.selectOne(new EntityWrapper<ExpenseAllocationInfo>()
|
|
|
+ .eq("contract_id",expenseInfo.getContractId())
|
|
|
+ .eq("cost_type",expenseInfo.getCostType()));
|
|
|
+ if (expenseAllocationInfo!=null){
|
|
|
+ //累加收回金额
|
|
|
+ expenseAllocationInfo.setRecoveryPrepayments(expenseAllocationInfo.getRecoveryPrepayments()+expenseInfo.getAmountMoney());
|
|
|
+ expenseAllocationInfoService.updateById(expenseAllocationInfo);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ ExpenseAllocationInfo expenseAllocationInfo1=new ExpenseAllocationInfo();
|
|
|
+ expenseAllocationInfo1.setId(IdGenerator.generateUUID());
|
|
|
+ expenseAllocationInfo1.setCostType(expenseInfo.getCostType());
|
|
|
+ expenseAllocationInfo1.setContractId(expenseInfo.getContractId());
|
|
|
+ expenseAllocationInfo1.setContractNo(expenseInfo.getContractNo());
|
|
|
+ expenseAllocationInfo1.setRecoveryPrepayments(expenseInfo.getAmountMoney());
|
|
|
+ expenseAllocationInfoService.insert(expenseAllocationInfo1);
|
|
|
+ }
|
|
|
+ }
|
|
|
// 插入操作历史
|
|
|
String staffName = this.billOperateHisService.getStaffAndName();
|
|
|
// 插入操作历史
|
|
@@ -458,6 +479,24 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
|
|
|
contractExpensesInfo.setContractNo(expenseInfo1.getContractNo());
|
|
|
contractExpensesInfo.setCostType("1");
|
|
|
contractExpensesInfoService.insert(contractExpensesInfo);
|
|
|
+ //查是否有分配数据
|
|
|
+ ExpenseAllocationInfo expenseAllocationInfo=expenseAllocationInfoService.selectOne(new EntityWrapper<ExpenseAllocationInfo>()
|
|
|
+ .eq("contract_id",expenseInfo1.getContractId())
|
|
|
+ .eq("cost_type",expenseInfo1.getCostType()));
|
|
|
+ if (expenseAllocationInfo!=null){
|
|
|
+ //累加付款金额
|
|
|
+ expenseAllocationInfo.setAccumulatedPrepayment(expenseAllocationInfo.getAccumulatedPrepayment()+expenseInfo1.getAmountMoney());
|
|
|
+ expenseAllocationInfoService.updateById(expenseAllocationInfo);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ ExpenseAllocationInfo expenseAllocationInfo1=new ExpenseAllocationInfo();
|
|
|
+ expenseAllocationInfo1.setId(IdGenerator.generateUUID());
|
|
|
+ expenseAllocationInfo1.setCostType(expenseInfo1.getCostType());
|
|
|
+ expenseAllocationInfo1.setContractId(expenseInfo1.getContractId());
|
|
|
+ expenseAllocationInfo1.setContractNo(expenseInfo1.getContractNo());
|
|
|
+ expenseAllocationInfo1.setAccumulatedPrepayment(expenseInfo1.getAmountMoney());
|
|
|
+ expenseAllocationInfoService.insert(expenseAllocationInfo1);
|
|
|
+ }
|
|
|
}
|
|
|
// 插入操作历史
|
|
|
String staffName = this.billOperateHisService.getStaffAndName();
|