Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -5,9 +5,11 @@ import com.njcn.common.pojo.response.HttpResult;
|
|||||||
import com.njcn.device.pms.api.fallback.MonitorClientFallbackFactory;
|
import com.njcn.device.pms.api.fallback.MonitorClientFallbackFactory;
|
||||||
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;
|
||||||
|
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
|
||||||
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
|
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
|
||||||
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
|
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
|
||||||
import com.njcn.device.pms.pojo.po.Monitor;
|
import com.njcn.device.pms.pojo.po.Monitor;
|
||||||
|
import com.njcn.device.pms.pojo.vo.MonitorVO;
|
||||||
import com.njcn.device.pq.pojo.po.Overlimit;
|
import com.njcn.device.pq.pojo.po.Overlimit;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -44,7 +46,7 @@ public interface MonitorClient {
|
|||||||
* @return com.njcn.common.pojo.response.HttpResult<java.util.List < com.njcn.device.pms.pojo.dto.PmsMonitorDTO>>
|
* @return com.njcn.common.pojo.response.HttpResult<java.util.List < com.njcn.device.pms.pojo.dto.PmsMonitorDTO>>
|
||||||
*/
|
*/
|
||||||
@PostMapping("/getMonitorInfoListByCond")
|
@PostMapping("/getMonitorInfoListByCond")
|
||||||
public HttpResult<List<PmsMonitorDTO>> getMonitorInfoListByCond(@RequestBody PmsMonitorParam pmsMonitorParam);
|
HttpResult<List<PmsMonitorDTO>> getMonitorInfoListByCond(@RequestBody PmsMonitorParam pmsMonitorParam);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -66,4 +68,13 @@ public interface MonitorClient {
|
|||||||
HttpResult<List<Monitor>> getMonitorList(@RequestBody List<String> monitorIds);
|
HttpResult<List<Monitor>> getMonitorList(@RequestBody List<String> monitorIds);
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 获取台账和终端信息(波形专用)
|
||||||
|
* @author wr
|
||||||
|
* @date 2023-03-23 10:53
|
||||||
|
* @param param
|
||||||
|
* @return HttpResult<List<Monitor>>
|
||||||
|
*/
|
||||||
|
@PostMapping("getMonitorTerminal")
|
||||||
|
HttpResult<MonitorVO> getMonitorTerminal(@RequestBody MonitorTerminalParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,11 @@ import com.njcn.common.pojo.response.HttpResult;
|
|||||||
import com.njcn.device.pms.api.MonitorClient;
|
import com.njcn.device.pms.api.MonitorClient;
|
||||||
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;
|
||||||
|
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
|
||||||
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
|
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
|
||||||
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
|
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
|
||||||
import com.njcn.device.pms.pojo.po.Monitor;
|
import com.njcn.device.pms.pojo.po.Monitor;
|
||||||
|
import com.njcn.device.pms.pojo.vo.MonitorVO;
|
||||||
import com.njcn.device.pms.utils.PmsDeviceEnumUtil;
|
import com.njcn.device.pms.utils.PmsDeviceEnumUtil;
|
||||||
import com.njcn.device.pq.pojo.po.Overlimit;
|
import com.njcn.device.pq.pojo.po.Overlimit;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
@@ -59,6 +61,12 @@ public class MonitorClientFallbackFactory implements FallbackFactory<MonitorClie
|
|||||||
log.error("{}异常,降级处理,异常为:{}", "获取主网监测点数据 ", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "获取主网监测点数据 ", throwable.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<MonitorVO> getMonitorTerminal(MonitorTerminalParam param) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "获取台账和终端信息(波形专用) ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.njcn.device.pms.pojo.param;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <监测点波形入参>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @createTime: 2023-03-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MonitorTerminalParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
@NotBlank(message = "id不能为空")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "区分主配网(0:主网 1:配网)")
|
||||||
|
@NotNull(message = "区分类别不能为空")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "区分系统(0:pq 1:pms)")
|
||||||
|
@NotNull(message = "区分系统不能为空")
|
||||||
|
private Integer systemType;
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.njcn.device.pms.pojo.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <功能描述>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @createTime: 2023-03-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MonitorVO {
|
||||||
|
/**
|
||||||
|
* 监测点ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "id", value = "监测点ID")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "name", value = "监测点名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测终端接线方式(字典)
|
||||||
|
*/
|
||||||
|
private String terminalWiringMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IP地址
|
||||||
|
*/
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通信端口
|
||||||
|
*/
|
||||||
|
private String port;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pt变比
|
||||||
|
*/
|
||||||
|
private Double pt1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pt变比
|
||||||
|
*/
|
||||||
|
private Double pt2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ct变比
|
||||||
|
*/
|
||||||
|
private Double ct1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ct变比
|
||||||
|
*/
|
||||||
|
private Double ct2;
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.device.pms.controller.ledgerManger;
|
package com.njcn.device.pms.controller.ledgerManger;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.constant.OperateType;
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
@@ -11,12 +12,9 @@ import com.njcn.common.utils.HttpResultUtil;
|
|||||||
import com.njcn.device.pms.annotation.TerminalOperationLogDesc;
|
import com.njcn.device.pms.annotation.TerminalOperationLogDesc;
|
||||||
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;
|
||||||
import com.njcn.device.pms.pojo.param.TerminalQueryParam;
|
import com.njcn.device.pms.pojo.param.*;
|
||||||
import com.njcn.device.pms.pojo.param.MonitorParam;
|
|
||||||
import com.njcn.device.pms.pojo.param.MonitorStatus;
|
|
||||||
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
|
|
||||||
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
|
|
||||||
import com.njcn.device.pms.pojo.po.Monitor;
|
import com.njcn.device.pms.pojo.po.Monitor;
|
||||||
|
import com.njcn.device.pms.pojo.vo.MonitorVO;
|
||||||
import com.njcn.device.pms.pojo.vo.PmsMonitorVO;
|
import com.njcn.device.pms.pojo.vo.PmsMonitorVO;
|
||||||
import com.njcn.device.pms.service.majornetwork.IMonitorService;
|
import com.njcn.device.pms.service.majornetwork.IMonitorService;
|
||||||
|
|
||||||
@@ -270,5 +268,18 @@ public class PmsMonitorController extends BaseController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getMonitorTerminal")
|
||||||
|
@ApiOperation("获取台账和终端信息(波形专用)")
|
||||||
|
@ApiImplicitParam(name = "monitorParam", value = "主网监测点实体", required = true)
|
||||||
|
public HttpResult<MonitorVO> getMonitorTerminal(@RequestBody MonitorTerminalParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("getMonitorTerminal");
|
||||||
|
MonitorVO monitorVO = monitorService.monitorTerminal(param);
|
||||||
|
if (ObjectUtil.isEmpty(monitorVO)) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitorVO, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
|
|||||||
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
|
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
|
||||||
import com.njcn.device.pms.pojo.param.PwPmsMonitorParam;
|
import com.njcn.device.pms.pojo.param.PwPmsMonitorParam;
|
||||||
import com.njcn.device.pms.pojo.po.Monitor;
|
import com.njcn.device.pms.pojo.po.Monitor;
|
||||||
|
import com.njcn.device.pms.pojo.vo.MonitorVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -56,4 +57,22 @@ public interface MonitorMapper extends BaseMapper<Monitor> {
|
|||||||
List<PmsMonitorInfoDTO> getMonitorInfo(@Param("pmsMonitorInfoParam") PmsMonitorInfoParam pmsMonitorInfoParam);
|
List<PmsMonitorInfoDTO> getMonitorInfo(@Param("pmsMonitorInfoParam") PmsMonitorInfoParam pmsMonitorInfoParam);
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 主网监测点和终端信息(波形查看专用)
|
||||||
|
* @author wr
|
||||||
|
* @date 2023-03-23 10:21
|
||||||
|
* @param id
|
||||||
|
* @return MonitorVO
|
||||||
|
*/
|
||||||
|
MonitorVO getMonitorTerminal(@Param("id")String id);
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 配网监测点和终端信息(波形查看专用)
|
||||||
|
* @author wr
|
||||||
|
* @date 2023-03-23 10:21
|
||||||
|
* @param id
|
||||||
|
* @return MonitorVO
|
||||||
|
*/
|
||||||
|
MonitorVO getPwMonitorTerminal(@Param("id")String id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,7 +131,37 @@
|
|||||||
AND pm.`Name` LIKE CONCAT('%',#{pmsMonitorInfoParam.monitorName},'%')
|
AND pm.`Name` LIKE CONCAT('%',#{pmsMonitorInfoParam.monitorName},'%')
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getMonitorTerminal" resultType="com.njcn.device.pms.pojo.vo.MonitorVO">
|
||||||
|
SELECT
|
||||||
|
pm.Id,
|
||||||
|
pm.NAME,
|
||||||
|
pm.Terminal_Wiring_Method,
|
||||||
|
pt.Ip,
|
||||||
|
pt.Port,
|
||||||
|
pm.Pt1,
|
||||||
|
pm.Pt2,
|
||||||
|
pm.Ct1,
|
||||||
|
pm.Ct2
|
||||||
|
FROM
|
||||||
|
pms_monitor pm
|
||||||
|
INNER JOIN pms_terminal pt on pt.Id=pm.Terminal_Id
|
||||||
|
where pm.id = #{id}
|
||||||
|
|
||||||
|
</select>
|
||||||
|
<select id="getPwMonitorTerminal" resultType="com.njcn.device.pms.pojo.vo.MonitorVO">
|
||||||
|
SELECT
|
||||||
|
pm.Monitor_Id,
|
||||||
|
pm.Terminal_Wiring_Method,
|
||||||
|
pt.Ip,
|
||||||
|
pt.PORT,
|
||||||
|
pm.Pt1,
|
||||||
|
pm.Pt2,
|
||||||
|
pm.Ct1,
|
||||||
|
pm.Ct2
|
||||||
|
FROM
|
||||||
|
pms_distribution_monitor pm
|
||||||
|
INNER JOIN pms_terminal pt ON pt.Id = pm.Terminal_Id
|
||||||
|
where pm.Monitor_Id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
|
|||||||
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
||||||
import com.njcn.device.pms.pojo.param.*;
|
import com.njcn.device.pms.pojo.param.*;
|
||||||
import com.njcn.device.pms.pojo.po.Monitor;
|
import com.njcn.device.pms.pojo.po.Monitor;
|
||||||
|
import com.njcn.device.pms.pojo.vo.MonitorVO;
|
||||||
import com.njcn.device.pms.pojo.vo.PmsMonitorVO;
|
import com.njcn.device.pms.pojo.vo.PmsMonitorVO;
|
||||||
import com.njcn.device.pq.pojo.po.Overlimit;
|
import com.njcn.device.pq.pojo.po.Overlimit;
|
||||||
|
|
||||||
@@ -124,4 +125,12 @@ public interface IMonitorService extends IService<Monitor> {
|
|||||||
*/
|
*/
|
||||||
boolean updateStatus(MonitorStatus monitorParam);
|
boolean updateStatus(MonitorStatus monitorParam);
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 获取台账和终端信息
|
||||||
|
* @author wr
|
||||||
|
* @date 2023-03-23 10:17
|
||||||
|
* @param param
|
||||||
|
* @return MonitorVO
|
||||||
|
*/
|
||||||
|
MonitorVO monitorTerminal(MonitorTerminalParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
|
|||||||
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
||||||
import com.njcn.device.pms.pojo.param.*;
|
import com.njcn.device.pms.pojo.param.*;
|
||||||
import com.njcn.device.pms.pojo.po.*;
|
import com.njcn.device.pms.pojo.po.*;
|
||||||
|
import com.njcn.device.pms.pojo.vo.MonitorVO;
|
||||||
import com.njcn.device.pms.pojo.vo.PmsMonitorVO;
|
import com.njcn.device.pms.pojo.vo.PmsMonitorVO;
|
||||||
import com.njcn.device.pms.service.majornetwork.IDistributionMonitorService;
|
import com.njcn.device.pms.service.majornetwork.IDistributionMonitorService;
|
||||||
import com.njcn.device.pms.service.majornetwork.IMonitorService;
|
import com.njcn.device.pms.service.majornetwork.IMonitorService;
|
||||||
@@ -149,7 +150,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
LambdaQueryWrapper<Monitor> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Monitor> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper
|
lambdaQueryWrapper
|
||||||
.eq(StrUtil.isNotBlank(baseParam.getMonitorState()), Monitor::getMonitorState, baseParam.getMonitorState())
|
.eq(StrUtil.isNotBlank(baseParam.getMonitorState()), Monitor::getMonitorState, baseParam.getMonitorState())
|
||||||
.eq(StrUtil.isNotBlank(baseParam.getMonitorTag()),Monitor::getMonitorTag,baseParam.getMonitorTag())
|
.eq(StrUtil.isNotBlank(baseParam.getMonitorTag()), Monitor::getMonitorTag, baseParam.getMonitorTag())
|
||||||
.and(StrUtil.isNotBlank(baseParam.getSearchValue()), i -> i.like(Monitor::getName, baseParam.getSearchValue())
|
.and(StrUtil.isNotBlank(baseParam.getSearchValue()), i -> i.like(Monitor::getName, baseParam.getSearchValue())
|
||||||
.or()
|
.or()
|
||||||
.like(Monitor::getId, baseParam.getSearchValue())
|
.like(Monitor::getId, baseParam.getSearchValue())
|
||||||
@@ -272,6 +273,31 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
return this.update(update);
|
return this.update(update);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MonitorVO monitorTerminal(MonitorTerminalParam param) {
|
||||||
|
//type 0:主网 1:配网
|
||||||
|
MonitorVO monitorTerminal;
|
||||||
|
if (param.getType() == 0) {
|
||||||
|
monitorTerminal = this.baseMapper.getMonitorTerminal(param.getId());
|
||||||
|
} else {
|
||||||
|
monitorTerminal = this.baseMapper.getPwMonitorTerminal(param.getId());
|
||||||
|
}
|
||||||
|
String terminalWiringMethod = monitorTerminal.getTerminalWiringMethod();
|
||||||
|
DictData data = dicDataFeignClient.getDicDataById(terminalWiringMethod).getData();
|
||||||
|
if( DicDataEnum.STAR.getCode().equals(data.getCode())){
|
||||||
|
monitorTerminal.setTerminalWiringMethod("0");
|
||||||
|
}
|
||||||
|
if( DicDataEnum.STAR_TRIANGLE.getCode().equals(data.getCode())){
|
||||||
|
monitorTerminal.setTerminalWiringMethod("1");
|
||||||
|
}
|
||||||
|
if( DicDataEnum.OPEN_DELTA.getCode().equals(data.getCode())){
|
||||||
|
monitorTerminal.setTerminalWiringMethod("2");
|
||||||
|
}else{
|
||||||
|
monitorTerminal.setTerminalWiringMethod("-1");
|
||||||
|
}
|
||||||
|
return monitorTerminal;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void checkParam(MonitorParam monitorParam, boolean update) {
|
private void checkParam(MonitorParam monitorParam, boolean update) {
|
||||||
|
|
||||||
|
|||||||
@@ -416,4 +416,5 @@ public interface LineMapper extends BaseMapper<Line> {
|
|||||||
List<LineFlowMealDetailVO> getDeviceRunStatistics(@Param("list") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
List<LineFlowMealDetailVO> getDeviceRunStatistics(@Param("list") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||||
|
|
||||||
Page<LineFlowMealDetailVO> getNewDeviceRunStatistics(Page<LineFlowMealDetailVO> page,@Param("devs") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
Page<LineFlowMealDetailVO> getNewDeviceRunStatistics(Page<LineFlowMealDetailVO> page,@Param("devs") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||||
|
Page<LineFlowMealDetailVO> getNewDeviceFlowStatistics(Page<LineFlowMealDetailVO> page,@Param("devs") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -798,7 +798,7 @@
|
|||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
and
|
and
|
||||||
m.Create_Time between #{startTime} and #{endTime}
|
a.Create_Time between #{startTime} and #{endTime}
|
||||||
) t
|
) t
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -836,10 +836,38 @@
|
|||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
and
|
and
|
||||||
m.Create_Time between #{startTime} and #{endTime}
|
a.Create_Time between #{startTime} and #{endTime}
|
||||||
) t
|
) t
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getNewDeviceFlowStatistics" resultType="LineFlowMealDetailVO">
|
||||||
|
select t.*,
|
||||||
|
(t.statisValue)/t.flowMeal flowProportion
|
||||||
|
from (SELECT
|
||||||
|
a.id,
|
||||||
|
a.Name name,
|
||||||
|
a.level,
|
||||||
|
a.update_Time updateTime,
|
||||||
|
b.run_flag runFlag,
|
||||||
|
b.com_flag comFlag,
|
||||||
|
b.id deviceId,
|
||||||
|
ifnull(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + ifnull(d1.flow, 0) flowMeal,
|
||||||
|
ifnull(m.Actual_Value,0) statisValue
|
||||||
|
FROM pq_line a
|
||||||
|
INNER JOIN pq_device b ON a.id = b.id
|
||||||
|
LEFT JOIN pqs_month_flow m ON b.id = m.Dev_Id
|
||||||
|
LEFT JOIN cld_dev_meal c ON b.id = c.line_id
|
||||||
|
LEFT JOIN cld_flow_meal d ON c.Base_Meal_Id = d.id
|
||||||
|
LEFT JOIN cld_flow_meal d1 ON c.Ream_Meal_Id = d1.id
|
||||||
|
where a.id in
|
||||||
|
<foreach item="item" collection="devs" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
and
|
||||||
|
a.Create_Time between #{startTime} and #{endTime}
|
||||||
|
) t ORDER BY flowProportion DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getFlowLineInfoByTableList" resultType="LineFlowMealDetailVO">
|
<select id="getFlowLineInfoByTableList" resultType="LineFlowMealDetailVO">
|
||||||
SELECT
|
SELECT
|
||||||
Id,
|
Id,
|
||||||
|
|||||||
@@ -392,29 +392,15 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<LineFlowMealDetailVO> getNewDeviceRunStatistics( PqsParam deviceInfoParam) {
|
public Page<LineFlowMealDetailVO> getNewDeviceRunStatistics( PqsParam deviceInfoParam) {
|
||||||
List<LineFlowMealDetailVO> deviceList = new ArrayList<>();
|
List<String> deviceIndexes = new ArrayList<>();
|
||||||
Page<LineFlowMealDetailVO> page = new Page();
|
Page<LineFlowMealDetailVO> page = new Page();
|
||||||
List<GeneralDeviceDTO> deviceInfoList = generalDeviceService.getDeviceInfo(deviceInfoParam, null, Stream.of(1).collect(Collectors.toList()));
|
List<GeneralDeviceDTO> deviceInfoList = generalDeviceService.getDeviceInfo(deviceInfoParam, null, Stream.of(1).collect(Collectors.toList()));
|
||||||
for (GeneralDeviceDTO generalDeviceDTO : deviceInfoList) {
|
deviceInfoList.stream().map(GeneralDeviceDTO::getDeviceIndexes).forEach(deviceIndexes::addAll);
|
||||||
List<String> lineIndexes = generalDeviceDTO.getLineIndexes();
|
page = lineMapper.getNewDeviceFlowStatistics(
|
||||||
List<String> deviceIndexes = generalDeviceDTO.getDeviceIndexes();
|
|
||||||
if (CollectionUtils.isEmpty(deviceIndexes)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
page = lineMapper.getNewDeviceRunStatistics(
|
|
||||||
new Page(deviceInfoParam.getPageNum(), deviceInfoParam.getPageSize()),
|
new Page(deviceInfoParam.getPageNum(), deviceInfoParam.getPageSize()),
|
||||||
lineIndexes,
|
deviceIndexes,
|
||||||
DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())),
|
DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())),
|
||||||
DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchEndTime())));
|
DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchEndTime())));
|
||||||
if (CollectionUtil.isNotEmpty(page.getRecords())){
|
|
||||||
for (LineFlowMealDetailVO device : page.getRecords()) {
|
|
||||||
BigDecimal b = new BigDecimal((device.getFlowMeal()-device.getStatisValue())/device.getFlowMeal()*100);
|
|
||||||
device.setFlowProportion(b.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.njcn.event.pojo.param;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <功能描述>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @createTime: 2023-03-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MTransientParam {
|
||||||
|
@ApiModelProperty(value = "监测点id")
|
||||||
|
@NotBlank(message = "监测点id不能为空")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "区分主配网(0:主网 1:配网)")
|
||||||
|
@NotNull(message = "区分类别不能为空")
|
||||||
|
private Integer type;
|
||||||
|
}
|
||||||
@@ -66,6 +66,12 @@ public class PwRmpEventDetailVO implements Serializable {
|
|||||||
@ApiModelProperty(name = "monitorVoltageLevel",value = "监测点电压等级")
|
@ApiModelProperty(name = "monitorVoltageLevel",value = "监测点电压等级")
|
||||||
private String monitorVoltageLevel;
|
private String monitorVoltageLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂时事件ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "eventId",value = "暂时事件ID")
|
||||||
|
private String eventId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 暂态事件类型
|
* 暂态事件类型
|
||||||
*/
|
*/
|
||||||
@@ -91,6 +97,12 @@ public class PwRmpEventDetailVO implements Serializable {
|
|||||||
@ApiModelProperty(name = "featureAmplitude", value = "特征幅值")
|
@ApiModelProperty(name = "featureAmplitude", value = "特征幅值")
|
||||||
private Double featureAmplitude;
|
private Double featureAmplitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "系统名称")
|
||||||
|
private String systemType="pms";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 波形路径
|
* 波形路径
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -86,11 +86,21 @@ public class RmpEventDetailVO implements Serializable {
|
|||||||
@ApiModelProperty(name = "featureAmplitude",value = "特征幅值")
|
@ApiModelProperty(name = "featureAmplitude",value = "特征幅值")
|
||||||
private Double featureAmplitude;
|
private Double featureAmplitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "系统名称")
|
||||||
|
private String systemType="pms";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 波形路径
|
* 波形路径
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "wavePath",value = "波形路径")
|
@ApiModelProperty(name = "wavePath",value = "波形路径")
|
||||||
private String wavePath;
|
private String wavePath;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "powerStationName",value = "电站名称")
|
||||||
|
private String powerStationName;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
|||||||
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.pms.pojo.param.MonitorTerminalParam;
|
||||||
import com.njcn.event.pojo.dto.wave.WaveDataDTO;
|
import com.njcn.event.pojo.dto.wave.WaveDataDTO;
|
||||||
import com.njcn.event.pojo.param.TransientParam;
|
import com.njcn.event.pojo.param.TransientParam;
|
||||||
import com.njcn.event.pojo.param.WaveFileParam;
|
import com.njcn.event.pojo.param.WaveFileParam;
|
||||||
@@ -54,13 +55,9 @@ public class TransientController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/getTransientAnalyseWave")
|
@PostMapping("/getTransientAnalyseWave")
|
||||||
@ApiOperation("暂态事件波形分析")
|
@ApiOperation("暂态事件波形分析")
|
||||||
@ApiImplicitParams({
|
public HttpResult<WaveDataDTO> getTransientAnalyseWave(@RequestBody MonitorTerminalParam param){
|
||||||
@ApiImplicitParam(name = "timeId", value = "暂态时刻", required = true),
|
|
||||||
@ApiImplicitParam(name = "lineId", value = "暂态监测点Id", required = true)
|
|
||||||
})
|
|
||||||
public HttpResult<WaveDataDTO> getTransientAnalyseWave(@RequestParam("timeId") String timeId, @RequestParam("lineId") String lineId){
|
|
||||||
String methodDescribe = getMethodDescribe("getTransientAnalyseWave");
|
String methodDescribe = getMethodDescribe("getTransientAnalyseWave");
|
||||||
WaveDataDTO wave = transientService.getTransientAnalyseWave(timeId, lineId);
|
WaveDataDTO wave = transientService.getTransientAnalyseWave(param);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, wave, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, wave, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,4 +45,7 @@ public interface RmpEventDetailMapper extends BaseMapper<RmpEventDetailVO> {
|
|||||||
@Param("eventType") List<String> eventType,
|
@Param("eventType") List<String> eventType,
|
||||||
@Param("startTime") String startTime,
|
@Param("startTime") String startTime,
|
||||||
@Param("endTime") String endTime);
|
@Param("endTime") String endTime);
|
||||||
|
|
||||||
|
|
||||||
|
RmpEventDetailPO getbyName(@Param("id") String id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,4 +65,10 @@
|
|||||||
AND DATE_FORMAT(start_time, '%Y-%m') <= SUBSTRING(#{endTime}, 1, 7)
|
AND DATE_FORMAT(start_time, '%Y-%m') <= SUBSTRING(#{endTime}, 1, 7)
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getbyName" resultType="com.njcn.event.pojo.po.RmpEventDetailPO">
|
||||||
|
SELECT
|
||||||
|
*from
|
||||||
|
r_mp_event_detail
|
||||||
|
where event_id=#{id}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -81,6 +81,7 @@ public class PwRmpEventDetailServiceImpl implements PwRmpEventDetailService {
|
|||||||
PwRmpEventDetailVO vo = new PwRmpEventDetailVO();
|
PwRmpEventDetailVO vo = new PwRmpEventDetailVO();
|
||||||
BeanUtils.copyProperties(po, vo);
|
BeanUtils.copyProperties(po, vo);
|
||||||
vo.setMonitorId(po.getMeasurementPointId());
|
vo.setMonitorId(po.getMeasurementPointId());
|
||||||
|
vo.setEventId(po.getEventId());
|
||||||
vo.setOrgId(pwPmsMonitorDTOMap.get(po.getMeasurementPointId()).getOrgId());
|
vo.setOrgId(pwPmsMonitorDTOMap.get(po.getMeasurementPointId()).getOrgId());
|
||||||
vo.setOrgName(pwPmsMonitorDTOMap.get(po.getMeasurementPointId()).getOrgName());
|
vo.setOrgName(pwPmsMonitorDTOMap.get(po.getMeasurementPointId()).getOrgName());
|
||||||
vo.setMonitorSort(pwPmsMonitorDTOMap.get(po.getMeasurementPointId()).getMonitorSort());
|
vo.setMonitorSort(pwPmsMonitorDTOMap.get(po.getMeasurementPointId()).getMonitorSort());
|
||||||
|
|||||||
@@ -106,13 +106,14 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
|||||||
// 属性赋值
|
// 属性赋值
|
||||||
return detailsOfTransientEvents.stream().map(po -> {
|
return detailsOfTransientEvents.stream().map(po -> {
|
||||||
RmpEventDetailVO vo = new RmpEventDetailVO();
|
RmpEventDetailVO vo = new RmpEventDetailVO();
|
||||||
for (PmsGeneralDeviceDTO dto : data) {
|
|
||||||
if (dto.getMonitorIdList().contains(po.getMeasurementPointId())) {
|
|
||||||
BeanUtils.copyProperties(po, vo);
|
BeanUtils.copyProperties(po, vo);
|
||||||
vo.setDeptName(dto.getName());
|
for (PmsMonitorDTO dto : monitorInfo) {
|
||||||
|
if (dto.getId().equals(po.getMeasurementPointId())) {
|
||||||
|
vo.setDeptName(dto.getOrgName());
|
||||||
vo.setMonitorSort(monitorSort);
|
vo.setMonitorSort(monitorSort);
|
||||||
vo.setMeasurementPointName(monitorInfoMap.get(po.getMeasurementPointId()));
|
vo.setMeasurementPointName(dto.getName());
|
||||||
vo.setEventType(eventStatisDataMap.get(po.getEventType()));
|
vo.setEventType(eventStatisDataMap.get(po.getEventType()));
|
||||||
|
vo.setPowerStationName(dto.getPowerrName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return vo;
|
return vo;
|
||||||
|
|||||||
@@ -8,6 +8,14 @@ import com.njcn.common.config.GeneralInfo;
|
|||||||
import com.njcn.common.pojo.enums.common.ServerEnum;
|
import com.njcn.common.pojo.enums.common.ServerEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.utils.PubUtils;
|
import com.njcn.common.utils.PubUtils;
|
||||||
|
import com.njcn.device.pms.api.MonitorClient;
|
||||||
|
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
|
||||||
|
import com.njcn.device.pms.pojo.po.Monitor;
|
||||||
|
import com.njcn.device.pms.pojo.vo.MonitorVO;
|
||||||
|
import com.njcn.event.mapper.majornetwork.RmpEventDetailMapper;
|
||||||
|
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||||
|
import com.njcn.event.pojo.vo.RmpEventDetailVO;
|
||||||
|
import com.njcn.event.service.majornetwork.RmpEventDetailService;
|
||||||
import com.njcn.oss.constant.GeneralConstant;
|
import com.njcn.oss.constant.GeneralConstant;
|
||||||
import com.njcn.oss.constant.OssPath;
|
import com.njcn.oss.constant.OssPath;
|
||||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||||
@@ -81,6 +89,9 @@ public class TransientServiceImpl implements TransientService {
|
|||||||
|
|
||||||
private final WaveUtil waveUtil;
|
private final WaveUtil waveUtil;
|
||||||
|
|
||||||
|
private final MonitorClient monitorClient;
|
||||||
|
|
||||||
|
private final RmpEventDetailMapper rmpEventDetailMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<TransientVO> getTransientData(TransientParam transientParam) {
|
public Page<TransientVO> getTransientData(TransientParam transientParam) {
|
||||||
@@ -173,15 +184,28 @@ public class TransientServiceImpl implements TransientService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WaveDataDTO getTransientAnalyseWave(String timeId, String lineId) {
|
public WaveDataDTO getTransientAnalyseWave(MonitorTerminalParam param) {
|
||||||
|
//EventDetail eventDetailByTime = eventDetailService.getEventDetailByTime(lineId, timeId);
|
||||||
|
|
||||||
WaveDataDTO waveDataDTO;
|
WaveDataDTO waveDataDTO;
|
||||||
//原始数据
|
//原始数据
|
||||||
WaveDataDTO originalData;
|
WaveDataDTO originalData;
|
||||||
//根据监测点id获取监测点详情
|
|
||||||
LineDetailDataVO lineDetailData = lineFeignClient.getLineDetailData(lineId).getData();
|
//获取暂降事件
|
||||||
EventDetail eventDetailByTime = eventDetailService.getEventDetailByTime(lineId, timeId);
|
RmpEventDetailPO eventDetail = rmpEventDetailMapper.getbyName(param.getId());
|
||||||
String ip = lineDetailData.getIp();
|
LineDetailDataVO lineDetailData=new LineDetailDataVO();
|
||||||
String waveName = eventDetailByTime.getWaveName();
|
MonitorVO monitorVO=new MonitorVO();
|
||||||
|
String ip;
|
||||||
|
if(param.getSystemType()==0){
|
||||||
|
lineDetailData = lineFeignClient.getLineDetailData(eventDetail.getMeasurementPointId()).getData();
|
||||||
|
ip=lineDetailData.getIp();
|
||||||
|
}else{
|
||||||
|
param.setId(eventDetail.getMeasurementPointId());
|
||||||
|
monitorVO = monitorClient.getMonitorTerminal(param).getData();
|
||||||
|
ip=monitorVO.getIp();
|
||||||
|
}
|
||||||
|
|
||||||
|
String waveName = eventDetail.getWavePath();
|
||||||
String cfgPath, datPath;
|
String cfgPath, datPath;
|
||||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.LOCAL_DISK) {
|
if (generalInfo.getBusinessFileStorage() == GeneralConstant.LOCAL_DISK) {
|
||||||
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
|
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
|
||||||
@@ -209,6 +233,7 @@ public class TransientServiceImpl implements TransientService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
waveDataDTO = waveUtil.getValidData(originalData);
|
waveDataDTO = waveUtil.getValidData(originalData);
|
||||||
|
if(param.getSystemType()==0){
|
||||||
waveDataDTO.setPtType(PubUtils.ptTypeName(lineDetailData.getPtType()));
|
waveDataDTO.setPtType(PubUtils.ptTypeName(lineDetailData.getPtType()));
|
||||||
double pt1 = Double.parseDouble(lineDetailData.getPt().split(StrUtil.SLASH)[0]);
|
double pt1 = Double.parseDouble(lineDetailData.getPt().split(StrUtil.SLASH)[0]);
|
||||||
double pt2 = Double.parseDouble(lineDetailData.getPt().split(StrUtil.SLASH)[1]);
|
double pt2 = Double.parseDouble(lineDetailData.getPt().split(StrUtil.SLASH)[1]);
|
||||||
@@ -218,6 +243,12 @@ public class TransientServiceImpl implements TransientService {
|
|||||||
waveDataDTO.setCt(ct1 / ct2);
|
waveDataDTO.setCt(ct1 / ct2);
|
||||||
return waveDataDTO;
|
return waveDataDTO;
|
||||||
}
|
}
|
||||||
|
waveDataDTO.setPtType(Integer.valueOf(monitorVO.getTerminalWiringMethod()));
|
||||||
|
waveDataDTO.setPt(monitorVO.getPt1() / monitorVO.getPt2());
|
||||||
|
waveDataDTO.setCt(monitorVO.getCt1() / monitorVO.getCt2());
|
||||||
|
return waveDataDTO;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.event.service.majornetwork;
|
package com.njcn.event.service.majornetwork;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
|
||||||
import com.njcn.event.pojo.dto.wave.WaveDataDTO;
|
import com.njcn.event.pojo.dto.wave.WaveDataDTO;
|
||||||
import com.njcn.event.pojo.param.TransientParam;
|
import com.njcn.event.pojo.param.TransientParam;
|
||||||
import com.njcn.event.pojo.param.WaveFileParam;
|
import com.njcn.event.pojo.param.WaveFileParam;
|
||||||
@@ -26,11 +27,10 @@ public interface TransientService {
|
|||||||
Page<TransientVO> getTransientData(TransientParam transientParam);
|
Page<TransientVO> getTransientData(TransientParam transientParam);
|
||||||
/**
|
/**
|
||||||
* 功能描述: 暂态事件波形分析
|
* 功能描述: 暂态事件波形分析
|
||||||
* @param timeId
|
* @param param
|
||||||
* @param lineId
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
WaveDataDTO getTransientAnalyseWave(String timeId, String lineId);
|
WaveDataDTO getTransientAnalyseWave(MonitorTerminalParam param);
|
||||||
/**
|
/**
|
||||||
* 功能描述: 暂态事件波形文件下载
|
* 功能描述: 暂态事件波形文件下载
|
||||||
* @param waveFileParam
|
* @param waveFileParam
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class StrategyParam {
|
|||||||
@ApiModelProperty("名称")
|
@ApiModelProperty("名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@ApiModelProperty("等级(0:一级;1:二级;2:三级)")
|
@ApiModelProperty("等级(0:自动策略 1:手动策略 2:排除策略)")
|
||||||
private Integer grade;
|
private Integer grade;
|
||||||
|
|
||||||
@ApiModelProperty(value = "区分预警单/告警单(0:预警单 ;1:告警单)")
|
@ApiModelProperty(value = "区分预警单/告警单(0:预警单 ;1:告警单)")
|
||||||
@@ -142,9 +142,6 @@ public class StrategyParam {
|
|||||||
@ApiModelProperty("名称")
|
@ApiModelProperty("名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
// @ApiModelProperty("变电站信息")
|
|
||||||
// private List<Power> childPower;
|
|
||||||
|
|
||||||
@ApiModelProperty("子节点详细信息")
|
@ApiModelProperty("子节点详细信息")
|
||||||
private List<?> children;
|
private List<?> children;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ public class SurveyPlanExcel implements Serializable {
|
|||||||
@Excel(name = "变电站数量", width = 15)
|
@Excel(name = "变电站数量", width = 15)
|
||||||
private Long subCount;
|
private Long subCount;
|
||||||
|
|
||||||
@Excel(name = "母线数量", width = 15)
|
// @Excel(name = "母线数量", width = 15)
|
||||||
private Long busCount;
|
// private Long busCount;
|
||||||
|
|
||||||
@Excel(name = "计划状态", width = 15)
|
@Excel(name = "计划状态", width = 15)
|
||||||
private String status;
|
private String status;
|
||||||
|
|||||||
@@ -48,6 +48,15 @@ public class ThsWarnStrategyController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getStrategyList")
|
||||||
|
@ApiOperation("数据查询")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
public HttpResult<List<ThsWarnStrategy>> strategyList(@RequestBody @Validated StrategyParam.StrategyPageParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("getStrategyPage");
|
||||||
|
List<ThsWarnStrategy> list = thsWarnStrategyService.strategyList(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/insertStrategy")
|
@PostMapping("/insertStrategy")
|
||||||
@ApiOperation(value = "数据添加")
|
@ApiOperation(value = "数据添加")
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
@@ -113,10 +122,10 @@ public class ThsWarnStrategyController extends BaseController {
|
|||||||
|
|
||||||
@GetMapping("/echoMonitor")
|
@GetMapping("/echoMonitor")
|
||||||
@ApiOperation(value = "监测点回显")
|
@ApiOperation(value = "监测点回显")
|
||||||
public HttpResult<List<String>> echoMonitor(@Param("deptId") String deptId,@Param("type") Integer type) {
|
public HttpResult<StrategyParam.MonitorTree> echoMonitor(@Param("deptId") String deptId,@Param("type") Integer type) {
|
||||||
String methodDescribe = getMethodDescribe("echoMonitor");
|
String methodDescribe = getMethodDescribe("echoMonitor");
|
||||||
List<String> strings = thsWarnStrategyService.echoMonitor(deptId, type);
|
StrategyParam.MonitorTree info = thsWarnStrategyService.echoMonitor(deptId, type);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, strings, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, info, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/delStrategy")
|
@PostMapping("/delStrategy")
|
||||||
|
|||||||
@@ -27,6 +27,14 @@ public interface ThsWarnStrategyService extends IService<ThsWarnStrategy> {
|
|||||||
*/
|
*/
|
||||||
Page<ThsWarnStrategy> strategyPage(StrategyParam.StrategyPageParam param);
|
Page<ThsWarnStrategy> strategyPage(StrategyParam.StrategyPageParam param);
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 预警单/告警单集合
|
||||||
|
* @author wr
|
||||||
|
* @date 2023-02-27 13:58
|
||||||
|
* @param param
|
||||||
|
* @return Page<?>
|
||||||
|
*/
|
||||||
|
List<ThsWarnStrategy> strategyList(StrategyParam.StrategyPageParam param);
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 预警单/告警单单条新增
|
* 预警单/告警单单条新增
|
||||||
@@ -101,7 +109,7 @@ public interface ThsWarnStrategyService extends IService<ThsWarnStrategy> {
|
|||||||
* @param type
|
* @param type
|
||||||
* @return List<ThsDeptAlarm>
|
* @return List<ThsDeptAlarm>
|
||||||
*/
|
*/
|
||||||
List<String> echoMonitor(String org,Integer type);
|
StrategyParam.MonitorTree echoMonitor(String org,Integer type);
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 预警单/告警单删除
|
* 预警单/告警单删除
|
||||||
|
|||||||
@@ -325,22 +325,46 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
|||||||
SurveyPlanExcel surveyPlanExcel = new SurveyPlanExcel ( );
|
SurveyPlanExcel surveyPlanExcel = new SurveyPlanExcel ( );
|
||||||
BeanUtils.copyProperties (temp, surveyPlanExcel);
|
BeanUtils.copyProperties (temp, surveyPlanExcel);
|
||||||
|
|
||||||
long Busbarcount = rGeneralSurveyPlanDetails.stream ( ).
|
// long Busbarcount = rGeneralSurveyPlanDetails.stream ( ).
|
||||||
filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))).
|
// filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))).
|
||||||
map (RGeneralSurveyPlanDetail::getBusbarId).distinct ( ).count ( );
|
// map (RGeneralSurveyPlanDetail::getBusbarId).distinct ( ).count ( );
|
||||||
|
|
||||||
long Subcount = rGeneralSurveyPlanDetails.stream ( ).
|
long Subcount = rGeneralSurveyPlanDetails.stream ( ).
|
||||||
filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))).
|
filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))).
|
||||||
map (RGeneralSurveyPlanDetail::getSubId).distinct ( ).count ( );
|
map (RGeneralSurveyPlanDetail::getSubId).distinct ( ).count ( );
|
||||||
surveyPlanExcel.setBusCount (Busbarcount);
|
// surveyPlanExcel.setBusCount (Busbarcount);
|
||||||
surveyPlanExcel.setSubCount (Subcount);
|
surveyPlanExcel.setSubCount (Subcount);
|
||||||
surveyPlanExcel.setOrgNo (pvTerminalTreeVOMap.get (surveyPlanExcel.getOrgNo ( )));
|
surveyPlanExcel.setOrgNo (pvTerminalTreeVOMap.get (surveyPlanExcel.getOrgNo ( )));
|
||||||
|
surveyPlanExcel.setStatus (getPlanStatus(temp.getStatus ()));
|
||||||
surveyPlanExcels.add (surveyPlanExcel);
|
surveyPlanExcels.add (surveyPlanExcel);
|
||||||
});
|
});
|
||||||
|
|
||||||
return surveyPlanExcels;
|
return surveyPlanExcels;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getPlanStatus(int status) {
|
||||||
|
String result = "";
|
||||||
|
switch (status) {
|
||||||
|
case 0:
|
||||||
|
result = "新建";
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
result = "待审核";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
result = "审核未通过";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
result = "已发布";
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
result = "已完成";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
result = "";
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @param questionQueryParm
|
* @param questionQueryParm
|
||||||
* @Description: querySurveyPlanOnQuestion
|
* @Description: querySurveyPlanOnQuestion
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.process.service.impl;
|
package com.njcn.process.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
@@ -27,11 +28,13 @@ import com.njcn.user.pojo.dto.DeptDTO;
|
|||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import com.njcn.web.utils.WebUtil;
|
import com.njcn.web.utils.WebUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.math3.random.RandomDataGenerator;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -62,6 +65,17 @@ public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMappe
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ThsWarnStrategy> strategyList(StrategyParam.StrategyPageParam param) {
|
||||||
|
return this.list(new LambdaQueryWrapper<ThsWarnStrategy>()
|
||||||
|
.like(StrUtil.isNotBlank(param.getName()), ThsWarnStrategy::getName, param.getName())
|
||||||
|
.eq(param.getGrade() != null, ThsWarnStrategy::getGrade, param.getGrade())
|
||||||
|
.eq(param.getType() != null, ThsWarnStrategy::getType, param.getType())
|
||||||
|
.ne(ThsWarnStrategy::getState, DataStateEnum.DELETED.getCode())
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public Boolean insertStrategy(StrategyParam.StrategyInsertParam param) {
|
public Boolean insertStrategy(StrategyParam.StrategyInsertParam param) {
|
||||||
@@ -196,12 +210,18 @@ public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> echoMonitor(String org,Integer type) {
|
public StrategyParam.MonitorTree echoMonitor(String org,Integer type) {
|
||||||
List<ThsDeptAlarm> list = thsDeptAlarmService.list(new LambdaQueryWrapper<ThsDeptAlarm>()
|
List<ThsDeptAlarm> list = thsDeptAlarmService.list(new LambdaQueryWrapper<ThsDeptAlarm>()
|
||||||
.eq(ThsDeptAlarm::getDeptId, org)
|
.eq(ThsDeptAlarm::getDeptId, org)
|
||||||
.eq(ThsDeptAlarm::getType, type)
|
.eq(ThsDeptAlarm::getType, type)
|
||||||
);
|
);
|
||||||
return list.stream().map(ThsDeptAlarm::getMonitorId).distinct().collect(Collectors.toList());
|
StrategyParam.MonitorTree tree=new StrategyParam.MonitorTree();
|
||||||
|
List<String> collect = list.stream().map(ThsDeptAlarm::getAlarmId).distinct().collect(Collectors.toList());
|
||||||
|
if(CollectionUtil.isNotEmpty(collect)){
|
||||||
|
tree.setId(collect.get(0));
|
||||||
|
}
|
||||||
|
tree.setChildren(list.stream().map(ThsDeptAlarm::getMonitorId).distinct().collect(Collectors.toList()));
|
||||||
|
return tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -283,7 +303,9 @@ public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMappe
|
|||||||
collect.forEach((key, value) -> {
|
collect.forEach((key, value) -> {
|
||||||
String[] split = key.split("_");
|
String[] split = key.split("_");
|
||||||
StrategyParam.MonitorTree power = new StrategyParam.MonitorTree();
|
StrategyParam.MonitorTree power = new StrategyParam.MonitorTree();
|
||||||
power.setId(split[0]);
|
//生成随机数
|
||||||
|
RandomDataGenerator randomDataGenerator = new RandomDataGenerator();
|
||||||
|
power.setId(split[0]+randomDataGenerator.nextInt(1,9));
|
||||||
power.setName("变电站名称: "+split[1]);
|
power.setName("变电站名称: "+split[1]);
|
||||||
//监测点信息
|
//监测点信息
|
||||||
List<StrategyParam.Monitor> monitors = new ArrayList();
|
List<StrategyParam.Monitor> monitors = new ArrayList();
|
||||||
|
|||||||
@@ -252,7 +252,16 @@ public enum DicDataEnum {
|
|||||||
/**
|
/**
|
||||||
* 一级业务类型
|
* 一级业务类型
|
||||||
*/
|
*/
|
||||||
TRANS_BUSINESS("运检业务","Trans_Business");
|
TRANS_BUSINESS("运检业务","Trans_Business"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接线方式
|
||||||
|
*/
|
||||||
|
STAR("星型接线","Trans_Business"),
|
||||||
|
STAR_TRIANGLE("星三角","Star_Triangle"),
|
||||||
|
OPEN_DELTA("开口三角","Open_Delta"),;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|||||||
Reference in New Issue
Block a user