diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/AppHydropowerStationVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/AppHydropowerStationVo.java index 708c4a7..234b0c4 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/AppHydropowerStationVo.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/AppHydropowerStationVo.java @@ -27,6 +27,12 @@ public class AppHydropowerStationVo { @ApiModelProperty(value = "站点编码") private String stationCode; + @ApiModelProperty(value = "最大温度") + private String maxTemp; + + @ApiModelProperty(value = "最低温度") + private String minTemp; + @ApiModelProperty(value = "装机容量") @JsonSerialize(nullsUsing = NullSerializer.class) private Double capacity; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/StAlamRecordController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/StAlamRecordController.java index 833b23b..6792ec4 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/StAlamRecordController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/StAlamRecordController.java @@ -50,8 +50,6 @@ public class StAlamRecordController { * * */ - @OperationAnnotation(moduleName = "集中监控",title = "集中监控", operatorType = OperatorType.MOBILE, - businessType = BusinessType.GENCODE,action = "获取当天的告警列表") @ApiOperation("获取当天的告警列表") @RequestMapping(value = "/getDaySoeList", method = {RequestMethod.GET, RequestMethod.POST}) public R getDaySoeList(@ApiParam(value = "时间 yyyy-MM-dd HH:mm:ss") @RequestParam(required = false) String date, @@ -66,8 +64,6 @@ public class StAlamRecordController { return stAlamRecordService.getDaySoeList(AuthUtil.getUser(), date, type,current,size,code); } - @OperationAnnotation(moduleName = "集中监控",title = "集中监控", operatorType = OperatorType.MOBILE, - businessType = BusinessType.GENCODE,action = "获取故障列表数据") @ApiOperation("获取故障列表数据") @RequestMapping(value = "/getFaultList", method = {RequestMethod.GET, RequestMethod.POST}) public R> getFaultList(@ApiParam(value = "站点编码") @RequestParam(required = false) String code) { diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java index 21f86fb..052b507 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java @@ -118,6 +118,8 @@ public class HydropowerServiceImpl implements HydropowerService { private final static int POOL_QUANTITY = 4; + private final static int DUTY_POOL_QUANTITY = 5; + /** * 加载水电站机组实时数据 @@ -1499,12 +1501,17 @@ public class HydropowerServiceImpl implements HydropowerService { if (CollectionUtil.isEmpty(stations)) { return new ArrayList<>(); } + // 获取站点7日天气 + Map weekWeather = this.weatherService.getWeekWeather(stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); // 实时监测点数据 List reals = (List) redisTemplate.opsForValue().get(load_hydropower_unit_real_key); return stations.stream().map(station -> { AppHydropowerStationVo hydropower = new AppHydropowerStationVo(); hydropower.setDeptId(station.getRefDept()); hydropower.setDeptName(station.getName()); + // 天气区间 + hydropower.setMaxTemp(this.intervalTemp(weekWeather,station.getCode(),true)); + hydropower.setMinTemp(this.intervalTemp(weekWeather,station.getCode(),false)); // 装机容量 hydropower.setCapacity(reals.stream().filter(real-> real.getDeptId().equals(station.getRefDept())).mapToDouble(HydropowerUnitRealVo::getInstalledCapacity).sum()); // 负荷 @@ -1543,6 +1550,22 @@ public class HydropowerServiceImpl implements HydropowerService { } /** + * 天气区间 + * @param week + * @param flag + * @return + */ + private String intervalTemp(Map week, String code,boolean flag) { + if(MapUtils.isEmpty(week) || !week.containsKey(code)){ + return "21"; + } + if(flag){ + return week.get(code).getDaily().get(0).getTempMax(); + } + return week.get(code).getDaily().get(0).getTempMin(); + } + + /** * app区域值班数据 * @param deptId * @return @@ -1566,11 +1589,11 @@ public class HydropowerServiceImpl implements HydropowerService { DateTimeFormatter dtf = DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME); String start = dtf.format(startDate); String end = dtf.format(LocalDateTime.now()); - List deptList = Collections.singletonList(duty.getCreateDept()); + List deptList = Collections.singletonList(deptId); // 使用多线程处理数据 ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("duty_data-pool-%d").build(); ExecutorService pool = new ThreadPoolExecutor(5, 5, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); - CountDownLatch countDownLatch = new CountDownLatch(POOL_QUANTITY); + CountDownLatch countDownLatch = new CountDownLatch(DUTY_POOL_QUANTITY); // 下一班组 pool.execute(()-> { this.getNextDuty(item,duty.getId()); @@ -1642,7 +1665,7 @@ public class HydropowerServiceImpl implements HydropowerService { return; } item.setNextShift(nextDuty.getClassName()); - item.setNextTeam(nextDuty.getGroupName()); + item.setNextTeam(Optional.ofNullable(nextDuty.getGroupName()).orElse("灵活排版")); // 下一班组负责人 String managerName = this.getManagerName(nextDuty.getManagerId()); item.setNextTeamLeader(managerName); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/DeptController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/DeptController.java index c595de2..83036bc 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/DeptController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/DeptController.java @@ -27,6 +27,7 @@ import java.util.List; @RequestMapping("/dept") public class DeptController extends BladeController { private final IDeptService deptService; + @ApiLog @RequestMapping("/getDeptLeafNode") public R getDeptLeafNode(){ @@ -34,8 +35,6 @@ public class DeptController extends BladeController { } @ApiLog - @OperationAnnotation(moduleName ="集中监控" ,title = "集中监控", operatorType = OperatorType.MOBILE, - businessType = BusinessType.GENCODE,action = "getCurrentUserDept") @GetMapping("/getCurrentUserDept") public R> getCurrentUserDept(@RequestParam(required = false) String name,@RequestParam(required = false) String type){ return R.data(deptService.getCurrentUserDept(name,type));