组态功能
This commit is contained in:
@@ -9,6 +9,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.api.fallback.DataArrayFeignClientFallbackFactory;
|
||||
import com.njcn.csdevice.pojo.po.CsDataArray;
|
||||
import com.njcn.csdevice.pojo.po.CsDataSet;
|
||||
import com.njcn.csdevice.pojo.vo.DataArrayTreeVO;
|
||||
import com.njcn.csdevice.pojo.vo.LineTargetVO;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
@@ -31,7 +32,7 @@ public interface DataArrayFeignClient {
|
||||
HttpResult<List<CsDataArray>> getArrayBySet(@RequestBody List<CsDataSet> setList);
|
||||
|
||||
@PostMapping("/getDataArray")
|
||||
HttpResult<List<LineTargetVO>> getDataArray(@RequestBody List<String> dataSetList);
|
||||
HttpResult<List<DataArrayTreeVO>> getDataArray(@RequestBody List<String> dataSetList);
|
||||
|
||||
@PostMapping("/getDataArrayById")
|
||||
HttpResult<List<CsDataArray>> getDataArrayById(@RequestParam("pid") String pid, @RequestParam("name") String name);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class CsLedgerFeignClientFallbackFactory implements FallbackFactory<CsLed
|
||||
|
||||
@Override
|
||||
public HttpResult<String> findDevByLineId(String lineId) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据监测点获取装置失败",cause.toString());
|
||||
log.error("{}异常,降级处理,异常为:{}","根据监测点获取装置",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.DataArrayFeignClient;
|
||||
import com.njcn.csdevice.pojo.po.CsDataArray;
|
||||
import com.njcn.csdevice.pojo.po.CsDataSet;
|
||||
import com.njcn.csdevice.pojo.vo.DataArrayTreeVO;
|
||||
import com.njcn.csdevice.pojo.vo.LineTargetVO;
|
||||
import com.njcn.csdevice.utils.CsDeviceEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
@@ -41,7 +42,7 @@ public class DataArrayFeignClientFallbackFactory implements FallbackFactory<Data
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<LineTargetVO>> getDataArray(List<String> dataSetList) {
|
||||
public HttpResult<List<DataArrayTreeVO>> getDataArray(List<String> dataSetList) {
|
||||
log.error("{}异常,降级处理,异常为:{}","获取详细数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class DevModelFeignClientFallbackFactory implements FallbackFactory<DevMo
|
||||
|
||||
@Override
|
||||
public HttpResult<CsDevModelPO> getModelById(String id) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据id查询模板失败",cause.toString());
|
||||
log.error("{}异常,降级处理,异常为:{}","根据id查询模板",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -21,4 +21,8 @@ public class DataArrayDTO implements Serializable {
|
||||
private String dataArrayName;
|
||||
|
||||
private String dataArrayShowName;
|
||||
|
||||
private String statMethod;
|
||||
|
||||
private String phase;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -22,6 +24,7 @@ import java.util.Date;
|
||||
/**
|
||||
* 装置数据模板表
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName(value = "cs_dev_model")
|
||||
public class CsDevModelPO extends BaseEntity {
|
||||
@@ -56,7 +59,7 @@ public class CsDevModelPO extends BaseEntity {
|
||||
* 版本日期
|
||||
*/
|
||||
@TableField(value = "version_date")
|
||||
private Date versionDate;
|
||||
private LocalDateTime versionDate;
|
||||
|
||||
/**
|
||||
* 装置模板文件路径
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.njcn.csdevice.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/6/14 13:36
|
||||
*/
|
||||
@Data
|
||||
public class DataArrayTreeVO {
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String showName;
|
||||
|
||||
private List<DataArrayTreeVO> children = new ArrayList<>();
|
||||
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import java.util.List;
|
||||
* @createTime 2023/6/1 10:13
|
||||
*/
|
||||
@Data
|
||||
public class LineTargetVO {
|
||||
public class LineTargetVO {
|
||||
|
||||
@ApiModelProperty("指标id")
|
||||
private String id;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.csdevice.controller.Equipment;
|
||||
package com.njcn.csdevice.controller.equipment;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
@@ -8,6 +8,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.pojo.po.CsDataArray;
|
||||
import com.njcn.csdevice.pojo.po.CsDataSet;
|
||||
import com.njcn.csdevice.pojo.vo.DataArrayTreeVO;
|
||||
import com.njcn.csdevice.pojo.vo.LineTargetVO;
|
||||
import com.njcn.csdevice.service.ICsDataArrayService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -52,9 +53,9 @@ public class CsDataArrayController extends BaseController {
|
||||
@PostMapping("/getDataArray")
|
||||
@ApiOperation("获取详细数据")
|
||||
@ApiImplicitParam(name = "dataSetList", value = "数据集集合", required = true)
|
||||
public HttpResult<List<LineTargetVO>> getDataArray(@RequestBody List<String> dataSetList){
|
||||
public HttpResult<List<DataArrayTreeVO>> getDataArray(@RequestBody List<String> dataSetList){
|
||||
String methodDescribe = getMethodDescribe("getDataArray");
|
||||
List<LineTargetVO> list = csDataArrayService.getDataArray(dataSetList);
|
||||
List<DataArrayTreeVO> list = csDataArrayService.getDataArray(dataSetList);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.csdevice.controller.Equipment;
|
||||
package com.njcn.csdevice.controller.equipment;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.csdevice.controller.Equipment;
|
||||
package com.njcn.csdevice.controller.equipment;
|
||||
|
||||
import com.njcn.csdevice.pojo.param.CsEquipmentTransferAddParm;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.csdevice.controller.Equipment;
|
||||
package com.njcn.csdevice.controller.equipment;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.njcn.csdevice.pojo.param.CsDevModelAddParm;
|
||||
@@ -105,7 +105,7 @@ public class DevModelController extends BaseController {
|
||||
@ApiOperation("根据模板Id获取模板数据")
|
||||
@ApiImplicitParam(name = "id", value = "模板id", required = true)
|
||||
public HttpResult<CsDevModelPO> getModelById(@RequestParam("id") String id){
|
||||
String methodDescribe = getMethodDescribe("getDataById");
|
||||
String methodDescribe = getMethodDescribe("getModelById");
|
||||
CsDevModelPO po = csDevModelService.getModelById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.csdevice.controller.Equipment;
|
||||
package com.njcn.csdevice.controller.equipment;
|
||||
|
||||
|
||||
import com.njcn.csdevice.pojo.param.CsDevModelRelationAddParm;
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.njcn.csdevice.controller.equipment;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.pojo.param.CsEquipmentDeliveryAddParm;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/6/13 15:44
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/deviceManager")
|
||||
@Api(tags = " 设备管理")
|
||||
@AllArgsConstructor
|
||||
public class DeviceManagerController extends BaseController {
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/deviceTree")
|
||||
@ApiOperation("设备树")
|
||||
public HttpResult<Boolean> getDeviceTree(){
|
||||
String methodDescribe = getMethodDescribe("getDeviceTree");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.njcn.csdevice.controller.equipment;
|
||||
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/6/13 15:45
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/deviceMonitor")
|
||||
@Api(tags = " 设备监控")
|
||||
@AllArgsConstructor
|
||||
public class DeviceMonitorController extends BaseController {
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.csdevice.controller.Equipment;
|
||||
package com.njcn.csdevice.controller.equipment;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.csdevice.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.csdevice.pojo.dto.DataArrayDTO;
|
||||
import com.njcn.csdevice.pojo.po.CsDataArray;
|
||||
import com.njcn.csdevice.pojo.vo.LineTargetVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -19,4 +20,6 @@ public interface CsDataArrayMapper extends BaseMapper<CsDataArray> {
|
||||
|
||||
List<LineTargetVO> getDataArray(@Param("list") List<String> list);
|
||||
|
||||
List<DataArrayDTO> getData(@Param("list") List<String> list);
|
||||
|
||||
}
|
||||
|
||||
@@ -19,4 +19,26 @@
|
||||
order by idx
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="getData" resultType="DataArrayDTO">
|
||||
select
|
||||
t1.another_name dataSetName,
|
||||
t0.name dataArrayName,
|
||||
t0.another_name dataArrayShowName,
|
||||
group_concat(distinct t0.stat_method) statMethod,
|
||||
group_concat(distinct t0.phase) phase
|
||||
from
|
||||
cs_data_array t0
|
||||
left join cs_data_set t1 on t0.pid = t1.id
|
||||
where
|
||||
t1.id IN
|
||||
<foreach collection='list' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
group by t1.another_name,t0.name,t0.another_name
|
||||
order by convert (substring_index(group_concat(distinct t0.sort),',',-1),unsigned)
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -3,6 +3,7 @@ package com.njcn.csdevice.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.po.CsDataArray;
|
||||
import com.njcn.csdevice.pojo.po.CsDataSet;
|
||||
import com.njcn.csdevice.pojo.vo.DataArrayTreeVO;
|
||||
import com.njcn.csdevice.pojo.vo.LineTargetVO;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@@ -26,7 +27,7 @@ public interface ICsDataArrayService extends IService<CsDataArray> {
|
||||
*/
|
||||
List<CsDataArray> getArrayBySet(List<CsDataSet> list);
|
||||
|
||||
List<LineTargetVO> getDataArray(List<String> list);
|
||||
List<DataArrayTreeVO> getDataArray(List<String> list);
|
||||
|
||||
List<CsDataArray> getDataArrayById(String pid, String name);
|
||||
|
||||
|
||||
@@ -2,13 +2,15 @@ package com.njcn.csdevice.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csdevice.mapper.CsDataArrayMapper;
|
||||
import com.njcn.csdevice.pojo.dto.DataArrayDTO;
|
||||
import com.njcn.csdevice.pojo.po.CsDataArray;
|
||||
import com.njcn.csdevice.pojo.po.CsDataSet;
|
||||
import com.njcn.csdevice.pojo.vo.DataArrayTreeVO;
|
||||
import com.njcn.csdevice.pojo.vo.LineTargetVO;
|
||||
import com.njcn.csdevice.service.ICsDataArrayService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -29,8 +31,51 @@ public class CsDataArrayServiceImpl extends ServiceImpl<CsDataArrayMapper, CsDat
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LineTargetVO> getDataArray(List<String> list) {
|
||||
return this.baseMapper.getDataArray(list);
|
||||
public List<DataArrayTreeVO> getDataArray(List<String> list) {
|
||||
List<DataArrayTreeVO> result = new ArrayList<>();
|
||||
List<DataArrayDTO> dataArrayList = this.baseMapper.getData(list);
|
||||
Map<String,List<DataArrayDTO>> map = dataArrayList.stream().collect(Collectors.groupingBy(DataArrayDTO::getDataSetName));
|
||||
map.forEach((k,v)->{
|
||||
List<DataArrayTreeVO> list2 = new ArrayList<>();
|
||||
DataArrayTreeVO vo1 = new DataArrayTreeVO();
|
||||
vo1.setId("0");
|
||||
vo1.setName(k);
|
||||
vo1.setShowName(k);
|
||||
v.forEach(item->{
|
||||
DataArrayTreeVO vo2 = new DataArrayTreeVO();
|
||||
List<DataArrayTreeVO> list3 = new ArrayList<>();
|
||||
vo2.setId("1");
|
||||
vo2.setName(item.getDataArrayName());
|
||||
vo2.setShowName(item.getDataArrayShowName());
|
||||
List<String> statMethodList = Arrays.asList(item.getStatMethod().split(","));
|
||||
List<String> phaseList = Arrays.asList(item.getPhase().split(","));
|
||||
statMethodList.forEach(item2->{
|
||||
List<DataArrayTreeVO> list4 = new ArrayList<>();
|
||||
DataArrayTreeVO vo3 = new DataArrayTreeVO();
|
||||
vo3.setId("2");
|
||||
vo3.setName(item2);
|
||||
vo3.setShowName(item2);
|
||||
phaseList.forEach(item3->{
|
||||
DataArrayTreeVO vo4 = new DataArrayTreeVO();
|
||||
vo4.setId("3");
|
||||
vo4.setName(item3);
|
||||
if (Objects.equals(item3,"M")){
|
||||
vo4.setShowName("无相别");
|
||||
} else {
|
||||
vo4.setShowName(item3);
|
||||
}
|
||||
list4.add(vo4);
|
||||
});
|
||||
vo3.setChildren(list4);
|
||||
list3.add(vo3);
|
||||
});
|
||||
vo2.setChildren(list3);
|
||||
list2.add(vo2);
|
||||
});
|
||||
vo1.setChildren(list2);
|
||||
result.add(vo1);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.pojo.vo.DataArrayTreeVO;
|
||||
import com.njcn.csdevice.pojo.vo.LineTargetVO;
|
||||
import com.njcn.csharmonic.pojo.vo.TargetDetailVO;
|
||||
import com.njcn.csharmonic.service.ILineTargetService;
|
||||
@@ -43,9 +44,9 @@ public class LineTargetController extends BaseController {
|
||||
@PostMapping("/target")
|
||||
@ApiOperation("监测点指标")
|
||||
@ApiImplicitParam(name = "lineId", value = "监测点Id", required = true)
|
||||
public HttpResult<List<LineTargetVO>> getLineTarget(@RequestParam("lineId") String lineId) {
|
||||
public HttpResult<List<DataArrayTreeVO>> getLineTarget(@RequestParam("lineId") String lineId) {
|
||||
String methodDescribe = getMethodDescribe("getLineTarget");
|
||||
List<LineTargetVO> list = lineTargetService.getLineTarget(lineId);
|
||||
List<DataArrayTreeVO> list = lineTargetService.getLineTarget(lineId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.csharmonic.service;
|
||||
|
||||
import com.njcn.csdevice.pojo.vo.DataArrayTreeVO;
|
||||
import com.njcn.csdevice.pojo.vo.LineTargetVO;
|
||||
import com.njcn.csharmonic.pojo.vo.TargetDetailVO;
|
||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||
@@ -16,7 +17,7 @@ public interface ILineTargetService {
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
List<LineTargetVO> getLineTarget(String lineId);
|
||||
List<DataArrayTreeVO> getLineTarget(String lineId);
|
||||
|
||||
/**
|
||||
* 获取指标的数据类型和相别
|
||||
|
||||
@@ -57,9 +57,8 @@ public class CsPagePOServiceImpl extends ServiceImpl<CsPagePOMapper, CsPagePO> i
|
||||
InputStream inputStream = this.writeJsonStringToInputStream(csPageParm.getJsonFile());
|
||||
String s = fileStorageUtil.uploadStream(inputStream, HarmonicConstant.CONFIGURATIONPATH, HarmonicConstant.CONFIGURATIONNAME);
|
||||
csPagePO.setPath(s);
|
||||
boolean save = this.save(csPagePO);
|
||||
this.save(csPagePO);
|
||||
BeanUtils.copyProperties(csPagePO, csPageVO);
|
||||
|
||||
InputStream fileStream = fileStorageUtil.getFileStream(csPagePO.getPath());
|
||||
String text = new BufferedReader(
|
||||
new InputStreamReader(fileStream, StandardCharsets.UTF_8))
|
||||
@@ -78,14 +77,10 @@ public class CsPagePOServiceImpl extends ServiceImpl<CsPagePOMapper, CsPagePO> i
|
||||
BeanUtils.copyProperties(auditParm, csPagePO);
|
||||
if(StringUtils.isNotBlank(auditParm.getJsonFile())){
|
||||
InputStream inputStream = this.writeJsonStringToInputStream(auditParm.getJsonFile());
|
||||
|
||||
String s = fileStorageUtil.uploadStream(inputStream, HarmonicConstant.CONFIGURATIONPATH, HarmonicConstant.CONFIGURATIONNAME);
|
||||
csPagePO.setPath(s);
|
||||
}
|
||||
|
||||
|
||||
return this.updateById(csPagePO);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,11 +2,11 @@ package com.njcn.csharmonic.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
||||
import com.github.tocrhz.mqtt.publisher.MqttPublisher;
|
||||
import com.njcn.csdevice.api.*;
|
||||
import com.njcn.csdevice.pojo.po.CsDataArray;
|
||||
import com.njcn.csdevice.pojo.po.CsDevModelPO;
|
||||
import com.njcn.csdevice.pojo.po.CsDevModelRelationPO;
|
||||
import com.njcn.csdevice.pojo.vo.DataArrayTreeVO;
|
||||
import com.njcn.csdevice.pojo.vo.LineTargetVO;
|
||||
import com.njcn.csharmonic.pojo.vo.ElementsVO;
|
||||
import com.njcn.csharmonic.pojo.vo.TargetDetailVO;
|
||||
@@ -15,7 +15,6 @@ import com.njcn.csharmonic.service.CsPagePOService;
|
||||
import com.njcn.csharmonic.service.ILineTargetService;
|
||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||
import com.njcn.influx.service.CommonService;
|
||||
import com.njcn.influxdb.utils.InfluxDbUtils;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.system.api.EpdFeignClient;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -57,29 +56,25 @@ public class LineTargetServiceImpl implements ILineTargetService {
|
||||
|
||||
private final CsPagePOService csPagePOService;
|
||||
|
||||
private final MqttPublisher publisher;
|
||||
|
||||
private final InfluxDbUtils influxDbUtils;
|
||||
|
||||
private final EpdFeignClient epdFeignClient;
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
|
||||
@Override
|
||||
public List<LineTargetVO> getLineTarget(String lineId) {
|
||||
List<LineTargetVO> list = new ArrayList<>();
|
||||
public List<DataArrayTreeVO> getLineTarget(String lineId) {
|
||||
List<DataArrayTreeVO> dataArrayList = new ArrayList<>();
|
||||
String devId = csLedgerFeignClient.findDevByLineId(lineId).getData();
|
||||
CsDevModelRelationPO po = devModelRelationFeignClient.getModelByDevId(devId).getData();
|
||||
if (!Objects.isNull(po)){
|
||||
CsDevModelPO csDevModelPo = devModelFeignClient.getModelById(po.getModelId()).getData();
|
||||
List<LineTargetVO> dataSetList = dataSetFeignClient.getDataSet(csDevModelPo.getId()).getData();
|
||||
List<String> setList = dataSetList.stream().map(LineTargetVO::getId).collect(Collectors.toList());
|
||||
List<LineTargetVO> dataArrayList = dataArrayFeignClient.getDataArray(setList).getData();
|
||||
dataSetList.forEach(dev -> dev.setChildren(getChildren(dev, dataArrayList)));
|
||||
list.addAll(dataSetList);
|
||||
if (!Objects.isNull(devId)){
|
||||
CsDevModelRelationPO po = devModelRelationFeignClient.getModelByDevId(devId).getData();
|
||||
if (!Objects.isNull(po)){
|
||||
CsDevModelPO csDevModelPo = devModelFeignClient.getModelById(po.getModelId()).getData();
|
||||
List<LineTargetVO> dataSetList = dataSetFeignClient.getDataSet(csDevModelPo.getId()).getData();
|
||||
List<String> setList = dataSetList.stream().map(LineTargetVO::getId).collect(Collectors.toList());
|
||||
dataArrayList = dataArrayFeignClient.getDataArray(setList).getData();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
return dataArrayList;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user