Browse Source

处理空指针

hanqingsong 7 months ago
parent
commit
cdca9e03cc

+ 4 - 2
src/main/java/com/chinaitop/depot/intelligent/priceApproval/service/impl/BusinessFsSaleRevenueServiceImpl.java

@@ -125,10 +125,10 @@ public class BusinessFsSaleRevenueServiceImpl extends ServiceImpl<BusinessFsSale
125
         if (CollectionUtils.isNotEmpty(param.getThreeConsistenceList())) {
125
         if (CollectionUtils.isNotEmpty(param.getThreeConsistenceList())) {
126
             param.getThreeConsistenceList().forEach(threeConsistence -> {
126
             param.getThreeConsistenceList().forEach(threeConsistence -> {
127
                 threeConsistence.setFsSaleRevenueId(param.getId());
127
                 threeConsistence.setFsSaleRevenueId(param.getId());
128
-                threeConsistence.setProvinceAccountingQuantity(threeConsistence.getAccountingQuantity());
128
+                threeConsistence.setProvinceAccountingQuantity(threeConsistence.getAccountingQuantity() == null ? new BigDecimal(0) : threeConsistence.getAccountingQuantity());
129
                 threeConsistence.setAccountingUnitPrice(new BigDecimal(0));
129
                 threeConsistence.setAccountingUnitPrice(new BigDecimal(0));
130
                 threeConsistence.setProvinceAccountingUnitPrice(new BigDecimal(0));
130
                 threeConsistence.setProvinceAccountingUnitPrice(new BigDecimal(0));
131
-                threeConsistence.setProvinceAccountingAmount(threeConsistence.getAccountingAmount());
131
+                threeConsistence.setProvinceAccountingAmount(threeConsistence.getAccountingAmount() == null ? new BigDecimal(0) : threeConsistence.getAccountingAmount());
132
                 threeConsistenceMapper.insert(threeConsistence);
132
                 threeConsistenceMapper.insert(threeConsistence);
133
             });
133
             });
134
         }
134
         }
@@ -157,6 +157,7 @@ public class BusinessFsSaleRevenueServiceImpl extends ServiceImpl<BusinessFsSale
157
             });
157
             });
158
         }
158
         }
159
     }
159
     }
160
+
160
     // 保存子表-原核定入库价格
161
     // 保存子表-原核定入库价格
161
     private void saveApprovalPrice(BusinessFsSaleRevenue param) {
162
     private void saveApprovalPrice(BusinessFsSaleRevenue param) {
162
         if (CollectionUtils.isNotEmpty(param.getApprovalPriceList())) {
163
         if (CollectionUtils.isNotEmpty(param.getApprovalPriceList())) {
@@ -166,6 +167,7 @@ public class BusinessFsSaleRevenueServiceImpl extends ServiceImpl<BusinessFsSale
166
             });
167
             });
167
         }
168
         }
168
     }
169
     }
170
+
169
     // 保存子表-差价上缴
171
     // 保存子表-差价上缴
170
     private void saveDiffPrice(BusinessFsSaleRevenue param) {
172
     private void saveDiffPrice(BusinessFsSaleRevenue param) {
171
         if (CollectionUtils.isNotEmpty(param.getDiffPriceList())) {
173
         if (CollectionUtils.isNotEmpty(param.getDiffPriceList())) {

+ 2 - 2
src/main/resources/mapper/priceApproval/BusinessFsSaleRevenueMapper.xml

@@ -259,8 +259,8 @@
259
     <select id="getDiffPriceInfo" parameterType="string" resultType="com.chinaitop.depot.intelligent.priceApproval.model.BusinessFsSaleRevenueDiffPrice">
259
     <select id="getDiffPriceInfo" parameterType="string" resultType="com.chinaitop.depot.intelligent.priceApproval.model.BusinessFsSaleRevenueDiffPrice">
260
         SELECT
260
         SELECT
261
             dpi.project_type projectType,
261
             dpi.project_type projectType,
262
-            dpi.quantity totalQuantity,
263
-            dpi.amount totalAmount
262
+            IFNULL(dpi.quantity,0) totalQuantity,
263
+	        IFNULL(dpi.amount,0) totalAmount
264
         FROM
264
         FROM
265
             business_fs_out_confirm_diff_price_item dpi
265
             business_fs_out_confirm_diff_price_item dpi
266
         LEFT JOIN business_fs_out_confirm oc ON dpi.fs_out_confirm_id = oc.id
266
         LEFT JOIN business_fs_out_confirm oc ON dpi.fs_out_confirm_id = oc.id