台湾盘点测试

taiwan-lingli-new taiwan-tingli
yiming 4 years ago
parent f21442807b
commit 753f56a345

@ -31,7 +31,7 @@ public class TestService {
row = street.getRightRow();
column = street.getRightColumn();
}
String lotnum = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMDDHHmmss"));
String lotnum = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
for(int i = 1;i<=row;i++){
for(int j = 1; j<= column;j++){
String code = "J83572603";

@ -127,6 +127,7 @@ public class KsecDecoder extends DelimiterBasedFrameDecoder {
ksecInfo.setHeader("TL");
ksecInfo.setData(dataInfo);
ctx.channel().writeAndFlush(ksecInfo);
tcpLogger.info("send info:{}",dataInfo.toString());
}
//找到该货位的最后一张照片与现在的照片比照
//plcService.recordStock(plcCmdInfo, dataInfo.getCode(), 0, 0);

@ -1,6 +1,8 @@
package com.zhehekeji.web.service.sick;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.*;
import java.net.InetSocketAddress;
@ -13,6 +15,8 @@ import java.nio.charset.StandardCharsets;
@Slf4j
public class SickSocket {
private static final Logger tcpLogger = LoggerFactory.getLogger("sick");
public static void main(String[] args) {
String code = readOCR("192.168.8.236", 2002);
System.out.println(code);
@ -29,10 +33,12 @@ public class SickSocket {
writeCmd(os);
is = socket.getInputStream();
code = read(is);
tcpLogger.info(code);
if(code!= null){
code = code.replace("\\n","");
}
} catch (IOException e) {
tcpLogger.error("sick time out,ip:{},info:{}",ip,e);
log.error("sick time out,ip:{},info:{}",ip,e);
}finally {
if(os != null){
@ -63,6 +69,7 @@ public class SickSocket {
String startCmd = "start";
byte[]bytes = startCmd.getBytes(StandardCharsets.UTF_8);
os.write(bytes);
tcpLogger.info(startCmd);
}
private static String read(InputStream inStream) throws IOException {

Loading…
Cancel
Save