Browse Source

1.资金各单加上中间表逻辑

heqinwei 7 years ago
parent
commit
65a7957118

+ 3 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java

@@ -146,6 +146,9 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
             //付款方
             Bankinformation bankinformation = bankinformationMapper.selectByPrimaryKey(bk_id);
             Double beginamount = bankinformation.getBk_beginamount() == null ? new Double(0) : bankinformation.getBk_beginamount();
+//            if (beginamount < bk_amount){
+//                throw new BizException(500, BizExceptionCode.BANK_AMOUNT_NOTENOUGH.getMessage());
+//            }
             Double spending = bankinformation.getBk_spending() == null ? new Double(0) : bankinformation.getBk_spending();
             Double incomme = bankinformation.getBk_income() == null ? new Double(0) : bankinformation.getBk_income();
             bankinformation.setBk_thisamount(beginamount + incomme - spending - bk_amount);

+ 4 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java

@@ -163,7 +163,10 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
         Double bk_amount = othspendings.getOs_amount();
         //付款方
         Bankinformation bankinformation = bankinformationMapper.selectByPrimaryKey(bk_id);
-        Double beginamount = bankinformation.getBk_beginamount();
+        Double beginamount = bankinformation.getBk_beginamount() == null ? new Double(0) : bankinformation.getBk_beginamount();
+//        if (beginamount < bk_amount){
+//            throw new BizException(500, BizExceptionCode.BANK_AMOUNT_NOTENOUGH.getMessage());
+//        }
         Double spending = bankinformation.getBk_spending() == null ? new Double(0) : bankinformation.getBk_spending();
         Double incomme = bankinformation.getBk_income() == null ? new Double(0) : bankinformation.getBk_income();
         bankinformation.setBk_thisamount(beginamount + incomme - spending - bk_amount);