Browse Source

#检修流程

zhongwei
yang_shj 1 year ago
parent
commit
f39f4844f3
  1. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/MapMarkerVo.java
  2. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HomeController.java
  3. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/HomeService.java
  4. 49
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java
  5. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java

3
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/MapMarkerVo.java

@ -33,4 +33,7 @@ public class MapMarkerVo {
@ApiModelProperty(value = "区域名称")
private String areaName;
@ApiModelProperty(value = "数据采集方式: 数据采集、数据填报")
private String dataOrigin;
}

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HomeController.java

@ -43,4 +43,12 @@ public class HomeController extends BladeController {
public R<List<TargetVo>> target(@ApiParam(value = "指标类型",required = true) Integer type) {
return R.data(service.target(type));
}
@ApiLog
@ApiOperation("黔东南指标")
@GetMapping("/blackTarget")
@ApiOperationSupport(order = 2)
public R<TargetVo> blackTarget() {
return R.data(service.blackTarget());
}
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/HomeService.java

@ -16,4 +16,6 @@ public interface HomeService {
List<StationCountVo> count();
List<TargetVo> target(Integer type);
TargetVo blackTarget();
}

49
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java

@ -537,4 +537,53 @@ public class HomeServiceImpl implements HomeService {
}
return stringBuilder.toString();
}
/**
* 黔东南指标
* @return
*/
@Override
public TargetVo blackTarget() {
TargetVo target = new TargetVo();
target.setType(HomePageConstant.HYDROPOWER);
target.setTypeName(DictCache.getValue("stationType", HomePageConstant.HYDROPOWER));
// 计划发电量
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE)
.eq(StationEntity::getType,HomePageConstant.HYDROPOWER));
// 实时数据
List<HydropowerUnitRealVo> reals = (List<HydropowerUnitRealVo>) redisTemplate.opsForValue().get(load_hydropower_unit_real_key);
// 指标数据
List<HydropowerUnitTargetVo> targets = (List<HydropowerUnitTargetVo>) redisTemplate.opsForValue().get(load_hydropower_unit_target_key);
if(CollectionUtil.isNotEmpty(reals)){
// 装机容量
target.setTaget_one(reals.stream().filter(real->stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(real.getDeptId())).mapToDouble(HydropowerUnitRealVo::getInstalledCapacity).sum());
}
if(CollectionUtil.isNotEmpty(targets)){
// 发电量
target.setTaget_two(targets.stream().filter(tar->stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(tar.getDeptId())).mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum());
}
if(CollectionUtil.isNotEmpty(stations)){
List<PlanGenerationEntity> plans = planService.getPlanGenerationByParam(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()), null, DateUtil.format(new Date(), "yyyy"));
if(CollectionUtil.isNotEmpty(plans)){
double plan = plans.stream().mapToDouble(PlanGenerationEntity::getPlanGeneration).sum();
if(Math.abs(plan) > 0){
target.setTaget_three(BigDecimal.valueOf(target.getTaget_two() / plan * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
}
}
}
// 双票合格率
R<List<Dept>> result = sysClient.getDeptList();
if(result.isSuccess() && CollectionUtil.isNotEmpty(result.getData()) && CollectionUtil.isNotEmpty(stations)){
List<Long> areas = result.getData().stream().filter(dept -> stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(dept.getId())).map(Dept::getParentId).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(areas)){
LocalDateTime firstDateTime = LocalDateTime.of(LocalDate.now().withDayOfYear(1), LocalTime.MIN);
DoublePassRateVO pass = ticketClient.getDoublePassRate(areas, firstDateTime, LocalDateTime.now());
if(ObjectUtil.isNotEmpty(pass)){
target.setTaget_four(Double.valueOf(pass.getDoublePassRate()));
}
}
}
return target;
}
}

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java

@ -129,6 +129,9 @@ public class SideHustleServiceImpl implements ISideHustleService {
@Value("${hzims.operation.realIdKey}")
public String real_id_key;
@Value("${hzims.equipment.emInfo.emInfoList}")
public String device_cache_cofig_final;
// 存储近年发电量Redis的key值
private final static String RECENT_YEAR_POWER_DATA = "hzims:operation:key:power:data";
@ -952,6 +955,7 @@ public class SideHustleServiceImpl implements ISideHustleService {
if(ObjectUtil.isEmpty(station)){
return;
}
vo.setDataOrigin(station.getDataOrigin());
vo.setLttd(station.getLttd());
vo.setLgtd(station.getLgtd());
String areaCode = station.getAreaCode();

Loading…
Cancel
Save