add: 添加二次分配
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -107,6 +107,6 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
|
||||
* @param device_code
|
||||
* @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())
|
||||
.eq(SchBasePoint::getCan_vehicle_type, mdBaseVehicle.getVehicle_type()).eq(SchBasePoint::getIs_used, true));
|
||||
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("没有找到等待点!");
|
||||
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,8 +307,30 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
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()));
|
||||
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("没有找到等待点!");
|
||||
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.setIs_lock(true);
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
@@ -322,17 +345,6 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
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
|
||||
@Transactional(propagation= Propagation.REQUIRES_NEW)
|
||||
public SchBasePoint selectEmpVehicleByRegionCode(String region_code, String...vehicleType) {
|
||||
|
||||
Reference in New Issue
Block a user