24282 1 hari lalu
induk
melakukan
4c48db8a4d

+ 4 - 4
hx-account/src/main/java/com/fjhx/account/service/account/impl/AccountPaymentServiceImpl.java

@@ -181,10 +181,10 @@ public class AccountPaymentServiceImpl extends ServiceImpl<AccountPaymentMapper,
             throw new ServiceException("该账户不存在此币种,请前往资金账户添加");
         }
 
-        // 如果余额小于付款金额则返回账户余额不足
-        if (accountRemainder.getRemainder().compareTo(accountPaymentDto.getAmount()) < 0) {
-            throw new ServiceException("账户余额不足");
-        }
+        //// 如果余额小于付款金额则返回账户余额不足
+        //if (accountRemainder.getRemainder().compareTo(accountPaymentDto.getAmount()) < 0) {
+        //    throw new ServiceException("账户余额不足");
+        //}
 
         //刷新打款信息
         AccountPayment oldAccountPayment = this.getById(accountPaymentDto.getId());

+ 62 - 74
hx-account/src/main/resources/mapper/account/AccountRunningWaterMapper.xml

@@ -9,82 +9,70 @@
                                            join exchange_settlement_detail esr on esr.contract_id = c.id
                                   where esr.exchange_settlement_id = arw.business_id),
                   IF
