国网推送

This commit is contained in:
hzj
2023-12-14 16:13:03 +08:00
parent d1e4790a5c
commit 5bb7adc5b6
28 changed files with 381 additions and 460 deletions

View File

@@ -6,88 +6,83 @@ import java.math.BigDecimal;
/** /**
* Description: * Description:
* Date: 2023/12/6 15:22【需求编号】 * Date: 2023/12/6 15:30【需求编号】
* *
* @author clam * @author clam
* @version V1.0.0 * @version V1.0.0
*/ */
@Data @Data
public class ConverterDetailStatisticsDTO { public class ConverterDetailStatisticsDTO {
/*主键 是否必填:是*/ /*主键 是否必填:是*/
private String id; private String id;
/*省级单位名称 是否必填:否*/
private String provinceName;
/*省级单位id 是否必填:是*/
private String provinceId;
/*市级单位id 是否必填:是*/
private String cityId;
/*市级单位名称 是否必填:否*/
private String cityName;
/*统计日期 是否必填:是*/ /*统计日期 是否必填:是*/
private String statisticalDate; private String statisticalDate;
/*统计类型 是否必填:是*/ /*统计类型 是否必填:是*/
private String statisticalType; private String statisticalType;
/*统计层级 是否必填:是*/ /*省级单位id 是否必填:是*/
private String statisticalLevel; private String provinceId;
/*省级单位名称 是否必填:否*/
private String provinceName;
/*市级单位id 是否必填:是*/
private String cityId;
/*市级单位名称 是否必填:否*/
private String cityName;
/*县级单位id 是否必填:否*/
private String countyId;
/*县级单位名称 是否必填:否*/
private String countyName;
/*换流站id 是否必填:是*/
private String converterId;
/*换流站名称 是否必填:是*/
private String converterName;
/*电压等级 是否必填:是*/
private String voltageLevel;
/*在运交流母线数量(条) 是否必填:*/ /*母线id 是否必填:*/
private Integer onlineAlternatingBusNum; private String busId;
/*在运换流站数量(座) 是否必填:*/ /*母线名称 是否必填:*/
private Integer onlineConverterNum; private String busName;
/*母线电压等级 是否必填:否*/
private String busVoltageLevel;
/*发生超标或暂态母线数量(条) 是否必填:*/ /*监测点id 是否必填:*/
private Integer abnormalBusNum; private String monitorId;
/*监测换流站数量(座) 是否必填:是*/
private Integer monitorConverterNum;
/*监测交流母线数量(条) 是否必填:否*/
private Integer monitorAlternatingBusNum;
/*累计发生超标或暂态换流站数量(座) 是否必填:否*/
private Integer abnormalConverterCount;
/*累计监测换流站数量(座) 是否必填:否*/
private Integer monitorConverterCount;
/*累计发生超标或暂态母线数量(座) 是否必填:否*/
private Integer abnormalBusCount;
/*累计监测交流母线数量(座) 是否必填:否*/
private Integer monitorAlternatingBusCount;
/*发生超标或暂态换流站数量(条) 是否必填:否*/
private Integer abnormalConverterNum;
/*发生超标或暂态母线日均占比(% 是否必填:否*/
private BigDecimal abnormalBusAvgRate;
/*发生超标或暂态母线占比(% 是否必填:否*/
private BigDecimal abnormalBusRate;
/*发生超标或暂态换流站日均占比(% 是否必填:否*/
private BigDecimal abnormalConverterAvgRate;
/*发生超标或暂态换流站占比(% 是否必填:否*/
private BigDecimal abnormalConverterRate;
/*交流母线监测率(% 是否必填:否*/
private BigDecimal monitorAlternatingBusRate;
/*换流站监测率(% 是否必填:*/
private BigDecimal monitorConverterRate;
/*站内有效监测点数量(个) 是否必填:是*/
private Integer effectiveMonitorNum;
/*谐波电压超标天数 是否必填:否*/
private Integer harmvOvDay;
/*当年累计月数 是否必填:否*/
private Integer monthsCount;
/*月均超标天数 是否必填:否*/
private BigDecimal monthOvDays;
/*奇次谐波电压限值(% 是否必填:是*/
private BigDecimal oddVoltLimit;
/*累计超标天数 是否必填:否*/
private Integer totalOvDays;
/*11次谐波电压95%概率值(% 是否必填:否*/
private BigDecimal v11;
/*13次谐波电压95%概率值(% 是否必填:否*/
private BigDecimal v13;
/*23次谐波电压95%概率值(% 是否必填:否*/
private BigDecimal v23;
/*25次谐波电压95%概率值(% 是否必填:否*/
private BigDecimal v25;
/*3次谐波电压95%概率值(% 是否必填:否*/
private BigDecimal v3;
/*5次谐波电压95%概率值(% 是否必填:否*/
private BigDecimal v5;
/*7次谐波电压95%概率值(% 是否必填:否*/
private BigDecimal v7;
/*电压总谐波畸变率95%概率值统计值(% 是否必填:否*/
private BigDecimal vthd;
/*电压总谐波畸变率95%概率值限值(% 是否必填:是*/
private BigDecimal vthdLimit;

View File

@@ -0,0 +1,96 @@
package com.njcn.harmonic.pojo.dto;
import lombok.Data;
import java.math.BigDecimal;
/**
* Description:
* Date: 2023/12/6 15:22【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class ConverterIndexStatisticsDTO {
/*主键 是否必填:是*/
private String id;
/*省级单位名称 是否必填:否*/
private String provinceName;
/*省级单位id 是否必填:是*/
private String provinceId;
/*市级单位id 是否必填:是*/
private String cityId;
/*市级单位名称 是否必填:否*/
private String cityName;
/*统计日期 是否必填:是*/
private String statisticalDate;
/*统计类型 是否必填:是*/
private String statisticalType;
/*统计层级 是否必填:是*/
private String statisticalLevel;
/*在运交流母线数量(条) 是否必填:是*/
private Integer onlineAlternatingBusNum;
/*在运换流站数量(座) 是否必填:是*/
private Integer onlineConverterNum;
/*发生超标或暂态母线数量(条) 是否必填:是*/
private Integer abnormalBusNum;
/*监测换流站数量(座) 是否必填:是*/
private Integer monitorConverterNum;
/*监测交流母线数量(条) 是否必填:否*/
private Integer monitorAlternatingBusNum;
/*累计发生超标或暂态换流站数量(座) 是否必填:否*/
private Integer abnormalConverterCount;
/*累计监测换流站数量(座) 是否必填:否*/
private Integer monitorConverterCount;
/*累计发生超标或暂态母线数量(座) 是否必填:否*/
private Integer abnormalBusCount;
/*累计监测交流母线数量(座) 是否必填:否*/
private Integer monitorAlternatingBusCount;
/*发生超标或暂态换流站数量(条) 是否必填:否*/
private Integer abnormalConverterNum;
/*发生超标或暂态母线日均占比(% 是否必填:否*/
private BigDecimal abnormalBusAvgRate;
/*发生超标或暂态母线占比(% 是否必填:否*/
private BigDecimal abnormalBusRate;
/*发生超标或暂态换流站日均占比(% 是否必填:否*/
private BigDecimal abnormalConverterAvgRate;
/*发生超标或暂态换流站占比(% 是否必填:否*/
private BigDecimal abnormalConverterRate;
/*交流母线监测率(% 是否必填:否*/
private BigDecimal monitorAlternatingBusRate;
/*换流站监测率(% 是否必填:*/
private BigDecimal monitorConverterRate;
}

View File

@@ -1,91 +0,0 @@
package com.njcn.harmonic.pojo.dto;
import lombok.Data;
import java.math.BigDecimal;
/**
* Description:
* Date: 2023/12/6 15:30【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class SubstationQualityStatisticsDTO {
/*主键 是否必填:是*/
private String id;
/*统计日期 是否必填:是*/
private String statisticalDate;
/*统计类型 是否必填:是*/
private String statisticalType;
/*省级单位id 是否必填:是*/
private String provinceId;
/*省级单位名称 是否必填:否*/
private String provinceName;
/*市级单位id 是否必填:是*/
private String cityId;
/*市级单位名称 是否必填:否*/
private String cityName;
/*县级单位id 是否必填:否*/
private String countyId;
/*县级单位名称 是否必填:否*/
private String countyName;
/*换流站id 是否必填:是*/
private String converterId;
/*换流站名称 是否必填:是*/
private String converterName;
/*电压等级 是否必填:是*/
private String voltageLevel;
/*母线id 是否必填:否*/
private String busId;
/*母线名称 是否必填:否*/
private String busName;
/*母线电压等级 是否必填:否*/
private String busVoltageLevel;
/*监测点id 是否必填:否*/
private String monitorId;
/*站内有效监测点数量(个) 是否必填:是*/
private Integer effectiveMonitorNum;
/*谐波电压超标天数 是否必填:否*/
private Integer harmvOvDay;
/*当年累计月数 是否必填:否*/
private Integer monthsCount;
/*月均超标天数 是否必填:否*/
private BigDecimal monthOvDays;
/*奇次谐波电压限值(% 是否必填:是*/
private BigDecimal oddVoltLimit;
/*累计超标天数 是否必填:否*/
private Integer totalOvDays;
/*11次谐波电压95%概率值(% 是否必填:否*/
private BigDecimal v11;
/*13次谐波电压95%概率值(% 是否必填:否*/
private BigDecimal v13;
/*23次谐波电压95%概率值(% 是否必填:否*/
private BigDecimal v23;
/*25次谐波电压95%概率值(% 是否必填:否*/
private BigDecimal v25;
/*3次谐波电压95%概率值(% 是否必填:否*/
private BigDecimal v3;
/*5次谐波电压95%概率值(% 是否必填:否*/
private BigDecimal v5;
/*7次谐波电压95%概率值(% 是否必填:否*/
private BigDecimal v7;
/*电压总谐波畸变率95%概率值统计值(% 是否必填:否*/
private BigDecimal vthd;
/*电压总谐波畸变率95%概率值限值(% 是否必填:是*/
private BigDecimal vthdLimit;
}

View File

