Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -426,54 +426,100 @@
|
||||
</select>
|
||||
|
||||
<select id="getBaseLineInfo" resultType="BaseLineInfo">
|
||||
SELECT
|
||||
line.Id,
|
||||
area.`Name` provincialName,
|
||||
gd.`Name` gdName,
|
||||
substation.`Name` subName,
|
||||
subscale.`Name` subScale,
|
||||
device.`Name` deviceName,
|
||||
pqdevice.IP networkParam,
|
||||
pqdevice.Com_Flag comState,
|
||||
factory.`Name` factoryName,
|
||||
pqdevice.Update_Time time,
|
||||
voltage.`Name` subvName,
|
||||
scale.`Name` subvScale,
|
||||
line.`Name` lineName,
|
||||
line.Sort
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_line voltage,
|
||||
pq_voltage pqvoltage,
|
||||
pq_line device,
|
||||
pq_device pqdevice,
|
||||
pq_line substation,
|
||||
pq_substation pqsubstation,
|
||||
pq_line gd,
|
||||
pq_line provincial,
|
||||
sys_dict_data scale,
|
||||
sys_dict_data factory,
|
||||
sys_dict_data loadtype,
|
||||
sys_dict_data subscale,
|
||||
sys_area area
|
||||
WHERE
|
||||
line.pid = voltage.id
|
||||
AND voltage.id = pqvoltage.id
|
||||
AND pqvoltage.Scale = scale.id
|
||||
AND voltage.pid = device.id
|
||||
AND voltage.pid = pqdevice.id
|
||||
AND pqdevice.Manufacturer = factory.id
|
||||
AND device.pid = substation.id
|
||||
AND substation.id = pqsubstation.id
|
||||
AND pqsubstation.Scale = subscale.id
|
||||
AND substation.pid = gd.id
|
||||
AND gd.pid = provincial.id
|
||||
AND provincial.NAME = area.id
|
||||
AND line.Id IN
|
||||
<foreach item="item" collection="list" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
GROUP BY line.id
|
||||
<!-- SELECT-->
|
||||
<!-- line.Id,-->
|
||||
<!-- area.`Name` provincialName,-->
|
||||
<!-- gd.`Name` gdName,-->
|
||||
<!-- substation.`Name` subName,-->
|
||||
<!-- subscale.`Name` subScale,-->
|
||||
<!-- device.`Name` deviceName,-->
|
||||
<!-- pqdevice.IP networkParam,-->
|
||||
<!-- pqdevice.Com_Flag comState,-->
|
||||
<!-- factory.`Name` factoryName,-->
|
||||
<!-- pqdevice.Update_Time time,-->
|
||||
<!-- voltage.`Name` subvName,-->
|
||||
<!-- scale.`Name` subvScale,-->
|
||||
<!-- line.`Name` lineName,-->
|
||||
<!-- line.Sort-->
|
||||
<!-- FROM-->
|
||||
<!-- pq_line line,-->
|
||||
<!-- pq_line voltage,-->
|
||||
<!-- pq_voltage pqvoltage,-->
|
||||
<!-- pq_line device,-->
|
||||
<!-- pq_device pqdevice,-->
|
||||
<!-- pq_line substation,-->
|
||||
<!-- pq_substation pqsubstation,-->
|
||||
<!-- pq_line gd,-->
|
||||
<!-- pq_line provincial,-->
|
||||
<!-- sys_dict_data scale,-->
|
||||
<!-- sys_dict_data factory,-->
|
||||
<!-- sys_dict_data loadtype,-->
|
||||
<!-- sys_dict_data subscale,-->
|
||||
<!-- sys_area area-->
|
||||
<!-- WHERE-->
|
||||
<!-- line.pid = voltage.id-->
|
||||
<!-- AND voltage.id = pqvoltage.id-->
|
||||
<!-- AND pqvoltage.Scale = scale.id-->
|
||||
<!-- AND voltage.pid = device.id-->
|
||||
<!-- AND voltage.pid = pqdevice.id-->
|
||||
<!-- AND pqdevice.Manufacturer = factory.id-->
|
||||
<!-- AND device.pid = substation.id-->
|
||||
<!-- AND substation.id = pqsubstation.id-->
|
||||
<!-- AND pqsubstation.Scale = subscale.id-->
|
||||
<!-- AND substation.pid = gd.id-->
|
||||
<!-- AND gd.pid = provincial.id-->
|
||||
<!-- AND provincial.NAME = area.id-->
|
||||
<!-- AND line.Id IN-->
|
||||
<!-- <foreach item="item" collection="list" separator="," open="(" close=")">-->
|
||||
<!-- #{item}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- GROUP BY line.id-->
|
||||
|
||||
select
|
||||
line.Id,
|
||||
line.`Name` lineName,
|
||||
area.`Name` provincialName,
|
||||
gd.`Name` gdName,
|
||||
substation.`Name` subName,
|
||||
subscale.`Name` subScale,
|
||||
device.`Name` deviceName,
|
||||
voltage.Name subvName,
|
||||
subvscale.Name subvScale,
|
||||
pqdevice.IP networkParam,
|
||||
pqdevice.Com_Flag comState,
|
||||
pqdevice.Update_Time time,
|
||||
factory.`Name` factoryName
|
||||
from
|
||||
pq_line line,
|
||||
pq_line voltage,
|
||||
pq_line device,
|
||||
pq_line substation,
|
||||
pq_line gd,
|
||||
pq_line provincial,
|
||||
sys_area area,
|
||||
pq_device pqdevice,
|
||||
sys_dict_data factory,
|
||||
sys_dict_data subscale,
|
||||
pq_substation pqsubstation,
|
||||
sys_dict_data subvscale,
|
||||
pq_voltage pqvoltage
|
||||
where
|
||||
line.Id in
|
||||
<foreach item="item" collection="list" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and line.Pid = voltage.Id
|
||||
and voltage.Pid = device.Id
|
||||
and device.Pid = substation.Id
|
||||
and substation.Pid = gd.Id
|
||||
and gd.Pid = provincial.Id
|
||||
and provincial.Name = area.Id
|
||||
and device.Id = pqdevice.Id
|
||||
and pqdevice.Manufacturer = factory.id
|
||||
and substation.Id = pqsubstation.Id
|
||||
and pqsubstation.`Scale` = subscale.Id
|
||||
and voltage.Id = pqvoltage.Id
|
||||
and pqvoltage.`Scale` = subvscale.Id
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public class AssessParam {
|
||||
|
||||
@ApiModelProperty("部门id")
|
||||
@NotBlank(message = "部门索引不可为空")
|
||||
private String deptId;
|
||||
private String deptIndex;
|
||||
|
||||
@ApiModelProperty("起始时间")
|
||||
@NotBlank(message = "起始时间不可为空")
|
||||
@@ -30,7 +30,7 @@ public class AssessParam {
|
||||
|
||||
@ApiModelProperty("监测点类型- 0:冀北 1:国网上报")
|
||||
@NotNull(message = "监测点类型不可为空")
|
||||
private Integer lineType;
|
||||
private Integer isUpToGrid;
|
||||
|
||||
@ApiModelProperty("稳态类型-全指标、电压偏差、频率偏差、电压总谐波畸变率、电压闪变、三相电压不平衡度")
|
||||
private Integer harmonicType;
|
||||
|
||||
@@ -73,4 +73,29 @@ public class EvaluationLevelVo {
|
||||
private Integer overDay;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class QualifiedDetail {
|
||||
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
|
||||
@ApiModelProperty("变电站名称")
|
||||
private String substationName;
|
||||
|
||||
@ApiModelProperty("频率偏差合格率")
|
||||
private Double freqDev = 3.14159;
|
||||
|
||||
@ApiModelProperty("电压偏差合格率")
|
||||
private Double vDev = 3.14159;
|
||||
|
||||
@ApiModelProperty("电压总谐波畸变率合格率")
|
||||
private Double vThd = 3.14159;
|
||||
|
||||
@ApiModelProperty("三相电压不平衡度合格率")
|
||||
private Double ubalance = 3.14159;
|
||||
|
||||
@ApiModelProperty("闪变合格率")
|
||||
private Double plt = 3.14159;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -102,4 +102,14 @@ public class GridController extends BaseController {
|
||||
List<EvaluationLevelVo.EvaluationDetail> result = gridService.getEvaluationDetail(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/qualifiedDetail")
|
||||
@ApiOperation("稳态指标合格率详情")
|
||||
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||
public HttpResult<List<EvaluationLevelVo.QualifiedDetail>> getQualifiedDetail(@RequestBody @Validated AssessParam param){
|
||||
String methodDescribe = getMethodDescribe("getQualifiedDetail");
|
||||
List<EvaluationLevelVo.QualifiedDetail> result = gridService.getQualifiedDetail(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,4 +67,11 @@ public interface IGridService {
|
||||
*/
|
||||
List<EvaluationLevelVo.EvaluationDetail> getEvaluationDetail(AssessParam param);
|
||||
|
||||
/**
|
||||
* 稳态指标超标合格率详情
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<EvaluationLevelVo.QualifiedDetail> getQualifiedDetail(AssessParam param);
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,9 @@ import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.bo.BaseLineInfo;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.harmonic.mapper.*;
|
||||
import com.njcn.harmonic.pojo.param.hebeinorth.AssessParam;
|
||||
@@ -54,12 +56,13 @@ public class GridServiceImpl implements IGridService {
|
||||
private final RStatDataVDMapper statDataVDMapper;
|
||||
private final RStatDataPltDMapper statDataPltDMapper;
|
||||
private final RStatLimitTargetDMapper rStatLimitTargetDMapper;
|
||||
private final GeneralDeviceInfoClient generalDeviceInfoClient;
|
||||
|
||||
@Override
|
||||
public List<AssessVo> getAssessOverview(AssessParam param) {
|
||||
List<AssessVo> result = new ArrayList<>();
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(param.getDeptId());
|
||||
deptGetLineParam.setDeptId(param.getDeptIndex());
|
||||
deptGetLineParam.setServerName("harmonic-boot");
|
||||
List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetLine(deptGetLineParam).getData();
|
||||
//获取所有监测点
|
||||
@@ -69,7 +72,7 @@ public class GridServiceImpl implements IGridService {
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
//上报国网监测点
|
||||
if (Objects.equals(param.getLineType(), 1)){
|
||||
if (Objects.equals(param.getIsUpToGrid(), 1)){
|
||||
List<LineDetail> lineDetails = lineFeignClient.getLineDetail(lineList).getData();
|
||||
lineList = lineDetails.stream().filter(o-> Objects.equals(o.getMonitorFlag(), 1)).map(LineDetail::getId).collect(Collectors.toList());
|
||||
}
|
||||
@@ -102,7 +105,7 @@ public class GridServiceImpl implements IGridService {
|
||||
List<AssessDetailVo> result = new ArrayList<>();
|
||||
//查询部门监测点关系
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(param.getDeptId());
|
||||
deptGetLineParam.setDeptId(param.getDeptIndex());
|
||||
deptGetLineParam.setServerName("harmonic-boot");
|
||||
List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetLine(deptGetLineParam).getData();
|
||||
//获取所有监测点
|
||||
@@ -112,7 +115,7 @@ public class GridServiceImpl implements IGridService {
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
//上报国网监测点
|
||||
if (Objects.equals(param.getLineType(), 1)){
|
||||
if (Objects.equals(param.getIsUpToGrid(), 1)){
|
||||
List<LineDetail> lineDetails = lineFeignClient.getLineDetail(lineList).getData();
|
||||
lineList = lineDetails.stream().filter(o-> Objects.equals(o.getMonitorFlag(), 1)).map(LineDetail::getId).collect(Collectors.toList());
|
||||
}
|
||||
@@ -141,7 +144,7 @@ public class GridServiceImpl implements IGridService {
|
||||
List<EvaluationVo.Children> childrenList = new ArrayList<>();
|
||||
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(param.getDeptId());
|
||||
deptGetLineParam.setDeptId(param.getDeptIndex());
|
||||
deptGetLineParam.setServerName("harmonic-boot");
|
||||
List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetLine(deptGetLineParam).getData();
|
||||
//获取所有监测点
|
||||
@@ -151,7 +154,7 @@ public class GridServiceImpl implements IGridService {
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
//上报国网监测点
|
||||
if (Objects.equals(param.getLineType(), 1)){
|
||||
if (Objects.equals(param.getIsUpToGrid(), 1)){
|
||||
//获取国网监测点
|
||||
List<LineDetail> lineDetails = lineFeignClient.getLineDetail(lineList).getData();
|
||||
lineList = lineDetails.stream().filter(o-> Objects.equals(o.getMonitorFlag(), 1)).map(LineDetail::getId).collect(Collectors.toList());
|
||||
@@ -190,7 +193,7 @@ public class GridServiceImpl implements IGridService {
|
||||
public List<EvaluationLevelVo> getEvaluationData(AssessParam param) {
|
||||
List<EvaluationLevelVo> result = new ArrayList<>();
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(param.getDeptId());
|
||||
deptGetLineParam.setDeptId(param.getDeptIndex());
|
||||
deptGetLineParam.setServerName("harmonic-boot");
|
||||
List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetLine(deptGetLineParam).getData();
|
||||
//获取符合电压等级的监测点
|
||||
@@ -201,7 +204,7 @@ public class GridServiceImpl implements IGridService {
|
||||
//监测点处理
|
||||
List<String> line = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(lineList)) {
|
||||
if (Objects.equals(param.getLineType(), 1)) {
|
||||
if (Objects.equals(param.getIsUpToGrid(), 1)) {
|
||||
line = lineList.stream().filter(o->Objects.equals(o.getIsUpToGrid(), 1)).map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||
} else {
|
||||
line = lineList.stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||
@@ -267,7 +270,7 @@ public class GridServiceImpl implements IGridService {
|
||||
public List<EvaluationLevelVo.EvaluationRatio> evaluationRatio(AssessParam param) {
|
||||
List<EvaluationLevelVo.EvaluationRatio> result = new ArrayList<>();
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(param.getDeptId());
|
||||
deptGetLineParam.setDeptId(param.getDeptIndex());
|
||||
deptGetLineParam.setServerName("harmonic-boot");
|
||||
List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetLine(deptGetLineParam).getData();
|
||||
//获取所有监测点数据
|
||||
@@ -277,7 +280,7 @@ public class GridServiceImpl implements IGridService {
|
||||
//筛选监测点
|
||||
List<String> line = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(lineList)) {
|
||||
if (Objects.equals(param.getLineType(), 1)) {
|
||||
if (Objects.equals(param.getIsUpToGrid(), 1)) {
|
||||
line = lineList.stream().filter(o->Objects.equals(o.getIsUpToGrid(), 1)).map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||
} else {
|
||||
line = lineList.stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||
@@ -317,7 +320,7 @@ public class GridServiceImpl implements IGridService {
|
||||
public List<EvaluationLevelVo.EvaluationDetail> getEvaluationDetail(AssessParam param) {
|
||||
List<EvaluationLevelVo.EvaluationDetail> result = new ArrayList<>();
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(param.getDeptId());
|
||||
deptGetLineParam.setDeptId(param.getDeptIndex());
|
||||
deptGetLineParam.setServerName("harmonic-boot");
|
||||
List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetLine(deptGetLineParam).getData();
|
||||
//获取所有监测点数据
|
||||
@@ -327,7 +330,7 @@ public class GridServiceImpl implements IGridService {
|
||||
//筛选监测点
|
||||
List<String> line = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(lineList)) {
|
||||
if (Objects.equals(param.getLineType(), 1)) {
|
||||
if (Objects.equals(param.getIsUpToGrid(), 1)) {
|
||||
line = lineList.stream().filter(o->Objects.equals(o.getIsUpToGrid(), 1)).map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||
} else {
|
||||
line = lineList.stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||
@@ -406,6 +409,50 @@ public class GridServiceImpl implements IGridService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EvaluationLevelVo.QualifiedDetail> getQualifiedDetail(AssessParam param) {
|
||||
List<EvaluationLevelVo.QualifiedDetail> result = new ArrayList<>();
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(param.getDeptIndex());
|
||||
deptGetLineParam.setServerName("harmonic-boot");
|
||||
List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetLine(deptGetLineParam).getData();
|
||||
//获取所有监测点数据
|
||||
Set<LineDevGetDTO> lineList = list.stream()
|
||||
.flatMap(item -> item.getLineBaseList().stream())
|
||||
.collect(Collectors.toSet());
|
||||
//筛选监测点
|
||||
List<String> line = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(lineList)) {
|
||||
if (Objects.equals(param.getIsUpToGrid(), 1)) {
|
||||
line = lineList.stream().filter(o->Objects.equals(o.getIsUpToGrid(), 1)).map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||
} else {
|
||||
line = lineList.stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
//获取基础台账信息
|
||||
List<BaseLineInfo> baseLineInfos = generalDeviceInfoClient.getBaseLineInfo(line).getData();
|
||||
//获取越限详情
|
||||
List<RStatLimitRateDPO> overLimitList = rStatLimitRateDMapper.getAssessTargetRate(line,param.getStartTime(),param.getEndTime());
|
||||
Map<String, List<RStatLimitRateDPO>> map = overLimitList.stream().collect(Collectors.groupingBy(RStatLimitRateDPO::getLineId));
|
||||
baseLineInfos.forEach(item->{
|
||||
EvaluationLevelVo.QualifiedDetail qualifiedDetail = new EvaluationLevelVo.QualifiedDetail();
|
||||
qualifiedDetail.setLineName(item.getLineName());
|
||||
qualifiedDetail.setSubstationName(item.getSubName());
|
||||
if(CollUtil.isNotEmpty(map.get(item.getId()))) {
|
||||
RStatLimitRateDPO item2 = map.get(item.getId()).get(0);
|
||||
if (!Objects.isNull(item2) && item2.getAllTime() > 0) {
|
||||
qualifiedDetail.setFreqDev(PubUtils.doubleRound(2,100.0-(item2.getFreqDevOvertime()*100.0/item2.getAllTime())));
|
||||
qualifiedDetail.setVDev(PubUtils.doubleRound(2,100.0-(item2.getVoltageDevOvertime()*100.0/item2.getAllTime())));
|
||||
qualifiedDetail.setVThd(PubUtils.doubleRound(2,100.0-(item2.getVoltageDevOvertime()*100.0/item2.getAllTime())));
|
||||
qualifiedDetail.setPlt(PubUtils.doubleRound(2,100.0-(item2.getFlickerOvertime()*100.0/item2.getAllTime())));
|
||||
qualifiedDetail.setUbalance(PubUtils.doubleRound(2,100.0-(item2.getUbalanceOvertime()*100.0/item2.getAllTime())));
|
||||
}
|
||||
result.add(qualifiedDetail);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取监测点频率偏差 T相最大值\获取监测点三相电压不平衡度 T相最大值
|
||||
*/
|
||||
|
||||
@@ -20,10 +20,8 @@ import org.springframework.context.annotation.DependsOn;
|
||||
@SpringBootApplication(scanBasePackages = "com.njcn")
|
||||
public class UserBootApplication {
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(UserBootApplication.class, args);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user