2.4.1.20接收电能质量变电站监测统计数据接口
This commit is contained in:
@@ -21,7 +21,7 @@ public class RUploadPointStatisticalDataD {
|
|||||||
/**
|
/**
|
||||||
* uuid
|
* uuid
|
||||||
*/
|
*/
|
||||||
private String dataId;
|
private String id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 省级单位id
|
* 省级单位id
|
||||||
|
|||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package com.njcn.harmonic.pojo.po.upload;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 主配网变电站监测统计数据-日表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-12-08
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("r_upload_substation_statistical_data_d")
|
||||||
|
public class RUploadSubstationStatisticalDataD {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* uuid
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省级单位id
|
||||||
|
*/
|
||||||
|
private String provinceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省级单位名称
|
||||||
|
*/
|
||||||
|
private String provinceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市级单位id
|
||||||
|
*/
|
||||||
|
private String cityId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市级单位名称
|
||||||
|
*/
|
||||||
|
private String cityName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 县级单位id
|
||||||
|
*/
|
||||||
|
private String countyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 县级单位名称
|
||||||
|
*/
|
||||||
|
private String countyName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站总数量
|
||||||
|
*/
|
||||||
|
private Integer substationCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试变电站数量
|
||||||
|
*/
|
||||||
|
private Integer testSubstaionNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在运变电站数量
|
||||||
|
*/
|
||||||
|
private Integer runSubstationNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测变电站数量
|
||||||
|
*/
|
||||||
|
private Integer monitorSubstaionNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线监测点数
|
||||||
|
*/
|
||||||
|
private Integer onlineMonitorNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 覆盖率
|
||||||
|
*/
|
||||||
|
private Double coverageRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测率
|
||||||
|
*/
|
||||||
|
private Double monitoringRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计月份
|
||||||
|
*/
|
||||||
|
private String statisticalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计类型(01:年 02:月 03:日)
|
||||||
|
*/
|
||||||
|
private String statisticalType;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package com.njcn.prepare.executor;
|
|||||||
import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam;
|
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.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;
|
||||||
@@ -25,6 +26,7 @@ public class SubStationExecutor extends BaseExecutor{
|
|||||||
|
|
||||||
private final PollutionService pollutionService;
|
private final PollutionService pollutionService;
|
||||||
private final RStatSubstationService rStatSubstationService;
|
private final RStatSubstationService rStatSubstationService;
|
||||||
|
private final IRUploadSubstationStatisticalDataDService rUploadSubstationStatisticalDataDService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -102,6 +104,21 @@ public class SubStationExecutor extends BaseExecutor{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 河北国网上送接口
|
||||||
|
* 2.4.1.20接收电能质量变电站监测统计数据接口
|
||||||
|
* xuyang
|
||||||
|
*/
|
||||||
|
@LiteflowMethod(value = LiteFlowMethodEnum.IS_ACCESS, nodeId = "rUploadSubStatisticalData", nodeType = NodeTypeEnum.COMMON)
|
||||||
|
public boolean rUploadSubStatisticalDataAccess(NodeComponent bindCmp) {
|
||||||
|
return isAccess(bindCmp);
|
||||||
|
}
|
||||||
|
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "rUploadSubStatisticalData", nodeType = NodeTypeEnum.COMMON)
|
||||||
|
public void rUploadSubStatisticalDataProcess(NodeComponent bindCmp) {
|
||||||
|
rUploadSubstationStatisticalDataDService.insertSubStatisticalDataDay(bindCmp.getRequestData());
|
||||||
|
}
|
||||||
|
|
||||||
/********************************************算法负责人:xy结束***********************************************************/
|
/********************************************算法负责人:xy结束***********************************************************/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.prepare.harmonic.mapper.mysql.upload;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||||
|
import com.njcn.harmonic.pojo.po.upload.RUploadSubstationStatisticalDataD;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 主配网变电站监测统计数据-日表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-12-08
|
||||||
|
*/
|
||||||
|
public interface RUploadSubstationStatisticalDataDMapper extends MppBaseMapper<RUploadSubstationStatisticalDataD> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.njcn.prepare.harmonic.service.mysql.upload;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
||||||
|
import com.njcn.harmonic.pojo.po.upload.RUploadSubstationStatisticalDataD;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 主配网变电站监测统计数据-日表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-12-08
|
||||||
|
*/
|
||||||
|
public interface IRUploadSubstationStatisticalDataDService extends IService<RUploadSubstationStatisticalDataD> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站监测统计数据
|
||||||
|
* @param calculatedParam
|
||||||
|
*/
|
||||||
|
void insertSubStatisticalDataDay(CalculatedParam<DeptGetChildrenMoreDTO> calculatedParam);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -68,7 +68,7 @@ public class RUploadPointStatisticalDataDServiceImpl extends MppServiceImpl<RUpl
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RUploadPointStatisticalDataD rUploadPointStatisticalDataD = new RUploadPointStatisticalDataD();
|
RUploadPointStatisticalDataD rUploadPointStatisticalDataD = new RUploadPointStatisticalDataD();
|
||||||
rUploadPointStatisticalDataD.setDataId(IdUtil.simpleUUID());
|
rUploadPointStatisticalDataD.setId(IdUtil.simpleUUID());
|
||||||
rUploadPointStatisticalDataD.setProvinceId(code);
|
rUploadPointStatisticalDataD.setProvinceId(code);
|
||||||
rUploadPointStatisticalDataD.setStatisticalDate(calculatedParam.getDataDate());
|
rUploadPointStatisticalDataD.setStatisticalDate(calculatedParam.getDataDate());
|
||||||
rUploadPointStatisticalDataD.setStatisticalLevel(judgeLevel(item.getDeptLevel()));
|
rUploadPointStatisticalDataD.setStatisticalLevel(judgeLevel(item.getDeptLevel()));
|
||||||
@@ -114,7 +114,7 @@ public class RUploadPointStatisticalDataDServiceImpl extends MppServiceImpl<RUpl
|
|||||||
List<RUploadPointStatisticalDataD> oldData = this.list(lambdaQueryWrapper);
|
List<RUploadPointStatisticalDataD> oldData = this.list(lambdaQueryWrapper);
|
||||||
if (CollectionUtil.isNotEmpty(oldData)){
|
if (CollectionUtil.isNotEmpty(oldData)){
|
||||||
result.forEach(item->{
|
result.forEach(item->{
|
||||||
item.setDataId(null);
|
item.setId(null);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result);
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.njcn.prepare.harmonic.service.mysql.upload.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||||
|
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
||||||
|
import com.njcn.device.biz.pojo.dto.DeptGetSubStationDTO;
|
||||||
|
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||||
|
import com.njcn.harmonic.pojo.po.upload.RUploadSubstationStatisticalDataD;
|
||||||
|
import com.njcn.prepare.harmonic.mapper.mysql.upload.RUploadSubstationStatisticalDataDMapper;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam;
|
||||||
|
import com.njcn.prepare.harmonic.service.mysql.upload.IRUploadSubstationStatisticalDataDService;
|
||||||
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
|
import com.njcn.user.pojo.po.Dept;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 主配网变电站监测统计数据-日表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-12-08
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class RUploadSubstationStatisticalDataDServiceImpl extends ServiceImpl<RUploadSubstationStatisticalDataDMapper, RUploadSubstationStatisticalDataD> implements IRUploadSubstationStatisticalDataDService {
|
||||||
|
|
||||||
|
private final CommTerminalGeneralClient commTerminalGeneralClient;
|
||||||
|
private final DeptFeignClient deptFeignClient;
|
||||||
|
@Override
|
||||||
|
public void insertSubStatisticalDataDay(CalculatedParam<DeptGetChildrenMoreDTO> calculatedParam) {
|
||||||
|
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||||
|
Dept data = deptFeignClient.getRootDept().getData();
|
||||||
|
deptGetLineParam.setDeptId(data.getId());
|
||||||
|
List<DeptGetSubStationDTO> data1 = commTerminalGeneralClient.deptSubStation(deptGetLineParam).getData();
|
||||||
|
data1.forEach(item->{
|
||||||
|
System.out.println("id==:" + item.getUnitId());
|
||||||
|
System.out.println("level==:" + item.getDeptLevel());
|
||||||
|
System.out.println("");
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user