Browse Source

#设备计划发电量feign接口get参数超长

zhongwei
yang_shj 3 months ago
parent
commit
d1a0613fbc
  1. 7
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IPlanGenertionClient.java
  2. 9
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/feign/PlanGenertionClient.java
  3. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml
  4. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/impl/HydroelectricServiceImpl.java
  5. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
  6. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainSystemMonitoringServiceImpl.java

7
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IPlanGenertionClient.java

@ -76,12 +76,11 @@ public interface IPlanGenertionClient {
/** /**
* 年计划/实际发电量 * 年计划/实际发电量
* @param stationIds * @param param
* @param date
* @return * @return
*/ */
@GetMapping(GET_POWER_YEAR) @PostMapping(GET_POWER_YEAR)
Double getPlanPowerYear(@RequestParam(value = "stationIds", required = false) List<String> stationIds, @RequestParam(value = "date", required = false) String date); Double getPlanPowerYear(@RequestBody DevicePlanGenerationVo param);
/** /**
* 计划发电量查询 * 计划发电量查询

9
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/feign/PlanGenertionClient.java

@ -107,14 +107,13 @@ public class PlanGenertionClient implements IPlanGenertionClient{
/** /**
* 年计划发电量/实际发电量 * 年计划发电量/实际发电量
* @param stationIds * @param param
* @param date 'yyyy'
* @return * @return
*/ */
@GetMapping(GET_POWER_YEAR) @PostMapping(GET_POWER_YEAR)
@Override @Override
public Double getPlanPowerYear(List<String> stationIds, String date) { public Double getPlanPowerYear(DevicePlanGenerationVo param) {
return service.getPlanPowerYear(stationIds,date); return service.getPlanPowerYear(param.getStationIds(),param.getDate());
} }
/** /**

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml

@ -238,7 +238,7 @@
<include refid="getTaskListSql"></include> <include refid="getTaskListSql"></include>
order by t.UPDATE_TIME desc order by t.UPDATE_TIME desc
</select> </select>
<select id="getFinishTaskList" parameterType="com.hnac.hzinfo.inspect.task.vo.TaskListQuery" resultType="com.hnac.hzinfo.inspect.task.vo.TaskVo"> <select id="getFinishTaskList" parameterType="com.hnac.hzinfo.inspect.task.vo.TaskListQuery" resultType="com.hnac.hzinfo.inspect.task.vo.TaskVo">
SELECT t.* from HZ_ST_EX_TASK t SELECT t.* from HZ_ST_EX_TASK t
LEFT JOIN HZ_ST_EX_TASK_USER u on t.ID=u.TASK_ID LEFT JOIN HZ_ST_EX_TASK_USER u on t.ID=u.TASK_ID

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/impl/HydroelectricServiceImpl.java

@ -363,7 +363,10 @@ public class HydroelectricServiceImpl implements HydroelectricService {
// 日发电量 // 日发电量
group.setGenerateDay(stationTargets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum()); group.setGenerateDay(stationTargets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum());
// 年计划发电量 // 年计划发电量
group.setGeneratePlanYear(planClient.getPlanPowerYear(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()), DateUtil.format(new Date(),"yyyy"))); DevicePlanGenerationVo planParam = new DevicePlanGenerationVo();
param.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
param.setDate(DateUtil.format(new Date(),"yyyy"));
group.setGeneratePlanYear(planClient.getPlanPowerYear(planParam));
if(group.getGeneratePlanYear() <= 0 || group.getGenerateYear() <= 0){ if(group.getGeneratePlanYear() <= 0 || group.getGenerateYear() <= 0){
group.setGenerateRate(0.0); group.setGenerateRate(0.0);
}else{ }else{

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java

@ -756,7 +756,10 @@ public class HydropowerServiceImpl implements HydropowerService {
// 日发电量 // 日发电量
kpi.setGenerateDay(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum()); kpi.setGenerateDay(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum());
// 年计划发电量 // 年计划发电量
Double plan = planGenertionClient.getPlanPowerYear(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()), DateUtil.format(new Date(),"yyyy")); DevicePlanGenerationVo param = new DevicePlanGenerationVo();
param.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
param.setDate(DateUtil.format(new Date(),"yyyy"));
Double plan = planGenertionClient.getPlanPowerYear(param);
kpi.setPlan(plan); kpi.setPlan(plan);
if(Math.abs(plan) <= 0){ if(Math.abs(plan) <= 0){
kpi.setPlanRate(0.0); kpi.setPlanRate(0.0);

10
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainSystemMonitoringServiceImpl.java

@ -1386,7 +1386,10 @@ public class MainSystemMonitoringServiceImpl implements IMainSystemMonitoringSer
BigDecimal powerYear = value.entrySet().stream().filter(s -> listByYear.contains(s.getKey())).map(s -> BigDecimal.valueOf(s.getValue()).setScale(1, RoundingMode.UP)).reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal powerYear = value.entrySet().stream().filter(s -> listByYear.contains(s.getKey())).map(s -> BigDecimal.valueOf(s.getValue()).setScale(1, RoundingMode.UP)).reduce(BigDecimal.ZERO, BigDecimal::add);
stationReportVO.setFinishPowerYear(objDivide(String.valueOf(powerYear)).toString()); stationReportVO.setFinishPowerYear(objDivide(String.valueOf(powerYear)).toString());
//获取计划年发电量 //获取计划年发电量
Double planPowerYear = planGenertionClient.getPlanPowerYear(Collections.singletonList(stationEntity.getCode()), yearMon[0]); DevicePlanGenerationVo param = new DevicePlanGenerationVo();
param.setStationIds(Collections.singletonList(stationEntity.getCode()));
param.setDate(yearMon[0]);
Double planPowerYear = planGenertionClient.getPlanPowerYear(param);
stationReportVO.setPowerYearPlan(objDivide(String.valueOf(planPowerYear)).doubleValue()); stationReportVO.setPowerYearPlan(objDivide(String.valueOf(planPowerYear)).doubleValue());
if (ObjectUtil.isNotEmpty(stationReportVO.getPowerMonPlan()) if (ObjectUtil.isNotEmpty(stationReportVO.getPowerMonPlan())
&&ObjectUtil.isNotEmpty(stationReportVO.getFinishPowerMon()) &&ObjectUtil.isNotEmpty(stationReportVO.getFinishPowerMon())
@ -1483,7 +1486,10 @@ public class MainSystemMonitoringServiceImpl implements IMainSystemMonitoringSer
Double finishPowerYear = BigDecimal.valueOf(powerCountYear.get()).doubleValue(); Double finishPowerYear = BigDecimal.valueOf(powerCountYear.get()).doubleValue();
stationReportVO.setFinishPowerYear(objDivide(String.valueOf(finishPowerYear)).toString()); stationReportVO.setFinishPowerYear(objDivide(String.valueOf(finishPowerYear)).toString());
//当年的计划发电量 //当年的计划发电量
Double planPowerYear = planGenertionClient.getPlanPowerYear(Collections.singletonList(stationId), year); DevicePlanGenerationVo param = new DevicePlanGenerationVo();
param.setStationIds(Collections.singletonList(stationEntity.getCode()));
param.setDate(year);
Double planPowerYear = planGenertionClient.getPlanPowerYear(param);
stationReportVO.setPowerYearPlan(objDivide(String.valueOf(planPowerYear)).doubleValue()); stationReportVO.setPowerYearPlan(objDivide(String.valueOf(planPowerYear)).doubleValue());
//当月的计划发电量 //当月的计划发电量
R<Float> planPowerMonR = planGenertionClient.planGenerationMonthCount(stationId, month); R<Float> planPowerMonR = planGenertionClient.planGenerationMonthCount(stationId, month);

Loading…
Cancel
Save