Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f84e6a4c41 | |||
|
|
8457222f85 | ||
|
|
74808dbd05 | ||
| 5f1f42f8d7 | |||
| 3ac18b896a | |||
| f86e7f0183 | |||
|
|
c99a97fff1 | ||
|
|
0f712c45fd | ||
|
|
d738116968 | ||
|
|
e322eb2413 | ||
|
|
0200607c0c | ||
|
|
a6c536cf45 | ||
|
|
e61269e489 | ||
|
|
01e95e71fb | ||
|
|
b4f4037987 | ||
| a5be610a6a | |||
| f8e88b87d0 | |||
|
|
6ee4da4422 | ||
|
|
20e1b8cce7 | ||
|
|
b3b5e64e07 | ||
| 6df4074c59 | |||
| 2c3f04fc82 | |||
| cc52561395 | |||
|
|
a797381a7d | ||
| 99eff7d3d2 | |||
|
|
37c6e52281 | ||
|
|
533cf97495 | ||
|
|
1f96e18d65 |
@@ -37,7 +37,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
protected void configure(HttpSecurity http) throws Exception {
|
protected void configure(HttpSecurity http) throws Exception {
|
||||||
http
|
http
|
||||||
.authorizeRequests()
|
.authorizeRequests()
|
||||||
.antMatchers("/oauth/getPublicKey","/oauth/logout","/auth/getImgCode","/judgeToken/guangZhou","/judgeToken/heBei","/oauth/autoLogin").permitAll()
|
.antMatchers("/oauth/getPublicKey","/oauth/logout","/auth/getImgCode","/judgeToken/guangZhou","/judgeToken/heBei","/oauth/autoLogin","/judgeToken/productionManagementCheck").permitAll()
|
||||||
// @link https://gitee.com/xiaoym/knife4j/issues/I1Q5X6 (接口文档knife4j需要放行的规则)
|
// @link https://gitee.com/xiaoym/knife4j/issues/I1Q5X6 (接口文档knife4j需要放行的规则)
|
||||||
.antMatchers("/webjars/**","/doc.html","/swagger-resources/**","/v2/api-docs").permitAll()
|
.antMatchers("/webjars/**","/doc.html","/swagger-resources/**","/v2/api-docs").permitAll()
|
||||||
.anyRequest().authenticated()
|
.anyRequest().authenticated()
|
||||||
|
|||||||
@@ -76,6 +76,93 @@ public class JudgeThirdToken extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产管理系统token校验
|
||||||
|
* @param token
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@PostMapping("/productionManagementCheck")
|
||||||
|
@ApiOperation("生产管理系统token校验")
|
||||||
|
@ApiImplicitParam(name = "token", required = true)
|
||||||
|
public HttpResult<Object> productionManagementCheck (String token) {
|
||||||
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
|
String methodDescribe = getMethodDescribe("productionManagementCheck");
|
||||||
|
LogUtil.njcnDebug(log, "{},token:{}", methodDescribe, token);
|
||||||
|
|
||||||
|
// 请求地址
|
||||||
|
String url = "http://10.120.192.72:80/head-auth-service/oauth/check_token";
|
||||||
|
|
||||||
|
// 请求头设置,x-www-form-urlencoded格式的数据
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
||||||
|
|
||||||
|
//提交参数设置
|
||||||
|
MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
|
||||||
|
map.add("token", token);
|
||||||
|
|
||||||
|
// 组装请求体
|
||||||
|
HttpEntity<MultiValueMap<String, String>> request =
|
||||||
|
new HttpEntity<>(map, headers);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成功
|
||||||
|
* {
|
||||||
|
* "sub": "40a21660947c44a6a40030109214f313",
|
||||||
|
* "ver": "JWT1.0",
|
||||||
|
* "user_name": "web",
|
||||||
|
* "pri": [
|
||||||
|
* "MASTER_ADMIN",
|
||||||
|
* "znxs",
|
||||||
|
* "root",
|
||||||
|
* "ADMIN"
|
||||||
|
* ],
|
||||||
|
* "last_login": 1744875032,
|
||||||
|
* "scope": [
|
||||||
|
* "all"
|
||||||
|
* ],
|
||||||
|
* "iss": "nrec",
|
||||||
|
* "active": true,
|
||||||
|
* "exp": 1744961431,
|
||||||
|
* "jti": "32add77a-43f0-4d67-82a2-8376fed6fc3d",
|
||||||
|
* "client_id": "frontend"
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* 失败
|
||||||
|
*
|
||||||
|
* {
|
||||||
|
* "msg": "Cannot convert access token to JSON",
|
||||||
|
* "path": "/auth-service/oauth/check_token",
|
||||||
|
* "code": "2500",
|
||||||
|
* "succ": false,
|
||||||
|
* "error": "Internal Server Error",
|
||||||
|
* "timestamp": 1744879150627
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 发送post请求,并打印结果,以String类型接收响应结果JSON字符串
|
||||||
|
try {
|
||||||
|
String result = restTemplate.postForObject(url, request, String.class);
|
||||||
|
JSONObject resultJson = new JSONObject(result);
|
||||||
|
if (resultJson.containsKey("code")) {
|
||||||
|
//失败
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
log.info(e.toString());
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
@PostMapping("/heBei")
|
@PostMapping("/heBei")
|
||||||
|
|||||||
@@ -400,6 +400,7 @@ public class ExcelUtil {
|
|||||||
* @param pullDowns
|
* @param pullDowns
|
||||||
*/
|
*/
|
||||||
private static void setTopLevel(Workbook workbook, List<PullDown> pullDowns) {
|
private static void setTopLevel(Workbook workbook, List<PullDown> pullDowns) {
|
||||||
|
if(CollUtil.isNotEmpty(pullDowns)){
|
||||||
int num = 0;
|
int num = 0;
|
||||||
for (PullDown pullDown : pullDowns) {
|
for (PullDown pullDown : pullDowns) {
|
||||||
if (!pullDown.getIsText()) {
|
if (!pullDown.getIsText()) {
|
||||||
@@ -437,6 +438,8 @@ public class ExcelUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取根据数值获取列字母(1=A,2=B,3=C,.......,27=AA)
|
* 获取根据数值获取列字母(1=A,2=B,3=C,.......,27=AA)
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -78,7 +78,9 @@ public class Knife4jSwaggerConfig {
|
|||||||
"com.njcn.cloud.controller",
|
"com.njcn.cloud.controller",
|
||||||
"com.njcn.zlevent.controller",
|
"com.njcn.zlevent.controller",
|
||||||
"com.njcn.prepare",
|
"com.njcn.prepare",
|
||||||
"com.njcn.supervision.controller"
|
"com.njcn.supervision.controller",
|
||||||
|
"com.njcn.algorithm",
|
||||||
|
"com.njcn.dataProcess"
|
||||||
)
|
)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
List<GrantType> grantTypes = new ArrayList<>();
|
List<GrantType> grantTypes = new ArrayList<>();
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public enum GWSendEnum {
|
|||||||
//接收电能质量监测点限值台账数据接口
|
//接收电能质量监测点限值台账数据接口
|
||||||
LIMIT_CREATE("pqLimitCreate", "/WMCenter/powerQuality/monitor/limitCreate"),
|
LIMIT_CREATE("pqLimitCreate", "/WMCenter/powerQuality/monitor/limitCreate"),
|
||||||
//接收电能质量主配网监测点统计数据接口
|
//接收电能质量主配网监测点统计数据接口
|
||||||
STATISTICAL_CREATE("pqMonitorStatisticalCreate", "/WMCenter/powerQuality/monitor/statisticalCreate"),
|
STATISTICAL_CREATE("pqMonitorStatisticalCreate", "/powerQuality/monitor/statisticalCreate"),
|
||||||
//接收电能质量换流站指标汇总统计数据接口
|
//接收电能质量换流站指标汇总统计数据接口
|
||||||
INDEX_CREATE("pqConverterIndexCreate", "/WMCenter/powerQuality/converterMonitor/indexCreate"),
|
INDEX_CREATE("pqConverterIndexCreate", "/WMCenter/powerQuality/converterMonitor/indexCreate"),
|
||||||
//接收电能质量换流站指标统计明细数据接口
|
//接收电能质量换流站指标统计明细数据接口
|
||||||
|
|||||||
@@ -3,10 +3,13 @@ package com.njcn.device.pms.pojo.po;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.njcn.db.bo.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
*
|
*
|
||||||
@@ -72,16 +75,34 @@ public class Monitor extends BaseEntity {
|
|||||||
private String lineName;
|
private String lineName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监测线路ID
|
* 监测母线
|
||||||
*/
|
*/
|
||||||
private String lineId;
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测线路号
|
||||||
|
*/
|
||||||
|
private Integer lineNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 投运日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate putDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中台母线ID
|
* 中台母线ID
|
||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String busId;
|
private String busId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中台母线ID
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String midStation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压等级(字典)
|
* 电压等级(字典)
|
||||||
*/
|
*/
|
||||||
@@ -190,7 +211,6 @@ public class Monitor extends BaseEntity {
|
|||||||
* 监测终端接线方式(字典)
|
* 监测终端接线方式(字典)
|
||||||
*/
|
*/
|
||||||
private String terminalWiringMethod;
|
private String terminalWiringMethod;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否是上送国网监测点,0-否 1-是
|
* 是否是上送国网监测点,0-否 1-是
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -88,17 +88,17 @@
|
|||||||
AND monitor.`Name` LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
AND monitor.`Name` LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<!--sql直接报错修改不爆错-->
|
||||||
<select id="getPwPhotovoltaicMonitorList" resultType="com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO">
|
<select id="getPwPhotovoltaicMonitorList" resultType="com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO">
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
monitor.Org_Id AS orgId,
|
pm.Org_Id AS orgId,
|
||||||
monitor.Org_Name AS orgName,
|
pm.Org_Name AS orgName,
|
||||||
monitor.Powerr_Id AS powerId,
|
pm.Powerr_Id AS powerId,
|
||||||
monitor.Powerr_Name AS powerName,
|
pm.Powerr_Name AS powerName,
|
||||||
monitor.id AS monitorId,
|
pm.id AS monitorId,
|
||||||
monitor.Name AS monitorName,
|
pm.Name AS monitorName,
|
||||||
monitor.Line_Id,
|
pm.Line_Id,
|
||||||
monitor.Line_Name,
|
pm.Line_Name,
|
||||||
pdm.Monitor_Sort AS monitorSort,
|
pdm.Monitor_Sort AS monitorSort,
|
||||||
pdm.Voltage_Level AS voltageLevel,
|
pdm.Voltage_Level AS voltageLevel,
|
||||||
pdm.If_Power_User AS if_powerUser,
|
pdm.If_Power_User AS if_powerUser,
|
||||||
@@ -110,28 +110,7 @@
|
|||||||
pdm.Update_By AS updateBy,
|
pdm.Update_By AS updateBy,
|
||||||
pdm.Update_Time AS updateTime
|
pdm.Update_Time AS updateTime
|
||||||
FROM
|
FROM
|
||||||
((
|
|
||||||
SELECT
|
|
||||||
pm.id,
|
|
||||||
pm.Name,
|
|
||||||
pm.Status,
|
|
||||||
pm.Org_Id,
|
|
||||||
pm.Org_Name,
|
|
||||||
pm.Powerr_Id,
|
|
||||||
pm.Powerr_Name,
|
|
||||||
pm.Line_Id,
|
|
||||||
pm.Line_Name
|
|
||||||
FROM
|
|
||||||
pms_monitor AS pm
|
pms_monitor AS pm
|
||||||
<where>
|
|
||||||
<if test="pwPmsMonitorParam.monitorTag!=null and pwPmsMonitorParam.monitorTag.size()!=0">
|
|
||||||
AND pm.Monitor_Tag IN
|
|
||||||
<foreach collection="pwPmsMonitorParam.monitorTag" item="item" open="(" close=")" separator=",">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
)
|
|
||||||
INNER JOIN pms_distribution_monitor AS pdm ON pm.id = pdm.Monitor_Id
|
INNER JOIN pms_distribution_monitor AS pdm ON pm.id = pdm.Monitor_Id
|
||||||
WHERE
|
WHERE
|
||||||
pm.Status = 1
|
pm.Status = 1
|
||||||
@@ -140,6 +119,12 @@
|
|||||||
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
||||||
#{orgId}
|
#{orgId}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
<if test="pwPmsMonitorParam.monitorTag!=null and pwPmsMonitorParam.monitorTag.size()!=0">
|
||||||
|
AND pm.Monitor_Tag IN
|
||||||
|
<foreach collection="pwPmsMonitorParam.monitorTag" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
<if test="pwPmsMonitorParam.voltageLevels!=null and pwPmsMonitorParam.voltageLevels.size()!=0">
|
<if test="pwPmsMonitorParam.voltageLevels!=null and pwPmsMonitorParam.voltageLevels.size()!=0">
|
||||||
AND pdm.Voltage_Level IN
|
AND pdm.Voltage_Level IN
|
||||||
<foreach collection="pwPmsMonitorParam.voltageLevels" item="item" open="(" close=")" separator=",">
|
<foreach collection="pwPmsMonitorParam.voltageLevels" item="item" open="(" close=")" separator=",">
|
||||||
|
|||||||
@@ -387,6 +387,7 @@
|
|||||||
<select id="pwMonitorAreaDetailInfo" resultType="com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO">
|
<select id="pwMonitorAreaDetailInfo" resultType="com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO">
|
||||||
SELECT
|
SELECT
|
||||||
t.org_id orgId,
|
t.org_id orgId,
|
||||||
|
t.orgName orgName,
|
||||||
t.id monitorId,
|
t.id monitorId,
|
||||||
t.NAME monitorName,
|
t.NAME monitorName,
|
||||||
b.Terminal_Id terminalId,
|
b.Terminal_Id terminalId,
|
||||||
@@ -401,6 +402,7 @@
|
|||||||
a.id,
|
a.id,
|
||||||
a.NAME,
|
a.NAME,
|
||||||
a.org_id,
|
a.org_id,
|
||||||
|
dept.name orgName,
|
||||||
3 AS lineType,
|
3 AS lineType,
|
||||||
a.Power_Station_Id AS powerrId,
|
a.Power_Station_Id AS powerrId,
|
||||||
a.Line_Id,
|
a.Line_Id,
|
||||||
@@ -408,7 +410,7 @@
|
|||||||
b.Power_Name powerName
|
b.Power_Name powerName
|
||||||
FROM
|
FROM
|
||||||
pms_power_client a
|
pms_power_client a
|
||||||
LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id
|
LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id LEFT JOIN sys_dept dept on a.org_id =dept.code
|
||||||
WHERE
|
WHERE
|
||||||
a.STATUS = 1
|
a.STATUS = 1
|
||||||
) UNION ALL
|
) UNION ALL
|
||||||
@@ -417,6 +419,7 @@
|
|||||||
a.id,
|
a.id,
|
||||||
a.NAME,
|
a.NAME,
|
||||||
a.org_id,
|
a.org_id,
|
||||||
|
dept.name orgName,
|
||||||
3 AS lineType,
|
3 AS lineType,
|
||||||
a.Power_Station_Id AS powerrId,
|
a.Power_Station_Id AS powerrId,
|
||||||
a.Line_Id,
|
a.Line_Id,
|
||||||
@@ -424,37 +427,39 @@
|
|||||||
b.Power_Name powerName
|
b.Power_Name powerName
|
||||||
FROM
|
FROM
|
||||||
pms_power_generation_user a
|
pms_power_generation_user a
|
||||||
LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id
|
LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id LEFT JOIN sys_dept dept on a.org_id =dept.code
|
||||||
WHERE
|
WHERE
|
||||||
a.STATUS = 1
|
a.STATUS = 1
|
||||||
) UNION ALL
|
) UNION ALL
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
id,
|
a.id,
|
||||||
NAME,
|
a.NAME,
|
||||||
org_id,
|
a.org_id,
|
||||||
|
dept.name orgName,
|
||||||
2 AS lineType,
|
2 AS lineType,
|
||||||
Power_Station_Id AS powerrId,
|
a.Power_Station_Id AS powerrId,
|
||||||
Line_Id,
|
a.Line_Id,
|
||||||
Voltage_Level,
|
a.Voltage_Level,
|
||||||
Powerr_Name powerName
|
a.Powerr_Name powerName
|
||||||
FROM
|
FROM
|
||||||
pms_power_distributionarea
|
pms_power_distributionarea a LEFT JOIN sys_dept dept on a.org_id =dept.code
|
||||||
WHERE
|
WHERE
|
||||||
STATUS = 1
|
STATUS = 1
|
||||||
) UNION ALL
|
) UNION ALL
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
id,
|
a.id,
|
||||||
NAME,
|
a.NAME,
|
||||||
org_id,
|
a.org_id,
|
||||||
|
dept.name orgName,
|
||||||
1 AS lineType,
|
1 AS lineType,
|
||||||
Powerr_Id AS powerrId,
|
a.Powerr_Id AS powerrId,
|
||||||
Line_Id,
|
a.Line_Id,
|
||||||
Voltage_Level,
|
a.Voltage_Level,
|
||||||
Powerr_Name powerName
|
a.Powerr_Name powerName
|
||||||
FROM
|
FROM
|
||||||
pms_monitor
|
pms_monitor a LEFT JOIN sys_dept dept on a.org_id =dept.code
|
||||||
WHERE
|
WHERE
|
||||||
STATUS = 1
|
STATUS = 1
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -148,10 +150,8 @@ public class DataQualityStatServiceImpl implements DataQualityStatService {
|
|||||||
vo.setOrgName(deptDTOMap.get(vo.getOrgNo()).getName());
|
vo.setOrgName(deptDTOMap.get(vo.getOrgNo()).getName());
|
||||||
if(vo.getMeasurementCount()!=0&&vo.getMeasurementCount()!=null){
|
if(vo.getMeasurementCount()!=0&&vo.getMeasurementCount()!=null){
|
||||||
vo.setEffectiveAccessRate(
|
vo.setEffectiveAccessRate(
|
||||||
Double.parseDouble(
|
BigDecimal.valueOf((vo.getEffectiveAccessMeasurementCount() * 1.0/ (vo.getMeasurementCount() * 1.0))*100).setScale(2, RoundingMode.HALF_UP).doubleValue()
|
||||||
df.format((vo.getEffectiveAccessMeasurementCount() * 1.0)
|
);
|
||||||
/ (vo.getMeasurementCount() * 1.0))
|
|
||||||
) * 100);
|
|
||||||
}else{
|
}else{
|
||||||
vo.setEffectiveAccessRate(0.0);
|
vo.setEffectiveAccessRate(0.0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -263,7 +263,9 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
List<GeneratrixWire> generatrixWireList = generatrixWireMapper.selectList(new LambdaQueryWrapper<GeneratrixWire>().in(GeneratrixWire::getId, busIds));
|
List<GeneratrixWire> generatrixWireList = generatrixWireMapper.selectList(new LambdaQueryWrapper<GeneratrixWire>().in(GeneratrixWire::getId, busIds));
|
||||||
Map<String, GeneratrixWire> mapBus = generatrixWireList.stream().collect(Collectors.toMap(GeneratrixWire::getId, Function.identity()));
|
Map<String, GeneratrixWire> mapBus = generatrixWireList.stream().collect(Collectors.toMap(GeneratrixWire::getId, Function.identity()));
|
||||||
|
|
||||||
|
List<String> powerIds = temList.stream().map(Monitor::getPowerrId).distinct().collect(Collectors.toList());
|
||||||
|
List<StatationStat> statationStatList = statationStatMapper.selectList(new LambdaQueryWrapper<StatationStat>().in(StatationStat::getPowerId,powerIds));
|
||||||
|
Map<String,StatationStat> statMap = statationStatList.stream().collect(Collectors.toMap(StatationStat::getPowerId,Function.identity()));
|
||||||
|
|
||||||
temList = temList.stream().peek(item -> {
|
temList = temList.stream().peek(item -> {
|
||||||
if (mapTerminal.containsKey(item.getTerminalId())) {
|
if (mapTerminal.containsKey(item.getTerminalId())) {
|
||||||
@@ -271,7 +273,9 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
item.setDevIp(mapTerminal.get(item.getTerminalId()).getIp());
|
item.setDevIp(mapTerminal.get(item.getTerminalId()).getIp());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (statMap.containsKey(item.getPowerrId())) {
|
||||||
|
item.setMidStation(statMap.get(item.getPowerrId()).getMidStationId());
|
||||||
|
}
|
||||||
|
|
||||||
if (mapBus.containsKey(item.getLineId())) {
|
if (mapBus.containsKey(item.getLineId())) {
|
||||||
item.setBusId(mapBus.get(item.getLineId()).getMidBusId());
|
item.setBusId(mapBus.get(item.getLineId()).getMidBusId());
|
||||||
@@ -1309,37 +1313,38 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 初始化字典数据的通用方法
|
||||||
|
private Map<String, DictData> initDictData(DicDataTypeEnum type) {
|
||||||
|
return dicDataFeignClient.getDicDataByTypeCode(type.getCode()).getData()
|
||||||
|
.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private String dealData(List<OracleTerminalExcel> oracleTerminalExcelList) {
|
private String dealData(List<OracleTerminalExcel> oracleTerminalExcelList) {
|
||||||
List<OracleTerminalExcel.OracleTerminalExcelMsg> oracleTerminalExcelMsg = new ArrayList<>();
|
List<OracleTerminalExcel.OracleTerminalExcelMsg> oracleTerminalExcelMsg = new ArrayList<>();
|
||||||
|
|
||||||
List<DeptDTO> allDept = deptFeignClient.getDeptDescendantIndexes(deptFeignClient.getRootDept().getData().getId(), Stream.of(0, 1, 2).collect(Collectors.toList())).getData();
|
List<DeptDTO> allDept = deptFeignClient.getDeptDescendantIndexes(deptFeignClient.getRootDept().getData().getId(), Stream.of(0, 1, 2).collect(Collectors.toList())).getData();
|
||||||
Map<String, DeptDTO> mapDept = allDept.stream().collect(Collectors.toMap(DeptDTO::getName, Function.identity()));
|
Map<String, DeptDTO> mapDept = allDept.stream().collect(Collectors.toMap(DeptDTO::getName, Function.identity()));
|
||||||
|
|
||||||
List<DictData> voltageLevelDic = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
Map<String, DictData> voltageLevelMap = initDictData(DicDataTypeEnum.DEV_VOLTAGE);
|
||||||
Map<String, DictData> voltageLevelMap = voltageLevelDic.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
|
||||||
|
|
||||||
//装置型号
|
//装置型号
|
||||||
List<DictData> devTypelDic = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_TYPE.getCode()).getData();
|
Map<String, DictData> devTypelDicMap = initDictData(DicDataTypeEnum.DEV_TYPE);
|
||||||
Map<String, DictData> devTypelDicMap = devTypelDic.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
|
||||||
|
|
||||||
//装置类别
|
|
||||||
DictData devCategoryDic = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_CATEGORY.getName(), DicDataEnum.Monitor_Terminals.getName()).getData();
|
|
||||||
|
|
||||||
//装置状态
|
//装置状态
|
||||||
List<DictData> devStatelDic = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_STATUS.getCode()).getData();
|
Map<String, DictData> devStateDicMap = initDictData(DicDataTypeEnum.DEV_STATUS);
|
||||||
Map<String, DictData> devStateDicMap = devStatelDic.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
|
||||||
|
|
||||||
//监测点状态
|
//监测点状态
|
||||||
List<DictData> monitorStatelDic = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.LINE_STATE.getCode()).getData();
|
Map<String, DictData> monitorStateDicMap = initDictData(DicDataTypeEnum.LINE_STATE);
|
||||||
Map<String, DictData> monitorStateDicMap = monitorStatelDic.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
|
||||||
|
|
||||||
//监测点标签
|
//监测点标签
|
||||||
List<DictData> objTypeList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.MONITORING_LABELS.getCode()).getData();
|
Map<String, DictData> objTypeDicMap = initDictData(DicDataTypeEnum.MONITORING_LABELS);
|
||||||
Map<String, DictData> objTypeDicMap = objTypeList.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
|
||||||
|
|
||||||
//装置厂家
|
//装置厂家
|
||||||
List<DictData> manList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_MANUFACTURER.getCode()).getData();
|
Map<String, DictData> manDicMap = initDictData(DicDataTypeEnum.DEV_MANUFACTURER);
|
||||||
Map<String, DictData> manDicMap = manList.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
|
||||||
|
//接线方式
|
||||||
|
Map<String, DictData> wireListMap = initDictData(DicDataTypeEnum.DEV_CONNECT);
|
||||||
|
|
||||||
//装作等级
|
//装作等级
|
||||||
DictData devGrade = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_GRADE.getName(), DicDataEnum.MOST_IMPORMENT.getName()).getData();
|
DictData devGrade = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_GRADE.getName(), DicDataEnum.MOST_IMPORMENT.getName()).getData();
|
||||||
@@ -1350,30 +1355,27 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
//监测点类型
|
//监测点类型
|
||||||
DictData monitorType = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.LINE_TYPE.getName(), DicDataEnum.Power_Supply_Point.getName()).getData();
|
DictData monitorType = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.LINE_TYPE.getName(), DicDataEnum.Power_Supply_Point.getName()).getData();
|
||||||
|
|
||||||
//接线方式
|
|
||||||
List<DictData> wireList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_CONNECT.getCode()).getData();
|
|
||||||
Map<String, DictData> wireListMap = wireList.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
|
||||||
|
|
||||||
DictData potentialDic = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.Cap_V.getCode(),DicDataTypeEnum.VOLTAGE_TRANSFORMER.getCode()).getData();
|
DictData potentialDic = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.Cap_V.getCode(),DicDataTypeEnum.VOLTAGE_TRANSFORMER.getCode()).getData();
|
||||||
|
|
||||||
DictData neutralDic = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.Neutral_Point.getName(), DicDataEnum.Ground_Res.getName()).getData();
|
DictData neutralDic = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.Neutral_Point.getName(), DicDataEnum.Ground_Res.getName()).getData();
|
||||||
|
//装置类别
|
||||||
|
DictData devCategoryDic = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_CATEGORY.getName(), DicDataEnum.Monitor_Terminals.getName()).getData();
|
||||||
|
|
||||||
|
|
||||||
List<DictData> businessType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.BUSINESS_TYPE.getCode()).getData();
|
//对象类型
|
||||||
Map<String, DictData> businessDicMap = businessType.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
|
||||||
|
|
||||||
|
|
||||||
//TODO 零时处理
|
|
||||||
List<SysDicTreePO> dicTree = dictTreeFeignClient.queryAll().getData();
|
List<SysDicTreePO> dicTree = dictTreeFeignClient.queryAll().getData();
|
||||||
dicTree = dicTree.stream().filter(item->item.getCode()!="Device_Unit" && !item.getCode().contains("@")).collect(Collectors.toList());
|
dicTree = dicTree.stream().filter(item->item.getCode()!="Device_Unit" && !item.getCode().contains("@")).collect(Collectors.toList());
|
||||||
Map<String,SysDicTreePO> objTypeMap = dicTree.stream().collect(Collectors.toMap(SysDicTreePO::getName,Function.identity()));
|
Map<String,SysDicTreePO> objTypeMap = dicTree.stream().collect(Collectors.toMap(SysDicTreePO::getName,Function.identity()));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (OracleTerminalExcel oracleTerminalExcel : oracleTerminalExcelList) {
|
for (OracleTerminalExcel oracleTerminalExcel : oracleTerminalExcelList) {
|
||||||
|
|
||||||
//单位
|
//单位
|
||||||
if(oracleTerminalExcel.getGdName().equals("省检修")){
|
if (oracleTerminalExcel.getGdName().equals("省检修")) {
|
||||||
oracleTerminalExcel.setGdName("国网河北超高压公司本部");
|
oracleTerminalExcel.setGdName("国网河北超高压公司本部");
|
||||||
}else {
|
} else {
|
||||||
oracleTerminalExcel.setGdName("国网"+oracleTerminalExcel.getGdName()+"本部");
|
oracleTerminalExcel.setGdName("国网" + oracleTerminalExcel.getGdName() + "本部");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mapDept.containsKey(oracleTerminalExcel.getGdName())) {
|
if (!mapDept.containsKey(oracleTerminalExcel.getGdName())) {
|
||||||
@@ -1383,7 +1385,6 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
|
|
||||||
//判断是否操作过该条记录
|
//判断是否操作过该条记录
|
||||||
LineBak lineBak = lineBakMapper.selectOne(new LambdaQueryWrapper<LineBak>().eq(LineBak::getLineId, oracleTerminalExcel.getId()));
|
LineBak lineBak = lineBakMapper.selectOne(new LambdaQueryWrapper<LineBak>().eq(LineBak::getLineId, oracleTerminalExcel.getId()));
|
||||||
|
|
||||||
DeviceBak deviceBak = deviceBakMapper.selectOne(new LambdaQueryWrapper<DeviceBak>().eq(DeviceBak::getDevId, oracleTerminalExcel.getDeviceId()));
|
DeviceBak deviceBak = deviceBakMapper.selectOne(new LambdaQueryWrapper<DeviceBak>().eq(DeviceBak::getDevId, oracleTerminalExcel.getDeviceId()));
|
||||||
|
|
||||||
|
|
||||||
@@ -1452,14 +1453,6 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* if (devTypelDicMap.containsKey(oracleTerminalExcel.getDevType())) {
|
|
||||||
pmsTerminalPO.setTerminalState(devTypelDicMap.get(oracleTerminalExcel.getDevType()).getId());
|
|
||||||
} else {
|
|
||||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "字典终端状态不存在,请确认后重试"));
|
|
||||||
continue;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
//终端状态
|
//终端状态
|
||||||
String devState = null;
|
String devState = null;
|
||||||
switch (oracleTerminalExcel.getRunFlag()) {
|
switch (oracleTerminalExcel.getRunFlag()) {
|
||||||
@@ -1509,16 +1502,10 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
deviceBakMapper.insert(deviceBakPO);
|
deviceBakMapper.insert(deviceBakPO);
|
||||||
terminalMapper.updateById(pmsTerminalPO);
|
terminalMapper.updateById(pmsTerminalPO);
|
||||||
devId = pmsTerminal.getId();
|
devId = pmsTerminal.getId();
|
||||||
} else if (Objects.isNull(pmsTerminal)) {
|
|
||||||
terminalMapper.deleteById(deviceBak.getId());
|
|
||||||
pmsTerminalPO.setId(deviceBak.getId());
|
|
||||||
terminalMapper.insert(pmsTerminalPO);
|
|
||||||
devId = pmsTerminalPO.getId();
|
|
||||||
} else {
|
} else {
|
||||||
devId = pmsTerminal.getId();
|
devId = deviceBak.getId();
|
||||||
pmsTerminalPO.setId(devId);
|
pmsTerminalPO.setId(devId);
|
||||||
terminalMapper.updateById(pmsTerminalPO);
|
terminalMapper.updateById(pmsTerminalPO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1530,8 +1517,6 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
GeneratrixWire generatrixWire = generatrixWireMapper.selectOne(generatrixWireLambdaQueryWrapper);
|
GeneratrixWire generatrixWire = generatrixWireMapper.selectOne(generatrixWireLambdaQueryWrapper);
|
||||||
|
|
||||||
String lineId = null, lineName = null, genScale = null;
|
String lineId = null, lineName = null, genScale = null;
|
||||||
|
|
||||||
|
|
||||||
GeneratrixWire generatrixWirePO = new GeneratrixWire();
|
GeneratrixWire generatrixWirePO = new GeneratrixWire();
|
||||||
generatrixWirePO.setGeneratrixName(oracleTerminalExcel.getSubvName());
|
generatrixWirePO.setGeneratrixName(oracleTerminalExcel.getSubvName());
|
||||||
generatrixWirePO.setStatus(DataStateEnum.ENABLE.getCode());
|
generatrixWirePO.setStatus(DataStateEnum.ENABLE.getCode());
|
||||||
@@ -1557,7 +1542,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
} else {
|
} else {
|
||||||
generatrixWirePO.setId(generatrixWire.getId());
|
generatrixWirePO.setId(generatrixWire.getId());
|
||||||
generatrixWireMapper.updateById(generatrixWirePO);
|
generatrixWireMapper.updateById(generatrixWirePO);
|
||||||
lineId = generatrixWire.getId();
|
lineId = generatrixWirePO.getId();
|
||||||
lineName = generatrixWirePO.getName();
|
lineName = generatrixWirePO.getName();
|
||||||
genScale = generatrixWirePO.getScale();
|
genScale = generatrixWirePO.getScale();
|
||||||
}
|
}
|
||||||
@@ -1566,11 +1551,8 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
LambdaQueryWrapper<Monitor> monitorLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Monitor> monitorLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
monitorLambdaQueryWrapper.eq(Monitor::getLineId, lineId)
|
monitorLambdaQueryWrapper.eq(Monitor::getLineId, lineId)
|
||||||
.eq(Monitor::getName, oracleTerminalExcel.getLineName());
|
.eq(Monitor::getName, oracleTerminalExcel.getLineName());
|
||||||
List<Monitor> monitorList = monitorMapper.selectList(monitorLambdaQueryWrapper);
|
Monitor monitor = monitorMapper.selectOne(monitorLambdaQueryWrapper);
|
||||||
|
|
||||||
if(CollUtil.isNotEmpty(monitorList)) {
|
|
||||||
|
|
||||||
for (Monitor monitor : monitorList) {
|
|
||||||
|
|
||||||
//当前电站下面没有监测点,可以新增
|
//当前电站下面没有监测点,可以新增
|
||||||
Monitor monitorPO = new Monitor();
|
Monitor monitorPO = new Monitor();
|
||||||
@@ -1591,6 +1573,8 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
one = "06";
|
one = "06";
|
||||||
} else if (deptDTO.getName().contains("超高压")) {
|
} else if (deptDTO.getName().contains("超高压")) {
|
||||||
one = "07";
|
one = "07";
|
||||||
|
} else if (deptDTO.getName().contains("雄安")) {
|
||||||
|
one = "08";
|
||||||
} else {
|
} else {
|
||||||
one = "3.14159";
|
one = "3.14159";
|
||||||
}
|
}
|
||||||
@@ -1599,7 +1583,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
|
|
||||||
monitorPO.setMonitorId(monitorId + one + last);
|
monitorPO.setMonitorId(monitorId + one + last);
|
||||||
|
|
||||||
|
monitorPO.setLineNum(oracleTerminalExcel.getLineNum());
|
||||||
monitorPO.setName(oracleTerminalExcel.getLineName());
|
monitorPO.setName(oracleTerminalExcel.getLineName());
|
||||||
monitorPO.setPowerrName(stationName);
|
monitorPO.setPowerrName(stationName);
|
||||||
monitorPO.setPowerrId(stationId);
|
monitorPO.setPowerrId(stationId);
|
||||||
@@ -1636,7 +1620,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "字典监测点运行状态不存在,请确认后重试"));
|
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "字典监测点运行状态不存在,请确认后重试"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
monitorPO.setPutDate(oracleTerminalExcel.getLoginTime());
|
||||||
monitorPO.setMonitorType(monitorType.getId());
|
monitorPO.setMonitorType(monitorType.getId());
|
||||||
monitorPO.setStandShortCapacity(oracleTerminalExcel.getStandardCapacity());
|
monitorPO.setStandShortCapacity(oracleTerminalExcel.getStandardCapacity());
|
||||||
monitorPO.setMinShortCircuitCapacity(oracleTerminalExcel.getShortCapacity());
|
monitorPO.setMinShortCircuitCapacity(oracleTerminalExcel.getShortCapacity());
|
||||||
@@ -1656,7 +1640,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
monitorPO.setMonitorObjectName(oracleTerminalExcel.getObjName());
|
monitorPO.setMonitorObjectName(oracleTerminalExcel.getObjName());
|
||||||
|
|
||||||
|
|
||||||
if (oracleTerminalExcel.getLoadType().equals("电加热负荷") ||oracleTerminalExcel.getLoadType().equals("轧机") || oracleTerminalExcel.getLoadType().equals("其他非线性负荷")) {
|
if (oracleTerminalExcel.getLoadType().equals("电加热负荷") || oracleTerminalExcel.getLoadType().equals("轧机") || oracleTerminalExcel.getLoadType().equals("其他非线性负荷")|| oracleTerminalExcel.getLoadType().equals("变频调速负荷")) {
|
||||||
if (objTypeDicMap.containsKey("冶炼负荷")) {
|
if (objTypeDicMap.containsKey("冶炼负荷")) {
|
||||||
String objTypeId = objTypeDicMap.get("冶炼负荷").getId();
|
String objTypeId = objTypeDicMap.get("冶炼负荷").getId();
|
||||||
monitorPO.setMonitorTag(objTypeId);
|
monitorPO.setMonitorTag(objTypeId);
|
||||||
@@ -1664,7 +1648,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "冶炼负荷字典监测标签不存在,请确认后重试"));
|
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "冶炼负荷字典监测标签不存在,请确认后重试"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else if (oracleTerminalExcel.getLoadType().equals("商业/市政/民用/电子通讯负荷")) {
|
} else if (oracleTerminalExcel.getLoadType().equals("商业/市政/民用/电子通讯负荷")|| "电动汽车充电站".equals(oracleTerminalExcel.getLoadType()) ||"轨道交通".equals(oracleTerminalExcel.getLoadType())) {
|
||||||
if (objTypeDicMap.containsKey("城市商业")) {
|
if (objTypeDicMap.containsKey("城市商业")) {
|
||||||
String objTypeId = objTypeDicMap.get("城市商业").getId();
|
String objTypeId = objTypeDicMap.get("城市商业").getId();
|
||||||
monitorPO.setMonitorTag(objTypeId);
|
monitorPO.setMonitorTag(objTypeId);
|
||||||
@@ -1673,7 +1657,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (oracleTerminalExcel.getLoadType().equals("半导体制造") || oracleTerminalExcel.getLoadType().equals("精密加工")) {
|
} else if (oracleTerminalExcel.getLoadType().equals("半导体制造") || oracleTerminalExcel.getLoadType().equals("精密加工") || oracleTerminalExcel.getLoadType().equals("党政机关")||"敏感/重要/高危用户".equals(oracleTerminalExcel.getLoadType())) {
|
||||||
if (objTypeDicMap.containsKey("敏感用户")) {
|
if (objTypeDicMap.containsKey("敏感用户")) {
|
||||||
String objTypeId = objTypeDicMap.get("敏感用户").getId();
|
String objTypeId = objTypeDicMap.get("敏感用户").getId();
|
||||||
monitorPO.setMonitorTag(objTypeId);
|
monitorPO.setMonitorTag(objTypeId);
|
||||||
@@ -1687,10 +1671,10 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
String objTypeId = objTypeDicMap.get("主变高压侧").getId();
|
String objTypeId = objTypeDicMap.get("主变高压侧").getId();
|
||||||
monitorPO.setMonitorTag(objTypeId);
|
monitorPO.setMonitorTag(objTypeId);
|
||||||
} else {
|
} else {
|
||||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "字典监测标签不存在,请确认后重试"));
|
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "主变高压侧字典监测标签不存在,请确认后重试"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}else if(oracleTerminalExcel.getLoadType().equals("跨省计量关口")){
|
} else if (oracleTerminalExcel.getLoadType().equals("跨省计量关口")) {
|
||||||
if (objTypeDicMap.containsKey("跨省联络线")) {
|
if (objTypeDicMap.containsKey("跨省联络线")) {
|
||||||
String objTypeId = objTypeDicMap.get("跨省联络线").getId();
|
String objTypeId = objTypeDicMap.get("跨省联络线").getId();
|
||||||
monitorPO.setMonitorTag(objTypeId);
|
monitorPO.setMonitorTag(objTypeId);
|
||||||
@@ -1699,7 +1683,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if(oracleTerminalExcel.getLoadType().equals("光伏电站")){
|
} else if (oracleTerminalExcel.getLoadType().equals("光伏电站")) {
|
||||||
if (objTypeDicMap.containsKey("光伏电站")) {
|
if (objTypeDicMap.containsKey("光伏电站")) {
|
||||||
String objTypeId = objTypeDicMap.get("光伏电站").getId();
|
String objTypeId = objTypeDicMap.get("光伏电站").getId();
|
||||||
monitorPO.setMonitorTag(objTypeId);
|
monitorPO.setMonitorTag(objTypeId);
|
||||||
@@ -1708,42 +1692,55 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}else if (oracleTerminalExcel.getLoadType().equals("风电场")) {
|
||||||
|
if (objTypeDicMap.containsKey("陆上风电")) {
|
||||||
|
String objTypeId = objTypeDicMap.get("陆上风电").getId();
|
||||||
|
monitorPO.setMonitorTag(objTypeId);
|
||||||
|
} else {
|
||||||
|
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "风电场字典监测标签不存在,请确认后重试"));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
}else if (oracleTerminalExcel.getLoadType().equals("其他发电厂")) {
|
||||||
|
if (objTypeDicMap.containsKey("其他电源")) {
|
||||||
|
String objTypeId = objTypeDicMap.get("其他电源").getId();
|
||||||
|
monitorPO.setMonitorTag(objTypeId);
|
||||||
|
} else {
|
||||||
|
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "其他电源监测标签不存在,请确认后重试"));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (objTypeDicMap.containsKey(oracleTerminalExcel.getLoadType())) {
|
if (objTypeDicMap.containsKey(oracleTerminalExcel.getLoadType())) {
|
||||||
String objTypeId = objTypeDicMap.get(oracleTerminalExcel.getLoadType()).getId();
|
String objTypeId = objTypeDicMap.get(oracleTerminalExcel.getLoadType()).getId();
|
||||||
monitorPO.setMonitorTag(objTypeId);
|
monitorPO.setMonitorTag(objTypeId);
|
||||||
} else {
|
} else {
|
||||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "字典监测标签不存在,请确认后重试"));
|
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, oracleTerminalExcel.getLoadType()+"字典监测标签不存在,请确认后重试"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//监测点对象类型
|
//监测点对象类型
|
||||||
|
|
||||||
if (objTypeMap.containsKey(oracleTerminalExcel.getLoadType())) {
|
if (objTypeMap.containsKey(oracleTerminalExcel.getLoadType())) {
|
||||||
String objTypeId = objTypeMap.get(oracleTerminalExcel.getLoadType()).getId();
|
String objTypeId = objTypeMap.get(oracleTerminalExcel.getLoadType()).getId();
|
||||||
monitorPO.setObjType(objTypeId);
|
monitorPO.setObjType(objTypeId);
|
||||||
}else if(oracleTerminalExcel.getLoadType().equals("电加热负荷")){
|
} else if (oracleTerminalExcel.getLoadType().equals("电加热负荷")) {
|
||||||
String objTypeId = objTypeMap.get("电加热负荷(含电弧炉、中频炉、电热炉、单/多晶硅生产设备)").getId();
|
String objTypeId = objTypeMap.get("电加热负荷(含电弧炉、中频炉、电热炉、单/多晶硅生产设备)").getId();
|
||||||
monitorPO.setObjType(objTypeId);
|
monitorPO.setObjType(objTypeId);
|
||||||
|
} else if (oracleTerminalExcel.getLoadType().equals("变频调速负荷")) {
|
||||||
|
String objTypeId = objTypeMap.get("变频调速负荷(变频电机、变频水泵等)").getId();
|
||||||
|
monitorPO.setObjType(objTypeId);
|
||||||
|
} else if (oracleTerminalExcel.getLoadType().equals("敏感/重要/高危用户")) {
|
||||||
|
String objTypeId = objTypeMap.get("敏感/重要/高危用户").getId();
|
||||||
|
monitorPO.setObjType(objTypeId);
|
||||||
} else {
|
} else {
|
||||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, oracleTerminalExcel.getLoadType() + "字典监测点对象类型不存在,请确认后重试"));
|
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, oracleTerminalExcel.getLoadType() + "字典监测点对象类型不存在,请确认后重试"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//行业类型
|
|
||||||
/* if (businessDicMap.containsKey(oracleTerminalExcel.getBusinessType())) {
|
|
||||||
String busTypeId = businessDicMap.get(oracleTerminalExcel.getBusinessType()).getId();
|
|
||||||
monitorPO.setTradeCode(busTypeId);
|
|
||||||
} else {
|
|
||||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, oracleTerminalExcel.getBusinessType()+"字典行业类型不存在,请确认后重试"));
|
|
||||||
continue;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
//TODO 监测点对象名称
|
//TODO 监测点对象名称
|
||||||
|
|
||||||
|
|
||||||
String wireMethod = "";
|
String wireMethod = "";
|
||||||
switch (oracleTerminalExcel.getPtType()) {
|
switch (oracleTerminalExcel.getPtType()) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -1784,7 +1781,6 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
monitorPO.setPowerFlag("102");
|
monitorPO.setPowerFlag("102");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (Objects.isNull(lineBak) && Objects.isNull(monitor)) {
|
if (Objects.isNull(lineBak) && Objects.isNull(monitor)) {
|
||||||
monitorPO.setIsUpToGrid(0);
|
monitorPO.setIsUpToGrid(0);
|
||||||
monitorMapper.insert(monitorPO);
|
monitorMapper.insert(monitorPO);
|
||||||
@@ -1801,23 +1797,23 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
lineBakPO.setId(monitorPO.getId());
|
lineBakPO.setId(monitorPO.getId());
|
||||||
lineBakPO.setLineId(oracleTerminalExcel.getId());
|
lineBakPO.setLineId(oracleTerminalExcel.getId());
|
||||||
lineBakMapper.insert(lineBakPO);
|
lineBakMapper.insert(lineBakPO);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (Objects.isNull(lineBak)) {
|
if (Objects.isNull(lineBak)) {
|
||||||
|
|
||||||
|
lineBakMapper.delete(new LambdaQueryWrapper<LineBak>().eq(LineBak::getId,monitor.getId()));
|
||||||
LineBak lineBakPO = new LineBak();
|
LineBak lineBakPO = new LineBak();
|
||||||
lineBakPO.setId(monitor.getId());
|
lineBakPO.setId(monitor.getId());
|
||||||
lineBakPO.setLineId(oracleTerminalExcel.getId());
|
lineBakPO.setLineId(oracleTerminalExcel.getId());
|
||||||
|
System.out.println(oracleTerminalExcel.getId());
|
||||||
lineBakMapper.insert(lineBakPO);
|
lineBakMapper.insert(lineBakPO);
|
||||||
monitorMapper.updateById(monitorPO);
|
monitorMapper.updateById(monitorPO);
|
||||||
} else if (Objects.isNull(monitor)) {
|
|
||||||
monitorPO.setIsUpToGrid(0);
|
|
||||||
monitorMapper.deleteById(lineBak.getId());
|
|
||||||
monitorPO.setId(lineBak.getId());
|
|
||||||
monitorMapper.insert(monitorPO);
|
|
||||||
} else {
|
} else {
|
||||||
monitorPO.setId(lineBak.getId());
|
monitorPO.setId(lineBak.getId());
|
||||||
monitorMapper.updateById(monitorPO);
|
monitorMapper.updateById(monitorPO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Overlimit overlimit = COverlimitUtil.globalAssemble(Float.parseFloat(scale.getValue()), oracleTerminalExcel.getDealCapacity(), oracleTerminalExcel.getDevCapacity(), oracleTerminalExcel.getShortCapacity(), 0, 0);
|
Overlimit overlimit = COverlimitUtil.globalAssemble(Float.parseFloat(scale.getValue()), oracleTerminalExcel.getDealCapacity(), oracleTerminalExcel.getDevCapacity(), oracleTerminalExcel.getShortCapacity(), 0, 0);
|
||||||
overlimit.setId(monitorPO.getId());
|
overlimit.setId(monitorPO.getId());
|
||||||
Overlimit overlimitRes = overlimitMapper.selectById(monitorPO.getId());
|
Overlimit overlimitRes = overlimitMapper.selectById(monitorPO.getId());
|
||||||
@@ -1828,13 +1824,10 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(oracleTerminalExcelMsg)) {
|
if (CollectionUtil.isNotEmpty(oracleTerminalExcelMsg)) {
|
||||||
ExcelUtil.exportExcel("失败列表.xlsx", OracleTerminalExcel.OracleTerminalExcelMsg.class, oracleTerminalExcelMsg);
|
ExcelUtil.exportExcel("失败列表.xlsx", OracleTerminalExcel.OracleTerminalExcelMsg.class, oracleTerminalExcelMsg);
|
||||||
return null;
|
return null;
|
||||||
@@ -1845,11 +1838,11 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
|
|
||||||
private String dealVoltageLevel(String voltage) {
|
private String dealVoltageLevel(String voltage) {
|
||||||
float scale = Float.parseFloat(voltage.substring(0, voltage.indexOf("kV")));
|
float scale = Float.parseFloat(voltage.substring(0, voltage.indexOf("kV")));
|
||||||
if (scale < 500) {
|
//if (scale < 500) {
|
||||||
return "交流" + voltage;
|
return "交流" + voltage;
|
||||||
} else {
|
//} else {
|
||||||
return "直流" + voltage;
|
// return "直流" + voltage;
|
||||||
}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -183,7 +184,7 @@ public class DeviceController extends BaseController {
|
|||||||
@ApiOperation("修改装置通讯状态")
|
@ApiOperation("修改装置通讯状态")
|
||||||
public HttpResult<Boolean> updateDevComFlag(@RequestBody DevComFlagDTO devComFlagDTO) {
|
public HttpResult<Boolean> updateDevComFlag(@RequestBody DevComFlagDTO devComFlagDTO) {
|
||||||
String methodDescribe = getMethodDescribe("updateDevComFlag");
|
String methodDescribe = getMethodDescribe("updateDevComFlag");
|
||||||
boolean update = iDeviceService.lambdaUpdate().set(Device::getComFlag, devComFlagDTO.getStatus()).set(Device::getUpdateTime, devComFlagDTO.getDate()).eq(Device::getId, devComFlagDTO.getId()).update();
|
boolean update = iDeviceService.lambdaUpdate().set(Objects.nonNull(devComFlagDTO.getStatus()), Device::getComFlag,devComFlagDTO.getStatus()).set(Device::getUpdateTime, devComFlagDTO.getDate()).eq(Device::getId, devComFlagDTO.getId()).update();
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, update, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, update, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -121,13 +121,13 @@ public class TerminalBaseController extends BaseController {
|
|||||||
}
|
}
|
||||||
terminalBaseService.addTerminal(addTerminalParam);
|
terminalBaseService.addTerminal(addTerminalParam);
|
||||||
//新增终端后发送消息给前置重启设备
|
//新增终端后发送消息给前置重启设备
|
||||||
if (Objects.nonNull(addTerminalParam.getDeviceParam())) {
|
// if (Objects.nonNull(addTerminalParam.getDeviceParam())) {
|
||||||
addTerminalParam.getDeviceParam().forEach(temp->{
|
// addTerminalParam.getDeviceParam().forEach(temp->{
|
||||||
Line line = terminalBaseService.queryTerminalByName(temp.getName());
|
// Line line = terminalBaseService.queryTerminalByName(temp.getName());
|
||||||
terminalBaseService.askRestartDevice(line.getId(), DeviceRebootType.ADD_TERMINAL);
|
// terminalBaseService.askRestartDevice(line.getId(), DeviceRebootType.ADD_TERMINAL);
|
||||||
});
|
// });
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,7 @@ public class TerminalBaseController extends BaseController {
|
|||||||
|
|
||||||
Boolean b = terminalBaseService.terminalSyncDeleteFly(lineId);
|
Boolean b = terminalBaseService.terminalSyncDeleteFly(lineId);
|
||||||
//删除监测点即修改终端通知前置重启
|
//删除监测点即修改终端通知前置重启
|
||||||
terminalBaseService.askRestartDevice(devId,DeviceRebootType.LEDGER_MODIFY);
|
// terminalBaseService.askRestartDevice(devId,DeviceRebootType.LEDGER_MODIFY);
|
||||||
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||||
}
|
}
|
||||||
@@ -211,8 +211,7 @@ public class TerminalBaseController extends BaseController {
|
|||||||
public HttpResult<Object> delTerminal(@RequestParam("id") String id) {
|
public HttpResult<Object> delTerminal(@RequestParam("id") String id) {
|
||||||
String methodDescribe = getMethodDescribe("delTerminal");
|
String methodDescribe = getMethodDescribe("delTerminal");
|
||||||
terminalBaseService.delTerminal(id);
|
terminalBaseService.delTerminal(id);
|
||||||
// 删除终端通知前置重启
|
|
||||||
terminalBaseService.askRestartDevice(id,DeviceRebootType.DELETE_TERMINAL);
|
|
||||||
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1802,7 +1802,7 @@
|
|||||||
line.Name name,
|
line.Name name,
|
||||||
pq_line_detail.Num lineNo,
|
pq_line_detail.Num lineNo,
|
||||||
s1.Name voltageLevel,
|
s1.Name voltageLevel,
|
||||||
pq_line_detail.PT_Phase_Type ptType,
|
pq_line_detail.PT_Type ptType,
|
||||||
pq_line_detail.Run_Flag status
|
pq_line_detail.Run_Flag status
|
||||||
FROM
|
FROM
|
||||||
pq_line_detail
|
pq_line_detail
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
pq_device_process.process_no processNo,
|
pq_device_process.process_no processNo,
|
||||||
pq_device.Dev_Key devKey
|
pq_device.Dev_Key devKey
|
||||||
FROM
|
FROM
|
||||||
pq_node
|
pq_device
|
||||||
LEFT JOIN pq_device ON pq_node.Id = pq_device.Node_Id
|
LEFT JOIN pq_node ON pq_node.Id = pq_device.Node_Id
|
||||||
LEFT JOIN pq_line on pq_device.id = pq_line.id
|
LEFT JOIN pq_line on pq_device.id = pq_line.id
|
||||||
LEFT JOIN pq_device_process on pq_device_process.id = pq_device.id
|
LEFT JOIN pq_device_process on pq_device_process.id = pq_device.id
|
||||||
LEFT JOIN sys_dict_data s1 ON pq_device.Dev_Type = s1.id
|
LEFT JOIN sys_dict_data s1 ON pq_device.Dev_Type = s1.id
|
||||||
|
|||||||
@@ -93,7 +93,6 @@ import java.util.stream.Stream;
|
|||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> implements TerminalBaseService {
|
public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> implements TerminalBaseService {
|
||||||
|
|
||||||
private final DeviceMapper deviceMapper;
|
private final DeviceMapper deviceMapper;
|
||||||
private final SuperDataMapper superDataMapper;
|
private final SuperDataMapper superDataMapper;
|
||||||
private final IPqsTerminalLogsService iPqsTerminalLogsService;
|
private final IPqsTerminalLogsService iPqsTerminalLogsService;
|
||||||
@@ -303,6 +302,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
processCountMap.put(processNum, processCount);
|
processCountMap.put(processNum, processCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
processCountMap = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取数量最少的线程号
|
//获取数量最少的线程号
|
||||||
@@ -1511,7 +1512,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
LambdaQueryWrapper<DeptLine> lineLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<DeptLine> lineLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lineLambdaQueryWrapper.in(DeptLine::getLineId, lineIndexList);
|
lineLambdaQueryWrapper.in(DeptLine::getLineId, lineIndexList);
|
||||||
deptLineMapper.delete(lineLambdaQueryWrapper);
|
deptLineMapper.delete(lineLambdaQueryWrapper);
|
||||||
|
// 删除终端通知前置重启
|
||||||
|
// this.askRestartDevice(id,DeviceRebootType.DELETE_TERMINAL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1532,7 +1534,9 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
LambdaQueryWrapper<DeptLine> lineLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<DeptLine> lineLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lineLambdaQueryWrapper.in(DeptLine::getLineId, lineIndexList);
|
lineLambdaQueryWrapper.in(DeptLine::getLineId, lineIndexList);
|
||||||
deptLineMapper.delete(lineLambdaQueryWrapper);
|
deptLineMapper.delete(lineLambdaQueryWrapper);
|
||||||
|
//通知前置删除监测点
|
||||||
|
// String[] split = obj.getPids().split(",");
|
||||||
|
// this.askRestartDevice(split[4],DeviceRebootType.LEDGER_MODIFY);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1542,6 +1546,9 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
lineDetailMapper.deleteById(obj.getId());
|
lineDetailMapper.deleteById(obj.getId());
|
||||||
overlimitMapper.deleteById(obj.getId());
|
overlimitMapper.deleteById(obj.getId());
|
||||||
deptLineMapper.deleteById(obj.getId());
|
deptLineMapper.deleteById(obj.getId());
|
||||||
|
//通知前置删除监测点
|
||||||
|
// String[] split = obj.getPids().split(",");
|
||||||
|
// this.askRestartDevice(split[4],DeviceRebootType.LEDGER_MODIFY);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new BusinessException(CommonResponseEnum.FAIL);
|
throw new BusinessException(CommonResponseEnum.FAIL);
|
||||||
@@ -3566,15 +3573,15 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
public void askRestartProcess(Integer processNum,String processType, String processRebootType) {
|
public void askRestartProcess(Integer processNum,String processType, String processRebootType) {
|
||||||
|
|
||||||
ProcessRebootMessage procesRebootMessage = new ProcessRebootMessage();
|
ProcessRebootMessage procesRebootMessage = new ProcessRebootMessage();
|
||||||
procesRebootMessage.setIndex(processNum);
|
// procesRebootMessage.setIndex(processNum);
|
||||||
List<ProcessRebootMessage.RebootData> list = new ArrayList<>();
|
// List<ProcessRebootMessage.RebootData> list = new ArrayList<>();
|
||||||
ProcessRebootMessage.RebootData rebootData = new ProcessRebootMessage.RebootData();
|
// ProcessRebootMessage.RebootData rebootData = new ProcessRebootMessage.RebootData();
|
||||||
|
//
|
||||||
rebootData.setFun(processType);
|
// rebootData.setFun(processType);
|
||||||
rebootData.setProcessNum(processNum);
|
// rebootData.setProcessNum(processNum);
|
||||||
rebootData.setFrontType(processRebootType);
|
// rebootData.setFrontType(processRebootType);
|
||||||
list.add(rebootData);
|
// list.add(rebootData);
|
||||||
procesRebootMessage.setData(list);
|
// procesRebootMessage.setData(list);
|
||||||
produceFeignClient.askRestartProcess(procesRebootMessage);
|
produceFeignClient.askRestartProcess(procesRebootMessage);
|
||||||
|
|
||||||
|
|
||||||
@@ -3582,6 +3589,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Async
|
||||||
public void askRestartDevice(String devId, String deviceRebootType) {
|
public void askRestartDevice(String devId, String deviceRebootType) {
|
||||||
DeviceProcess one = deviceProcessService.lambdaQuery().eq(DeviceProcess::getId, devId).one();
|
DeviceProcess one = deviceProcessService.lambdaQuery().eq(DeviceProcess::getId, devId).one();
|
||||||
|
|
||||||
|
|||||||
@@ -17,84 +17,84 @@ public class EventDipShortDistributionVO implements Serializable {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private int featureAmp90with100ms;
|
private int featureAmp90with100ms=0;
|
||||||
private int featureAmp90with250ms;
|
private int featureAmp90with250ms=0;
|
||||||
private int featureAmp90with500ms;
|
private int featureAmp90with500ms=0;
|
||||||
private int featureAmp90with1000ms;
|
private int featureAmp90with1000ms=0;
|
||||||
private int featureAmp90with3000ms;
|
private int featureAmp90with3000ms=0;
|
||||||
private int featureAmp90with10000ms;
|
private int featureAmp90with10000ms=0;
|
||||||
private int featureAmp90with20000ms;
|
private int featureAmp90with20000ms=0;
|
||||||
private int featureAmp90with60000ms;
|
private int featureAmp90with60000ms=0;
|
||||||
|
|
||||||
private int featureAmp80with100ms;
|
private int featureAmp80with100ms=0;
|
||||||
private int featureAmp80with250ms;
|
private int featureAmp80with250ms=0;
|
||||||
private int featureAmp80with500ms;
|
private int featureAmp80with500ms=0;
|
||||||
private int featureAmp80with1000ms;
|
private int featureAmp80with1000ms=0;
|
||||||
private int featureAmp80with3000ms;
|
private int featureAmp80with3000ms=0;
|
||||||
private int featureAmp80with10000ms;
|
private int featureAmp80with10000ms=0;
|
||||||
private int featureAmp80with20000ms;
|
private int featureAmp80with20000ms=0;
|
||||||
private int featureAmp80with60000ms;
|
private int featureAmp80with60000ms=0;
|
||||||
|
|
||||||
private int featureAmp70with100ms;
|
private int featureAmp70with100ms=0;
|
||||||
private int featureAmp70with250ms;
|
private int featureAmp70with250ms=0;
|
||||||
private int featureAmp70with500ms;
|
private int featureAmp70with500ms=0;
|
||||||
private int featureAmp70with1000ms;
|
private int featureAmp70with1000ms=0;
|
||||||
private int featureAmp70with3000ms;
|
private int featureAmp70with3000ms=0;
|
||||||
private int featureAmp70with10000ms;
|
private int featureAmp70with10000ms=0;
|
||||||
private int featureAmp70with20000ms;
|
private int featureAmp70with20000ms=0;
|
||||||
private int featureAmp70with60000ms;
|
private int featureAmp70with60000ms=0;
|
||||||
|
|
||||||
private int featureAmp60with100ms;
|
private int featureAmp60with100ms=0;
|
||||||
private int featureAmp60with250ms;
|
private int featureAmp60with250ms=0;
|
||||||
private int featureAmp60with500ms;
|
private int featureAmp60with500ms=0;
|
||||||
private int featureAmp60with1000ms;
|
private int featureAmp60with1000ms=0;
|
||||||
private int featureAmp60with3000ms;
|
private int featureAmp60with3000ms=0;
|
||||||
private int featureAmp60with10000ms;
|
private int featureAmp60with10000ms=0;
|
||||||
private int featureAmp60with20000ms;
|
private int featureAmp60with20000ms=0;
|
||||||
private int featureAmp60with60000ms;
|
private int featureAmp60with60000ms=0;
|
||||||
|
|
||||||
private int featureAmp50with100ms;
|
private int featureAmp50with100ms=0;
|
||||||
private int featureAmp50with250ms;
|
private int featureAmp50with250ms=0;
|
||||||
private int featureAmp50with500ms;
|
private int featureAmp50with500ms=0;
|
||||||
private int featureAmp50with1000ms;
|
private int featureAmp50with1000ms=0;
|
||||||
private int featureAmp50with3000ms;
|
private int featureAmp50with3000ms=0;
|
||||||
private int featureAmp50with10000ms;
|
private int featureAmp50with10000ms=0;
|
||||||
private int featureAmp50with20000ms;
|
private int featureAmp50with20000ms=0;
|
||||||
private int featureAmp50with60000ms;
|
private int featureAmp50with60000ms=0;
|
||||||
|
|
||||||
private int featureAmp40with100ms;
|
private int featureAmp40with100ms=0;
|
||||||
private int featureAmp40with250ms;
|
private int featureAmp40with250ms=0;
|
||||||
private int featureAmp40with500ms;
|
private int featureAmp40with500ms=0;
|
||||||
private int featureAmp40with1000ms;
|
private int featureAmp40with1000ms=0;
|
||||||
private int featureAmp40with3000ms;
|
private int featureAmp40with3000ms=0;
|
||||||
private int featureAmp40with10000ms;
|
private int featureAmp40with10000ms=0;
|
||||||
private int featureAmp40with20000ms;
|
private int featureAmp40with20000ms=0;
|
||||||
private int featureAmp40with60000ms;
|
private int featureAmp40with60000ms=0;
|
||||||
|
|
||||||
private int featureAmp30with100ms;
|
private int featureAmp30with100ms=0;
|
||||||
private int featureAmp30with250ms;
|
private int featureAmp30with250ms=0;
|
||||||
private int featureAmp30with500ms;
|
private int featureAmp30with500ms=0;
|
||||||
private int featureAmp30with1000ms;
|
private int featureAmp30with1000ms=0;
|
||||||
private int featureAmp30with3000ms;
|
private int featureAmp30with3000ms=0;
|
||||||
private int featureAmp30with10000ms;
|
private int featureAmp30with10000ms=0;
|
||||||
private int featureAmp30with20000ms;
|
private int featureAmp30with20000ms=0;
|
||||||
private int featureAmp30with60000ms;
|
private int featureAmp30with60000ms=0;
|
||||||
|
|
||||||
private int featureAmp20with100ms;
|
private int featureAmp20with100ms=0;
|
||||||
private int featureAmp20with250ms;
|
private int featureAmp20with250ms=0;
|
||||||
private int featureAmp20with500ms;
|
private int featureAmp20with500ms=0;
|
||||||
private int featureAmp20with1000ms;
|
private int featureAmp20with1000ms=0;
|
||||||
private int featureAmp20with3000ms;
|
private int featureAmp20with3000ms=0;
|
||||||
private int featureAmp20with10000ms;
|
private int featureAmp20with10000ms=0;
|
||||||
private int featureAmp20with20000ms;
|
private int featureAmp20with20000ms=0;
|
||||||
private int featureAmp20with60000ms;
|
private int featureAmp20with60000ms=0;
|
||||||
|
|
||||||
private int featureAmp10with100ms;
|
private int featureAmp10with100ms=0;
|
||||||
private int featureAmp10with250ms;
|
private int featureAmp10with250ms=0;
|
||||||
private int featureAmp10with500ms;
|
private int featureAmp10with500ms=0;
|
||||||
private int featureAmp10with1000ms;
|
private int featureAmp10with1000ms=0;
|
||||||
private int featureAmp10with3000ms;
|
private int featureAmp10with3000ms=0;
|
||||||
private int featureAmp10with10000ms;
|
private int featureAmp10with10000ms=0;
|
||||||
private int featureAmp10with20000ms;
|
private int featureAmp10with20000ms=0;
|
||||||
private int featureAmp10with60000ms;
|
private int featureAmp10with60000ms=0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,18 +26,18 @@ public class EventRiseDistributionTableVO implements Serializable {
|
|||||||
* 持续时间100ms-500ms
|
* 持续时间100ms-500ms
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "duration500",value = "持续时间100ms-500ms")
|
@ApiModelProperty(name = "duration500",value = "持续时间100ms-500ms")
|
||||||
private Integer duration500;
|
private Integer duration500=0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 持续时间500ms-5000ms
|
* 持续时间500ms-5000ms
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "duration5000",value = "持续时间500ms-5000ms")
|
@ApiModelProperty(name = "duration5000",value = "持续时间500ms-5000ms")
|
||||||
private Integer duration5000;
|
private Integer duration5000=0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 持续时间5000ms-60000ms
|
* 持续时间5000ms-60000ms
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "duration60000",value = "持续时间5000ms-60000ms")
|
@ApiModelProperty(name = "duration60000",value = "持续时间5000ms-60000ms")
|
||||||
private Integer duration60000;
|
private Integer duration60000=0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,4 +53,7 @@ public interface PwEventDistributionStatisticsMapper {
|
|||||||
* @return com.njcn.event.pojo.vo.EventRiseDistributionVO
|
* @return com.njcn.event.pojo.vo.EventRiseDistributionVO
|
||||||
*/
|
*/
|
||||||
EventRiseDistributionVO getEventRiseDistributionByCond(Map<String, Object> map);
|
EventRiseDistributionVO getEventRiseDistributionByCond(Map<String, Object> map);
|
||||||
|
|
||||||
|
List<RmpEventDetailPO> getEventDipShortDistributionByCondition(Map<String, Object> condMap);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,13 +34,13 @@ public interface PwRmpEventDetailMapper extends BaseMapper<RmpEventDetailPO> {
|
|||||||
/**
|
/**
|
||||||
* 获取暂态事件明细
|
* 获取暂态事件明细
|
||||||
*
|
*
|
||||||
* @param monitorIds 监测点id
|
|
||||||
* @param eventType 暂态指标类型
|
* @param eventType 暂态指标类型
|
||||||
* @param startTime 开始时间
|
* @param startTime 开始时间
|
||||||
* @param endTime 结束时间
|
* @param endTime 结束时间
|
||||||
* @return 暂态事件明细
|
* @return 暂态事件明细
|
||||||
*/
|
*/
|
||||||
List<RmpEventDetailPO> getDetailsOfTransientEvents(@Param("monitorIds") List<String> monitorIds,
|
List<RmpEventDetailPO> getDetailsOfTransientEvents(
|
||||||
|
// @Param("monitorIds") List<String> monitorIds,
|
||||||
@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);
|
||||||
@@ -55,7 +55,8 @@ public interface PwRmpEventDetailMapper extends BaseMapper<RmpEventDetailPO> {
|
|||||||
* @param endTime
|
* @param endTime
|
||||||
* @return java.util.List<com.njcn.event.pojo.po.RmpEventDetailPO>
|
* @return java.util.List<com.njcn.event.pojo.po.RmpEventDetailPO>
|
||||||
*/
|
*/
|
||||||
List<RmpEventDetailPO> getDetailsOfTransientEventsByMonth(@Param("monitorIds") List<String> monitorIds,
|
List<RmpEventDetailPO> getDetailsOfTransientEventsByMonth(
|
||||||
|
// @Param("monitorIds") List<String> monitorIds,
|
||||||
@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);
|
||||||
|
|||||||
@@ -262,4 +262,39 @@
|
|||||||
)
|
)
|
||||||
r
|
r
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getEventDipShortDistributionByCondition" resultType="com.njcn.event.pojo.po.RmpEventDetailPO">
|
||||||
|
SELECT
|
||||||
|
measurement_point_id as measurementPointId,
|
||||||
|
start_time AS startTime,
|
||||||
|
duration AS duration,
|
||||||
|
feature_amplitude AS featureAmplitude
|
||||||
|
FROM
|
||||||
|
r_mp_event_detail
|
||||||
|
WHERE 1 = 1
|
||||||
|
|
||||||
|
AND event_type IN
|
||||||
|
<foreach collection="eventTypeList" item="type" open="(" close=")" separator=",">
|
||||||
|
#{type}
|
||||||
|
</foreach>
|
||||||
|
|
||||||
|
<choose>
|
||||||
|
<when test="dateType != null and dateType == 3">
|
||||||
|
<if test="startTime != null and startTime != ''">
|
||||||
|
AND DATE_FORMAT(start_time, '%Y-%m') >= #{startTime}
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null and endTime != ''">
|
||||||
|
AND DATE_FORMAT(start_time, '%Y-%m') <= #{endTime}
|
||||||
|
</if>
|
||||||
|
</when>
|
||||||
|
<when test="dateType != null and dateType == 5">
|
||||||
|
<if test="startTime != null and startTime != ''">
|
||||||
|
AND DATE_FORMAT(start_time, '%Y-%m-%d') >= #{startTime}
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null and endTime != ''">
|
||||||
|
AND DATE_FORMAT(start_time, '%Y-%m-%d') <= #{endTime}
|
||||||
|
</if>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -36,11 +36,11 @@
|
|||||||
Event_Type as eventType
|
Event_Type as eventType
|
||||||
FROM
|
FROM
|
||||||
r_mp_event_detail
|
r_mp_event_detail
|
||||||
WHERE
|
WHERE 1=1
|
||||||
measurement_point_id IN
|
<!-- measurement_point_id IN-->
|
||||||
<foreach collection="monitorIds" item="item" open="(" close=")" separator=",">
|
<!-- <foreach collection="monitorIds" item="item" open="(" close=")" separator=",">-->
|
||||||
#{item}
|
<!-- #{item}-->
|
||||||
</foreach>
|
<!-- </foreach>-->
|
||||||
<if test="eventType != null and eventType.size() >0">
|
<if test="eventType != null and eventType.size() >0">
|
||||||
AND Event_Type IN
|
AND Event_Type IN
|
||||||
<foreach collection="eventType" item="item" open="(" close=")" separator=",">
|
<foreach collection="eventType" item="item" open="(" close=")" separator=",">
|
||||||
@@ -71,12 +71,12 @@
|
|||||||
<if test="endTime != null and endTime != ''">
|
<if test="endTime != null and endTime != ''">
|
||||||
AND DATE_FORMAT(start_time, '%Y-%m') <= #{endTime}
|
AND DATE_FORMAT(start_time, '%Y-%m') <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="monitorIds != null and monitorIds.size() != 0 ">
|
<!-- <if test="monitorIds != null and monitorIds.size() != 0 ">-->
|
||||||
and measurement_point_id IN
|
<!-- and measurement_point_id IN-->
|
||||||
<foreach collection="monitorIds" item="item" open="(" close=")" separator=",">
|
<!-- <foreach collection="monitorIds" item="item" open="(" close=")" separator=",">-->
|
||||||
#{item}
|
<!-- #{item}-->
|
||||||
</foreach>
|
<!-- </foreach>-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<if test="eventType != null and eventType.size() >0">
|
<if test="eventType != null and eventType.size() >0">
|
||||||
AND Event_Type IN
|
AND Event_Type IN
|
||||||
<foreach collection="eventType" item="item" open="(" close=")" separator=",">
|
<foreach collection="eventType" item="item" open="(" close=")" separator=",">
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import com.njcn.system.enums.DicDataEnum;
|
|||||||
import com.njcn.system.enums.DicDataTypeEnum;
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
import com.njcn.system.pojo.po.DictData;
|
import com.njcn.system.pojo.po.DictData;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.collections4.ListUtils;
|
import org.apache.commons.collections4.ListUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -80,14 +81,20 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ
|
|||||||
|
|
||||||
//查询暂态事件明细
|
//查询暂态事件明细
|
||||||
List<RmpEventDetailPO> detailList = new ArrayList<>();
|
List<RmpEventDetailPO> detailList = new ArrayList<>();
|
||||||
List<List<String>> partition = ListUtils.partition(monitorIdList, 20000);
|
// List<List<String>> partition = ListUtils.partition(monitorIdList, 20000);
|
||||||
for (List<String> list : partition) {
|
// for (List<String> list : partition) {
|
||||||
|
// if (BizParamConstant.STAT_BIZ_MONTH.equals(type + "")) { //按月查
|
||||||
|
// detailList.addAll(rmpEventDetailMapper.getDetailsOfTransientEventsByMonth(list, null, startTime, endTime));
|
||||||
|
// } else { //按日查
|
||||||
|
// detailList.addAll( rmpEventDetailMapper.getDetailsOfTransientEvents(list, null, startTime, endTime));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
if (BizParamConstant.STAT_BIZ_MONTH.equals(type + "")) { //按月查
|
if (BizParamConstant.STAT_BIZ_MONTH.equals(type + "")) { //按月查
|
||||||
detailList.addAll(rmpEventDetailMapper.getDetailsOfTransientEventsByMonth(list, null, startTime, endTime));
|
detailList.addAll(rmpEventDetailMapper.getDetailsOfTransientEventsByMonth( null, startTime, endTime));
|
||||||
} else { //按日查
|
} else { //按日查
|
||||||
detailList.addAll( rmpEventDetailMapper.getDetailsOfTransientEvents(list, null, startTime, endTime));
|
detailList.addAll( rmpEventDetailMapper.getDetailsOfTransientEvents(null, startTime, endTime));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
detailList = detailList.stream().filter(temp->monitorIdList.contains(temp.getLineId())).collect(Collectors.toList());
|
||||||
if (CollUtil.isNotEmpty(detailList)) {
|
if (CollUtil.isNotEmpty(detailList)) {
|
||||||
//todo 获取监测点信息接口
|
//todo 获取监测点信息接口
|
||||||
pwPmsMonitorParam.setMonitorName(eventMonitorReportParam.getMonitorName());
|
pwPmsMonitorParam.setMonitorName(eventMonitorReportParam.getMonitorName());
|
||||||
@@ -173,8 +180,10 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ
|
|||||||
condMap.put("endTime", endTime);
|
condMap.put("endTime", endTime);
|
||||||
condMap.put("eventTypeList", Arrays.asList(eventStatisMapByCode.get(DicDataEnum.VOLTAGE_DIP.getCode()).getId(), eventStatisMapByCode.get(DicDataEnum.SHORT_INTERRUPTIONS.getCode()).getId()));
|
condMap.put("eventTypeList", Arrays.asList(eventStatisMapByCode.get(DicDataEnum.VOLTAGE_DIP.getCode()).getId(), eventStatisMapByCode.get(DicDataEnum.SHORT_INTERRUPTIONS.getCode()).getId()));
|
||||||
condMap.put("dateType", type);
|
condMap.put("dateType", type);
|
||||||
EventDipShortDistributionVO eventDipShortDistribution = eventDistributionStatisticsMapper.getEventDipShortDistributionByCond(condMap);
|
// EventDipShortDistributionVO eventDipShortDistribution = eventDistributionStatisticsMapper.getEventDipShortDistributionByCond(condMap);
|
||||||
|
List<RmpEventDetailPO> eventDipShortDistributionByCondition = eventDistributionStatisticsMapper.getEventDipShortDistributionByCondition(condMap);
|
||||||
|
eventDipShortDistributionByCondition = eventDipShortDistributionByCondition.stream().filter(temp->monitorIds.contains(temp.getMeasurementPointId())).collect(Collectors.toList());
|
||||||
|
EventDipShortDistributionVO eventDipShortDistribution = change(eventDipShortDistributionByCondition);
|
||||||
//设置返回数据
|
//设置返回数据
|
||||||
List<EventDipShortDistributionTableVO> list = new ArrayList<>();
|
List<EventDipShortDistributionTableVO> list = new ArrayList<>();
|
||||||
//特征幅值[80,90]
|
//特征幅值[80,90]
|
||||||
@@ -296,12 +305,100 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
private EventDipShortDistributionVO change(List<RmpEventDetailPO> list) {
|
||||||
|
EventDipShortDistributionVO eventDipShortDistributionVO = new EventDipShortDistributionVO();
|
||||||
|
if(!CollectionUtils.isEmpty(list)) {
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp90with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp90with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp90with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp90with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp90with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp90with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp90with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp90with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
|
||||||
|
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp80with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp80with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp80with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp80with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp80with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp80with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp80with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp80with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
|
||||||
|
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp70with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp70with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp70with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp70with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp70with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp70with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp70with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp70with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
|
||||||
|
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp60with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp60with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp60with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp60with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp60with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp60with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp60with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp60with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
|
||||||
|
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp50with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp50with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp50with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp50with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp50with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp50with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp50with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp50with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
|
||||||
|
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp40with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp40with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp40with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp40with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp40with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp40with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp40with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp40with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
|
||||||
|
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp30with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp30with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp30with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp30with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp30with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp30with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp30with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp30with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
|
||||||
|
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp20with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp20with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp20with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp20with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp20with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp20with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp20with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp20with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
|
||||||
|
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp10with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp10with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp10with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp10with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp10with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp10with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp10with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
|
||||||
|
eventDipShortDistributionVO.setFeatureAmp10with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return eventDipShortDistributionVO;
|
||||||
|
}
|
||||||
|
/**
|
||||||
* 暂态指标监测点电压暂升分布情况
|
* 暂态指标监测点电压暂升分布情况
|
||||||
* @author jianghaifei
|
* @author jianghaifei
|
||||||
* @date 2022-10-29 14:08
|
* @date 2022-10-29 14:03
|
||||||
* @param eventMonitorReportParam
|
* @param eventMonitorReportParam
|
||||||
* @return com.njcn.event.pojo.vo.EventRiseDistributionVO
|
* @retu4n com.njcn.event4pojo.vo.EventRiseDistributionVO
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<EventRiseDistributionTableVO> getEventRiseDistributionByCond(EventMonitorReportParam eventMonitorReportParam) {
|
public List<EventRiseDistributionTableVO> getEventRiseDistributionByCond(EventMonitorReportParam eventMonitorReportParam) {
|
||||||
@@ -325,7 +422,10 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ
|
|||||||
riseCondMap.put("endTime", endTime);
|
riseCondMap.put("endTime", endTime);
|
||||||
riseCondMap.put("eventTypeList", Collections.singletonList(eventStatisMapByCode.get(DicDataEnum.VOLTAGE_RISE.getCode()).getId()));
|
riseCondMap.put("eventTypeList", Collections.singletonList(eventStatisMapByCode.get(DicDataEnum.VOLTAGE_RISE.getCode()).getId()));
|
||||||
riseCondMap.put("dateType", type);
|
riseCondMap.put("dateType", type);
|
||||||
EventRiseDistributionVO eventRiseDistribution = eventDistributionStatisticsMapper.getEventRiseDistributionByCond(riseCondMap);
|
// EventRiseDistributionVO eventRiseDistribution = eventDistributionStatisticsMapper.getEventRiseDistributionByCond(riseCondMap);
|
||||||
|
List<RmpEventDetailPO> rmpEventDetailPOS = eventDistributionStatisticsMapper.getEventDipShortDistributionByCondition(riseCondMap);
|
||||||
|
rmpEventDetailPOS = rmpEventDetailPOS.stream().filter(temp->monitorIds.contains(temp.getMeasurementPointId())).collect(Collectors.toList());
|
||||||
|
EventRiseDistributionVO eventRiseDistribution = changeEventRise(rmpEventDetailPOS);
|
||||||
//设置返回数据
|
//设置返回数据
|
||||||
List<EventRiseDistributionTableVO> list = new ArrayList<>();
|
List<EventRiseDistributionTableVO> list = new ArrayList<>();
|
||||||
//特征幅值U1≥120
|
//特征幅值U1≥120
|
||||||
@@ -345,4 +445,19 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ
|
|||||||
list.add(entity110);
|
list.add(entity110);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private EventRiseDistributionVO changeEventRise(List<RmpEventDetailPO> list) {
|
||||||
|
EventRiseDistributionVO eventRiseDistributionVO = new EventRiseDistributionVO();
|
||||||
|
if(!CollectionUtils.isEmpty(list)){
|
||||||
|
eventRiseDistributionVO.setFeatureAmp120with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 120 && temp.getDuration() > 10 && temp.getDuration() <= 500).count());
|
||||||
|
eventRiseDistributionVO.setFeatureAmp120with5000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 120 && temp.getDuration() > 500 && temp.getDuration() <= 5000).count());
|
||||||
|
eventRiseDistributionVO.setFeatureAmp120with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 120 && temp.getDuration() > 5000 && temp.getDuration() <= 60000).count());
|
||||||
|
eventRiseDistributionVO.setFeatureAmp110with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= -120 && temp.getFeatureAmplitude() <= 110 && temp.getDuration() > 500 && temp.getDuration() <= 60000).count());
|
||||||
|
eventRiseDistributionVO.setFeatureAmp110with5000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= -120 && temp.getFeatureAmplitude() <= 110 && temp.getDuration() > 5000 && temp.getDuration() <= 60000).count());
|
||||||
|
eventRiseDistributionVO.setFeatureAmp110with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= -120 && temp.getFeatureAmplitude() <= 110 && temp.getDuration() > 60000 && temp.getDuration() <= 60000).count());
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
return eventRiseDistributionVO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,7 +215,8 @@ whitelist:
|
|||||||
- /pqs-auth/oauth/getPublicKey
|
- /pqs-auth/oauth/getPublicKey
|
||||||
- /pqs-auth/judgeToken/heBei
|
- /pqs-auth/judgeToken/heBei
|
||||||
- /pqs-auth/judgeToken/guangZhou
|
- /pqs-auth/judgeToken/guangZhou
|
||||||
|
- /pqs-auth/judgeToken/productionManagementCheck
|
||||||
|
-
|
||||||
- /webjars/**
|
- /webjars/**
|
||||||
- /doc.html
|
- /doc.html
|
||||||
- /swagger-resources/**
|
- /swagger-resources/**
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ import com.njcn.harmonic.pojo.param.RMpBenchmarkLevelParam;
|
|||||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelM;
|
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelM;
|
||||||
import com.njcn.harmonic.pojo.vo.PwRMpBenchmarkLevelVO;
|
import com.njcn.harmonic.pojo.vo.PwRMpBenchmarkLevelVO;
|
||||||
import com.njcn.harmonic.service.distribution.PwRMpBenchmarkLevelMService;
|
import com.njcn.harmonic.service.distribution.PwRMpBenchmarkLevelMService;
|
||||||
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
|
import com.njcn.system.pojo.po.DictData;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@@ -26,6 +30,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author jianghf
|
* @author jianghf
|
||||||
@@ -43,6 +48,8 @@ public class PwRMpBenchmarkLevelMServiceImpl extends ServiceImpl<PwRMpBenchmarkL
|
|||||||
|
|
||||||
private final DistributionMonitorClient distributionMonitorClient;
|
private final DistributionMonitorClient distributionMonitorClient;
|
||||||
|
|
||||||
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 配网-全网基准水平
|
* 配网-全网基准水平
|
||||||
@@ -71,6 +78,10 @@ public class PwRMpBenchmarkLevelMServiceImpl extends ServiceImpl<PwRMpBenchmarkL
|
|||||||
pwPmsMonitorParam.setOrgId(id); //单位id
|
pwPmsMonitorParam.setOrgId(id); //单位id
|
||||||
pwPmsMonitorParam.setVoltageLevels(voltageLevelParamList); //电压等级
|
pwPmsMonitorParam.setVoltageLevels(voltageLevelParamList); //电压等级
|
||||||
|
|
||||||
|
DictData dictData = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.THREE_LINE.getCode(), DicDataTypeEnum.LINE_SORT.getCode()).getData();
|
||||||
|
pwPmsMonitorParam.setMonitorSort(Stream.of(dictData.getId()).collect(Collectors.toList()));
|
||||||
|
|
||||||
|
//临时调整为查询三类测点
|
||||||
List<String> monitorIds = pmsGeneralDeviceInfoClient.getPwPmsMonitorIds(pwPmsMonitorParam).getData();
|
List<String> monitorIds = pmsGeneralDeviceInfoClient.getPwPmsMonitorIds(pwPmsMonitorParam).getData();
|
||||||
if (CollUtil.isEmpty(monitorIds)) {
|
if (CollUtil.isEmpty(monitorIds)) {
|
||||||
return new Page<>();
|
return new Page<>();
|
||||||
@@ -96,10 +107,11 @@ public class PwRMpBenchmarkLevelMServiceImpl extends ServiceImpl<PwRMpBenchmarkL
|
|||||||
//监测点map key:监测点id value:监测点实体
|
//监测点map key:监测点id value:监测点实体
|
||||||
Map<String, PwPmsMonitorDTO> monitorMap = pwMonitorList.stream().collect(Collectors.toMap(PwPmsMonitorDTO::getMonitorId, Function.identity(), (key1, key2) -> key1));
|
Map<String, PwPmsMonitorDTO> monitorMap = pwMonitorList.stream().collect(Collectors.toMap(PwPmsMonitorDTO::getMonitorId, Function.identity(), (key1, key2) -> key1));
|
||||||
|
|
||||||
List<PwRMpBenchmarkLevelVO> resultList = temList.stream().map(item -> {
|
List<PwRMpBenchmarkLevelVO> resultList = temList.stream().filter(temp->monitorMap.containsKey(temp.getMeasurementPointId())).map(item -> {
|
||||||
//封装前端需要的对象
|
//封装前端需要的对象
|
||||||
PwRMpBenchmarkLevelVO rMpBenchmarkLevelVO = new PwRMpBenchmarkLevelVO();
|
PwRMpBenchmarkLevelVO rMpBenchmarkLevelVO = new PwRMpBenchmarkLevelVO();
|
||||||
BeanUtils.copyProperties(item, rMpBenchmarkLevelVO);
|
BeanUtils.copyProperties(item, rMpBenchmarkLevelVO);
|
||||||
|
if(monitorMap.containsKey(item.getMeasurementPointId())){
|
||||||
//单位信息
|
//单位信息
|
||||||
rMpBenchmarkLevelVO.setOrgNo(monitorMap.get(item.getMeasurementPointId()).getOrgId()); //单位id
|
rMpBenchmarkLevelVO.setOrgNo(monitorMap.get(item.getMeasurementPointId()).getOrgId()); //单位id
|
||||||
rMpBenchmarkLevelVO.setOrgName(monitorMap.get(item.getMeasurementPointId()).getOrgName()); //单位名称
|
rMpBenchmarkLevelVO.setOrgName(monitorMap.get(item.getMeasurementPointId()).getOrgName()); //单位名称
|
||||||
@@ -107,6 +119,16 @@ public class PwRMpBenchmarkLevelMServiceImpl extends ServiceImpl<PwRMpBenchmarkL
|
|||||||
rMpBenchmarkLevelVO.setMeasurementPointName(monitorMap.get(item.getMeasurementPointId()).getMonitorName()); //监测点名称
|
rMpBenchmarkLevelVO.setMeasurementPointName(monitorMap.get(item.getMeasurementPointId()).getMonitorName()); //监测点名称
|
||||||
//电压等级
|
//电压等级
|
||||||
rMpBenchmarkLevelVO.setVoltageLevel(monitorMap.get(item.getMeasurementPointId()).getVoltageLevel());
|
rMpBenchmarkLevelVO.setVoltageLevel(monitorMap.get(item.getMeasurementPointId()).getVoltageLevel());
|
||||||
|
}else {
|
||||||
|
//单位信息
|
||||||
|
rMpBenchmarkLevelVO.setOrgNo("/"); //单位id
|
||||||
|
rMpBenchmarkLevelVO.setOrgName("/"); //单位名称
|
||||||
|
//监测点信息
|
||||||
|
rMpBenchmarkLevelVO.setMeasurementPointName("/"); //监测点名称
|
||||||
|
//电压等级
|
||||||
|
rMpBenchmarkLevelVO.setVoltageLevel("/");
|
||||||
|
}
|
||||||
|
|
||||||
return rMpBenchmarkLevelVO;
|
return rMpBenchmarkLevelVO;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.njcn.harmonic.pojo.po.RStatPwPermeabilityM;
|
|||||||
import com.njcn.harmonic.pojo.vo.RStatPwPermeabilityMVO;
|
import com.njcn.harmonic.pojo.vo.RStatPwPermeabilityMVO;
|
||||||
import com.njcn.harmonic.service.distribution.RStatPwPermeabilityMService;
|
import com.njcn.harmonic.service.distribution.RStatPwPermeabilityMService;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
import com.njcn.system.enums.DicDataTypeEnum;
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
import com.njcn.system.pojo.po.DictData;
|
import com.njcn.system.pojo.po.DictData;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -24,6 +25,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 各渗透率光伏台区基准水平
|
* 各渗透率光伏台区基准水平
|
||||||
@@ -68,6 +70,8 @@ public class RStatPwPermeabilityMServiceImpl extends ServiceImpl<RStatPwPermeabi
|
|||||||
//根据条件查询单位下面的所有配网监测点
|
//根据条件查询单位下面的所有配网监测点
|
||||||
PwPmsMonitorParam pwPmsMonitorParam = new PwPmsMonitorParam();
|
PwPmsMonitorParam pwPmsMonitorParam = new PwPmsMonitorParam();
|
||||||
pwPmsMonitorParam.setOrgId(id); //单位id
|
pwPmsMonitorParam.setOrgId(id); //单位id
|
||||||
|
DictData dictData = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.THREE_LINE.getCode(), DicDataTypeEnum.LINE_SORT.getCode()).getData();
|
||||||
|
pwPmsMonitorParam.setMonitorSort(Stream.of(dictData.getId()).collect(Collectors.toList()));
|
||||||
List<String> monitorIds = pmsGeneralDeviceInfoClient.getPwPmsMonitorIds(pwPmsMonitorParam).getData();
|
List<String> monitorIds = pmsGeneralDeviceInfoClient.getPwPmsMonitorIds(pwPmsMonitorParam).getData();
|
||||||
if (CollUtil.isEmpty(monitorIds)) {
|
if (CollUtil.isEmpty(monitorIds)) {
|
||||||
return new Page<>();
|
return new Page<>();
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public class RStatOrgMServiceImpl extends ServiceImpl<RStatOrgMMapper, RStatOrgM
|
|||||||
if(rStatOrgM.getHarmonicMeasurementAverage()!=null&&rStatOrgM.getEffectiveMeasurementAverage()!=null&&
|
if(rStatOrgM.getHarmonicMeasurementAverage()!=null&&rStatOrgM.getEffectiveMeasurementAverage()!=null&&
|
||||||
rStatOrgM.getHarmonicMeasurementAverage()!=0&&rStatOrgM.getEffectiveMeasurementAverage()!=0){
|
rStatOrgM.getHarmonicMeasurementAverage()!=0&&rStatOrgM.getEffectiveMeasurementAverage()!=0){
|
||||||
Float harmonicMeasurementRatioAverage = Float.parseFloat(
|
Float harmonicMeasurementRatioAverage = Float.parseFloat(
|
||||||
df.format(rStatOrgM.getHarmonicMeasurementAverage()*100.0 / rStatOrgM.getEffectiveMeasurementAverage()));
|
df.format(rStatOrgM.getHarmonicMeasurementAverage() / rStatOrgM.getEffectiveMeasurementAverage()));
|
||||||
rStatOrgVO.setHarmonicMeasurementRatioAverage(harmonicMeasurementRatioAverage);
|
rStatOrgVO.setHarmonicMeasurementRatioAverage(harmonicMeasurementRatioAverage);
|
||||||
}else{
|
}else{
|
||||||
rStatOrgVO.setHarmonicMeasurementRatioAverage(0.0f);
|
rStatOrgVO.setHarmonicMeasurementRatioAverage(0.0f);
|
||||||
@@ -101,7 +101,7 @@ public class RStatOrgMServiceImpl extends ServiceImpl<RStatOrgMMapper, RStatOrgM
|
|||||||
if(rStatOrgM.getHarmonicMeasurementAccrued()!=null&&rStatOrgM.getEffectiveMeasurementAccrued()!=null&&
|
if(rStatOrgM.getHarmonicMeasurementAccrued()!=null&&rStatOrgM.getEffectiveMeasurementAccrued()!=null&&
|
||||||
rStatOrgM.getHarmonicMeasurementAccrued()!=0&&rStatOrgM.getEffectiveMeasurementAccrued()!=0){
|
rStatOrgM.getHarmonicMeasurementAccrued()!=0&&rStatOrgM.getEffectiveMeasurementAccrued()!=0){
|
||||||
Float harmonicMeasurementRatioAccrued = Float.parseFloat(
|
Float harmonicMeasurementRatioAccrued = Float.parseFloat(
|
||||||
df.format(rStatOrgM.getHarmonicMeasurementAccrued()*100.0 / rStatOrgM.getEffectiveMeasurementAccrued() ));
|
df.format(rStatOrgM.getHarmonicMeasurementAccrued() / rStatOrgM.getEffectiveMeasurementAccrued() ));
|
||||||
rStatOrgVO.setHarmonicMeasurementRatioAccrued(harmonicMeasurementRatioAccrued);
|
rStatOrgVO.setHarmonicMeasurementRatioAccrued(harmonicMeasurementRatioAccrued);
|
||||||
}else{
|
}else{
|
||||||
rStatOrgVO.setHarmonicMeasurementRatioAccrued(0.0f);
|
rStatOrgVO.setHarmonicMeasurementRatioAccrued(0.0f);
|
||||||
|
|||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package com.njcn.harmonic.service.upload.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.njcn.advance.pojo.dto.waveAnalysis.AnalyWave;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.harmonic.api.UploadGwDataFeignClient;
|
||||||
|
import com.njcn.harmonic.pojo.param.UploadParam;
|
||||||
|
import com.njcn.harmonic.pojo.po.upload.RUploadDataLog;
|
||||||
|
import com.njcn.harmonic.service.upload.IPointStatisticalDataService;
|
||||||
|
import com.njcn.harmonic.service.upload.IRUploadDataLogService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-04-21
|
||||||
|
* @Description: 主网测点失败尝试
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@EnableScheduling
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class FailedAttemptJob {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(FailedAttemptJob.class);
|
||||||
|
|
||||||
|
private final IRUploadDataLogService irUploadDataLogService;
|
||||||
|
|
||||||
|
private final IPointStatisticalDataService iPointStatisticalDataService;
|
||||||
|
|
||||||
|
|
||||||
|
// 每天早上 8 点执行
|
||||||
|
@Scheduled(cron = "0 05 8 * * ?")
|
||||||
|
public void executeAtEight() {
|
||||||
|
commFunction();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 每天早上 9 点执行
|
||||||
|
@Scheduled(cron = "0 10 8 * * ?")
|
||||||
|
public void executeAtNine() {
|
||||||
|
commFunction();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 每天早上 10 点执行
|
||||||
|
@Scheduled(cron = "0 15 8 * * ?")
|
||||||
|
public void executeAtTen() {
|
||||||
|
commFunction();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void commFunction(){
|
||||||
|
System.out.println("早上定时任务执行(主网测点失败尝试):" + LocalDateTime.now());
|
||||||
|
LambdaQueryWrapper<RUploadDataLog> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(RUploadDataLog::getStatisticDate, LocalDate.now().minusDays(1)).eq(RUploadDataLog::getBigType,0).eq(RUploadDataLog::getSmallType,1);
|
||||||
|
RUploadDataLog rUploadDataLog = irUploadDataLogService.getOne(lambdaQueryWrapper);
|
||||||
|
if(Objects.nonNull(rUploadDataLog)){
|
||||||
|
if(rUploadDataLog.getResult().equals(0)){
|
||||||
|
//失败了需要重试
|
||||||
|
UploadParam param = new UploadParam();
|
||||||
|
param.setTime(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
||||||
|
iPointStatisticalDataService.uploadPointStatisticalData(param);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -121,7 +121,7 @@ public class PointStatisticalDataServiceImpl extends ServiceImpl<RUploadPointSta
|
|||||||
sp.setIsAppend("1");
|
sp.setIsAppend("1");
|
||||||
}
|
}
|
||||||
//上送数据
|
//上送数据
|
||||||
Map<String, String> send = GwSendUtil.send(sp, GWSendEnum.STATISTICAL_CREATE);
|
Map<String, String> send = GwSendUtil.newSend(sp, GWSendEnum.STATISTICAL_CREATE);
|
||||||
//获取返回结果
|
//获取返回结果
|
||||||
List<String> l = dtoList.stream().map(MonitorStatisticalDTO::getId).collect(Collectors.toList());
|
List<String> l = dtoList.stream().map(MonitorStatisticalDTO::getId).collect(Collectors.toList());
|
||||||
returnInformation(i,l,send,resultLog,resultFlag,localDate);
|
returnInformation(i,l,send,resultLog,resultFlag,localDate);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.harmonic.service.upload.impl;
|
package com.njcn.harmonic.service.upload.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
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.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -27,7 +28,7 @@ public class RUploadDataLogServiceImpl extends MppServiceImpl<RUploadDataLogMapp
|
|||||||
@Override
|
@Override
|
||||||
public Page<RUploadDataLog> getList(BaseParam baseParam) {
|
public Page<RUploadDataLog> getList(BaseParam baseParam) {
|
||||||
LambdaQueryWrapper<RUploadDataLog> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<RUploadDataLog> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.between(RUploadDataLog::getCreateTime,baseParam.getSearchBeginTime(),baseParam.getSearchEndTime())
|
lambdaQueryWrapper.between(RUploadDataLog::getStatisticDate, DateUtil.beginOfDay(DateUtil.parse(baseParam.getSearchBeginTime())),DateUtil.endOfDay(DateUtil.parse(baseParam.getSearchEndTime())))
|
||||||
.orderByDesc(RUploadDataLog::getStatisticDate);
|
.orderByDesc(RUploadDataLog::getStatisticDate);
|
||||||
if(StrUtil.isNotBlank(baseParam.getSearchValue())){
|
if(StrUtil.isNotBlank(baseParam.getSearchValue())){
|
||||||
lambdaQueryWrapper.eq(RUploadDataLog::getSmallType,Integer.parseInt(baseParam.getSearchValue()));
|
lambdaQueryWrapper.eq(RUploadDataLog::getSmallType,Integer.parseInt(baseParam.getSearchValue()));
|
||||||
|
|||||||
@@ -23,9 +23,13 @@ spring:
|
|||||||
ip: @service.server.url@
|
ip: @service.server.url@
|
||||||
server-addr: @nacos.url@
|
server-addr: @nacos.url@
|
||||||
namespace: @nacos.namespace@
|
namespace: @nacos.namespace@
|
||||||
|
#username: @nacos.username@
|
||||||
|
#password: @nacos.password@
|
||||||
config:
|
config:
|
||||||
server-addr: @nacos.url@
|
server-addr: @nacos.url@
|
||||||
namespace: @nacos.namespace@
|
namespace: @nacos.namespace@
|
||||||
|
#username: @nacos.username@
|
||||||
|
#password: @nacos.password@
|
||||||
file-extension: yaml
|
file-extension: yaml
|
||||||
shared-configs:
|
shared-configs:
|
||||||
- data-id: share-config.yaml
|
- data-id: share-config.yaml
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.njcn.harmonic.mapper.upload.PmsTemProcessApprovalMapper">
|
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
<!--@mbg.generated-->
|
|
||||||
obj_id, temp_user_dossier_id, approval_join_user_id, approval_join_user_name, approval_advise,
|
|
||||||
create_time, update_time, legacy_problem, rectification_status, rectification_time,
|
|
||||||
rectification_user_id, rectification_user_name, rectification_measure
|
|
||||||
</sql>
|
|
||||||
</mapper>
|
|
||||||
@@ -225,7 +225,7 @@ public class ExecutionCenter extends BaseController {
|
|||||||
@PostMapping("/orgPointExecutor")
|
@PostMapping("/orgPointExecutor")
|
||||||
@Async("asyncExecutor")
|
@Async("asyncExecutor")
|
||||||
public void orgPointExecutor(@RequestBody BaseParam baseParam) {
|
public void orgPointExecutor(@RequestBody BaseParam baseParam) {
|
||||||
String methodDescribe = getMethodDescribe("OrgPointExecutor");
|
String methodDescribe = getMethodDescribe("orgPointExecutor");
|
||||||
//手动判断参数是否合法,
|
//手动判断参数是否合法,
|
||||||
CalculatedParam<DeptGetChildrenMoreDTO> calculatedParam = judgeExecuteParam(baseParam);
|
CalculatedParam<DeptGetChildrenMoreDTO> calculatedParam = judgeExecuteParam(baseParam);
|
||||||
// 测点索引
|
// 测点索引
|
||||||
|
|||||||
@@ -86,13 +86,6 @@ public class IntegrityServiceImpl extends MppServiceImpl<RStatIntegrityDMapper,
|
|||||||
RStatIntegrityD integrityDpo = new RStatIntegrityD();
|
RStatIntegrityD integrityDpo = new RStatIntegrityD();
|
||||||
integrityDpo.setTimeId(LocalDateTimeUtil.parseDate(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN));
|
integrityDpo.setTimeId(LocalDateTimeUtil.parseDate(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN));
|
||||||
integrityDpo.setLineIndex(item.getPointId());
|
integrityDpo.setLineIndex(item.getPointId());
|
||||||
if(Objects.isNull(item.getInterval())){
|
|
||||||
System.out.println("遇到空指针异常+++++++++++++++++++++++++++++++++"+item);
|
|
||||||
System.out.println("遇到空指针异常+++++++++++++++++++++++++++++++++"+item);
|
|
||||||
System.out.println("遇到空指针异常+++++++++++++++++++++++++++++++++"+item);
|
|
||||||
|
|
||||||
System.out.println(item.getPointId());
|
|
||||||
}
|
|
||||||
integrityDpo.setDueTime(InfluxDBTableConstant.DAY_MINUTE / item.getInterval());
|
integrityDpo.setDueTime(InfluxDBTableConstant.DAY_MINUTE / item.getInterval());
|
||||||
integrityDpo.setRealTime(countList.stream()
|
integrityDpo.setRealTime(countList.stream()
|
||||||
.filter(item2 -> Objects.equals(item.getPointId(), item2.getLineId()))
|
.filter(item2 -> Objects.equals(item.getPointId(), item2.getLineId()))
|
||||||
|
|||||||
@@ -25,7 +25,9 @@ public enum SupervisionResponseEnum {
|
|||||||
NO_USER_REPORT_UPDATE("A00550","常态化干扰源用户管理信息更新失败,不存在该条信息"),
|
NO_USER_REPORT_UPDATE("A00550","常态化干扰源用户管理信息更新失败,不存在该条信息"),
|
||||||
NO_DEPT_POWER("A00550","不能操作非自己部门创建的任务"),
|
NO_DEPT_POWER("A00550","不能操作非自己部门创建的任务"),
|
||||||
IMPORT_DEV_ERROR("A00550","导入终端检测失败"),
|
IMPORT_DEV_ERROR("A00550","导入终端检测失败"),
|
||||||
|
IMPORT_PLAN_ERROR("A00550","导入技术监督计划失败"),
|
||||||
IMPORT_DEV_DATA_ERROR("A00550","终端数据为空"),
|
IMPORT_DEV_DATA_ERROR("A00550","终端数据为空"),
|
||||||
|
IMPORT_PLAN_DATA_ERROR("A00550","技术监督计划数据为空"),
|
||||||
DELETE_TO_BE_SUBMITTED("A00550","流程删除失败,只有待提交信息可删除!"),
|
DELETE_TO_BE_SUBMITTED("A00550","流程删除失败,只有待提交信息可删除!"),
|
||||||
EXISTENCE_OR_NOT("A00550","信息查询为空,请检查信息是否存在!"),
|
EXISTENCE_OR_NOT("A00550","信息查询为空,请检查信息是否存在!"),
|
||||||
NAME_EXISTS("A00550","名称重复"),
|
NAME_EXISTS("A00550","名称重复"),
|
||||||
|
|||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package com.njcn.supervision.pojo.dto;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2025/3/27 11:21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SupervisionPlanExcel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责单位ID
|
||||||
|
*/
|
||||||
|
@Excel(name = "*计划负责单位", width = 30)
|
||||||
|
private String deptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "*计划名称", width = 30)
|
||||||
|
private String planName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监督类型
|
||||||
|
*/
|
||||||
|
@Excel(name = "*监督类型", width = 30)
|
||||||
|
private String supvType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监督对象名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "*监督对象名称", width = 30)
|
||||||
|
private String supvObjectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划开始时间
|
||||||
|
*/
|
||||||
|
@Excel(name = "*计划开始时间(yyyy/MM/dd)", width = 30,exportFormat = "yyyy/MM/dd")
|
||||||
|
private Date planStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划结束时间
|
||||||
|
*/
|
||||||
|
@Excel(name = "*计划结束时间(yyyy/MM/dd)", width = 30,exportFormat = "yyyy/MM/dd")
|
||||||
|
private Date planEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0 关联系统内变电站;1 用户手动输入变电站
|
||||||
|
*/
|
||||||
|
@Excel(name = "*是否系统电站", width = 30, replace = {"是_0", "否_1",})
|
||||||
|
private String customSubstationFlag ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站台账ID或者用户手动输入的变电站名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "*关联电站一", width = 30)
|
||||||
|
private String substation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站台账ID或者用户手动输入的变电站名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "关联电站二", width = 30)
|
||||||
|
private String substation2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站台账ID或者用户手动输入的变电站名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "关联电站三", width = 30)
|
||||||
|
private String substation3;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class ExcelMsg extends SupervisionPlanExcel implements Serializable {
|
||||||
|
|
||||||
|
@Excel(name = "错误信息描述", width = 30)
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,13 +15,17 @@ import com.njcn.supervision.service.survey.ISurveyPlanService;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -108,5 +112,25 @@ public class SurveyPlanController extends BaseController {
|
|||||||
Boolean b = surveyPlanService.deleteSurveyPlan(supervisionId);
|
Boolean b = surveyPlanService.deleteSurveyPlan(supervisionId);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping(value = "/downloadPlanTemplate", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||||
|
@ApiOperation("下载技术监督计划模板")
|
||||||
|
public void downloadPlanTemplate() {
|
||||||
|
surveyPlanService.downloadPlanTemplate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(value = "/importPlanData")
|
||||||
|
@ApiOperation("批量导入技术监督计划")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
public HttpResult<String> importPlanData(@ApiParam(value = "文件", required = true) @RequestPart("file") MultipartFile file, HttpServletResponse response) {
|
||||||
|
String methodDescribe = getMethodDescribe("importPlanData");
|
||||||
|
surveyPlanService.importPlanData(file, response);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ import com.njcn.system.pojo.po.DictData;
|
|||||||
import com.njcn.user.api.DeptFeignClient;
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -76,6 +77,7 @@ import static java.util.regex.Pattern.*;
|
|||||||
* @author xy
|
* @author xy
|
||||||
* @since 2024-06-17
|
* @since 2024-06-17
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, LineWarning> implements ILineWarningService {
|
public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, LineWarning> implements ILineWarningService {
|
||||||
@@ -374,11 +376,16 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||||
double maxData = getFreqDev(param.getLineId()
|
List<DataV> freqDevList = getFreqDev(param.getLineId()
|
||||||
, time + " 00:00:00"
|
, time + " 00:00:00"
|
||||||
, time + " 23:59:59"
|
, time + " 23:59:59"
|
||||||
).get(0).getFreqDev();
|
);
|
||||||
|
if (CollUtil.isNotEmpty(freqDevList)) {
|
||||||
|
double maxData = freqDevList.get(0).getFreqDev();
|
||||||
channelEachData(item, maxData > 0 ? overlimit.getFreqDev() : -overlimit.getFreqDev(), "getFreqDev", result, DicDataEnum.FREQUENCY_DEV.getName(), timeInterval, maxData);
|
channelEachData(item, maxData > 0 ? overlimit.getFreqDev() : -overlimit.getFreqDev(), "getFreqDev", result, DicDataEnum.FREQUENCY_DEV.getName(), timeInterval, maxData);
|
||||||
|
} else {
|
||||||
|
log.info("{}原始数据缺失", time);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -394,6 +401,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
, time + " 00:00:00"
|
, time + " 00:00:00"
|
||||||
, time + " 23:59:59"
|
, time + " 23:59:59"
|
||||||
);
|
);
|
||||||
|
if (CollUtil.isNotEmpty(voltageList)) {
|
||||||
List<Double> voltage = voltageList.stream().map(DataV::getVuDev).collect(Collectors.toList());
|
List<Double> voltage = voltageList.stream().map(DataV::getVuDev).collect(Collectors.toList());
|
||||||
if (Math.abs(voltage.get(0)) >= Math.abs(voltage.get(1))) {
|
if (Math.abs(voltage.get(0)) >= Math.abs(voltage.get(1))) {
|
||||||
overLimit = overlimit.getUvoltageDev();
|
overLimit = overlimit.getUvoltageDev();
|
||||||
@@ -403,6 +411,9 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
maxData = voltage.get(1);
|
maxData = voltage.get(1);
|
||||||
}
|
}
|
||||||
channelEachData(item, overLimit, "getVoltageDev", result, DicDataEnum.VOLTAGE_DEV.getName(), timeInterval, maxData);
|
channelEachData(item, overLimit, "getVoltageDev", result, DicDataEnum.VOLTAGE_DEV.getName(), timeInterval, maxData);
|
||||||
|
} else {
|
||||||
|
log.info("{}原始数据缺失", time);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -412,11 +423,16 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||||
double maxData = getFlicker(param.getLineId()
|
List<DataPlt> dataPltList = getFlicker(param.getLineId()
|
||||||
, time + " 00:00:00"
|
, time + " 00:00:00"
|
||||||
, time + " 23:59:59"
|
, time + " 23:59:59"
|
||||||
).get(0).getPlt();
|
);
|
||||||
|
if (CollUtil.isNotEmpty(dataPltList)) {
|
||||||
|
double maxData = dataPltList.get(0).getPlt();
|
||||||
channelEachData(item, overlimit.getFlicker(), "getFlicker", result, DicDataEnum.FLICKER.getName(), timeInterval, maxData);
|
channelEachData(item, overlimit.getFlicker(), "getFlicker", result, DicDataEnum.FLICKER.getName(), timeInterval, maxData);
|
||||||
|
} else {
|
||||||
|
log.info("{}原始数据缺失", time);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -426,11 +442,16 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||||
double maxData = getVThd(param.getLineId()
|
List<DataV> dataVList = getVThd(param.getLineId()
|
||||||
, time + " 00:00:00"
|
, time + " 00:00:00"
|
||||||
, time + " 23:59:59"
|
, time + " 23:59:59"
|
||||||
).get(0).getVThd();
|
);
|
||||||
|
if (CollUtil.isNotEmpty(dataVList)) {
|
||||||
|
double maxData = dataVList.get(0).getVThd();
|
||||||
channelEachData(item, overlimit.getUaberrance(), "getUaberrance", result, DicDataEnum.THD_V.getName(), timeInterval, maxData);
|
channelEachData(item, overlimit.getUaberrance(), "getUaberrance", result, DicDataEnum.THD_V.getName(), timeInterval, maxData);
|
||||||
|
} else {
|
||||||
|
log.info("{}原始数据缺失", time);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -441,11 +462,16 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||||
double maxData = getVThd(param.getLineId()
|
List<DataV> dataVList = getVThd(param.getLineId()
|
||||||
, time + " 00:00:00"
|
, time + " 00:00:00"
|
||||||
, time + " 23:59:59"
|
, time + " 23:59:59"
|
||||||
).get(0).getVThd();
|
);
|
||||||
|
if (CollUtil.isNotEmpty(dataVList)) {
|
||||||
|
double maxData = dataVList.get(0).getVThd();
|
||||||
channelEachData(item, overlimit.getUaberrance(), "getUaberrance", result, DicDataEnum.THD_V.getName(), timeInterval, maxData);
|
channelEachData(item, overlimit.getUaberrance(), "getUaberrance", result, DicDataEnum.THD_V.getName(), timeInterval, maxData);
|
||||||
|
} else {
|
||||||
|
log.info("{}原始数据缺失", time);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//谐波电压含有率2~25次
|
//谐波电压含有率2~25次
|
||||||
@@ -453,10 +479,15 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
if (CollUtil.isNotEmpty(list2)) {
|
if (CollUtil.isNotEmpty(list2)) {
|
||||||
list2.forEach(item -> {
|
list2.forEach(item -> {
|
||||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||||
DataHarmRateV dataHarmRateV = getDataHarmRateV(param.getLineId()
|
List<DataHarmRateV> dataHarmRateVList = getDataHarmRateV(param.getLineId()
|
||||||
, time + " 00:00:00"
|
, time + " 00:00:00"
|
||||||
, time + " 23:59:59").get(0);
|
, time + " 23:59:59");
|
||||||
|
if (CollUtil.isNotEmpty(dataHarmRateVList)) {
|
||||||
|
DataHarmRateV dataHarmRateV = dataHarmRateVList.get(0);
|
||||||
channelHarmonicData(dataHarmRateV, null, null, item, overlimit, result, "getUharm", DicDataEnum.HARMONIC_VOLTAGE.getName(), timeInterval, 2, 25);
|
channelHarmonicData(dataHarmRateV, null, null, item, overlimit, result, "getUharm", DicDataEnum.HARMONIC_VOLTAGE.getName(), timeInterval, 2, 25);
|
||||||
|
} else {
|
||||||
|
log.info("{}原始数据缺失", time);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -466,10 +497,15 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||||
DataI dataI = getDataI(param.getLineId()
|
List<DataI> dataIList = getDataI(param.getLineId()
|
||||||
, time + " 00:00:00"
|
, time + " 00:00:00"
|
||||||
, time + " 23:59:59").get(0);
|
, time + " 23:59:59");
|
||||||
|
if (CollUtil.isNotEmpty(dataIList)) {
|
||||||
|
DataI dataI = dataIList.get(0);
|
||||||
channelHarmonicData(null, dataI, null, item, overlimit, result, "getIharm", DicDataEnum.HARMONIC_CURRENT.getName(), timeInterval, 2, 25);
|
channelHarmonicData(null, dataI, null, item, overlimit, result, "getIharm", DicDataEnum.HARMONIC_CURRENT.getName(), timeInterval, 2, 25);
|
||||||
|
} else {
|
||||||
|
log.info("{}原始数据缺失", time);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -479,10 +515,15 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||||
DataInHarmV dataInHarmV = getDataInHarmV(param.getLineId()
|
List<DataInHarmV> dataInHarmVList = getDataInHarmV(param.getLineId()
|
||||||
, time + " 00:00:00"
|
, time + " 00:00:00"
|
||||||
, time + " 23:59:59").get(0);
|
, time + " 23:59:59");
|
||||||
|
if (CollUtil.isNotEmpty(dataInHarmVList)) {
|
||||||
|
DataInHarmV dataInHarmV = dataInHarmVList.get(0);
|
||||||
channelHarmonicData(null, null, dataInHarmV, item, overlimit, result, "getInuharm", DicDataEnum.INTERHARMONIC_VOLTAGE.getName(), timeInterval, 1, 16);
|
channelHarmonicData(null, null, dataInHarmV, item, overlimit, result, "getInuharm", DicDataEnum.INTERHARMONIC_VOLTAGE.getName(), timeInterval, 1, 16);
|
||||||
|
} else {
|
||||||
|
log.info("{}原始数据缺失", time);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -492,11 +533,16 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||||
double maxData = getUnbalance(param.getLineId()
|
List<DataV> dataVList = getUnbalance(param.getLineId()
|
||||||
, time + " 00:00:00"
|
, time + " 00:00:00"
|
||||||
, time + " 23:59:59"
|
, time + " 23:59:59"
|
||||||
).get(0).getVUnbalance();
|
);
|
||||||
|
if (CollUtil.isNotEmpty(dataVList)) {
|
||||||
|
double maxData = dataVList.get(0).getVUnbalance();
|
||||||
channelEachData(item, overlimit.getUbalance(), "getUbalance", result, DicDataEnum.PHASE_VOLTAGE.getName(), timeInterval, maxData);
|
channelEachData(item, overlimit.getUbalance(), "getUbalance", result, DicDataEnum.PHASE_VOLTAGE.getName(), timeInterval, maxData);
|
||||||
|
} else {
|
||||||
|
log.info("{}原始数据缺失", time);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -506,11 +552,16 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||||
double maxData = getINeg(param.getLineId()
|
List<DataI> dataIList = getINeg(param.getLineId()
|
||||||
, time + " 00:00:00"
|
, time + " 00:00:00"
|
||||||
, time + " 23:59:59"
|
, time + " 23:59:59"
|
||||||
).get(0).getINeg();
|
);
|
||||||
|
if (CollUtil.isNotEmpty(dataIList)) {
|
||||||
|
double maxData = dataIList.get(0).getINeg();
|
||||||
channelEachData(item, overlimit.getINeg(), "getINeg", result, DicDataEnum.NEG_CURRENT.getName(), timeInterval, maxData);
|
channelEachData(item, overlimit.getINeg(), "getINeg", result, DicDataEnum.NEG_CURRENT.getName(), timeInterval, maxData);
|
||||||
|
} else {
|
||||||
|
log.info("{}原始数据缺失", time);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -904,12 +955,12 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取负序电压不平衡度-日最大值-最大值
|
* 获取负序电压不平衡度-日最大值-CP95
|
||||||
*/
|
*/
|
||||||
public List<DataV> getUnbalance(String lineIndex, String startTime, String endTime) {
|
public List<DataV> getUnbalance(String lineIndex, String startTime, String endTime) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
||||||
influxQueryWrapper.eq(DataV::getLineId, lineIndex)
|
influxQueryWrapper.eq(DataV::getLineId, lineIndex)
|
||||||
.eq(DataV::getValueType, InfluxDbSqlConstant.MAX)
|
.eq(DataV::getValueType, InfluxDbSqlConstant.CP95)
|
||||||
.eq(DataV::getPhaseType, "T")
|
.eq(DataV::getPhaseType, "T")
|
||||||
.max(DataV::getVUnbalance)
|
.max(DataV::getVUnbalance)
|
||||||
.between(DataV::getTime, startTime, endTime);
|
.between(DataV::getTime, startTime, endTime);
|
||||||
@@ -917,12 +968,12 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取负序电流-日最大值-最大值
|
* 获取负序电流-日最大值-CP95
|
||||||
*/
|
*/
|
||||||
public List<DataI> getINeg(String lineIndex, String startTime, String endTime) {
|
public List<DataI> getINeg(String lineIndex, String startTime, String endTime) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataI.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataI.class);
|
||||||
influxQueryWrapper.eq(DataI::getLineId, lineIndex)
|
influxQueryWrapper.eq(DataI::getLineId, lineIndex)
|
||||||
.eq(DataI::getValueType, InfluxDbSqlConstant.MAX)
|
.eq(DataI::getValueType, InfluxDbSqlConstant.CP95)
|
||||||
.eq(DataI::getPhaseType, "T")
|
.eq(DataI::getPhaseType, "T")
|
||||||
.max(DataI::getINeg)
|
.max(DataI::getINeg)
|
||||||
.between(DataI::getTime, startTime, endTime);
|
.between(DataI::getTime, startTime, endTime);
|
||||||
|
|||||||
@@ -357,33 +357,6 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
List<PullDown> pullDowns = new ArrayList<>();
|
List<PullDown> pullDowns = new ArrayList<>();
|
||||||
|
|
||||||
PullDown pullDown;
|
PullDown pullDown;
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(0);
|
|
||||||
pullDown.setLastCol(0);
|
|
||||||
pullDown.setIsText(true);
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(10);
|
|
||||||
pullDown.setLastCol(10);
|
|
||||||
pullDown.setIsText(true);
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(11);
|
|
||||||
pullDown.setLastCol(11);
|
|
||||||
pullDown.setIsText(true);
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(20);
|
|
||||||
pullDown.setLastCol(20);
|
|
||||||
pullDown.setIsText(true);
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
pullDown = new PullDown();
|
||||||
pullDown.setFirstCol(1);
|
pullDown.setFirstCol(1);
|
||||||
pullDown.setLastCol(1);
|
pullDown.setLastCol(1);
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import com.njcn.bpm.service.IBpmService;
|
|||||||
import com.njcn.supervision.pojo.param.survey.SurveyPlanParam;
|
import com.njcn.supervision.pojo.param.survey.SurveyPlanParam;
|
||||||
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
|
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
|
||||||
import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO;
|
import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,4 +32,8 @@ public interface ISurveyPlanService extends IBpmService<SurveyPlan> {
|
|||||||
SurveyPlanVO getVOById(String id);
|
SurveyPlanVO getVOById(String id);
|
||||||
|
|
||||||
Boolean deleteSurveyPlan(List<String> supervisionId);
|
Boolean deleteSurveyPlan(List<String> supervisionId);
|
||||||
|
|
||||||
|
void downloadPlanTemplate();
|
||||||
|
|
||||||
|
void importPlanData(MultipartFile file, HttpServletResponse response);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
package com.njcn.supervision.service.survey.impl;
|
package com.njcn.supervision.service.survey.impl;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.text.StrPool;
|
import cn.hutool.core.text.StrPool;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.excel.EasyExcel;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
@@ -20,13 +26,24 @@ import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
|||||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.common.pojo.enums.common.DealStateEnum;
|
import com.njcn.common.pojo.enums.common.DealStateEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||||
|
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||||
|
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||||
|
import com.njcn.device.pms.pojo.excel.PowerGenerationUserExcel;
|
||||||
|
import com.njcn.device.pms.utils.PubUtil;
|
||||||
import com.njcn.device.pq.api.LineFeignClient;
|
import com.njcn.device.pq.api.LineFeignClient;
|
||||||
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
||||||
|
import com.njcn.poi.excel.ExcelUtil;
|
||||||
|
import com.njcn.poi.excel.PullDown;
|
||||||
|
import com.njcn.poi.util.PoiUtil;
|
||||||
import com.njcn.supervision.enums.FlowStatusEnum;
|
import com.njcn.supervision.enums.FlowStatusEnum;
|
||||||
import com.njcn.supervision.enums.SupervisionKeyEnum;
|
import com.njcn.supervision.enums.SupervisionKeyEnum;
|
||||||
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||||
import com.njcn.supervision.mapper.survey.SurveyPlanMapper;
|
import com.njcn.supervision.mapper.survey.SurveyPlanMapper;
|
||||||
|
import com.njcn.supervision.pojo.dto.SupervisionDevMainReportExcel;
|
||||||
|
import com.njcn.supervision.pojo.dto.SupervisionPlanExcel;
|
||||||
import com.njcn.supervision.pojo.param.survey.SurveyPlanParam;
|
import com.njcn.supervision.pojo.param.survey.SurveyPlanParam;
|
||||||
|
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
||||||
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
|
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
|
||||||
import com.njcn.supervision.pojo.po.survey.SurveyTest;
|
import com.njcn.supervision.pojo.po.survey.SurveyTest;
|
||||||
import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO;
|
import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO;
|
||||||
@@ -35,18 +52,24 @@ import com.njcn.supervision.service.survey.ISurveyPlanService;
|
|||||||
import com.njcn.supervision.service.survey.ISurveyTestService;
|
import com.njcn.supervision.service.survey.ISurveyTestService;
|
||||||
import com.njcn.supervision.utils.InstanceUtil;
|
import com.njcn.supervision.utils.InstanceUtil;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
import com.njcn.system.pojo.po.DictData;
|
import com.njcn.system.pojo.po.DictData;
|
||||||
import com.njcn.user.api.DeptFeignClient;
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
|
import com.njcn.user.pojo.dto.DeptDTO;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.time.ZoneId;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -62,19 +85,16 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private BpmProcessFeignClient bpmProcessFeignClient;
|
private BpmProcessFeignClient bpmProcessFeignClient;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private DeptFeignClient deptFeignClient;
|
private DeptFeignClient deptFeignClient;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private LineFeignClient lineFeignClient;
|
private LineFeignClient lineFeignClient;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ISurveyTestService surveyTestService;
|
private ISurveyTestService surveyTestService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private DicDataFeignClient dicDataFeignClient;
|
private DicDataFeignClient dicDataFeignClient;
|
||||||
|
@Resource
|
||||||
|
private CommTerminalGeneralClient commterminalGeneralClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<SurveyPlanVO> surveyPlanPage(SurveyPlanParam.SurveyPlanQueryParam surveyPlanQueryParam) {
|
public Page<SurveyPlanVO> surveyPlanPage(SurveyPlanParam.SurveyPlanQueryParam surveyPlanQueryParam) {
|
||||||
@@ -125,12 +145,16 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
|||||||
String[] subIds = substation.split(StrPool.COMMA);
|
String[] subIds = substation.split(StrPool.COMMA);
|
||||||
|
|
||||||
for (String subId : subIds) {
|
for (String subId : subIds) {
|
||||||
String name = lineFeignClient.getSubstationInfo(subId).getData().getName();
|
PollutionSubstationDTO data = lineFeignClient.getSubstationInfo(subId).getData();
|
||||||
|
if (ObjectUtil.isNotNull(data)) {
|
||||||
|
String name = data.getName();
|
||||||
subName = subName.concat(StrPool.COMMA).concat(name);
|
subName = subName.concat(StrPool.COMMA).concat(name);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if(StrUtil.isNotBlank(subName)){
|
||||||
subName = subName.substring(1);
|
subName = subName.substring(1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
record.setSubstation(subName);
|
record.setSubstation(subName);
|
||||||
} else {
|
} else {
|
||||||
record.setSubstationName(record.getSubstation());
|
record.setSubstationName(record.getSubstation());
|
||||||
@@ -348,4 +372,185 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
|||||||
return this.update(new LambdaUpdateWrapper<SurveyPlan>().set(SurveyPlan::getState, DataStateEnum.DELETED.getCode())
|
return this.update(new LambdaUpdateWrapper<SurveyPlan>().set(SurveyPlan::getState, DataStateEnum.DELETED.getCode())
|
||||||
.in(SurveyPlan::getId, supervisionId));
|
.in(SurveyPlan::getId, supervisionId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void downloadPlanTemplate() {
|
||||||
|
ExportParams exportParams = new ExportParams("技术监督计划模板数据模板(带*字段均是必填,请严格按照模板标准填入数据)", "技术监督计划信息");
|
||||||
|
//所属供电公司
|
||||||
|
List<DeptDTO> depts = deptFeignClient.getDepSonDetailByDeptId(RequestUtil.getDeptIndex()).getData();
|
||||||
|
List<DictData> supType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPV_TYPE.getCode()).getData();
|
||||||
|
SubstationParam substationParam = new SubstationParam();
|
||||||
|
substationParam.setOrgIds(depts.stream().map(DeptDTO::getId).distinct().collect(Collectors.toList()));
|
||||||
|
List<SubGetBase> data = commterminalGeneralClient.tagOrIdGetSub(substationParam).getData();
|
||||||
|
|
||||||
|
List<PullDown> pullDowns = new ArrayList<>();
|
||||||
|
|
||||||
|
PullDown pullDown;
|
||||||
|
pullDown = new PullDown();
|
||||||
|
pullDown.setFirstCol(0);
|
||||||
|
pullDown.setLastCol(0);
|
||||||
|
pullDown.setStrings(depts.stream().map(DeptDTO::getName).distinct().collect(Collectors.toList()));
|
||||||
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
pullDown = new PullDown();
|
||||||
|
pullDown.setFirstCol(2);
|
||||||
|
pullDown.setLastCol(2);
|
||||||
|
pullDown.setStrings(supType.stream().map(DictData::getName).distinct().collect(Collectors.toList()));
|
||||||
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
pullDown = new PullDown();
|
||||||
|
pullDown.setFirstCol(6);
|
||||||
|
pullDown.setLastCol(6);
|
||||||
|
pullDown.setStrings(Stream.of("是", "否").collect(Collectors.toList()));
|
||||||
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
pullDown = new PullDown();
|
||||||
|
pullDown.setFirstCol(7);
|
||||||
|
pullDown.setLastCol(7);
|
||||||
|
pullDown.setStrings(data.stream().map(SubGetBase::getName).distinct().collect(Collectors.toList()));
|
||||||
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
pullDown = new PullDown();
|
||||||
|
pullDown.setFirstCol(8);
|
||||||
|
pullDown.setLastCol(8);
|
||||||
|
pullDown.setStrings(data.stream().map(SubGetBase::getName).distinct().collect(Collectors.toList()));
|
||||||
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
pullDown = new PullDown();
|
||||||
|
pullDown.setFirstCol(9);
|
||||||
|
pullDown.setLastCol(9);
|
||||||
|
pullDown.setStrings(data.stream().map(SubGetBase::getName).distinct().collect(Collectors.toList()));
|
||||||
|
pullDowns.add(pullDown);
|
||||||
|
ExcelUtil.exportExcelPullDown(exportParams, "技术监督计划模板.xlsx", pullDowns, SupervisionPlanExcel.class, new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void importPlanData(MultipartFile file, HttpServletResponse response) {
|
||||||
|
List<SupervisionPlanExcel.ExcelMsg> planMsgList = new ArrayList<>();
|
||||||
|
ImportParams params = new ImportParams();
|
||||||
|
//表头
|
||||||
|
params.setHeadRows(1);
|
||||||
|
//标题
|
||||||
|
params.setTitleRows(1);
|
||||||
|
params.setNeedVerify(true);
|
||||||
|
params.setStartSheetIndex(0);
|
||||||
|
params.setSheetNum(1);
|
||||||
|
List<SupervisionPlanExcel> planExcels;
|
||||||
|
try {
|
||||||
|
planExcels = ExcelImportUtil.importExcel(file.getInputStream(), SupervisionPlanExcel.class, params);
|
||||||
|
//如果存在非法数据,将不合格的数据导出
|
||||||
|
if (CollUtil.isEmpty(planExcels)) {
|
||||||
|
throw new BusinessException(SupervisionResponseEnum.IMPORT_PLAN_DATA_ERROR);
|
||||||
|
}
|
||||||
|
//各地市
|
||||||
|
List<DeptDTO> deptS = deptFeignClient.getDepSonDetailByDeptId(RequestUtil.getDeptIndex()).getData();
|
||||||
|
List<DictData> supType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPV_TYPE.getCode()).getData();
|
||||||
|
|
||||||
|
SubstationParam substationParam = new SubstationParam();
|
||||||
|
substationParam.setOrgIds(deptS.stream().map(DeptDTO::getId).distinct().collect(Collectors.toList()));
|
||||||
|
List<SubGetBase> data = commterminalGeneralClient.tagOrIdGetSub(substationParam).getData();
|
||||||
|
List<SurveyPlan> info = new ArrayList<>();
|
||||||
|
SurveyPlan po;
|
||||||
|
if (CollectionUtil.isNotEmpty(planExcels)) {
|
||||||
|
for (SupervisionPlanExcel planExcel : planExcels) {
|
||||||
|
po = new SurveyPlan();
|
||||||
|
StringBuilder msg = new StringBuilder();
|
||||||
|
if (StrUtil.isEmpty(planExcel.getDeptId())) {
|
||||||
|
msg.append("计划负责单位不能为空!");
|
||||||
|
} else {
|
||||||
|
List<String> DeptIds = deptS.stream().filter(x -> x.getName().equals(planExcel.getDeptId())).map(DeptDTO::getId).collect(Collectors.toList());
|
||||||
|
if (CollUtil.isEmpty(DeptIds)) {
|
||||||
|
msg.append("计划负责单位不存在!");
|
||||||
|
} else {
|
||||||
|
po.setDeptId(DeptIds.get(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (StrUtil.isEmpty(planExcel.getPlanName())) {
|
||||||
|
msg.append("计划名称不能为空!");
|
||||||
|
} else {
|
||||||
|
po.setPlanName(planExcel.getPlanName());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StrUtil.isEmpty(planExcel.getSupvType())) {
|
||||||
|
msg.append("监督类型不能为空!");
|
||||||
|
} else {
|
||||||
|
String dicById = PubUtil.getDicById(planExcel.getSupvType(), supType);
|
||||||
|
if (StrUtil.isEmpty(dicById)) {
|
||||||
|
msg.append("监督类型不存在!");
|
||||||
|
} else {
|
||||||
|
po.setSupvType(dicById);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (StrUtil.isEmpty(planExcel.getSupvObjectName())) {
|
||||||
|
msg.append("监督对象名称不能为空!");
|
||||||
|
} else {
|
||||||
|
po.setSupvObjectName(planExcel.getSupvObjectName());
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Date startTime = planExcel.getPlanStartTime();
|
||||||
|
Date endTime = planExcel.getPlanEndTime();
|
||||||
|
po.setPlanStartTime(startTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate());
|
||||||
|
po.setPlanEndTime(endTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate());
|
||||||
|
} catch (Exception e) {
|
||||||
|
msg.append("计划时间格式有误!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StrUtil.isEmpty(planExcel.getCustomSubstationFlag())) {
|
||||||
|
msg.append("是否系统电站不能为空!");
|
||||||
|
} else {
|
||||||
|
po.setCustomSubstationFlag(Integer.valueOf(planExcel.getCustomSubstationFlag()));
|
||||||
|
}
|
||||||
|
List<String> list = Arrays.asList(planExcel.getSubstation(), planExcel.getSubstation2(), planExcel.getSubstation3())
|
||||||
|
.stream().filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
||||||
|
if (CollUtil.isEmpty(list)) {
|
||||||
|
msg.append("关联电站不能为空!");
|
||||||
|
} else {
|
||||||
|
if ("0".equals(planExcel.getCustomSubstationFlag())) {
|
||||||
|
List<String> subIds = data.stream().filter(x -> list.contains(x.getName())).map(SubGetBase::getId).collect(Collectors.toList());
|
||||||
|
if (CollUtil.isEmpty(subIds)) {
|
||||||
|
msg.append("关联电站不存在!");
|
||||||
|
} else {
|
||||||
|
po.setSubstation(String.join(",", subIds));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
po.setSubstation(planExcel.getSubstation());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String string = msg.toString();
|
||||||
|
if (StrUtil.isNotBlank(string)) {
|
||||||
|
SupervisionPlanExcel.ExcelMsg excelMsg = new SupervisionPlanExcel.ExcelMsg();
|
||||||
|
BeanUtils.copyProperties(planExcel, excelMsg);
|
||||||
|
excelMsg.setMsg(string);
|
||||||
|
planMsgList.add(excelMsg);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
po.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
|
po.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
info.add(po);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(info)) {
|
||||||
|
for (SurveyPlan surveyPlan : info) {
|
||||||
|
this.saveOrUpdate(surveyPlan);
|
||||||
|
SurveyPlan plan = this.baseMapper.selectById(surveyPlan.getId());
|
||||||
|
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||||
|
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||||
|
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.SURVEY_PLAN.getKey());
|
||||||
|
bpmProcessInstanceCreateReqDTO.setBusinessKey(plan.getId());
|
||||||
|
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>(16));
|
||||||
|
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||||
|
String processInstanceId = bpmProcessFeignClient.createProcessInstance(plan.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
||||||
|
// 将工作流的编号,更新到流程单中
|
||||||
|
plan.setProcessInstanceId(processInstanceId);
|
||||||
|
this.baseMapper.updateById(plan);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//判断有没有错误信息
|
||||||
|
if (CollectionUtil.isNotEmpty(planMsgList)) {
|
||||||
|
ExcelUtil.exportExcel("失败列表.xlsx", SupervisionPlanExcel.ExcelMsg.class, planMsgList);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BusinessException(SupervisionResponseEnum.IMPORT_PLAN_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,10 @@ spring:
|
|||||||
refresh: true
|
refresh: true
|
||||||
main:
|
main:
|
||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 100MB
|
||||||
|
max-request-size: 100MB
|
||||||
#项目日志的配置
|
#项目日志的配置
|
||||||
logging:
|
logging:
|
||||||
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
||||||
|
|||||||
@@ -91,7 +91,6 @@
|
|||||||
<artifactId>cs-device-api</artifactId>
|
<artifactId>cs-device-api</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class MeasurementTaskRunner implements TimerTaskRunner {
|
|||||||
baseParam.setFullChain(true);
|
baseParam.setFullChain(true);
|
||||||
baseParam.setRepair(false);
|
baseParam.setRepair(false);
|
||||||
if(StrUtil.isBlank(date)){
|
if(StrUtil.isBlank(date)){
|
||||||
baseParam.setDataDate(DateUtil.yesterday().toString(DatePattern.NORM_DATETIME_PATTERN));
|
baseParam.setDataDate(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
||||||
}else {
|
}else {
|
||||||
baseParam.setDataDate(date);
|
baseParam.setDataDate(date);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用于pms往国网推送公共连接点数据定时任务
|
* 主配网监测点
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
|||||||
Reference in New Issue
Block a user