1.pmsbug修改,配网统计报表报告
2.技术监督策略,代码提交
This commit is contained in:
@@ -20,6 +20,7 @@ public enum ProcessResponseEnum {
|
||||
PROCESS_ERROR("A00553","当前流程未审核通过,操作失败!"),
|
||||
QUERY_IS_EMPTY("A00554","当前未查询到当前策略信息,无法删除!"),
|
||||
ENABLED_CANNOT_BE_DELETED("A00555","策略为启用状态不能删除!"),
|
||||
THERE_IS_ONLY_ONE_STRATEGY("A00556","自动策略或手动策略,通用策略只能有一条!"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.njcn.process.pojo.param;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <策略监测点绑定>
|
||||
*
|
||||
* @author wr
|
||||
* @createTime: 2023-03-22
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class MonitorParam {
|
||||
|
||||
@ApiModelProperty(value = "单位id")
|
||||
@NotBlank(message = "单位id不能为空")
|
||||
private String deptId;
|
||||
|
||||
@ApiModelProperty(value = "类型 0.预警策略 1.告警策略")
|
||||
@NotEmpty(message = "类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "预警策略/告警策略id")
|
||||
@NotEmpty(message = "策略id集合不能为空")
|
||||
private List<String> alarmId;
|
||||
|
||||
@ApiModelProperty(value = "监测点id")
|
||||
@NotEmpty(message = "监测点id集合不能为空")
|
||||
private List<String> monitorId;
|
||||
|
||||
|
||||
}
|
||||
@@ -57,6 +57,10 @@ public class StrategyParam {
|
||||
@NotNull(message = "等级不能为空")
|
||||
private Integer grade;
|
||||
|
||||
@ApiModelProperty(value = "0.通用策略 1.定值策略")
|
||||
@NotNull(message = "策略选择不能为空")
|
||||
private Integer bigType;
|
||||
|
||||
@ApiModelProperty(value = "区分预警单还是告警单(0:预警单;1:告警单)")
|
||||
@NotNull(message = "区分类别不能为空")
|
||||
private Integer type;
|
||||
@@ -108,6 +112,10 @@ public class StrategyParam {
|
||||
@NotBlank(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "0.通用策略 1.定值策略")
|
||||
@NotNull(message = "策略选择不能为空")
|
||||
private Integer bigType;
|
||||
|
||||
@ApiModelProperty(value = "等级(0:一级;1:二级;2:三级)")
|
||||
@NotNull(message = "等级不能为空")
|
||||
private Integer grade;
|
||||
@@ -134,23 +142,22 @@ public class StrategyParam {
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("变电站信息")
|
||||
private List<Power> childPower;
|
||||
// @ApiModelProperty("变电站信息")
|
||||
// private List<Power> childPower;
|
||||
|
||||
@ApiModelProperty("子节点详细信息")
|
||||
private List<MonitorTree> children;
|
||||
private List<?> children;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Power {
|
||||
public static class Monitor {
|
||||
@ApiModelProperty("id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("监测点信息")
|
||||
private List<Power> childMonitor;
|
||||
@ApiModelProperty("标识")
|
||||
private Integer leven=3;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,6 +42,10 @@ public class ThsWarnStrategy extends BaseEntity implements Serializable {
|
||||
@TableField("Operation")
|
||||
private Integer operation;
|
||||
|
||||
@ApiModelProperty(value = "0.通用策略 1.定值策略")
|
||||
@TableField("Big_Type")
|
||||
private Integer bigType;
|
||||
|
||||
@ApiModelProperty(value = "区分预警单还是告警单(0:预警单;1:告警单)")
|
||||
private Integer type;
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.process.pojo.param.MonitorParam;
|
||||
import com.njcn.process.pojo.param.StrategyParam;
|
||||
import com.njcn.process.pojo.po.ThsDeptAlarm;
|
||||
import com.njcn.process.pojo.po.ThsWarnStrategy;
|
||||
import com.njcn.process.service.ThsWarnStrategyService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -40,7 +40,7 @@ public class ThsWarnStrategyController extends BaseController {
|
||||
private final ThsWarnStrategyService thsWarnStrategyService;
|
||||
|
||||
@PostMapping("/getStrategyPage")
|
||||
@ApiOperation("预警单/告警单策略分页查询")
|
||||
@ApiOperation("分页查询")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
public HttpResult<Page<ThsWarnStrategy>> getStrategyPage(@RequestBody @Validated StrategyParam.StrategyPageParam param) {
|
||||
String methodDescribe = getMethodDescribe("getStrategyPage");
|
||||
@@ -49,7 +49,7 @@ public class ThsWarnStrategyController extends BaseController {
|
||||
}
|
||||
|
||||
@PostMapping("/insertStrategy")
|
||||
@ApiOperation(value = "预警单/告警单单条新增")
|
||||
@ApiOperation(value = "数据添加")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||
public HttpResult<Boolean> insertStrategy(@RequestBody @Validated StrategyParam.StrategyInsertParam param) {
|
||||
String methodDescribe = getMethodDescribe("insertStrategy");
|
||||
@@ -58,7 +58,7 @@ public class ThsWarnStrategyController extends BaseController {
|
||||
}
|
||||
|
||||
@PostMapping("/bindStrategy")
|
||||
@ApiOperation(value = "预警单/告警单信息绑定")
|
||||
@ApiOperation(value = "信息绑定")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||
public HttpResult<Boolean> bindStrategy(@RequestBody @Validated StrategyParam.BindParam param) {
|
||||
String methodDescribe = getMethodDescribe("bindStrategy");
|
||||
@@ -67,7 +67,7 @@ public class ThsWarnStrategyController extends BaseController {
|
||||
}
|
||||
|
||||
@PostMapping("/getUpdateStrategy")
|
||||
@ApiOperation(value = "预警单/告警单修改详细查询")
|
||||
@ApiOperation(value = "详细查询")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
public HttpResult<StrategyParam.StrategyUpdateParam> getUpdateStrategy(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getUpdateStrategy");
|
||||
@@ -76,7 +76,7 @@ public class ThsWarnStrategyController extends BaseController {
|
||||
}
|
||||
|
||||
@PostMapping("/updateStrategy")
|
||||
@ApiOperation(value = "预警单/告警单修改")
|
||||
@ApiOperation(value = "信息修改")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
|
||||
public HttpResult<Boolean> updateStrategy(@RequestBody @Validated StrategyParam.StrategyUpParam param) {
|
||||
String methodDescribe = getMethodDescribe("updateStrategy");
|
||||
@@ -85,7 +85,7 @@ public class ThsWarnStrategyController extends BaseController {
|
||||
}
|
||||
|
||||
@PostMapping("/updateStrategyState")
|
||||
@ApiOperation(value = "预警单/告警单修改状态")
|
||||
@ApiOperation(value = "修改状态")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
|
||||
public HttpResult<Boolean> updateStrategyState(@RequestBody @Validated StrategyParam.StrategyStateParam param) {
|
||||
String methodDescribe = getMethodDescribe("updateStrategyState");
|
||||
@@ -93,26 +93,34 @@ public class ThsWarnStrategyController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/getMonitor")
|
||||
@GetMapping("/getMonitor")
|
||||
@ApiOperation(value = "监测点查询接口")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
public HttpResult<List<StrategyParam.MonitorTree>> getMonitor(@Param("monitorTag") List<String> monitorTag, @Param("orgId") String orgId) {
|
||||
public HttpResult<List<StrategyParam.MonitorTree>> getMonitor(@Param("orgId") String orgId) {
|
||||
String methodDescribe = getMethodDescribe("getMonitor");
|
||||
List<StrategyParam.MonitorTree> monitor = thsWarnStrategyService.getMonitor(monitorTag, orgId);
|
||||
List<StrategyParam.MonitorTree> monitor = thsWarnStrategyService.getMonitor( orgId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/bindMonitor")
|
||||
@ApiOperation(value = "预警单/告警单监测点绑定")
|
||||
@ApiOperation(value = "监测点绑定")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||
public HttpResult<Boolean> bindMonitor(@RequestBody List<ThsDeptAlarm> param) {
|
||||
public HttpResult<Boolean> bindMonitor(@RequestBody MonitorParam param) {
|
||||
String methodDescribe = getMethodDescribe("bindMonitor");
|
||||
Boolean flag = thsWarnStrategyService.bindMonitor(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
|
||||
@GetMapping("/echoMonitor")
|
||||
@ApiOperation(value = "监测点回显")
|
||||
public HttpResult<List<String>> echoMonitor(@Param("deptId") String deptId,@Param("type") Integer type) {
|
||||
String methodDescribe = getMethodDescribe("echoMonitor");
|
||||
List<String> strings = thsWarnStrategyService.echoMonitor(deptId, type);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, strings, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/delStrategy")
|
||||
@ApiOperation(value = "预警单/告警单信息删除")
|
||||
@ApiOperation(value = "信息删除")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||
public HttpResult<Boolean> delStrategy(String ids) {
|
||||
String methodDescribe = getMethodDescribe("delStrategy");
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.njcn.process.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.process.pojo.param.MonitorParam;
|
||||
import com.njcn.process.pojo.param.StrategyParam;
|
||||
import com.njcn.process.pojo.po.ThsDeptAlarm;
|
||||
import com.njcn.process.pojo.po.ThsWarnStrategy;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
@@ -74,14 +74,14 @@ public interface ThsWarnStrategyService extends IService<ThsWarnStrategy> {
|
||||
*/
|
||||
Boolean updateStrategyState(StrategyParam.StrategyStateParam param);
|
||||
|
||||
/***
|
||||
* 监测点查询接口
|
||||
* @author wr
|
||||
* @date 2023-03-10 14:52
|
||||
* @param monitorTag
|
||||
* @return List<PmsMonitorInfoDTO>
|
||||
*/
|
||||
List<StrategyParam.MonitorTree> getMonitor(List<String> monitorTag, String orgId);
|
||||
/***
|
||||
* 监测点查询接口
|
||||
* @author wr
|
||||
* @date 2023-03-22 17:38
|
||||
* @param orgId
|
||||
* @return List<MonitorTree>
|
||||
*/
|
||||
List<StrategyParam.MonitorTree> getMonitor( String orgId);
|
||||
|
||||
|
||||
/***
|
||||
@@ -91,8 +91,17 @@ public interface ThsWarnStrategyService extends IService<ThsWarnStrategy> {
|
||||
* @param param
|
||||
* @return Boolean
|
||||
*/
|
||||
Boolean bindMonitor(List<ThsDeptAlarm> param);
|
||||
Boolean bindMonitor(MonitorParam param);
|
||||
|
||||
/***
|
||||
* 监测点回显
|
||||
* @author wr
|
||||
* @date 2023-03-22 10:44
|
||||
* @param org
|
||||
* @param type
|
||||
* @return List<ThsDeptAlarm>
|
||||
*/
|
||||
List<String> echoMonitor(String org,Integer type);
|
||||
|
||||
/***
|
||||
* 预警单/告警单删除
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.njcn.process.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -13,10 +12,9 @@ import com.njcn.device.pms.api.MonitorClient;
|
||||
import com.njcn.device.pms.enums.PmsDeviceResponseEnum;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
|
||||
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
|
||||
import com.njcn.device.pms.pojo.po.DistributionMonitor;
|
||||
import com.njcn.process.enums.ProcessResponseEnum;
|
||||
import com.njcn.process.pojo.param.MonitorParam;
|
||||
import com.njcn.process.pojo.param.StrategyParam;
|
||||
import com.njcn.process.pojo.po.PmsTerminalDetection;
|
||||
import com.njcn.process.pojo.po.ThsDeptAlarm;
|
||||
import com.njcn.process.pojo.po.ThsWarnStrategy;
|
||||
import com.njcn.process.mapper.ThsWarnStrategyMapper;
|
||||
@@ -67,15 +65,24 @@ public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMappe
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public Boolean insertStrategy(StrategyParam.StrategyInsertParam param) {
|
||||
int count = this.count(new LambdaQueryWrapper<ThsWarnStrategy>()
|
||||
ThsWarnStrategy one = this.getOne(new LambdaQueryWrapper<ThsWarnStrategy>()
|
||||
.eq(ThsWarnStrategy::getName, param.getName())
|
||||
.or(wrapper ->
|
||||
wrapper.eq(ThsWarnStrategy::getGrade, param.getGrade())
|
||||
.eq(ThsWarnStrategy::getBigType, 0)
|
||||
)
|
||||
);
|
||||
if (count > 0) {
|
||||
throw new BusinessException(PmsDeviceResponseEnum.MODEL_NAME_REPEAT);
|
||||
|
||||
if (ObjectUtil.isNotNull(one)) {
|
||||
if(one.getName().equals(param.getName())){
|
||||
throw new BusinessException(PmsDeviceResponseEnum.MODEL_NAME_REPEAT);
|
||||
}
|
||||
throw new BusinessException(ProcessResponseEnum.THERE_IS_ONLY_ONE_STRATEGY);
|
||||
}
|
||||
ThsWarnStrategy thsWarnStrategy = BeanUtil.copyProperties(param, ThsWarnStrategy.class);
|
||||
thsWarnStrategy.setCreateBy(RequestUtil.getUserNickname());
|
||||
thsWarnStrategy.setState(2);
|
||||
thsWarnStrategy.setBigType(param.getBigType());
|
||||
return this.save(thsWarnStrategy);
|
||||
}
|
||||
|
||||
@@ -111,13 +118,21 @@ public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMappe
|
||||
.and(wrapper ->
|
||||
wrapper.eq(ThsWarnStrategy::getName, param.getName())
|
||||
)
|
||||
.or(wrapper ->
|
||||
wrapper.eq( ThsWarnStrategy::getGrade, param.getGrade())
|
||||
.eq(ThsWarnStrategy::getBigType, 0)
|
||||
)
|
||||
|
||||
);
|
||||
if (ObjectUtil.isNotNull(one)) {
|
||||
throw new BusinessException(PmsDeviceResponseEnum.MODEL_NAME_REPEAT);
|
||||
if(one.getName().equals(param.getName())){
|
||||
throw new BusinessException(PmsDeviceResponseEnum.MODEL_NAME_REPEAT);
|
||||
}
|
||||
throw new BusinessException(ProcessResponseEnum.THERE_IS_ONLY_ONE_STRATEGY);
|
||||
}
|
||||
ThsWarnStrategy thsWarnStrategy = BeanUtil.copyProperties(param, ThsWarnStrategy.class);
|
||||
thsWarnStrategy.setUpdateBy(RequestUtil.getUserNickname());
|
||||
thsWarnStrategy.setBigType(param.getBigType());
|
||||
return this.updateById(thsWarnStrategy);
|
||||
}
|
||||
|
||||
@@ -131,9 +146,8 @@ public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMappe
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StrategyParam.MonitorTree> getMonitor(List<String> monitorTag, String orgId) {
|
||||
public List<StrategyParam.MonitorTree> getMonitor(String orgId) {
|
||||
PmsMonitorParam param = new PmsMonitorParam();
|
||||
param.setMonitorTags(monitorTag);
|
||||
List<PmsMonitorDTO> data = monitorClient.getMonitorInfoListByCond(param).getData();
|
||||
//获取部门结构
|
||||
List<DeptDTO> deptInfos = deptFeignClient.getDeptDescendantIndexes(orgId, WebUtil.filterDeptType()).getData();
|
||||
@@ -144,22 +158,50 @@ public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMappe
|
||||
StrategyParam.MonitorTree tree = new StrategyParam.MonitorTree();
|
||||
tree.setId(deptDTOS.get(0).getId());
|
||||
tree.setName(deptDTOS.get(0).getName());
|
||||
tree.setChildPower(getPowers(deptDTOS.get(0).getCode(), data));
|
||||
tree.setChildren(recursionSelectList(orgId, deptInfos, data));
|
||||
List<StrategyParam.MonitorTree> powers = getPowers(deptDTOS.get(0).getCode(), data);
|
||||
powers.addAll(recursionSelectList(orgId, deptInfos, data));
|
||||
tree.setChildren(powers);
|
||||
monitorTrees.add(tree);
|
||||
return monitorTrees;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public Boolean bindMonitor(List<ThsDeptAlarm> param) {
|
||||
//删除之前数据
|
||||
public Boolean bindMonitor(MonitorParam param) {
|
||||
//删除之前数据(根据部门和策略类型)
|
||||
LambdaQueryWrapper<ThsDeptAlarm> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ThsDeptAlarm::getDeptId, param.get(0).getDeptId());
|
||||
lambdaQueryWrapper.in(ThsDeptAlarm::getAlarmId, param.get(0).getDeptId());
|
||||
lambdaQueryWrapper.in(ThsDeptAlarm::getType, param.get(0).getType());
|
||||
lambdaQueryWrapper.eq(ThsDeptAlarm::getDeptId, param.getDeptId());
|
||||
lambdaQueryWrapper.eq(ThsDeptAlarm::getType, param.getType());
|
||||
thsDeptAlarmService.remove(lambdaQueryWrapper);
|
||||
return thsDeptAlarmService.saveBatch(param);
|
||||
|
||||
//信息添加
|
||||
List<ThsDeptAlarm> info=new ArrayList();
|
||||
List<String> alarmIds= param.getAlarmId();
|
||||
List<String> monitorIds= param.getMonitorId();
|
||||
String deptId= param.getDeptId();
|
||||
Integer type= param.getType();
|
||||
//便利信息
|
||||
ThsDeptAlarm alarm;
|
||||
for (String s : alarmIds) {
|
||||
for (String monitorId : monitorIds) {
|
||||
alarm=new ThsDeptAlarm();
|
||||
alarm.setDeptId(deptId);
|
||||
alarm.setType(type);
|
||||
alarm.setAlarmId(s);
|
||||
alarm.setMonitorId(monitorId);
|
||||
info.add(alarm);
|
||||
}
|
||||
}
|
||||
return thsDeptAlarmService.saveBatch(info);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> echoMonitor(String org,Integer type) {
|
||||
List<ThsDeptAlarm> list = thsDeptAlarmService.list(new LambdaQueryWrapper<ThsDeptAlarm>()
|
||||
.eq(ThsDeptAlarm::getDeptId, org)
|
||||
.eq(ThsDeptAlarm::getType, type)
|
||||
);
|
||||
return list.stream().map(ThsDeptAlarm::getMonitorId).distinct().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -213,8 +255,9 @@ public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMappe
|
||||
StrategyParam.MonitorTree tree = new StrategyParam.MonitorTree();
|
||||
tree.setId(customer.getId());
|
||||
tree.setName(customer.getName());
|
||||
tree.setChildPower(getPowers(customer.getCode(), data));
|
||||
List<StrategyParam.MonitorTree> children = recursionSelectList(customer.getId(), deptInfos, data);
|
||||
List<StrategyParam.MonitorTree> children = new ArrayList<>();
|
||||
children.addAll(getPowers(customer.getCode(), data));
|
||||
children.addAll(recursionSelectList(customer.getId(), deptInfos, data));
|
||||
tree.setChildren(children);
|
||||
menuSelectList.add(tree);
|
||||
}));
|
||||
@@ -229,9 +272,9 @@ public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMappe
|
||||
* @param data
|
||||
* @return List<Power>
|
||||
*/
|
||||
private static List<StrategyParam.Power> getPowers(String orgCode, List<PmsMonitorDTO> data) {
|
||||
private static List<StrategyParam.MonitorTree> getPowers(String orgCode, List<PmsMonitorDTO> data) {
|
||||
//变电站信息初始化
|
||||
List<StrategyParam.Power> powers = new ArrayList<>();
|
||||
List<StrategyParam.MonitorTree> powers = new ArrayList<>();
|
||||
//获取监测点信息
|
||||
List<PmsMonitorDTO> monitorDTOS = data.stream().filter(dept -> dept.getOrgId().equals(orgCode)).collect(Collectors.toList());
|
||||
Map<String, List<PmsMonitorDTO>> collect = monitorDTOS.stream().collect(
|
||||
@@ -239,18 +282,18 @@ public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMappe
|
||||
//获取变电站和监测点信息
|
||||
collect.forEach((key, value) -> {
|
||||
String[] split = key.split("_");
|
||||
StrategyParam.Power power = new StrategyParam.Power();
|
||||
StrategyParam.MonitorTree power = new StrategyParam.MonitorTree();
|
||||
power.setId(split[0]);
|
||||
power.setName(split[1]);
|
||||
power.setName("变电站名称: "+split[1]);
|
||||
//监测点信息
|
||||
List<StrategyParam.Power> monitors = new ArrayList();
|
||||
List<StrategyParam.Monitor> monitors = new ArrayList();
|
||||
for (PmsMonitorDTO dto : value) {
|
||||
StrategyParam.Power childMonitor = new StrategyParam.Power();
|
||||
StrategyParam.Monitor childMonitor = new StrategyParam.Monitor();
|
||||
childMonitor.setId(dto.getId());
|
||||
childMonitor.setName(dto.getName());
|
||||
childMonitor.setName("监测点名称: "+getMonitorEventCountdto.getName());
|
||||
monitors.add(childMonitor);
|
||||
}
|
||||
power.setChildMonitor(monitors);
|
||||
power.setChildren(monitors);
|
||||
powers.add(power);
|
||||
});
|
||||
return powers;
|
||||
|
||||
Reference in New Issue
Block a user