diff --git a/src/main/java/com/njcn/roma/client/ClientHandler.java b/src/main/java/com/njcn/roma/client/ClientHandler.java index b1b108d..607e604 100644 --- a/src/main/java/com/njcn/roma/client/ClientHandler.java +++ b/src/main/java/com/njcn/roma/client/ClientHandler.java @@ -14,16 +14,11 @@ import com.huawei.it.eip.ump.client.consumer.Consumer; import com.huawei.it.eip.ump.client.listener.MessageListener; import com.huawei.it.eip.ump.common.exception.UmpException; import com.huawei.it.eip.ump.common.message.Message; -import com.njcn.influx.imapper.DataHarmPowerPMapper; -import com.njcn.influx.imapper.DataHarmRateVMapper; -import com.njcn.influx.imapper.DataVMapper; -import com.njcn.influx.pojo.po.DataHarmPowerP; -import com.njcn.influx.pojo.po.DataHarmRateV; -import com.njcn.influx.pojo.po.DataV; +import com.njcn.influx.imapper.*; +import com.njcn.influx.pojo.po.*; import com.njcn.influx.service.IDataVService; import com.njcn.roma.mapper.EleEpdPqdMapper; import com.njcn.roma.pojo.EleEpdPqd; -import com.njcn.roma.pojo.MessageBodyDTO; import com.njcn.roma.pojo.MonitorRealData; import com.njcn.roma.server.WebSocketServer; import com.njcn.roma.service.MonitorRealDataService; @@ -41,8 +36,6 @@ import java.nio.charset.StandardCharsets; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -52,7 +45,6 @@ import java.util.concurrent.Executors; import java.util.function.Function; import java.util.stream.Collectors; -import static com.njcn.roma.utils.JsonValueFluctuator.fluctuateValuesInJson; import static com.njcn.roma.utils.JsonValueFluctuator.realToData; /** @@ -68,19 +60,25 @@ import static com.njcn.roma.utils.JsonValueFluctuator.realToData; @Slf4j public class ClientHandler extends Thread { - private final ExecutorService executor = Executors.newFixedThreadPool(10); // 假设使用10个线程的线程池 - - private final WebSocketServer webSocketServer; + // 假设使用10个线程的线程池 + private final ExecutorService executor = Executors.newFixedThreadPool(10); private final EleEpdPqdMapper eleEpdPqdMapper; private Consumer consumer; private final DataVMapper dataVMapper; + + private final DataIMapper dataIMapper; + private final DataHarmRateVMapper dataHarmRateVMapper; private final DataHarmPowerPMapper dataHarmPowerPMapper; + private final DataPltMapper dataPltMapper; + + private final DataFlickerMapper dataFlickerMapper; + private final MonitorRealDataService monitorRealDataService; private Map> classMap = null; @@ -94,7 +92,6 @@ public class ClientHandler extends Thread { classMap = eleEpdPqdList.stream().collect(Collectors.groupingBy(EleEpdPqd::getClassId)); if (consumer == null) { - log.info("初始化独立线程作为roma客户端消费数据》》》》》》》》》》》》》"); consumer = new Consumer(); consumer.setUmpNamesrvUrls("25.36.190.3:19776;25.36.190.4:19776"); // 设置统一消息 @@ -108,10 +105,7 @@ public class ClientHandler extends Thread { consumer.subscribe(new MessageListener() { public ConsumeStatus consume(Message message) { // 消费消息的业务逻辑 - - onMessageReceived(message); - // 正常接收到消息后,请务必返回 CONSUME_SUCCESS,只有在业务处理失败才返回RECONSUME_LATER return ConsumeStatus.CONSUME_SUCCESS; } @@ -130,22 +124,11 @@ public class ClientHandler extends Thread { } - /** - * 解析模板 - */ - public void praTemplate() { - String template = "[{\"datatype\":\"string\",\"description\":\"数据时间\",\"method\":\"R\",\"name\":\"time\",\"unit\":\"\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"string\",\"description\":\"数据类型\",\"method\":\"R\",\"name\":\"DataType\",\"unit\":\"\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"数据标记\",\"method\":\"R\",\"name\":\"DataTag\",\"unit\":\"\",\"enumlist\":[],\"max\":\"1\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"频率\",\"method\":\"R\",\"name\":\"Freq\",\"unit\":\"Hz\",\"enumlist\":[],\"max\":\"60\",\"min\":\"40\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"频率偏差\",\"method\":\"R\",\"name\":\"FreqDev\",\"unit\":\"Hz\",\"enumlist\":[],\"max\":\"10\",\"min\":\"-10\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电流总有效值\",\"method\":\"R\",\"name\":\"A_phsA\",\"unit\":\"A\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电流总有效值\",\"method\":\"R\",\"name\":\"A_phsB\",\"unit\":\"A\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电流总有效值\",\"method\":\"R\",\"name\":\"A_phsC\",\"unit\":\"A\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压总有效值\",\"method\":\"R\",\"name\":\"PhV_phsA\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压总有效值\",\"method\":\"R\",\"name\":\"PhV_phsB\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压总有效值\",\"method\":\"R\",\"name\":\"PhV_phsC\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"AB线电压总有效值\",\"method\":\"R\",\"name\":\"PPV_phsAB\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"BC线电压总有效值\",\"method\":\"R\",\"name\":\"PPV_phsBC\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"CA线电压总有效值\",\"method\":\"R\",\"name\":\"PPV_phsCA\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压偏差\",\"method\":\"R\",\"name\":\"PhVDev_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压偏差\",\"method\":\"R\",\"name\":\"PhVDev_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压偏差\",\"method\":\"R\",\"name\":\"PhVDev_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"三相总有功功率\",\"method\":\"R\",\"name\":\"TotW\",\"unit\":\"kW\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"-65536\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"三相总无功功率\",\"method\":\"R\",\"name\":\"TotVar\",\"unit\":\"kVar\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"-65536\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"三相总视在功率\",\"method\":\"R\",\"name\":\"TotVA\",\"unit\":\"kVA\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"-65536\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"三相功率因数\",\"method\":\"R\",\"name\":\"TotPF\",\"unit\":\"\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"电压正序分量\",\"method\":\"R\",\"name\":\"SeqV_C1\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"电压负序分量\",\"method\":\"R\",\"name\":\"SeqV_C2\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"电压零序分量\",\"method\":\"R\",\"name\":\"SeqV_C0\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"电压负序不平衡度\",\"method\":\"R\",\"name\":\"ImbNgV\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"电压零序不平衡度\",\"method\":\"R\",\"name\":\"ImbZroV\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压基波有效值\",\"method\":\"R\",\"name\":\"HFundPhV_phsA\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压基波有效值\",\"method\":\"R\",\"name\":\"HFundPhV_phsB\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压基波有效值\",\"method\":\"R\",\"name\":\"HFundPhV_phsC\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压谐波总畸变率\",\"method\":\"R\",\"name\":\"ThdPhV_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压谐波总畸变率\",\"method\":\"R\",\"name\":\"ThdPhV_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压谐波总畸变率\",\"method\":\"R\",\"name\":\"ThdPhV_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压2次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H2_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压3次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H3_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压4次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H4_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压5次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H5_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压6次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H6_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压7次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H7_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压8次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H8_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压9次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H9_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压10次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H10_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压11次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H11_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压12次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H12_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压13次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H13_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压14次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H14_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压15次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H15_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压16次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H16_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压17次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H17_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压18次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H18_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压19次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H19_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压20次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H20_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压21次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H21_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压22次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H22_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压23次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H23_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压24次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H24_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压25次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H25_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压2次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H2_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压3次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H3_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压4次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H4_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压5次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H5_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压6次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H6_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压7次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H7_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压8次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H8_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压9次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H9_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压10次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H10_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压11次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H11_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压12次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H12_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压13次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H13_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压14次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H14_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压15次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H15_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压16次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H16_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压17次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H17_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压18次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H18_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压19次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H19_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压20次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H20_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压21次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H21_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压22次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H22_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压23次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H23_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压24次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H24_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压25次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H25_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压2次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H2_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压3次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H3_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压4次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H4_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压5次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H5_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压6次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H6_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压7次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H7_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压8次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H8_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压9次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H9_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压10次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H10_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压11次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H11_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压12次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H12_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压13次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H13_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压14次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H14_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压15次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H15_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压16次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H16_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压17次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H17_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压18次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H18_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压19次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H19_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压20次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H20_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压21次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H21_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压22次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H22_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压23次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H23_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压24次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H24_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压25次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H25_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相短时闪变\",\"method\":\"R\",\"name\":\"PstPhV_phsA\",\"unit\":\"\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相短时闪变\",\"method\":\"R\",\"name\":\"PstPhV_phsB\",\"unit\":\"\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相短时闪变\",\"method\":\"R\",\"name\":\"PstPhV_phsC\",\"unit\":\"\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相长时闪变\",\"method\":\"R\",\"name\":\"PltPhV_phsA\",\"unit\":\"\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相长时闪变\",\"method\":\"R\",\"name\":\"PltPhV_phsB\",\"unit\":\"\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相长时闪变\",\"method\":\"R\",\"name\":\"PltPhV_phsC\",\"unit\":\"\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1}]"; - JSONArray jsonArray = JSONArray.parseArray(template); - - - System.out.println("解析结束"); - - } // 消息消费回调 - void onMessageReceived(Message message) { + public void onMessageReceived(Message message) { // 将消息处理逻辑封装为Runnable任务 Runnable task = () -> { try { @@ -162,102 +145,170 @@ public class ClientHandler extends Thread { } void processMessage(Message message) { - // 实际的消息处理逻辑 try { System.out.println("收到新的一轮数据:******************"); - String devId = idKey+message.getProperties().get("deviceIdentifier"); + log.info(message.toString()); + String customDevId = idKey+message.getProperties().get("deviceIdentifier"); String topicMsg = new String(message.getBody(), StandardCharsets.UTF_8); - JSONObject jsonObject = realToData(topicMsg); - jsonObject.put("customDevId", devId); - jsonObject.put("deviceId",message.getProperties().get("deviceId")); + String deviceId = message.getProperties().get("deviceId"); + dataCalculate(topicMsg,customDevId,deviceId); - if(jsonObject.get("DataType").toString().charAt(0) == '0'){ - jsonObject.put("DataType","MAX"); - }else if(jsonObject.get("DataType").toString().charAt(0) == '1'){ - jsonObject.put("DataType","MIN"); - }else if(jsonObject.get("DataType").toString().charAt(0) == '2'){ - jsonObject.put("DataType","AVG"); - }else if(jsonObject.get("DataType").toString().charAt(0) == '3'){ - jsonObject.put("DataType","CP95"); - } + } catch (Exception e) { + e.printStackTrace(); + log.error("消费消息异常begin:-----------------------------------"); + log.error(message.toString()); + log.error("消费消息异常end:-----------------------------------"); + } + } + + /** + * 组装数据,并入库 + * @param topicMsg + * @param devId + * @param deviceId + */ + public void dataCalculate(String topicMsg,String devId,String deviceId){ + JSONObject jsonObject = realToData(topicMsg); + jsonObject.put("customDevId", devId); + jsonObject.put("deviceId",deviceId); + + if(jsonObject.get("DataType").toString().charAt(0) == '0'){ + jsonObject.put("DataType","MAX"); + }else if(jsonObject.get("DataType").toString().charAt(0) == '1'){ + jsonObject.put("DataType","MIN"); + }else if(jsonObject.get("DataType").toString().charAt(0) == '2'){ + jsonObject.put("DataType","AVG"); + }else if(jsonObject.get("DataType").toString().charAt(0) == '3'){ + jsonObject.put("DataType","CP95"); + } - String temJson = jsonObject.toJSONString(); - System.out.println("Receive>>>>>>>>>>>>: " + temJson); - assData(devId,jsonObject,temJson); + String temJson = jsonObject.toJSONString(); + // System.out.println("Receive>>>>>>>>>>>>: " + temJson); + assData(devId,jsonObject,temJson); - List poList = new ArrayList<>(); - List dataHarmRateVList = new ArrayList<>(); - List dataHarmPowerPList = new ArrayList<>(); + List poList = new ArrayList<>(); + List poIList = new ArrayList<>(); + List dataHarmRateVList = new ArrayList<>(); + List dataHarmPowerPList = new ArrayList<>(); + List dataHarmPowerQList = new ArrayList<>(); + List dataFlickerList = new ArrayList<>(); + List dataPltList = new ArrayList<>(); - - String valueType = jsonObject.get("DataType").toString(); - Instant instant = (Instant) jsonObject.get("time"); - classMap.forEach((classId,classList)->{ - Map> elePhaseMap = classList.stream().collect(Collectors.groupingBy(EleEpdPqd::getPhase)); - elePhaseMap.forEach((phase, list) -> { - Map m = list.stream().collect(Collectors.toMap(EleEpdPqd::getName, Function.identity())); - Map map = new HashMap<>(); - m.forEach((mk, mv) -> { - if (jsonObject.containsKey(mk)) { - if (StrUtil.isNotBlank(mv.getOtherName())) { - map.put(mv.getOtherName(), Double.valueOf(jsonObject.get(mk).toString())); - } - } - }); - - - - if(classId.equals("data_v")) { - DataV dataV = new DataV(); - BeanUtil.copyProperties(map, dataV); - dataV.setPhaseType(phase); - dataV.setLineId(devId); - dataV.setValueType(valueType); - dataV.setQualityFlag("0"); - dataV.setTime(instant); - - JsonValueFluctuator.setNullNumberFieldsToZero(dataV); - poList.add(dataV); - }else if(classId.equals("data_harmrate_v")){ - DataHarmRateV dataHarmRateV = new DataHarmRateV(); - BeanUtil.copyProperties(map, dataHarmRateV); - dataHarmRateV.setPhaseType(phase); - dataHarmRateV.setLineId(devId); - dataHarmRateV.setValueType(valueType); - dataHarmRateV.setQualityFlag("0"); - dataHarmRateV.setTime(instant); - - JsonValueFluctuator.setNullNumberFieldsToZero(dataHarmRateV); - dataHarmRateVList.add(dataHarmRateV); - }else if(classId.equals("data_harmpower_p")){ - DataHarmPowerP dataHarmPowerP = new DataHarmPowerP(); - BeanUtil.copyProperties(map, dataHarmPowerP); - dataHarmPowerP.setPhaseType(phase); - dataHarmPowerP.setLineId(devId); - dataHarmPowerP.setValueType(valueType); - dataHarmPowerP.setQualityFlag("0"); - dataHarmPowerP.setTime(instant); - - JsonValueFluctuator.setNullNumberFieldsToZero(dataHarmPowerP); - dataHarmPowerPList.add(dataHarmPowerP); + String valueType = jsonObject.get("DataType").toString(); + Instant instant = (Instant) jsonObject.get("time"); + classMap.forEach((classId,classList)->{ + Map> elePhaseMap = classList.stream().collect(Collectors.groupingBy(EleEpdPqd::getPhase)); + elePhaseMap.forEach((phase, list) -> { + Map m = list.stream().collect(Collectors.toMap(EleEpdPqd::getName, Function.identity())); + Map map = new HashMap<>(); + m.forEach((mk, mv) -> { + if (jsonObject.containsKey(mk)) { + if (StrUtil.isNotBlank(mv.getOtherName())) { + map.put(mv.getOtherName(), Double.valueOf(jsonObject.get(mk).toString())); } + } + }); + switch (classId){ + case "data_v": + DataV dataV = new DataV(); + BeanUtil.copyProperties(map, dataV); + dataV.setPhaseType(phase); + dataV.setLineId(devId); + dataV.setValueType(valueType); + dataV.setQualityFlag("0"); + dataV.setTime(instant); + JsonValueFluctuator.setNullNumberFieldsToZero(dataV); + poList.add(dataV); + break; + case "data_i": + DataI dataI = new DataI(); + BeanUtil.copyProperties(map, dataI); + dataI.setPhaseType(phase); + dataI.setLineId(devId); + dataI.setValueType(valueType); + dataI.setQualityFlag("0"); + dataI.setTime(instant); - }); + JsonValueFluctuator.setNullNumberFieldsToZero(dataI); + poIList.add(dataI); + break; + case "data_harmrate_v": + DataHarmRateV dataHarmRateV = new DataHarmRateV(); + BeanUtil.copyProperties(map, dataHarmRateV); + dataHarmRateV.setPhaseType(phase); + dataHarmRateV.setLineId(devId); + dataHarmRateV.setValueType(valueType); + dataHarmRateV.setQualityFlag("0"); + dataHarmRateV.setTime(instant); + JsonValueFluctuator.setNullNumberFieldsToZero(dataHarmRateV); + dataHarmRateVList.add(dataHarmRateV); + break; + case "data_harmpower_p": + DataHarmPowerP dataHarmPowerP = new DataHarmPowerP(); + BeanUtil.copyProperties(map, dataHarmPowerP); + dataHarmPowerP.setPhaseType(phase); + dataHarmPowerP.setLineId(devId); + dataHarmPowerP.setValueType(valueType); + dataHarmPowerP.setQualityFlag("0"); + dataHarmPowerP.setTime(instant); + + JsonValueFluctuator.setNullNumberFieldsToZero(dataHarmPowerP); + dataHarmPowerPList.add(dataHarmPowerP); + break; + case "data_harmpower_q": + DataHarmPowerQ dataHarmPowerQ = new DataHarmPowerQ(); + BeanUtil.copyProperties(map, dataHarmPowerQ); + dataHarmPowerQ.setPhaseType(phase); + dataHarmPowerQ.setLineId(devId); + dataHarmPowerQ.setValueType(valueType); + dataHarmPowerQ.setQualityFlag("0"); + dataHarmPowerQ.setTime(instant); + + JsonValueFluctuator.setNullNumberFieldsToZero(dataHarmPowerQ); + dataHarmPowerQList.add(dataHarmPowerQ); + break; + case "data_flicker": + DataFlicker dataFlicker = new DataFlicker(); + BeanUtil.copyProperties(map, dataFlicker); + dataFlicker.setPhaseType(phase); + dataFlicker.setLineId(devId); + dataFlicker.setValueType(valueType); + dataFlicker.setQualityFlag("0"); + dataFlicker.setTime(instant); + + JsonValueFluctuator.setNullNumberFieldsToZero(dataFlicker); + dataFlickerList.add(dataFlicker); + break; + + case "data_plt": + DataPlt dataPlt = new DataPlt(); + BeanUtil.copyProperties(map, dataPlt); + dataPlt.setPhaseType(phase); + dataPlt.setLineId(devId); + dataPlt.setValueType(valueType); + dataPlt.setQualityFlag("0"); + dataPlt.setTime(instant); + + JsonValueFluctuator.setNullNumberFieldsToZero(dataPlt); + dataPltList.add(dataPlt); + break; + } }); + }); - try { - dataVMapper.insertBatch(poList); - dataHarmRateVMapper.insertBatch(dataHarmRateVList); - dataHarmPowerPMapper.insertBatch(dataHarmPowerPList); - } catch (Exception e) { - e.printStackTrace(); - } - + try { + dataVMapper.insertBatch(poList); + dataIMapper.insertBatch(poIList); + dataHarmRateVMapper.insertBatch(dataHarmRateVList); + dataHarmPowerPMapper.insertBatch(dataHarmPowerPList); + dataPltMapper.insertBatch(dataPltList); + dataFlickerMapper.insertBatch(dataFlickerList); + log.info("influxdb数据插入成功------------------"); } catch (Exception e) { e.printStackTrace(); } @@ -269,6 +320,14 @@ public class ClientHandler extends Thread { e.printStackTrace(); } + + + /** + * 处理最新数据入mysql数据库 + * @param devId + * @param jsonObject + * @param temJson + */ private void assData(String devId,JSONObject jsonObject,String temJson){ MonitorRealData monitorRealData = new MonitorRealData(); monitorRealData.setLineId(devId); @@ -283,4 +342,23 @@ public class ClientHandler extends Thread { } + + /** + * 解析模板 + */ + public void praTemplate() { + + String template = "[{\"datatype\":\"string\",\"description\":\"数据时间\",\"method\":\"R\",\"name\":\"time\",\"unit\":\"\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"string\",\"description\":\"数据类型\",\"method\":\"R\",\"name\":\"DataType\",\"unit\":\"\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"数据标记\",\"method\":\"R\",\"name\":\"DataTag\",\"unit\":\"\",\"enumlist\":[],\"max\":\"1\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"频率\",\"method\":\"R\",\"name\":\"Freq\",\"unit\":\"Hz\",\"enumlist\":[],\"max\":\"60\",\"min\":\"40\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"频率偏差\",\"method\":\"R\",\"name\":\"FreqDev\",\"unit\":\"Hz\",\"enumlist\":[],\"max\":\"10\",\"min\":\"-10\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电流总有效值\",\"method\":\"R\",\"name\":\"A_phsA\",\"unit\":\"A\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电流总有效值\",\"method\":\"R\",\"name\":\"A_phsB\",\"unit\":\"A\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电流总有效值\",\"method\":\"R\",\"name\":\"A_phsC\",\"unit\":\"A\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压总有效值\",\"method\":\"R\",\"name\":\"PhV_phsA\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压总有效值\",\"method\":\"R\",\"name\":\"PhV_phsB\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压总有效值\",\"method\":\"R\",\"name\":\"PhV_phsC\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"AB线电压总有效值\",\"method\":\"R\",\"name\":\"PPV_phsAB\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"BC线电压总有效值\",\"method\":\"R\",\"name\":\"PPV_phsBC\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"CA线电压总有效值\",\"method\":\"R\",\"name\":\"PPV_phsCA\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压偏差\",\"method\":\"R\",\"name\":\"PhVDev_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压偏差\",\"method\":\"R\",\"name\":\"PhVDev_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压偏差\",\"method\":\"R\",\"name\":\"PhVDev_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"三相总有功功率\",\"method\":\"R\",\"name\":\"TotW\",\"unit\":\"kW\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"-65536\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"三相总无功功率\",\"method\":\"R\",\"name\":\"TotVar\",\"unit\":\"kVar\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"-65536\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"三相总视在功率\",\"method\":\"R\",\"name\":\"TotVA\",\"unit\":\"kVA\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"-65536\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"三相功率因数\",\"method\":\"R\",\"name\":\"TotPF\",\"unit\":\"\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"电压正序分量\",\"method\":\"R\",\"name\":\"SeqV_C1\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"电压负序分量\",\"method\":\"R\",\"name\":\"SeqV_C2\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"电压零序分量\",\"method\":\"R\",\"name\":\"SeqV_C0\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"电压负序不平衡度\",\"method\":\"R\",\"name\":\"ImbNgV\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"电压零序不平衡度\",\"method\":\"R\",\"name\":\"ImbZroV\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压基波有效值\",\"method\":\"R\",\"name\":\"HFundPhV_phsA\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压基波有效值\",\"method\":\"R\",\"name\":\"HFundPhV_phsB\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压基波有效值\",\"method\":\"R\",\"name\":\"HFundPhV_phsC\",\"unit\":\"V\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压谐波总畸变率\",\"method\":\"R\",\"name\":\"ThdPhV_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压谐波总畸变率\",\"method\":\"R\",\"name\":\"ThdPhV_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压谐波总畸变率\",\"method\":\"R\",\"name\":\"ThdPhV_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压2次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H2_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压3次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H3_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压4次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H4_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压5次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H5_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压6次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H6_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压7次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H7_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压8次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H8_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压9次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H9_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压10次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H10_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压11次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H11_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压12次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H12_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压13次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H13_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压14次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H14_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压15次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H15_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压16次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H16_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压17次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H17_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压18次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H18_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压19次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H19_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压20次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H20_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压21次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H21_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压22次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H22_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压23次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H23_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压24次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H24_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相电压25次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H25_phsA\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压2次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H2_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压3次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H3_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压4次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H4_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压5次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H5_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压6次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H6_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压7次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H7_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压8次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H8_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压9次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H9_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压10次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H10_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压11次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H11_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压12次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H12_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压13次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H13_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压14次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H14_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压15次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H15_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压16次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H16_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压17次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H17_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压18次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H18_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压19次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H19_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压20次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H20_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压21次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H21_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压22次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H22_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压23次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H23_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压24次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H24_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相电压25次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H25_phsB\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压2次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H2_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压3次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H3_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压4次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H4_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压5次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H5_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压6次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H6_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压7次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H7_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压8次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H8_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压9次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H9_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压10次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H10_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压11次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H11_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压12次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H12_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压13次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H13_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压14次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H14_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压15次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H15_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压16次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H16_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压17次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H17_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压18次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H18_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压19次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H19_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压20次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H20_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压21次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H21_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压22次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H22_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压23次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H23_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压24次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H24_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相电压25次谐波含有率\",\"method\":\"R\",\"name\":\"HRPhV_H25_phsC\",\"unit\":\"%\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相短时闪变\",\"method\":\"R\",\"name\":\"PstPhV_phsA\",\"unit\":\"\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相短时闪变\",\"method\":\"R\",\"name\":\"PstPhV_phsB\",\"unit\":\"\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相短时闪变\",\"method\":\"R\",\"name\":\"PstPhV_phsC\",\"unit\":\"\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"A相长时闪变\",\"method\":\"R\",\"name\":\"PltPhV_phsA\",\"unit\":\"\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"B相长时闪变\",\"method\":\"R\",\"name\":\"PltPhV_phsB\",\"unit\":\"\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1},{\"datatype\":\"decimal\",\"description\":\"C相长时闪变\",\"method\":\"R\",\"name\":\"PltPhV_phsC\",\"unit\":\"\",\"enumlist\":[],\"max\":\"65536\",\"min\":\"0\",\"maxlength\":32,\"required\":1,\"step\":1}]"; + JSONArray jsonArray = JSONArray.parseArray(template); + + + System.out.println("解析结束"); + + } + + public static void main(String[] args) { + + } + + } diff --git a/src/main/java/com/njcn/roma/controller/TestController.java b/src/main/java/com/njcn/roma/controller/TestController.java index e335493..5f9faf7 100644 --- a/src/main/java/com/njcn/roma/controller/TestController.java +++ b/src/main/java/com/njcn/roma/controller/TestController.java @@ -28,6 +28,7 @@ import com.njcn.roma.server.WebSocketServer; import com.njcn.roma.service.MonitorRealDataService; import com.njcn.roma.utils.JsonValueFluctuator; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -50,13 +51,14 @@ import java.util.stream.Collectors; */ @RestController @RequiredArgsConstructor +@Slf4j public class TestController { private final ClientHandler clientHandler; private final WebSocketServer webSocketServer; - public String topicMsg = "{\"DataType\":\"1.000\",\"HRPhV_H14_phsC\":\"0.2000\",\"HRPhV_H14_phsB\":\"0.0000\",\"HRPhV_H14_phsA\":\"0.0000\",\"HRPhV_H2_phsB\":\"0.0100\",\"HRPhV_H2_phsA\":\"0.0100\",\"HRPhV_H2_phsC\":\"0.0100\",\"HRPhV_H15_phsA\":\"0.0120\",\"TotW\":\"19771.1367\",\"HRPhV_H15_phsB\":\"0.0120\",\"HRPhV_H15_phsC\":\"0.0120\",\"FreqDev\":\"0.0000\",\"PPV_phsAB\":\"384.0318\",\"A_phsC\":\"60.7116\",\"TotPF\":\"0.4946\",\"A_phsA\":\"60.7123\",\"A_phsB\":\"60.7111\",\"PPV_phsBC\":\"383.3656\",\"HRPhV_H25_phsB\":\"0.0080\",\"HRPhV_H25_phsC\":\"0.0080\",\"HRPhV_H25_phsA\":\"0.0080\",\"DataTag\":\"0\",\"HRPhV_H20_phsA\":\"0.0000\",\"HRPhV_H20_phsB\":\"0.0000\",\"HRPhV_H20_phsC\":\"0.0000\",\"PPV_phsCA\":\"383.3637\",\"HRPhV_H3_phsB\":\"0.0640\",\"HRPhV_H3_phsC\":\"0.0640\",\"HRPhV_H9_phsC\":\"0.0220\",\"ThdPhV_phsA\":\"0.0913\",\"HRPhV_H9_phsB\":\"0.0220\",\"HRPhV_H9_phsA\":\"0.0220\",\"ThdPhV_phsB\":\"0.0913\",\"ThdPhV_phsC\":\"0.0913\",\"HRPhV_H19_phsC\":\"0.0100\",\"HRPhV_H19_phsB\":\"0.0100\",\"HRPhV_H19_phsA\":\"0.0100\",\"HRPhV_H16_phsA\":\"0.0000\",\"HRPhV_H13_phsA\":\"0.0140\",\"HRPhV_H16_phsC\":\"0.0000\",\"HRPhV_H13_phsB\":\"0.0140\",\"HRPhV_H16_phsB\":\"0.0000\",\"TotVA\":\"39977.2305\",\"HRPhV_H13_phsC\":\"0.0140\",\"HRPhV_H6_phsB\":\"0.0026\",\"HRPhV_H3_phsA\":\"0.0640\",\"HRPhV_H6_phsA\":\"0.0026\",\"HRPhV_H10_phsA\":\"0.0026\",\"HRPhV_H10_phsB\":\"0.0026\",\"HRPhV_H6_phsC\":\"0.0026\",\"HRPhV_H10_phsC\":\"0.0026\",\"ImbNgV\":\"0.0012\",\"TotVar\":\"34745.9492\",\"HRPhV_H7_phsC\":\"0.0280\",\"HRPhV_H7_phsB\":\"0.0280\",\"HRPhV_H22_phsC\":\"0.0000\",\"HRPhV_H22_phsB\":\"0.0000\",\"ImbZroV\":\"0.0012\",\"HRPhV_H22_phsA\":\"0.0000\",\"HRPhV_H7_phsA\":\"0.0280\",\"HRPhV_H8_phsA\":\"0.0026\",\"HRPhV_H23_phsB\":\"0.0080\",\"PhV_phsA\":\"221.9935\",\"HRPhV_H8_phsB\":\"0.0026\",\"HRPhV_H23_phsC\":\"0.0080\",\"HRPhV_H8_phsC\":\"0.0026\",\"PhV_phsB\":\"221.9947\",\"PhV_phsC\":\"221.9979\",\"HRPhV_H23_phsA\":\"0.0080\",\"PstPhV_phsC\":\"3.2942\",\"PstPhV_phsA\":\"3.3086\",\"PstPhV_phsB\":\"3.2987\",\"Freq\":\"50.0000\",\"HRPhV_H11_phsA\":\"0.0180\",\"HRPhV_H11_phsB\":\"0.0180\",\"HRPhV_H17_phsC\":\"0.0100\",\"HRPhV_H11_phsC\":\"0.0180\",\"HRPhV_H17_phsB\":\"0.0100\",\"HRPhV_H17_phsA\":\"0.0100\",\"SeqV_C2\":\"0.0715\",\"HRPhV_H4_phsB\":\"0.0050\",\"SeqV_C1\":\"60.4601\",\"HRPhV_H4_phsA\":\"0.0050\",\"SeqV_C0\":\"0.0714\",\"PhVDev_phsC\":\"0.0119\",\"HRPhV_H5_phsA\":\"0.0400\",\"HRPhV_H5_phsB\":\"0.0400\",\"HRPhV_H5_phsC\":\"0.0400\",\"PhVDev_phsB\":\"0.0119\",\"HRPhV_H12_phsC\":\"0.0010\",\"PltPhV_phsA\":\"0.0000\",\"PhVDev_phsA\":\"0.0119\",\"HRPhV_H12_phsB\":\"0.0010\",\"HRPhV_H4_phsC\":\"0.0050\",\"HRPhV_H18_phsB\":\"0.0000\",\"HRPhV_H18_phsC\":\"0.0000\",\"HRPhV_H12_phsA\":\"0.0010\",\"HRPhV_H18_phsA\":\"0.0000\",\"HFundPhV_phsC\":\"220.8052\",\"HRPhV_H21_phsC\":\"0.0080\",\"HRPhV_H21_phsB\":\"0.0080\",\"HRPhV_H24_phsC\":\"0.0000\",\"HFundPhV_phsA\":\"220.8056\",\"HRPhV_H21_phsA\":\"0.0080\",\"HFundPhV_phsB\":\"220.8055\",\"HRPhV_H24_phsB\":\"0.0000\",\"PltPhV_phsC\":\"0.0000\",\"HRPhV_H24_phsA\":\"0.0000\",\"PltPhV_phsB\":\"0.0000\",\"time\":\"20240816T150000Z\"}"; + public String topicMsg = "{\"DataType\":\"1.000\",\"HRPhV_H14_phsC\":\"0.2000\",\"HRPhV_H14_phsB\":\"0.0000\",\"HRPhV_H14_phsA\":\"0.0000\",\"HRPhV_H2_phsB\":\"0.0100\",\"HRPhV_H2_phsA\":\"0.0100\",\"HRPhV_H2_phsC\":\"0.0100\",\"HRPhV_H15_phsA\":\"0.0120\",\"TotW\":\"19771.1367\",\"HRPhV_H15_phsB\":\"0.0120\",\"HRPhV_H15_phsC\":\"0.0120\",\"FreqDev\":\"0.0000\",\"PPV_phsAB\":\"384.0318\",\"A_phsC\":\"60.7116\",\"TotPF\":\"0.4946\",\"A_phsA\":\"60.7123\",\"A_phsB\":\"60.7111\",\"PPV_phsBC\":\"383.3656\",\"HRPhV_H25_phsB\":\"0.0080\",\"HRPhV_H25_phsC\":\"0.0080\",\"HRPhV_H25_phsA\":\"0.0080\",\"DataTag\":\"0\",\"HRPhV_H20_phsA\":\"0.0000\",\"HRPhV_H20_phsB\":\"0.0000\",\"HRPhV_H20_phsC\":\"0.0000\",\"PPV_phsCA\":\"383.3637\",\"HRPhV_H3_phsB\":\"0.0640\",\"HRPhV_H3_phsC\":\"0.0640\",\"HRPhV_H9_phsC\":\"0.0220\",\"ThdPhV_phsA\":\"0.0913\",\"HRPhV_H9_phsB\":\"0.0220\",\"HRPhV_H9_phsA\":\"0.0220\",\"ThdPhV_phsB\":\"0.0913\",\"ThdPhV_phsC\":\"0.0913\",\"HRPhV_H19_phsC\":\"0.0100\",\"HRPhV_H19_phsB\":\"0.0100\",\"HRPhV_H19_phsA\":\"0.0100\",\"HRPhV_H16_phsA\":\"0.0000\",\"HRPhV_H13_phsA\":\"0.0140\",\"HRPhV_H16_phsC\":\"0.0000\",\"HRPhV_H13_phsB\":\"0.0140\",\"HRPhV_H16_phsB\":\"0.0000\",\"TotVA\":\"39977.2305\",\"HRPhV_H13_phsC\":\"0.0140\",\"HRPhV_H6_phsB\":\"0.0026\",\"HRPhV_H3_phsA\":\"0.0640\",\"HRPhV_H6_phsA\":\"0.0026\",\"HRPhV_H10_phsA\":\"0.0026\",\"HRPhV_H10_phsB\":\"0.0026\",\"HRPhV_H6_phsC\":\"0.0026\",\"HRPhV_H10_phsC\":\"0.0026\",\"ImbNgV\":\"0.0012\",\"TotVar\":\"34745.9492\",\"HRPhV_H7_phsC\":\"0.0280\",\"HRPhV_H7_phsB\":\"0.0280\",\"HRPhV_H22_phsC\":\"0.0000\",\"HRPhV_H22_phsB\":\"0.0000\",\"ImbZroV\":\"0.0012\",\"HRPhV_H22_phsA\":\"0.0000\",\"HRPhV_H7_phsA\":\"0.0280\",\"HRPhV_H8_phsA\":\"0.0026\",\"HRPhV_H23_phsB\":\"0.0080\",\"PhV_phsA\":\"221.9935\",\"HRPhV_H8_phsB\":\"0.0026\",\"HRPhV_H23_phsC\":\"0.0080\",\"HRPhV_H8_phsC\":\"0.0026\",\"PhV_phsB\":\"221.9947\",\"PhV_phsC\":\"221.9979\",\"HRPhV_H23_phsA\":\"0.0080\",\"PstPhV_phsC\":\"3.2942\",\"PstPhV_phsA\":\"3.3086\",\"PstPhV_phsB\":\"3.2987\",\"Freq\":\"50.0000\",\"HRPhV_H11_phsA\":\"0.0180\",\"HRPhV_H11_phsB\":\"0.0180\",\"HRPhV_H17_phsC\":\"0.0100\",\"HRPhV_H11_phsC\":\"0.0180\",\"HRPhV_H17_phsB\":\"0.0100\",\"HRPhV_H17_phsA\":\"0.0100\",\"SeqV_C2\":\"0.0715\",\"HRPhV_H4_phsB\":\"0.0050\",\"SeqV_C1\":\"60.4601\",\"HRPhV_H4_phsA\":\"0.0050\",\"SeqV_C0\":\"0.0714\",\"PhVDev_phsC\":\"0.0119\",\"HRPhV_H5_phsA\":\"0.0400\",\"HRPhV_H5_phsB\":\"0.0400\",\"HRPhV_H5_phsC\":\"0.0400\",\"PhVDev_phsB\":\"0.0119\",\"HRPhV_H12_phsC\":\"0.0010\",\"PltPhV_phsA\":\"0.0000\",\"PhVDev_phsA\":\"0.0119\",\"HRPhV_H12_phsB\":\"0.0010\",\"HRPhV_H4_phsC\":\"0.0050\",\"HRPhV_H18_phsB\":\"0.0000\",\"HRPhV_H18_phsC\":\"0.0000\",\"HRPhV_H12_phsA\":\"0.0010\",\"HRPhV_H18_phsA\":\"0.0000\",\"HFundPhV_phsC\":\"220.8052\",\"HRPhV_H21_phsC\":\"0.0080\",\"HRPhV_H21_phsB\":\"0.0080\",\"HRPhV_H24_phsC\":\"0.0000\",\"HFundPhV_phsA\":\"220.8056\",\"HRPhV_H21_phsA\":\"0.0080\",\"HFundPhV_phsB\":\"220.8055\",\"HRPhV_H24_phsB\":\"0.0000\",\"PltPhV_phsC\":\"0.0000\",\"HRPhV_H24_phsA\":\"0.0000\",\"PltPhV_phsB\":\"0.0000\",\"time\":\"20241115T150000Z\"}"; public String devId = "暂无数据"; @@ -134,7 +136,16 @@ public class TestController { @GetMapping("clientTest") public void TestClient() { - clientHandler.start(); + System.out.println("进入模拟程序调用--------------------"); + String topic = "{\"HRPhV_H14_phsC\":0.078,\"HRPhV_H14_phsB\":0.035,\"HRPhV_H14_phsA\":0.044,\"HRPhV_H2_phsB\":0.132,\"HRPhV_H2_phsA\":0.141,\"HRPhV_H2_phsC\":0.158,\"HRPhV_H15_phsA\":0.121,\"TotW\":15877.469,\"HRPhV_H15_phsB\":0.155,\"HRPhV_H15_phsC\":0.342,\"FreqDev\":0.034,\"PPV_phsAB\":407.071,\"A_phsC\":28.514,\"TotPF\":0.996,\"A_phsA\":20.083,\"A_phsB\":29.695,\"PPV_phsBC\":408.577,\"HRPhV_H25_phsB\":0.046,\"HRPhV_H25_phsC\":0.039,\"HRPhV_H25_phsA\":0.052,\"DataTag\":\"0.000\",\"HRPhV_H20_phsA\":0.102,\"HRPhV_H20_phsB\":0.085,\"HRPhV_H20_phsC\":0.126,\"DataType\":\"CP95\",\"PPV_phsCA\":408.532,\"HRPhV_H3_phsB\":0.544,\"HRPhV_H3_phsC\":0.432,\"HRPhV_H9_phsC\":0.195,\"ThdPhV_phsA\":1.408,\"HRPhV_H9_phsB\":0.271,\"HRPhV_H9_phsA\":0.21,\"ThdPhV_phsB\":1.453,\"ThdPhV_phsC\":1.688,\"HRPhV_H19_phsC\":0.095,\"HRPhV_H19_phsB\":0.171,\"HRPhV_H19_phsA\":0.086,\"HRPhV_H16_phsA\":0.312,\"HRPhV_H13_phsA\":0.295,\"HRPhV_H16_phsC\":0.408,\"HRPhV_H13_phsB\":0.245,\"HRPhV_H16_phsB\":0.215,\"TotVA\":16013.368,\"HRPhV_H13_phsC\":0.394,\"HRPhV_H6_phsB\":0.088,\"HRPhV_H3_phsA\":0.246,\"HRPhV_H6_phsA\":0.042,\"HRPhV_H10_phsA\":0.056,\"HRPhV_H10_phsB\":0.038,\"HRPhV_H6_phsC\":0.083,\"HRPhV_H10_phsC\":0.068,\"ImbNgV\":0.465,\"TotVar\":-191.2,\"HRPhV_H7_phsC\":1.019,\"HRPhV_H7_phsB\":0.801,\"HRPhV_H22_phsC\":0.064,\"HRPhV_H22_phsB\":0.041,\"ImbZroV\":0.05,\"HRPhV_H22_phsA\":0.035,\"HRPhV_H7_phsA\":0.855,\"HRPhV_H8_phsA\":0.061,\"HRPhV_H23_phsB\":0.039,\"PhV_phsA\":235.764,\"HRPhV_H8_phsB\":0.041,\"HRPhV_H23_phsC\":0.111,\"HRPhV_H8_phsC\":0.075,\"PhV_phsB\":235.669,\"PhV_phsC\":236.598,\"HRPhV_H23_phsA\":0.114,\"PstPhV_phsC\":0.172,\"PstPhV_phsA\":0.177,\"PstPhV_phsB\":0.182,\"Freq\":50.034,\"HRPhV_H11_phsA\":0.265,\"HRPhV_H11_phsB\":0.246,\"HRPhV_H17_phsC\":0.199,\"HRPhV_H11_phsC\":0.182,\"HRPhV_H17_phsB\":0.197,\"HRPhV_H17_phsA\":0.248,\"SeqV_C2\":1.092,\"HRPhV_H4_phsB\":0.078,\"SeqV_C1\":235.958,\"HRPhV_H4_phsA\":0.092,\"SeqV_C0\":0.118,\"PhVDev_phsC\":7.842,\"HRPhV_H5_phsA\":0.969,\"HRPhV_H5_phsB\":1.043,\"HRPhV_H5_phsC\":1.097,\"PhVDev_phsB\":7.419,\"HRPhV_H12_phsC\":0.122,\"PltPhV_phsA\":0.255,\"PhVDev_phsA\":7.462,\"HRPhV_H12_phsB\":0.069,\"HRPhV_H4_phsC\":0.132,\"HRPhV_H18_phsB\":0.028,\"HRPhV_H18_phsC\":0.094,\"HRPhV_H12_phsA\":0.105,\"HRPhV_H18_phsA\":0.052,\"HFundPhV_phsC\":236.564,\"HRPhV_H21_phsC\":0.096,\"HRPhV_H21_phsB\":0.083,\"HRPhV_H24_phsC\":0.052,\"HFundPhV_phsA\":235.737,\"HRPhV_H21_phsA\":0.071,\"HFundPhV_phsB\":235.64,\"HRPhV_H24_phsB\":0.032,\"PltPhV_phsC\":0.244,\"HRPhV_H24_phsA\":0.032,\"PltPhV_phsB\":0.242,\"time\":\"2025-09-23T08:23:00Z\"}"; + + String topic2 = "{\"time\":\"20260106T170100Z\",\"DataTag\":0,\"DataType\":\"1.000\",\"Freq\":50.0671,\"FreqDev\":0.0671,\"A_phsA\":104.2118,\"A_phsB\":103.4132,\"A_phsC\":102.7066,\"PhV_phsA\":5.0094,\"PhV_phsB\":5.0081,\"PhV_phsC\":4.9913,\"PPV_phsAB\":8.68,\"PPV_phsBC\":8.6621,\"PPV_phsCA\":8.6539,\"PhVDev_phsA\":-13.2348,\"PhVDev_phsB\":-13.2564,\"PhVDev_phsC\":-13.5473,\"TotW\":1537.62427,\"TotVA\":1537.63232,\"TotVar\":5.0479,\"TotPF\":1,\"SeqV_C1\":4990.753,\"SeqV_C2\":0.0089,\"SeqV_C0\":0.0047,\"ImbNgV\":0.1785,\"ImbZroV\":0.0938,\"HFundPhV_phsA\":4.9972,\"HFundPhV_phsB\":4.9959,\"HFundPhV_phsC\":4.9792,\"ThdPhV_phsA\":6.9898,\"ThdPhV_phsB\":7.0035,\"ThdPhV_phsC\":6.98,\"HRPhV_H2_phsA\":0.9546,\"HRPhV_H3_phsA\":1.006,\"HRPhV_H4_phsA\":1.0045,\"HRPhV_H5_phsA\":0.9977,\"HRPhV_H6_phsA\":1.0003,\"HRPhV_H7_phsA\":0.9975,\"HRPhV_H8_phsA\":1,\"HRPhV_H9_phsA\":1.0008,\"HRPhV_H10_phsA\":1.0013,\"HRPhV_H11_phsA\":1.0002,\"HRPhV_H12_phsA\":1.003,\"HRPhV_H13_phsA\":1.0022,\"HRPhV_H14_phsA\":1.0027,\"HRPhV_H15_phsA\":1.0033,\"HRPhV_H16_phsA\":1.0017,\"HRPhV_H17_phsA\":1.0019,\"HRPhV_H18_phsA\":1.0012,\"HRPhV_H19_phsA\":1.0012,\"HRPhV_H20_phsA\":1.0008,\"HRPhV_H21_phsA\":1.0007,\"HRPhV_H22_phsA\":1.0028,\"HRPhV_H23_phsA\":1.0027,\"HRPhV_H24_phsA\":1.0054,\"HRPhV_H25_phsA\":1.005,\"HRPhV_H2_phsB\":0.9687,\"HRPhV_H3_phsB\":1.0166,\"HRPhV_H4_phsB\":1.0027,\"HRPhV_H5_phsB\":1.0037,\"HRPhV_H6_phsB\":1.0016,\"HRPhV_H7_phsB\":1.0031,\"HRPhV_H8_phsB\":1.0017,\"HRPhV_H9_phsB\":1.0002,\"HRPhV_H10_phsB\":1.0025,\"HRPhV_H11_phsB\":1.0033,\"HRPhV_H12_phsB\":1.0042,\"HRPhV_H13_phsB\":1.0041,\"HRPhV_H14_phsB\":1.004,\"HRPhV_H15_phsB\":1.0037,\"HRPhV_H16_phsB\":1.0031,\"HRPhV_H17_phsB\":1.0029,\"HRPhV_H18_phsB\":1.0022,\"HRPhV_H19_phsB\":1.0021,\"HRPhV_H20_phsB\":1.0009,\"HRPhV_H21_phsB\":1.0031,\"HRPhV_H22_phsB\":1.004,\"HRPhV_H23_phsB\":1.0048,\"HRPhV_H24_phsB\":1.007,\"HRPhV_H25_phsB\":1.0071,\"HRPhV_H2_phsC\":1.0017,\"HRPhV_H3_phsC\":1.0041,\"HRPhV_H4_phsC\":1.0002,\"HRPhV_H5_phsC\":1.0004,\"HRPhV_H6_phsC\":0.9988,\"HRPhV_H7_phsC\":1.0015,\"HRPhV_H8_phsC\":0.9986,\"HRPhV_H9_phsC\":0.9988,\"HRPhV_H10_phsC\":0.9983,\"HRPhV_H11_phsC\":0.9977,\"HRPhV_H12_phsC\":0.9968,\"HRPhV_H13_phsC\":0.997,\"HRPhV_H14_phsC\":0.9965,\"HRPhV_H15_phsC\":0.9986,\"HRPhV_H16_phsC\":0.9998,\"HRPhV_H17_phsC\":1.0023,\"HRPhV_H18_phsC\":1.0027,\"HRPhV_H19_phsC\":1.0034,\"HRPhV_H20_phsC\":1.0031,\"HRPhV_H21_phsC\":1,\"HRPhV_H22_phsC\":1,\"HRPhV_H23_phsC\":0.9984,\"HRPhV_H24_phsC\":0.996,\"HRPhV_H25_phsC\":0.996,\"PstPhV_phsA\":0,\"PstPhV_phsB\":0,\"PstPhV_phsC\":0,\"PltPhV_phsA\":0,\"PltPhV_phsB\":0,\"PltPhV_phsC\":0}"; + + String customDevId = "pmswifi_test"; + String devId = "deviceIdtest"; + clientHandler.dataCalculate(topic2,customDevId,devId); + log.info("模拟成功----------------------"); + } @@ -249,7 +260,7 @@ public class TestController { //Map eleEpdPqdMap = eleEpdPqdList.stream().collect(Collectors.toMap(EleEpdPqd::getName, Function.identity())); - devId = "NJCN230497"; + devId = "NJCN230497111"; for (int j = 0; j < 6; j++) { List poList = new ArrayList<>(); diff --git a/src/main/java/com/njcn/roma/listener/ClientListener.java b/src/main/java/com/njcn/roma/listener/ClientListener.java index 72b3117..0e2c84c 100644 --- a/src/main/java/com/njcn/roma/listener/ClientListener.java +++ b/src/main/java/com/njcn/roma/listener/ClientListener.java @@ -24,8 +24,6 @@ public class ClientListener { @EventListener public void onApplicationEvent(ContextRefreshedEvent event) { log.info("启动时自动执行 @EventListener 注解方法"); - clientHandler.start(); - } } diff --git a/src/main/java/com/njcn/roma/utils/JsonValueFluctuator.java b/src/main/java/com/njcn/roma/utils/JsonValueFluctuator.java index 8e9e556..65befa0 100644 --- a/src/main/java/com/njcn/roma/utils/JsonValueFluctuator.java +++ b/src/main/java/com/njcn/roma/utils/JsonValueFluctuator.java @@ -70,9 +70,7 @@ public class JsonValueFluctuator { jsonObject.put(key, numberValue); } } - }); - return jsonObject; } @@ -119,7 +117,8 @@ public class JsonValueFluctuator { * @return 浮动后的数值 */ private static double fluctuateValue(double value) { - double factor = 1.0 + (random.nextDouble() * 0.2) - 0.1; // 随机产生0.9到1.1之间的因子 + // 随机产生0.9到1.1之间的因子 + double factor = 1.0 + (random.nextDouble() * 0.2) - 0.1; return value * factor; } } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml new file mode 100644 index 0000000..d5b36b2 --- /dev/null +++ b/src/main/resources/application-dev.yml @@ -0,0 +1,74 @@ + +spring: + datasource: + dynamic: + druid: + initial-size: 10 + # 初始化大小,最小,最大 + min-idle: 20 + maxActive: 500 + # 配置获取连接等待超时的时间 + maxWait: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + timeBetweenEvictionRunsMillis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + minEvictableIdleTimeMillis: 300000 + testWhileIdle: true + testOnBorrow: true + validation-query: SELECT 1 from dual + testOnReturn: false + # 打开PSCache,并且指定每个连接上PSCache的大小 + poolPreparedStatements: false + maxPoolPreparedStatementPerConnectionSize: -1 + filters: stat,wall + filter: + wall: + config: + multi-statement-allow: true + none-base-statement-allow: true + enabled: true + # 配置DruidStatFilter + web-stat-filter: + enabled: true + url-pattern: "/*" + exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*" + # 配置DruidStatViewServlet + stat-view-servlet: + enabled: true + url-pattern: "/druid/*" + # IP白名单(没有配置或者为空,则允许所有访问) + allow: #127.0.0.1,192.168.163.1 + # IP黑名单 (存在共同时,deny优先于allow) + deny: #192.168.1.73 + # 禁用HTML页面上的“Reset All”功能 + reset-enable: false + # 登录名 + login-username: admin + # 登录密码 + login-password: njcnpqs + query-timeout: 36000 + primary: master + strict: false + datasource: + master: + url: jdbc:mysql://192.168.1.24:13306/pqsinfo_pmscs?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=CTT + username: root + password: njcnpqs + driver-class-name: com.mysql.cj.jdbc.Driver + + #influxDB内容配置 + influx: + url: http://192.168.1.24:8086 + user: admin + password: 123456 + database: pqsinfo_pms + + + +roma: + acceptIp: 25.36.190.3:19776 + sendIp: 25.36.190.7:11443 + appId: X_DNZLXT + appKey: IoKU7u47seGwzO4CqGmCaQ== + + diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml new file mode 100644 index 0000000..adef51e --- /dev/null +++ b/src/main/resources/application-prod.yml @@ -0,0 +1,74 @@ +spring: + datasource: + dynamic: + druid: + initial-size: 10 + # 初始化大小,最小,最大 + min-idle: 20 + maxActive: 500 + # 配置获取连接等待超时的时间 + maxWait: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + timeBetweenEvictionRunsMillis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + minEvictableIdleTimeMillis: 300000 + testWhileIdle: true + testOnBorrow: true + validation-query: SELECT 1 from dual + testOnReturn: false + # 打开PSCache,并且指定每个连接上PSCache的大小 + poolPreparedStatements: false + maxPoolPreparedStatementPerConnectionSize: -1 + filters: stat,wall + filter: + wall: + config: + multi-statement-allow: true + none-base-statement-allow: true + enabled: true + # 配置DruidStatFilter + web-stat-filter: + enabled: true + url-pattern: "/*" + exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*" + # 配置DruidStatViewServlet + stat-view-servlet: + enabled: true + url-pattern: "/druid/*" + # IP白名单(没有配置或者为空,则允许所有访问) + allow: #127.0.0.1,192.168.163.1 + # IP黑名单 (存在共同时,deny优先于allow) + deny: #192.168.1.73 + # 禁用HTML页面上的“Reset All”功能 + reset-enable: false + # 登录名 + login-username: admin + # 登录密码 + login-password: njcnpqs + query-timeout: 36000 + primary: master + strict: false + datasource: + master: + url: jdbc:mysql://25.36.232.37:13306/pmsinfo?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT + username: root + password: Huawei12# + driver-class-name: com.mysql.cj.jdbc.Driver + + + + influx: + url: http://25.36.232.36:8086 + user: admin + password: admin + database: pqsbase_hbcs + mapper-location: com.njcn.influx.imapper + + +roma: + acceptIp: 25.36.190.3:19776 + sendIp: 25.36.190.7:11443 + appId: X_DNZLXT + appKey: IoKU7u47seGwzO4CqGmCaQ== + + diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 143a3d5..82c3c2c 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -10,94 +10,8 @@ spring: password: dnzl@#002 application: name: roma - #datasource: - #type: com.zaxxer.hikari.HikariDataSource - #driver-class-name: org.sqlite.JDBC - #url: "jdbc:sqlite:D:\\pmsTest.db" - - - - autoconfigure: - exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure - datasource: - dynamic: - druid: - initial-size: 10 - # 初始化大小,最小,最大 - min-idle: 20 - maxActive: 500 - # 配置获取连接等待超时的时间 - maxWait: 60000 - # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 - timeBetweenEvictionRunsMillis: 60000 - # 配置一个连接在池中最小生存的时间,单位是毫秒 - minEvictableIdleTimeMillis: 300000 - testWhileIdle: true - testOnBorrow: true - validation-query: SELECT 1 from dual - testOnReturn: false - # 打开PSCache,并且指定每个连接上PSCache的大小 - poolPreparedStatements: false - maxPoolPreparedStatementPerConnectionSize: -1 - filters: stat,wall - filter: - wall: - config: - multi-statement-allow: true - none-base-statement-allow: true - enabled: true - # 配置DruidStatFilter - web-stat-filter: - enabled: true - url-pattern: "/*" - exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*" - # 配置DruidStatViewServlet - stat-view-servlet: - enabled: true - url-pattern: "/druid/*" - # IP白名单(没有配置或者为空,则允许所有访问) - allow: #127.0.0.1,192.168.163.1 - # IP黑名单 (存在共同时,deny优先于allow) - deny: #192.168.1.73 - # 禁用HTML页面上的“Reset All”功能 - reset-enable: false - # 登录名 - login-username: admin - # 登录密码 - login-password: njcnpqs - query-timeout: 36000 - primary: master - strict: false - datasource: - master: - url: jdbc:mysql://192.168.1.24:13306/pqsinfo_pmscs?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=CTT - username: root - password: njcnpqs - driver-class-name: com.mysql.cj.jdbc.Driver - #url: jdbc:mysql://25.36.232.37:13306/pmsinfo?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT - #username: root - #password: Huawei12# - #driver-class-name: com.mysql.cj.jdbc.Driver - #sqlite: - # url: "jdbc:sqlite:D:\\pmsTest.db" - # driver-class-name: org.sqlite.JDBC - # type: com.alibaba.druid.pool.DruidDataSource - - - #influxDB内容配置 - influx: - url: http://192.168.1.24:8086 - user: admin - password: 123456 - database: pqsinfo_pms - - #influx: - #url: http://25.36.232.36:8086 - #user: admin - #password: admin - #database: pqsbase_hbcs - #mapper-location: com.njcn.influx.imapper - + profiles: + active: dev roma: acceptIp: 25.36.190.3:19776 diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml new file mode 100644 index 0000000..34f8080 --- /dev/null +++ b/src/main/resources/logback.xml @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + UTF-8 + %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + UTF-8 + + + + + + + + ${logHomeDir}/${log.projectName}/debug/debug.log + + + + + DEBUG + + ACCEPT + + DENY + + + + + + ${logHomeDir}/${log.projectName}/debug/debug.log.%d{yyyy-MM-dd}.%i.log + + 10MB + + ${log.maxHistory:-30} + + + + + + + + + + ${log.pattern} + + UTF-8 + + + + + + + INFO + ACCEPT + DENY + + + ${logHomeDir}/${log.projectName}/info/info.log + + + + ${logHomeDir}/${log.projectName}/info/info.log.%d{yyyy-MM-dd}.%i.log + + 10MB + ${log.maxHistory:-30} + + + + ${log.pattern} + + UTF-8 + + + + + + + + ${logHomeDir}/${log.projectName}/error/error.log + + + ERROR + ACCEPT + DENY + + + + ${logHomeDir}/${log.projectName}/error/error.log.%d{yyyy-MM-dd}.%i.log + + 10MB + ${log.maxHistory:-30} + + + + ${log.pattern} + + UTF-8 + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html index 22de09d..d81bd1d 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/static/index.html @@ -6,7 +6,7 @@ 谐波次 (%)数表格 - +
@@ -27,7 +27,7 @@
- @@ -36,14 +36,13 @@ - +
装置标识:{{data.customDevId}}
{{data.time}}
- @@ -403,10 +402,9 @@ -