|
|
|
@ -2,6 +2,7 @@ package com.zhehekeji.web.service;
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.zhehekeji.common.util.PathUtil;
|
|
|
|
import com.zhehekeji.common.util.PathUtil;
|
|
|
|
|
|
|
|
import com.zhehekeji.core.pojo.Result;
|
|
|
|
import com.zhehekeji.web.config.ConfigProperties;
|
|
|
|
import com.zhehekeji.web.config.ConfigProperties;
|
|
|
|
import com.zhehekeji.web.entity.*;
|
|
|
|
import com.zhehekeji.web.entity.*;
|
|
|
|
import com.zhehekeji.web.lib.*;
|
|
|
|
import com.zhehekeji.web.lib.*;
|
|
|
|
@ -19,13 +20,18 @@ import com.zhehekeji.web.service.client.TransmissionPojo;
|
|
|
|
import com.zhehekeji.web.service.ksec.KsecDataInfo;
|
|
|
|
import com.zhehekeji.web.service.ksec.KsecDataInfo;
|
|
|
|
import com.zhehekeji.web.service.ksec.KsecInfo;
|
|
|
|
import com.zhehekeji.web.service.ksec.KsecInfo;
|
|
|
|
import com.zhehekeji.web.service.lbScanCode.ReentrantLockExample;
|
|
|
|
import com.zhehekeji.web.service.lbScanCode.ReentrantLockExample;
|
|
|
|
|
|
|
|
import com.zhehekeji.web.service.sick.CognexSocket;
|
|
|
|
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.poi.ss.formula.functions.T;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.core.ParameterizedTypeReference;
|
|
|
|
import org.springframework.http.HttpEntity;
|
|
|
|
import org.springframework.http.HttpEntity;
|
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
|
import org.springframework.http.HttpMethod;
|
|
|
|
import org.springframework.http.HttpMethod;
|
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
|
|
|
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
@ -366,7 +372,7 @@ public class PlcService {
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
RestTemplate restTemplate;
|
|
|
|
RestTemplate restTemplate;
|
|
|
|
|
|
|
|
|
|
|
|
String scan(PlcCmdInfo plcCmdInfo,Street street){
|
|
|
|
String scan(PlcCmdInfo plcCmdInfo,Street street,String wmsTrayCode){
|
|
|
|
Boolean trayCheck = Boolean.FALSE;
|
|
|
|
Boolean trayCheck = Boolean.FALSE;
|
|
|
|
String trayCode = "";
|
|
|
|
String trayCode = "";
|
|
|
|
log.info("扫码类型:" + configProperties.getScanCodeMode().getTray());
|
|
|
|
log.info("扫码类型:" + configProperties.getScanCodeMode().getTray());
|
|
|
|
@ -428,6 +434,7 @@ public class PlcService {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
//托盘使用sick扫码枪
|
|
|
|
//托盘使用sick扫码枪
|
|
|
|
SensorGun sensorGun = sensorService.getSensorByPlc(street.getId(), leftRight);
|
|
|
|
SensorGun sensorGun = sensorService.getSensorByPlc(street.getId(), leftRight);
|
|
|
|
if (sensorGun == null) {
|
|
|
|
if (sensorGun == null) {
|
|
|
|
@ -435,37 +442,59 @@ public class PlcService {
|
|
|
|
trayCheck = Boolean.FALSE;
|
|
|
|
trayCheck = Boolean.FALSE;
|
|
|
|
log.error("no sensor gun config in database ,street id:{},direction:{}", street.getId(), plcCmdInfo.getLeftRight1());
|
|
|
|
log.error("no sensor gun config in database ,street id:{},direction:{}", street.getId(), plcCmdInfo.getLeftRight1());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
trayCode = SickSocket.readOCR(sensorGun.getIp(), sensorGun.getPort());
|
|
|
|
if (leftRight > 2) {
|
|
|
|
log.info("sensor tray code:{}", trayCode);
|
|
|
|
|
|
|
|
if ("".equals(plcCmdInfo.getWmsCode())) {
|
|
|
|
trayCode = CognexSocket.readOCR(sensorGun.getIp(), sensorGun.getPort());
|
|
|
|
//托盘码为空,无货物
|
|
|
|
|
|
|
|
//只要扫码枪未识别出条码,即认为盘点正确
|
|
|
|
|
|
|
|
if (StringUtils.isEmpty(trayCode) || trayCode.equals("NoRead")) {
|
|
|
|
|
|
|
|
trayCode = "无货物";
|
|
|
|
|
|
|
|
trayCheck = Boolean.TRUE;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
trayCode = "扫码枪识别异常";
|
|
|
|
|
|
|
|
trayCheck = Boolean.FALSE;
|
|
|
|
|
|
|
|
log.warn("sick ocr error:{}", trayCode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (StringUtils.isEmpty(trayCode) || trayCode.equals("NoRead")) {
|
|
|
|
trayCode = SickSocket.readOCR(sensorGun.getIp(), sensorGun.getPort());
|
|
|
|
trayCode = "扫码枪识别异常";
|
|
|
|
}
|
|
|
|
trayCheck = Boolean.FALSE;
|
|
|
|
|
|
|
|
log.warn("sick ocr error:{}", trayCode);
|
|
|
|
log.info("sensor tray code:{}", trayCode);
|
|
|
|
} else {
|
|
|
|
//如果无货物判断是否
|
|
|
|
//扫到与货码相同
|
|
|
|
for (String code : trayCode.split(";")) {
|
|
|
|
if(trayCode.equals(plcCmdInfo.getWmsCode())){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log.info("sick ocr info:{},wmsCode{}", code,wmsTrayCode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!code.endsWith(org.apache.commons.lang3.StringUtils.leftPad(wmsTrayCode, 6, '0'))) {
|
|
|
|
|
|
|
|
trayCheck = Boolean.FALSE;
|
|
|
|
|
|
|
|
log.info("sick ocr error:{}", trayCode);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
trayCheck = Boolean.TRUE;
|
|
|
|
trayCheck = Boolean.TRUE;
|
|
|
|
|
|
|
|
log.info("sick ocr success:{}", trayCode);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
plcCmdInfo.setTrayCode(trayCode);
|
|
|
|
plcCmdInfo.setTrayCode(trayCode);
|
|
|
|
plcCmdInfo.setTrayCheck(trayCheck);
|
|
|
|
plcCmdInfo.setTrayCheck(trayCheck);
|
|
|
|
|
|
|
|
log.info("tray code:{},sys trayCode:{},plcInfo{}",trayCode,wmsTrayCode,plcCmdInfo.toString());
|
|
|
|
return trayCode;
|
|
|
|
return trayCode;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
|
|
|
Boolean trayCheck = Boolean.FALSE;
|
|
|
|
|
|
|
|
String trayCode = "LJ-02-042851;LJ-02-042831;";
|
|
|
|
|
|
|
|
String wmsTrayCode = "42831";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//如果无货物判断是否
|
|
|
|
|
|
|
|
for (String code : trayCode.split(";")) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log.info("sick ocr info:{},wmsCode{}", code,wmsTrayCode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!code.endsWith(org.apache.commons.lang3.StringUtils.leftPad(wmsTrayCode, 6, '0'))) {
|
|
|
|
|
|
|
|
trayCheck = Boolean.FALSE;
|
|
|
|
|
|
|
|
log.info("sick ocr error:{}", trayCode);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
trayCheck = Boolean.TRUE;
|
|
|
|
|
|
|
|
log.info("sick ocr success:{}", trayCode);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
System.out.println(trayCheck);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public boolean checkVision(KsecDataInfo dataInfo){
|
|
|
|
public boolean checkVision(KsecDataInfo dataInfo){
|
|
|
|
|
|
|
|
|
|
|
|
KuKou kuKou = new KuKou();
|
|
|
|
KuKou kuKou = new KuKou();
|
|
|
|
@ -491,7 +520,6 @@ public class PlcService {
|
|
|
|
kuKouService.save(kuKou);
|
|
|
|
kuKouService.save(kuKou);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public boolean checkVision(KsecDataInfo dataInfo,Boolean flag){
|
|
|
|
public boolean checkVision(KsecDataInfo dataInfo,Boolean flag){
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
@ -501,19 +529,42 @@ public class PlcService {
|
|
|
|
|
|
|
|
|
|
|
|
IndustrialCameraVO scTransmission = new IndustrialCameraVO();
|
|
|
|
IndustrialCameraVO scTransmission = new IndustrialCameraVO();
|
|
|
|
scTransmission.setTypeMacth(dataInfo.getTypeNum());
|
|
|
|
scTransmission.setTypeMacth(dataInfo.getTypeNum());
|
|
|
|
|
|
|
|
scTransmission.setCount(dataInfo.getQuantity());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scTransmission.setCode(dataInfo.getTrayCode());
|
|
|
|
|
|
|
|
|
|
|
|
// 创建 HttpEntity 对象
|
|
|
|
// 创建 HttpEntity 对象
|
|
|
|
HttpEntity<IndustrialCameraVO> entity = new HttpEntity<>(scTransmission, headers);
|
|
|
|
HttpEntity<IndustrialCameraVO> entity = new HttpEntity<>(scTransmission, headers);
|
|
|
|
Map<String, ConfigProperties.Template> map = configProperties.getTemplate().stream().collect(Collectors.toMap(k->k.getCode(), v->v));
|
|
|
|
Map<String, ConfigProperties.Template> map = configProperties.getTemplate().stream().collect(Collectors.toMap(k->k.getCode(), v->v));
|
|
|
|
|
|
|
|
|
|
|
|
// 发送 POST 请求
|
|
|
|
// 发送 POST 请求
|
|
|
|
ResponseEntity<Boolean> response = restTemplate.exchange(
|
|
|
|
ResponseEntity<Result<KuKou>> response = restTemplate.exchange(
|
|
|
|
"http://" + configProperties.getSiteInventoryIp() + ":8099" + "/api/industrialCamera/siteInventory",
|
|
|
|
"http://" + configProperties.getSiteInventoryIp() + ":8099" + "/api/industrialCamera/siteInventory",
|
|
|
|
HttpMethod.POST,
|
|
|
|
HttpMethod.POST,
|
|
|
|
entity,
|
|
|
|
entity,
|
|
|
|
Boolean.class
|
|
|
|
new ParameterizedTypeReference<Result<KuKou>>() {}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
return response.getBody();
|
|
|
|
if (response.getBody()!=null && Objects.requireNonNull(response.getBody()).getData().getFlag()==1){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scTransmission.setWmsTrayCode(dataInfo.getTrayCode());
|
|
|
|
|
|
|
|
scTransmission.setTrayCode(response.getBody().getData().getCode());
|
|
|
|
|
|
|
|
scTransmission.setCount(response.getBody().getData().getCount());
|
|
|
|
|
|
|
|
scTransmission.setTypeMacth(response.getBody().getData().getCategoryName());
|
|
|
|
|
|
|
|
scTransmission.setFlag(response.getBody().getData().getFlag());
|
|
|
|
|
|
|
|
kuKouService.setHttp(scTransmission,flag);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scTransmission.setWmsTrayCode(dataInfo.getTrayCode());
|
|
|
|
|
|
|
|
if (response.getBody()!=null&& response.getBody().getData()!=null&& response.getBody().getData().getCode()!=null){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scTransmission.setTrayCode(response.getBody().getData().getCode());
|
|
|
|
|
|
|
|
}else
|
|
|
|
|
|
|
|
scTransmission.setTrayCode("");
|
|
|
|
|
|
|
|
scTransmission.setCount(0);
|
|
|
|
|
|
|
|
kuKouService.setHttp(scTransmission,flag);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
log.error("3D get pcd error", e);
|
|
|
|
log.error("3D get pcd error", e);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
@ -521,60 +572,76 @@ public class PlcService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Boolean check(PlcCmdInfo plcCmdInfo,String cmdCode,String wmsCode,String wmsTrayCode,String wmsCatagary){
|
|
|
|
public Boolean check(PlcCmdInfo plcCmdInfo,String cmdCode,String wmsCode,String wmsTrayCode,String wmsCatagary){
|
|
|
|
|
|
|
|
|
|
|
|
long startTime = System.currentTimeMillis();
|
|
|
|
long startTime = System.currentTimeMillis();
|
|
|
|
Street street = streetService.getStreetByPlcId(plcCmdInfo.getPlcId());
|
|
|
|
Street street = streetService.getStreetByPlcId(plcCmdInfo.getPlcId());
|
|
|
|
CronTab.putTime(street.getId());
|
|
|
|
CronTab.putTime(street.getId());
|
|
|
|
List<LightSource> lightSources = lightSourceMapper.selectList(new QueryWrapper<LightSource>().eq("street_id",street.getId()));
|
|
|
|
|
|
|
|
lightSources.forEach(lightSource -> {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
LightSourceService.lightControllerOpen(configProperties.getLightSource(),lightSource);
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
|
|
|
log.error("open light"+lightSource.getIp()+" error",e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
Integer cameraId = getCameraByPlcCmd(plcCmdInfo,plcCmdInfo.getLeftRight1());
|
|
|
|
Integer cameraId = getCameraByPlcCmd(plcCmdInfo,plcCmdInfo.getLeftRight1());
|
|
|
|
|
|
|
|
|
|
|
|
if(plcCmdInfo.getSeparation1() == 1 && configProperties.getScanCodeMode().getTray() == 2){
|
|
|
|
String path = PathUtil.createFileNameByRowColumn("jpg", cameraId, plcCmdInfo.getRow1(), plcCmdInfo.getColumn1());
|
|
|
|
//内测
|
|
|
|
|
|
|
|
String c = cmdCode + "-" + plcCmdInfo.getLeftRightStr(1) + "-IN";
|
|
|
|
taskExecutor.execute(() -> {
|
|
|
|
log.info("camera ptz"+c);
|
|
|
|
List<LightSource> lightSources = lightSourceMapper.selectList(new QueryWrapper<LightSource>().eq("street_id",street.getId()));
|
|
|
|
gyrateCameraByCode(cameraId, c);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
lightSources.forEach(lightSource -> {
|
|
|
|
String c = cmdCode + "-" + plcCmdInfo.getLeftRightStr(1);
|
|
|
|
try {
|
|
|
|
log.info("camera ptz"+c);
|
|
|
|
LightSourceService.lightControllerOpen(configProperties.getLightSource(), lightSource);
|
|
|
|
gyrateCameraByCode(cameraId, c);
|
|
|
|
} catch (Exception e) {
|
|
|
|
try {
|
|
|
|
log.error("open light " + lightSource.getIp() + " error", e);
|
|
|
|
Thread.sleep(configProperties.getCameraConfig().getDelayCaptureTime());
|
|
|
|
}
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
});
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (plcCmdInfo.getSeparation1() == 2) {
|
|
|
|
|
|
|
|
// 内测
|
|
|
|
|
|
|
|
String c = cmdCode + "-DEEP-" + plcCmdInfo.getLeftRightStr(1) ;
|
|
|
|
|
|
|
|
log.info("camera ptz " + c);
|
|
|
|
|
|
|
|
gyrateCameraByCode(cameraId, c);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
String c = cmdCode + "-" + plcCmdInfo.getLeftRightStr(1);
|
|
|
|
|
|
|
|
log.info("camera ptz " + c);
|
|
|
|
|
|
|
|
gyrateCameraByCode(cameraId, c);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
Thread.sleep(configProperties.getCameraConfig().getDelayCaptureTime());
|
|
|
|
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
cameraCapture(cameraId, false,null , path);
|
|
|
|
|
|
|
|
} catch (NullPointerException e) {
|
|
|
|
|
|
|
|
log.error("相机{}未连接无法拍照", cameraId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
lightSources.forEach(lightSource -> {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
LightSourceService.lightControllerClose(configProperties.getLightSource(),lightSource);
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
|
|
|
log.error("open light"+lightSource.getIp()+" error",e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String path = PathUtil.createFileNameByRowColumn("jpg", cameraId, plcCmdInfo.getRow1(), plcCmdInfo.getColumn1());
|
|
|
|
});
|
|
|
|
try {
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
cameraCapture(cameraId, false, null, path);
|
|
|
|
// 其他逻辑...
|
|
|
|
} catch (NullPointerException e) {
|
|
|
|
//托盘码
|
|
|
|
log.error("相机{}未连接无法拍照", cameraId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//托盘码
|
|
|
|
|
|
|
|
String trayCode = "";
|
|
|
|
String trayCode = "";
|
|
|
|
Boolean trayCheck = Boolean.TRUE;
|
|
|
|
Boolean trayCheck = Boolean.TRUE;
|
|
|
|
trayCode = scan(plcCmdInfo,street);
|
|
|
|
trayCode = scan(plcCmdInfo,street,wmsTrayCode);
|
|
|
|
trayCheck = plcCmdInfo.getTrayCheck();
|
|
|
|
trayCheck = plcCmdInfo.getTrayCheck();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OrderInfo orderInfo = new OrderInfo(street, plcCmdInfo, 1, cmdCode);
|
|
|
|
OrderInfo orderInfo = new OrderInfo(street, plcCmdInfo, 1, cmdCode);
|
|
|
|
Stock stock = stockMapper.getByStreetAndDirectionAndSideAndRowColumn(orderInfo.getStreetId(), plcCmdInfo.getLeftRight1(), orderInfo.getSeparation(), orderInfo.getRow(), orderInfo.getColumn());
|
|
|
|
Stock stock = stockMapper.getByStreetAndDirectionAndSideAndRowColumn(orderInfo.getStreetId(), plcCmdInfo.getLeftRight1(), orderInfo.getSeparation(), orderInfo.getRow(), orderInfo.getColumn());
|
|
|
|
String scanCode = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//货物使用球机扫码
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log.info("code:{}", scanCode);
|
|
|
|
IndustrialCameraVO scTransmission = new IndustrialCameraVO();
|
|
|
|
|
|
|
|
scTransmission.setWmsTrayCode(wmsTrayCode);
|
|
|
|
|
|
|
|
scTransmission.setTrayCode(trayCode);
|
|
|
|
|
|
|
|
scTransmission.setFlag(trayCheck?1:0);
|
|
|
|
|
|
|
|
kuKouService.setHttp(scTransmission,trayCheck);
|
|
|
|
//核对异常
|
|
|
|
//核对异常
|
|
|
|
Integer status = 1;
|
|
|
|
Integer status = 1;
|
|
|
|
//托盘和货物都正确
|
|
|
|
//托盘和货物都正确
|
|
|
|
@ -585,7 +652,7 @@ public class PlcService {
|
|
|
|
stock = Stock.builder()
|
|
|
|
stock = Stock.builder()
|
|
|
|
.checkNum(plcCmdInfo.getOrderNum())
|
|
|
|
.checkNum(plcCmdInfo.getOrderNum())
|
|
|
|
.lotnum(plcCmdInfo.getLotnum())
|
|
|
|
.lotnum(plcCmdInfo.getLotnum())
|
|
|
|
.code(scanCode)
|
|
|
|
.code(trayCode)
|
|
|
|
.wmsCode(wmsCode)
|
|
|
|
.wmsCode(wmsCode)
|
|
|
|
.wmsTrayCode(wmsTrayCode)
|
|
|
|
.wmsTrayCode(wmsTrayCode)
|
|
|
|
.trayCode(trayCode)
|
|
|
|
.trayCode(trayCode)
|
|
|
|
@ -606,7 +673,7 @@ public class PlcService {
|
|
|
|
stock.setCheckNum(plcCmdInfo.getOrderNum());
|
|
|
|
stock.setCheckNum(plcCmdInfo.getOrderNum());
|
|
|
|
stock.setTrayCode(trayCode);
|
|
|
|
stock.setTrayCode(trayCode);
|
|
|
|
stock.setWmsTrayCode(wmsTrayCode);
|
|
|
|
stock.setWmsTrayCode(wmsTrayCode);
|
|
|
|
stock.setCode(scanCode);
|
|
|
|
stock.setCode(trayCode);
|
|
|
|
stock.setWmsCode(wmsCode);
|
|
|
|
stock.setWmsCode(wmsCode);
|
|
|
|
stockMapper.updateById(stock);
|
|
|
|
stockMapper.updateById(stock);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -617,15 +684,8 @@ public class PlcService {
|
|
|
|
long end = System.currentTimeMillis();
|
|
|
|
long end = System.currentTimeMillis();
|
|
|
|
long s = end - startTime;
|
|
|
|
long s = end - startTime;
|
|
|
|
log.info("time:{}millisecond", s);
|
|
|
|
log.info("time:{}millisecond", s);
|
|
|
|
lightSources.forEach(lightSource -> {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
LightSourceService.lightControllerClose(configProperties.getLightSource(),lightSource);
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
|
|
|
log.error("open light"+lightSource.getIp()+" error",e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
return trayCheck;
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void gyrateCamera(PlcCmdInfo plcCmdInfo,String code){
|
|
|
|
public void gyrateCamera(PlcCmdInfo plcCmdInfo,String code){
|
|
|
|
@ -894,6 +954,9 @@ public class PlcService {
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private LightSourceMapper lightSourceMapper;
|
|
|
|
private LightSourceMapper lightSourceMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private ThreadPoolTaskExecutor taskExecutor;
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 给到客户端
|
|
|
|
* 给到客户端
|
|
|
|
* @param plcCmdInfo
|
|
|
|
* @param plcCmdInfo
|
|
|
|
|