算法提交

This commit is contained in:
hzj
2023-12-07 13:40:54 +08:00
parent 2704188f75
commit 79e01bbc82
12 changed files with 399 additions and 12 deletions

View File

@@ -0,0 +1,69 @@
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 ConverterDetailStatisticsDTO {
/*主键 是否必填:是*/
private String id;
/*发生超标或暂态母线日均占比(% 是否必填:否*/
private BigDecimal abnormalBusAvgRate;
/*发生超标或暂态母线数量(条) 是否必填:是*/
private Integer abnormalBusNum;
/*发生超标或暂态母线占比(% 是否必填:否*/
private BigDecimal abnormalBusRate;
/*发生超标或暂态换流站日均占比(% 是否必填:否*/
private BigDecimal abnormalConverterAvgRate;
/*发生超标或暂态换流站数量(条) 是否必填:否*/
private Integer abnormalConverterNum;
/*发生超标或暂态换流站占比(% 是否必填:否*/
private BigDecimal abnormalConverterRate;
/*市级单位id 是否必填:是*/
private String cityId;
/*市级单位名称 是否必填:否*/
private String cityName;
/*监测交流母线数量(条) 是否必填:否*/
private Integer monitorAlternatingBusNum;
/*交流母线监测率(% 是否必填:否*/
private BigDecimal monitorAlternatingBusRate;
/*监测换流站数量(座) 是否必填:是*/
private Integer monitorConverterNum;
/*换流站监测率(% 是否必填:*/
private BigDecimal monitorConverterRate;
/*在运交流母线数量(条) 是否必填:是*/
private Integer onlineAlternatingBusNum;
/*在运换流站数量(座) 是否必填:是*/
private Integer onlineConverterNum;
/*省级单位名称 是否必填:否*/
private String provinceName;
/*省级单位id 是否必填:是*/
private String provinceId;
/*统计日期 是否必填:是*/
private String statisticalDate;
/*统计类型 是否必填:是*/
private String statisticalType;
/*统计层级 是否必填:是*/
private String statisticalLevel;
/*累计发生超标或暂态换流站数量(座) 是否必填:否*/
private Integer abnormalConverterCount;
/*累计监测换流站数量(座) 是否必填:否*/
private Integer monitorConverterCount;
/*累计发生超标或暂态母线数量(座) 是否必填:否*/
private Integer abnormalBusCount;
/*累计监测交流母线数量(座) 是否必填:否*/
private Integer monitorAlternatingBusCount;
}

View File

@@ -0,0 +1,89 @@
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;
/*母线id 是否必填:否*/
private String busId;
/*母线名称 是否必填:否*/
private String busName;
/*母线电压等级 是否必填:否*/
private String busVoltageLevel;
/*监测点id 是否必填:否*/
private String monitorId;
/*站内有效监测点数量(个) 是否必填:是*/
private Integer effectiveMonitorNum;
/*月均超标天数 是否必填:否*/
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;
/*电压等级 是否必填:是*/
private String voltageLevel;
/*电压总谐波畸变率95%概率值统计值(% 是否必填:否*/
private BigDecimal vthd;
/*电压总谐波畸变率95%概率值限值(% 是否必填:是*/
private BigDecimal vthdLimit;
/*谐波电压超标天数 是否必填:否*/
private Integer harmvOvDay;
/*当年累计月数 是否必填:否*/
private Integer monthsCount;
}

View File

@@ -7,7 +7,7 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.time.LocalDate;
/**
*
@@ -26,7 +26,6 @@ import java.util.Date;
@TableName(value = "r_operating_index_d")
@AllArgsConstructor
@NoArgsConstructor
@Deprecated
public class ROperatingIndexDPO {
/**
* 单位ID
@@ -38,7 +37,7 @@ public class ROperatingIndexDPO {
* 时间
*/
@MppMultiId(value = "data_date")
private Date dataDate;
private LocalDate dataDate;
/**
* 在运监测点数

View File

@@ -0,0 +1,41 @@
package com.njcn.harmonic.controller.majornetwork;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.harmonic.service.majornetwork.StationDataQualityService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Description:
* Date: 2023/12/6 15:50【需求编号】
*
* @author clam
* @version V1.0.0
*/
@RestController
@Api(tags = "上报电能质量换流站指标统计明细及统计数据接口")
@RequiredArgsConstructor
@RequestMapping("/StationDataQuality")
public class StationDataQualitySendController extends BaseController {
private final StationDataQualityService stationDataQualityService;
@PostMapping("/report")
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@ApiOperation("上报电能质量换流站指标统计明细及统计数据接口")
public HttpResult<Boolean> report() {
String methodDescribe = getMethodDescribe("report");
boolean flag = stationDataQualityService.report();
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
}
}

View File

@@ -0,0 +1,12 @@
package com.njcn.harmonic.service.majornetwork;
/**
* Description:
* Date: 2023/12/6 15:57【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface StationDataQualityService {
boolean report();
}

View File

@@ -0,0 +1,46 @@
package com.njcn.harmonic.service.majornetwork.impl;
import com.njcn.device.pms.api.MonitorClient;
import com.njcn.device.pms.pojo.po.Monitor;
import com.njcn.harmonic.pojo.dto.SubstationQualityStatisticsDTO;
import com.njcn.harmonic.service.majornetwork.StationDataQualityService;
import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* Description:
* Date: 2023/12/6 15:57【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service
@RequiredArgsConstructor
public class StationDataQualityServiceImpl implements StationDataQualityService {
private final MonitorClient monitorClient;
private final DeptFeignClient deptFeignClient;
@Override
public boolean report() {
List<Monitor> data = monitorClient.getMonitorList(new ArrayList<>()).getData();
List<PvTerminalTreeVO> deptList = deptFeignClient.allDeptList().getData();
Map<String, PvTerminalTreeVO> mapCode = deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getCode, Function.identity()));
Map<String, PvTerminalTreeVO> mapList = deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getId, Function.identity()));
data.stream().forEach(temp->{
SubstationQualityStatisticsDTO substaticsDTO = new SubstationQualityStatisticsDTO();
substaticsDTO.setId("1");
});
return true;
}
}