|
|
|
|
@ -24,6 +24,7 @@ import com.zhehekeji.web.ws.WebSocketServer;
|
|
|
|
|
import io.swagger.models.auth.In;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.collections4.SetUtils;
|
|
|
|
|
import org.apache.commons.lang3.ArrayUtils;
|
|
|
|
|
import org.apache.poi.util.ArrayUtil;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@ -40,6 +41,7 @@ import java.util.concurrent.ArrayBlockingQueue;
|
|
|
|
|
import java.util.concurrent.BlockingDeque;
|
|
|
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description plc信号指令处理类
|
|
|
|
|
@ -307,9 +309,9 @@ public class PlcService {
|
|
|
|
|
gyrateCameraByCodeTimeLater(street.getCamera1Id(), "C5", configProperties.getCameraConfig().getC2OutDelayCaptureTime() + 500);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
threadPoolExecutor.execute(()->{
|
|
|
|
|
rfidLiveService.rfidOrderStock(plcCmdInfo, times, code);
|
|
|
|
|
});
|
|
|
|
|
// threadPoolExecutor.execute(()->{
|
|
|
|
|
// rfidLiveService.rfidOrderStock(plcCmdInfo, times, code);
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Integer getCameraByPlcCmdAction(PlcCmdInfo plcCmdInfo, String code) {
|
|
|
|
|
@ -643,7 +645,12 @@ public class PlcService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String path = PathUtil.createFileNameByRowColumn("jpg", cameraId, plcCmdInfo.getRow1(), plcCmdInfo.getColumn1());
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
cameraCapture(cameraId, false, null, path);
|
|
|
|
|
}catch (NullPointerException e){
|
|
|
|
|
log.error("相机{}未连接无法拍照",cameraId);
|
|
|
|
|
}
|
|
|
|
|
//托盘码
|
|
|
|
|
String trayCode = null;
|
|
|
|
|
Boolean trayCheck = Boolean.TRUE;
|
|
|
|
|
@ -696,33 +703,42 @@ public class PlcService {
|
|
|
|
|
tags = RFIDStop(plcCmdInfo);
|
|
|
|
|
log.info("盘点rfid扫描结果:"+tags);
|
|
|
|
|
}
|
|
|
|
|
if (tags != null && tags.size() > 0 && tags.contains(wmsTrayCode)) {
|
|
|
|
|
// if (tags != null && tags.size() > 0 && tags.contains(wmsTrayCode)) {
|
|
|
|
|
//
|
|
|
|
|
// trayCode = wmsTrayCode;
|
|
|
|
|
// trayCheck = Boolean.TRUE;
|
|
|
|
|
// if(! rfidLiveService.getRfidLive(plcCmdInfo,street,wmsTrayCode)){
|
|
|
|
|
//
|
|
|
|
|
// RFID rfid = rfidMapper.selectOne(new QueryWrapper<RFID>().eq("street_id", street.getId()));
|
|
|
|
|
// rfidLiveService.rfidRemoveLive(plcCmdInfo,street,rfid);
|
|
|
|
|
// rfidLiveService.rfidSave(plcCmdInfo,trayCode,street,rfid);
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// log.warn("sick ocr error:{}", "");
|
|
|
|
|
// //查看数据库里数据
|
|
|
|
|
// RfidLive rfidLive = rfidLiveService.getOne(new QueryWrapper<RfidLive>()
|
|
|
|
|
// .eq("street_Id", street.getId())
|
|
|
|
|
// .eq("direction", plcCmdInfo.getFromDirection())
|
|
|
|
|
// .eq("side", plcCmdInfo.getFromSeparation())
|
|
|
|
|
// .eq("rfid_row", plcCmdInfo.getRow1())
|
|
|
|
|
// .eq("rfid_column", plcCmdInfo.getColumn1()));
|
|
|
|
|
// if (ToolUtil.isNotEmpty(rfidLive) && ToolUtil.isNotEmpty(rfidLive.getRfidTrayCode()) && rfidLive.getRfidTrayCode().contains(wmsTrayCode)) {
|
|
|
|
|
// trayCode = wmsTrayCode;
|
|
|
|
|
// trayCheck = Boolean.TRUE;
|
|
|
|
|
// log.info("数据库查询rfid", trayCode);
|
|
|
|
|
// } else {
|
|
|
|
|
// trayCode = "";
|
|
|
|
|
// trayCheck = Boolean.FALSE;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
if (tags != null && tags.size() > 0 ) {
|
|
|
|
|
|
|
|
|
|
trayCode = wmsTrayCode;
|
|
|
|
|
trayCheck = Boolean.TRUE;
|
|
|
|
|
if(! rfidLiveService.getRfidLive(plcCmdInfo,street,wmsTrayCode)){
|
|
|
|
|
|
|
|
|
|
RFID rfid = rfidMapper.selectOne(new QueryWrapper<RFID>().eq("street_id", street.getId()));
|
|
|
|
|
if(! rfidLiveService.getRfidLive(plcCmdInfo,street,wmsTrayCode)){
|
|
|
|
|
rfidLiveService.rfidRemoveLive(plcCmdInfo,street,rfid);
|
|
|
|
|
rfidLiveService.rfidSave(plcCmdInfo,trayCode,street,rfid);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
log.warn("sick ocr error:{}", "");
|
|
|
|
|
//查看数据库里数据
|
|
|
|
|
RfidLive rfidLive = rfidLiveService.getOne(new QueryWrapper<RfidLive>()
|
|
|
|
|
.eq("street_Id", street.getId())
|
|
|
|
|
.eq("direction", plcCmdInfo.getFromDirection())
|
|
|
|
|
.eq("side", plcCmdInfo.getFromSeparation())
|
|
|
|
|
.eq("rfid_row", plcCmdInfo.getRow1())
|
|
|
|
|
.eq("rfid_column", plcCmdInfo.getColumn1()));
|
|
|
|
|
if (ToolUtil.isNotEmpty(rfidLive) && ToolUtil.isNotEmpty(rfidLive.getRfidTrayCode()) && rfidLive.getRfidTrayCode().contains(wmsTrayCode)) {
|
|
|
|
|
trayCode = wmsTrayCode;
|
|
|
|
|
trayCheck = Boolean.TRUE;
|
|
|
|
|
log.info("数据库查询rfid", trayCode);
|
|
|
|
|
} else {
|
|
|
|
|
trayCode = "";
|
|
|
|
|
trayCheck = Boolean.FALSE;
|
|
|
|
|
}
|
|
|
|
|
rfidLiveService.rfidSave(plcCmdInfo, String.join(",", tags),street,rfid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|