|
|
@@ -472,7 +472,17 @@ public class HlwPaymentServiceImpl extends ServiceImpl<HlwPaymentMapper, HlwPaym
|
|
|
hlwCompanyAccount.setTotalPayment(businessAccountUtils.add(hlwCompanyAccount.getTotalPayment(), hlwPayment.getTotalPayment()));
|
|
|
hlwCompanyAccount.setTotalServiceFee(businessAccountUtils.add(hlwCompanyAccount.getTotalServiceFee(), hlwPayment.getServiceFee()));
|
|
|
hlwCompanyAccount.setBalance(businessAccountUtils.sub(hlwCompanyAccount.getBalance(), hlwPayment.getTotalPayment()));
|
|
|
- hlwCompanyAccountService.updateById(hlwCompanyAccount);
|
|
|
+ boolean update = hlwCompanyAccountService.updateById(hlwCompanyAccount);
|
|
|
+ while (!update) {
|
|
|
+ /**
|
|
|
+ * 更新失败,则重新获取
|
|
|
+ */
|
|
|
+ HlwCompanyAccount hlwCompanyAccountNew = hlwCompanyAccountService.getOne(queryWrapper);
|
|
|
+ hlwCompanyAccountNew.setTotalPayment(businessAccountUtils.add(hlwCompanyAccountNew.getTotalPayment(), hlwPayment.getTotalPayment()));
|
|
|
+ hlwCompanyAccountNew.setTotalServiceFee(businessAccountUtils.add(hlwCompanyAccountNew.getTotalServiceFee(), hlwPayment.getServiceFee()));
|
|
|
+ hlwCompanyAccountNew.setBalance(businessAccountUtils.sub(hlwCompanyAccountNew.getBalance(), hlwPayment.getTotalPayment()));
|
|
|
+ update = hlwCompanyAccountService.updateById(hlwCompanyAccountNew);
|
|
|
+ }
|
|
|
//企业账户明细表(插入)
|
|
|
HlwCompanyAccountDetail hlwCompanyAccountDetail = new HlwCompanyAccountDetail();
|
|
|
hlwCompanyAccountDetail.setCompanyAccountId(hlwCompanyAccount.getId());
|
|
|
@@ -528,7 +538,18 @@ public class HlwPaymentServiceImpl extends ServiceImpl<HlwPaymentMapper, HlwPaym
|
|
|
hlwCompanyAccount.setTotalPayment(businessAccountUtils.add(hlwCompanyAccount.getTotalPayment(), hlwPayment.getTotalPayment()));
|
|
|
hlwCompanyAccount.setTotalServiceFee(businessAccountUtils.add(hlwCompanyAccount.getTotalServiceFee(), hlwPayment.getServiceFee()));
|
|
|
hlwCompanyAccount.setBalance(businessAccountUtils.sub(hlwCompanyAccount.getBalance(), hlwPayment.getTotalPayment()));
|
|
|
- hlwCompanyAccountService.updateById(hlwCompanyAccount);
|
|
|
+ boolean update = hlwCompanyAccountService.updateById(hlwCompanyAccount);
|
|
|
+ while (!update) {
|
|
|
+ /**
|
|
|
+ * 更新失败,则重新获取
|
|
|
+ */
|
|
|
+ HlwCompanyAccount hlwCompanyAccountNew = hlwCompanyAccountService.getOne(queryWrapper);
|
|
|
+ hlwCompanyAccountNew.setTotalPayment(businessAccountUtils.add(hlwCompanyAccountNew.getTotalPayment(), hlwPayment.getTotalPayment()));
|
|
|
+ hlwCompanyAccountNew.setTotalServiceFee(businessAccountUtils.add(hlwCompanyAccountNew.getTotalServiceFee(), hlwPayment.getServiceFee()));
|
|
|
+ hlwCompanyAccountNew.setBalance(businessAccountUtils.sub(hlwCompanyAccountNew.getBalance(), hlwPayment.getTotalPayment()));
|
|
|
+ update = hlwCompanyAccountService.updateById(hlwCompanyAccountNew);
|
|
|
+ }
|
|
|
+
|
|
|
//企业账户明细表(插入)
|
|
|
HlwCompanyAccountDetail hlwCompanyAccountDetail = new HlwCompanyAccountDetail();
|
|
|
hlwCompanyAccountDetail.setCompanyAccountId(hlwCompanyAccount.getId());
|