Browse Source

Merge remote-tracking branch 'origin/dev' into dev

zhoudw 7 years ago
parent
commit
f43404ecab

+ 7 - 7
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java

@@ -237,10 +237,10 @@ public class RecbalanceServiceImpl implements RecbalanceService {
          * cu_leftamount=cu_beginaramount-cu_beginprerecamount+cu_recamount-cu_preamount;
          */
         Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(recbalance.getRb_custid());
-        Double preamount = customerData.getCu_preamount();
-        Double beginapamount = customerData.getCu_beginaramount();
-        Double beginprepayamount= customerData.getCu_beginprerecamount();
-        Double recamount = customerData.getCu_recamount();
+        Double preamount = customerData.getCu_preamount()==null?new Double(0):customerData.getCu_preamount();
+        Double beginapamount = customerData.getCu_beginaramount()==null?new Double(0):customerData.getCu_beginaramount();
+        Double beginprepayamount= customerData.getCu_beginprerecamount()==null?new Double(0):customerData.getCu_beginprerecamount();
+        Double recamount = customerData.getCu_recamount()==null?new Double(0):customerData.getCu_recamount();
 
         Customer customer = new Customer();
         customer.setId(Long.valueOf(String.valueOf(recbalance.getRb_custid())));
@@ -258,9 +258,9 @@ public class RecbalanceServiceImpl implements RecbalanceService {
          * ve_payamount=nvl(ve_payamount,0)+pb_pbdamount,
          * ve_leftamount=ve_beginapamount-ve_beginprepayamount+ve_payamount-ve_preamount;
          */
-        Recbalance rec = recbalanceMapper.selectByPrimaryKey(Long.valueOf(id));
-        Double pay_preamount = rec.getRb_preamount();
-        Double pay_pbdamount = rec.getRb_rbdamount();
+        Recbalance rec = recbalanceMapper.selectByPrimaryKey(Math.toIntExact(id));
+        Double pay_preamount = rec.getRb_preamount()==null?new Double(0):rec.getRb_preamount();
+        Double pay_pbdamount = rec.getRb_rbdamount()==null?new Double(0):rec.getRb_rbdamount();
         Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(rec.getRb_custid());
         Double preamount = customerData.getCu_preamount()==null?(new Double(0)):customerData.getCu_preamount();
         Double beginapamount = customerData.getCu_beginaramount()==null?new Double(0):customerData.getCu_beginaramount();

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/PaybalanceMapper.xml

@@ -597,7 +597,7 @@
     <result column="ve_beginym" property="ve_beginym" jdbcType="INTEGER" />
     <result column="ve_preamount" property="ve_preamount" jdbcType="DOUBLE" />
   </resultMap>
-  <select id="selectVendorByPrimaryKey" resultMap="VendorResultMapper" parameterType="java.lang.Long" >
+  <select id="selectVendorByPrimaryKey" resultMap="VendorResultMapper" parameterType="java.lang.Integer" >
     select
     <include refid="Vendor_Column_List" />
     from vendor

+ 2 - 2
applications/money/money-server/src/main/resources/mapper/RecbalanceMapper.xml

@@ -735,7 +735,7 @@
     updaterid, updatetime, cu_text1, cu_text2, cu_text3, cu_text4, cu_text5, cu_leftamount,
     cu_recamount,cu_preamount
   </sql>
-  <select id="selectCustomerByPrimaryKey" parameterType="java.lang.Long" resultMap="CustomerResultMap">
+  <select id="selectCustomerByPrimaryKey" parameterType="java.lang.Integer" resultMap="CustomerResultMap">
     select
     <include refid="Customer_Column_List" />
     from customer
@@ -833,6 +833,6 @@
         cu_preamount = #{cu_preamount,jdbcType=DOUBLE},
       </if>
     </set>
-    where cu_id = #{id,jdbcType=INTEGER}
+    where cu_id = #{id}
   </update>
 </mapper>

+ 1 - 1
frontend/saas-web/app/view/money/payBalance/FormPanelController.js

@@ -306,7 +306,7 @@ Ext.define('saas.view.money.payBalance.FormPanelController', {
         var sum_pbd_nowbalance = store2.sum('pbd_nowbalance'); // 本次核销金额合计
 
         var flag = sum_pd_amount + pb_discounts - sum_pbd_nowbalance;
-
+         viewModel.set("pb_preamount",flag);
         if(flag != 0) {
             var t = flag > 0 ? '大' : '小';
 

+ 1 - 0
frontend/saas-web/app/view/money/recBalance/FormPanelController.js

@@ -382,6 +382,7 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
 
         var flag = sum_rd_amount + rb_discounts - sum_rbd_nowbalance;
 
+        viewModel.set("rb_preamount",flag);
         if(flag != 0) {
             var t = flag > 0 ? '大' : '小';