修改部门下监测点,返回信息和查询入参的修改
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.njcn.device.biz.pojo.dto;
|
package com.njcn.device.biz.pojo.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -13,12 +14,18 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
public class DeptGetChildrenDTO {
|
public class DeptGetChildrenDTO {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "deptId",value = "部门id")
|
||||||
private String deptId;
|
private String deptId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "deptId",value = "部门名称")
|
||||||
private String deptName;
|
private String deptName;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "deptChildren",value = "子集部门code集合")
|
||||||
private List<String> deptChildren;
|
private List<String> deptChildren;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "lineIds",value = "监测点信息")
|
||||||
private List<String> lineIds;
|
private List<String> lineIds;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "pwMonitorIds",value = "配网监测点信息")
|
||||||
|
private List<String> pwMonitorIds;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
package com.njcn.device.biz.pojo.dto;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author wr
|
|
||||||
* @description
|
|
||||||
* @date 2023/4/26 10:08
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class PmsDeptGetChildrenDTO {
|
|
||||||
|
|
||||||
@ApiModelProperty(name = "deptId",value = "部门id")
|
|
||||||
private String deptId;
|
|
||||||
|
|
||||||
@ApiModelProperty(name = "deptId",value = "部门名称")
|
|
||||||
private String deptName;
|
|
||||||
|
|
||||||
@ApiModelProperty(name = "deptChildren",value = "子集部门code集合")
|
|
||||||
private List<String> deptChildren;
|
|
||||||
|
|
||||||
@ApiModelProperty(name = "monitorIds",value = "主网监测点信息")
|
|
||||||
private List<String> monitorIds;
|
|
||||||
|
|
||||||
@ApiModelProperty(name = "pwMonitorIds",value = "配网监测点信息")
|
|
||||||
private List<String> pwMonitorIds;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -20,7 +20,6 @@ public class DeptGetLineParam {
|
|||||||
@ApiModelProperty(name = "deptId",value = "部门id")
|
@ApiModelProperty(name = "deptId",value = "部门id")
|
||||||
private String deptId;
|
private String deptId;
|
||||||
|
|
||||||
@NotBlank(message = "系统类型不可为空")
|
|
||||||
@ApiModelProperty(name = "serverName",value = "系统类型 0.event-boot 1.harmonic-boot")
|
@ApiModelProperty(name = "serverName",value = "系统类型 0.event-boot 1.harmonic-boot")
|
||||||
private String serverName;
|
private String serverName;
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
package com.njcn.device.biz.pojo.param;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author wr
|
|
||||||
* @description
|
|
||||||
* @date 2023/4/26 10:37
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class PmsDeptGetLineParam {
|
|
||||||
@NotBlank(message = "部门id不可为空")
|
|
||||||
@ApiModelProperty(name = "deptId",value = "部门id")
|
|
||||||
private String deptId;
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
package com.njcn.device.pms.controller.ledgerManger;
|
package com.njcn.device.pms.controller.ledgerManger;
|
||||||
|
|
||||||
import cn.hutool.core.date.TimeInterval;
|
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.device.biz.pojo.dto.PmsDeptGetChildrenDTO;
|
import com.njcn.device.biz.pojo.dto.DeptGetChildrenDTO;
|
||||||
import com.njcn.device.biz.pojo.param.PmsDeptGetLineParam;
|
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||||
import com.njcn.device.pms.service.majornetwork.IMonitorService;
|
import com.njcn.device.pms.service.majornetwork.IMonitorService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -42,11 +41,9 @@ public class DeptMonitorController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/deptGetLineIds")
|
@PostMapping("/deptGetLineIds")
|
||||||
@ApiImplicitParam(name = "param", value = "请求参数", required = true)
|
@ApiImplicitParam(name = "param", value = "请求参数", required = true)
|
||||||
public HttpResult<List<PmsDeptGetChildrenDTO>> deptGetLineList(@RequestBody @Validated PmsDeptGetLineParam param) {
|
public HttpResult<List<DeptGetChildrenDTO>> deptGetLineList(@RequestBody @Validated DeptGetLineParam param) {
|
||||||
TimeInterval timer = new TimeInterval();
|
|
||||||
String methodDescribe = getMethodDescribe("deptGetLineList");
|
String methodDescribe = getMethodDescribe("deptGetLineList");
|
||||||
List<PmsDeptGetChildrenDTO> monitor = monitorService.deptMonitor(param);
|
List<DeptGetChildrenDTO> monitor = monitorService.deptMonitor(param);
|
||||||
log.info("运行时长" + timer.intervalRestart());
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package com.njcn.device.pms.service.majornetwork;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||||
import com.njcn.device.biz.pojo.dto.PmsDeptGetChildrenDTO;
|
import com.njcn.device.biz.pojo.dto.DeptGetChildrenDTO;
|
||||||
import com.njcn.device.biz.pojo.param.PmsDeptGetLineParam;
|
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||||
import com.njcn.device.pms.pojo.dto.PmsMonitorBaseDTO;
|
import com.njcn.device.pms.pojo.dto.PmsMonitorBaseDTO;
|
||||||
import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
|
import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
|
||||||
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
||||||
@@ -16,7 +16,6 @@ import com.njcn.device.pq.pojo.po.Overlimit;
|
|||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -142,5 +141,5 @@ public interface IMonitorService extends IService<Monitor> {
|
|||||||
* 根据部门id获取监测点信息
|
* 根据部门id获取监测点信息
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<PmsDeptGetChildrenDTO> deptMonitor(PmsDeptGetLineParam param);
|
List<DeptGetChildrenDTO> deptMonitor(DeptGetLineParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.njcn.device.pms.service.majornetwork.impl;
|
package com.njcn.device.pms.service.majornetwork.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
@@ -10,12 +9,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.device.biz.pojo.dto.PmsDeptGetChildrenDTO;
|
import com.njcn.device.biz.pojo.dto.DeptGetChildrenDTO;
|
||||||
import com.njcn.device.biz.pojo.param.PmsDeptGetLineParam;
|
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||||
import com.njcn.device.biz.utils.COverlimit;
|
import com.njcn.device.biz.utils.COverlimit;
|
||||||
import com.njcn.device.pms.enums.PmsDeviceResponseEnum;
|
import com.njcn.device.pms.enums.PmsDeviceResponseEnum;
|
||||||
import com.njcn.device.pms.mapper.majornetwork.*;
|
import com.njcn.device.pms.mapper.majornetwork.*;
|
||||||
import com.njcn.device.pms.pojo.dto.PmsGeneralDeviceDTO;
|
|
||||||
import com.njcn.device.pms.pojo.dto.PmsMonitorBaseDTO;
|
import com.njcn.device.pms.pojo.dto.PmsMonitorBaseDTO;
|
||||||
import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
|
import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
|
||||||
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
||||||
@@ -325,9 +323,9 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PmsDeptGetChildrenDTO> deptMonitor(PmsDeptGetLineParam param) {
|
public List<DeptGetChildrenDTO> deptMonitor(DeptGetLineParam param) {
|
||||||
//返回主网和配网监测信息
|
//返回主网和配网监测信息
|
||||||
List<PmsDeptGetChildrenDTO> deviceInfos = new ArrayList<>();
|
List<DeptGetChildrenDTO> deviceInfos = new ArrayList<>();
|
||||||
List<DeptDTO> deptInfos = deptFeignClient.getDeptDescendantIndexes(param.getDeptId(), Stream.of(0,1).collect(Collectors.toList())).getData();
|
List<DeptDTO> deptInfos = deptFeignClient.getDeptDescendantIndexes(param.getDeptId(), Stream.of(0,1).collect(Collectors.toList())).getData();
|
||||||
List<DeptDTO> directDeptInfos = deptInfos.stream()
|
List<DeptDTO> directDeptInfos = deptInfos.stream()
|
||||||
.filter(deptDTO -> deptDTO.getPid().equals(param.getDeptId()))
|
.filter(deptDTO -> deptDTO.getPid().equals(param.getDeptId()))
|
||||||
@@ -356,8 +354,14 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
return deviceInfos;
|
return deviceInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
private PmsDeptGetChildrenDTO getPmsMonitor(DeptDTO deptDTO, List<String> deptIdList) {
|
/**
|
||||||
PmsDeptGetChildrenDTO pmsDeptGetChildrenDTO = new PmsDeptGetChildrenDTO();
|
* 获取主配网监测点id集合
|
||||||
|
* @param deptDTO
|
||||||
|
* @param deptIdList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private DeptGetChildrenDTO getPmsMonitor(DeptDTO deptDTO, List<String> deptIdList) {
|
||||||
|
DeptGetChildrenDTO pmsDeptGetChildrenDTO = new DeptGetChildrenDTO();
|
||||||
pmsDeptGetChildrenDTO.setDeptId(deptDTO.getCode());
|
pmsDeptGetChildrenDTO.setDeptId(deptDTO.getCode());
|
||||||
if (deptDTO.getType() == 0) {
|
if (deptDTO.getType() == 0) {
|
||||||
pmsDeptGetChildrenDTO.setDeptName(deptDTO.getArea());
|
pmsDeptGetChildrenDTO.setDeptName(deptDTO.getArea());
|
||||||
@@ -371,10 +375,10 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
//配网监测点
|
//配网监测点
|
||||||
List<PmsMonitorBaseDTO> pwMonitorList = iDistributionMonitorService.getMonitorByCondition(deptIdList,null);
|
List<PmsMonitorBaseDTO> pwMonitorList = iDistributionMonitorService.getMonitorByCondition(deptIdList,null);
|
||||||
|
|
||||||
pmsDeptGetChildrenDTO.setMonitorIds(monitorList.stream().map(Monitor::getId).distinct().collect(Collectors.toList()));
|
pmsDeptGetChildrenDTO.setLineIds(monitorList.stream().map(Monitor::getId).distinct().collect(Collectors.toList()));
|
||||||
pmsDeptGetChildrenDTO.setPwMonitorIds(pwMonitorList.stream().map(PmsMonitorBaseDTO::getMonitorId).distinct().collect(Collectors.toList()));
|
pmsDeptGetChildrenDTO.setPwMonitorIds(pwMonitorList.stream().map(PmsMonitorBaseDTO::getMonitorId).distinct().collect(Collectors.toList()));
|
||||||
}else{
|
}else{
|
||||||
pmsDeptGetChildrenDTO.setMonitorIds(new ArrayList<>());
|
pmsDeptGetChildrenDTO.setLineIds(new ArrayList<>());
|
||||||
pmsDeptGetChildrenDTO.setPwMonitorIds(new ArrayList<>());
|
pmsDeptGetChildrenDTO.setPwMonitorIds(new ArrayList<>());
|
||||||
}
|
}
|
||||||
return pmsDeptGetChildrenDTO;
|
return pmsDeptGetChildrenDTO;
|
||||||
|
|||||||
Reference in New Issue
Block a user