|
@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.persagy.apm.alarmservice.group.calculatemethod.model.CalculateMethod;
|
|
|
import com.persagy.apm.alarmservice.group.calculatemethod.model.dto.QueryCalculateMethodDTO;
|
|
|
import com.persagy.apm.alarmservice.group.calculatemethod.service.ICalculateMethodService;
|
|
|
+import com.persagy.apm.alarmservice.group.management.model.equip.dto.GroupManagementDTO;
|
|
|
+import com.persagy.apm.alarmservice.group.management.model.equip.vo.GroupManagementVo;
|
|
|
import com.persagy.apm.alarmservice.group.management.service.GroupManagementService;
|
|
|
import com.persagy.apm.alarmservice.group.monitorindicator.model.MonitorIndicator;
|
|
|
import com.persagy.apm.alarmservice.group.monitorindicator.model.dto.QueryMonitorIndicatorDTO;
|
|
@@ -25,8 +27,6 @@ import com.persagy.apm.common.constant.enums.ValidEnum;
|
|
|
import com.persagy.apm.common.context.AppContext;
|
|
|
import com.persagy.apm.common.context.poems.PoemsContext;
|
|
|
import com.persagy.apm.common.model.vo.SimpleObjVO;
|
|
|
-import com.persagy.apm.alarmservice.group.management.model.equip.dto.GroupManagementDTO;
|
|
|
-import com.persagy.apm.alarmservice.group.management.model.equip.vo.GroupManagementVo;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.assertj.core.util.Lists;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -110,14 +110,22 @@ public class ProjectMonitorIndicatorConfigServiceImpl extends ServiceImpl<Projec
|
|
|
*/
|
|
|
@Override
|
|
|
public String updateProjectMonitorIndicatorConfig(UpdateProjectMonitorIndicatorConfigDTO updateProjectMonitorIndicatorConfigDTO) {
|
|
|
- ProjectMonitorIndicatorConfig projectMonitorIndicatorConfig =
|
|
|
- getConfigByObjAndIndicator(
|
|
|
- updateProjectMonitorIndicatorConfigDTO.getObjId(),
|
|
|
- updateProjectMonitorIndicatorConfigDTO.getMonitorIndicatorId());
|
|
|
- projectMonitorIndicatorConfig.setCalculateMethodId(updateProjectMonitorIndicatorConfigDTO.getCalculateMethodId());
|
|
|
- projectMonitorIndicatorConfig.setModifier(AppContext.getContext().getAccountId());
|
|
|
- updateById(projectMonitorIndicatorConfig);
|
|
|
- return projectMonitorIndicatorConfig.getId();
|
|
|
+ List<String> objIdList = updateProjectMonitorIndicatorConfigDTO.getObjId();
|
|
|
+ if (CollectionUtils.isEmpty(objIdList)) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ for (String objId : objIdList) {
|
|
|
+ ProjectMonitorIndicatorConfig projectMonitorIndicatorConfig =
|
|
|
+ getConfigByObjAndIndicator(
|
|
|
+ objId,
|
|
|
+ updateProjectMonitorIndicatorConfigDTO.getMonitorIndicatorId());
|
|
|
+ projectMonitorIndicatorConfig.setCalculateMethodId(updateProjectMonitorIndicatorConfigDTO.getCalculateMethodId());
|
|
|
+ projectMonitorIndicatorConfig.setModifier(AppContext.getContext().getAccountId());
|
|
|
+ updateById(projectMonitorIndicatorConfig);
|
|
|
+ }
|
|
|
+
|
|
|
+ return String.join(",", objIdList);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -216,7 +224,7 @@ public class ProjectMonitorIndicatorConfigServiceImpl extends ServiceImpl<Projec
|
|
|
result.setTotal(0);
|
|
|
|
|
|
// 获取分组下的监测指标,查询条件:设备类+监测指标id列表
|
|
|
- List<MonitorIndicator> monitorIndicators = queryGroupIndicators(
|
|
|
+ List<MonitorIndicator> monitorIndicators = queryGroupIndicators(
|
|
|
pageQueryProjectMonitorIndicatorConfigDTO.getClassCode(),
|
|
|
pageQueryProjectMonitorIndicatorConfigDTO.getMonitorIndicatorId());
|
|
|
if (CollectionUtils.isEmpty(monitorIndicators)) {
|
|
@@ -275,7 +283,7 @@ public class ProjectMonitorIndicatorConfigServiceImpl extends ServiceImpl<Projec
|
|
|
* 根据分页信息截取项目监测指标配置列表
|
|
|
*
|
|
|
* @param pageQueryProjectMonitorIndicatorConfigDTO 分页查询条件
|
|
|
- * @param recordList 全部项目监测指标配置列表
|
|
|
+ * @param recordList 全部项目监测指标配置列表
|
|
|
* @return 截取后的项目监测指标配置列表
|
|
|
* @author lixing
|
|
|
* @version V1.0 2021/9/17 9:29 下午
|
|
@@ -295,7 +303,7 @@ public class ProjectMonitorIndicatorConfigServiceImpl extends ServiceImpl<Projec
|
|
|
* 监测对象+设备组合成成项目监测指标配置列表
|
|
|
*
|
|
|
* @param monitorIndicators 监测对象列表
|
|
|
- * @param objList 设备列表
|
|
|
+ * @param objList 设备列表
|
|
|
* @return 项目监测指标配置列表
|
|
|
* @author lixing
|
|
|
* @version V1.0 2021/9/17 9:27 下午
|
|
@@ -337,7 +345,7 @@ public class ProjectMonitorIndicatorConfigServiceImpl extends ServiceImpl<Projec
|
|
|
/**
|
|
|
* 获取分组下的监测指标
|
|
|
*
|
|
|
- * @param classCode 分组设备编码
|
|
|
+ * @param classCode 分组设备编码
|
|
|
* @param indicatorIds 监测指标id列表
|
|
|
* @return 分组下的监测指标
|
|
|
* @author lixing
|
|
@@ -381,9 +389,9 @@ public class ProjectMonitorIndicatorConfigServiceImpl extends ServiceImpl<Projec
|
|
|
/**
|
|
|
* 获取设备监测指标的默认取值
|
|
|
*
|
|
|
- * @param objId 监测对象id
|
|
|
+ * @param objId 监测对象id
|
|
|
* @param monitorIndicatorId 监测指标id
|
|
|
- * @param projectId 项目id
|
|
|
+ * @param projectId 项目id
|
|
|
* @return 设备监测指标的默认取值
|
|
|
* @author lixing
|
|
|
* @version V1.0 2021/9/17 2:57 下午
|