代码提交

This commit is contained in:
huangzj
2023-10-11 09:57:29 +08:00
parent 3faf9a39d5
commit 60dcf51013
12 changed files with 129 additions and 69 deletions

View File

@@ -99,5 +99,5 @@ public class CsEquipmentDeliveryDTO {
private Integer runStatus; private Integer runStatus;
private Integer moduleNumber; private Integer moduleNumber;
private Integer process;
} }

View File

@@ -23,4 +23,7 @@ public class LineParamDTO {
@ApiModelProperty(value = "设备id") @ApiModelProperty(value = "设备id")
private String devId; private String devId;
@ApiModelProperty(value = "监测点id")
private String lineId;
} }

View File

@@ -40,7 +40,7 @@
</select> </select>
<select id="queryLine" resultType="com.njcn.csdevice.pojo.po.CsLedger"> <select id="queryLine" resultType="com.njcn.csdevice.pojo.po.CsLedger">
select id from cs_ledger a where a.`Level`='3' and a.state='1' select * from cs_ledger a where a.`Level`='3' and a.state='1'
<if test="lineParamdto.engineerId!=null and lineParamdto.engineerId!=''"> <if test="lineParamdto.engineerId!=null and lineParamdto.engineerId!=''">
and FIND_IN_SET(#{lineParamdto.engineerId}, a.pids ) and FIND_IN_SET(#{lineParamdto.engineerId}, a.pids )
</if> </if>
@@ -50,6 +50,9 @@
<if test="lineParamdto.devId!=null and lineParamdto.devId!=''"> <if test="lineParamdto.devId!=null and lineParamdto.devId!=''">
and FIND_IN_SET(#{lineParamdto.devId}, a.pids ) and FIND_IN_SET(#{lineParamdto.devId}, a.pids )
</if> </if>
<if test="lineParamdto.lineId!=null and lineParamdto.lineId!=''">
and a.id=#{lineParamdto.lineId}
</if>
</select> </select>

View File

@@ -33,6 +33,10 @@ public class CommonStatisticalQueryParam {
@ApiModelProperty(value = "结束时间") @ApiModelProperty(value = "结束时间")
private String endTime; private String endTime;
private String process;

View File

@@ -97,4 +97,10 @@ public class CsEventPO extends BaseEntity {
*/ */
@TableField(value = "location") @TableField(value = "location")
private String location; private String location;
/**
* 用于数据控制 1:设备登记2功能调试3出厂调试 4设备投运)
*/
@TableField(value = "process")
private String process;
} }

View File

@@ -38,54 +38,54 @@ public class StableDataController extends BaseController {
private final StableDataService stableDataService; private final StableDataService stableDataService;
//
@OperateInfo(info = LogEnum.BUSINESS_COMMON) // @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryFisrtThdData") // @PostMapping("/queryFisrtThdData")
@ApiOperation("查询谐波畸变率实时数据") // @ApiOperation("查询谐波畸变率实时数据")
@ApiImplicitParams({ // @ApiImplicitParams({
@ApiImplicitParam(name = "devId", value = "设备id", required = true), // @ApiImplicitParam(name = "devId", value = "设备id", required = true),
@ApiImplicitParam(name = "statisticalName", value = "统计指标name", required = true) // @ApiImplicitParam(name = "statisticalName", value = "统计指标name", required = true)
}) // })
public HttpResult<List<ThdDataVO>> queryFisrtThdData(@RequestParam("devId") String devId, @RequestParam("statisticalName") String statisticalName) { // public HttpResult<List<ThdDataVO>> queryFisrtThdData(@RequestParam("devId") String devId, @RequestParam("statisticalName") String statisticalName) {
String methodDescribe = getMethodDescribe("queryThdData"); // String methodDescribe = getMethodDescribe("queryThdData");
List<ThdDataVO> list = stableDataService.queryThdData(devId, statisticalName); // List<ThdDataVO> list = stableDataService.queryThdData(devId, statisticalName);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); // return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
} // }
//
@OperateInfo(info = LogEnum.BUSINESS_COMMON) // @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryThdDataByTime") // @PostMapping("/queryThdDataByTime")
@ApiOperation("查询时间段内谐波畸变率") // @ApiOperation("查询时间段内谐波畸变率")
@ApiImplicitParam(name = "thdDataQueryParm", value = "查询参数", required = true) // @ApiImplicitParam(name = "thdDataQueryParm", value = "查询参数", required = true)
public HttpResult<List<ThdDataVO>> queryThdDataByTime(@RequestBody @Validated ThdDataQueryParm thdDataQueryParm) { // public HttpResult<List<ThdDataVO>> queryThdDataByTime(@RequestBody @Validated ThdDataQueryParm thdDataQueryParm) {
String methodDescribe = getMethodDescribe("queryThdDataByTime"); // String methodDescribe = getMethodDescribe("queryThdDataByTime");
List<ThdDataVO> list = stableDataService.queryThdDataByTime(thdDataQueryParm); // List<ThdDataVO> list = stableDataService.queryThdDataByTime(thdDataQueryParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); // return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
//
} // }
//
@OperateInfo(info = LogEnum.BUSINESS_COMMON) // @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryFisrtThdContent") // @PostMapping("/queryFisrtThdContent")
@ApiOperation("查询谐波含量实时数据") // @ApiOperation("查询谐波含量实时数据")
@ApiImplicitParams({ // @ApiImplicitParams({
@ApiImplicitParam(name = "devId", value = "设备id", required = true), // @ApiImplicitParam(name = "devId", value = "设备id", required = true),
@ApiImplicitParam(name = "statisticalName", value = "统计指标name", required = true) // @ApiImplicitParam(name = "statisticalName", value = "统计指标name", required = true)
}) // })
public HttpResult<List<ThdDataVO>> queryFisrtThdContent(@RequestParam("devId") String devId, @RequestParam("statisticalName") String statisticalName) { // public HttpResult<List<ThdDataVO>> queryFisrtThdContent(@RequestParam("devId") String devId, @RequestParam("statisticalName") String statisticalName) {
String methodDescribe = getMethodDescribe("queryFisrtThdContent"); // String methodDescribe = getMethodDescribe("queryFisrtThdContent");
List<ThdDataVO> list = stableDataService.queryFisrtThdContent(devId, statisticalName); // List<ThdDataVO> list = stableDataService.queryFisrtThdContent(devId, statisticalName);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); // return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
} // }
//
@OperateInfo(info = LogEnum.BUSINESS_COMMON) // @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryThdContentByTime") // @PostMapping("/queryThdContentByTime")
@ApiOperation("查询时间段内谐波畸变率") // @ApiOperation("查询时间段内谐波畸变率")
@ApiImplicitParam(name = "thdDataQueryParm", value = "查询参数", required = true) // @ApiImplicitParam(name = "thdDataQueryParm", value = "查询参数", required = true)
public HttpResult<List<ThdDataVO>> queryThdContentByTime(@RequestBody @Validated ThdDataQueryParm thdDataQueryParm) { // public HttpResult<List<ThdDataVO>> queryThdContentByTime(@RequestBody @Validated ThdDataQueryParm thdDataQueryParm) {
String methodDescribe = getMethodDescribe("queryThdContentByTime"); // String methodDescribe = getMethodDescribe("queryThdContentByTime");
List<ThdDataVO> list = stableDataService.queryThdContentByTime(thdDataQueryParm); // List<ThdDataVO> list = stableDataService.queryThdContentByTime(thdDataQueryParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); // return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
//
} // }
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryFisrtCommonStatistical") @PostMapping("/queryFisrtCommonStatistical")
@ApiOperation("查询实时数据") @ApiOperation("查询实时数据")

View File

@@ -21,7 +21,7 @@ import java.util.List;
public interface CsEventUserPOMapper extends BaseMapper<CsEventUserPO> { public interface CsEventUserPOMapper extends BaseMapper<CsEventUserPO> {
Integer queryEventCount(@Param("csEventUserQueryParam") CsEventUserQueryParam csEventUserQueryParam); Integer queryEventCount(@Param("csEventUserQueryParam") CsEventUserQueryParam csEventUserQueryParam);
List<EventDetailVO> queryUserEventList(@Param("csEventUserQueryParam") CsEventUserQueryParam csEventUserQueryParam, @Param("devIds") List<String> devIds); List<EventDetailVO> queryUserEventList(@Param("csEventUserQueryParam") CsEventUserQueryParam csEventUserQueryParam, @Param("devIds") List<String> devIds, @Param("flag") Boolean flag);
Page<EventDetailVO> queryEventpage(Page<EventDetailVO> returnpage, @Param("csEventUserQueryPage") CsEventUserQueryPage csEventUserQueryPage, @Param("devIds") List<String> devIds); Page<EventDetailVO> queryEventpage(Page<EventDetailVO> returnpage, @Param("csEventUserQueryPage") CsEventUserQueryPage csEventUserQueryPage, @Param("devIds") List<String> devIds, @Param("flag") Boolean flag);
} }

View File

@@ -29,10 +29,17 @@
</select> </select>
<select id="queryUserEventList" resultType="com.njcn.csharmonic.pojo.vo.EventDetailVO"> <select id="queryUserEventList" resultType="com.njcn.csharmonic.pojo.vo.EventDetailVO">
select DISTINCT a.event_id id,a.status status,b.device_id deviceId,b.line_id lineId, select DISTINCT a.event_id id,
<if test="flag">
a.status status,
</if>
<if test="!flag">
1 status,
</if>
b.device_id deviceId,b.line_id lineId,
b.start_time startTime,b.tag tag ,b.wave_path wavePath,b.instant_pics,b.rms_pics , b.type type b.start_time startTime,b.tag tag ,b.wave_path wavePath,b.instant_pics,b.rms_pics , b.type type
from cs_event_user a inner join cs_event b on a.event_id=b.id where 1=1 from cs_event_user a inner join cs_event b on a.event_id=b.id inner join cs_equipment_delivery c on b.device_id=c.id where 1=1
and b.process=c.process
<if test="csEventUserQueryParam!=null and csEventUserQueryParam.endTime != null and csEventUserQueryParam.endTime !=''"> <if test="csEventUserQueryParam!=null and csEventUserQueryParam.endTime != null and csEventUserQueryParam.endTime !=''">
AND DATE(b.start_time) &lt;= DATE(#{csEventUserQueryParam.endTime}) AND DATE(b.start_time) &lt;= DATE(#{csEventUserQueryParam.endTime})
</if> </if>
@@ -68,10 +75,17 @@
</select> </select>
<select id="queryEventpage" resultType="com.njcn.csharmonic.pojo.vo.EventDetailVO"> <select id="queryEventpage" resultType="com.njcn.csharmonic.pojo.vo.EventDetailVO">
select DISTINCT a.event_id id,a.status status,b.device_id deviceId,b.line_id lineId, select DISTINCT a.event_id id,
<if test="flag">
a.status status,
</if>
<if test="!flag">
1 status,
</if>
b.device_id deviceId,b.line_id lineId,
b.start_time startTime,b.tag tag ,b.wave_path wavePath,b.instant_pics,b.rms_pics , b.type type b.start_time startTime,b.tag tag ,b.wave_path wavePath,b.instant_pics,b.rms_pics , b.type type
from cs_event_user a inner join cs_event b on a.event_id=b.id where 1=1 from cs_event_user a inner join cs_event b on a.event_id=b.id inner join cs_equipment_delivery c on b.device_id=c.id where 1=1
and b.process=c.process
<if test="csEventUserQueryPage!=null and csEventUserQueryPage.endTime != null and csEventUserQueryPage.endTime !=''"> <if test="csEventUserQueryPage!=null and csEventUserQueryPage.endTime != null and csEventUserQueryPage.endTime !=''">
AND DATE(b.start_time) &lt;= DATE(#{csEventUserQueryPage.endTime}) AND DATE(b.start_time) &lt;= DATE(#{csEventUserQueryPage.endTime})
</if> </if>

View File

@@ -68,6 +68,8 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
public List<EventDetailVO> queryUserEventList(CsEventUserQueryParam csEventUserQueryParam) { public List<EventDetailVO> queryUserEventList(CsEventUserQueryParam csEventUserQueryParam) {
csEventUserQueryParam.setUserId(RequestUtil.getUserIndex()); csEventUserQueryParam.setUserId(RequestUtil.getUserIndex());
String role = RequestUtil.getUserRole(); String role = RequestUtil.getUserRole();
Boolean flag =Boolean.TRUE;
if(Objects.equals(role, LogInfo.UNKNOWN_ROLE)){ if(Objects.equals(role, LogInfo.UNKNOWN_ROLE)){
return new ArrayList<>(); return new ArrayList<>();
} }
@@ -81,6 +83,8 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
} }
if( Objects.equals(role, AppRoleEnum.OPERATION_MANAGER.getCode())||Objects.equals(role, AppRoleEnum.ROOT.getCode())){ if( Objects.equals(role, AppRoleEnum.OPERATION_MANAGER.getCode())||Objects.equals(role, AppRoleEnum.ROOT.getCode())){
csEventUserQueryParam.setUserId(null); csEventUserQueryParam.setUserId(null);
flag = Boolean.FALSE;
} }
// if(CollectionUtil.isEmpty(csEventUserQueryParam.getTarget())&&Objects.equals(csEventUserQueryParam.getType(),"0")){ // if(CollectionUtil.isEmpty(csEventUserQueryParam.getTarget())&&Objects.equals(csEventUserQueryParam.getType(),"0")){
// /*获取所有暂态事件类型*/ // /*获取所有暂态事件类型*/
@@ -101,7 +105,7 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
if (CollectionUtils.isEmpty(collect)){ if (CollectionUtils.isEmpty(collect)){
return new ArrayList<>(); return new ArrayList<>();
} }
List<EventDetailVO> list = this.getBaseMapper().queryUserEventList(csEventUserQueryParam,collect); List<EventDetailVO> list = this.getBaseMapper().queryUserEventList(csEventUserQueryParam,collect,flag);
// 主要用于统计不关心详情,详情重分页查询获取 // 主要用于统计不关心详情,详情重分页查询获取
// list.forEach(temp->{ // list.forEach(temp->{
// DevDetailDTO devDetail = csLedgerFeignClient.queryDevDetail(temp.getDeviceId()).getData(); // DevDetailDTO devDetail = csLedgerFeignClient.queryDevDetail(temp.getDeviceId()).getData();
@@ -208,7 +212,7 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
@Override @Override
public Page<EventDetailVO> queryEventpage(CsEventUserQueryPage csEventUserQueryPage) { public Page<EventDetailVO> queryEventpage(CsEventUserQueryPage csEventUserQueryPage) {
Page<EventDetailVO> returnpage = new Page<> (csEventUserQueryPage.getPageNum ( ), csEventUserQueryPage.getPageSize ( )); Page<EventDetailVO> returnpage = new Page<> (csEventUserQueryPage.getPageNum ( ), csEventUserQueryPage.getPageSize ( ));
Boolean flag =Boolean.TRUE;
csEventUserQueryPage.setUserId(RequestUtil.getUserIndex()); csEventUserQueryPage.setUserId(RequestUtil.getUserIndex());
String role = RequestUtil.getUserRole(); String role = RequestUtil.getUserRole();
@@ -225,6 +229,7 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
} }
if( Objects.equals(role, AppRoleEnum.OPERATION_MANAGER.getCode())||Objects.equals(role, AppRoleEnum.ROOT.getCode())){ if( Objects.equals(role, AppRoleEnum.OPERATION_MANAGER.getCode())||Objects.equals(role, AppRoleEnum.ROOT.getCode())){
csEventUserQueryPage.setUserId(null); csEventUserQueryPage.setUserId(null);
flag = Boolean.FALSE;
} }
List<String> deviceId = new ArrayList<>(); List<String> deviceId = new ArrayList<>();
List<CsLedgerVO> data = csLedgerFeignClient.getDeviceTree().getData(); List<CsLedgerVO> data = csLedgerFeignClient.getDeviceTree().getData();
@@ -247,7 +252,7 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
} }
returnpage = this.getBaseMapper().queryEventpage(returnpage,csEventUserQueryPage,collect); returnpage = this.getBaseMapper().queryEventpage(returnpage,csEventUserQueryPage,collect,flag);
returnpage.getRecords().forEach(temp->{ returnpage.getRecords().forEach(temp->{
DevDetailDTO devDetail = csLedgerFeignClient.queryDevDetail(temp.getDeviceId()).getData(); DevDetailDTO devDetail = csLedgerFeignClient.queryDevDetail(temp.getDeviceId()).getData();

View File

@@ -1,6 +1,11 @@
package com.njcn.csharmonic.service.impl; package com.njcn.csharmonic.service.impl;
import com.njcn.csdevice.api.CsLedgerFeignClient;
import com.njcn.csdevice.api.DataArrayFeignClient; import com.njcn.csdevice.api.DataArrayFeignClient;
import com.njcn.csdevice.api.EquipmentFeignClient;
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
import com.njcn.csdevice.pojo.dto.LineParamDTO;
import com.njcn.csdevice.pojo.po.CsLedger;
import com.njcn.csharmonic.param.DevicDataTrendQueryParam; import com.njcn.csharmonic.param.DevicDataTrendQueryParam;
import com.njcn.csharmonic.pojo.vo.ThdDataVO; import com.njcn.csharmonic.pojo.vo.ThdDataVO;
import com.njcn.csharmonic.service.DeviceDataTrendService; import com.njcn.csharmonic.service.DeviceDataTrendService;
@@ -32,6 +37,8 @@ public class DeviceDataTrendServiceImpl implements DeviceDataTrendService {
private final EpdFeignClient epdFeignClient; private final EpdFeignClient epdFeignClient;
private final CommonService commonService; private final CommonService commonService;
private final DataArrayFeignClient dataArrayFeignClient; private final DataArrayFeignClient dataArrayFeignClient;
private final CsLedgerFeignClient csLedgerFeignClient;
private final EquipmentFeignClient equipmentFeignClient;
@Override @Override
public List<List<ThdDataVO>> queryDataTrend(DevicDataTrendQueryParam devicDataTrendQueryParam) { public List<List<ThdDataVO>> queryDataTrend(DevicDataTrendQueryParam devicDataTrendQueryParam) {
List<List<ThdDataVO>> result = new ArrayList<>(); List<List<ThdDataVO>> result = new ArrayList<>();
@@ -39,8 +46,10 @@ public class DeviceDataTrendServiceImpl implements DeviceDataTrendService {
if(CollectionUtils.isEmpty(devicDataTrendQueryParam.getStatisticalParams())){ if(CollectionUtils.isEmpty(devicDataTrendQueryParam.getStatisticalParams())){
return result; return result;
} }
LineParamDTO lineParamDTO = new LineParamDTO();
lineParamDTO.setLineId(devicDataTrendQueryParam.getLineId());
List<CsLedger> data = csLedgerFeignClient.queryLine(lineParamDTO).getData();
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(data.get(0).getPid()).collect(Collectors.toList())).getData();
devicDataTrendQueryParam.getStatisticalParams().forEach(temp->{ devicDataTrendQueryParam.getStatisticalParams().forEach(temp->{
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(Stream.of(devicDataTrendQueryParam.getLineId()).collect(Collectors.toList()), List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(Stream.of(devicDataTrendQueryParam.getLineId()).collect(Collectors.toList()),
@@ -48,7 +57,8 @@ public class DeviceDataTrendServiceImpl implements DeviceDataTrendService {
temp.getName(), temp.getPhase(), temp.getName(), temp.getPhase(),
temp.getStatMethod(), temp.getStatMethod(),
devicDataTrendQueryParam.getStartTime(), devicDataTrendQueryParam.getStartTime(),
devicDataTrendQueryParam.getEndTime()); devicDataTrendQueryParam.getEndTime(),
data1.get(0).getProcess()+"");
List<ThdDataVO> collect1 = deviceRtData.stream().map(statisticalDataDTO -> { List<ThdDataVO> collect1 = deviceRtData.stream().map(statisticalDataDTO -> {
ThdDataVO vo = new ThdDataVO(); ThdDataVO vo = new ThdDataVO();
vo.setLineId(statisticalDataDTO.getLineId()); vo.setLineId(statisticalDataDTO.getLineId());

View File

@@ -4,7 +4,9 @@ import cn.hutool.core.collection.CollectionUtil;
import com.njcn.common.pojo.exception.BusinessException; import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.csdevice.api.CsLedgerFeignClient; import com.njcn.csdevice.api.CsLedgerFeignClient;
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.csdevice.utils.ReflectUtils; import com.njcn.csdevice.utils.ReflectUtils;
import com.njcn.csharmonic.param.CommonStatisticalQueryParam; import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
@@ -37,6 +39,7 @@ 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:
@@ -60,6 +63,8 @@ public class StableDataServiceImpl implements StableDataService {
private final InfluxDbUtils influxDbUtils; private final InfluxDbUtils influxDbUtils;
private final CsStatisticalSetFeignClient csStatisticalSetFeignClient; private final CsStatisticalSetFeignClient csStatisticalSetFeignClient;
private final EquipmentFeignClient equipmentFeignClient;
@Override @Override
public List<ThdDataVO> queryThdData(String devId, String statisticalName) { public List<ThdDataVO> queryThdData(String devId, String statisticalName) {
@@ -180,6 +185,7 @@ public class StableDataServiceImpl implements StableDataService {
csLinePOList = csLineFeignClient.queryLineByDevId(commonStatisticalQueryParam.getDevId()).getData(); csLinePOList = csLineFeignClient.queryLineByDevId(commonStatisticalQueryParam.getDevId()).getData();
} }
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(commonStatisticalQueryParam.getDevId()).collect(Collectors.toList())).getData();
String areaId = dicDataFeignClient.getDicDataByCode(DicDataEnum.OUTPUT_SIDE.getCode()).getData().getId(); String areaId = dicDataFeignClient.getDicDataByCode(DicDataEnum.OUTPUT_SIDE.getCode()).getData().getId();
Optional.ofNullable(csLinePOList).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR)); Optional.ofNullable(csLinePOList).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR));
@@ -195,7 +201,7 @@ public class StableDataServiceImpl implements StableDataService {
}else { }else {
frequency = "_"+commonStatisticalQueryParam.getFrequency(); frequency = "_"+commonStatisticalQueryParam.getFrequency();
} }
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtData(collect, data.getClassId(), data.getName()+frequency, data.getPhase(), commonStatisticalQueryParam.getValueType()); List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtData(collect, data.getClassId(), data.getName()+frequency, data.getPhase(), commonStatisticalQueryParam.getValueType(),data1.get(0).getProcess()+"");
List<CsLinePO> finalCsLinePOList = csLinePOList; List<CsLinePO> finalCsLinePOList = csLinePOList;
String finalFrequency = frequency; String finalFrequency = frequency;
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> { List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
@@ -227,6 +233,9 @@ public class StableDataServiceImpl implements StableDataService {
List<ThdDataVO> result = new ArrayList(); List<ThdDataVO> result = new ArrayList();
Optional.ofNullable(commonStatisticalQueryParam.getDevId()).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.DEVICE_LOSE)); Optional.ofNullable(commonStatisticalQueryParam.getDevId()).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.DEVICE_LOSE));
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(commonStatisticalQueryParam.getDevId()).collect(Collectors.toList())).getData();
List<CsLinePO> csLinePOList = csLineFeignClient.queryLineByDevId(commonStatisticalQueryParam.getDevId()).getData(); List<CsLinePO> csLinePOList = csLineFeignClient.queryLineByDevId(commonStatisticalQueryParam.getDevId()).getData();
if(CollectionUtil.isEmpty(csLinePOList)){ if(CollectionUtil.isEmpty(csLinePOList)){
@@ -245,7 +254,7 @@ public class StableDataServiceImpl implements StableDataService {
List<String> finalCollect = collect; List<String> finalCollect = collect;
data.forEach(epdPqd->{ data.forEach(epdPqd->{
String frequency = Optional.ofNullable(commonStatisticalQueryParam.getFrequency()).orElse(""); String frequency = Optional.ofNullable(commonStatisticalQueryParam.getFrequency()).orElse("");
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(finalCollect, epdPqd.getClassId(), epdPqd.getName()+frequency, epdPqd.getPhase(), commonStatisticalQueryParam.getValueType(),commonStatisticalQueryParam.getStartTime(),commonStatisticalQueryParam.getEndTime()); List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(finalCollect, epdPqd.getClassId(), epdPqd.getName()+frequency, epdPqd.getPhase(), commonStatisticalQueryParam.getValueType(),commonStatisticalQueryParam.getStartTime(),commonStatisticalQueryParam.getEndTime(),data1.get(0).getProcess()+"");
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> { List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
@@ -281,6 +290,9 @@ public class StableDataServiceImpl implements StableDataService {
if(CollectionUtil.isEmpty(csLinePOList)){ if(CollectionUtil.isEmpty(csLinePOList)){
throw new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR); throw new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR);
} }
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(commonStatisticalQueryParam.getDevId()).collect(Collectors.toList())).getData();
List<String> collect = csLinePOList.stream().map(CsLinePO::getLineId).collect(Collectors.toList()); List<String> collect = csLinePOList.stream().map(CsLinePO::getLineId).collect(Collectors.toList());
String areaId = dicDataFeignClient.getDicDataByCode(DicDataEnum.OUTPUT_SIDE.getCode()).getData().getId(); String areaId = dicDataFeignClient.getDicDataByCode(DicDataEnum.OUTPUT_SIDE.getCode()).getData().getId();
Optional.ofNullable(csLinePOList).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR)); Optional.ofNullable(csLinePOList).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR));
@@ -295,7 +307,7 @@ public class StableDataServiceImpl implements StableDataService {
if(CollectionUtil.isNotEmpty(data)){ if(CollectionUtil.isNotEmpty(data)){
List<String> finalCollect = collect; List<String> finalCollect = collect;
data.forEach(epdPqd->{ data.forEach(epdPqd->{
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(finalCollect, epdPqd.getClassId(), epdPqd.getName()+frequency, epdPqd.getPhase(), commonStatisticalQueryParam.getValueType(),commonStatisticalQueryParam.getStartTime(),commonStatisticalQueryParam.getEndTime()); List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(finalCollect, epdPqd.getClassId(), epdPqd.getName()+frequency, epdPqd.getPhase(), commonStatisticalQueryParam.getValueType(),commonStatisticalQueryParam.getStartTime(),commonStatisticalQueryParam.getEndTime(),data1.get(0).getProcess()+"");
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> { List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
@@ -353,6 +365,9 @@ public class StableDataServiceImpl implements StableDataService {
csLinePOList = csLineFeignClient.queryLineByDevId(frequencyStatisticalQueryParam.getDevId()).getData(); csLinePOList = csLineFeignClient.queryLineByDevId(frequencyStatisticalQueryParam.getDevId()).getData();
} }
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(frequencyStatisticalQueryParam.getDevId()).collect(Collectors.toList())).getData();
String areaId = dicDataFeignClient.getDicDataByCode(DicDataEnum.OUTPUT_SIDE.getCode()).getData().getId(); String areaId = dicDataFeignClient.getDicDataByCode(DicDataEnum.OUTPUT_SIDE.getCode()).getData().getId();
Optional.ofNullable(csLinePOList).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR)); Optional.ofNullable(csLinePOList).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR));
@@ -373,7 +388,7 @@ public class StableDataServiceImpl implements StableDataService {
stringBuilder1.append("last("+data.getName()).append("_"+i).append(") AS "+data.getName()).append("_"+i).append(","); stringBuilder1.append("last("+data.getName()).append("_"+i).append(") AS "+data.getName()).append("_"+i).append(",");
} }
} }
stringBuilder2.append ("line_id='").append (csLinePO.getLineId()).append("' and value_type = 'avg' group by phasic_type ").append(InfluxDbSqlConstant.TZ); stringBuilder2.append ("line_id='").append (csLinePO.getLineId()).append("' and value_type = 'avg' and process="+data1.get(0).getProcess()+" group by phasic_type ").append(InfluxDbSqlConstant.TZ);
String sql1 = "select "+stringBuilder1+" from "+"apf_data"+" where "+stringBuilder2; String sql1 = "select "+stringBuilder1+" from "+"apf_data"+" where "+stringBuilder2;
QueryResult sqlData = influxDbUtils.query(sql1); QueryResult sqlData = influxDbUtils.query(sql1);

View File

@@ -49,7 +49,7 @@ public class TemperatureServiceImpl implements TemperatureService {
if(CollectionUtils.isEmpty(collect)){ if(CollectionUtils.isEmpty(collect)){
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",data1.get(0).getProcess()+"");
List<StatisticalDataDTO> result = new ArrayList<>(); List<StatisticalDataDTO> result = new ArrayList<>();
for(int i = 0; i <=moduleNumber; i++){ for(int i = 0; i <=moduleNumber; i++){
StatisticalDataDTO statisticalData = new StatisticalDataDTO(); StatisticalDataDTO statisticalData = new StatisticalDataDTO();