add: 添加二次分配
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,8 +307,30 @@ 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("没有找到等待点!");
|
||||||
|
schBasePoint1.setVehicle_code(vehicleCode);
|
||||||
|
schBasePoint1.setIs_lock(true);
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
|
String now = DateUtil.now();
|
||||||
|
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,String vehicleCode) {
|
||||||
|
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::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()));
|
||||||
|
if(CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0){
|
||||||
|
SchBasePoint schBasePoint = schBasePoints.get(0);
|
||||||
schBasePoint.setVehicle_code(vehicleCode);
|
schBasePoint.setVehicle_code(vehicleCode);
|
||||||
schBasePoint.setIs_lock(true);
|
schBasePoint.setIs_lock(true);
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
@@ -322,17 +345,6 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public SchBasePoint selectByNextWaitPoint(String device_code) {
|
|
||||||
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::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()));
|
|
||||||
if(CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0){
|
|
||||||
return schBasePoints.get(0);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(propagation= Propagation.REQUIRES_NEW)
|
@Transactional(propagation= Propagation.REQUIRES_NEW)
|
||||||
public SchBasePoint selectEmpVehicleByRegionCode(String region_code, String...vehicleType) {
|
public SchBasePoint selectEmpVehicleByRegionCode(String region_code, String...vehicleType) {
|
||||||
|
|||||||
Reference in New Issue
Block a user