1.河北pms母线中间表接口添加

2.两级贯通接口调整
This commit is contained in:
cdf
2024-05-10 14:29:33 +08:00
parent f9bec14719
commit 0581380f19
44 changed files with 767 additions and 354 deletions

View File

@@ -0,0 +1,39 @@
package com.njcn.harmonic.pojo.param.upload;
import lombok.Data;
import java.util.List;
/**
* pqs
*
* @author cdf
* @date 2024/5/9
*/
@Data
public class DimBusBarParam {
private String busId;
private List<String> busIds;
private String busName;
private String dataSource;
private String deployState;
private String detailType;
private String endTime;
private Integer harmonicNum;
private String indexType;
private String monitorId;
private String nodeId;
private String nodeLevel;
private List<String> seqs;
private String startTime;
private String statDate;
private String statType;
private String stationName;
private String voltageLevel;
private Integer pageNum;
private Integer pageSize;
private List<String> onlineBusIds;
private List<String> orgIds;
}

View File

@@ -0,0 +1,69 @@
package com.njcn.harmonic.pojo.po.upload;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import lombok.Data;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* pqs
*
* @author cdf
* @date 2024/4/17
*/
@TableName(value = "pms_run_statistic_d")
@Data
public class PmsRunStatisticD {
/**
*
*/
@MppMultiId
private LocalDate statisticDate;
@MppMultiId
private String deptId;
private String runMonitorIds;
private String onlineMonitorIds;
private String runBusIds;
private Integer runBusNum;
private String onlineBusIds;
private String onlineBusMidIds;
private String runDevIds;
private String runStationIds;
private Integer runStationNum;
private String onlineStationIds;
private String typicalOnlineIds;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
@JsonSerialize(using = LocalDateTimeSerializer.class)
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,72 @@
package com.njcn.harmonic.pojo.po.upload;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import lombok.Data;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* pqs
*
* @author cdf
* @date 2024/4/17
*/
@TableName(value = "pms_run_statistic_m")
@Data
public class PmsRunStatisticM {
/**
*
*/
@MppMultiId
private LocalDate statisticDate;
@MppMultiId
private LocalDate statDate;
@MppMultiId
private String deptId;
private String runMonitorIds;
private String onlineMonitorIds;
private String runBusIds;
private Integer runBusNum;
private String onlineBusIds;
private String onlineBusMidIds;
private String runDevIds;
private String runStationIds;
private Integer runStationNum;
private String onlineStationIds;
private String typicalOnlineIds;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
@JsonSerialize(using = LocalDateTimeSerializer.class)
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,72 @@
package com.njcn.harmonic.pojo.po.upload;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import lombok.Data;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* pqs
*
* @author cdf
* @date 2024/4/17
*/
@TableName(value = "pms_run_statistic_y")
@Data
public class PmsRunStatisticY {
/**
*
*/
@MppMultiId
private LocalDate statisticDate;
@MppMultiId
private LocalDate statDate;
@MppMultiId
private String deptId;
private String runMonitorIds;
private String onlineMonitorIds;
private String runBusIds;
private Integer runBusNum;
private String onlineBusIds;
private String onlineBusMidIds;
private String runDevIds;
private String runStationIds;
private Integer runStationNum;
private String onlineStationIds;
private String typicalOnlineIds;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
@JsonSerialize(using = LocalDateTimeSerializer.class)
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,262 @@
package com.njcn.harmonic.pojo.po.upload;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import com.njcn.db.bo.BaseEntity;
import java.io.Serializable;
import java.time.LocalDate;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
/**
* <p>
* 母线越限详情
* </p>
*
* @author cdf
* @since 2024-05-09
*/
@Data
@TableName("r_dim_bus_up_d")
public class RDimBusUpD {
private static final long serialVersionUID = 1L;
@MppMultiId
private LocalDate statisticDate;
@MppMultiId
private String phasicType;
@MppMultiId
private String busId;
private String midBusId;
private String effectId;
private String effectIds;
private String voltageLevel;
private Double v;
private Integer allTime;
private Integer flickerAllTime;
private Integer freqDevOvertime;
private Integer voltageDevOvertime;
private Integer ubalanceOvertime;
private Integer flickerOvertime;
private Integer uaberranceOvertime;
private Integer iNegOvertime;
@TableField(value = "uharm_2_overtime")
private Integer uharm2Overtime;
@TableField(value = "uharm_3_overtime")
private Integer uharm3Overtime;
@TableField(value = "uharm_4_overtime")
private Integer uharm4Overtime;
@TableField(value = "uharm_5_overtime")
private Integer uharm5Overtime;
@TableField(value = "uharm_6_overtime")
private Integer uharm6Overtime;
@TableField(value = "uharm_7_overtime")
private Integer uharm7Overtime;
@TableField(value = "uharm_8_overtime")
private Integer uharm8Overtime;
@TableField(value = "uharm_9_overtime")
private Integer uharm9Overtime;
@TableField(value = "uharm_10_overtime")
private Integer uharm10Overtime;
@TableField(value = "uharm_11_overtime")
private Integer uharm11Overtime;
@TableField(value = "uharm_12_overtime")
private Integer uharm12Overtime;
@TableField(value = "uharm_13_overtime")
private Integer uharm13Overtime;
@TableField(value = "uharm_14_overtime")
private Integer uharm14Overtime;
@TableField(value = "uharm_15_overtime")
private Integer uharm15Overtime;
@TableField(value = "uharm_16_overtime")
private Integer uharm16Overtime;
@TableField(value = "uharm_17_overtime")
private Integer uharm17Overtime;
@TableField(value = "uharm_18_overtime")
private Integer uharm18Overtime;
@TableField(value = "uharm_19_overtime")
private Integer uharm19Overtime;
@TableField(value = "uharm_20_overtime")
private Integer uharm20Overtime;
@TableField(value = "uharm_21_overtime")
private Integer uharm21Overtime;
@TableField(value = "uharm_22_overtime")
private Integer uharm22Overtime;
@TableField(value = "uharm_23_overtime")
private Integer uharm23Overtime;
@TableField(value = "uharm_24_overtime")
private Integer uharm24Overtime;
@TableField(value = "uharm_25_overtime")
private Integer uharm25Overtime;
@TableField(value = "uharm_26_overtime")
private Integer uharm26Overtime;
@TableField(value = "uharm_27_overtime")
private Integer uharm27Overtime;
@TableField(value = "uharm_28_overtime")
private Integer uharm28Overtime;
@TableField(value = "uharm_29_overtime")
private Integer uharm29Overtime;
@TableField(value = "uharm_30_overtime")
private Integer uharm30Overtime;
@TableField(value = "uharm_31_overtime")
private Integer uharm31Overtime;
@TableField(value = "uharm_32_overtime")
private Integer uharm32Overtime;
@TableField(value = "uharm_33_overtime")
private Integer uharm33Overtime;
@TableField(value = "uharm_34_overtime")
private Integer uharm34Overtime;
@TableField(value = "uharm_35_overtime")
private Integer uharm35Overtime;
@TableField(value = "uharm_36_overtime")
private Integer uharm36Overtime;
@TableField(value = "uharm_37_overtime")
private Integer uharm37Overtime;
@TableField(value = "uharm_38_overtime")
private Integer uharm38Overtime;
@TableField(value = "uharm_39_overtime")
private Integer uharm39Overtime;
@TableField(value = "uharm_40_overtime")
private Integer uharm40Overtime;
@TableField(value = "uharm_41_overtime")
private Integer uharm41Overtime;
@TableField(value = "uharm_42_overtime")
private Integer uharm42Overtime;
@TableField(value = "uharm_43_overtime")
private Integer uharm43Overtime;
@TableField(value = "uharm_44_overtime")
private Integer uharm44Overtime;
@TableField(value = "uharm_45_overtime")
private Integer uharm45Overtime;
@TableField(value = "uharm_46_overtime")
private Integer uharm46Overtime;
@TableField(value = "uharm_47_overtime")
private Integer uharm47Overtime;
@TableField(value = "uharm_48_overtime")
private Integer uharm48Overtime;
@TableField(value = "uharm_49_overtime")
private Integer uharm49Overtime;
@TableField(value = "uharm_50_overtime")
private Integer uharm50Overtime;
public RDimBusUpD() {
this.uharm2Overtime = 0;
this.uharm3Overtime = 0;
this.uharm4Overtime = 0;
this.uharm5Overtime = 0;
this.uharm6Overtime = 0;
this.uharm7Overtime = 0;
this.uharm8Overtime = 0;
this.uharm9Overtime = 0;
this.uharm10Overtime = 0;
this.uharm11Overtime = 0;
this.uharm12Overtime = 0;
this.uharm13Overtime = 0;
this.uharm14Overtime = 0;
this.uharm15Overtime = 0;
this.uharm16Overtime = 0;
this.uharm17Overtime = 0;
this.uharm18Overtime = 0;
this.uharm19Overtime = 0;
this.uharm20Overtime = 0;
this.uharm21Overtime = 0;
this.uharm22Overtime = 0;
this.uharm23Overtime = 0;
this.uharm24Overtime = 0;
this.uharm25Overtime = 0;
this.uharm26Overtime = 0;
this.uharm27Overtime = 0;
this.uharm28Overtime = 0;
this.uharm29Overtime = 0;
this.uharm30Overtime = 0;
this.uharm31Overtime = 0;
this.uharm32Overtime = 0;
this.uharm33Overtime = 0;
this.uharm34Overtime = 0;
this.uharm35Overtime = 0;
this.uharm36Overtime = 0;
this.uharm37Overtime = 0;
this.uharm38Overtime = 0;
this.uharm39Overtime = 0;
this.uharm40Overtime = 0;
this.uharm41Overtime = 0;
this.uharm42Overtime = 0;
this.uharm43Overtime = 0;
this.uharm44Overtime = 0;
this.uharm45Overtime = 0;
this.uharm46Overtime = 0;
this.uharm47Overtime = 0;
this.uharm48Overtime = 0;
this.uharm49Overtime = 0;
this.uharm50Overtime = 0;
}
}

View File

@@ -0,0 +1,158 @@
package com.njcn.harmonic.pojo.po.upload;
import com.baomidou.mybatisplus.annotation.TableName;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import com.njcn.db.bo.BaseEntity;
import java.io.Serializable;
import java.time.LocalDate;
import lombok.Getter;
import lombok.Setter;
/**
* <p>
* 母线越限详情
* </p>
*
* @author cdf
* @since 2024-05-09
*/
@Getter
@Setter
@TableName("r_dim_bus_up_m")
public class RDimBusUpM extends BaseEntity {
private static final long serialVersionUID = 1L;
@MppMultiId
private LocalDate statisticDate;
@MppMultiId
private String phasicType;
@MppMultiId
private String busId;
private String effectId;
private String effectIds;
private String vlotageLevel;
private Integer v;
private Integer allTime;
private Integer flickerAllTime;
private Integer freqDevOvertime;
private Integer voltageDevOvertime;
private Integer ubalanceOvertime;
private Integer flickerOvertime;
private Integer uaberranceOvertime;
private Integer iNegOvertime;
private Integer uharm2Overtime;
private Integer uharm3Overtime;
private Integer uharm4Overtime;
private Integer uharm5Overtime;
private Integer uharm6Overtime;
private Integer uharm7Overtime;
private Integer uharm8Overtime;
private Integer uharm9Overtime;
private Integer uharm10Overtime;
private Integer uharm11Overtime;
private Integer uharm12Overtime;
private Integer uharm13Overtime;
private Integer uharm14Overtime;
private Integer uharm15Overtime;
private Integer uharm16Overtime;
private Integer uharm17Overtime;
private Integer uharm18Overtime;
private Integer uharm19Overtime;
private Integer uharm20Overtime;
private Integer uharm21Overtime;
private Integer uharm22Overtime;
private Integer uharm23Overtime;
private Integer uharm24Overtime;
private Integer uharm25Overtime;
private Integer uharm26Overtime;
private Integer uharm27Overtime;
private Integer uharm28Overtime;
private Integer uharm29Overtime;
private Integer uharm30Overtime;
private Integer uharm31Overtime;
private Integer uharm32Overtime;
private Integer uharm33Overtime;
private Integer uharm34Overtime;
private Integer uharm35Overtime;
private Integer uharm36Overtime;
private Integer uharm37Overtime;
private Integer uharm38Overtime;
private Integer uharm39Overtime;
private Integer uharm40Overtime;
private Integer uharm41Overtime;
private Integer uharm42Overtime;
private Integer uharm43Overtime;
private Integer uharm44Overtime;
private Integer uharm45Overtime;
private Integer uharm46Overtime;
private Integer uharm47Overtime;
private Integer uharm48Overtime;
private Integer uharm49Overtime;
private Integer uharm50Overtime;
}

View File

@@ -0,0 +1,158 @@
package com.njcn.harmonic.pojo.po.upload;
import com.baomidou.mybatisplus.annotation.TableName;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import com.njcn.db.bo.BaseEntity;
import java.io.Serializable;
import java.time.LocalDate;
import lombok.Getter;
import lombok.Setter;
/**
* <p>
* 母线越限详情
* </p>
*
* @author cdf
* @since 2024-05-09
*/
@Getter
@Setter
@TableName("r_dim_bus_up_y")
public class RDimBusUpY extends BaseEntity {
private static final long serialVersionUID = 1L;
@MppMultiId
private LocalDate statisticDate;
@MppMultiId
private String phasicType;
@MppMultiId
private String busId;
private String effectId;
private String effectIds;
private String vlotageLevel;
private Integer v;
private Integer allTime;
private Integer flickerAllTime;
private Integer freqDevOvertime;
private Integer voltageDevOvertime;
private Integer ubalanceOvertime;
private Integer flickerOvertime;
private Integer uaberranceOvertime;
private Integer iNegOvertime;
private Integer uharm2Overtime;
private Integer uharm3Overtime;
private Integer uharm4Overtime;
private Integer uharm5Overtime;
private Integer uharm6Overtime;
private Integer uharm7Overtime;
private Integer uharm8Overtime;
private Integer uharm9Overtime;
private Integer uharm10Overtime;
private Integer uharm11Overtime;
private Integer uharm12Overtime;
private Integer uharm13Overtime;
private Integer uharm14Overtime;
private Integer uharm15Overtime;
private Integer uharm16Overtime;
private Integer uharm17Overtime;
private Integer uharm18Overtime;
private Integer uharm19Overtime;
private Integer uharm20Overtime;
private Integer uharm21Overtime;
private Integer uharm22Overtime;
private Integer uharm23Overtime;
private Integer uharm24Overtime;
private Integer uharm25Overtime;
private Integer uharm26Overtime;
private Integer uharm27Overtime;
private Integer uharm28Overtime;
private Integer uharm29Overtime;
private Integer uharm30Overtime;
private Integer uharm31Overtime;
private Integer uharm32Overtime;
private Integer uharm33Overtime;
private Integer uharm34Overtime;
private Integer uharm35Overtime;
private Integer uharm36Overtime;
private Integer uharm37Overtime;
private Integer uharm38Overtime;
private Integer uharm39Overtime;
private Integer uharm40Overtime;
private Integer uharm41Overtime;
private Integer uharm42Overtime;
private Integer uharm43Overtime;
private Integer uharm44Overtime;
private Integer uharm45Overtime;
private Integer uharm46Overtime;
private Integer uharm47Overtime;
private Integer uharm48Overtime;
private Integer uharm49Overtime;
private Integer uharm50Overtime;
}

View File

@@ -0,0 +1,33 @@
package com.njcn.harmonic.pojo.vo.upload;
import lombok.Data;
/**
* pqs
*
* @author cdf
* @date 2024/5/9
*/
@Data
public class DimBusBarVO {
private String astId;
private String busName;
private String busVoltageLevel;
private String busVoltageLevelName;
private String cityOrg;
private String cityOrgName;
private String deviceStatus;
private String maintCrew;
private String maintCrewName;
private String maintOrg;
private String maintOrgName;
private String operationDate;
private String psrId;
private String psrStateName;
private String stationId;
private String stationName;
private String stationType;
private String stationVoltageLevel;
private String stationVoltageLevelName;
}

View File

@@ -0,0 +1,30 @@
package com.njcn.harmonic.pojo.vo.upload;
import lombok.Data;
/**
* pqs
*
* @author cdf
* @date 2024/5/9
*/
@Data
public class PmsHttpResult<T> {
private String msg;
private Integer code;
private T data;
private String sucess;
private String encrypt_data;
private String other;
public PmsHttpResult(Integer code,T data){
this.code = code;
this.data = data;
}
}

View File

@@ -9,6 +9,9 @@ import com.njcn.common.utils.HttpResultUtil;
import com.njcn.common.utils.LogUtil;
import com.njcn.harmonic.pojo.param.UploadDataParam;
import com.njcn.harmonic.pojo.param.UploadParam;
import com.njcn.harmonic.pojo.param.upload.DimBusBarParam;
import com.njcn.harmonic.pojo.vo.upload.DimBusBarVO;
import com.njcn.harmonic.pojo.vo.upload.PmsHttpResult;
import com.njcn.harmonic.pojo.vo.upload.UploadEvaluationDataVo;
import com.njcn.harmonic.service.upload.IEvaluationDataService;
import com.njcn.web.controller.BaseController;
@@ -38,6 +41,7 @@ import org.springframework.web.bind.annotation.RestController;
public class EvaluationDataController extends BaseController {
private final IEvaluationDataService evaluationDataService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getEvaluationData")
@ApiOperation("查询母线基准水平评估数据")
@@ -60,4 +64,7 @@ public class EvaluationDataController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
}

View File

@@ -0,0 +1,50 @@
package com.njcn.harmonic.controller.upload;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.harmonic.pojo.param.upload.DimBusBarParam;
import com.njcn.harmonic.pojo.vo.upload.DimBusBarVO;
import com.njcn.harmonic.pojo.vo.upload.PmsHttpResult;
import com.njcn.harmonic.service.upload.IEvaluationDataService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* pqs
*
* @author cdf
* @date 2024/5/10
*/
@Slf4j
@RestController
@RequestMapping("/IndexAnalysis/BenchmarkLevelEva")
@Api(tags = "基准水平下穿查询")
@AllArgsConstructor
public class EvaluationDownController extends BaseController {
private final IEvaluationDataService evaluationDataService;
/**
* 接收总部基准水平评估在运母线数量详情下穿接口
* @author cdf
* @date 2024/5/9
*/
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getBaseEvaOnlineBusDetail")
@ApiOperation("国网上送-接收总部基准水平评估在运母线数量详情下穿接口")
@ApiImplicitParam(name = "param", value = "实体参数", required = true)
public PmsHttpResult<Page<DimBusBarVO>> getBaseEvaOnlineBusDetail(@RequestBody DimBusBarParam param) {
String methodDescribe = getMethodDescribe("getBaseEvaOnlineBusDetail");
Page<DimBusBarVO> page = evaluationDataService.getBaseEvaOnlineBusDetail(param);
return new PmsHttpResult<>(0, page);
}
}

View File

@@ -0,0 +1,60 @@
<?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.RUploadEvaluationDataDMapper">
<select id="getBaseEvaOnlineBusDetail" resultType="DimBusBarVO">
select
mid.id astId,
mid.Name busName,
mid.voltage_Level busVoltageLevel,
dicVoltage.name busVoltageLevelName,
mid.SectionId cityOrg,
mid.Section cityOrgName,
mid.Run_Status deviceStatus,
station.Power_Id stationId,
station.Power_Name stationName,
station.Voltage_Level stationVoltageLevel
from pms_mid_ledger mid
left join pms_generatrix_wire wire on mid.id = wire.Mid_Bus_Id
left join sys_dict_data dicVoltage on mid.voltage_Level = dicVoltage.id
left join pms_statation_stat station on wire.Station_Id = station.Power_Id
where mid.level = 1
<if test="param.busId!=null and param.busId!='' ">
and mid.id = #{param.busId}
</if>
<if test="param.busName!=null and param.busName!='' ">
and mid.name = #{param.busName}
</if>
<if test="param.busIds!=null and param.busIds.size>0">
and mid.id in
<foreach collection="param.busIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="param.onlineBusIds!=null and param.onlineBusIds.size>0">
and mid.id in
<foreach collection="param.onlineBusIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="param.orgIds!=null and param.orgIds.size>0">
and mid.SectionId in
<foreach collection="param.orgIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="param.deployState!=null and param.deployState!='' ">
and mid.Run_Status = #{param.deployState}
</if>
</select>
</mapper>

View File

@@ -0,0 +1,19 @@
package com.njcn.harmonic.mapper.upload;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
import com.njcn.harmonic.pojo.po.upload.PmsRunStatisticD;
/**
* <p>
* Mapper 接口
* </p>
*
* @author cdf
* @since 2024-04-17
*/
public interface PmsRunStatisticDMapper extends MppBaseMapper<PmsRunStatisticD> {
}

View File

@@ -0,0 +1,19 @@
package com.njcn.harmonic.mapper.upload;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
import com.njcn.harmonic.pojo.po.upload.PmsRunStatisticM;
/**
* <p>
* Mapper 接口
* </p>
*
* @author cdf
* @since 2024-04-17
*/
public interface PmsRunStatisticMMapper extends MppBaseMapper<PmsRunStatisticM> {
}

View File

@@ -0,0 +1,19 @@
package com.njcn.harmonic.mapper.upload;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
import com.njcn.harmonic.pojo.po.upload.PmsRunStatisticY;
/**
* <p>
* Mapper 接口
* </p>
*
* @author cdf
* @since 2024-04-17
*/
public interface PmsRunStatisticYMapper extends MppBaseMapper<PmsRunStatisticY> {
}

View File

@@ -0,0 +1,18 @@
package com.njcn.harmonic.mapper.upload;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
import com.njcn.harmonic.pojo.po.upload.RDimBusUpD;
/**
* <p>
* 母线越限详情 Mapper 接口
* </p>
*
* @author cdf
* @since 2024-05-09
*/
public interface RDimBusUpDMapper extends MppBaseMapper<RDimBusUpD> {
}

View File

@@ -0,0 +1,18 @@
package com.njcn.harmonic.mapper.upload;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
import com.njcn.harmonic.pojo.po.upload.RDimBusUpM;
/**
* <p>
* 母线越限详情 Mapper 接口
* </p>
*
* @author cdf
* @since 2024-05-09
*/
public interface RDimBusUpMMapper extends MppBaseMapper<RDimBusUpM> {
}

View File

@@ -0,0 +1,18 @@
package com.njcn.harmonic.mapper.upload;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
import com.njcn.harmonic.pojo.po.upload.RDimBusUpY;
/**
* <p>
* 母线越限详情 Mapper 接口
* </p>
*
* @author cdf
* @since 2024-05-09
*/
public interface RDimBusUpYMapper extends MppBaseMapper<RDimBusUpY> {
}

View File

@@ -1,7 +1,11 @@
package com.njcn.harmonic.mapper.upload;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.harmonic.pojo.param.upload.DimBusBarParam;
import com.njcn.harmonic.pojo.po.upload.RUploadEvaluationDataD;
import com.njcn.harmonic.pojo.vo.upload.DimBusBarVO;
import org.apache.ibatis.annotations.Param;
/**
* <p>
@@ -13,4 +17,6 @@ import com.njcn.harmonic.pojo.po.upload.RUploadEvaluationDataD;
*/
public interface RUploadEvaluationDataDMapper extends BaseMapper<RUploadEvaluationDataD> {
public Page<DimBusBarVO> getBaseEvaOnlineBusDetail(@Param("page") Page<DimBusBarVO> page, @Param("param") DimBusBarParam param);
}

View File

@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.harmonic.pojo.param.UploadDataParam;
import com.njcn.harmonic.pojo.param.UploadParam;
import com.njcn.harmonic.pojo.param.upload.DimBusBarParam;
import com.njcn.harmonic.pojo.po.upload.RUploadEvaluationDataD;
import com.njcn.harmonic.pojo.vo.upload.DimBusBarVO;
import com.njcn.harmonic.pojo.vo.upload.UploadEvaluationDataVo;
/**
@@ -29,4 +31,6 @@ public interface IEvaluationDataService extends IService<RUploadEvaluationDataD>
*/
String uploadEvaluationData(UploadParam param);
Page<DimBusBarVO> getBaseEvaOnlineBusDetail(DimBusBarParam param);
}

View File

@@ -5,18 +5,24 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.harmonic.mapper.upload.RUploadEvaluationDataDMapper;
import com.njcn.harmonic.mapper.upload.*;
import com.njcn.harmonic.pojo.dto.upload.PqEvaluationCreateDTO;
import com.njcn.harmonic.pojo.param.UploadDataParam;
import com.njcn.harmonic.pojo.param.UploadParam;
import com.njcn.harmonic.pojo.param.upload.DimBusBarParam;
import com.njcn.harmonic.pojo.po.upload.PmsRunStatisticD;
import com.njcn.harmonic.pojo.po.upload.RDimBusUpD;
import com.njcn.harmonic.pojo.po.upload.RUploadEvaluationDataD;
import com.njcn.harmonic.pojo.vo.upload.DimBusBarVO;
import com.njcn.harmonic.pojo.vo.upload.UploadEvaluationDataVo;
import com.njcn.harmonic.service.upload.IEvaluationDataService;
import com.njcn.system.api.DicDataFeignClient;
@@ -33,10 +39,8 @@ import org.apache.commons.collections4.ListUtils;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -56,6 +60,19 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
private final DeptFeignClient deptFeignClient;
private final DicDataFeignClient dicDataFeignClient;
private final PmsRunStatisticDMapper pmsRunStatisticDMapper;
private final PmsRunStatisticMMapper pmsRunStatisticMMapper;
private final PmsRunStatisticYMapper pmsRunStatisticYMapper;
private final RDimBusUpDMapper rDimBusUpDMapper;
private final RDimBusUpMMapper rDimBusUpMMapper;
private final RDimBusUpYMapper rDimBusUpYMapper;
@Override
public Page<UploadEvaluationDataVo> getEvaluationData(UploadDataParam param) {
LambdaQueryWrapper<RUploadEvaluationDataD> lambdaQueryWrapper = this.getDeptLevel(param);
@@ -63,19 +80,19 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
lambdaQueryWrapper.orderByDesc(RUploadEvaluationDataD::getProvinceName);
Page<RUploadEvaluationDataD> page = this.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), lambdaQueryWrapper);
List<UploadEvaluationDataVo> voList = BeanUtil.copyToList(page.getRecords(), UploadEvaluationDataVo.class);
if (CollectionUtil.isNotEmpty(voList)){
voList = voList.stream().peek(item->{
if (!Objects.equals(item.getAvgValue(),3.1415926)){
if (CollectionUtil.isNotEmpty(voList)) {
voList = voList.stream().peek(item -> {
if (!Objects.equals(item.getAvgValue(), 3.1415926)) {
BigDecimal four = BigDecimal.valueOf(item.getAvgValue());
double value = four.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
double value = four.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
item.setAvgValue(value);
} else if (!Objects.equals(item.getStandardDeviation(),3.1415926)){
} else if (!Objects.equals(item.getStandardDeviation(), 3.1415926)) {
BigDecimal four = BigDecimal.valueOf(item.getStandardDeviation());
double value = four.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
double value = four.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
item.setStandardDeviation(value);
}
BigDecimal four = BigDecimal.valueOf(item.getMonitorBusRate());
double value = four.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
double value = four.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
item.setMonitorBusRate(value);
}).collect(Collectors.toList());
}
@@ -93,17 +110,17 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
List<RUploadEvaluationDataD> list;
//指定数据上送,不管之前有没有上送,都重新上送一次
//(预防之前上送过,修改数据后需要再次上送)
if (CollUtil.isNotEmpty(param.getList())){
if (CollUtil.isNotEmpty(param.getList())) {
list = this.lambdaQuery()
.eq(RUploadEvaluationDataD::getComputeDate,param.getTime())
.in(RUploadEvaluationDataD::getId,param.getList())
.eq(RUploadEvaluationDataD::getComputeDate, param.getTime())
.in(RUploadEvaluationDataD::getId, param.getList())
.list();
}
//未指定数据上送,则上送省级数据(包含日、月数据)
else {
list = this.lambdaQuery()
.eq(RUploadEvaluationDataD::getComputeDate,param.getTime())
.in(RUploadEvaluationDataD::getStatisticalLevel, Stream.of("3","4").collect(Collectors.toList()))
.eq(RUploadEvaluationDataD::getComputeDate, param.getTime())
.in(RUploadEvaluationDataD::getStatisticalLevel, Stream.of("3", "4").collect(Collectors.toList()))
.list();
}
@@ -150,11 +167,107 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
Map<String, String> send = GwSendUtil.send(sp, GWSendEnum.EVALUATION);
//获取返回结果
List<String> l = dtoList.stream().map(PqEvaluationCreateDTO::getId).collect(Collectors.toList());
returnInformation(i,l,send);
returnInformation(i, l, send);
}
return "上送成功:成功数据" + list.size() + "";
}
@Override
public Page<DimBusBarVO> getBaseEvaOnlineBusDetail(DimBusBarParam param) {
Dept dept = deptFeignClient.getRootDept().getData();
List<String> temBusIds = new ArrayList<>();
//统计类型不为空,则查询指定统计天数的数据
if (StrUtil.isNotBlank(param.getStatType())) {
//判断日月年不为空时候对应参数不能为空
if (StrUtil.isBlank(param.getStartTime()) || StrUtil.isBlank(param.getEndTime())) {
//TODO 需要抛出异常,抛异常格式需要和总部要求格式一致
}
if (StrUtil.isBlank(param.getNodeId())) {
//没有组织id则认为查询日的省级数据
param.setNodeId(dept.getCode());
}
List<String> orgIds = deptFeignClient.getDepSonSelfCodetByCode(param.getNodeId()).getData();
param.setOrgIds(orgIds);
if (param.getStatType().equals("03")) {
LocalDate day = LocalDate.parse(param.getStartTime());
//具体日期投运,监测台账查询
LambdaQueryWrapper<PmsRunStatisticD> dayLam = new LambdaQueryWrapper<>();
dayLam.eq(PmsRunStatisticD::getStatisticDate, day).in(PmsRunStatisticD::getDeptId, param.getNodeId());
PmsRunStatisticD pmsRunStatisticD = pmsRunStatisticDMapper.selectOne(dayLam);
if (Objects.nonNull(pmsRunStatisticD)) {
if (StrUtil.isNotBlank(param.getDataSource())) {
temBusIds = new ArrayList<>(Arrays.asList(pmsRunStatisticD.getOnlineBusMidIds().split(StrUtil.COMMA)));
} else {
temBusIds = new ArrayList<>(Arrays.asList(pmsRunStatisticD.getRunBusIds().split(StrUtil.COMMA)));
}
}
//稳态指标条件筛选
if (StrUtil.isNotBlank(param.getIndexType())) {
QueryWrapper<RDimBusUpD> queryWrapper = new QueryWrapper<>();
this.harmTarget(param, queryWrapper);
queryWrapper.eq("statistic_date", day);
List<RDimBusUpD> rDimBusUpDList = rDimBusUpDMapper.selectList(queryWrapper);
if (CollectionUtil.isEmpty(rDimBusUpDList)) {
return new Page<>();
}
temBusIds = rDimBusUpDList.stream().map(RDimBusUpD::getMidBusId).distinct().collect(Collectors.toList());
}
param.setOnlineBusIds(temBusIds);
} else if (param.getStatType().equals("02")) {
} else if (param.getStatType().equals("01")) {
}
}
return this.baseMapper.getBaseEvaOnlineBusDetail(new Page<>(param.getPageNum(), param.getPageSize()), param);
}
private void harmTarget(DimBusBarParam param, QueryWrapper<RDimBusUpD> queryWrapper) {
//稳态指标条件筛选
String target = "", harmV = "";
switch (param.getIndexType()) {
case "01":
target = "voltage_dev_overtime";
break;
case "02":
target = "flicker_overtime";
break;
case "03":
target = "ubalance_overtime";
break;
case "04":
target = "uaberrance_overtime";
break;
case "05":
target = "harm_v";
break;
}
queryWrapper.select("statistic_date", "phasic_type", "bus_id", "mid_bus_id");
if (CollectionUtil.isNotEmpty(param.getSeqs())) {
queryWrapper.in("phasic_type", param.getSeqs());
}
if (param.getIndexType().equals("05")) {
harmV = "uharm_" + param.getHarmonicNum() + "_overtime";
queryWrapper.gt(harmV, 0);
} else {
queryWrapper.gt(target, 0);
}
}
/**
* 获取当前单位的层级
@@ -191,7 +304,7 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
private String formatBeginMonth(String searchBeginTime, String dataType) {
if (Objects.equals(dataType, "02")) {
return DateUtil.format(DateUtil.beginOfMonth(DateUtil.parse(searchBeginTime, DatePattern.NORM_MONTH_PATTERN)), DatePattern.NORM_MONTH_PATTERN);
} else if (Objects.equals(dataType, "01")){
} else if (Objects.equals(dataType, "01")) {
return DateUtil.format(DateUtil.beginOfMonth(DateUtil.parse(searchBeginTime, DatePattern.NORM_YEAR_PATTERN)), DatePattern.NORM_YEAR_PATTERN);
}
return searchBeginTime;
@@ -221,9 +334,9 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
/**
* 国网上送返回信息
*
* @param step 分片上传当前阶段
* @param ids 分片数据
* @param send 上送结果
* @param step 分片上传当前阶段
* @param ids 分片数据
* @param send 上送结果
* @return
*/
private void returnInformation(Integer step, List<String> ids, Map<String, String> send) {
@@ -243,8 +356,8 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
} else {
String errors = mapData.get("errors").toString();
int start = step * 100;
int end = (step+1) * 100;
throw new BusinessException("上送"+start+"条至"+end+"条数据,上送失败:" + status + "_" + errors);
int end = (step + 1) * 100;
throw new BusinessException("上送" + start + "条至" + end + "条数据,上送失败:" + status + "_" + errors);
}
} else {
throw new BusinessException("当前时间段国网上送请求过多,请稍后再试");
@@ -253,6 +366,7 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
/**
* 修改上送信息状态
*
* @param ids id集合
*/
private void updateState(List<String> ids) {
@@ -268,7 +382,7 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
public String getVoltage(String voltage) {
DictData dictData = dicDataFeignClient.getDicDataById(voltage).getData();
Integer code = dictData.getAlgoDescribe();
if (Objects.isNull(code)){
if (Objects.isNull(code)) {
return "99";
}
return (code < 10) ? "0" + code : String.valueOf(code);