暂降事件查询
This commit is contained in:
@@ -28,25 +28,21 @@ public class CsEquipmentDeliveryDTO {
|
|||||||
/**
|
/**
|
||||||
* id
|
* id
|
||||||
*/
|
*/
|
||||||
@TableField(value = "id")
|
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 装置名称
|
* 装置名称
|
||||||
*/
|
*/
|
||||||
@TableField(value = "name")
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 网关识别码
|
* 网关识别码
|
||||||
*/
|
*/
|
||||||
@TableField(value = "ndid")
|
|
||||||
private String ndid;
|
private String ndid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 装置mac地址
|
* 装置mac地址
|
||||||
*/
|
*/
|
||||||
@TableField(value = "mac")
|
|
||||||
private String mac;
|
private String mac;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -58,31 +54,26 @@ public class CsEquipmentDeliveryDTO {
|
|||||||
/**
|
/**
|
||||||
* 装置类型(直连设备、网关设备、装置)
|
* 装置类型(直连设备、网关设备、装置)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "dev_type")
|
|
||||||
private String devType;
|
private String devType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 装置型号(pqs588、pqs680...)
|
* 装置型号(pqs588、pqs680...)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "dev_model")
|
|
||||||
private String devModel;
|
private String devModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 装置接入方式(mqtt、cloud)
|
* 装置接入方式(mqtt、cloud)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "dev_access_method")
|
|
||||||
private String devAccessMethod;
|
private String devAccessMethod;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 装置程序版本
|
* 装置程序版本
|
||||||
*/
|
*/
|
||||||
@TableField(value = "program_version")
|
|
||||||
private String programVersion;
|
private String programVersion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 调试人员
|
* 调试人员
|
||||||
*/
|
*/
|
||||||
@TableField(value = "debug_person")
|
|
||||||
private String debugPerson;
|
private String debugPerson;
|
||||||
|
|
||||||
|
|
||||||
@@ -90,26 +81,23 @@ public class CsEquipmentDeliveryDTO {
|
|||||||
/**
|
/**
|
||||||
* 合同号
|
* 合同号
|
||||||
*/
|
*/
|
||||||
@TableField(value = "cntract_no")
|
|
||||||
private String cntractNo;
|
private String cntractNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 营销经理
|
* 营销经理
|
||||||
*/
|
*/
|
||||||
@TableField(value = "sales_manager")
|
|
||||||
private String salesManager;
|
private String salesManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接入状态(1:未注册 2:注册 3:接入)
|
* 接入状态(1:未注册 2:注册 3:接入)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "status")
|
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备状态(0:删除 1:离线 2:在线)
|
* 设备状态(0:删除 1:离线 2:在线)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "run_status")
|
|
||||||
private Integer runStatus;
|
private Integer runStatus;
|
||||||
|
|
||||||
|
private Integer moduleNumber;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -261,8 +261,10 @@ class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO>
|
|||||||
// userId = null;
|
// userId = null;
|
||||||
// }
|
// }
|
||||||
/*如何为空前端没传,查询所有*/
|
/*如何为空前端没传,查询所有*/
|
||||||
|
List<String> device = new ArrayList<>();
|
||||||
if(StringUtils.isEmpty(appProjectQueryParm.getEngineeringId())){
|
if(StringUtils.isEmpty(appProjectQueryParm.getEngineeringId())){
|
||||||
List<String> roleengineer = roleEngineerDevService.getRoleengineer();
|
List<String> roleengineer = roleEngineerDevService.getRoleengineer();
|
||||||
|
device = roleEngineerDevService.getDevice();
|
||||||
appProjectQueryParm.setEngineeringIds(roleengineer);
|
appProjectQueryParm.setEngineeringIds(roleengineer);
|
||||||
|
|
||||||
if(CollectionUtils.isEmpty(roleengineer)){
|
if(CollectionUtils.isEmpty(roleengineer)){
|
||||||
@@ -274,11 +276,17 @@ class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO>
|
|||||||
|
|
||||||
QueryWrapper<CsLedger> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<CsLedger> queryWrapper = new QueryWrapper<>();
|
||||||
returnpage = appProjectMapper.getPageVo (returnpage, appProjectQueryParm);
|
returnpage = appProjectMapper.getPageVo (returnpage, appProjectQueryParm);
|
||||||
|
List<String> finalDevice = device;
|
||||||
List<AppProjectVO> collect = returnpage.getRecords().stream().map(temp -> {
|
List<AppProjectVO> collect = returnpage.getRecords().stream().map(temp -> {
|
||||||
AppTopologyDiagramQueryParm appTopologyDiagramQueryParm = new AppTopologyDiagramQueryParm();
|
AppTopologyDiagramQueryParm appTopologyDiagramQueryParm = new AppTopologyDiagramQueryParm();
|
||||||
queryWrapper.clear();
|
Integer integer =0;
|
||||||
queryWrapper.lambda().eq(CsLedger::getPid,temp.getId()).eq(CsLedger::getState,1);
|
if(!CollectionUtils.isEmpty(finalDevice)){
|
||||||
Integer integer = csLedgerMapper.selectCount(queryWrapper);
|
queryWrapper.clear();
|
||||||
|
queryWrapper.lambda().eq(CsLedger::getPid,temp.getId()).eq(CsLedger::getState,1).in(CsLedger::getId, finalDevice);
|
||||||
|
|
||||||
|
integer = csLedgerMapper.selectCount(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
temp.setDevNum(integer);
|
temp.setDevNum(integer);
|
||||||
appTopologyDiagramQueryParm.setProjectId(temp.getId());
|
appTopologyDiagramQueryParm.setProjectId(temp.getId());
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ package com.njcn.csharmonic.service.impl;
|
|||||||
|
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||||
|
import com.njcn.csdevice.api.EquipmentFeignClient;
|
||||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||||
|
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
import com.njcn.csharmonic.pojo.vo.TemperatureVO;
|
import com.njcn.csharmonic.pojo.vo.TemperatureVO;
|
||||||
import com.njcn.csharmonic.service.TemperatureService;
|
import com.njcn.csharmonic.service.TemperatureService;
|
||||||
@@ -15,10 +17,12 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description:
|
* Description:
|
||||||
@@ -33,8 +37,11 @@ public class TemperatureServiceImpl implements TemperatureService {
|
|||||||
private final CommonService commonService;
|
private final CommonService commonService;
|
||||||
private final CsLineFeignClient csLineFeignClient;
|
private final CsLineFeignClient csLineFeignClient;
|
||||||
private final DicDataFeignClient dicDataFeignClient;
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
private final EquipmentFeignClient equipmentFeignClient;
|
||||||
@Override
|
@Override
|
||||||
public List<StatisticalDataDTO> queryTemperature(String devId) {
|
public List<StatisticalDataDTO> queryTemperature(String devId) {
|
||||||
|
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(devId).collect(Collectors.toList())).getData();
|
||||||
|
Integer moduleNumber = data1.get(0).getModuleNumber();
|
||||||
List<CsLinePO> csLinePOList = csLineFeignClient.queryLineByDevId(devId).getData();
|
List<CsLinePO> csLinePOList = csLineFeignClient.queryLineByDevId(devId).getData();
|
||||||
Optional.ofNullable(csLinePOList).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR));
|
Optional.ofNullable(csLinePOList).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR));
|
||||||
DictData data = dicDataFeignClient.getDicDataByCode(DicDataEnum.OUTPUT_SIDE.getCode()).getData();
|
DictData data = dicDataFeignClient.getDicDataByCode(DicDataEnum.OUTPUT_SIDE.getCode()).getData();
|
||||||
@@ -43,6 +50,14 @@ public class TemperatureServiceImpl implements TemperatureService {
|
|||||||
throw new BusinessException("不存在输出侧监测点,无温度信息");
|
throw new BusinessException("不存在输出侧监测点,无温度信息");
|
||||||
}
|
}
|
||||||
List<StatisticalDataDTO> topTemperature = commonService.getTopTemperature(collect.get(0).getLineId(), "apf_data", "Apf_Temp_Env");
|
List<StatisticalDataDTO> topTemperature = commonService.getTopTemperature(collect.get(0).getLineId(), "apf_data", "Apf_Temp_Env");
|
||||||
return topTemperature;
|
List<StatisticalDataDTO> result = new ArrayList<>();
|
||||||
|
for(int i = 0; i <moduleNumber; i++){
|
||||||
|
StatisticalDataDTO statisticalData = new StatisticalDataDTO();
|
||||||
|
int finalI = i;
|
||||||
|
StatisticalDataDTO statisticalDataDTO = topTemperature.stream().filter(tem -> Objects.equals(tem.getClDid(), finalI + "")).findFirst().orElse(new StatisticalDataDTO());
|
||||||
|
statisticalDataDTO.setClDid(finalI+"");
|
||||||
|
result.add(statisticalDataDTO);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user