|
|
@@ -51,6 +51,9 @@ public class InvAccountOperateServiceImpl extends ServiceImpl<InvAccountOperateM
|
|
|
@Autowired
|
|
|
private InvAccountProfitService invAccountProfitService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private InvAccountIncoiceService invAccountIncoiceService;
|
|
|
+
|
|
|
|
|
|
@Value("${upload.file.path}")
|
|
|
String uploadFilePath;
|
|
|
@@ -127,6 +130,9 @@ public class InvAccountOperateServiceImpl extends ServiceImpl<InvAccountOperateM
|
|
|
insAccountOperateMapper.insert(invAccountOperate);
|
|
|
|
|
|
List<InvAccountOp> list = invAccountEntOpList(entProfit, entAccount, entAccountCard, applyAmount,invAccountOperate.getAccountOperateId());
|
|
|
+ list.forEach(invAccountOp -> {
|
|
|
+ invAccountOp.setInvoiceId(invAccountOperate.getAccountOperateId());
|
|
|
+ });
|
|
|
invAccountOpService.saveBatch(list);
|
|
|
|
|
|
return HttpResult.ok("新增收入成功");
|
|
|
@@ -201,6 +207,12 @@ public class InvAccountOperateServiceImpl extends ServiceImpl<InvAccountOperateM
|
|
|
queryWrapper.eq(InvAccountOp::getAccountOperateId, invAccountOperate1.getAccountOperateId());
|
|
|
opList.addAll(invAccountOpService.list(queryWrapper));
|
|
|
});
|
|
|
+ if(invAccountOperate.getInvoiceId() != null){
|
|
|
+ InvAccountIncoice byId = invAccountIncoiceService.getById(invAccountOperate.getInvoiceId());
|
|
|
+ byId.setPayoutMoney(new BigDecimal(byId.getPayoutMoney()).subtract(new BigDecimal(invAccountOperate.getApplyAmount())).toString());
|
|
|
+ byId.setNotPayoutMoney(new BigDecimal(byId.getNotPayoutMoney()).add(new BigDecimal(invAccountOperate.getApplyAmount())).toString());
|
|
|
+ invAccountIncoiceService.updateById(byId);
|
|
|
+ }
|
|
|
|
|
|
invAccountOpService.removeBatchByIds(opList);
|
|
|
invAccountCardService.updateBatchById(invAccountCards);
|