Browse Source

add: 添加二次分配

master
yanps 6 months ago
parent
commit
00f90bc3f7
  1. 3
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java
  2. 5
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  3. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java
  4. 44
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java

3
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(); String hasWms = paramService.findByCode("hasWms").getValue();
if ("3".equals(task.getTask_type()) && StrUtil.isNotEmpty(hasWms) && "1".equals(hasWms)) { 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()); 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); JSONObject respjson = JSONObject.parseObject(resp);
String point_code = respjson.getString("point_code"); String point_code = respjson.getString("point_code");
task.setStart_device_code2(point_code); task.setStart_device_code2(point_code);

5
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); SchBasePoint schBasePoint = pointService.selectByPointCode(device_code);
if(ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("点位不存在!device_code:" + 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; return null;
} }

2
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<SchBasePoint> {
* @param device_code * @param device_code
* @return * @return
*/ */
SchBasePoint selectByNextWaitPoint(String device_code); SchBasePoint selectByNextWaitPoint(String device_code,String vehicleCode);
} }

44
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<SchBasePointMapper, Sch
isNull(SchBasePoint::getVehicle_code).eq(SchBasePoint::getRegion_code, region_code).eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()) isNull(SchBasePoint::getVehicle_code).eq(SchBasePoint::getRegion_code, region_code).eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.eq(SchBasePoint::getCan_vehicle_type, mdBaseVehicle.getVehicle_type()).eq(SchBasePoint::getIs_used, true)); .eq(SchBasePoint::getCan_vehicle_type, mdBaseVehicle.getVehicle_type()).eq(SchBasePoint::getIs_used, true));
if(CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0){ if(CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 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("没有找到等待点!"); if(ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("没有找到等待点!");
schBasePoint.setVehicle_code(vehicleCode); schBasePoint1.setVehicle_code(vehicleCode);
schBasePoint.setIs_lock(true); schBasePoint1.setIs_lock(true);
String currentUserId = SecurityUtils.getCurrentUserId(); String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName(); String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now(); String now = DateUtil.now();
schBasePoint.setUpdate_id(currentUserId); schBasePoint1.setUpdate_id(currentUserId);
schBasePoint.setUpdate_name(nickName); schBasePoint1.setUpdate_name(nickName);
schBasePoint.setUpdate_time(now); schBasePoint1.setUpdate_time(now);
updateById(schBasePoint); updateById(schBasePoint1);
return schBasePoint; return schBasePoint;
} }
//分配载具类型相同的站点 //分配载具类型相同的站点
@ -306,29 +307,40 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
isNull(SchBasePoint::getVehicle_code).eq(SchBasePoint::getCan_vehicle_type, mdBaseVehicle.getVehicle_type()) isNull(SchBasePoint::getVehicle_code).eq(SchBasePoint::getCan_vehicle_type, mdBaseVehicle.getVehicle_type())
.eq(SchBasePoint::getIs_used, true).eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())); .eq(SchBasePoint::getIs_used, true).eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()));
if(CollUtil.isNotEmpty(schBasePoints1) && schBasePoints1.size() > 0){ if(CollUtil.isNotEmpty(schBasePoints1) && schBasePoints1.size() > 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("没有找到等待点!"); if(ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("没有找到等待点!");
schBasePoint.setVehicle_code(vehicleCode); schBasePoint1.setVehicle_code(vehicleCode);
schBasePoint.setIs_lock(true); schBasePoint1.setIs_lock(true);
String currentUserId = SecurityUtils.getCurrentUserId(); String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName(); String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now(); String now = DateUtil.now();
schBasePoint.setUpdate_id(currentUserId); schBasePoint1.setUpdate_id(currentUserId);
schBasePoint.setUpdate_name(nickName); schBasePoint1.setUpdate_name(nickName);
schBasePoint.setUpdate_time(now); schBasePoint1.setUpdate_time(now);
updateById(schBasePoint); updateById(schBasePoint1);
return schBasePoint; return schBasePoint;
} }
return null; return null;
} }
@Override @Override
public SchBasePoint selectByNextWaitPoint(String device_code) { public SchBasePoint selectByNextWaitPoint(String device_code,String vehicleCode) {
List<SchBasePoint> schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getNext_wait_point, device_code).eq(SchBasePoint::getIs_used, true) List<SchBasePoint> 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::getIs_lock, false).isNull(SchBasePoint::getVehicle_code)
.eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())); .eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()));
if(CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0){ 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; return null;
} }

Loading…
Cancel
Save