Parcourir la source

健康公示墙数据完善

fllmoyu il y a 5 ans
Parent
commit
c626b7f9fe

+ 8 - 0
web/src/main/java/com/jpsoft/smart/modules/mobile/controller/HealthShowApiController.java

@@ -116,6 +116,8 @@ public class HealthShowApiController {
 
 
                 List<String> deviceNoList = new ArrayList<>();
+                //默认添加一个不存在的设备,以防止公司无设备时返回错误
+                deviceNoList.add("1");
                 for (CompanyInfo companyInfo1 : list) {
                     List<DeviceInfo> deviceInfoList = companyDeviceRelationService.findDeviceByCompanyId(companyInfo1.getId());
                     for (DeviceInfo deviceInfo : deviceInfoList) {
@@ -243,6 +245,8 @@ public class HealthShowApiController {
             if (companyList.size() > 0) {
                 List<String> deviceNoList = new ArrayList<>();
 
+                //默认添加一个不存在的设备,以防止公司无设备时返回错误
+                deviceNoList.add("1");
                 for (CompanyInfo companyInfo1 : companyList) {
                     List<DeviceInfo> deviceInfoList = companyDeviceRelationService.findDeviceByCompanyId(companyInfo1.getId());
                     for (DeviceInfo deviceInfo : deviceInfoList) {
@@ -332,6 +336,8 @@ public class HealthShowApiController {
 
 
                 List<String> deviceNoList = new ArrayList<>();
+                //默认添加一个不存在的设备,以防止公司无设备时返回错误
+                deviceNoList.add("1");
                 for (CompanyInfo companyInfo1 : list) {
                     List<DeviceInfo> deviceInfoList = companyDeviceRelationService.findDeviceByCompanyId(companyInfo1.getId());
                     for (DeviceInfo deviceInfo : deviceInfoList) {
@@ -470,6 +476,8 @@ public class HealthShowApiController {
 
 
                 List<String> deviceNoList = new ArrayList<>();
+                //默认添加一个不存在的设备,以防止公司无设备时返回错误
+                deviceNoList.add("1");
                 for (CompanyInfo companyInfo1 : list) {
                     List<DeviceInfo> deviceInfoList = companyDeviceRelationService.findDeviceByCompanyId(companyInfo1.getId());
                     for (DeviceInfo deviceInfo : deviceInfoList) {