diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java index 9527a12..bbb863b 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java @@ -451,6 +451,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic String hasWms = paramService.findByCode("hasWms").getValue(); if ("3".equals(task.getTask_type()) && StrUtil.isNotEmpty(hasWms) && "1".equals(hasWms)) { String resp = acsToWmsService.requestTaskAgain(task.getNext_point_code(), task.getExt_task_id(), inst.getVehicle_code()); + if(StrUtil.isEmpty(resp)){ + log.info("申请分配二次点位失败,响应参数:{}",resp); + } JSONObject respjson = JSONObject.parseObject(resp); String point_code = respjson.getString("point_code"); task.setStart_device_code2(point_code); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index 74c8c67..3477692 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -324,8 +324,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { //查询点位是否存在 SchBasePoint schBasePoint = pointService.selectByPointCode(device_code); if(ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("点位不存在!device_code:" + device_code); - SchBasePoint schBasePoint1 = pointService.selectByNextWaitPoint(device_code); - // + SchBasePoint schBasePoint1 = pointService.selectByNextWaitPoint(device_code,schBaseTask.getVehicle_code()); + if(ObjectUtil.isEmpty(schBasePoint1)) throw new BadRequestException("未查询到可用点位!等待点位:"+device_code); + return schBasePoint; } return null; } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java index 889b27c..4770beb 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java @@ -107,6 +107,6 @@ public interface ISchBasePointService extends IService { * @param device_code * @return */ - SchBasePoint selectByNextWaitPoint(String device_code); + SchBasePoint selectByNextWaitPoint(String device_code,String vehicleCode); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java index 0a794c6..b76cad2 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java @@ -288,17 +288,18 @@ public class SchBasePointServiceImpl extends ServiceImpl 0){ - SchBasePoint schBasePoint = pointMapper.selectById(schBasePoints.get(0).getNext_wait_point()); + SchBasePoint schBasePoint1 = schBasePoints.get(0); + SchBasePoint schBasePoint = pointMapper.selectById(schBasePoint1.getNext_wait_point()); if(ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("没有找到等待点!"); - schBasePoint.setVehicle_code(vehicleCode); - schBasePoint.setIs_lock(true); + schBasePoint1.setVehicle_code(vehicleCode); + schBasePoint1.setIs_lock(true); String currentUserId = SecurityUtils.getCurrentUserId(); String nickName = SecurityUtils.getCurrentNickName(); String now = DateUtil.now(); - schBasePoint.setUpdate_id(currentUserId); - schBasePoint.setUpdate_name(nickName); - schBasePoint.setUpdate_time(now); - updateById(schBasePoint); + schBasePoint1.setUpdate_id(currentUserId); + schBasePoint1.setUpdate_name(nickName); + schBasePoint1.setUpdate_time(now); + updateById(schBasePoint1); return schBasePoint; } //分配载具类型相同的站点 @@ -306,29 +307,40 @@ public class SchBasePointServiceImpl extends ServiceImpl 0){ - SchBasePoint schBasePoint = pointMapper.selectById(schBasePoints.get(0).getNext_wait_point()); + SchBasePoint schBasePoint1 = schBasePoints.get(0); + SchBasePoint schBasePoint = pointMapper.selectById(schBasePoint1.getNext_wait_point()); if(ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("没有找到等待点!"); - schBasePoint.setVehicle_code(vehicleCode); - schBasePoint.setIs_lock(true); + schBasePoint1.setVehicle_code(vehicleCode); + schBasePoint1.setIs_lock(true); String currentUserId = SecurityUtils.getCurrentUserId(); String nickName = SecurityUtils.getCurrentNickName(); String now = DateUtil.now(); - schBasePoint.setUpdate_id(currentUserId); - schBasePoint.setUpdate_name(nickName); - schBasePoint.setUpdate_time(now); - updateById(schBasePoint); + schBasePoint1.setUpdate_id(currentUserId); + schBasePoint1.setUpdate_name(nickName); + schBasePoint1.setUpdate_time(now); + updateById(schBasePoint1); return schBasePoint; } return null; } @Override - public SchBasePoint selectByNextWaitPoint(String device_code) { + public SchBasePoint selectByNextWaitPoint(String device_code,String vehicleCode) { List schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getNext_wait_point, device_code).eq(SchBasePoint::getIs_used, true) .eq(SchBasePoint::getIs_lock, false).isNull(SchBasePoint::getVehicle_code) .eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())); if(CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0){ - return schBasePoints.get(0); + SchBasePoint schBasePoint = schBasePoints.get(0); + schBasePoint.setVehicle_code(vehicleCode); + schBasePoint.setIs_lock(true); + String currentUserId = SecurityUtils.getCurrentUserId(); + String nickName = SecurityUtils.getCurrentNickName(); + String now = DateUtil.now(); + schBasePoint.setUpdate_id(currentUserId); + schBasePoint.setUpdate_name(nickName); + schBasePoint.setUpdate_time(now); + updateById(schBasePoint); + return schBasePoint; } return null; }