|
|
|
|
@ -169,23 +169,25 @@ public class KsecDecoder extends DelimiterBasedFrameDecoder {
|
|
|
|
|
}
|
|
|
|
|
} else if (Cmd.E.name().equals(ksecInfo.getType())) {
|
|
|
|
|
|
|
|
|
|
//盘点
|
|
|
|
|
//转球机到盘点位 然后拍照
|
|
|
|
|
tcpLogger.info(body);
|
|
|
|
|
if(!StringUtils.isEmpty(lotnum) && !lotnum.equals(lastLotnum)){
|
|
|
|
|
//需要把stock表truncate
|
|
|
|
|
FileUtil.save(lotnum,"lastLotnum");
|
|
|
|
|
tcpLogger.info("truncate table ,last lotnum:{},new lotnum:{}",lastLotnum,lotnum);
|
|
|
|
|
plcService.truncateStock();
|
|
|
|
|
lastLotnum = lotnum;
|
|
|
|
|
}
|
|
|
|
|
log.info("orderInfo:{}", plcCmdInfo.toString());
|
|
|
|
|
plcCmdInfo.setTimes(1);
|
|
|
|
|
Boolean ok = plcService.check(plcCmdInfo,ksecInfo.getData().getCmdName(), dataInfo.getCode(), dataInfo.getTrayCode());
|
|
|
|
|
if(ok){
|
|
|
|
|
ksecInfo.getData().setAckStatus(1);
|
|
|
|
|
}else {
|
|
|
|
|
ksecInfo.getData().setAckStatus(0);
|
|
|
|
|
if(!(ksecInfo.getData().getFromColumn()== 0 && ksecInfo.getData().getFromRow() == 0)) {
|
|
|
|
|
//盘点
|
|
|
|
|
//转球机到盘点位 然后拍照
|
|
|
|
|
tcpLogger.info(body);
|
|
|
|
|
if (!StringUtils.isEmpty(lotnum) && !lotnum.equals(lastLotnum)) {
|
|
|
|
|
//需要把stock表truncate
|
|
|
|
|
FileUtil.save(lotnum, "lastLotnum");
|
|
|
|
|
tcpLogger.info("truncate table ,last lotnum:{},new lotnum:{}", lastLotnum, lotnum);
|
|
|
|
|
plcService.truncateStock();
|
|
|
|
|
lastLotnum = lotnum;
|
|
|
|
|
}
|
|
|
|
|
log.info("orderInfo:{}", plcCmdInfo.toString());
|
|
|
|
|
plcCmdInfo.setTimes(1);
|
|
|
|
|
Boolean ok = plcService.check(plcCmdInfo, ksecInfo.getData().getCmdName(), dataInfo.getCode(), dataInfo.getTrayCode());
|
|
|
|
|
if (ok) {
|
|
|
|
|
ksecInfo.getData().setAckStatus(1);
|
|
|
|
|
} else {
|
|
|
|
|
ksecInfo.getData().setAckStatus(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ctx.channel().writeAndFlush(ksecInfo);
|
|
|
|
|
}
|
|
|
|
|
|