Browse Source

#去除日志打印

zhongwei
yang_shj 2 months ago
parent
commit
df0d1bb202
  1. 1
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/DutyNoticeScheduledTask.java
  2. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java
  3. 6
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java
  4. 43
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java
  5. 1
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ShowServiceImpl.java
  6. 1
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java
  7. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/impl/DataServiceImpl.java
  8. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java

1
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/DutyNoticeScheduledTask.java

@ -109,7 +109,6 @@ public class DutyNoticeScheduledTask {
List<String> userList = userListByRoleAlias.stream().map(s -> s.getId().toString()).collect(Collectors.toList());
String userIds = String.join(",", userList);
if (StringUtils.isBlank(userIds)) {
log.error("推送的消息不能为空哦,{}", userIds);
throw new ServiceException("推送的消息不能为空");
}
message.setCreateUser(Long.valueOf(userList.get(0)));

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java

@ -128,7 +128,6 @@ public class AlarmServiceImpl implements AlarmService {
}
}
});
log.error("start_stop_alarm : {}",refresh);
redisTemplate.opsForValue().set(start_stop_cache_final,refresh);
}
@ -279,7 +278,6 @@ public class AlarmServiceImpl implements AlarmService {
alarm.setRealId(entity.getRealId());
alarm.setContext(entity.getSoeExplain());
alarm.setState(entity.getStatus());
log.error("send_interruption_msg : {}",JsonUtil.toJson(alarm));
mqttSender.sendToMqtt(InterruptionConstants.HZ3000_TOPIC_PREFIX + entity.getStationId(), JsonUtil.toJson(alarm));
});
}

6
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java

@ -206,10 +206,8 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService {
});
});
countDownLatch.countDown();
log.error("save_generation_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList()));
}catch (Exception e){
countDownLatch.countDown();
log.error("save_generation_execute_complete_error : {}" ,e.getMessage());
}
});
}
@ -356,10 +354,8 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService {
});
});
countDownLatch.countDown();
log.error("save_generation_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList()));
}catch (Exception e){
countDownLatch.countDown();
log.error("save_generation_execute_complete_error : {}" ,e.getMessage());
}
});
}
@ -450,10 +446,8 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService {
threeGenerateService.saveBatch(this.saveFillGenerate(station,start,end));
});
countDownLatch.countDown();
log.error("save_generation_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList()));
}catch (Exception e){
countDownLatch.countDown();
log.error("save_generation_execute_complete_error : {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList()));
}
});
}

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

