Ver Fonte

fix: 新增对账单界面导出数据异常处理

hejq há 7 anos atrás
pai
commit
99bb0646af

+ 16 - 14
src/main/java/com/uas/platform/b2b/service/impl/ErpProdIODetailServiceImpl.java

@@ -109,20 +109,22 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
         ErpProdIo erpProdIo = new ErpProdIo();
         ErpProdIo erpProdIo = new ErpProdIo();
         erpProdIo.setDetails(details);
         erpProdIo.setDetails(details);
         // 应收总额
         // 应收总额
-        List<TradeCount> totalTrades = apCheckService.getDueTrade(enUU, keyword.getCustomerUU());
-        List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(keyword.getCustomerUU(), enUU);
-        if (!CollectionUtil.isEmpty(totalTrades)) {
-            erpProdIo.setTotalCount(totalTrades);
-            if (!CollectionUtil.isEmpty(vendors)) {
-                String tradeString = JSON.toJSONString(totalTrades);
-                ThreadUtils.task(()
-                    -> commonDao.getJdbcTemplate().update(String.format(ApCheckTask.UPDATE_COUNT_SQL, tradeString, vendors.get(0).getId()))
-                );
-            }
-        }
-        // 本月应收
-        List<TradeCount> thisMonthTrades = apCheckService.getThisMonthTrade(enUU, keyword.getCustomerUU(), checkDate, fromDate, endDate);
-        erpProdIo.setThisMonthCount(thisMonthTrades);
+       if (null != keyword.getCustomerUU()) {
+           List<TradeCount> totalTrades = apCheckService.getDueTrade(enUU, keyword.getCustomerUU());
+           List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(keyword.getCustomerUU(), enUU);
+           if (!CollectionUtil.isEmpty(totalTrades)) {
+               erpProdIo.setTotalCount(totalTrades);
+               if (!CollectionUtil.isEmpty(vendors)) {
+                   String tradeString = JSON.toJSONString(totalTrades);
+                   ThreadUtils.task(()
+                       -> commonDao.getJdbcTemplate().update(String.format(ApCheckTask.UPDATE_COUNT_SQL, tradeString, vendors.get(0).getId()))
+                   );
+               }
+           }
+           // 本月应收
+           List<TradeCount> thisMonthTrades = apCheckService.getThisMonthTrade(enUU, keyword.getCustomerUU(), checkDate, fromDate, endDate);
+           erpProdIo.setThisMonthCount(thisMonthTrades);
+       }
 		return erpProdIo;
 		return erpProdIo;
 	}
 	}
 
 

+ 1 - 1
src/main/webapp/resources/js/index/app.js

@@ -10001,7 +10001,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
 
         $scope.exportApcheckList = function() {
         $scope.exportApcheckList = function() {
             var url = 'sale/apCheck/xls?1=1';
             var url = 'sale/apCheck/xls?1=1';
-            if (angular.isDefined($scope.fromDate) && angular.isDefined($scope.endDate)) {
+            if (null !== $scope.fromDate && null !== $scope.endDate) {
                 url = url + '&fromDate=' + $scope.fromDate + '&endDate=' + $scope.endDate;
                 url = url + '&fromDate=' + $scope.fromDate + '&endDate=' + $scope.endDate;
             }
             }
             if (angular.isDefined($scope.thisMouth)) {
             if (angular.isDefined($scope.thisMouth)) {