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. 18
      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")
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);
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)){
return new ArrayList<>();
}
List<ConverElectricityVo> electricitys = new ArrayList<>();
// 数据累计
datas.forEach(item->{
if(CollectionUtil.isEmpty(item.getList())){
if(CollectionUtil.isEmpty(datas)){
return;
}
item.getList().forEach(data->{
datas.forEach(data->{
ConverElectricityVo electricity = new ConverElectricityVo();
Date date = DateUtil.parse(data.getTs(), "yyyy-MM-dd HH:mm:ss.s");
electricity.setTime(DateUtil.format(date,DateUtil.PATTERN_DATE));
@ -519,14 +519,7 @@ public class HzimsDataServiceImpl implements HzimsDataService {
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
return datas;
}
// 功率查询
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;
return dataService.periodTargetDatas(start,end,3,2,result.getData(),HomePageConstant.ACTIVE_POWER);
}
/**

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<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);
}

18
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
*/
@Override
public List<AnalyzeDataConditionVO> periodTargetDatas(String startTime, String endTime, Integer accessRules, Integer cycleType, List<String> deviceCodes, String signages) {
AnalyseCodeByAnalyseDataPO po = new AnalyseCodeByAnalyseDataPO();
List<AnalyzeDataConditionPO> signboardConditions = new ArrayList<>();
public List<AnalyseDataTaosVO> periodTargetDatas(String startTime, String endTime, Integer accessRules, Integer cycleType, List<String> deviceCodes, String signages) {
List<AnalyseDataTaosVO> dataTaos = new ArrayList<>();
deviceCodes.forEach(deviceCode->{
AnalyseCodeByAnalyseDataPO po = new AnalyseCodeByAnalyseDataPO();
po.setDeviceCode(deviceCode);
AnalyzeDataConditionPO analyzeDataConditionPO = new AnalyzeDataConditionPO();
analyzeDataConditionPO.setFull(1);
po.setDeviceCode(deviceCode);
analyzeDataConditionPO.setSignages(signages);
analyzeDataConditionPO.setKeepFigures(2);
analyzeDataConditionPO.setAccessRules(accessRules);
@ -109,16 +109,16 @@ public class AnalyseDataServiceImpl implements IAnalyseDataService {
analyzeDataConditionPO.setTimeInterval(1);
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)));
signboardConditions.add(analyzeDataConditionPO);
});
po.setSignboardConditions(signboardConditions);
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 new ArrayList<>();
return;
}
log.error("period_target_data_resp {}",result);
return result.getData();
dataTaos.addAll(result.getData().get(0).getList());
});
return dataTaos;
}

Loading…
Cancel
Save