1.增加视觉服务端端口(使用南京烟草视觉服务)
parent
9f0435dbc7
commit
f4db45a846
@ -0,0 +1,32 @@
|
|||||||
|
package com.zhehekeji.web.service.client;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
/**
|
||||||
|
* 与客户端建立连接的传输体
|
||||||
|
*/
|
||||||
|
public class CETransmission {
|
||||||
|
|
||||||
|
private static String HEADER = "CE";
|
||||||
|
private static String Split = "&";
|
||||||
|
|
||||||
|
private String SRMNumber;
|
||||||
|
|
||||||
|
public String toString(){
|
||||||
|
return HEADER + Split + SRMNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getHEADER(){
|
||||||
|
return HEADER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CETransmission(String body){
|
||||||
|
String [] strings = body.split(Split);
|
||||||
|
if(strings != null && strings.length == 2 && HEADER.equals(strings[0])){
|
||||||
|
SRMNumber = strings[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,111 @@
|
|||||||
|
package com.zhehekeji.web.service.client;
|
||||||
|
|
||||||
|
|
||||||
|
import io.netty.channel.Channel;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所有的客户端的chanel
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class ClientChanel {
|
||||||
|
|
||||||
|
|
||||||
|
static final Logger tcpLogger = LoggerFactory.getLogger("tcp");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* key : 巷道标识符
|
||||||
|
*/
|
||||||
|
static Map<String, Channel> channelMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* key : 巷道标识符
|
||||||
|
*/
|
||||||
|
static Map<String, LocalDateTime> channelStringTime = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* key :IP
|
||||||
|
* value: 巷道标识符
|
||||||
|
*/
|
||||||
|
static Map<String,String> IP_SRMNumberMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* key :巷道标识符
|
||||||
|
* value: IP
|
||||||
|
*/
|
||||||
|
static Map<String,String> SRMNumber_IPMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
public static void putIp(String ip,String ID){
|
||||||
|
IP_SRMNumberMap.put(ip,ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void putSRMNUmber_Ip(String ID,String ip){
|
||||||
|
SRMNumber_IPMap.put(ID,ip);
|
||||||
|
IP_SRMNumberMap.put(ip,ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getIpFromId(String ID){
|
||||||
|
return SRMNumber_IPMap.get(ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void deleteIp(String ip){
|
||||||
|
IP_SRMNumberMap.remove(ip);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getIDFromIp(String ip){
|
||||||
|
return IP_SRMNumberMap.get(ip);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void connect(String SRMNumber, Channel channel){
|
||||||
|
channelMap.put(SRMNumber,channel);
|
||||||
|
InetSocketAddress socketAddress = (InetSocketAddress) channel.remoteAddress();
|
||||||
|
String clientIp = socketAddress.getAddress().getHostAddress();
|
||||||
|
putSRMNUmber_Ip(SRMNumber, clientIp);
|
||||||
|
channelStringTime.put(SRMNumber,LocalDateTime.now());
|
||||||
|
log.info("connect:{}巷道 ", SRMNumber);
|
||||||
|
}
|
||||||
|
// static {
|
||||||
|
// Timer timer = new Timer();
|
||||||
|
// timer.scheduleAtFixedRate(new TimerTask() {
|
||||||
|
// @Override
|
||||||
|
// public void run() {
|
||||||
|
// for (String key :channelStringTime.keySet()){
|
||||||
|
// if(LocalDateTime.now().equals(channelStringTime.get(key).plusMinutes(5))) {
|
||||||
|
// channelStringTime.remove(key);
|
||||||
|
// disConnect(key);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// },0,60000);
|
||||||
|
// }
|
||||||
|
public static void disConnect(String key){
|
||||||
|
channelMap.remove(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Set<String> keys(){
|
||||||
|
return channelMap.keySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Channel get(String key){
|
||||||
|
return channelMap.get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void write(String data,String key){
|
||||||
|
if(channelMap.get(key) != null){
|
||||||
|
channelMap.get(key).writeAndFlush(data);
|
||||||
|
}else {
|
||||||
|
tcpLogger.info("no connect client:{}",key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
package com.zhehekeji.web.service.client;
|
||||||
|
|
||||||
|
import java.util.Hashtable;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class ClientCodeMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线程安全的map
|
||||||
|
*/
|
||||||
|
protected static Map<String,String> codeMap = new Hashtable<>();
|
||||||
|
|
||||||
|
public static void putCode(String SRMNumber,String code){
|
||||||
|
codeMap.put(SRMNumber,code);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getCode(String SRMNumber){
|
||||||
|
return codeMap.get(SRMNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void removeCode(String SRMNumber){
|
||||||
|
codeMap.remove(SRMNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,145 @@
|
|||||||
|
package com.zhehekeji.web.service.client;
|
||||||
|
|
||||||
|
import com.zhehekeji.web.entity.Stock;
|
||||||
|
import com.zhehekeji.web.service.PlcService;
|
||||||
|
import com.zhehekeji.web.service.ksec.*;
|
||||||
|
import io.netty.buffer.ByteBuf;
|
||||||
|
import io.netty.buffer.Unpooled;
|
||||||
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
|
import io.netty.handler.codec.DelimiterBasedFrameDecoder;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.ArrayBlockingQueue;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import static com.zhehekeji.web.service.ksec.KsecDecoder.ksecInfoMap;
|
||||||
|
import static org.aspectj.weaver.tools.cache.SimpleCacheFactory.path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户端解码器 连接用
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class Decoder extends DelimiterBasedFrameDecoder {
|
||||||
|
|
||||||
|
private static final Logger tcpLogger = LoggerFactory.getLogger("tcp");
|
||||||
|
|
||||||
|
public static String PT_CLIENT = "PT";
|
||||||
|
private static String WCS_CLIENT = "WCS";
|
||||||
|
private static String EMPTY_CLIENT = "EMPTY";
|
||||||
|
private static String END_STRING = "$";
|
||||||
|
|
||||||
|
private static ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(5,15,30, TimeUnit.MILLISECONDS,new ArrayBlockingQueue<>(20000));
|
||||||
|
|
||||||
|
private PlcService plcService;
|
||||||
|
|
||||||
|
public Decoder(PlcService plcService) {
|
||||||
|
|
||||||
|
super(20000,true,false, Unpooled.copiedBuffer(">".getBytes()),
|
||||||
|
Unpooled.copiedBuffer("$".getBytes()));
|
||||||
|
this.plcService = plcService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
|
||||||
|
|
||||||
|
in = (ByteBuf) super.decode(ctx, in);
|
||||||
|
if(in == null){
|
||||||
|
log.debug("no data");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
ClientRunnable clientRunnable = new ClientRunnable(in,ctx,plcService);
|
||||||
|
threadPoolExecutor.execute(clientRunnable);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ClientRunnable implements Runnable {
|
||||||
|
|
||||||
|
private ByteBuf in;
|
||||||
|
|
||||||
|
private ChannelHandlerContext ctx;
|
||||||
|
|
||||||
|
private PlcService plcService;
|
||||||
|
|
||||||
|
|
||||||
|
public ClientRunnable(ByteBuf in,ChannelHandlerContext ctx,PlcService plcService){
|
||||||
|
this.ctx = ctx;
|
||||||
|
this.in = in;
|
||||||
|
this.plcService = plcService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
String body = in.toString(Charset.forName("UTF-8"));
|
||||||
|
tcpLogger.info("receive client:{}, data length:{}",body, body.length());
|
||||||
|
//视觉服务
|
||||||
|
{
|
||||||
|
if(body.startsWith(HBTransmission.getHEADER())) {
|
||||||
|
//心跳
|
||||||
|
HBTransmission hbTransmission = new HBTransmission(body);
|
||||||
|
//回复客户端心跳
|
||||||
|
ctx.channel().writeAndFlush(hbTransmission.toString());
|
||||||
|
ClientChanel.connect(hbTransmission.getSRMNumber(), ctx.channel());
|
||||||
|
//tcpLogger.info("client:{} heart", hbTransmission.getSRMNumber());
|
||||||
|
in.release();
|
||||||
|
} else if(body.startsWith(SCTransmission.getHeader())){
|
||||||
|
//盘点指令
|
||||||
|
SCTransmission scTransmission = new SCTransmission(body);
|
||||||
|
if(scTransmission.isCollectOver()){
|
||||||
|
//给普天发送数据采集完毕指令
|
||||||
|
KsecDataInfo ksecDataInfo = ksecInfoMap.get(scTransmission.getTaskNo());
|
||||||
|
ksecDataInfo.setCmdName("E2");
|
||||||
|
KsecInfo ksecInfo = new KsecInfo("KC","E",ksecDataInfo);
|
||||||
|
KsecNettyClient.write(ksecInfo);
|
||||||
|
}else {
|
||||||
|
plcService.visualInventory(scTransmission);
|
||||||
|
|
||||||
|
KsecDataInfo ksecDataInfo = ksecInfoMap.get(scTransmission.getTaskNo());
|
||||||
|
ksecDataInfo.setCmdName("E3");
|
||||||
|
ksecDataInfo.setQuantity(scTransmission.getRstCount());
|
||||||
|
ksecDataInfo.setTypeNum(scTransmission.getRstCategory());
|
||||||
|
ksecDataInfo.setCheckRlt(Integer.parseInt(scTransmission.getCheckRst()));
|
||||||
|
KsecInfo ksecInfo = new KsecInfo("KC","E",ksecDataInfo);
|
||||||
|
KsecNettyClient.write(ksecInfo);
|
||||||
|
ksecInfoMap.remove(scTransmission.getTaskNo());
|
||||||
|
//添加到实时信息里
|
||||||
|
//RealtimeCheckMap.put(scTransmission.getSRMNumber(),scTransmission.checkInfo());
|
||||||
|
//更新盤點統計
|
||||||
|
// emptyCheckService.updateCheckLastTime(tmTransmission.getTaskNo(),tmTransmission.getSRMNumber(),stock.getCode());
|
||||||
|
}
|
||||||
|
in.release();
|
||||||
|
}else if(body.startsWith(CETransmission.getHEADER())){
|
||||||
|
//客户端建立连接
|
||||||
|
CETransmission ceTransmission = new CETransmission(body);
|
||||||
|
//回复客户端,建立连接完成
|
||||||
|
|
||||||
|
ctx.channel().writeAndFlush(ceTransmission.toString());
|
||||||
|
ClientChanel.connect(ceTransmission.getSRMNumber(), ctx.channel());
|
||||||
|
tcpLogger.info("client:{} connect", ceTransmission.getSRMNumber());
|
||||||
|
in.release();
|
||||||
|
}
|
||||||
|
else if(body.startsWith("DC")){
|
||||||
|
//客户端断开连接
|
||||||
|
String [] strings = body.split("&");
|
||||||
|
if(strings != null && strings.length == 2){
|
||||||
|
tcpLogger.info("client:{} disConnect", strings[1]);
|
||||||
|
ClientChanel.disConnect(strings[1]);
|
||||||
|
}
|
||||||
|
in.release();
|
||||||
|
}
|
||||||
|
|
||||||
|
// else if (body.contains("EMPTY_CLIENT")){
|
||||||
|
// ClientChanel.connect(EMPTY_CLIENT_NAME, ctx.channel());
|
||||||
|
// tcpLogger.info("client:{} connect", EMPTY_CLIENT_NAME);
|
||||||
|
// in.release();
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
package com.zhehekeji.web.service.client;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 空货位扫描到的全部条码
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EmptyCheckCodeInfo {
|
||||||
|
|
||||||
|
private static Map<String, Set<String>> allCode = new HashMap<>();
|
||||||
|
|
||||||
|
public static void start(String SRMNumber, String taskNo){
|
||||||
|
String key = String.format("{}-{}",SRMNumber, taskNo);
|
||||||
|
allCode.remove(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCode(String SRMNumber,Integer row,Integer startColumn,Integer endColumn,String code){
|
||||||
|
String key = String.format("{}-{}-{}-{}",SRMNumber,row,startColumn,endColumn);
|
||||||
|
Set<String> codes = allCode.get(key);
|
||||||
|
if(codes == null){
|
||||||
|
codes = new HashSet<>();
|
||||||
|
}
|
||||||
|
codes.add(code);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Set<String> getAllCode(String SRMNumber, String taskNo){
|
||||||
|
String key = String.format("{}-{}",SRMNumber, taskNo);
|
||||||
|
return allCode.get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void stop(String SRMNumber,Integer row,Integer startColumn,Integer endColumn){
|
||||||
|
String key = String.format("{}-{}-{}-{}",SRMNumber,row,startColumn,endColumn);
|
||||||
|
allCode.remove(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package com.zhehekeji.web.service.client;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
/**
|
||||||
|
* 与客户端的心跳
|
||||||
|
*/
|
||||||
|
public class HBTransmission {
|
||||||
|
|
||||||
|
private static String HEADER = "HB";
|
||||||
|
private static String Split = "&";
|
||||||
|
|
||||||
|
private String SRMNumber;
|
||||||
|
|
||||||
|
public String toString(){
|
||||||
|
return HEADER + Split + SRMNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getHEADER(){
|
||||||
|
return HEADER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HBTransmission(String body){
|
||||||
|
String [] strings = body.split(Split);
|
||||||
|
if(strings != null && strings.length == 2 && HEADER.equals(strings[0])){
|
||||||
|
SRMNumber = strings[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
HBTransmission ceTransmission= new HBTransmission("HB&1");
|
||||||
|
System.out.println(ceTransmission);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
package com.zhehekeji.web.service.client;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ISTransmission {
|
||||||
|
|
||||||
|
private static String HEADER = "IS";
|
||||||
|
|
||||||
|
private static String Split = ",";
|
||||||
|
|
||||||
|
private String SRMNumber;
|
||||||
|
|
||||||
|
private String taskId;
|
||||||
|
|
||||||
|
private String goodsLocation;
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
public String toString(){
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
sb.append(HEADER).append(Split).append(SRMNumber).append(Split).append(taskId).append(Split).append(goodsLocation);
|
||||||
|
if(code != null){
|
||||||
|
sb.append(Split).append(code);
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ISTransmission(String SRMNumber,String taskId,String goodsLocation){
|
||||||
|
this.SRMNumber = SRMNumber;
|
||||||
|
this.goodsLocation = goodsLocation;
|
||||||
|
this.taskId = taskId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ISTransmission(String msg){
|
||||||
|
String [] strings = msg.split(Split);
|
||||||
|
HEADER = strings[0];
|
||||||
|
SRMNumber = strings[1];
|
||||||
|
goodsLocation = strings[2];
|
||||||
|
if(strings.length == 4){
|
||||||
|
code = strings[3];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.zhehekeji.web.service.client;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普天的消息 转给盘点客户端
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class MessageConverter {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
package com.zhehekeji.web.service.client;
|
||||||
|
|
||||||
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
|
import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户端的上下线
|
||||||
|
*
|
||||||
|
* @author Administrator
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class NettyConnectHandler extends ChannelInboundHandlerAdapter {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 建立连接时
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
||||||
|
InetSocketAddress socketAddress = (InetSocketAddress) ctx.channel().remoteAddress();
|
||||||
|
String clientIp = socketAddress.getAddress().getHostAddress();
|
||||||
|
int clientPort = socketAddress.getPort();
|
||||||
|
log.info("ip:{} port:{} connected",clientIp, clientPort);
|
||||||
|
ctx.fireChannelActive();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭连接时
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||||
|
InetSocketAddress socketAddress = (InetSocketAddress) ctx.channel().remoteAddress();
|
||||||
|
String clientIp = socketAddress.getAddress().getHostAddress();
|
||||||
|
int clientPort = socketAddress.getPort();
|
||||||
|
log.info("ip:{} port:{} disconnected",clientIp, clientPort);
|
||||||
|
String ID = ClientChanel.getIDFromIp(clientIp);
|
||||||
|
//设置客户端下线
|
||||||
|
ClientChanel.disConnect(ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,87 @@
|
|||||||
|
package com.zhehekeji.web.service.client;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class RealtimeCheckMap {
|
||||||
|
|
||||||
|
private static Map<String,CheckInfo> map = new HashMap<>();
|
||||||
|
|
||||||
|
public static void put(String SRMNumber,CheckInfo checkInfo){
|
||||||
|
checkInfo.setTime(LocalDateTime.now());
|
||||||
|
String ip ="http://"+ClientChanel.getIpFromId(SRMNumber)+":9009/pic/"+checkInfo.getCheckCode()+"/"+checkInfo.getTaskNo()+"/";
|
||||||
|
checkInfo.setIP(ip);
|
||||||
|
checkInfo.setSidePic1(String.format("%s1.png",ip));
|
||||||
|
checkInfo.setSidePic2(String.format("%s2.png",ip));
|
||||||
|
checkInfo.setSidePic3(String.format("%s3.png",ip));
|
||||||
|
checkInfo.setSidePic4(String.format("%s4.png",ip));
|
||||||
|
checkInfo.setTopPic1(String.format("%s5.png",ip));
|
||||||
|
checkInfo.setTopPic2(String.format("%s6.png",ip));
|
||||||
|
map.put(SRMNumber,checkInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CheckInfo getRealtimeCheck(String SRMNumber){
|
||||||
|
return map.get(SRMNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class CheckInfo{
|
||||||
|
|
||||||
|
private Integer row;
|
||||||
|
|
||||||
|
private Integer column;
|
||||||
|
|
||||||
|
private Integer side;
|
||||||
|
|
||||||
|
private Integer direction;
|
||||||
|
|
||||||
|
private String WMSCode;
|
||||||
|
|
||||||
|
private String WMSCategory;
|
||||||
|
|
||||||
|
private Integer WMSCount;
|
||||||
|
|
||||||
|
private String checkCode;
|
||||||
|
|
||||||
|
private String checkCategory;
|
||||||
|
|
||||||
|
private Integer checkCount;
|
||||||
|
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
private String topPic1;
|
||||||
|
|
||||||
|
private String topPic2;
|
||||||
|
|
||||||
|
private String sidePic1;
|
||||||
|
|
||||||
|
private String sidePic2;
|
||||||
|
|
||||||
|
private String sidePic3;
|
||||||
|
|
||||||
|
private String sidePic4;
|
||||||
|
|
||||||
|
private String IP;
|
||||||
|
|
||||||
|
private String taskNo;
|
||||||
|
|
||||||
|
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime time;
|
||||||
|
|
||||||
|
public Integer getStatus(){
|
||||||
|
if(WMSCode.equals(checkCount) && checkCount.equals(WMSCount)){
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue