1.返回结果,如果不为失败则按照成功来

2.tcpinfo增加日志
just-camera
LAPTOP-S9HJSOEB\昊天 2 years ago
parent a3c02cce59
commit 5a7ae811b4

@ -11,6 +11,7 @@ public class StockCheckSearch {
@NotEmpty(message = "巷道标识符不能为空")
@ApiModelProperty("巷道标识符")
private String SRMNumber;
@NotNull(message = "行不能为空")

@ -338,7 +338,6 @@ public class StockService {
if(stock.getCheckPic()!=null){
stock.setCheckPics(stock.getCheckPic().split(";"));
}
return stock;
}

@ -61,7 +61,7 @@ public class TransmissionPojo {
this.count = Integer.valueOf(dataArray[6]);
}
if (dataArray.length > 7) {
this.result = Integer.valueOf(dataArray[7]);
this.result = Integer.parseInt(dataArray[7])==0 ?0:1;
this.picsPath = dataArray[8].split(";");
}

@ -9,15 +9,20 @@ import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.net.InetSocketAddress;
@Slf4j
@Component
public class KsecNettyClient {
static final Logger tcpLogger = LoggerFactory.getLogger("tcp");
private static EventLoopGroup group = new NioEventLoopGroup();
@Resource
private PlcService plcService;
@ -101,6 +106,9 @@ public class KsecNettyClient {
public static void write(KsecInfo ksecInfo){
if(channel != null){
channel.writeAndFlush(ksecInfo);
InetSocketAddress socketAddress = (InetSocketAddress) channel.remoteAddress();
String clientIp = socketAddress.getAddress().getHostAddress();
tcpLogger.info("write kesc data:{} channel:{}",ksecInfo,clientIp);
}else {
log.error(" no connected upPc");
}

Loading…
Cancel
Save