-                      (
-                              arw.type = 40,
-                              (SELECT GROUP_CONCAT(c.`code`)
-                               FROM tax_refund_details trd
-                                        LEFT JOIN bytesailing_sale.contract c ON c.id = trd.contract_id
-                               WHERE trd.account_running_water_id = arw.id),
-                              IF
-                                  (
-                                          arw.type = 30, (SELECT GROUP_CONCAT(clc.contract_code)
-                                                          FROM bytesailing_sale.claim cl
-                                                                   LEFT JOIN bytesailing_sale.claim_contract clc ON clc.claim_id = cl.id
-                                                          WHERE cl.business_id = arw.id),
-                                          (SELECT IF
-                                                      (
-                                                              t1.type = 20,
-                                                              (SELECT GROUP_CONCAT(c.`code`)
-                                                               FROM bytesailing_purchase.pay pa
-                                                                        LEFT JOIN bytesailing_purchase.pay_detail pad ON pad.pay_id = pa.id
-                                                                  LEFT JOIN bytesailing_purchase.purchase p ON pad.purchase_id = p.id
-                                                                  LEFT JOIN bytesailing_sale.contract c ON p.data_resource_id = c.id
-                                                                  WHERE
-                                                                  t1.business_id = pa.id ),(
-					SELECT
-						GROUP_CONCAT( t4.`code` )
-					FROM
-						account_request_funds t2
-						LEFT JOIN account_request_funds_detail t3 ON t2.id = t3.account_request_funds_id
-						LEFT JOIN `bytesailing_sale`.contract t4 ON t3.contract_id = t4.id
-					WHERE
-						t1.business_id = t2.id
-					)
-				) contractCodes
-                                           FROM account_payment t1
-                                           WHERE t1.id = arw.business_id)
-                                  )
-                      )
-                   ) AS contractCodes,
+                  (
+                          arw.type = 40,
+                          (SELECT GROUP_CONCAT(c.`code`)
+                           FROM tax_refund_details trd
+                                    LEFT JOIN bytesailing_sale.contract c ON c.id = trd.contract_id
+                           WHERE trd.account_running_water_id = arw.id),
+                          IF
+                          (
+                                  arw.type = 30, (SELECT GROUP_CONCAT(clc.contract_code)
+                                                  FROM bytesailing_sale.claim cl
+                                                           LEFT JOIN bytesailing_sale.claim_contract clc ON clc.claim_id = cl.id
+                                                  WHERE cl.business_id = arw.id),
+                                  (SELECT IF
+                                          (
+                                                  t1.type = 20,
+                                                  (SELECT GROUP_CONCAT(c.`code`)
+                                                   FROM bytesailing_purchase.pay pa
+                                                            LEFT JOIN bytesailing_purchase.pay_detail pad ON pad.pay_id = pa.id
+                                                            LEFT JOIN bytesailing_purchase.purchase p ON pad.purchase_id = p.id
+                                                            LEFT JOIN bytesailing_sale.contract c ON p.data_resource_id = c.id
+                                                   WHERE t1.business_id = pa.id), (SELECT GROUP_CONCAT(t4.`code`)
+                                                                                   FROM account_request_funds t2
+                                                                                            LEFT JOIN account_request_funds_detail t3 ON t2.id = t3.account_request_funds_id
+                                                                                            LEFT JOIN `bytesailing_sale`.contract t4 ON t3.contract_id = t4.id
+                                                                                   WHERE t1.business_id = t2.id)
+                                          ) contractCodes
+                                   FROM account_payment t1
+                                   WHERE t1.id = arw.business_id)
+                          )
+                  )
+               ) AS     contractCodes,
                if(arw.type = 60, (select c.`id` from bytesailing_sale.contract c where c.id = arw.business_id),
                   IF
-                      (
-                              arw.type = 40,
-                              (SELECT GROUP_CONCAT(c.`id`)
-                               FROM tax_refund_details trd
-                                        LEFT JOIN bytesailing_sale.contract c ON c.id = trd.contract_id
-                               WHERE trd.account_running_water_id = arw.id),
-                              IF
-                                  (
-                                          arw.type = 30, (SELECT GROUP_CONCAT(clc.contract_id)
-                                                          FROM bytesailing_sale.claim cl
-                                                                   LEFT JOIN bytesailing_sale.claim_contract clc ON clc.claim_id = cl.id
-                                                          WHERE cl.business_id = arw.id),
-                                          (SELECT IF
-                                                      (
-                                                              t1.type = 20,
-                                                              (SELECT GROUP_CONCAT(c.`id`)
-                                                               FROM bytesailing_purchase.pay pa
-                                                                        LEFT JOIN bytesailing_purchase.pay_detail pad ON pad.pay_id = pa.id
-                                                                  LEFT JOIN bytesailing_purchase.purchase p ON pad.purchase_id = p.id
-                                                                  LEFT JOIN bytesailing_sale.contract c ON p.data_resource_id = c.id
-                                                                  WHERE
-                                                                  t1.business_id = pa.id ),(
-					SELECT
-						GROUP_CONCAT( t4.`id` )
-					FROM
-						account_request_funds t2
-						LEFT JOIN account_request_funds_detail t3 ON t2.id = t3.account_request_funds_id
-						LEFT JOIN `bytesailing_sale`.contract t4 ON t3.contract_id = t4.id
-					WHERE
-						t1.business_id = t2.id
-					)
-				) contractCodes
-                                           FROM account_payment t1
-                                           WHERE t1.id = arw.business_id)
-                                  )
-                      )
-                   ) AS contractIds,
+                  (
+                          arw.type = 40,
+                          (SELECT GROUP_CONCAT(c.`id`)
+                           FROM tax_refund_details trd
+                                    LEFT JOIN bytesailing_sale.contract c ON c.id = trd.contract_id
+                           WHERE trd.account_running_water_id = arw.id),
+                          IF
+                          (
+                                  arw.type = 30, (SELECT GROUP_CONCAT(clc.contract_id)
+                                                  FROM bytesailing_sale.claim cl
+                                                           LEFT JOIN bytesailing_sale.claim_contract clc ON clc.claim_id = cl.id
+                                                  WHERE cl.business_id = arw.id),
+                                  (SELECT IF
+                                          (
+                                                  t1.type = 20,
+                                                  (SELECT GROUP_CONCAT(c.`id`)
+                                                   FROM bytesailing_purchase.pay pa
+                                                            LEFT JOIN bytesailing_purchase.pay_detail pad ON pad.pay_id = pa.id
+                                                            LEFT JOIN bytesailing_purchase.purchase p ON pad.purchase_id = p.id
+                                                            LEFT JOIN bytesailing_sale.contract c ON p.data_resource_id = c.id
+                                                   WHERE t1.business_id = pa.id), (SELECT GROUP_CONCAT(t4.`id`)
+                                                                                   FROM account_request_funds t2
+                                                                                            LEFT JOIN account_request_funds_detail t3 ON t2.id = t3.account_request_funds_id
+                                                                                            LEFT JOIN `bytesailing_sale`.contract t4 ON t3.contract_id = t4.id
+                                                                                   WHERE t1.business_id = t2.id)
+                                          ) contractCodes
+                                   FROM account_payment t1
+                                   WHERE t1.id = arw.business_id)
+                          )
+                  )
+               ) AS     contractIds,
                am.alias accountManagementName,
                am.corporation_id
         FROM account_running_water arw