浏览代码

下载安装计划生成文件BUG

lin 4 年之前
父节点
当前提交
af243d1489

+ 9 - 0
smart-city-platform/src/main/java/com/bz/smart_city/async/AsyncInstallPlanDownloadTask.java

@@ -103,6 +103,15 @@ public class AsyncInstallPlanDownloadTask {
         Customer customer = customerService.findById(installPlan.getCustomerId());
         //4、获取水表类型数据
         List<Integer> deviceTypeIds = installPlanDeviceTypeMapper.getDeviceIdByPlanId(installPlan.getId());
+        int deviceTypeCount = 0;
+        while (deviceTypeIds.size() == 0){
+            if(deviceTypeCount == 100){
+                break;
+            }
+            log.info("installBuildingList while deviceTypeCount={}",deviceTypeCount);
+            deviceTypeIds = installPlanDeviceTypeMapper.getDeviceIdByPlanId(installPlan.getId());
+            deviceTypeCount++;
+        }
         List<DeviceTypeDto> deviceTypeList = deviceTypeMapper.findByIds(deviceTypeIds);
         ChannelDeviceTypeUse use =  channelDeviceTypeUseMapper.findByDeviceId(deviceTypeIds.get(0));