|
|
@ -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,29 +307,40 @@ 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("没有找到等待点!"); |
|
|
|
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<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); |
|
|
|
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; |
|
|
|
} |
|
|
|