Browse Source

fix:近三年发电量日志打印

zhongwei
ty 7 months ago
parent
commit
7bd0df680d
  1. 8
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java

8
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java

@ -120,12 +120,6 @@ public class RealTargetServiceImpl implements RealTargetService {
private final static String loadwater_level_key = "hzims:operation:loadwater:level:key"; private final static String loadwater_level_key = "hzims:operation:loadwater:level:key";
private final static String load_photovoltaic_real_key = "hzims:operation:photovoltaic:real:key"; private final static String load_photovoltaic_real_key = "hzims:operation:photovoltaic:real:key";
private final static String load_photovoltaic_target_key = "hzims:operation:photovoltaic:target:key"; private final static String load_photovoltaic_target_key = "hzims:operation:photovoltaic:target:key";
@Getter
private static final ThreadPoolExecutor fixedThreadExecutor;
static {
ThreadFactory threadFactory = Executors.defaultThreadFactory();
fixedThreadExecutor = new ThreadPoolExecutor(5, 5, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingDeque(), threadFactory);
}
@Override @Override
public void loadEmInfo(String param) { public void loadEmInfo(String param) {
@ -1254,7 +1248,6 @@ public class RealTargetServiceImpl implements RealTargetService {
Long time2=System.currentTimeMillis(); Long time2=System.currentTimeMillis();
log.info("近年发电量接口,数据组装"+(time2-time)); log.info("近年发电量接口,数据组装"+(time2-time));
stationList.forEach(station -> { stationList.forEach(station -> {
fixedThreadExecutor.execute(()->{
// 站点设备集合 // 站点设备集合
List<EminfoAndEmParamVo> stationDevices = devices.stream().filter(device -> device.getCreateDept().equals(station.getRefDept())).collect(Collectors.toList()); List<EminfoAndEmParamVo> stationDevices = devices.stream().filter(device -> device.getCreateDept().equals(station.getRefDept())).collect(Collectors.toList());
log.error("load_power_data station :" + station.getCode() + "==== device :" + stationDevices ); log.error("load_power_data station :" + station.getCode() + "==== device :" + stationDevices );
@ -1264,7 +1257,6 @@ public class RealTargetServiceImpl implements RealTargetService {
} }
powerMap.put(station.getId(),generateMap); powerMap.put(station.getId(),generateMap);
}); });
});
redisTemplate.opsForValue().set(recent_year_power_data, powerMap); redisTemplate.opsForValue().set(recent_year_power_data, powerMap);
Long time3=System.currentTimeMillis(); Long time3=System.currentTimeMillis();
log.info("近年发电量数据接口,总耗时:"+(time3-time)); log.info("近年发电量数据接口,总耗时:"+(time3-time));

Loading…
Cancel
Save