pq台账功能修改
This commit is contained in:
@@ -2,6 +2,7 @@ package com.njcn.device.pms.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -26,12 +27,13 @@ public class DistributionMonitor extends BaseEntity {
|
||||
/**
|
||||
* 监测点类别(字典)
|
||||
*/
|
||||
@MppMultiId
|
||||
private String monitorSort;
|
||||
|
||||
/**
|
||||
* 监测点ID
|
||||
*/
|
||||
@TableId
|
||||
@MppMultiId
|
||||
private String monitorId;
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -116,10 +117,19 @@ public interface GeneralDeviceInfoClient {
|
||||
HttpResult<List<RStatOnlinerateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param);
|
||||
|
||||
/**
|
||||
*
|
||||
*根据单位获取投运监测点
|
||||
* @author cdf
|
||||
* @date 2023/6/7
|
||||
*/
|
||||
@PostMapping("/deptGetRunLine")
|
||||
HttpResult<List<String>> deptGetRunLine(@RequestParam("deptId")String deptId);
|
||||
|
||||
|
||||
/**
|
||||
*根据单位获取投运监测点
|
||||
* @author cdf
|
||||
* @date 2023/6/7
|
||||
*/
|
||||
@GetMapping("/deptGetRunLineEvent")
|
||||
HttpResult<List<String>> deptGetRunLineEvent(@RequestParam("deptId")String deptId);
|
||||
}
|
||||
|
||||
@@ -92,6 +92,12 @@ public class GeneralDeviceInfoClientFallbackFactory implements FallbackFactory<G
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取单位投运监测点", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<String>> deptGetRunLineEvent(String deptId) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取单位暂态系统投运监测点", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +17,9 @@ public class AreaLineInfoVO implements Serializable {
|
||||
@ApiModelProperty(name = "lineId",value = "监测点id")
|
||||
private String lineId;
|
||||
|
||||
@ApiModelProperty(name = "num",value = "监测点线路编号")
|
||||
private Integer num;
|
||||
|
||||
@ApiModelProperty(name = "lineName",value = "监测点名称")
|
||||
private String lineName;
|
||||
|
||||
|
||||
@@ -279,13 +279,25 @@ public class GeneralDeviceInfoController extends BaseController {
|
||||
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/deptGetRunLine")
|
||||
@ApiOperation("根据单位获取投运监测点")
|
||||
@ApiImplicitParam(name = "deptId", value = "单位部门索引", required = true)
|
||||
public HttpResult<List<String>> deptGetRunLine(@RequestParam("deptId")String deptId) {
|
||||
String methodDescribe = getMethodDescribe("deptGetRunLine");
|
||||
List<String> runLineIds = generalDeviceService.deptGetRunLine(deptId,Stream.of(0).collect(Collectors.toList()));
|
||||
List<String> runLineIds = generalDeviceService.deptGetRunLine(deptId,Stream.of(0).collect(Collectors.toList()),Stream.of(0,1,2).collect(Collectors.toList()));
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,runLineIds,methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/deptGetRunLineEvent")
|
||||
@ApiOperation("根据单位获取暂态系统投运监测点")
|
||||
@ApiImplicitParam(name = "deptId", value = "单位部门索引", required = true)
|
||||
public HttpResult<List<String>> deptGetRunLineEvent(@RequestParam("deptId")String deptId) {
|
||||
String methodDescribe = getMethodDescribe("deptGetRunLineEvent");
|
||||
List<String> runLineIds = generalDeviceService.deptGetRunLine(deptId,Stream.of(0).collect(Collectors.toList()),Stream.of(0,2).collect(Collectors.toList()));
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,runLineIds,methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -75,5 +75,5 @@ public interface DeptLineMapper extends BaseMapper<DeptLine> {
|
||||
List<TerminalGetBase> orgSubStationGet(@Param("list")List<Integer> devType);
|
||||
|
||||
|
||||
List<String> getLineIdByDeptIds(@Param("deptIds")List<String> deptIds,@Param("runFlag")List<Integer> runFlag);
|
||||
List<String> getLineIdByDeptIds(@Param("deptIds")List<String> deptIds,@Param("runFlag")List<Integer> runFlag,@Param("dataType")List<Integer> dataType);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,11 @@
|
||||
inner join pq_line voltage on point.pid = voltage.id
|
||||
inner join pq_line dev on voltage.pid = dev.id
|
||||
inner join pq_device device on dev.id = device.id
|
||||
where Dev_Model = 1
|
||||
where device.Dev_Model = 1
|
||||
and device.Dev_Data_Type in
|
||||
<foreach collection="dataType" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
and device.run_flag in
|
||||
<foreach collection="runFlag" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
|
||||
@@ -487,12 +487,14 @@
|
||||
subscale.name subScale,
|
||||
pqdevice.IP ip,
|
||||
factory.`Name` manufacturer,
|
||||
voltage.id voltageId,
|
||||
voltage.`Name` voltageName,
|
||||
scale.`Name` voltageScale,
|
||||
pqdevice.run_flag,
|
||||
pqdevice.com_flag,
|
||||
pqsubstation.Lng,
|
||||
pqsubstation.lat,
|
||||
detail.num,
|
||||
detail.ct1,
|
||||
detail.ct2,
|
||||
detail.pt1,
|
||||
|
||||
@@ -44,7 +44,7 @@ public interface DeptLineService extends IService<DeptLine> {
|
||||
* @param ids 部门ids
|
||||
* @return 查询结果
|
||||
*/
|
||||
List<String> getLineByDeptIds(List<String> ids,List<Integer> runFlag);
|
||||
List<String> getLineByDeptIds(List<String> ids,List<Integer> runFlag,List<Integer> dataType);
|
||||
|
||||
/**
|
||||
* 部门解除绑定监测点
|
||||
|
||||
@@ -61,8 +61,8 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getLineByDeptIds(List<String> ids,List<Integer> runFlag) {
|
||||
return this.baseMapper.getLineIdByDeptIds(ids,runFlag);
|
||||
public List<String> getLineByDeptIds(List<String> ids,List<Integer> runFlag,List<Integer> dataType) {
|
||||
return this.baseMapper.getLineIdByDeptIds(ids,runFlag,dataType);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -727,12 +727,19 @@ public class GeneralDeviceService {
|
||||
}
|
||||
|
||||
|
||||
public List<String> deptGetRunLine(String deptId,List<Integer> runFlag) {
|
||||
/**
|
||||
* @param deptId 部门id
|
||||
* @param runFlag 设备运行状态 0:投运 1.热备用 2.停运
|
||||
* @param dataType 系统 0:暂态系统;1:稳态系统;2:两个系统
|
||||
* @author cdf
|
||||
* @date 2023/7/20
|
||||
*/
|
||||
public List<String> deptGetRunLine(String deptId,List<Integer> runFlag,List<Integer> dataType) {
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(deptId, Stream.of(0, 1).collect(Collectors.toList())).getData();
|
||||
if (CollUtil.isNotEmpty(deptDTOList)) {
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getId).distinct().collect(Collectors.toList());
|
||||
|
||||
return deptLineService.getLineByDeptIds(deptIds,runFlag);
|
||||
return deptLineService.getLineByDeptIds(deptIds,runFlag,dataType);
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user