|
@@ -212,16 +212,9 @@ public class ThresholdService {
|
|
|
//翻译
|
|
//翻译
|
|
|
List<String> collect = basiclElementList.stream().map(DeviceElementDTO::getElement).collect(Collectors.toList());
|
|
List<String> collect = basiclElementList.stream().map(DeviceElementDTO::getElement).collect(Collectors.toList());
|
|
|
if (!CollectionUtils.isEmpty(collect)) {
|
|
if (!CollectionUtils.isEmpty(collect)) {
|
|
|
|
|
+ Map<String, SystemDict> dictList = commonService.getDictByDictCode(DictEnum.MODEL_PART);
|
|
|
for (String dict : collect) {
|
|
for (String dict : collect) {
|
|
|
//不查询数据库【kws_device_model_part】 查字典
|
|
//不查询数据库【kws_device_model_part】 查字典
|
|
|
- Map<String, SystemDict> dictList = commonService.getDictList(null,
|
|
|
|
|
- new HashMap<>() {
|
|
|
|
|
- {
|
|
|
|
|
- put("code", DictEnum.MODEL_PART.getCodeType());
|
|
|
|
|
- put("type", "1");
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
itemNameList.add(dictList == null ? dict : (dictList.get(dict) == null ? dict : dictList.get(dict).getLabel()));
|
|
itemNameList.add(dictList == null ? dict : (dictList.get(dict) == null ? dict : dictList.get(dict).getLabel()));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -233,12 +226,12 @@ public class ThresholdService {
|
|
|
itemNameList.addAll(collect1);
|
|
itemNameList.addAll(collect1);
|
|
|
}
|
|
}
|
|
|
dto.setItemNameCount(itemNameList.size());
|
|
dto.setItemNameCount(itemNameList.size());
|
|
|
- dto.setItemName(JSONObject.toJSONString(itemNameList));
|
|
|
|
|
|
|
+ dto.setItemName(JSONObject.toJSONString(itemNameList.stream().distinct().collect(Collectors.toList())));
|
|
|
//获取总数和设置阈值数
|
|
//获取总数和设置阈值数
|
|
|
int deviceTotal = getThresholdNumber(thresholdQuery.getProjectId(), headerData, deviceId);
|
|
int deviceTotal = getThresholdNumber(thresholdQuery.getProjectId(), headerData, deviceId);
|
|
|
dto.setDeviceTotal(String.valueOf(deviceTotal));
|
|
dto.setDeviceTotal(String.valueOf(deviceTotal));
|
|
|
int deviceSetTotal = 0;
|
|
int deviceSetTotal = 0;
|
|
|
- if (!CollectionUtils.isEmpty(kwsThresholds)) {
|
|
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(kwsThresholds) && kwsThresholds.size() > 0) {
|
|
|
deviceSetTotal = kwsThresholds.stream().map(KwsThreshold::getItemName).distinct().collect(Collectors.toList()).size();
|
|
deviceSetTotal = kwsThresholds.stream().map(KwsThreshold::getItemName).distinct().collect(Collectors.toList()).size();
|
|
|
}
|
|
}
|
|
|
dto.setDeviceSetTotal(deviceSetTotal);
|
|
dto.setDeviceSetTotal(deviceSetTotal);
|
|
@@ -246,8 +239,8 @@ public class ThresholdService {
|
|
|
dto.setStatus(setting);
|
|
dto.setStatus(setting);
|
|
|
dto.setStatusName(statusName);
|
|
dto.setStatusName(statusName);
|
|
|
dto.setPhones(phones.toString());
|
|
dto.setPhones(phones.toString());
|
|
|
- dto.setCreateByName(CollectionUtils.isEmpty(kwsThresholds) ? null : kwsThresholds.get(0).getCreateBy().toString());
|
|
|
|
|
- dto.setUpdateByName(CollectionUtils.isEmpty(kwsThresholds) ? null : kwsThresholds.get(0).getUpdateBy().toString());
|
|
|
|
|
|
|
+ dto.setCreateByName(CollectionUtils.isEmpty(kwsThresholds) ? null : (kwsThresholds.get(0).getCreateBy() == null ? null : kwsThresholds.get(0).getCreateBy().toString()));
|
|
|
|
|
+ dto.setUpdateByName(CollectionUtils.isEmpty(kwsThresholds) ? null : (kwsThresholds.get(0).getUpdateBy() == null ? null : kwsThresholds.get(0).getUpdateBy().toString()));
|
|
|
dto.setUpdateTime(CollectionUtils.isEmpty(kwsThresholds) ? null : kwsThresholds.get(0).getCreateTime());
|
|
dto.setUpdateTime(CollectionUtils.isEmpty(kwsThresholds) ? null : kwsThresholds.get(0).getCreateTime());
|
|
|
}
|
|
}
|
|
|
return PageRes.build(info, dtoList);
|
|
return PageRes.build(info, dtoList);
|