1.开放了rfid检查时间配置参数

2.在wms发送盘点命令后,执行check方法
3.完成如果rfid获取到wms传输的trayCode数据的话,设置盘点为盘点成功
nanjing-yancao-rfid
LAPTOP-S9HJSOEB\昊天 3 years ago
parent 8878705305
commit f88f2d128a

@ -36,11 +36,19 @@ public class ConfigProperties {
private LightSource lightSource; private LightSource lightSource;
private ScanCodeMode scanCodeMode; private ScanCodeMode scanCodeMode;
private Rfid rfid;
@Data
public static class Rfid {
private Long scanTime = 5L;
}
@Data @Data
public static class CameraConfig{ public static class CameraConfig{
private Integer cameraType; private Integer cameraType;
private String cameraPassword; private String cameraPassword;

@ -14,13 +14,18 @@ import com.zhehekeji.web.service.hikLightSource.HikControlSocket;
import com.zhehekeji.web.service.ksec.KsecNettyClient; import com.zhehekeji.web.service.ksec.KsecNettyClient;
import com.zhehekeji.web.service.sick.SickSocket; import com.zhehekeji.web.service.sick.SickSocket;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.SetUtils;
import org.apache.poi.util.ArrayUtil;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.File;
import java.io.FileWriter;
import java.time.Duration; import java.time.Duration;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -621,6 +626,22 @@ public class PlcService {
//RFID //RFID
RFID rfid = rfidService.getRFIDByPlc(street.getId()); RFID rfid = rfidService.getRFIDByPlc(street.getId());
try{
RFIDCheck(plcCmdInfo);
Thread.sleep(1000*configProperties.getRfid().getScanTime());
Set<String> tags = RFIDStop(plcCmdInfo);
if(tags!= null && tags.size()>0 && tags.contains(wmsTrayCode)){
trayCode = "";
trayCheck = Boolean.TRUE;
}else {
trayCode = "未识别";
trayCheck = Boolean.FALSE;
log.warn("sick ocr error:{}",trayCode);
}
}catch (Exception e){
e.printStackTrace();
}
} }

@ -201,11 +201,14 @@ public class KsecDecoder extends DelimiterBasedFrameDecoder {
// ctx.channel().writeAndFlush(ksecInfo); // ctx.channel().writeAndFlush(ksecInfo);
//rfid的逻辑 //rfid的逻辑
String code = dataInfo.getCmdName(); String code = dataInfo.getCmdName();
plcService.check(plcCmdInfo,ksecInfo.getType(),dataInfo.getCode(),dataInfo.getTrayCode());
/*
if("E1".equals(code)){ if("E1".equals(code)){
plcService.RFIDCheck(plcCmdInfo); plcService.RFIDCheck(plcCmdInfo);
}else { }else {
plcService.RFIDStop(plcCmdInfo); plcService.RFIDStop(plcCmdInfo);
} }*/
} }
//找到该货位的最后一张照片与现在的照片比照 //找到该货位的最后一张照片与现在的照片比照

@ -86,4 +86,10 @@ scanCodeMode:
trayCodeTypes: trayCodeTypes:
- 14 - 14
# 照片 視頻保存多久 # 照片 視頻保存多久
deleteFileDays: 365 deleteFileDays: 365
#rfid
rfid:
#rfid连续扫描时间默认5s 单位s
scanTime: 1

@ -86,4 +86,10 @@ scanCodeMode:
trayCodeTypes: trayCodeTypes:
- 14 - 14
# 照片 視頻保存多久 # 照片 視頻保存多久
deleteFileDays: 365 deleteFileDays: 365
#rfid
rfid:
#rfid连续扫描时间默认5s 单位s
scanTime: 1

@ -7,7 +7,7 @@ spring:
maxWait: 60000 maxWait: 60000
minEvictableIdleTimeMillis: 300000 minEvictableIdleTimeMillis: 300000
minIdle: 15 minIdle: 15
password: Leaper@123 password: root
poolPreparedStatements: true poolPreparedStatements: true
testOnBorrow: true testOnBorrow: true
testOnReturn: false testOnReturn: false
@ -64,11 +64,16 @@ lightSource:
# -----goods 货物 # -----goods 货物
# 扫码模式 0:此处不盘点 1球机扫码 2sick扫码枪 3:南北达RFID # 扫码模式 0:此处不盘点 1球机扫码 2sick扫码枪 3:南北达RFID
scanCodeMode: scanCodeMode:
tray: 0 tray: 3
goods: 1 goods: 1
goodsCodeTypes: goodsCodeTypes:
- 14 - 14
trayCodeTypes: trayCodeTypes:
- 14 - 14
# 照片 視頻保存多久 # 照片 視頻保存多久
deleteFileDays: 365 deleteFileDays: 365
#rfid
rfid:
#rfid连续扫描时间默认5s 单位s
scanTime: 1

@ -31,4 +31,6 @@ zhehe:
enable: true enable: true
postToken: w89euijon2&UHBTY$%huni34ri postToken: w89euijon2&UHBTY$%huni34ri
logging: logging:
config: classpath:logback-spring.xml config: classpath:logback-spring.xml
level:
com.com.zhehekeji.web.mapper: debug
Loading…
Cancel
Save