Explorar o código

资金模块-调整业务逻辑

huangx %!s(int64=7) %!d(string=hai) anos
pai
achega
3e444f6611

+ 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>