Browse Source

#app水电站集团/区域优化

zhongwei
yang_shj 2 years ago
parent
commit
8688711562
  1. 6
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/AppHydropowerStationVo.java
  2. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/StAlamRecordController.java
  3. 29
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
  4. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/DeptController.java

6
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;

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/StAlamRecordController.java

@ -50,8 +50,6 @@ public class StAlamRecordController {
* <option value="5">遥测越限</option>
* <option value="6">遥信变位</option>
*/
@OperationAnnotation(moduleName = "集中监控",title = "集中监控", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "获取当天的告警列表")
@ApiOperation("获取当天的告警列表")
@RequestMapping(value = "/getDaySoeList", method = {RequestMethod.GET, RequestMethod.POST})
public R<SoeBodyVo> 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<List<FaultVo>> getFaultList(@ApiParam(value = "站点编码") @RequestParam(required = false) String code) {

29
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<String, HeWeatherWeatherDailyResponse> weekWeather = this.weatherService.getWeekWeather(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
// 实时监测点数据
List<HydropowerUnitRealVo> reals = (List<HydropowerUnitRealVo>) 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<String, HeWeatherWeatherDailyResponse> 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<Long> deptList = Collections.singletonList(duty.getCreateDept());
List<Long> 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<Runnable>(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);

3
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<List<Dept>> getCurrentUserDept(@RequestParam(required = false) String name,@RequestParam(required = false) String type){
return R.data(deptService.getCurrentUserDept(name,type));

Loading…
Cancel
Save