|
@@ -12,6 +12,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
+import javax.sound.midi.Soundbank;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
@@ -86,27 +87,35 @@ public class EnvInputServerHandler extends ChannelInboundHandlerAdapter {
|
|
|
|
|
|
|
|
|
|
private void handleClientAskCmd(String clientAskText, ChannelHandlerContext ctx) throws ParseException, IOException {
|
|
private void handleClientAskCmd(String clientAskText, ChannelHandlerContext ctx) throws ParseException, IOException {
|
|
|
|
+ try {
|
|
|
|
+ System.out.println("接收到消息: " + clientAskText + " 时间: " + System.currentTimeMillis());
|
|
|
|
+ EnvironmentalData parse = HJ212Parser.parse(clientAskText.replace("##", ""));
|
|
|
|
+ ProtData protData = new ProtData();
|
|
|
|
+ protData.setPh(parse.getCpData().getParameters().get("w01001").getAvg());
|
|
|
|
+// protData.setOther1(parse.getCpData().getParameters().get("w01010").getAvg());
|
|
|
|
+ protData.setCod(parse.getCpData().getParameters().get("w01018").getAvg());
|
|
|
|
+ protData.setNh3n(parse.getCpData().getParameters().get("w21003").getAvg());
|
|
|
|
+ protData.setOther2(parse.getCpData().getParameters().get("w00000").getAvg());
|
|
|
|
|
|
- System.out.println("接收到消息: " + clientAskText + " 时间: " + System.currentTimeMillis());
|
|
|
|
- EnvironmentalData parse = HJ212Parser.parse(clientAskText.replace("##", ""));
|
|
|
|
- ProtData protData = new ProtData();
|
|
|
|
- protData.setPh(parse.getCpData().getParameters().get("w01001").getAvg());
|
|
|
|
- protData.setOther1(parse.getCpData().getParameters().get("w01010").getAvg());
|
|
|
|
- protData.setCod(parse.getCpData().getParameters().get("w01018").getAvg());
|
|
|
|
- protData.setNh3n(parse.getCpData().getParameters().get("w21003").getAvg());
|
|
|
|
- protData.setOther2(parse.getCpData().getParameters().get("w00000").getAvg());
|
|
|
|
- protData.setLoctionType(1);
|
|
|
|
- String mn = parse.getHeader().getMn();
|
|
|
|
- if ("01523162079470".equals(mn)){
|
|
|
|
- protData.setFarmId(30);
|
|
|
|
- }else {
|
|
|
|
- protData.setFarmId(28);
|
|
|
|
|
|
+ protData.setLoctionType(1);
|
|
|
|
+ String mn = parse.getHeader().getMn();
|
|
|
|
+ if ("01523162079470".equals(mn)){
|
|
|
|
+ protData.setFarmId(30);
|
|
|
|
+ }else {
|
|
|
|
+ protData.setFarmId(28);
|
|
|
|
+ }
|
|
|
|
+ protData.setOther3(clientAskText);
|
|
|
|
+ protData.setCreateDate(new Date());
|
|
|
|
+
|
|
|
|
+ protDataMapper.insert(protData);
|
|
|
|
+ askTextSb.delete(0, askTextSb.length());
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ System.out.println(e);
|
|
|
|
+ askTextSb.delete(0, askTextSb.length());
|
|
}
|
|
}
|
|
- protData.setOther3(clientAskText);
|
|
|
|
- protData.setCreateDate(new Date());
|
|
|
|
|
|
|
|
- protDataMapper.insert(protData);
|
|
|
|
- askTextSb.delete(0, askTextSb.length());
|
|
|
|
|
|
+ //##0349QN=20250414111200085;ST=32;CN=2011;PW=123456;MN=01523162079470;Flag=4;CP=&&DataTime=20250414111200;w01018-SampleTime=20250414100000,w01018-Rtd=74.2,w01018-Flag=N;w00000-SampleTime=20250414111048,w00000-Rtd=1.968,w00000-Flag=N;w01001-Rtd=7.26,w01001-Flag=N;w01010-Rtd=21,w01010-Flag=N;w21003-SampleTime=20250414100000,w21003-Rtd=0.422,w21003-Flag=N&&3600
|
|
|
|
+
|
|
}
|
|
}
|
|
//QN 20250412142007184 请求编号(21位时间戳:2025-04-12 14:20:07.184)
|
|
//QN 20250412142007184 请求编号(21位时间戳:2025-04-12 14:20:07.184)
|
|
//ST 32 系统类型(32表示污水处理设施)
|
|
//ST 32 系统类型(32表示污水处理设施)
|