Преглед изворни кода

平台资金管理-A-B-C退款方法修改,重新获取实体对象

ZhangWenQiang пре 5 година
родитељ
комит
90844d9442

+ 9 - 8
happy-boot-module-powerjob/src/main/java/org/jeecg/modules/hlgaccount/service/impl/HlgAccountDetailServiceImpl.java

@@ -588,8 +588,9 @@ public class HlgAccountDetailServiceImpl extends ServiceImpl<HlgAccountDetailMap
     @Override
     public Result<HlgAccountDetail> refundA_B(HlgCpAccountDetail hlgCpAccountDetail) {
         Result<HlgAccountDetail> result = new Result<>();
+        HlgCpAccountDetail hlgCpAccountDetailDto = hlgCpAccountDetailService.getById(hlgCpAccountDetail.getId());
         //平台支付账户
-        HlgCpAccount hlgCpAccount = hlgCpAccountService.getById(hlgCpAccountDetail.getCpAccountId());
+        HlgCpAccount hlgCpAccount = hlgCpAccountService.getById(hlgCpAccountDetailDto.getCpAccountId());
         /**
          * 1、拦截条件:该企业未绑定开心平台
          */
@@ -601,7 +602,7 @@ public class HlgAccountDetailServiceImpl extends ServiceImpl<HlgAccountDetailMap
         /**
          * account-detail(更新)
          */
-        HlgAccountDetail hlgAccountDetail = this.getById(hlgCpAccountDetail.getAccountDetailId());
+        HlgAccountDetail hlgAccountDetail = this.getById(hlgCpAccountDetailDto.getAccountDetailId());
         hlgAccountDetail.setIsDrawback(1);
         this.updateById(hlgAccountDetail);
         /**
@@ -616,16 +617,16 @@ public class HlgAccountDetailServiceImpl extends ServiceImpl<HlgAccountDetailMap
         /**
          * cp_account_detail(更新)
          */
-        hlgCpAccountDetail.setIsDrawback(1);
-        hlgCpAccountDetailService.updateById(hlgCpAccountDetail);
+        hlgCpAccountDetailDto.setIsDrawback(1);
+        hlgCpAccountDetailService.updateById(hlgCpAccountDetailDto);
         /**
          * cp-account(更新)
          */
-        hlgCpAccount.setTotalDeposit(businessAccountUtils.sub(hlgCpAccount.getTotalDeposit(), hlgCpAccountDetail.getAmount()));
-        hlgCpAccount.setTotalDepositServiceFee(businessAccountUtils.sub(hlgCpAccount.getTotalDepositServiceFee(), hlgCpAccountDetail.getServiceFee()));
+        hlgCpAccount.setTotalDeposit(businessAccountUtils.sub(hlgCpAccount.getTotalDeposit(), hlgCpAccountDetailDto.getAmount()));
+        hlgCpAccount.setTotalDepositServiceFee(businessAccountUtils.sub(hlgCpAccount.getTotalDepositServiceFee(), hlgCpAccountDetailDto.getServiceFee()));
         hlgCpAccount.setTotalPaymentServiceFee(businessAccountUtils.sub(hlgCpAccount.getTotalPaymentServiceFee(), hlgAccountDetail.getServiceFee()));
-        hlgCpAccount.setBalance(businessAccountUtils.sub(hlgCpAccount.getBalance(), hlgCpAccountDetail.getAmount()));
-        hlgCpAccount.setServiceFeeBalance(businessAccountUtils.sub(hlgCpAccount.getServiceFeeBalance(), businessAccountUtils.sub(hlgCpAccountDetail.getServiceFee(), hlgAccountDetail.getServiceFee())));
+        hlgCpAccount.setBalance(businessAccountUtils.sub(hlgCpAccount.getBalance(), hlgCpAccountDetailDto.getAmount()));
+        hlgCpAccount.setServiceFeeBalance(businessAccountUtils.sub(hlgCpAccount.getServiceFeeBalance(), businessAccountUtils.sub(hlgCpAccountDetailDto.getServiceFee(), hlgAccountDetail.getServiceFee())));
         hlgCpAccountService.updateById(hlgCpAccount);
         result.success("退款成功");
         return result;