@ -39,7 +39,6 @@ import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO;
import com.hnac.hzinfo.sdk.core.response.HzPage;
import com.hnac.hzinfo.sdk.core.response.Result;
import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient;
import com.xxl.job.core.log.XxlJobLogger;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
@ -698,21 +697,17 @@ public class RealTargetServiceImpl implements RealTargetService {
list.add(waterLevelVo);
}
countDownLatch.countDown();
XxlJobLogger.log("load_water_level : 子线程执行完成 {}", item.getInstanceCode());
} catch (Exception exception) {
countDownLatch.countDown();
XxlJobLogger.log("load_water_level_error : 子线程执行失败 {}", exception.getMessage());
}
});
}
try {
XxlJobLogger.log("load_water_level :等待线程执行");
countDownLatch.await();
} catch (InterruptedException e) {
e.printStackTrace();
Thread.currentThread().interrupt();
}
XxlJobLogger.log("load_water_level :线程执行结束");
redisTemplate.opsForValue().set(loadwater_level_key,list);
}
@ -1444,7 +1439,6 @@ public class RealTargetServiceImpl implements RealTargetService {
powerMap.put(station.getCode(),generateMap);
});
countDownLatch.countDown();
log.error("pool_item_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList()));
}catch (Exception e){
countDownLatch.countDown();
}
@ -1461,43 +1455,6 @@ public class RealTargetServiceImpl implements RealTargetService {
}
private Map<String, Float> lastReduceFirst(StationEntity station, List<EminfoAndEmParamVo> devices, String start, String end) {
List<PowerMonthVo> datas = new ArrayList<>();
// 设备采集发电量
if(CollectionUtil.isNotEmpty(devices)){
devices.forEach(device->{
List<Map<String, String>> records = dataService.lastFirstBySignage(start,end,7,5,device.getEmCode(),HomePageConstant.HYDROPOWER_GENERATE_POWER);
if(CollectionUtil.isEmpty(records)){
return;
}
datas.addAll(records.stream().map(record -> {
PowerMonthVo generate = new PowerMonthVo();
Date time;
if(record.get("ts").contains(".0")){
time = DateUtil.parse(record.get("ts"), "yyyy-MM-dd HH:mm:ss.s");
}else{
time = DateUtil.parse(record.get("ts") + ".0", "yyyy-MM-dd HH:mm:ss.s");
}
generate.setStrMonth(DateUtil.format(time,DateUtil.PATTERN_DATE));
String val = record.get(HomePageConstant.HYDROPOWER_GENERATE_POWER);
if(StringUtil.isEmpty(val)){
generate.setPower(0f);
}else{
generate.setPower(Float.parseFloat(String.valueOf(Double.parseDouble(val) * device.getRideCount())));
}
return generate;
}).collect(Collectors.toList()));
});
}
// 补充填报数据
datas.addAll(this.generateFill(station,start,end));
if(CollectionUtil.isEmpty(datas)){
return null;
}
return datas.stream().collect(Collectors.toMap(PowerMonthVo::getStrMonth, PowerMonthVo::getPower, Float::sum));
}
/**
* 近年发电量数据
*

1
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ShowServiceImpl.java

@ -627,7 +627,6 @@ public class ShowServiceImpl implements ShowService {
target.setTaget_three(0.0);
target.setTaget_four(0.0);
target.setCharge(0);
log.error("charge_target_exception: {} ", e.getMessage());
}
return target;
}

1
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java

@ -211,7 +211,6 @@ public class MonitorServiceImpl implements MonitorService {
if(CollectionUtil.isEmpty(realIds)){
return;
}
log.error("real_time_data: {},{}",stationReal.getStation(),realIds);
List<String> objects = redisClient.getBatchRealDataByRealId(stationReal.getStation(),realIds);
for(int i = 0; i < realIds.size() ;i++){
if(ObjectUtil.isNotEmpty(objects.get(i))){

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/impl/DataServiceImpl.java

@ -109,12 +109,10 @@ public class DataServiceImpl implements DataService {
analyzeDataConditionPO.setEndTime(LocalDateTime.parse(DateUtil.format(new Date(), endTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
signboardConditions.add(analyzeDataConditionPO);
po.setSignboardConditions(signboardConditions);
log.error("period_target_data_request {}",po);
R<List<AnalyzeDataConditionVO>> result = analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po);
if (!result.isSuccess() || CollectionUtil.isEmpty(result.getData())) {
return new ArrayList<>();
}
log.error("period_target_data_resp {}",result);
return result.getData().get(0).getList();
}
@ -147,12 +145,10 @@ public class DataServiceImpl implements DataService {
signboardConditions.add(analyzeDataConditionPO);
});
po.setSignboardConditions(signboardConditions);
log.error("period_targets_data_request {}",po);
R<List<AnalyzeDataConditionVO>> result = analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po);
if (!result.isSuccess() || CollectionUtil.isEmpty(result.getData())) {
return new ArrayList<>();
}
log.error("period_targets_data_resp {}",result);
return result.getData();
}

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

@ -225,7 +225,6 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
if(CollectionUtil.isEmpty(realStationVoList)){
return null;
}
log.info("步骤1获取所有监控缓存数据 耗时 : {}",System.currentTimeMillis() - beginTime);
beginTime = System.currentTimeMillis();
// 集中监控响应站点数据
List<RealStationVo> validList = realStationVoList.stream().filter(o -> message.getDeptIds().contains(o.getStationDeptId())).collect(Collectors.toList());
@ -240,11 +239,9 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
Map<String, HeWeatherWeatherNowResponse> nowWeather = this.weatherService.getNowWeather(codes);
// 七日内天气
Map<String, HeWeatherWeatherDailyResponse> weekWeather = this.weatherService.getWeekWeather(codes);
log.info("步骤2获取天气 耗时 : {}",System.currentTimeMillis() - beginTime);
beginTime = System.currentTimeMillis();
// 站点水位数据
List<WaterLevelVo> levelList = (List<WaterLevelVo>) redisTemplate.opsForValue().get(loadwater_level_key);
log.info("步骤3获取水位数据 耗时 : {}",System.currentTimeMillis() - beginTime);
beginTime = System.currentTimeMillis();
// 遍历站点
validList.forEach(item->{
@ -253,7 +250,6 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
// 前池水位
this.waterLevel(levelList,item);
});
log.info("步骤4站点数据处理 耗时 : {}",System.currentTimeMillis() - beginTime);
return new TextMessage(JSONObject.toJSONString(validList.stream().peek(o->{
if(ObjectUtil.isEmpty(o.getSort())){
o.setSort(999);

Loading…
Cancel
Save