@@ -17,8 +17,8 @@ import java.math.BigDecimal;
* @version V1.0.0 * @version V1.0.0
*/ */
@Data @Data
@TableName(value = "substation_quality_statistics") @TableName(value = "converter_detail_statistics")
public class SubstationQualityStatisticsPO { public class ConverterDetailStatisticsPO {
@TableId(value = "id", type = IdType.INPUT) @TableId(value = "id", type = IdType.INPUT)
private String id; private String id;

View File

@@ -17,8 +17,8 @@ import java.math.BigDecimal;
* @version V1.0.0 * @version V1.0.0
*/ */
@Data @Data
@TableName(value = "converterdetailstatistics") @TableName(value = "converter_index_statistics")
public class ConverterdetailstatisticsPO { public class ConverterIndexStatisticsPO {
@TableId(value = "id", type = IdType.INPUT) @TableId(value = "id", type = IdType.INPUT)
private String id; private String id;

View File

@@ -0,0 +1,60 @@
package com.njcn.harmonic.utils;
import com.njcn.harmonic.pojo.dto.PqTypicalSourceCreateDTO;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
/**
* Description:
* Date: 2023/12/7 16:12【需求编号】
*
* @author clam
* @version V1.0.0
*/
public class PotoSqlUtil {
public static String generateCreateTableSql(Class<?> entityClass) {
StringBuilder sql = new StringBuilder("CREATE TABLE ");
sql.append(entityClass.getSimpleName()).append(" (");
Field[] fields = entityClass.getDeclaredFields();
for (int i = 0; i < fields.length; i++) {
Field field = fields[i];
if (!Modifier.isStatic(field.getModifiers())) {
sql.append(field.getName()).append(" ");
Class<?> fieldType = field.getType();
if (fieldType == int.class || fieldType == Integer.class) {
sql.append("INT");
} else if (fieldType == String.class) {
sql.append("VARCHAR(255)");
} else if (fieldType == double.class || fieldType == Double.class) {
sql.append("DOUBLE");
} else if (fieldType == float.class || fieldType == Float.class) {
sql.append("FLOAT");
} else if (fieldType == boolean.class || fieldType == Boolean.class) {
sql.append("BOOLEAN");
} else if (fieldType == java.util.Date.class) {
sql.append("DATE");
} else if (fieldType == java.math.BigDecimal.class) {
sql.append("decimal");
}
else {
// 其他类型暂不支持,可以根据需要添加
continue;
}
if (i < fields.length - 1) {
sql.append(", ");
}
}
}
sql.append(");");
return sql.toString();
}
public static void main(String[] args) {
String createTableSql = generateCreateTableSql(PqTypicalSourceCreateDTO.class);
System.out.println(createTableSql);
}
}

View File

@@ -8,8 +8,8 @@ import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil; import com.njcn.common.utils.HttpResultUtil;
import com.njcn.common.utils.LogUtil; import com.njcn.common.utils.LogUtil;
import com.njcn.harmonic.pojo.param.SendQueryParam; import com.njcn.harmonic.pojo.param.SendQueryParam;
import com.njcn.harmonic.pojo.po.send.ConverterdetailstatisticsPO; import com.njcn.harmonic.pojo.po.send.ConverterIndexStatisticsPO;
import com.njcn.harmonic.service.send.ConverterdetailstatisticsPOService; import com.njcn.harmonic.service.send.ConverterIndexStatisticsPOService;
import com.njcn.web.controller.BaseController; import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@@ -37,17 +37,17 @@ import java.util.List;
@RequestMapping("/Converterdetail") @RequestMapping("/Converterdetail")
@Api(tags = "换流站指标统计明细汇总数据") @Api(tags = "换流站指标统计明细汇总数据")
@RequiredArgsConstructor @RequiredArgsConstructor
public class ConverterdetailstatisticsController extends BaseController { public class ConverterIndexStatisticsController extends BaseController {
private final ConverterdetailstatisticsPOService converterdetailstatisticsPOService; private final ConverterIndexStatisticsPOService converterIndexStatisticsPOService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryPage") @PostMapping("/queryPage")
@ApiOperation("数据查询") @ApiOperation("数据查询")
@ApiImplicitParam(name = "param", value = "实体参数", required = true) @ApiImplicitParam(name = "param", value = "实体参数", required = true)
public HttpResult<Page<ConverterdetailstatisticsPO>> queryPage(@Validated @RequestBody SendQueryParam.SendPageParam param) { public HttpResult<Page<ConverterIndexStatisticsPO>> queryPage(@Validated @RequestBody SendQueryParam.SendPageParam param) {
String methodDescribe = getMethodDescribe("queryPage"); String methodDescribe = getMethodDescribe("queryPage");
LogUtil.njcnDebug(log, "{},实体参数:{}", methodDescribe, param); LogUtil.njcnDebug(log, "{},实体参数:{}", methodDescribe, param);
Page<ConverterdetailstatisticsPO> list = converterdetailstatisticsPOService.queryPage(param); Page<ConverterIndexStatisticsPO> list = converterIndexStatisticsPOService.queryPage(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
} }
@@ -57,7 +57,7 @@ public class ConverterdetailstatisticsController extends BaseController {
@ApiImplicitParam(name = "ids",value = "请求体",required = true) @ApiImplicitParam(name = "ids",value = "请求体",required = true)
public HttpResult<String> send(@RequestBody List<String> ids){ public HttpResult<String> send(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("send"); String methodDescribe = getMethodDescribe("send");
String s = converterdetailstatisticsPOService.send(ids); String s = converterIndexStatisticsPOService.send(ids);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
} }

View File

@@ -8,8 +8,8 @@ import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil; import com.njcn.common.utils.HttpResultUtil;
import com.njcn.common.utils.LogUtil; import com.njcn.common.utils.LogUtil;
import com.njcn.harmonic.pojo.param.SendQueryParam; import com.njcn.harmonic.pojo.param.SendQueryParam;
import com.njcn.harmonic.pojo.po.send.SubstationQualityStatisticsPO; import com.njcn.harmonic.pojo.po.send.ConverterDetailStatisticsPO;
import com.njcn.harmonic.service.send.SubstationQualityStatisticsPOService; import com.njcn.harmonic.service.send.ConverterDetailStatisticsPOService;
import com.njcn.web.controller.BaseController; import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@@ -42,16 +42,16 @@ import java.util.List;
public class SubstationQualityStatisticsController extends BaseController { public class SubstationQualityStatisticsController extends BaseController {
private final SubstationQualityStatisticsPOService substationQualityStatisticsPOService; private final ConverterDetailStatisticsPOService converterDetailStatisticsPOService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryPage") @PostMapping("/queryPage")
@ApiOperation("数据查询") @ApiOperation("数据查询")
@ApiImplicitParam(name = "param", value = "实体参数", required = true) @ApiImplicitParam(name = "param", value = "实体参数", required = true)
public HttpResult<Page<SubstationQualityStatisticsPO>> queryPage(@Validated @RequestBody SendQueryParam.SendPageParam param) { public HttpResult<Page<ConverterDetailStatisticsPO>> queryPage(@Validated @RequestBody SendQueryParam.SendPageParam param) {
String methodDescribe = getMethodDescribe("queryPage"); String methodDescribe = getMethodDescribe("queryPage");
LogUtil.njcnDebug(log, "{},实体参数:{}", methodDescribe, param); LogUtil.njcnDebug(log, "{},实体参数:{}", methodDescribe, param);
Page<SubstationQualityStatisticsPO> list = substationQualityStatisticsPOService.queryPage(param); Page<ConverterDetailStatisticsPO> list = converterDetailStatisticsPOService.queryPage(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
} }
@@ -61,7 +61,7 @@ public class SubstationQualityStatisticsController extends BaseController {
@ApiImplicitParam(name = "ids",value = "请求体",required = true) @ApiImplicitParam(name = "ids",value = "请求体",required = true)
public HttpResult<String> send(@RequestBody List<String> ids){ public HttpResult<String> send(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("send"); String methodDescribe = getMethodDescribe("send");
String s = substationQualityStatisticsPOService.send(ids); String s = converterDetailStatisticsPOService.send(ids);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
} }

View File

@@ -1,7 +1,7 @@
package com.njcn.harmonic.mapper.send; package com.njcn.harmonic.mapper.send;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.harmonic.pojo.po.send.SubstationQualityStatisticsPO; import com.njcn.harmonic.pojo.po.send.ConverterDetailStatisticsPO;
/** /**
* *
@@ -11,5 +11,5 @@ import com.njcn.harmonic.pojo.po.send.SubstationQualityStatisticsPO;
* @author clam * @author clam
* @version V1.0.0 * @version V1.0.0
*/ */
public interface SubstationQualityStatisticsPOMapper extends BaseMapper<SubstationQualityStatisticsPO> { public interface ConverterDetailStatisticsPOMapper extends BaseMapper<ConverterDetailStatisticsPO> {
} }

View File

@@ -1,7 +1,7 @@
package com.njcn.harmonic.mapper.send; package com.njcn.harmonic.mapper.send;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.harmonic.pojo.po.send.ConverterdetailstatisticsPO; import com.njcn.harmonic.pojo.po.send.ConverterIndexStatisticsPO;
/** /**
* *
@@ -11,5 +11,5 @@ import com.njcn.harmonic.pojo.po.send.ConverterdetailstatisticsPO;
* @author clam * @author clam
* @version V1.0.0 * @version V1.0.0
*/ */
public interface ConverterdetailstatisticsPOMapper extends BaseMapper<ConverterdetailstatisticsPO> { public interface ConverterIndexStatisticsPOMapper extends BaseMapper<ConverterIndexStatisticsPO> {
} }

View File

@@ -1,15 +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.prepare.harmonic.mapper.mysql.send.ConverterdetailstatisticsPOMapper">
<!--@mbg.generated-->
<!--@Table converterdetailstatistics-->
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, abnormalBusAvgRate, abnormalBusNum, abnormalBusRate, abnormalConverterAvgRate,
abnormalConverterNum, abnormalConverterRate, cityId, cityName, monitorAlternatingBusNum,
monitorAlternatingBusRate, monitorConverterNum, monitorConverterRate, onlineAlternatingBusNum,
onlineConverterNum, provinceName, provinceId, statisticalDate, statisticalType, statisticalLevel,
abnormalConverterCount, monitorConverterCount, abnormalBusCount, monitorAlternatingBusCount
</sql>
</mapper>

View File

@@ -1,13 +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.prepare.harmonic.mapper.mysql.send.PqTypicalSourceCreatePOMapper">
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, statisticalDate, statisticalLevel, statisticalType, indexType, provinceId, provinceName,
cityId, cityName, countyId, countyName, industryType, interferenceSourceNum, averageOvDays,
flickerAvgOvRate, flickerOvNum, flickerOvRate, iAvgOvRate, iOvNum, iOvRate, inseqAvgOvRate,
inseqOvNum, inseqOvRate, monitorNum, monitoringRate, ovNum, ovRate, unbanOvNum, unbanOvRate,
vAvgOvRate, vOvNum, vOvRate, unbanAvgOvRate, ovDayCount
</sql>
</mapper>

View File

@@ -1,12 +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.prepare.harmonic.mapper.mysql.send.SubstationQualityStatisticsPOMapper">
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, statisticalDate, statisticalType, provinceId, provinceName, cityId, cityName,
countyId, countyName, converterId, converterName, voltageLevel, busId, busName, busVoltageLevel,
monitorId, effectiveMonitorNum, harmvOvDay, monthsCount, monthOvDays, oddVoltLimit,
totalOvDays, v11, v13, v23, v25, v3, v5, v7, vthd, vthdLimit
</sql>
</mapper>

View File

@@ -3,7 +3,7 @@ package com.njcn.harmonic.service.send;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.harmonic.pojo.param.SendQueryParam; import com.njcn.harmonic.pojo.param.SendQueryParam;
import com.njcn.harmonic.pojo.po.send.SubstationQualityStatisticsPO; import com.njcn.harmonic.pojo.po.send.ConverterDetailStatisticsPO;
import java.util.List; import java.util.List;
@@ -15,10 +15,10 @@ import java.util.List;
* @author clam * @author clam
* @version V1.0.0 * @version V1.0.0
*/ */
public interface SubstationQualityStatisticsPOService extends IService<SubstationQualityStatisticsPO>{ public interface ConverterDetailStatisticsPOService extends IService<ConverterDetailStatisticsPO>{
Page<SubstationQualityStatisticsPO> queryPage(SendQueryParam.SendPageParam param); Page<ConverterDetailStatisticsPO> queryPage(SendQueryParam.SendPageParam param);
String send(List<String> ids); String send(List<String> ids);
} }

View File

@@ -3,7 +3,7 @@ package com.njcn.harmonic.service.send;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.harmonic.pojo.param.SendQueryParam; import com.njcn.harmonic.pojo.param.SendQueryParam;
import com.njcn.harmonic.pojo.po.send.ConverterdetailstatisticsPO; import com.njcn.harmonic.pojo.po.send.ConverterIndexStatisticsPO;
import java.util.List; import java.util.List;
@@ -15,10 +15,10 @@ import java.util.List;
* @author clam * @author clam
* @version V1.0.0 * @version V1.0.0
*/ */
public interface ConverterdetailstatisticsPOService extends IService<ConverterdetailstatisticsPO>{ public interface ConverterIndexStatisticsPOService extends IService<ConverterIndexStatisticsPO>{
Page<ConverterdetailstatisticsPO> queryPage(SendQueryParam.SendPageParam param); Page<ConverterIndexStatisticsPO> queryPage(SendQueryParam.SendPageParam param);
String send(List<String> ids); String send(List<String> ids);
} }

View File

@@ -7,11 +7,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.common.pojo.exception.BusinessException; import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.harmonic.mapper.send.ConverterdetailstatisticsPOMapper; import com.njcn.harmonic.mapper.send.ConverterDetailStatisticsPOMapper;
import com.njcn.harmonic.pojo.dto.ConverterDetailStatisticsDTO; import com.njcn.harmonic.pojo.dto.ConverterDetailStatisticsDTO;
import com.njcn.harmonic.pojo.param.SendQueryParam; import com.njcn.harmonic.pojo.param.SendQueryParam;
import com.njcn.harmonic.pojo.po.send.ConverterdetailstatisticsPO; import com.njcn.harmonic.pojo.po.send.ConverterDetailStatisticsPO;
import com.njcn.harmonic.service.send.ConverterdetailstatisticsPOService; import com.njcn.harmonic.service.send.ConverterDetailStatisticsPOService;
import com.njcn.user.api.DeptFeignClient; import com.njcn.user.api.DeptFeignClient;
import com.njcn.web.enums.GWSendEnum; import com.njcn.web.enums.GWSendEnum;
import com.njcn.web.pojo.param.SendParam; import com.njcn.web.pojo.param.SendParam;
@@ -27,7 +27,7 @@ import java.util.stream.Collectors;
/** /**
* *
* Description: * Description:
* Date: 2023/12/11 11:35需求编号 * Date: 2023/12/7 16:21需求编号
* *
* @author clam * @author clam
* @version V1.0.0 * @version V1.0.0
@@ -35,38 +35,42 @@ import java.util.stream.Collectors;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@Slf4j @Slf4j
public class ConverterdetailstatisticsPOServiceImpl extends ServiceImpl<ConverterdetailstatisticsPOMapper, ConverterdetailstatisticsPO> implements ConverterdetailstatisticsPOService { public class ConverterDetailStatisticsPOServiceImpl extends ServiceImpl<ConverterDetailStatisticsPOMapper, ConverterDetailStatisticsPO> implements ConverterDetailStatisticsPOService {
private final DeptFeignClient deptFeignClient; private final DeptFeignClient deptFeignClient;
@Override @Override
public Page<ConverterdetailstatisticsPO> queryPage(SendQueryParam.SendPageParam param) { public Page<ConverterDetailStatisticsPO> queryPage(SendQueryParam.SendPageParam param) {
Page<ConverterdetailstatisticsPO> page = new Page<> (param.getPageNum ( ), param.getPageSize ( )); Page<ConverterDetailStatisticsPO> page = new Page<> (param.getPageNum ( ), param.getPageSize ( ));
List<String> deptIds = deptFeignClient.getDepSonSelfCodetByCode(param.getDeptIndex()).getData(); List<String> deptIds = deptFeignClient.getDepSonSelfCodetByCode(param.getDeptIndex()).getData();
QueryWrapper<ConverterdetailstatisticsPO> wrapper = new QueryWrapper<>(); QueryWrapper<ConverterDetailStatisticsPO> wrapper = new QueryWrapper<>();
wrapper.lambda().in(ConverterdetailstatisticsPO::getProvinceId,deptIds). wrapper.lambda().in(ConverterDetailStatisticsPO::getProvinceId,deptIds).
between(ConverterdetailstatisticsPO::getStatisticalDate,param.getSearchBeginTime(),param.getSearchEndTime()); between(ConverterDetailStatisticsPO::getStatisticalDate,param.getSearchBeginTime(),param.getSearchEndTime());
Page<ConverterdetailstatisticsPO> converterdetailstatisticsPOPage = this.getBaseMapper().selectPage(page, wrapper); Page<ConverterDetailStatisticsPO> substationQualityStatisticsPOPage = this.getBaseMapper().selectPage(page, wrapper);
return converterdetailstatisticsPOPage; return substationQualityStatisticsPOPage;
} }
@Override @Override
public String send(List<String> ids) { public String send(List<String> ids) {
List<ConverterdetailstatisticsPO> list = this.lambdaQuery().eq(ConverterdetailstatisticsPO::getId, ids).list();
List<ConverterDetailStatisticsPO> list = this.lambdaQuery().eq(ConverterDetailStatisticsPO::getId, ids).list();
if (list.size() > 100) { if (list.size() > 100) {
throw new BusinessException("一次最多上送100条数据"); throw new BusinessException("一次最多上送100条数据");
} }
List<ConverterDetailStatisticsDTO> converterDetailStatisticsDTOS = BeanUtil.copyToList(list, ConverterDetailStatisticsDTO.class); List<ConverterDetailStatisticsDTO> converterDetailStatisticsDTOList = BeanUtil.copyToList(list, ConverterDetailStatisticsDTO.class);
SendParam param = new SendParam(); SendParam param = new SendParam();
param.setStats(converterDetailStatisticsDTOS); param.setStats(converterDetailStatisticsDTOList);
String s = JSONObject.toJSONStringWithDateFormat(param, JSON.DEFFAULT_DATE_FORMAT); String s = JSONObject.toJSONStringWithDateFormat(param, JSON.DEFFAULT_DATE_FORMAT);
log.info(Thread.currentThread().getName() + "获取返回体 换流站指标统计明细数据接口数据:" + s + "开始----"); log.info(Thread.currentThread().getName() + "获取返回体 换流站指标统计明细数据接口数据:" + s + "开始----");
Map<String, String> send = GwSendUtil.send(param, GWSendEnum.DETAIL_CREATE); Map<String, String> send = GwSendUtil.send(param, GWSendEnum.SUBSTATION_MONITOR);
log.info(Thread.currentThread().getName() + "获取返回体换流站指标统计明细数据接口响应结果:" + send + "结束----"); log.info(Thread.currentThread().getName() + "获取返回体换流站指标统计明细数据接口响应结果:" + send + "结束----");
List<String> trIds = converterDetailStatisticsDTOS.stream().map(ConverterDetailStatisticsDTO::getId).distinct().collect(Collectors.toList()); List<String> trIds = converterDetailStatisticsDTOList.stream().map(ConverterDetailStatisticsDTO::getId).distinct().collect(Collectors.toList());
return returnInformation(1, trIds, send); return returnInformation(1, trIds, send);
} }

View File

@@ -7,11 +7,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.common.pojo.exception.BusinessException; import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.harmonic.mapper.send.SubstationQualityStatisticsPOMapper; import com.njcn.harmonic.mapper.send.ConverterIndexStatisticsPOMapper;
import com.njcn.harmonic.pojo.dto.SubstationQualityStatisticsDTO; import com.njcn.harmonic.pojo.dto.ConverterIndexStatisticsDTO;
import com.njcn.harmonic.pojo.param.SendQueryParam; import com.njcn.harmonic.pojo.param.SendQueryParam;
import com.njcn.harmonic.pojo.po.send.SubstationQualityStatisticsPO; import com.njcn.harmonic.pojo.po.send.ConverterIndexStatisticsPO;
import com.njcn.harmonic.service.send.SubstationQualityStatisticsPOService; import com.njcn.harmonic.service.send.ConverterIndexStatisticsPOService;
import com.njcn.user.api.DeptFeignClient; import com.njcn.user.api.DeptFeignClient;
import com.njcn.web.enums.GWSendEnum; import com.njcn.web.enums.GWSendEnum;
import com.njcn.web.pojo.param.SendParam; import com.njcn.web.pojo.param.SendParam;
@@ -27,7 +27,7 @@ import java.util.stream.Collectors;
/** /**
* *
* Description: * Description:
* Date: 2023/12/7 16:21需求编号 * Date: 2023/12/11 11:35需求编号
* *
* @author clam * @author clam
* @version V1.0.0 * @version V1.0.0
@@ -35,42 +35,38 @@ import java.util.stream.Collectors;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@Slf4j @Slf4j
public class SubstationQualityStatisticsPOServiceImpl extends ServiceImpl<SubstationQualityStatisticsPOMapper, SubstationQualityStatisticsPO> implements SubstationQualityStatisticsPOService { public class ConverterIndexStatisticsPOServiceImpl extends ServiceImpl<ConverterIndexStatisticsPOMapper, ConverterIndexStatisticsPO> implements ConverterIndexStatisticsPOService {
private final DeptFeignClient deptFeignClient; private final DeptFeignClient deptFeignClient;
@Override @Override
public Page<SubstationQualityStatisticsPO> queryPage(SendQueryParam.SendPageParam param) { public Page<ConverterIndexStatisticsPO> queryPage(SendQueryParam.SendPageParam param) {
Page<SubstationQualityStatisticsPO> page = new Page<> (param.getPageNum ( ), param.getPageSize ( )); Page<ConverterIndexStatisticsPO> page = new Page<> (param.getPageNum ( ), param.getPageSize ( ));
List<String> deptIds = deptFeignClient.getDepSonSelfCodetByCode(param.getDeptIndex()).getData(); List<String> deptIds = deptFeignClient.getDepSonSelfCodetByCode(param.getDeptIndex()).getData();
QueryWrapper<SubstationQualityStatisticsPO> wrapper = new QueryWrapper<>(); QueryWrapper<ConverterIndexStatisticsPO> wrapper = new QueryWrapper<>();
wrapper.lambda().in(SubstationQualityStatisticsPO::getProvinceId,deptIds). wrapper.lambda().in(ConverterIndexStatisticsPO::getProvinceId,deptIds).
between(SubstationQualityStatisticsPO::getStatisticalDate,param.getSearchBeginTime(),param.getSearchEndTime()); between(ConverterIndexStatisticsPO::getStatisticalDate,param.getSearchBeginTime(),param.getSearchEndTime());
Page<SubstationQualityStatisticsPO> substationQualityStatisticsPOPage = this.getBaseMapper().selectPage(page, wrapper); Page<ConverterIndexStatisticsPO> converterdetailstatisticsPOPage = this.getBaseMapper().selectPage(page, wrapper);
return substationQualityStatisticsPOPage; return converterdetailstatisticsPOPage;
} }
@Override @Override
public String send(List<String> ids) { public String send(List<String> ids) {
List<ConverterIndexStatisticsPO> list = this.lambdaQuery().eq(ConverterIndexStatisticsPO::getId, ids).list();
List<SubstationQualityStatisticsPO> list = this.lambdaQuery().eq(SubstationQualityStatisticsPO::getId, ids).list();
if (list.size() > 100) { if (list.size() > 100) {
throw new BusinessException("一次最多上送100条数据"); throw new BusinessException("一次最多上送100条数据");
} }
List<SubstationQualityStatisticsDTO> substationQualityStatisticsDTOList = BeanUtil.copyToList(list, SubstationQualityStatisticsDTO.class); List<ConverterIndexStatisticsDTO> converterIndexStatisticsDTOS = BeanUtil.copyToList(list, ConverterIndexStatisticsDTO.class);
SendParam param = new SendParam(); SendParam param = new SendParam();
param.setStats(substationQualityStatisticsDTOList); param.setStats(converterIndexStatisticsDTOS);
String s = JSONObject.toJSONStringWithDateFormat(param, JSON.DEFFAULT_DATE_FORMAT); String s = JSONObject.toJSONStringWithDateFormat(param, JSON.DEFFAULT_DATE_FORMAT);
log.info(Thread.currentThread().getName() + "获取返回体 换流站指标统计明细数据接口数据:" + s + "开始----"); log.info(Thread.currentThread().getName() + "获取返回体 换流站指标统计明细数据接口数据:" + s + "开始----");
Map<String, String> send = GwSendUtil.send(param, GWSendEnum.SUBSTATION_MONITOR); Map<String, String> send = GwSendUtil.send(param, GWSendEnum.DETAIL_CREATE);
log.info(Thread.currentThread().getName() + "获取返回体换流站指标统计明细数据接口响应结果:" + send + "结束----"); log.info(Thread.currentThread().getName() + "获取返回体换流站指标统计明细数据接口响应结果:" + send + "结束----");
List<String> trIds = substationQualityStatisticsDTOList.stream().map(SubstationQualityStatisticsDTO::getId).distinct().collect(Collectors.toList()); List<String> trIds = converterIndexStatisticsDTOS.stream().map(ConverterIndexStatisticsDTO::getId).distinct().collect(Collectors.toList());
return returnInformation(1, trIds, send); return returnInformation(1, trIds, send);
} }

View File

@@ -13,7 +13,7 @@ import com.njcn.prepare.harmonic.service.mysql.dim.*;
import com.njcn.prepare.harmonic.service.mysql.line.PollutionService; import com.njcn.prepare.harmonic.service.mysql.line.PollutionService;
import com.njcn.prepare.harmonic.service.mysql.newalgorithm.*; import com.njcn.prepare.harmonic.service.mysql.newalgorithm.*;
import com.njcn.prepare.harmonic.service.mysql.upload.IRUploadEvaluationDataDService; import com.njcn.prepare.harmonic.service.mysql.upload.IRUploadEvaluationDataDService;
import com.njcn.prepare.harmonic.service.mysql.send.ConverterdetailstatisticsPOService; import com.njcn.prepare.harmonic.service.mysql.send.ConverterIndexStatisticsPOService;
import com.njcn.prepare.harmonic.service.mysql.send.PqTypicalSourceCreatePOService; import com.njcn.prepare.harmonic.service.mysql.send.PqTypicalSourceCreatePOService;
import com.njcn.prepare.harmonic.service.mysql.upload.IRUploadPointStatisticalDataDService; import com.njcn.prepare.harmonic.service.mysql.upload.IRUploadPointStatisticalDataDService;
import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.annotation.LiteflowComponent;
@@ -74,7 +74,7 @@ public class OrgPointExecutor extends BaseExecutor{
private final IRUploadPointStatisticalDataDService irUploadPointStatisticalDataDService; private final IRUploadPointStatisticalDataDService irUploadPointStatisticalDataDService;
private final ConverterdetailstatisticsPOService converterdetailstatisticsPOService; private final ConverterIndexStatisticsPOService converterIndexStatisticsPOService;
private final PqTypicalSourceCreatePOService pqTypicalSourceCreatePOService; private final PqTypicalSourceCreatePOService pqTypicalSourceCreatePOService;
private final IRUploadEvaluationDataDService irUploadEvaluationDataDService; private final IRUploadEvaluationDataDService irUploadEvaluationDataDService;
/** /**
@@ -628,14 +628,14 @@ public class OrgPointExecutor extends BaseExecutor{
* 2.4.1.18 接收电能质量换流站指标汇总统计数据接口 * 2.4.1.18 接收电能质量换流站指标汇总统计数据接口
* xuyang * xuyang
*/ */
@LiteflowMethod(value = LiteFlowMethodEnum.IS_ACCESS, nodeId = "converterdetailstatistics", nodeType = NodeTypeEnum.COMMON) @LiteflowMethod(value = LiteFlowMethodEnum.IS_ACCESS, nodeId = "converterIndexStatistics", nodeType = NodeTypeEnum.COMMON)
public boolean converterdetailstatisticsAccess(NodeComponent bindCmp) { public boolean converterIndexStatisticsAccess(NodeComponent bindCmp) {
return isAccess(bindCmp); return isAccess(bindCmp);
} }
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "converterdetailstatistics", nodeType = NodeTypeEnum.COMMON) @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "converterIndexStatistics", nodeType = NodeTypeEnum.COMMON)
public void converterdetailstatisticsProcess(NodeComponent bindCmp) { public void converterIndexStatisticsProcess(NodeComponent bindCmp) {
CalculatedParam<DeptGetChildrenMoreDTO> calculatedParam = bindCmp.getRequestData(); CalculatedParam<DeptGetChildrenMoreDTO> calculatedParam = bindCmp.getRequestData();
converterdetailstatisticsPOService.handlerDay(calculatedParam); converterIndexStatisticsPOService.handlerDay(calculatedParam);
} }
/** /**
*河北国网上送接口 *河北国网上送接口

View File

@@ -4,7 +4,7 @@ import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam;
import com.njcn.prepare.harmonic.service.mysql.line.PollutionService; import com.njcn.prepare.harmonic.service.mysql.line.PollutionService;
import com.njcn.prepare.harmonic.service.mysql.newalgorithm.RStatSubstationService; import com.njcn.prepare.harmonic.service.mysql.newalgorithm.RStatSubstationService;
import com.njcn.prepare.harmonic.service.mysql.upload.IRUploadSubstationStatisticalDataDService; import com.njcn.prepare.harmonic.service.mysql.upload.IRUploadSubstationStatisticalDataDService;
import com.njcn.prepare.harmonic.service.mysql.send.SubstationQualityStatisticsPOService; import com.njcn.prepare.harmonic.service.mysql.send.ConverterDetailStatisticsPOService;
import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.annotation.LiteflowMethod; import com.yomahub.liteflow.annotation.LiteflowMethod;
import com.yomahub.liteflow.core.NodeComponent; import com.yomahub.liteflow.core.NodeComponent;
@@ -27,7 +27,7 @@ public class SubStationExecutor extends BaseExecutor{
private final PollutionService pollutionService; private final PollutionService pollutionService;
private final RStatSubstationService rStatSubstationService; private final RStatSubstationService rStatSubstationService;
private final SubstationQualityStatisticsPOService substationQualityStatisticsPOService; private final ConverterDetailStatisticsPOService converterDetailStatisticsPOService;
private final IRUploadSubstationStatisticalDataDService rUploadSubstationStatisticalDataDService; private final IRUploadSubstationStatisticalDataDService rUploadSubstationStatisticalDataDService;
@@ -71,16 +71,16 @@ public class SubStationExecutor extends BaseExecutor{
* 2.4.1.19 接收电能质量换流站指标统计明细数据接口 * 2.4.1.19 接收电能质量换流站指标统计明细数据接口
* *
*/ */
@LiteflowMethod(value = LiteFlowMethodEnum.IS_ACCESS, nodeId = "substationQualityStatistics", nodeType = NodeTypeEnum.COMMON) @LiteflowMethod(value = LiteFlowMethodEnum.IS_ACCESS, nodeId = "converterDetailStatistics", nodeType = NodeTypeEnum.COMMON)
public boolean processSubstationQualityStatistics(NodeComponent bindCmp) { public boolean processConverterDetailStatisticsStatistics(NodeComponent bindCmp) {
return isAccess(bindCmp); return isAccess(bindCmp);
} }
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "substationQualityStatistics", nodeType = NodeTypeEnum.COMMON) @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "converterDetailStatistics", nodeType = NodeTypeEnum.COMMON)
public void processSubstationQualityStatisticss(NodeComponent bindCmp) { public void processConverterDetailStatisticsStatisticss(NodeComponent bindCmp) {
String tag = bindCmp.getTag(); String tag = bindCmp.getTag();
CalculatedParam<String> calculatedParam = bindCmp.getRequestData(); CalculatedParam<String> calculatedParam = bindCmp.getRequestData();
substationQualityStatisticsPOService.handleDay(calculatedParam); converterDetailStatisticsPOService.handleDay(calculatedParam);
} }

View File

@@ -1,7 +1,7 @@
package com.njcn.prepare.harmonic.mapper.mysql.send; package com.njcn.prepare.harmonic.mapper.mysql.send;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.harmonic.pojo.po.send.SubstationQualityStatisticsPO; import com.njcn.harmonic.pojo.po.send.ConverterDetailStatisticsPO;
/** /**
* *
@@ -11,5 +11,5 @@ import com.njcn.harmonic.pojo.po.send.SubstationQualityStatisticsPO;
* @author clam * @author clam
* @version V1.0.0 * @version V1.0.0
*/ */
public interface SubstationQualityStatisticsPOMapper extends BaseMapper<SubstationQualityStatisticsPO> { public interface ConverterDetailStatisticsPOMapper extends BaseMapper<ConverterDetailStatisticsPO> {
} }

View File

@@ -1,7 +1,7 @@
package com.njcn.prepare.harmonic.mapper.mysql.send; package com.njcn.prepare.harmonic.mapper.mysql.send;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.harmonic.pojo.po.send.ConverterdetailstatisticsPO; import com.njcn.harmonic.pojo.po.send.ConverterIndexStatisticsPO;
/** /**
* *
@@ -11,5 +11,5 @@ import com.njcn.harmonic.pojo.po.send.ConverterdetailstatisticsPO;
* @author clam * @author clam
* @version V1.0.0 * @version V1.0.0
*/ */
public interface ConverterdetailstatisticsPOMapper extends BaseMapper<ConverterdetailstatisticsPO> { public interface ConverterIndexStatisticsPOMapper extends BaseMapper<ConverterIndexStatisticsPO> {
} }

View File

@@ -1,40 +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.prepare.harmonic.mapper.mysql.send.ConverterdetailstatisticsPOMapper">
<resultMap id="BaseResultMap" type="com.njcn.harmonic.pojo.po.send.ConverterdetailstatisticsPO">
<!--@mbg.generated-->
<!--@Table converterdetailstatistics-->
<result column="id" jdbcType="VARCHAR" property="id" />
<result column="abnormalBusAvgRate" jdbcType="DECIMAL" property="abnormalbusavgrate" />
<result column="abnormalBusNum" jdbcType="INTEGER" property="abnormalbusnum" />
<result column="abnormalBusRate" jdbcType="DECIMAL" property="abnormalbusrate" />
<result column="abnormalConverterAvgRate" jdbcType="DECIMAL" property="abnormalConverterAvgRateabnormalconverteravgrate" />
<result column="abnormalConverterNum" jdbcType="INTEGER" property="abnormalconverternum" />
<result column="abnormalConverterRate" jdbcType="DECIMAL" property="abnormalconverterrate" />
<result column="cityId" jdbcType="VARCHAR" property="cityid" />
<result column="cityName" jdbcType="VARCHAR" property="cityname" />
<result column="monitorAlternatingBusNum" jdbcType="INTEGER" property="monitoralternatingbusnum" />
<result column="monitorAlternatingBusRate" jdbcType="DECIMAL" property="monitoralternatingbusrate" />
<result column="monitorConverterNum" jdbcType="INTEGER" property="monitorconverternum" />
<result column="monitorConverterRate" jdbcType="DECIMAL" property="monitorconverterrate" />
<result column="onlineAlternatingBusNum" jdbcType="INTEGER" property="onlinealternatingbusnum" />
<result column="onlineConverterNum" jdbcType="INTEGER" property="onlineconverternum" />
<result column="provinceName" jdbcType="VARCHAR" property="provincename" />
<result column="provinceId" jdbcType="VARCHAR" property="provinceid" />
<result column="statisticalDate" jdbcType="VARCHAR" property="statisticaldate" />
<result column="statisticalType" jdbcType="VARCHAR" property="statisticaltype" />
<result column="statisticalLevel" jdbcType="VARCHAR" property="statisticallevel" />
<result column="abnormalConverterCount" jdbcType="INTEGER" property="abnormalconvertercount" />
<result column="monitorConverterCount" jdbcType="INTEGER" property="monitorconvertercount" />
<result column="abnormalBusCount" jdbcType="INTEGER" property="abnormalbuscount" />
<result column="monitorAlternatingBusCount" jdbcType="INTEGER" property="monitoralternatingbuscount" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, abnormalBusAvgRate, abnormalBusNum, abnormalBusRate, abnormalConverterAvgRate,
abnormalConverterNum, abnormalConverterRate, cityId, cityName, monitorAlternatingBusNum,
monitorAlternatingBusRate, monitorConverterNum, monitorConverterRate, onlineAlternatingBusNum,
onlineConverterNum, provinceName, provinceId, statisticalDate, statisticalType, statisticalLevel,
abnormalConverterCount, monitorConverterCount, abnormalBusCount, monitorAlternatingBusCount
</sql>
</mapper>

View File

@@ -1,13 +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.prepare.harmonic.mapper.mysql.send.PqTypicalSourceCreatePOMapper">
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, statisticalDate, statisticalLevel, statisticalType, indexType, provinceId, provinceName,
cityId, cityName, countyId, countyName, industryType, interferenceSourceNum, averageOvDays,
flickerAvgOvRate, flickerOvNum, flickerOvRate, iAvgOvRate, iOvNum, iOvRate, inseqAvgOvRate,
inseqOvNum, inseqOvRate, monitorNum, monitoringRate, ovNum, ovRate, unbanOvNum, unbanOvRate,
vAvgOvRate, vOvNum, vOvRate, unbanAvgOvRate, ovDayCount
</sql>
</mapper>

View File

@@ -1,46 +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.prepare.harmonic.mapper.mysql.send.SubstationQualityStatisticsPOMapper">
<resultMap id="BaseResultMap" type="com.njcn.harmonic.pojo.po.send.SubstationQualityStatisticsPO">
<!--@mbg.generated-->
<!--@Table substation_quality_statistics-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="statisticalDate" jdbcType="VARCHAR" property="statisticaldate" />
<result column="statisticalType" jdbcType="VARCHAR" property="statisticaltype" />
<result column="provinceId" jdbcType="VARCHAR" property="provinceid" />
<result column="provinceName" jdbcType="VARCHAR" property="provincename" />
<result column="cityId" jdbcType="VARCHAR" property="cityid" />
<result column="cityName" jdbcType="VARCHAR" property="cityname" />
<result column="countyId" jdbcType="VARCHAR" property="countyid" />
<result column="countyName" jdbcType="VARCHAR" property="countyname" />
<result column="converterId" jdbcType="VARCHAR" property="converterid" />
<result column="converterName" jdbcType="VARCHAR" property="convertername" />
<result column="voltageLevel" jdbcType="VARCHAR" property="voltagelevel" />
<result column="busId" jdbcType="VARCHAR" property="busid" />
<result column="busName" jdbcType="VARCHAR" property="busname" />
<result column="busVoltageLevel" jdbcType="VARCHAR" property="busvoltagelevel" />
<result column="monitorId" jdbcType="VARCHAR" property="monitorid" />
<result column="effectiveMonitorNum" jdbcType="INTEGER" property="effectivemonitornum" />
<result column="harmvOvDay" jdbcType="INTEGER" property="harmvovday" />
<result column="monthsCount" jdbcType="INTEGER" property="monthscount" />
<result column="monthOvDays" jdbcType="DECIMAL" property="monthovdays" />
<result column="oddVoltLimit" jdbcType="DECIMAL" property="oddvoltlimit" />
<result column="totalOvDays" jdbcType="INTEGER" property="totalovdays" />
<result column="v11" jdbcType="DECIMAL" property="v11" />
<result column="v13" jdbcType="DECIMAL" property="v13" />
<result column="v23" jdbcType="DECIMAL" property="v23" />
<result column="v25" jdbcType="DECIMAL" property="v25" />
<result column="v3" jdbcType="DECIMAL" property="v3" />
<result column="v5" jdbcType="DECIMAL" property="v5" />
<result column="v7" jdbcType="DECIMAL" property="v7" />
<result column="vthd" jdbcType="DECIMAL" property="vthd" />
<result column="vthdLimit" jdbcType="DECIMAL" property="vthdlimit" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, statisticalDate, statisticalType, provinceId, provinceName, cityId, cityName,
countyId, countyName, converterId, converterName, voltageLevel, busId, busName, busVoltageLevel,
monitorId, effectiveMonitorNum, harmvOvDay, monthsCount, monthOvDays, oddVoltLimit,
totalOvDays, v11, v13, v23, v25, v3, v5, v7, vthd, vthdLimit
</sql>
</mapper>

View File

@@ -1,6 +1,6 @@
package com.njcn.prepare.harmonic.service.mysql.send; package com.njcn.prepare.harmonic.service.mysql.send;
import com.njcn.harmonic.pojo.po.send.SubstationQualityStatisticsPO; import com.njcn.harmonic.pojo.po.send.ConverterDetailStatisticsPO;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam; import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam;
@@ -12,7 +12,7 @@ import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam;
* @author clam * @author clam
* @version V1.0.0 * @version V1.0.0
*/ */
public interface SubstationQualityStatisticsPOService extends IService<SubstationQualityStatisticsPO>{ public interface ConverterDetailStatisticsPOService extends IService<ConverterDetailStatisticsPO>{
void handleDay(CalculatedParam<String> calculatedParam); void handleDay(CalculatedParam<String> calculatedParam);

View File

@@ -1,7 +1,7 @@
package com.njcn.prepare.harmonic.service.mysql.send; package com.njcn.prepare.harmonic.service.mysql.send;
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO; import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
import com.njcn.harmonic.pojo.po.send.ConverterdetailstatisticsPO; import com.njcn.harmonic.pojo.po.send.ConverterIndexStatisticsPO;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam; import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam;
@@ -13,7 +13,7 @@ import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam;
* @author clam * @author clam
* @version V1.0.0 * @version V1.0.0
*/ */
public interface ConverterdetailstatisticsPOService extends IService<ConverterdetailstatisticsPO>{ public interface ConverterIndexStatisticsPOService extends IService<ConverterIndexStatisticsPO>{
void handlerDay(CalculatedParam<DeptGetChildrenMoreDTO> calculatedParam); void handlerDay(CalculatedParam<DeptGetChildrenMoreDTO> calculatedParam);

View File

@@ -12,15 +12,15 @@ import com.njcn.device.pms.pojo.param.PmsBaseParam;
import com.njcn.device.pms.pojo.po.Monitor; import com.njcn.device.pms.pojo.po.Monitor;
import com.njcn.device.pms.pojo.po.StatationStat; import com.njcn.device.pms.pojo.po.StatationStat;
import com.njcn.harmonic.pojo.po.day.RStatDataVDPO; import com.njcn.harmonic.pojo.po.day.RStatDataVDPO;
import com.njcn.harmonic.pojo.po.send.SubstationQualityStatisticsPO; import com.njcn.harmonic.pojo.po.send.ConverterDetailStatisticsPO;
import com.njcn.prepare.harmonic.mapper.mysql.send.SubstationQualityStatisticsPOMapper; import com.njcn.prepare.harmonic.mapper.mysql.send.ConverterDetailStatisticsPOMapper;
import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam; import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam;
import com.njcn.prepare.harmonic.pojo.mysql.ROperatingMonitorDPO; import com.njcn.prepare.harmonic.pojo.mysql.ROperatingMonitorDPO;
import com.njcn.prepare.harmonic.pojo.po.RStatSubstationMPO; import com.njcn.prepare.harmonic.pojo.po.RStatSubstationMPO;
import com.njcn.prepare.harmonic.service.mysql.day.IRStatDataVDService; import com.njcn.prepare.harmonic.service.mysql.day.IRStatDataVDService;
import com.njcn.prepare.harmonic.service.mysql.line.ROperatingMonitorService; import com.njcn.prepare.harmonic.service.mysql.line.ROperatingMonitorService;
import com.njcn.prepare.harmonic.service.mysql.newalgorithm.RStatSubstationMPOService; import com.njcn.prepare.harmonic.service.mysql.newalgorithm.RStatSubstationMPOService;
import com.njcn.prepare.harmonic.service.mysql.send.SubstationQualityStatisticsPOService; import com.njcn.prepare.harmonic.service.mysql.send.ConverterDetailStatisticsPOService;
import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.enums.DicDataEnum; import com.njcn.system.enums.DicDataEnum;
import com.njcn.system.enums.DicDataTypeEnum; import com.njcn.system.enums.DicDataTypeEnum;
@@ -50,7 +50,7 @@ import java.util.stream.Collectors;
*/ */
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class SubstationQualityStatisticsPOServiceImpl extends ServiceImpl<SubstationQualityStatisticsPOMapper, SubstationQualityStatisticsPO> implements SubstationQualityStatisticsPOService{ public class ConverterDetailStatisticsPOServiceImpl extends ServiceImpl<ConverterDetailStatisticsPOMapper, ConverterDetailStatisticsPO> implements ConverterDetailStatisticsPOService {
private final MonitorClient monitorClient; private final MonitorClient monitorClient;
private final DeptFeignClient deptFeignClient; private final DeptFeignClient deptFeignClient;
@@ -65,7 +65,7 @@ public class SubstationQualityStatisticsPOServiceImpl extends ServiceImpl<Substa
public void handleDay(CalculatedParam<String> calculatedParam) { public void handleDay(CalculatedParam<String> calculatedParam) {
List<SubstationQualityStatisticsPO> substationQualityStatisticsPOList = new ArrayList<>(); List<ConverterDetailStatisticsPO> converterDetailStatisticsPOList = new ArrayList<>();
List<Monitor> monitorList = monitorClient.getMonitorList(new ArrayList<>()).getData(); List<Monitor> monitorList = monitorClient.getMonitorList(new ArrayList<>()).getData();
// List<GeneratrixAndPowerStationDTO> pmsGeneratrixDTOList = pmsGeneratrixClient.getGeneratrixAndPowerStationInfo(new PmsGeneratrixParam()).getData(); // List<GeneratrixAndPowerStationDTO> pmsGeneratrixDTOList = pmsGeneratrixClient.getGeneratrixAndPowerStationInfo(new PmsGeneratrixParam()).getData();
List<StatationStat> stationList = statationStatClient.getstatationStatList(new PmsBaseParam()).getData(); List<StatationStat> stationList = statationStatClient.getstatationStatList(new PmsBaseParam()).getData();
@@ -87,12 +87,12 @@ public class SubstationQualityStatisticsPOServiceImpl extends ServiceImpl<Substa
for (StatationStat temp : stationList) { for (StatationStat temp : stationList) {
SubstationQualityStatisticsPO substationQualityStatisticsPO = new SubstationQualityStatisticsPO(); ConverterDetailStatisticsPO converterDetailStatisticsPO = new ConverterDetailStatisticsPO();
// List<GeneratrixAndPowerStationDTO> tempGeneratrixDTOList = pmsGeneratrixDTOList.stream().filter(pmsGeneratrixDTO -> Objects.equals(pmsGeneratrixDTO.getPowerId(), temp.getPowerId())).collect(Collectors.toList()); // List<GeneratrixAndPowerStationDTO> tempGeneratrixDTOList = pmsGeneratrixDTOList.stream().filter(pmsGeneratrixDTO -> Objects.equals(pmsGeneratrixDTO.getPowerId(), temp.getPowerId())).collect(Collectors.toList());
List<Monitor> tempMonitorList = monitorList.stream().filter(monitor -> Objects.equals(monitor.getPowerrId(), temp.getPowerId())).collect(Collectors.toList()); List<Monitor> tempMonitorList = monitorList.stream().filter(monitor -> Objects.equals(monitor.getPowerrId(), temp.getPowerId())).collect(Collectors.toList());
List<String> monitorIdList = tempMonitorList.stream().map(Monitor::getId).collect(Collectors.toList()); List<String> monitorIdList = tempMonitorList.stream().map(Monitor::getId).collect(Collectors.toList());
substationQualityStatisticsPO.setStatisticalDate(calculatedParam.getDataDate()); converterDetailStatisticsPO.setStatisticalDate(calculatedParam.getDataDate());
substationQualityStatisticsPO.setStatisticalType("03"); converterDetailStatisticsPO.setStatisticalType("03");
if (mapCode.containsKey(temp.getOrgId())) { if (mapCode.containsKey(temp.getOrgId())) {
PvTerminalTreeVO pvTerminalTreeVO = mapCode.get(temp.getOrgId()); PvTerminalTreeVO pvTerminalTreeVO = mapCode.get(temp.getOrgId());
@@ -103,42 +103,42 @@ public class SubstationQualityStatisticsPOServiceImpl extends ServiceImpl<Substa
if (i == 2) { if (i == 2) {
if (mapList.containsKey(split[i])) { if (mapList.containsKey(split[i])) {
pvTerminalTreeVO = mapList.get(split[i]); pvTerminalTreeVO = mapList.get(split[i]);
substationQualityStatisticsPO.setProvinceName(pvTerminalTreeVO.getName()); converterDetailStatisticsPO.setProvinceName(pvTerminalTreeVO.getName());
substationQualityStatisticsPO.setProvinceId(pvTerminalTreeVO.getCode()); converterDetailStatisticsPO.setProvinceId(pvTerminalTreeVO.getCode());
} }
} }
// //
if (i == 3) { if (i == 3) {
if (mapList.containsKey(split[i])) { if (mapList.containsKey(split[i])) {
pvTerminalTreeVO = mapList.get(split[i]); pvTerminalTreeVO = mapList.get(split[i]);
substationQualityStatisticsPO.setCityName(pvTerminalTreeVO.getName()); converterDetailStatisticsPO.setCityName(pvTerminalTreeVO.getName());
substationQualityStatisticsPO.setCityId(pvTerminalTreeVO.getCode()); converterDetailStatisticsPO.setCityId(pvTerminalTreeVO.getCode());
} }
} }
// //
if (i == 4) { if (i == 4) {
if (mapList.containsKey(split[i])) { if (mapList.containsKey(split[i])) {
pvTerminalTreeVO = mapList.get(split[i]); pvTerminalTreeVO = mapList.get(split[i]);
substationQualityStatisticsPO.setCountyName(pvTerminalTreeVO.getName()); converterDetailStatisticsPO.setCountyName(pvTerminalTreeVO.getName());
substationQualityStatisticsPO.setCountyId(pvTerminalTreeVO.getCode()); converterDetailStatisticsPO.setCountyId(pvTerminalTreeVO.getCode());
} }
} }
} }
} }
substationQualityStatisticsPO.setConverterId(temp.getPowerId()); converterDetailStatisticsPO.setConverterId(temp.getPowerId());
substationQualityStatisticsPO.setConverterName(temp.getPowerName()); converterDetailStatisticsPO.setConverterName(temp.getPowerName());
substationQualityStatisticsPO.setId(temp.getPowerId()+"-"+calculatedParam.getDataDate()); converterDetailStatisticsPO.setId(temp.getPowerId()+"-"+calculatedParam.getDataDate());
//电站等级 //电站等级
if (mapVoltage.containsKey(temp.getVoltageLevel())) { if (mapVoltage.containsKey(temp.getVoltageLevel())) {
substationQualityStatisticsPO.setVoltageLevel(String.format("%02d", mapVoltage.get(temp.getVoltageLevel()).getAlgoDescribe())); converterDetailStatisticsPO.setVoltageLevel(String.format("%02d", mapVoltage.get(temp.getVoltageLevel()).getAlgoDescribe()));
} }
substationQualityStatisticsPO.setBusId(""); converterDetailStatisticsPO.setBusId("");
substationQualityStatisticsPO.setBusName(""); converterDetailStatisticsPO.setBusName("");
substationQualityStatisticsPO.setBusVoltageLevel(""); converterDetailStatisticsPO.setBusVoltageLevel("");
substationQualityStatisticsPO.setMonitorId(""); converterDetailStatisticsPO.setMonitorId("");
//站内有效监测点数量 //站内有效监测点数量
Integer effectiveMonitorNum = 0; Integer effectiveMonitorNum = 0;
@@ -152,16 +152,16 @@ public class SubstationQualityStatisticsPOServiceImpl extends ServiceImpl<Substa
} }
substationQualityStatisticsPO.setEffectiveMonitorNum(effectiveMonitorNum); converterDetailStatisticsPO.setEffectiveMonitorNum(effectiveMonitorNum);
//换流站电压等级500kv奇次谐波电压限值为1.6压总谐波畸变率95%概率值限值为2.0 //换流站电压等级500kv奇次谐波电压限值为1.6压总谐波畸变率95%概率值限值为2.0
substationQualityStatisticsPO.setOddVoltLimit(BigDecimal.valueOf(1.6).setScale(1,BigDecimal.ROUND_HALF_UP)); converterDetailStatisticsPO.setOddVoltLimit(BigDecimal.valueOf(1.6).setScale(1,BigDecimal.ROUND_HALF_UP));
substationQualityStatisticsPO.setVthdLimit(BigDecimal.valueOf(2.0).setScale(1,BigDecimal.ROUND_HALF_UP)); converterDetailStatisticsPO.setVthdLimit(BigDecimal.valueOf(2.0).setScale(1,BigDecimal.ROUND_HALF_UP));
RStatSubstationMPO one = rStatSubstationMPOService.lambdaQuery().eq(RStatSubstationMPO::getSubstationId, temp.getPowerId()).eq(RStatSubstationMPO::getDataDate, localDate).one(); RStatSubstationMPO one = rStatSubstationMPOService.lambdaQuery().eq(RStatSubstationMPO::getSubstationId, temp.getPowerId()).eq(RStatSubstationMPO::getDataDate, localDate).one();
if (!Objects.isNull(one)){ if (!Objects.isNull(one)){
substationQualityStatisticsPO.setHarmvOvDay(one.getVOverDay().intValue()); converterDetailStatisticsPO.setHarmvOvDay(one.getVOverDay().intValue());
substationQualityStatisticsPO.setMonthsCount(localDate.getMonthValue()); converterDetailStatisticsPO.setMonthsCount(localDate.getMonthValue());
substationQualityStatisticsPO.setMonthOvDays(BigDecimal.valueOf(one.getVOverDay())); converterDetailStatisticsPO.setMonthOvDays(BigDecimal.valueOf(one.getVOverDay()));
substationQualityStatisticsPO.setTotalOvDays(one.getHarmonicOverDay().intValue()); converterDetailStatisticsPO.setTotalOvDays(one.getHarmonicOverDay().intValue());
} }
if (!CollectionUtils.isEmpty(monitorIdList)) { if (!CollectionUtils.isEmpty(monitorIdList)) {
List<RStatDataVDPO> cp95 = IRStatDataVDService.lambdaQuery(). List<RStatDataVDPO> cp95 = IRStatDataVDService.lambdaQuery().
@@ -171,38 +171,38 @@ public class SubstationQualityStatisticsPOServiceImpl extends ServiceImpl<Substa
if (!CollectionUtils.isEmpty(cp95)) { if (!CollectionUtils.isEmpty(cp95)) {
double vthd = cp95.stream().mapToDouble(RStatDataVDPO::getVThd).average().getAsDouble(); double vthd = cp95.stream().mapToDouble(RStatDataVDPO::getVThd).average().getAsDouble();
substationQualityStatisticsPO.setVthd(BigDecimal.valueOf(vthd).setScale(1,BigDecimal.ROUND_HALF_UP)); converterDetailStatisticsPO.setVthd(BigDecimal.valueOf(vthd).setScale(1,BigDecimal.ROUND_HALF_UP));
double v3 = cp95.stream().mapToDouble(RStatDataVDPO::getVThd).average().getAsDouble(); double v3 = cp95.stream().mapToDouble(RStatDataVDPO::getVThd).average().getAsDouble();
substationQualityStatisticsPO.setV3(BigDecimal.valueOf(v3).setScale(1,BigDecimal.ROUND_HALF_UP)); converterDetailStatisticsPO.setV3(BigDecimal.valueOf(v3).setScale(1,BigDecimal.ROUND_HALF_UP));
double v5 = cp95.stream().mapToDouble(RStatDataVDPO::getV5).average().getAsDouble(); double v5 = cp95.stream().mapToDouble(RStatDataVDPO::getV5).average().getAsDouble();
substationQualityStatisticsPO.setV5(BigDecimal.valueOf(v5).setScale(1,BigDecimal.ROUND_HALF_UP)); converterDetailStatisticsPO.setV5(BigDecimal.valueOf(v5).setScale(1,BigDecimal.ROUND_HALF_UP));
double v7 = cp95.stream().mapToDouble(RStatDataVDPO::getV7).average().getAsDouble(); double v7 = cp95.stream().mapToDouble(RStatDataVDPO::getV7).average().getAsDouble();
substationQualityStatisticsPO.setV7(BigDecimal.valueOf(v7).setScale(1,BigDecimal.ROUND_HALF_UP)); converterDetailStatisticsPO.setV7(BigDecimal.valueOf(v7).setScale(1,BigDecimal.ROUND_HALF_UP));
double v11 = cp95.stream().mapToDouble(RStatDataVDPO::getV11).average().getAsDouble(); double v11 = cp95.stream().mapToDouble(RStatDataVDPO::getV11).average().getAsDouble();
substationQualityStatisticsPO.setV11(BigDecimal.valueOf(v11).setScale(1,BigDecimal.ROUND_HALF_UP)); converterDetailStatisticsPO.setV11(BigDecimal.valueOf(v11).setScale(1,BigDecimal.ROUND_HALF_UP));
double v13 = cp95.stream().mapToDouble(RStatDataVDPO::getV13).average().getAsDouble(); double v13 = cp95.stream().mapToDouble(RStatDataVDPO::getV13).average().getAsDouble();
substationQualityStatisticsPO.setV13(BigDecimal.valueOf(v13).setScale(1,BigDecimal.ROUND_HALF_UP)); converterDetailStatisticsPO.setV13(BigDecimal.valueOf(v13).setScale(1,BigDecimal.ROUND_HALF_UP));
double v23 = cp95.stream().mapToDouble(RStatDataVDPO::getV23).average().getAsDouble(); double v23 = cp95.stream().mapToDouble(RStatDataVDPO::getV23).average().getAsDouble();
substationQualityStatisticsPO.setV23(BigDecimal.valueOf(v23).setScale(1,BigDecimal.ROUND_HALF_UP)); converterDetailStatisticsPO.setV23(BigDecimal.valueOf(v23).setScale(1,BigDecimal.ROUND_HALF_UP));
double v25 = cp95.stream().mapToDouble(RStatDataVDPO::getV25).average().getAsDouble(); double v25 = cp95.stream().mapToDouble(RStatDataVDPO::getV25).average().getAsDouble();
substationQualityStatisticsPO.setV25(BigDecimal.valueOf(v25).setScale(1,BigDecimal.ROUND_HALF_UP)); converterDetailStatisticsPO.setV25(BigDecimal.valueOf(v25).setScale(1,BigDecimal.ROUND_HALF_UP));
} }
} }
substationQualityStatisticsPOList.add(substationQualityStatisticsPO); converterDetailStatisticsPOList.add(converterDetailStatisticsPO);
} }
if(!CollectionUtils.isEmpty(substationQualityStatisticsPOList)){ if(!CollectionUtils.isEmpty(converterDetailStatisticsPOList)){
this.saveOrUpdateBatch(substationQualityStatisticsPOList); this.saveOrUpdateBatch(converterDetailStatisticsPOList);
} }
} }
} }

View File

@@ -16,14 +16,14 @@ import com.njcn.device.pms.pojo.po.Monitor;
import com.njcn.device.pms.pojo.po.StatationStat; import com.njcn.device.pms.pojo.po.StatationStat;
import com.njcn.harmonic.pojo.po.RMpEventDetailDPO; import com.njcn.harmonic.pojo.po.RMpEventDetailDPO;
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO; import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
import com.njcn.harmonic.pojo.po.send.ConverterdetailstatisticsPO; import com.njcn.harmonic.pojo.po.send.ConverterIndexStatisticsPO;
import com.njcn.prepare.harmonic.mapper.mysql.send.ConverterdetailstatisticsPOMapper; import com.njcn.prepare.harmonic.mapper.mysql.send.ConverterIndexStatisticsPOMapper;
import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam; import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam;
import com.njcn.prepare.harmonic.pojo.mysql.ROperatingMonitorDPO; import com.njcn.prepare.harmonic.pojo.mysql.ROperatingMonitorDPO;
import com.njcn.prepare.harmonic.service.mysql.day.IRStatLimitRateDService; import com.njcn.prepare.harmonic.service.mysql.day.IRStatLimitRateDService;
import com.njcn.prepare.harmonic.service.mysql.line.RMpEventDetailDService; import com.njcn.prepare.harmonic.service.mysql.line.RMpEventDetailDService;
import com.njcn.prepare.harmonic.service.mysql.line.ROperatingMonitorService; import com.njcn.prepare.harmonic.service.mysql.line.ROperatingMonitorService;
import com.njcn.prepare.harmonic.service.mysql.send.ConverterdetailstatisticsPOService; import com.njcn.prepare.harmonic.service.mysql.send.ConverterIndexStatisticsPOService;
import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.enums.DicDataEnum; import com.njcn.system.enums.DicDataEnum;
import com.njcn.system.enums.DicDataTypeEnum; import com.njcn.system.enums.DicDataTypeEnum;
@@ -54,7 +54,7 @@ import java.util.stream.Collectors;
*/ */
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class ConverterdetailstatisticsPOServiceImpl extends ServiceImpl<ConverterdetailstatisticsPOMapper, ConverterdetailstatisticsPO> implements ConverterdetailstatisticsPOService{ public class ConverterIndexStatisticsPOServiceImpl extends ServiceImpl<ConverterIndexStatisticsPOMapper, ConverterIndexStatisticsPO> implements ConverterIndexStatisticsPOService {
private final MonitorClient monitorClient; private final MonitorClient monitorClient;
@@ -69,7 +69,7 @@ public class ConverterdetailstatisticsPOServiceImpl extends ServiceImpl<Converte
@Override @Override
public void handlerDay(CalculatedParam<DeptGetChildrenMoreDTO> calculatedParam) { public void handlerDay(CalculatedParam<DeptGetChildrenMoreDTO> calculatedParam) {
List<ConverterdetailstatisticsPO> converterdetailstatisticsPOList = new ArrayList<>(); List<ConverterIndexStatisticsPO> converterIndexStatisticsPOList = new ArrayList<>();
LocalDate localDate = LocalDateTimeUtil.parseDate(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN); LocalDate localDate = LocalDateTimeUtil.parseDate(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN);
@@ -86,9 +86,9 @@ public class ConverterdetailstatisticsPOServiceImpl extends ServiceImpl<Converte
for (DeptGetChildrenMoreDTO deptGetChildrenMoreDTO : calculatedParam.getIdList()) { for (DeptGetChildrenMoreDTO deptGetChildrenMoreDTO : calculatedParam.getIdList()) {
ConverterdetailstatisticsPO converterdetailstatisticsPO = new ConverterdetailstatisticsPO(); ConverterIndexStatisticsPO converterIndexStatisticsPO = new ConverterIndexStatisticsPO();
converterdetailstatisticsPO.setStatisticalDate(calculatedParam.getDataDate()); converterIndexStatisticsPO.setStatisticalDate(calculatedParam.getDataDate());
converterdetailstatisticsPO.setStatisticalType("03"); converterIndexStatisticsPO.setStatisticalType("03");
if (mapCode.containsKey(deptGetChildrenMoreDTO.getUnitId())) { if (mapCode.containsKey(deptGetChildrenMoreDTO.getUnitId())) {
PvTerminalTreeVO pvTerminalTreeVO = mapCode.get(deptGetChildrenMoreDTO.getUnitId()); PvTerminalTreeVO pvTerminalTreeVO = mapCode.get(deptGetChildrenMoreDTO.getUnitId());
@@ -102,24 +102,24 @@ public class ConverterdetailstatisticsPOServiceImpl extends ServiceImpl<Converte
if (i == 2) { if (i == 2) {
if (mapList.containsKey(split[i])) { if (mapList.containsKey(split[i])) {
pvTerminalTreeVO = mapList.get(split[i]); pvTerminalTreeVO = mapList.get(split[i]);
converterdetailstatisticsPO.setProvinceName(pvTerminalTreeVO.getName()); converterIndexStatisticsPO.setProvinceName(pvTerminalTreeVO.getName());
converterdetailstatisticsPO.setProvinceId(pvTerminalTreeVO.getCode()); converterIndexStatisticsPO.setProvinceId(pvTerminalTreeVO.getCode());
converterdetailstatisticsPO.setStatisticalLevel("3"); converterIndexStatisticsPO.setStatisticalLevel("3");
} }
} }
// //
if (i == 3) { if (i == 3) {
if (mapList.containsKey(split[i])) { if (mapList.containsKey(split[i])) {
pvTerminalTreeVO = mapList.get(split[i]); pvTerminalTreeVO = mapList.get(split[i]);
converterdetailstatisticsPO.setCityName(pvTerminalTreeVO.getName()); converterIndexStatisticsPO.setCityName(pvTerminalTreeVO.getName());
converterdetailstatisticsPO.setCityId(pvTerminalTreeVO.getCode()); converterIndexStatisticsPO.setCityId(pvTerminalTreeVO.getCode());
converterdetailstatisticsPO.setStatisticalLevel("4"); converterIndexStatisticsPO.setStatisticalLevel("4");
} }
} }
} }
} }
converterdetailstatisticsPO.setId(converterdetailstatisticsPO.getCityId()+"-"+calculatedParam.getDataDate()); converterIndexStatisticsPO.setId(converterIndexStatisticsPO.getCityId()+"-"+calculatedParam.getDataDate());
if (!CollectionUtils.isEmpty(deptGetChildrenMoreDTO.getLineBaseList())) { if (!CollectionUtils.isEmpty(deptGetChildrenMoreDTO.getLineBaseList())) {
List<LineDevGetDTO> lineBaseList = deptGetChildrenMoreDTO.getLineBaseList(); List<LineDevGetDTO> lineBaseList = deptGetChildrenMoreDTO.getLineBaseList();
@@ -134,8 +134,8 @@ public class ConverterdetailstatisticsPOServiceImpl extends ServiceImpl<Converte
List<PmsGeneratrixDTO> data = pmsGeneratrixClient.getGeneratrixInfo(pmsGeneratrixParam).getData(); List<PmsGeneratrixDTO> data = pmsGeneratrixClient.getGeneratrixInfo(pmsGeneratrixParam).getData();
List<String> exchangelineIds = data.stream().filter(temp -> exchangeList.contains(temp.getGeneratrixVoltageLevel())). List<String> exchangelineIds = data.stream().filter(temp -> exchangeList.contains(temp.getGeneratrixVoltageLevel())).
map(PmsGeneratrixDTO::getGeneratrixId).collect(Collectors.toList()); map(PmsGeneratrixDTO::getGeneratrixId).collect(Collectors.toList());
converterdetailstatisticsPO.setOnlineAlternatingBusNum(exchangelineIds.size()); converterIndexStatisticsPO.setOnlineAlternatingBusNum(exchangelineIds.size());
converterdetailstatisticsPO.setOnlineConverterNum(powerrIds.size()); converterIndexStatisticsPO.setOnlineConverterNum(powerrIds.size());
//监测监测点 //监测监测点
List<ROperatingMonitorDPO> list = new ArrayList<>(); List<ROperatingMonitorDPO> list = new ArrayList<>();
if (!CollectionUtils.isEmpty(tempIds)) { if (!CollectionUtils.isEmpty(tempIds)) {
@@ -156,10 +156,10 @@ public class ConverterdetailstatisticsPOServiceImpl extends ServiceImpl<Converte
List<String> supervisexchangelineIds = data.stream().filter(temp -> supervisgeneratrixIds.contains(temp.getGeneratrixVoltageLevel())). List<String> supervisexchangelineIds = data.stream().filter(temp -> supervisgeneratrixIds.contains(temp.getGeneratrixVoltageLevel())).
map(PmsGeneratrixDTO::getGeneratrixId).collect(Collectors.toList()); map(PmsGeneratrixDTO::getGeneratrixId).collect(Collectors.toList());
converterdetailstatisticsPO.setMonitorAlternatingBusCount(supervisexchangelineIds.size()); converterIndexStatisticsPO.setMonitorAlternatingBusCount(supervisexchangelineIds.size());
converterdetailstatisticsPO.setMonitorConverterCount(supervispowerrIds.size()); converterIndexStatisticsPO.setMonitorConverterCount(supervispowerrIds.size());
converterdetailstatisticsPO.setMonitorAlternatingBusNum(supervisexchangelineIds.size()); converterIndexStatisticsPO.setMonitorAlternatingBusNum(supervisexchangelineIds.size());
converterdetailstatisticsPO.setMonitorConverterNum(supervispowerrIds.size()); converterIndexStatisticsPO.setMonitorConverterNum(supervispowerrIds.size());
//发生暂态稳态的监测点集合 //发生暂态稳态的监测点集合
List<String> abnormallines; List<String> abnormallines;
if (!CollectionUtils.isEmpty(tempIds)) { if (!CollectionUtils.isEmpty(tempIds)) {
@@ -250,25 +250,25 @@ public class ConverterdetailstatisticsPOServiceImpl extends ServiceImpl<Converte
List<String> abnormalpowerrIds = supervisLines.stream().map(Monitor::getPowerrId).distinct().collect(Collectors.toList()); List<String> abnormalpowerrIds = supervisLines.stream().map(Monitor::getPowerrId).distinct().collect(Collectors.toList());
List<String> abnormalgeneratrixIds = supervisLines.stream().map(Monitor::getLineId).distinct().collect(Collectors.toList()); List<String> abnormalgeneratrixIds = supervisLines.stream().map(Monitor::getLineId).distinct().collect(Collectors.toList());
converterdetailstatisticsPO.setAbnormalBusNum(abnormalgeneratrixIds.size()); converterIndexStatisticsPO.setAbnormalBusNum(abnormalgeneratrixIds.size());
converterdetailstatisticsPO.setAbnormalBusCount(abnormalgeneratrixIds.size()); converterIndexStatisticsPO.setAbnormalBusCount(abnormalgeneratrixIds.size());
converterdetailstatisticsPO.setAbnormalConverterCount(abnormalpowerrIds.size()); converterIndexStatisticsPO.setAbnormalConverterCount(abnormalpowerrIds.size());
converterdetailstatisticsPO.setAbnormalConverterNum(abnormalpowerrIds.size()); converterIndexStatisticsPO.setAbnormalConverterNum(abnormalpowerrIds.size());
converterdetailstatisticsPO.setAbnormalBusRate(divideAndRound(converterdetailstatisticsPO.getAbnormalBusNum(),generatrixIds.size())); converterIndexStatisticsPO.setAbnormalBusRate(divideAndRound(converterIndexStatisticsPO.getAbnormalBusNum(),generatrixIds.size()));
converterdetailstatisticsPO.setAbnormalBusAvgRate(divideAndRound(converterdetailstatisticsPO.getAbnormalBusNum(),generatrixIds.size())); converterIndexStatisticsPO.setAbnormalBusAvgRate(divideAndRound(converterIndexStatisticsPO.getAbnormalBusNum(),generatrixIds.size()));
converterdetailstatisticsPO.setAbnormalConverterRate(divideAndRound(converterdetailstatisticsPO.getAbnormalConverterNum(),powerrIds.size())); converterIndexStatisticsPO.setAbnormalConverterRate(divideAndRound(converterIndexStatisticsPO.getAbnormalConverterNum(),powerrIds.size()));
converterdetailstatisticsPO.setAbnormalConverterAvgRate(divideAndRound(converterdetailstatisticsPO.getAbnormalConverterNum(),powerrIds.size())); converterIndexStatisticsPO.setAbnormalConverterAvgRate(divideAndRound(converterIndexStatisticsPO.getAbnormalConverterNum(),powerrIds.size()));
converterdetailstatisticsPO.setMonitorConverterRate(divideAndRound(converterdetailstatisticsPO.getMonitorConverterNum(),powerrIds.size())); converterIndexStatisticsPO.setMonitorConverterRate(divideAndRound(converterIndexStatisticsPO.getMonitorConverterNum(),powerrIds.size()));
converterdetailstatisticsPO.setMonitorAlternatingBusRate(divideAndRound(converterdetailstatisticsPO.getMonitorAlternatingBusNum(),generatrixIds.size())); converterIndexStatisticsPO.setMonitorAlternatingBusRate(divideAndRound(converterIndexStatisticsPO.getMonitorAlternatingBusNum(),generatrixIds.size()));
} }
converterdetailstatisticsPOList.add(converterdetailstatisticsPO); converterIndexStatisticsPOList.add(converterIndexStatisticsPO);
} }
if(!CollectionUtils.isEmpty(converterdetailstatisticsPOList)){ if(!CollectionUtils.isEmpty(converterIndexStatisticsPOList)){
this.saveOrUpdateBatch(converterdetailstatisticsPOList); this.saveOrUpdateBatch(converterIndexStatisticsPOList);
} }
} }
/** /**