From 7ad4b3cb3848a8a3ee18f117f453060b9530bfba Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期一, 31 七月 2023 09:46:24 +0800
Subject: [PATCH] 新增贝博粮情协议--整体框架提交

---
 igds-core/src/main/java/com/ld/igds/io/constant/ProtocolEnum.java                                  |    1 
 igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/RemoteGrainServiceImpl.java     |   61 +++++
 igds-web/src/main/resources/application-pro5327.yml                                                |    2 
 pom.xml                                                                                            |    2 
 igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/client/ClientHandler.java       |   58 +++++
 igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/builder/CommandBuild.java       |   54 ++++
 igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/util/BeiboGrainServerUtils.java |   13 +
 igds-web/src/main/resources/application.yml                                                        |    2 
 igds-protocol-beibo/pom.xml                                                                        |   48 ++++
 igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/client/BeiboClientEngine.java   |  117 ++++++++++
 igds-web/pom.xml                                                                                   |  113 +++++----
 igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/package-info.java               |    6 
 igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/analysis/AnalysisService.java   |  125 +++++++++++
 13 files changed, 552 insertions(+), 50 deletions(-)

diff --git a/igds-core/src/main/java/com/ld/igds/io/constant/ProtocolEnum.java b/igds-core/src/main/java/com/ld/igds/io/constant/ProtocolEnum.java
index d57d44d..92b8ef0 100644
--- a/igds-core/src/main/java/com/ld/igds/io/constant/ProtocolEnum.java
+++ b/igds-core/src/main/java/com/ld/igds/io/constant/ProtocolEnum.java
@@ -31,6 +31,7 @@
     TCP_BHZH_GRAIN_V2("TCP_BHZH_GRAIN_V2", "閭︽捣鏅鸿兘鏈夌嚎鐗圴2"),
     TCP_BHZH_VERB_V2("TCP_BHZH_VERB_V2", "閭︽捣鎺у埗鏌滄櫤鑳芥湁绾跨増V2"),
     TCP_BHZH_INOUT_V1("TCP_BHZH_INOUT_V1", "閭︽捣鏅鸿兘鍑哄叆搴撴帶鍒跺櫒鍗忚"),
+    TCP_BEIBO_GRAIN_V1("TCP_BEIBO_GRAIN_V1", "璐濆崥绮儏鍒嗘満鏈嶅姟绔崗璁�"),
     FZZY_OPENAPI_HTTP("FZZY_OPENAPI_HTTP", "椋庢鑷磋繙API-HTTP鍗忚");
 
 
