Pārlūkot izejas kodu

避免参数为空时出现异常

buzhanyi 9 mēneši atpakaļ
vecāks
revīzija
acbd87792c

+ 7 - 3
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

@@ -4876,9 +4876,13 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
             List<PmDemand> demandList = pmDemandMapper.selectList(dmLp);
             List<Long> deIds = demandList.stream().map(PmDemand::getDemandId).collect(Collectors.toList());
             //出现流废标情况的项目
-            List<PmBidFailureHis> failureHis = pmBidFailureHisService.listByIds(deIds);
-            lfblmm = failureHis.size() + "";
-            lfbl = getPercent(failureHis.size(), countAfRwxd);
+            if (!ObjectUtils.isEmpty(deIds)) {
+                List<PmBidFailureHis> failureHis = pmBidFailureHisService.listByIds(deIds);
+                lfbl = getPercent(failureHis.size(), countAfRwxd);
+            } else {
+                lfbl = getPercent(0, countAfRwxd);
+            }
+
         }
 
         Map<String, String> result = new HashMap<>();