diff --git a/cs-device/cs-device-boot/pom.xml b/cs-device/cs-device-boot/pom.xml
index 2566b8c..75ea87f 100644
--- a/cs-device/cs-device-boot/pom.xml
+++ b/cs-device/cs-device-boot/pom.xml
@@ -167,6 +167,11 @@
message-api
1.0.0
+
+ com.njcn
+ event-common
+ 1.0.0
+
diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/AppLineTopologyDiagramServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/AppLineTopologyDiagramServiceImpl.java
index 26820a0..aa51cc4 100644
--- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/AppLineTopologyDiagramServiceImpl.java
+++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/AppLineTopologyDiagramServiceImpl.java
@@ -16,6 +16,10 @@ import com.njcn.csdevice.service.AppLineTopologyDiagramService;
import com.njcn.csdevice.service.AppTopologyDiagramService;
import com.njcn.csdevice.service.CsLinePOService;
import com.njcn.csdevice.service.ICsLedgerService;
+import com.njcn.redis.utils.RedisUtil;
+import com.njcn.system.api.DicDataFeignClient;
+import com.njcn.system.api.DictTreeFeignClient;
+import com.njcn.system.pojo.vo.DictTreeVO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -39,6 +43,9 @@ public class AppLineTopologyDiagramServiceImpl extends ServiceImpl queryPage(BaseParam baseParam) {
@@ -356,9 +364,9 @@ public class PortableOfflLogServiceImpl extends ServiceImpl> partition = ListUtils.partition(pqdData, 1500);
for (List sliceList : partition) {
List sublistAsOriginalListType = new ArrayList<>(sliceList);
-// Map map = pqdDataSplitService.splitPqdData(sublistAsOriginalListType);
-// insertData(map);
- pqdDataMapper.insertBatch(sublistAsOriginalListType);
+ Map map = pqdDataSplitService.splitPqdData(sublistAsOriginalListType);
+ insertData(map);
+// pqdDataMapper.insertBatch(sublistAsOriginalListType);
}
//min结果集解析入库后就不需要在解析了
minFlag = false;
@@ -386,6 +394,8 @@ public class PortableOfflLogServiceImpl extends ServiceImpl newTaglogbuffers = (List) response.getObj();
if(newTaglogbuffers != null && !newTaglogbuffers.isEmpty()){
+ List list1 = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_REASON.getCode()).getData();
+ List list2 = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_TYPE.getCode()).getData();
//否则正常标记为成功解析
portableOfflLog.setState(1);
portableOfflLog.setAllCount(newTaglogbuffers.size());
@@ -456,14 +466,32 @@ public class PortableOfflLogServiceImpl extends ServiceImpl Objects.equals(item.getAlgoDescribe(), dto.getCause()))
+ .map(DictData::getId)
+ .findFirst()
+ .orElse(null);
+ csEventPO.setAdvanceReason(id1);
+
+ String id2 = list2.stream()
+ .filter(item -> Objects.equals(item.getAlgoDescribe(), dto.getType()))
+ .map(DictData::getId)
+ .findFirst()
+ .orElse(null);
+ csEventPO.setAdvanceType(id2);
+ }
+
//默认暂态事件
csEventPO.setType(0);
String clDid = influxDbParamUtil.getClDidByLineId(uploadDataParam.getLineId());
csEventPO.setClDid(clDid == null ? null : Integer.parseInt(clDid));
-
-
csEventPO.setProcess(csEquipmentDeliveryDTO.getProcess());
- csEventPOS.add(csEventPO);
+
+
EntData entData = new EntData();
entData.setUuid(csEventPO.getId());
entData.setTime(new Date().toInstant());
@@ -508,12 +536,19 @@ public class PortableOfflLogServiceImpl extends ServiceImpl queryMainLogPage(BaseParam baseParam) {
Page returnpage = new Page<> (baseParam.getPageNum(), baseParam.getPageSize ());
diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/PqdDataSplitServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/PqdDataSplitServiceImpl.java
index 53cc6ff..0518ed8 100644
--- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/PqdDataSplitServiceImpl.java
+++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/PqdDataSplitServiceImpl.java
@@ -73,6 +73,7 @@ public class PqdDataSplitServiceImpl implements IPqdDataSplitService {
for (int i = item.getHarmStart(); i <= item.getHarmEnd(); i++) {
EleEpdPqd newItem = copyEleEpdPqd(item);
newItem.setName(item.getName() + "_" + i);
+ newItem.setOtherName(item.getOtherName() + "_" + i);
expandedList.add(newItem);
}
return expandedList.stream();
diff --git a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/handler/MqttMessageHandler.java b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/handler/MqttMessageHandler.java
index a0e7a31..067253c 100644
--- a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/handler/MqttMessageHandler.java
+++ b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/handler/MqttMessageHandler.java
@@ -10,8 +10,6 @@ import com.github.tocrhz.mqtt.publisher.MqttPublisher;
import com.njcn.csdevice.api.CsLineFeignClient;
import com.njcn.csdevice.api.CsLineTopologyFeignClient;
import com.njcn.csdevice.api.DevCapacityFeignClient;
-import com.njcn.csdevice.api.fallback.CsLineTopologyClientFallbackFactory;
-import com.njcn.csdevice.pojo.po.CsLinePO;
import com.njcn.csdevice.pojo.vo.AppTopologyDiagramVO;
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
import com.njcn.csharmonic.param.FrequencyStatisticalQueryParam;
@@ -122,111 +120,6 @@ public class MqttMessageHandler {
publisher.send("/zl/TemperData/" + pageId, gson.toJson(recallReplyDTO), 1, false);
}
-
- /**
- * 实时数据应答
- */
-// @MqttSubscribe(value = "/zl/askDevData/{devId}",qos = 1)
-// public void responseTopoData(String topic, @NamedValue("devId") String devId, MqttMessage message, @Payload String payload) {
-// String topoDataJson =redisUtil.getStringByKey (devId);
-// if(StringUtils.isEmpty(topoDataJson)){
-// List result = new ArrayList<>();
-// List tempList = new ArrayList<>();
-//
-// //1.查询拓扑图配置的指标:拓扑图扑图配置:7677f94c749dedaff30f911949cbd724
-// List data = csStatisticalSetFeignClient.queryStatisticalSelect("b934664f9592d1c5e92caa90695b7103").getData();
-// data.forEach(temp->{
-// if(Objects.nonNull(temp.getHarmStart())&&Objects.nonNull(temp.getHarmEnd())){
-// FrequencyStatisticalQueryParam frequencyStatisticalQueryParam = new FrequencyStatisticalQueryParam();
-// frequencyStatisticalQueryParam.setDevId(devId);
-// frequencyStatisticalQueryParam.setStatisticalId(temp.getId());
-// frequencyStatisticalQueryParam.setValueType("avg");
-// frequencyStatisticalQueryParam.setFrequencyStart(temp.getHarmStart());
-// frequencyStatisticalQueryParam.setFrequencyEnd(temp.getHarmEnd());
-// List thdDataVOList = stableDataService.QuerySqlData(frequencyStatisticalQueryParam);
-// tempList.addAll(thdDataVOList);
-//
-// }else {
-// CommonStatisticalQueryParam commonStatisticalQueryParam = new CommonStatisticalQueryParam();
-// commonStatisticalQueryParam.setDevId(devId);
-// commonStatisticalQueryParam.setStatisticalId(temp.getId());
-// commonStatisticalQueryParam.setValueType("avg");
-// List listFuture= stableDataService.queryFisrtCommonStatistical(commonStatisticalQueryParam);
-// tempList.addAll(listFuture);
-// }
-//
-// });
-// //过滤M相
-// List m = tempList.stream().filter(temp -> Objects.equals(temp.getPhase(), "M")).collect(Collectors.toList());
-// m.stream().forEach(temp->{
-// Stream.of("A","B","C").forEach(phase->{
-// ThdDataVO thdDataVO = new ThdDataVO();
-// BeanUtils.copyProperties(temp,thdDataVO);
-// thdDataVO.setPhase(phase);
-// result.add(thdDataVO);
-// });
-// });
-// List apfThdI = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_ThdA_Load(%)")).collect(Collectors.toList());
-// Map> collect3 = apfThdI.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
-// collect3.forEach((k,v)->{
-// if(!CollectionUtil.isEmpty(v)){
-// double asDouble = v.stream().mapToDouble(ThdDataVO::getStatisticalData).average().getAsDouble();
-// ThdDataVO thdDataVO = new ThdDataVO();
-// BeanUtils.copyProperties(v.get(0),thdDataVO);
-// thdDataVO.setStatisticalData(Double.valueOf(df.format(asDouble)));
-// thdDataVO.setPhase("avg");
-// result.add(thdDataVO);
-// }
-// });
-// List apfRmsI = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_RmsI_TolOut(A)")).collect(Collectors.toList());
-// Map> collect2 = apfRmsI.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
-// collect2.forEach((k,v)->{
-// if(!CollectionUtil.isEmpty(v)){
-// double asDouble = v.stream().mapToDouble(ThdDataVO::getStatisticalData).average().getAsDouble();
-// ThdDataVO thdDataVO = new ThdDataVO();
-// BeanUtils.copyProperties(v.get(0),thdDataVO);
-// thdDataVO.setStatisticalData(Double.valueOf(df.format(asDouble)));
-// thdDataVO.setPhase("avg");
-// result.add(thdDataVO);
-// }
-// });
-// List apfThdISys = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_ThdA_Sys(%)")).collect(Collectors.toList());
-// Map> collect4 = apfThdISys.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
-// collect4.forEach((k,v)->{
-// if(!CollectionUtil.isEmpty(v)){
-// double asDouble = v.stream().mapToDouble(ThdDataVO::getStatisticalData).average().getAsDouble();
-// ThdDataVO thdDataVO = new ThdDataVO();
-// BeanUtils.copyProperties(v.get(0),thdDataVO);
-// thdDataVO.setStatisticalData(Double.valueOf(df.format(asDouble)));
-// thdDataVO.setPhase("avg");
-// result.add(thdDataVO);
-//
-// }
-// });
-// Double capacity = devCapacityFeignClient.getDevCapacity(devId).getData();
-// apfRmsI.forEach(temp->{
-// ThdDataVO thdDataVO = new ThdDataVO();
-// BeanUtils.copyProperties(temp,thdDataVO);
-// thdDataVO.setUnit("%");
-// thdDataVO.setStatisticalName("load_Rate");
-// thdDataVO.setAnotherName("负载率");
-// if (capacity<=0){
-// thdDataVO.setStatisticalData(3.1415926);
-// }else {
-// double v = temp.getStatisticalData()*100 / capacity;
-// thdDataVO.setStatisticalData(Double.valueOf(df.format(v)));
-// }
-// result.add(thdDataVO);
-// });
-// List notM = tempList.stream().filter(temp -> !Objects.equals(temp.getPhase(), "M")).collect(Collectors.toList());
-// result.addAll(notM);
-// Gson gson = new Gson();
-// topoDataJson = gson.toJson(result);
-// redisUtil.saveByKeyWithExpire(devId, (Object) topoDataJson, 30L);
-// }
-// publisher.send("/zl/devData/"+devId,topoDataJson,1,false);
-// }
-
/**
* 实时数据应答
*/