1.设备注册接入优化
2.波形文件接收、解析功能调整
This commit is contained in:
@@ -6,9 +6,13 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||
import com.njcn.csdevice.api.DataArrayFeignClient;
|
||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
||||
import com.njcn.csdevice.pojo.param.DataArrayParam;
|
||||
import com.njcn.csdevice.pojo.po.CsDataArray;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
|
||||
import com.njcn.cswarn.api.CsEquipmentAlarmFeignClient;
|
||||
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
|
||||
import com.njcn.influx.utils.InfluxDbUtils;
|
||||
import com.njcn.mq.message.AppAutoDataMessage;
|
||||
@@ -56,6 +60,8 @@ public class StatServiceImpl implements IStatService {
|
||||
|
||||
private final RedisUtil redisUtil;
|
||||
|
||||
private final EquipmentFeignClient equipmentFeignClient;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void analysis(AppAutoDataMessage appAutoDataMessage) {
|
||||
@@ -86,6 +92,8 @@ public class StatServiceImpl implements IStatService {
|
||||
if(Objects.isNull(object2)) {
|
||||
saveData();
|
||||
}
|
||||
//获取当前设备信息
|
||||
CsEquipmentDeliveryPO po = equipmentFeignClient.findDevByNDid(appAutoDataMessage.getId()).getData();
|
||||
if (CollectionUtil.isNotEmpty(list)){
|
||||
List<String> recordList = new ArrayList<>();
|
||||
for (AppAutoDataMessage.DataArray item : list) {
|
||||
@@ -116,7 +124,7 @@ public class StatServiceImpl implements IStatService {
|
||||
} else {
|
||||
dataArrayList = objectToList(object);
|
||||
}
|
||||
List<String> result = assembleData(lineId,dataArrayList,item,appAutoDataMessage.getMsg().getClDid(),dataArrayParam.getStatMethod());
|
||||
List<String> result = assembleData(lineId,dataArrayList,item,appAutoDataMessage.getMsg().getClDid(),dataArrayParam.getStatMethod(),po.getProcess());
|
||||
recordList.addAll(result);
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(recordList)){
|
||||
@@ -183,7 +191,7 @@ public class StatServiceImpl implements IStatService {
|
||||
/**
|
||||
* influxDB数据组装
|
||||
*/
|
||||
public List<String> assembleData(String lineId,List<CsDataArray> dataArrayList,AppAutoDataMessage.DataArray item,Integer clDid,String statMethod) {
|
||||
public List<String> assembleData(String lineId,List<CsDataArray> dataArrayList,AppAutoDataMessage.DataArray item,Integer clDid,String statMethod,Integer process) {
|
||||
List<String> records = new ArrayList<String>();
|
||||
//解码
|
||||
List<Float> floats = PubUtils.byteArrayToFloatList(Base64.getDecoder().decode(item.getData()));
|
||||
@@ -206,6 +214,7 @@ public class StatServiceImpl implements IStatService {
|
||||
tags.put(InfluxDBTableConstant.PHASIC_TYPE,dataArrayList.get(i).getPhase());
|
||||
tags.put(InfluxDBTableConstant.VALUE_TYPE,statMethod);
|
||||
tags.put(InfluxDBTableConstant.CL_DID,clDid.toString());
|
||||
tags.put(InfluxDBTableConstant.PROCESS,process.toString());
|
||||
Map<String,Object> fields = new HashMap<>();
|
||||
fields.put(dataArrayList.get(i).getName(),floats.get(i));
|
||||
fields.put(InfluxDBTableConstant.IS_ABNORMAL,item.getDataTag());
|
||||
|
||||
Reference in New Issue
Block a user