|
@@ -8,7 +8,9 @@ import com.github.pagehelper.PageInfo;
|
|
|
import com.sckw.core.exception.BusinessException;
|
|
import com.sckw.core.exception.BusinessException;
|
|
|
import com.sckw.core.model.constant.NumberConstant;
|
|
import com.sckw.core.model.constant.NumberConstant;
|
|
|
import com.sckw.core.model.enums.DeviceEnum;
|
|
import com.sckw.core.model.enums.DeviceEnum;
|
|
|
|
|
+import com.sckw.core.model.enums.DictEnum;
|
|
|
import com.sckw.core.model.enums.DictItemEnum;
|
|
import com.sckw.core.model.enums.DictItemEnum;
|
|
|
|
|
+import com.sckw.core.model.enums.MessageLogEnum;
|
|
|
import com.sckw.core.model.page.PageRes;
|
|
import com.sckw.core.model.page.PageRes;
|
|
|
import com.sckw.core.utils.IdWorker;
|
|
import com.sckw.core.utils.IdWorker;
|
|
|
import com.sckw.core.utils.RegularUtils;
|
|
import com.sckw.core.utils.RegularUtils;
|
|
@@ -144,6 +146,10 @@ public class ProjectService {
|
|
|
company.setMountainId(headerData.getMountainId());
|
|
company.setMountainId(headerData.getMountainId());
|
|
|
company.setCompanyId(headerData.getCompanyId());
|
|
company.setCompanyId(headerData.getCompanyId());
|
|
|
mountainCompanyMapper.insert(company);
|
|
mountainCompanyMapper.insert(company);
|
|
|
|
|
+ Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
|
|
|
|
|
+ logMap.put("projectName", projectAddDto.getName());
|
|
|
|
|
+ logMap.put("mountainName", projectAddDto.getMountainName());
|
|
|
|
|
+ commonService.insertLog(MessageLogEnum.ADD_PROJECT, headerData, logMap, headerData.getCreateBy() == null ? null : Long.parseLong(headerData.getCreateBy()));
|
|
|
return HttpResult.ok();
|
|
return HttpResult.ok();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -183,13 +189,14 @@ public class ProjectService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
|
- public HttpResult update(ProjectUpdateDTO projectAddDto, HttpServletRequest response) {
|
|
|
|
|
|
|
+ public HttpResult update(ProjectUpdateDTO projectAddDto, HttpServletRequest request) {
|
|
|
|
|
+ HeaderData headerData = commonService.getHeaderData(request);
|
|
|
KwsProject project = new KwsProject();
|
|
KwsProject project = new KwsProject();
|
|
|
BeanUtils.copyProperties(projectAddDto, project);
|
|
BeanUtils.copyProperties(projectAddDto, project);
|
|
|
project.setId(Long.parseLong(projectAddDto.getId()));
|
|
project.setId(Long.parseLong(projectAddDto.getId()));
|
|
|
project.setStatus(NumberConstant.ZERO);
|
|
project.setStatus(NumberConstant.ZERO);
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
- project.setUpdateBy(Long.parseLong(commonService.getHeaderData(response).getUpdateBy()));
|
|
|
|
|
|
|
+ project.setUpdateBy(headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
|
|
|
project.setUpdateTime(now);
|
|
project.setUpdateTime(now);
|
|
|
projectMapper.updateById(project);
|
|
projectMapper.updateById(project);
|
|
|
String fence = projectAddDto.getFence();
|
|
String fence = projectAddDto.getFence();
|
|
@@ -198,13 +205,27 @@ public class ProjectService {
|
|
|
.set(KwsProjectArea::getFence, fence)
|
|
.set(KwsProjectArea::getFence, fence)
|
|
|
.set(KwsProjectArea::getArea, projectAddDto.getArea())
|
|
.set(KwsProjectArea::getArea, projectAddDto.getArea())
|
|
|
);
|
|
);
|
|
|
|
|
+ Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
|
|
|
|
|
+ logMap.put("projectName", projectAddDto.getName());
|
|
|
|
|
+ logMap.put("mountainName", projectAddDto.getMountainName());
|
|
|
|
|
+ commonService.insertLog(MessageLogEnum.UPDATE_PROJECT, headerData, logMap, headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
|
|
|
return HttpResult.ok();
|
|
return HttpResult.ok();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
|
public HttpResult dels(String ids, HttpServletRequest request) {
|
|
public HttpResult dels(String ids, HttpServletRequest request) {
|
|
|
|
|
+ HeaderData headerData = commonService.getHeaderData(request);
|
|
|
List<Long> list = StringUtils.splitStrToList(ids, Long.class);
|
|
List<Long> list = StringUtils.splitStrToList(ids, Long.class);
|
|
|
|
|
+ KwsProject project = projectMapper.selectOne(new LambdaQueryWrapper<KwsProject>()
|
|
|
|
|
+ .eq(KwsProject::getId, list.get(0)));
|
|
|
|
|
+ if (project == null) {
|
|
|
|
|
+ throw new BusinessException("要删除的项目不存在");
|
|
|
|
|
+ }
|
|
|
int update = projectMapper.update(null, new LambdaUpdateWrapper<KwsProject>().in(KwsProject::getId, list).set(KwsProject::getDelFlag, "1"));
|
|
int update = projectMapper.update(null, new LambdaUpdateWrapper<KwsProject>().in(KwsProject::getId, list).set(KwsProject::getDelFlag, "1"));
|
|
|
|
|
+ Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
|
|
|
|
|
+ logMap.put("projectName", project.getName());
|
|
|
|
|
+ logMap.put("mountainName", project.getMountainName());
|
|
|
|
|
+ commonService.insertLog(MessageLogEnum.DELETE_PROJECT, headerData, logMap, headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
|
|
|
if (update < 1) {
|
|
if (update < 1) {
|
|
|
throw new BusinessException("删除失败");
|
|
throw new BusinessException("删除失败");
|
|
|
}
|
|
}
|
|
@@ -261,6 +282,20 @@ public class ProjectService {
|
|
|
String bindDeviceId = bindDevice.getBindDeviceId();
|
|
String bindDeviceId = bindDevice.getBindDeviceId();
|
|
|
//设备主从绑定
|
|
//设备主从绑定
|
|
|
List<KwsDeviceRelation> saveList = new ArrayList<>();
|
|
List<KwsDeviceRelation> saveList = new ArrayList<>();
|
|
|
|
|
+ StringBuilder deviceName = new StringBuilder();
|
|
|
|
|
+ List<KwsDevice> kwsDevices = deviceMapper.selectList(new LambdaQueryWrapper<KwsDevice>()
|
|
|
|
|
+ .eq(KwsDevice::getDelFlag, 0)
|
|
|
|
|
+ .in(KwsDevice::getId, list));
|
|
|
|
|
+ if (CollectionUtils.isEmpty(kwsDevices)) {
|
|
|
|
|
+ throw new BusinessException("需要关联设备不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ for (int i = 0; i < kwsDevices.size(); i++) {
|
|
|
|
|
+ if (i != kwsDevices.size() - 1) {
|
|
|
|
|
+ deviceName.append(kwsDevices.get(i).getName()).append(",");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ deviceName.append(kwsDevices.get(i).getName());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
list.forEach(id -> {
|
|
list.forEach(id -> {
|
|
|
String deviceId = "";
|
|
String deviceId = "";
|
|
|
if (bindDeviceId == null) {
|
|
if (bindDeviceId == null) {
|
|
@@ -327,6 +362,10 @@ public class ProjectService {
|
|
|
);
|
|
);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
|
|
|
|
|
+ logMap.put("projectName", project.getName());
|
|
|
|
|
+ logMap.put("deviceName", deviceName.toString());
|
|
|
|
|
+ commonService.insertLog(MessageLogEnum.ADD_NETWORKING_DEVICE, headerData, logMap, headerData.getCreateBy() == null ? null : Long.parseLong(headerData.getCreateBy()));
|
|
|
return HttpResult.ok();
|
|
return HttpResult.ok();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -383,7 +422,7 @@ public class ProjectService {
|
|
|
return HttpResult.ok();
|
|
return HttpResult.ok();
|
|
|
}
|
|
}
|
|
|
//当前设备下的所有基本要素
|
|
//当前设备下的所有基本要素
|
|
|
- List<ProjectCatLogVO> returnList = new ArrayList<>();
|
|
|
|
|
|
|
+ List<Map<String, ProjectCatLogVO>> returnList = new ArrayList<>();
|
|
|
basicItem(mountainId, projectId, deviceId, kwsDevice, returnList);
|
|
basicItem(mountainId, projectId, deviceId, kwsDevice, returnList);
|
|
|
|
|
|
|
|
//集成要素 折线图
|
|
//集成要素 折线图
|
|
@@ -442,7 +481,7 @@ public class ProjectService {
|
|
|
* @param deviceId 所属设备
|
|
* @param deviceId 所属设备
|
|
|
* @param kwsDevice 设备信息
|
|
* @param kwsDevice 设备信息
|
|
|
* @param returnList 返回数据
|
|
* @param returnList 返回数据
|
|
|
- * @param date 时间范围
|
|
|
|
|
|
|
+ * @param date 时间范围
|
|
|
*/
|
|
*/
|
|
|
private void basicItemByWeek(String mountainId, String projectId, String deviceId, KwsDevice kwsDevice, List<ProjectCatLogVO> returnList, Date date) {
|
|
private void basicItemByWeek(String mountainId, String projectId, String deviceId, KwsDevice kwsDevice, List<ProjectCatLogVO> returnList, Date date) {
|
|
|
List<ProjectDeviceVO> projectDeviceList = projectMapper.selectDeviceByProjectId(mountainId, Long.parseLong(projectId), Long.parseLong(deviceId));
|
|
List<ProjectDeviceVO> projectDeviceList = projectMapper.selectDeviceByProjectId(mountainId, Long.parseLong(projectId), Long.parseLong(deviceId));
|
|
@@ -553,7 +592,7 @@ public class ProjectService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- returnVO.setMapList(mapList);
|
|
|
|
|
|
|
+ returnVO.setMonitor(mapList);
|
|
|
returnList.add(returnVO);
|
|
returnList.add(returnVO);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -562,7 +601,7 @@ public class ProjectService {
|
|
|
/**
|
|
/**
|
|
|
* 集成要素折线图计算
|
|
* 集成要素折线图计算
|
|
|
*/
|
|
*/
|
|
|
- private void integrationItem(HeaderData headerData, String deviceId, KwsDevice kwsDevice, List<ProjectCatLogVO> returnList) {
|
|
|
|
|
|
|
+ private void integrationItem(HeaderData headerData, String deviceId, KwsDevice kwsDevice, List<Map<String, ProjectCatLogVO>> returnList) {
|
|
|
List<KwsDeviceIntegration> deviceIntegrations = deviceIntegrationMapper.selectList(new LambdaQueryWrapper<KwsDeviceIntegration>()
|
|
List<KwsDeviceIntegration> deviceIntegrations = deviceIntegrationMapper.selectList(new LambdaQueryWrapper<KwsDeviceIntegration>()
|
|
|
.eq(KwsDeviceIntegration::getMountainId, headerData.getMountainId())
|
|
.eq(KwsDeviceIntegration::getMountainId, headerData.getMountainId())
|
|
|
.eq(KwsDeviceIntegration::getDeviceId, deviceId)
|
|
.eq(KwsDeviceIntegration::getDeviceId, deviceId)
|
|
@@ -575,6 +614,7 @@ public class ProjectService {
|
|
|
List<KwsIntegration> kwsIntegrations = integrationMapper.selectList(new LambdaQueryWrapper<KwsIntegration>().in(KwsIntegration::getId, longList));
|
|
List<KwsIntegration> kwsIntegrations = integrationMapper.selectList(new LambdaQueryWrapper<KwsIntegration>().in(KwsIntegration::getId, longList));
|
|
|
if (!CollectionUtils.isEmpty(kwsIntegrations) && kwsIntegrations.size() > 0) {
|
|
if (!CollectionUtils.isEmpty(kwsIntegrations) && kwsIntegrations.size() > 0) {
|
|
|
kwsIntegrations.forEach(integration -> {
|
|
kwsIntegrations.forEach(integration -> {
|
|
|
|
|
+ Map<String, ProjectCatLogVO> returnMap = new HashMap<>(NumberConstant.SIXTEEN);
|
|
|
ProjectCatLogVO projectCatLogVO = new ProjectCatLogVO();
|
|
ProjectCatLogVO projectCatLogVO = new ProjectCatLogVO();
|
|
|
String integrationName = integration.getIntegrationName();
|
|
String integrationName = integration.getIntegrationName();
|
|
|
String partNames = integration.getPartNames();
|
|
String partNames = integration.getPartNames();
|
|
@@ -605,8 +645,8 @@ public class ProjectService {
|
|
|
ThresholdLevelVO thresholdLevelVO = new ThresholdLevelVO();
|
|
ThresholdLevelVO thresholdLevelVO = new ThresholdLevelVO();
|
|
|
String thresholdMax = "";
|
|
String thresholdMax = "";
|
|
|
String thresholdMin = "";
|
|
String thresholdMin = "";
|
|
|
- if (listMap.get("1") != null) {
|
|
|
|
|
- KwsThreshold kwsThreshold = listMap.get("1").get(0);
|
|
|
|
|
|
|
+ if (listMap.get(1) != null) {
|
|
|
|
|
+ KwsThreshold kwsThreshold = listMap.get(1).get(0);
|
|
|
thresholdMax = kwsThreshold.getMax();
|
|
thresholdMax = kwsThreshold.getMax();
|
|
|
thresholdMin = kwsThreshold.getMin();
|
|
thresholdMin = kwsThreshold.getMin();
|
|
|
thresholdLevelVO.setThresholdMax(thresholdMax);
|
|
thresholdLevelVO.setThresholdMax(thresholdMax);
|
|
@@ -616,8 +656,8 @@ public class ProjectService {
|
|
|
}
|
|
}
|
|
|
// thresholdMap.put("oneLevelAlarm", map);
|
|
// thresholdMap.put("oneLevelAlarm", map);
|
|
|
projectCatLogVO.setOneLevelAlarm(thresholdLevelVO);
|
|
projectCatLogVO.setOneLevelAlarm(thresholdLevelVO);
|
|
|
- if (listMap.get("2") != null) {
|
|
|
|
|
- KwsThreshold kwsThreshold = listMap.get("2").get(0);
|
|
|
|
|
|
|
+ if (listMap.get(2) != null) {
|
|
|
|
|
+ KwsThreshold kwsThreshold = listMap.get(2).get(0);
|
|
|
thresholdMax = kwsThreshold.getMax();
|
|
thresholdMax = kwsThreshold.getMax();
|
|
|
thresholdMin = kwsThreshold.getMin();
|
|
thresholdMin = kwsThreshold.getMin();
|
|
|
thresholdLevelVO.setThresholdMax(thresholdMax);
|
|
thresholdLevelVO.setThresholdMax(thresholdMax);
|
|
@@ -628,8 +668,8 @@ public class ProjectService {
|
|
|
// thresholdMap.put("twoLevelAlarm", map);
|
|
// thresholdMap.put("twoLevelAlarm", map);
|
|
|
projectCatLogVO.setTwoLevelAlarm(thresholdLevelVO);
|
|
projectCatLogVO.setTwoLevelAlarm(thresholdLevelVO);
|
|
|
|
|
|
|
|
- if (listMap.get("3") != null) {
|
|
|
|
|
- KwsThreshold kwsThreshold = listMap.get("3").get(0);
|
|
|
|
|
|
|
+ if (listMap.get(3) != null) {
|
|
|
|
|
+ KwsThreshold kwsThreshold = listMap.get(3).get(0);
|
|
|
thresholdMax = kwsThreshold.getMax();
|
|
thresholdMax = kwsThreshold.getMax();
|
|
|
thresholdMin = kwsThreshold.getMin();
|
|
thresholdMin = kwsThreshold.getMin();
|
|
|
thresholdLevelVO.setThresholdMax(thresholdMax);
|
|
thresholdLevelVO.setThresholdMax(thresholdMax);
|
|
@@ -676,7 +716,9 @@ public class ProjectService {
|
|
|
mapList.add(map);
|
|
mapList.add(map);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- projectCatLogVO.setMapList(mapList);
|
|
|
|
|
|
|
+ projectCatLogVO.setMonitor(mapList);
|
|
|
|
|
+ returnMap.put(integrationName, projectCatLogVO);
|
|
|
|
|
+ returnList.add(returnMap);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -687,12 +729,15 @@ public class ProjectService {
|
|
|
/**
|
|
/**
|
|
|
* 折线图 基本要素
|
|
* 折线图 基本要素
|
|
|
*/
|
|
*/
|
|
|
- private void basicItem(String mountainId, String projectId, String deviceId, KwsDevice kwsDevice, List<ProjectCatLogVO> returnList) {
|
|
|
|
|
|
|
+ private void basicItem(String mountainId, String projectId, String deviceId, KwsDevice kwsDevice, List<Map<String, ProjectCatLogVO>> returnList) {
|
|
|
List<ProjectDeviceVO> projectDeviceList = projectMapper.selectDeviceByProjectId(mountainId, Long.parseLong(projectId), Long.parseLong(deviceId));
|
|
List<ProjectDeviceVO> projectDeviceList = projectMapper.selectDeviceByProjectId(mountainId, Long.parseLong(projectId), Long.parseLong(deviceId));
|
|
|
if (!CollectionUtils.isEmpty(projectDeviceList)) {
|
|
if (!CollectionUtils.isEmpty(projectDeviceList)) {
|
|
|
for (ProjectDeviceVO projectDeviceVO : projectDeviceList) {
|
|
for (ProjectDeviceVO projectDeviceVO : projectDeviceList) {
|
|
|
|
|
+ Map<String, ProjectCatLogVO> returnMap = new HashMap<>();
|
|
|
ProjectCatLogVO returnVO = new ProjectCatLogVO();
|
|
ProjectCatLogVO returnVO = new ProjectCatLogVO();
|
|
|
String partName = projectDeviceVO.getPartName();
|
|
String partName = projectDeviceVO.getPartName();
|
|
|
|
|
+ Map<String, SystemDict> dictByDictCode = commonService.getDictByDictCode(DictEnum.MODEL_PART);
|
|
|
|
|
+ String itemName = dictByDictCode.get(partName) == null ? partName : dictByDictCode.get(partName).getLabel();
|
|
|
//设置过阈值的基本要素
|
|
//设置过阈值的基本要素
|
|
|
List<KwsDeviceReference> references = deviceReferenceMapper.selectList(new LambdaQueryWrapper<KwsDeviceReference>()
|
|
List<KwsDeviceReference> references = deviceReferenceMapper.selectList(new LambdaQueryWrapper<KwsDeviceReference>()
|
|
|
.eq(KwsDeviceReference::getDeviceId, deviceId)
|
|
.eq(KwsDeviceReference::getDeviceId, deviceId)
|
|
@@ -706,7 +751,8 @@ public class ProjectService {
|
|
|
deviceReference = references.get(0);
|
|
deviceReference = references.get(0);
|
|
|
}
|
|
}
|
|
|
//基准值
|
|
//基准值
|
|
|
- BigDecimal currentValue = deviceReference.getCurrentValue();
|
|
|
|
|
|
|
+ BigDecimal currentValue = deviceReference == null ? null : deviceReference.getCurrentValue();
|
|
|
|
|
+ returnVO.setReference(currentValue);
|
|
|
List<KwsThreshold> kwsThresholds = thresholdMapper.selectList(new LambdaQueryWrapper<KwsThreshold>()
|
|
List<KwsThreshold> kwsThresholds = thresholdMapper.selectList(new LambdaQueryWrapper<KwsThreshold>()
|
|
|
.eq(KwsThreshold::getDelFlag, 0)
|
|
.eq(KwsThreshold::getDelFlag, 0)
|
|
|
.eq(KwsThreshold::getItemName, partName)
|
|
.eq(KwsThreshold::getItemName, partName)
|
|
@@ -723,8 +769,8 @@ public class ProjectService {
|
|
|
ThresholdLevelVO thresholdLevelVO = new ThresholdLevelVO();
|
|
ThresholdLevelVO thresholdLevelVO = new ThresholdLevelVO();
|
|
|
String thresholdMax = "";
|
|
String thresholdMax = "";
|
|
|
String thresholdMin = "";
|
|
String thresholdMin = "";
|
|
|
- if (listMap.get("1") != null) {
|
|
|
|
|
- KwsThreshold kwsThreshold = listMap.get("1").get(0);
|
|
|
|
|
|
|
+ if (listMap.get(1) != null) {
|
|
|
|
|
+ KwsThreshold kwsThreshold = listMap.get(1).get(0);
|
|
|
thresholdMax = kwsThreshold.getMax();
|
|
thresholdMax = kwsThreshold.getMax();
|
|
|
thresholdMin = kwsThreshold.getMin();
|
|
thresholdMin = kwsThreshold.getMin();
|
|
|
thresholdLevelVO.setThresholdMax(thresholdMax);
|
|
thresholdLevelVO.setThresholdMax(thresholdMax);
|
|
@@ -734,8 +780,8 @@ public class ProjectService {
|
|
|
}
|
|
}
|
|
|
// thresholdMap.put("oneLevelAlarm", map);
|
|
// thresholdMap.put("oneLevelAlarm", map);
|
|
|
returnVO.setOneLevelAlarm(thresholdLevelVO);
|
|
returnVO.setOneLevelAlarm(thresholdLevelVO);
|
|
|
- if (listMap.get("2") != null) {
|
|
|
|
|
- KwsThreshold kwsThreshold = listMap.get("2").get(0);
|
|
|
|
|
|
|
+ if (listMap.get(2) != null) {
|
|
|
|
|
+ KwsThreshold kwsThreshold = listMap.get(2).get(0);
|
|
|
thresholdMax = kwsThreshold.getMax();
|
|
thresholdMax = kwsThreshold.getMax();
|
|
|
thresholdMin = kwsThreshold.getMin();
|
|
thresholdMin = kwsThreshold.getMin();
|
|
|
thresholdLevelVO.setThresholdMax(thresholdMax);
|
|
thresholdLevelVO.setThresholdMax(thresholdMax);
|
|
@@ -746,8 +792,8 @@ public class ProjectService {
|
|
|
// thresholdMap.put("twoLevelAlarm", map);
|
|
// thresholdMap.put("twoLevelAlarm", map);
|
|
|
returnVO.setTwoLevelAlarm(thresholdLevelVO);
|
|
returnVO.setTwoLevelAlarm(thresholdLevelVO);
|
|
|
|
|
|
|
|
- if (listMap.get("3") != null) {
|
|
|
|
|
- KwsThreshold kwsThreshold = listMap.get("3").get(0);
|
|
|
|
|
|
|
+ if (listMap.get(3) != null) {
|
|
|
|
|
+ KwsThreshold kwsThreshold = listMap.get(3).get(0);
|
|
|
thresholdMax = kwsThreshold.getMax();
|
|
thresholdMax = kwsThreshold.getMax();
|
|
|
thresholdMin = kwsThreshold.getMin();
|
|
thresholdMin = kwsThreshold.getMin();
|
|
|
thresholdLevelVO.setThresholdMax(thresholdMax);
|
|
thresholdLevelVO.setThresholdMax(thresholdMax);
|
|
@@ -808,8 +854,9 @@ public class ProjectService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- returnVO.setMapList(mapList);
|
|
|
|
|
- returnList.add(returnVO);
|
|
|
|
|
|
|
+ returnVO.setMonitor(mapList);
|
|
|
|
|
+ returnMap.put(itemName, returnVO);
|
|
|
|
|
+ returnList.add(returnMap);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -893,6 +940,23 @@ public class ProjectService {
|
|
|
.set(KwsDevice::getUpdateBy, headerData.getUpdateBy() == null ? Long.parseLong(headerData.getCreateBy()) : Long.parseLong(headerData.getUpdateBy()))
|
|
.set(KwsDevice::getUpdateBy, headerData.getUpdateBy() == null ? Long.parseLong(headerData.getCreateBy()) : Long.parseLong(headerData.getUpdateBy()))
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(deleteList)) {
|
|
|
|
|
+ List<KwsDevice> kwsDevices = deviceMapper.selectList(new LambdaQueryWrapper<KwsDevice>().in(KwsDevice::getId, deleteList).eq(KwsDevice::getDelFlag, 0));
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(kwsDevices)) {
|
|
|
|
|
+ StringBuilder deviceName = new StringBuilder();
|
|
|
|
|
+ for (int i = 0; i < kwsDevices.size(); i++) {
|
|
|
|
|
+ if (i != kwsDevices.size() - 1) {
|
|
|
|
|
+ deviceName.append(kwsDevices.get(i).getName()).append(",");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ deviceName.append(kwsDevices.get(i).getName());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
|
|
|
|
|
+ logMap.put("projectName", project.getName());
|
|
|
|
|
+ logMap.put("deviceName", deviceName.toString());
|
|
|
|
|
+ commonService.insertLog(MessageLogEnum.DELETE_NETWORKING_DEVICE, headerData, logMap, headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
return HttpResult.ok("删除关联设备成功!");
|
|
return HttpResult.ok("删除关联设备成功!");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|