diff --git a/igds-protocol-beibo/pom.xml b/igds-protocol-beibo/pom.xml
new file mode 100644
index 0000000..9d30503
--- /dev/null
+++ b/igds-protocol-beibo/pom.xml
@@ -0,0 +1,48 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>com.ld.igds</groupId>
+	<artifactId>igds-protocol-beibo</artifactId>
+	<version>4.0.0-RELEASE</version>
+	<packaging>jar</packaging>
+
+	<properties>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+		<java.version>1.8</java.version>
+		<igds.version>4.0.0-RELEASE</igds.version>
+	</properties>
+
+	<dependencies>
+
+		<!-- 寮曞叆涔夊姟鏍稿績鍖� -->
+		<dependency>
+			<groupId>com.ld.igds</groupId>
+			<artifactId>igds-core</artifactId>
+			<version>${igds.version}</version>
+		</dependency>
+
+		<!-- 寮曞叆IO鍖� -->
+		<dependency>
+			<groupId>com.ld.base.io</groupId>
+			<artifactId>base-io-netty</artifactId>
+			<version>1.0.0-SNAPSHOT</version>
+		</dependency>
+	</dependencies>
+
+ 	<build>
+ 		<plugins>
+ 			<plugin>
+ 				<groupId>org.apache.maven.plugins</groupId>
+ 				<artifactId>maven-compiler-plugin</artifactId>
+ 				<configuration>
+ 					<source>1.8</source>
+ 					<target>1.8</target>
+ 					<compilerArguments>
+ 						<extdirs>src\main\webapp\WEB-INF\lib</extdirs>
+ 					</compilerArguments>
+ 				</configuration>
+ 			</plugin>
+ 		</plugins>
+ 	</build>
+
+</project>
\ No newline at end of file
diff --git a/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/RemoteGrainServiceImpl.java b/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/RemoteGrainServiceImpl.java
new file mode 100644
index 0000000..601dccb
--- /dev/null
+++ b/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/RemoteGrainServiceImpl.java
@@ -0,0 +1,61 @@
+package com.ld.igds.protocol.beibo.grain;
+
+import com.ld.igds.io.RemoteGrainService;
+import com.ld.igds.io.constant.OrderRespEnum;
+import com.ld.igds.io.constant.ProtocolEnum;
+import com.ld.igds.io.request.CheckGrainRequest;
+import com.ld.igds.io.response.GrainResponse;
+import com.ld.igds.protocol.beibo.grain.builder.CommandBuild;
+import com.ld.igds.protocol.beibo.grain.client.BeiboClientEngine;
+import com.ld.igds.util.BytesUtil;
+import com.ld.io.api.InvokeResult;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+/**
+ * 璐濆崥绮儏鍒嗘満鍗忚
+ *
+ * @author czt
+ */
+@Slf4j
+@Component(RemoteGrainServiceImpl.BEAN_ID)
+public class RemoteGrainServiceImpl implements RemoteGrainService {
+
+    public static final String BEAN_ID = "beiboGrain.remoteGrainService";
+
+    @Override
+    public String getProtocol() {
+        return ProtocolEnum.TCP_BEIBO_GRAIN_V1.getCode();
+    }
+
+    @Override
+    public GrainResponse checkGrain(CheckGrainRequest request) {
+        try {
+            log.info("璐濆崥绮儏鍒嗘満寮�濮嬫娴嬶紝鍒嗘満{}鐨処P={},绔彛={}",request.getSerId(),request.getIp(),request.getPort());
+            BeiboClientEngine beibo = new BeiboClientEngine(request.getIp(),request.getPort());
+            beibo.start();
+            Thread.sleep(3000);
+
+            //鐢熸垚绮儏鍛戒护
+            String hexStr = CommandBuild.getInstance().getMsgCheck(request.getSerId(), request.getDepotId());
+
+            InvokeResult result = beibo.send(BytesUtil.hexStrToBytes(hexStr));
+
+            log.info("result=" +result.getMessage());
+
+            // 灏佽杩斿洖淇℃伅
+            if (InvokeResult.SUCCESS == result) {
+                return new GrainResponse(OrderRespEnum.ORDER_SUCCESS.getCode(),
+                        "绮儏绮儏鍙戦�佹垚鍔燂紒");
+            } else {
+                log.error("骞冲彴------>>>>璐濆崥绮儏鍒嗘満锛氱伯鎯呮娴�-澶辫触{}", result.getMessage());
+                return new GrainResponse(OrderRespEnum.ORDER_ERROR.getCode(),
+                        "鍛戒护鍙戦�佸紓甯革細" + result.getMessage());
+            }
+
+        } catch (Exception e) {
+            log.error("绮儏妫�娴嬪紓甯革細{}", e);
+            return new GrainResponse(OrderRespEnum.ORDER_ERROR.getCode(), "鍚庣寮傚父锛�" + e.getMessage());
+        }
+    }
+}
\ No newline at end of file
diff --git a/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/analysis/AnalysisService.java b/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/analysis/AnalysisService.java
new file mode 100644
index 0000000..ed6fedd
--- /dev/null
+++ b/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/analysis/AnalysisService.java
@@ -0,0 +1,125 @@
+package com.ld.igds.protocol.beibo.grain.analysis;
+
+import com.ld.igds.common.CoreCommonService;
+import com.ld.igds.common.CoreSerService;
+import com.ld.igds.common.dto.THDto;
+import com.ld.igds.constant.BizType;
+import com.ld.igds.grain.GrainUtil;
+import com.ld.igds.io.notify.NotifyGrainInvoker;
+import com.ld.igds.models.DepotConf;
+import com.ld.igds.models.DeviceSer;
+import com.ld.igds.models.DicSysConf;
+import com.ld.igds.order.ExeOrderService;
+import com.ld.igds.order.data.ExeRequest;
+import com.ld.igds.protocol.beibo.grain.util.BeiboGrainServerUtils;
+import com.ld.igds.util.ContextUtil;
+import com.ld.igds.warn.WarnUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.*;
+
+/**
+ * 鍗忚瑙f瀽
+ *
+ * @author vince
+ */
+@Slf4j
+@Component(AnalysisService.BEAN_ID)
+public class AnalysisService {
+
+
+    /**
+     * 閽堝鍒嗗寘绮儏鎶ユ枃杩涜灏佽
+     */
+    public static Map<String, String> contextMapGrain = new HashMap<>();
+
+    /**
+     * 鐢ㄤ簬瀛樻斁杩斿洖鐨勪粨娓╀粨婀夸俊鎭�
+     */
+    public static Map<String, THDto> contextMapTH = new HashMap<>();
+
+    public static final String BEAN_ID = "beiboGrain.analysisService";
+
+    @Autowired
+    private CoreSerService coreSerService;
+    @Autowired
+    private CoreCommonService commonService;
+    @Autowired
+    private NotifyGrainInvoker notifyGrainInvoker;
+    @Autowired
+    private GrainUtil grainUtil;
+    @Autowired
+    private WarnUtils warnUtils;
+    @Autowired
+    private ExeOrderService exeOrderService;
+
+    /**
+     *
+     * @param result
+     */
+    public void analysis(String result){
+        log.info("璐濆崥鍒嗘満------->>骞冲彴锛氫俊鎭姤鏂�={}", result);
+        if(!result.startsWith(BeiboGrainServerUtils.MSG_START)){
+            log.error("璐濆崥鍒嗘満------->>骞冲彴锛岃В鏋愮伯鎯呭け璐ワ細鎶ユ枃璧峰绗﹂敊璇紝涓嶈В鏋�");
+        }
+        //鍘婚櫎璧峰绗�
+        result = result.substring(9*2-1);
+
+        analysisGrain(result);
+    }
+
+
+    private void analysisGrain(String result) {
+        try {
+
+            //鎴彇鍒嗘満鍦板潃
+            String serId = result.substring(0, 2);
+            //鏍规嵁鍒嗘満鍦板潃鑾峰彇鍒嗘満淇℃伅
+            DeviceSer ser = coreSerService.getCacheSer(ContextUtil.getDefaultCompanyId(),serId);
+            if (ser == null) {
+                log.error("璐濆崥鍒嗘満-------->>骞冲彴锛岃В鏋愮伯鎯呭け璐ワ紝鏈幏鍙栧埌绯荤粺绮儏涓绘満閰嶇疆锛�" + serId);
+                return;
+            }
+
+            // 棣栧厛鑾峰彇鍒扮郴缁熷弬鏁帮紝鍒ゆ柇鏄惁闇�瑕佹壒娆¤嚜鍔ㄤ紭鍖�
+            DicSysConf sysConf = commonService.getCacheSysConf(ser.getCompanyId());
+            List<ExeRequest> list = exeOrderService.getInProgressOrderBySerId(BizType.GRAIN.getCode(), ser.getId());
+
+            if (null == list || list.isEmpty()) {
+                String info = "绮儏瑙f瀽澶辫触:鍒嗘満=" + ser.getName() + "娌℃湁鑾峰彇鍒版墍灞炰粨搴撲俊鎭��";
+                log.error("璐濆崥鍒嗘満------>>>骞冲彴锛�" + info);
+                return;
+            }
+
+            //鑾峰彇閽堝褰撳墠浠撳簱鐨勫懡浠�
+            ExeRequest exeRequest = list.get(0);
+            if (null == exeRequest) {
+                String info = "绮儏瑙f瀽澶辫触:鍒嗘満=" + ser.getName() + "娌℃湁鑾峰彇鍘嗗彶鍛戒护銆�";
+                log.error("璐濆崥鍒嗘満------>>>骞冲彴锛�" + info);
+                return;
+            }
+
+            DepotConf depotConf = commonService.getCacheDepotConf(exeRequest.getCompanyId(), exeRequest.getDepotId());
+
+            if (null == depotConf) {
+                String info = "绮儏瑙f瀽澶辫触:鍒嗘満=" + ser.getName() + "娌℃湁鑾峰彇鍒扮伯鎯呭弬鏁伴厤缃俊鎭��";
+                log.error("璐濆崥鍒嗘満------>>>骞冲彴锛�" + info);
+                return;
+            }
+
+            // 绮儏鐨勬壒娆″彿閲嶆柊鏍规嵁棰戠巼璋冩暣
+            String batchId = ContextUtil.getBatchIdByFireq(depotConf.getGrainFreq());
+
+            //TODO 鏍规嵁瀹為檯鎶ユ枃锛屽緟瀹炵幇
+
+
+
+
+
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+    }
+}
diff --git a/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/builder/CommandBuild.java b/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/builder/CommandBuild.java
new file mode 100644
index 0000000..8b02a21
--- /dev/null
+++ b/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/builder/CommandBuild.java
@@ -0,0 +1,54 @@
+package com.ld.igds.protocol.beibo.grain.builder;
+
+import com.ld.igds.protocol.beibo.grain.util.BeiboGrainServerUtils;
+import com.ld.igds.util.BytesUtil;
+
+/**
+ * 鍛戒护鐢熸垚
+ *
+ * @author czt
+ */
+public class CommandBuild {
+
+    private final static CommandBuild instance = new CommandBuild();
+
+    private CommandBuild() {
+    }
+
+    public static CommandBuild getInstance() {
+        return instance;
+    }
+
+    /**
+     * 绮儏閲囬泦鍛戒护
+     *
+     * @param grainAddr 绮儏鍒嗘満鍦板潃
+     * @param deptId    浠撳簱缂栧彿鍦板潃
+     * @return
+     */
+    public static String getMsgCheck(String grainAddr, String deptId) {
+
+        StringBuffer sb = new StringBuffer();
+
+        //璧峰绗�
+        sb.append(BeiboGrainServerUtils.MSG_START);
+
+        //鍒嗘満鍦板潃
+        int i = Integer.parseInt(grainAddr);
+        sb.append(BytesUtil.intToHexStr1(i));
+
+        //鎺у埗鍛戒护
+        sb.append("82");
+
+        //鍒嗘満鍦板潃
+        sb.append(BytesUtil.intToHexStr1(i));
+
+        //娴嬫俯鐢电紗灞傛暟锛屼笉鐭ラ亾鐢电紗閲囬泦灞傛暟鏃讹紝榛樿00鎴栬�匜F
+        sb.append("00");
+
+        //缁撳熬绗�
+        sb.append(BeiboGrainServerUtils.MSG_END);
+
+        return sb.toString();
+    }
+}
diff --git a/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/client/BeiboClientEngine.java b/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/client/BeiboClientEngine.java
new file mode 100644
index 0000000..b4d65e2
--- /dev/null
+++ b/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/client/BeiboClientEngine.java
@@ -0,0 +1,117 @@
+package com.ld.igds.protocol.beibo.grain.client;
+
+import com.ld.igds.util.BytesUtil;
+import com.ld.io.api.InvokeResult;
+import io.netty.bootstrap.Bootstrap;
+import io.netty.buffer.Unpooled;
+import io.netty.channel.*;
+import io.netty.channel.oio.OioEventLoopGroup;
+import io.netty.channel.socket.SocketChannel;
+import io.netty.channel.socket.oio.OioSocketChannel;
+import io.netty.handler.codec.bytes.ByteArrayDecoder;
+import io.netty.handler.codec.bytes.ByteArrayEncoder;
+
+/**
+ * 璐濆崥绮儏鍗忚锛屽垎鏈轰负鏈嶅姟绔紝骞冲彴涓哄鎴风涓诲姩杩炴帴
+ * 
+ * @author czt
+ */
+public class BeiboClientEngine implements Runnable {
+
+	private String host;
+	private int port;
+	// public ChannelFuture channelFuture;
+	public Channel channel;
+
+	public BeiboClientEngine(String host, int port) {
+		this.host = host;
+		this.port = port;
+	}
+	public void start() {
+		Thread thread = new Thread(this);
+		thread.start();
+	}
+
+	@Override
+	public void run() {
+		try {
+			startRun();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	public void startRun() throws Exception {
+		EventLoopGroup group = new OioEventLoopGroup();
+		Bootstrap b = new Bootstrap();
+		// b.option(ChannelOption.SO_KEEPALIVE, true);
+		b.group(group).channel(OioSocketChannel.class)
+				.handler(new ChannelInitializer<SocketChannel>() {
+					@Override
+					protected void initChannel(SocketChannel ch)
+							throws Exception {
+						ChannelPipeline p = ch.pipeline();
+						// 瀛楃涓茶В鐮� 鍜� 缂栫爜
+						p.addLast("decoder", new ByteArrayDecoder());
+						p.addLast("encoder", new ByteArrayEncoder());
+						// 鑷繁鐨勯�昏緫Handler
+						p.addLast("handler", new ClientHandler());
+					}
+				});
+
+		// 鍙戣捣寮傛杩炴帴璇锋眰锛岀粦瀹氳繛鎺ョ鍙e拰host淇℃伅
+		ChannelFuture channelFuture = b.connect(host, port);
+		this.channel = channelFuture.channel();
+		// channelFuture.channel().closeFuture().sync();
+
+		channelFuture.addListener(new ChannelFutureListener() {
+			@Override
+			public void operationComplete(ChannelFuture arg0) throws Exception {
+				if (channelFuture.isSuccess()) {
+					System.out.println("杩炴帴鏈嶅姟鍣ㄦ垚鍔�");
+				} else {
+					System.out.println("杩炴帴鏈嶅姟鍣ㄥけ璐�");
+					channelFuture.cause().printStackTrace();
+					group.shutdownGracefully(); // 鍏抽棴绾跨▼缁�
+				}
+			}
+		});
+	}
+
+	public InvokeResult send(byte[] array) throws InterruptedException {
+		if (null == channel) {
+			return InvokeResult.SOCKET_NOT_CREATE;
+		}
+		if (!channel.isActive()) {
+			return InvokeResult.CHANNEL_CLOSED;
+		}
+		channel.writeAndFlush(Unpooled.copiedBuffer(array)).sync();
+
+		return InvokeResult.SUCCESS;
+	}
+
+	public static void main(String[] args) {
+		try {
+
+			String msg = "000000000006010600070012";
+			BeiboClientEngine test = new BeiboClientEngine(
+					"192.168.1.95", 9999);
+
+			test.start();
+
+			msg = "BB BB BB BB";
+
+			// Thread.sleep(3000L);
+
+			test.send(BytesUtil.hexStrToBytes(msg));
+
+		} catch (InterruptedException e) {
+			e.printStackTrace();
+		}
+	}
+
+	public Channel getChannel() {
+		return channel;
+	}
+
+}
diff --git a/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/client/ClientHandler.java b/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/client/ClientHandler.java
new file mode 100644
index 0000000..ad53e2c
--- /dev/null
+++ b/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/client/ClientHandler.java
@@ -0,0 +1,58 @@
+package com.ld.igds.protocol.beibo.grain.client;
+
+import com.ld.igds.protocol.beibo.grain.analysis.AnalysisService;
+import com.ld.igds.util.BytesUtil;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.SimpleChannelInboundHandler;
+import io.netty.util.internal.logging.InternalLogger;
+import io.netty.util.internal.logging.InternalLoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.net.InetSocketAddress;
+
+/**
+ * Handles a client-side channel.
+ */
+
+public class ClientHandler extends SimpleChannelInboundHandler<Object> {
+	@Autowired
+	private AnalysisService analysisService;
+	private final InternalLogger log = InternalLoggerFactory.getInstance(this
+			.getClass());
+	@Override
+	public void channelActive(ChannelHandlerContext ctx) {
+		InetSocketAddress insocket = (InetSocketAddress) ctx.channel()
+				.remoteAddress();
+		log.info("璐濆崥绮儏鍒嗘満鎴愬姛杩炴帴锛孖P={},port={}", insocket.getAddress()
+				.getHostAddress(), insocket.getPort());
+	}
+
+	@Override
+	public void channelInactive(ChannelHandlerContext ctx) throws Exception {
+		super.channelInactive(ctx);
+
+		InetSocketAddress insocket = (InetSocketAddress) ctx.channel()
+				.remoteAddress();
+
+		log.info("璐濆崥绮儏鍒嗘満鏂紑杩炴帴锛孖P={},port={}", insocket.getAddress(),insocket.getPort());
+	}
+
+	@Override
+	public void channelRead0(ChannelHandlerContext ctx, Object msg)
+			throws Exception {
+		byte[] bytes = (byte[]) msg;
+		String result = BytesUtil.bytesToString(bytes);
+		log.info("璐濆崥绮儏鍒嗘満杩斿洖淇℃伅=" + result);
+
+		InetSocketAddress insocket = (InetSocketAddress) ctx.channel().remoteAddress();
+
+		//瑙f瀽
+		analysisService.analysis(result);
+	}
+
+	@Override
+	public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
+		ctx.close();
+	}
+
+}
diff --git a/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/package-info.java b/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/package-info.java
new file mode 100644
index 0000000..cf5b4a3
--- /dev/null
+++ b/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/package-info.java
@@ -0,0 +1,6 @@
+/**
+ * 璐濆崥绮儏鍗忚-鍒嗘満涓烘湇鍔$
+ */
+package com.ld.igds.protocol.beibo.grain;
+
+
diff --git a/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/util/BeiboGrainServerUtils.java b/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/util/BeiboGrainServerUtils.java
new file mode 100644
index 0000000..de00a97
--- /dev/null
+++ b/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/util/BeiboGrainServerUtils.java
@@ -0,0 +1,13 @@
+package com.ld.igds.protocol.beibo.grain.util;
+
+/**
+ * 宸ュ叿绫�
+ *
+ * @author czt
+ */
+public class BeiboGrainServerUtils {
+
+
+    public static String MSG_START = "00000000FFEB90FEAA"; //璧峰绗�
+    public static String MSG_END = "00000000000000000000000000"; //缁撳熬绗�
+}
diff --git a/igds-web/pom.xml b/igds-web/pom.xml
index 1753995..613beb3 100644
--- a/igds-web/pom.xml
+++ b/igds-web/pom.xml
@@ -168,6 +168,23 @@
             </exclusions>
         </dependency>
 
+        <!--  绉佹湁鍗忚-璐濆崥绮儏
+        <dependency>
+            <groupId>com.ld.igds</groupId>
+            <artifactId>igds-protocol-beibo</artifactId>
+            <version>${igds.version}</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>slf4j-log4j12</artifactId>
+                    <groupId>org.slf4j</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>log4j</artifactId>
+                    <groupId>log4j</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>-->
+
         <!--  绉佹湁鍗忚-閭︽捣鏅鸿兘
         <dependency>
             <groupId>com.ld.igds</groupId>
@@ -252,54 +269,54 @@
             </plugin>
 
             <!-- YUI Compressor Maven鍘嬬缉鎻掍欢 寮�鍙戝寘涓嶅疄鐢�-->
-            <plugin>
-                <groupId>net.alchim31.maven</groupId>
-                <artifactId>yuicompressor-maven-plugin</artifactId>
-                <version>1.5.1</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>compress</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <encoding>UTF-8</encoding>
-                    <!--涓嶆樉绀簀s鍙兘鐨勯敊璇� -->
-                    <jswarn>false</jswarn>
-                    <!--鏄惁娣锋穯 -->
-                    <nomunge>true</nomunge>
-                    <!--鑻ュ瓨鍦ㄥ凡鍘嬬缉鐨勬枃浠讹紝浼氬厛瀵规瘮婧愭枃浠舵槸鍚︽湁鏀瑰姩 鏈夋敼鍔ㄤ究鍘嬬缉锛屾棤鏀瑰姩灏变笉鍘嬬缉 -->
-                    <force>false</force>
-                    <!--鍦ㄦ寚瀹氱殑鍒楀彿鍚庢彃鍏ユ柊琛� -->
-                    <linebreakpos>-1</linebreakpos>
-                    <!--鍘嬬缉涔嬪墠鍏堟墽琛岃仛鍚堟枃浠舵搷浣� -->
-                    <preProcessAggregates>true</preProcessAggregates>
-                    <!--鍘嬬缉鍚庝繚瀛樻枃浠跺悗缂� 鏃犲悗缂� -->
-                    <nosuffix>true</nosuffix>
-                    <!--婧愮洰褰曪紝鍗抽渶鍘嬬缉鐨勬牴鐩綍 -->
-                    <sourceDirectory>src/main/resources</sourceDirectory>
-                    <!--杈撳嚭鐩綍锛屽嵆鍘嬬缉鍚庣殑鐩綍 -->
-                    <outputDirectory>target/classes</outputDirectory>
-                    <force>true</force>
-                    <!--鍘嬬缉js鍜宑ss鏂囦欢 -->
-                    <includes>
-                        <include>**/*.js</include>
-                        <include>**/*.css</include>
-                    </includes>
-                    <!-- 浠ヤ笅鐩綍鍜屾枃浠朵笉浼氳鍘嬬缉 -->
-                    <excludes>
-                        <exclude>**/*.min.js</exclude>
-                        <exclude>**/*.min.css</exclude>
-                        <exclude>**/d7/**</exclude>
-                        <exclude>**/dorado-home/**</exclude>
-                        <exclude>**/bdf2/**</exclude>
-                        <exclude>**/css/**</exclude>
-                        <exclude>**/js/**</exclude>
-                        <exclude>**/plugins/**</exclude>
-                    </excludes>
-                </configuration>
-            </plugin>
+<!--            <plugin>-->
+<!--                <groupId>net.alchim31.maven</groupId>-->
+<!--                <artifactId>yuicompressor-maven-plugin</artifactId>-->
+<!--                <version>1.5.1</version>-->
+<!--                <executions>-->
+<!--                    <execution>-->
+<!--                        <goals>-->
+<!--                            <goal>compress</goal>-->
+<!--                        </goals>-->
+<!--                    </execution>-->
+<!--                </executions>-->
+<!--                <configuration>-->
+<!--                    <encoding>UTF-8</encoding>-->
+<!--                    &lt;!&ndash;涓嶆樉绀簀s鍙兘鐨勯敊璇� &ndash;&gt;-->
+<!--                    <jswarn>false</jswarn>-->
+<!--                    &lt;!&ndash;鏄惁娣锋穯 &ndash;&gt;-->
+<!--                    <nomunge>true</nomunge>-->
+<!--                    &lt;!&ndash;鑻ュ瓨鍦ㄥ凡鍘嬬缉鐨勬枃浠讹紝浼氬厛瀵规瘮婧愭枃浠舵槸鍚︽湁鏀瑰姩 鏈夋敼鍔ㄤ究鍘嬬缉锛屾棤鏀瑰姩灏变笉鍘嬬缉 &ndash;&gt;-->
+<!--                    <force>false</force>-->
+<!--                    &lt;!&ndash;鍦ㄦ寚瀹氱殑鍒楀彿鍚庢彃鍏ユ柊琛� &ndash;&gt;-->
+<!--                    <linebreakpos>-1</linebreakpos>-->
+<!--                    &lt;!&ndash;鍘嬬缉涔嬪墠鍏堟墽琛岃仛鍚堟枃浠舵搷浣� &ndash;&gt;-->
+<!--                    <preProcessAggregates>true</preProcessAggregates>-->
+<!--                    &lt;!&ndash;鍘嬬缉鍚庝繚瀛樻枃浠跺悗缂� 鏃犲悗缂� &ndash;&gt;-->
+<!--                    <nosuffix>true</nosuffix>-->
+<!--                    &lt;!&ndash;婧愮洰褰曪紝鍗抽渶鍘嬬缉鐨勬牴鐩綍 &ndash;&gt;-->
+<!--                    <sourceDirectory>src/main/resources</sourceDirectory>-->
+<!--                    &lt;!&ndash;杈撳嚭鐩綍锛屽嵆鍘嬬缉鍚庣殑鐩綍 &ndash;&gt;-->
+<!--                    <outputDirectory>target/classes</outputDirectory>-->
+<!--                    <force>true</force>-->
+<!--                    &lt;!&ndash;鍘嬬缉js鍜宑ss鏂囦欢 &ndash;&gt;-->
+<!--                    <includes>-->
+<!--                        <include>**/*.js</include>-->
+<!--                        <include>**/*.css</include>-->
+<!--                    </includes>-->
+<!--                    &lt;!&ndash; 浠ヤ笅鐩綍鍜屾枃浠朵笉浼氳鍘嬬缉 &ndash;&gt;-->
+<!--                    <excludes>-->
+<!--                        <exclude>**/*.min.js</exclude>-->
+<!--                        <exclude>**/*.min.css</exclude>-->
+<!--                        <exclude>**/d7/**</exclude>-->
+<!--                        <exclude>**/dorado-home/**</exclude>-->
+<!--                        <exclude>**/bdf2/**</exclude>-->
+<!--                        <exclude>**/css/**</exclude>-->
+<!--                        <exclude>**/js/**</exclude>-->
+<!--                        <exclude>**/plugins/**</exclude>-->
+<!--                    </excludes>-->
+<!--                </configuration>-->
+<!--            </plugin>-->
 
         </plugins>
 
diff --git a/igds-web/src/main/resources/application-pro5327.yml b/igds-web/src/main/resources/application-pro5327.yml
index 6ef340f..3a22b99 100644
--- a/igds-web/src/main/resources/application-pro5327.yml
+++ b/igds-web/src/main/resources/application-pro5327.yml
@@ -51,7 +51,7 @@
     database: 2
     host: 127.0.0.1
     port: 6379
-    password:
+    password: Abc123..
     # 杩炴帴姹犳渶澶ц繛鎺ユ暟锛堜娇鐢ㄨ礋鍊艰〃绀烘病鏈夐檺鍒讹級
     pool:
       max-active: 200
diff --git a/igds-web/src/main/resources/application.yml b/igds-web/src/main/resources/application.yml
index af38ae1..3cfe1d9 100644
--- a/igds-web/src/main/resources/application.yml
+++ b/igds-web/src/main/resources/application.yml
@@ -1,7 +1,7 @@
 ##########################  Server   ########################## 涓规1鍩庡叧鐪佺伯椋熷偍澶囧簱
 spring:
   profiles:
-    active: linux
+    active: dev
   application:
     name: igds
   main:
diff --git a/pom.xml b/pom.xml
index 49543a2..d5ab05f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -39,6 +39,8 @@
         <module>igds-protocol-fzzy3</module>
         <!--閭︽捣鏅鸿兘-->
         <module>igds-protocol-bhzn</module>
+        <!--璐濆崥绮儏鍗忚-->
+        <module>igds-protocol-beibo</module>
         <!--鐗╄仈缃戞嫇灞曡澶囧寘-->
         <module>igds-protocol-iot</module>
 

--
Gitblit v1.9.3