소스 검색

新需求

魏超 5 년 전
부모
커밋
0a428f762c
1개의 변경된 파일13개의 추가작업 그리고 3개의 파일을 삭제
  1. 13
    3
      src/main/java/com/huiju/estateagents/redpack/service/impl/TaOrgOrderServiceImpl.java

+ 13
- 3
src/main/java/com/huiju/estateagents/redpack/service/impl/TaOrgOrderServiceImpl.java 파일 보기

482
         ResponseBean responseBean = new ResponseBean();
482
         ResponseBean responseBean = new ResponseBean();
483
 
483
 
484
         //订单退款申请,更新账户的实际余额
484
         //订单退款申请,更新账户的实际余额
485
+        refundApplication.setOrderId(id);
485
         TaOrgAccount taOrgAccount = assembleRefundAccount(refundApplication.getOrgId(), refundApplication, CommConstant.ITEM_TYPE_REFUND);
486
         TaOrgAccount taOrgAccount = assembleRefundAccount(refundApplication.getOrgId(), refundApplication, CommConstant.ITEM_TYPE_REFUND);
486
         taOrgAccountMapper.updateById(taOrgAccount);
487
         taOrgAccountMapper.updateById(taOrgAccount);
487
 
488
 
519
         ResponseBean responseBean = new ResponseBean();
520
         ResponseBean responseBean = new ResponseBean();
520
 
521
 
521
         //退款订单驳回,更新账户的可用余额
522
         //退款订单驳回,更新账户的可用余额
523
+        refundApplication.setOrderId(id);
522
         TaOrgAccount taOrgAccount = assembleRefundAccount(refundApplication.getOrgId(), refundApplication, CommConstant.ITEM_TYPE_REJECT);
524
         TaOrgAccount taOrgAccount = assembleRefundAccount(refundApplication.getOrgId(), refundApplication, CommConstant.ITEM_TYPE_REJECT);
523
         taOrgAccountMapper.updateById(taOrgAccount);
525
         taOrgAccountMapper.updateById(taOrgAccount);
524
 
526
 
562
         rechargeAccount.setAccountId(selectOneAccount.getAccountId());
564
         rechargeAccount.setAccountId(selectOneAccount.getAccountId());
563
 
565
 
564
         if (CommConstant.ITEM_TYPE_REFUND.equals(operateType)) {
566
         if (CommConstant.ITEM_TYPE_REFUND.equals(operateType)) {
565
-            rechargeAccount.setRealBalance(selectOneAccount.getRealBalance() - refundApplication.getAmount());
566
-            rechargeAccount.setTotalRefund(selectOneAccount.getTotalRefund() + refundApplication.getAmount());
567
+            TaOrgRefundApplication taOrgRefundApplication = selectRefundApplication(refundApplication);
568
+            rechargeAccount.setRealBalance(selectOneAccount.getRealBalance() - taOrgRefundApplication.getAmount());
569
+            rechargeAccount.setTotalRefund(selectOneAccount.getTotalRefund() + taOrgRefundApplication.getAmount());
567
         }
570
         }
568
 
571
 
569
         if (CommConstant.ITEM_TYPE_REJECT.equals(operateType)) {
572
         if (CommConstant.ITEM_TYPE_REJECT.equals(operateType)) {
570
-            rechargeAccount.setAvailableBalance(refundApplication.getAmount());
573
+            TaOrgRefundApplication taOrgRefundApplication = selectRefundApplication(refundApplication);
574
+            rechargeAccount.setAvailableBalance(selectOneAccount.getAvailableBalance() + taOrgRefundApplication.getAmount());
571
         }
575
         }
572
 
576
 
573
         rechargeAccount.setModifyDate(LocalDateTime.now());
577
         rechargeAccount.setModifyDate(LocalDateTime.now());
713
         return sysUser;
717
         return sysUser;
714
     }
718
     }
715
 
719
 
720
+    public TaOrgRefundApplication selectRefundApplication(TaOrgRefundApplication refundApplication){
721
+        QueryWrapper<TaOrgRefundApplication> taOrgRefundApplicationQueryWrapper = new QueryWrapper<>();
722
+        taOrgRefundApplicationQueryWrapper.eq("order_id", refundApplication.getOrderId());
723
+        return taOrgRefundApplicationMapper.selectOne(taOrgRefundApplicationQueryWrapper);
724
+    }
725
+
716
 }
726
 }