Browse Source

#乌兹别克功率数据处理

zhongwei
yang_shj 9 months ago
parent
commit
843134665e
  1. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/entity/UserDeptEntity.java
  2. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/service/impl/HzimsDataServiceImpl.java
  3. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/IAnalyseDataService.java
  4. 26
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AnalyseDataServiceImpl.java

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/entity/UserDeptEntity.java

@ -28,6 +28,4 @@ public class UserDeptEntity extends TenantEntity implements Serializable {
@ApiModelProperty("机构Id") @ApiModelProperty("机构Id")
private Long deptId; private Long deptId;
} }

15
hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/service/impl/HzimsDataServiceImpl.java

@ -411,17 +411,17 @@ public class HzimsDataServiceImpl implements HzimsDataService {
calendar.add(Calendar.DAY_OF_MONTH,-30); calendar.add(Calendar.DAY_OF_MONTH,-30);
String startTime = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); String startTime = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
// 功率查询 // 功率查询
List<AnalyzeDataConditionVO> datas = dataService.periodTargetDatas(startTime,endTime,3,2,result.getData(),HomePageConstant.ACTIVE_POWER); List<AnalyseDataTaosVO> datas = dataService.periodTargetDatas(startTime,endTime,3,2,result.getData(),HomePageConstant.ACTIVE_POWER);
if(CollectionUtil.isEmpty(datas)){ if(CollectionUtil.isEmpty(datas)){
return new ArrayList<>(); return new ArrayList<>();
} }
List<ConverElectricityVo> electricitys = new ArrayList<>(); List<ConverElectricityVo> electricitys = new ArrayList<>();
// 数据累计 // 数据累计
datas.forEach(item->{ datas.forEach(item->{
if(CollectionUtil.isEmpty(item.getList())){ if(CollectionUtil.isEmpty(datas)){
return; return;
} }
item.getList().forEach(data->{ datas.forEach(data->{
ConverElectricityVo electricity = new ConverElectricityVo(); ConverElectricityVo electricity = new ConverElectricityVo();
Date date = DateUtil.parse(data.getTs(), "yyyy-MM-dd HH:mm:ss.s"); Date date = DateUtil.parse(data.getTs(), "yyyy-MM-dd HH:mm:ss.s");
electricity.setTime(DateUtil.format(date,DateUtil.PATTERN_DATE)); electricity.setTime(DateUtil.format(date,DateUtil.PATTERN_DATE));
@ -519,14 +519,7 @@ public class HzimsDataServiceImpl implements HzimsDataService {
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){ if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
return datas; return datas;
} }
// 功率查询 return dataService.periodTargetDatas(start,end,3,2,result.getData(),HomePageConstant.ACTIVE_POWER);
List<AnalyzeDataConditionVO> loads = dataService.periodTargetDatas(start,end,3,2,result.getData(),HomePageConstant.ACTIVE_POWER);
if(!CollectionUtil.isEmpty(loads)){
loads.forEach(load->{
datas.addAll(load.getList());
});
}
return datas;
} }
/** /**

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

@ -18,7 +18,7 @@ public interface IAnalyseDataService {
List<AnalyseDataTaosVO> periodTargetData(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, String signages); List<AnalyseDataTaosVO> periodTargetData(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, String signages);
List<AnalyzeDataConditionVO> periodTargetDatas(String startTime, String endTime, Integer accessRules, Integer cycleType, List<String> deviceCodes, String signages); List<AnalyseDataTaosVO> periodTargetDatas(String startTime, String endTime, Integer accessRules, Integer cycleType, List<String> deviceCodes, String signages);
Float periodTargetFloat(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, Integer ride ,String signages); Float periodTargetFloat(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, Integer ride ,String signages);
} }

26
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AnalyseDataServiceImpl.java

@ -94,13 +94,13 @@ public class AnalyseDataServiceImpl implements IAnalyseDataService {
* @return * @return
*/ */
@Override @Override
public List<AnalyzeDataConditionVO> periodTargetDatas(String startTime, String endTime, Integer accessRules, Integer cycleType, List<String> deviceCodes, String signages) { public List<AnalyseDataTaosVO> periodTargetDatas(String startTime, String endTime, Integer accessRules, Integer cycleType, List<String> deviceCodes, String signages) {
AnalyseCodeByAnalyseDataPO po = new AnalyseCodeByAnalyseDataPO(); List<AnalyseDataTaosVO> dataTaos = new ArrayList<>();
List<AnalyzeDataConditionPO> signboardConditions = new ArrayList<>();
deviceCodes.forEach(deviceCode->{ deviceCodes.forEach(deviceCode->{
AnalyseCodeByAnalyseDataPO po = new AnalyseCodeByAnalyseDataPO();
po.setDeviceCode(deviceCode);
AnalyzeDataConditionPO analyzeDataConditionPO = new AnalyzeDataConditionPO(); AnalyzeDataConditionPO analyzeDataConditionPO = new AnalyzeDataConditionPO();
analyzeDataConditionPO.setFull(1); analyzeDataConditionPO.setFull(1);
po.setDeviceCode(deviceCode);
analyzeDataConditionPO.setSignages(signages); analyzeDataConditionPO.setSignages(signages);
analyzeDataConditionPO.setKeepFigures(2); analyzeDataConditionPO.setKeepFigures(2);
analyzeDataConditionPO.setAccessRules(accessRules); analyzeDataConditionPO.setAccessRules(accessRules);
@ -109,16 +109,16 @@ public class AnalyseDataServiceImpl implements IAnalyseDataService {
analyzeDataConditionPO.setTimeInterval(1); analyzeDataConditionPO.setTimeInterval(1);
analyzeDataConditionPO.setBeginTime(LocalDateTime.parse(DateUtil.format(new Date(), startTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME))); analyzeDataConditionPO.setBeginTime(LocalDateTime.parse(DateUtil.format(new Date(), startTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
analyzeDataConditionPO.setEndTime(LocalDateTime.parse(DateUtil.format(new Date(), endTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME))); analyzeDataConditionPO.setEndTime(LocalDateTime.parse(DateUtil.format(new Date(), endTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
signboardConditions.add(analyzeDataConditionPO); po.setSignboardConditions(Collections.singletonList(analyzeDataConditionPO));
log.error("period_target_data_request {}",po);
R<List<AnalyzeDataConditionVO>> result = analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po);
if (!result.isSuccess() || CollectionUtil.isEmpty(result.getData())) {
return;
}
log.error("period_target_data_resp {}",result);
dataTaos.addAll(result.getData().get(0).getList());
}); });
po.setSignboardConditions(signboardConditions); return dataTaos;
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();
} }

Loading…
Cancel
Save