|
@ -75,6 +75,8 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch |
|
|
|
|
|
|
|
|
private final Object lock = new Object(); |
|
|
private final Object lock = new Object(); |
|
|
|
|
|
|
|
|
|
|
|
private final Object lock2 = new Object(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public IPage<SchBasePoint> queryAll(Map whereJson, PageQuery page) { |
|
|
public IPage<SchBasePoint> queryAll(Map whereJson, PageQuery page) { |
|
@ -249,6 +251,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch |
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public SchBasePoint selectByRegionCode(String region_code, String vehicleCode, String piont_type) { |
|
|
public SchBasePoint selectByRegionCode(String region_code, String vehicleCode, String piont_type) { |
|
|
|
|
|
synchronized (lock2) { |
|
|
//查询载具的类型
|
|
|
//查询载具的类型
|
|
|
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.getById(vehicleCode); |
|
|
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.getById(vehicleCode); |
|
|
if (ObjectUtil.isEmpty(mdBaseVehicle)) throw new BadRequestException("载具类型不存在!"); |
|
|
if (ObjectUtil.isEmpty(mdBaseVehicle)) throw new BadRequestException("载具类型不存在!"); |
|
@ -286,6 +289,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch |
|
|
} |
|
|
} |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public SchBasePoint selectByPointCode(String start_device_code) { |
|
|
public SchBasePoint selectByPointCode(String start_device_code) { |
|
@ -391,7 +395,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch |
|
|
.eq(SchBasePoint::getIs_used, true) |
|
|
.eq(SchBasePoint::getIs_used, true) |
|
|
.eq(SchBasePoint::getPoint_status, pointStatus) |
|
|
.eq(SchBasePoint::getPoint_status, pointStatus) |
|
|
.eq(SchBasePoint::getPoint_type, "1") |
|
|
.eq(SchBasePoint::getPoint_type, "1") |
|
|
.eq(StrUtil.isNotBlank(vehicle_type),SchBasePoint::getCan_vehicle_type, vehicle_type) |
|
|
.eq(StrUtil.isNotBlank(vehicle_type), SchBasePoint::getCan_vehicle_type, vehicle_type) |
|
|
.isNull(seq == 2, SchBasePoint::getVehicles) |
|
|
.isNull(seq == 2, SchBasePoint::getVehicles) |
|
|
.isNull(seq == 1, SchBasePoint::getVehicle_code) |
|
|
.isNull(seq == 1, SchBasePoint::getVehicle_code) |
|
|
.eq(StrUtil.isNotBlank(region_code), SchBasePoint::getRegion_code, region_code) |
|
|
.eq(StrUtil.isNotBlank(region_code), SchBasePoint::getRegion_code, region_code) |
|
@ -428,10 +432,10 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch |
|
|
List<String> msg = new ArrayList<>(); |
|
|
List<String> msg = new ArrayList<>(); |
|
|
String vehicles = schBasePoint.getVehicles(); |
|
|
String vehicles = schBasePoint.getVehicles(); |
|
|
boolean contains = vehicles.contains(","); |
|
|
boolean contains = vehicles.contains(","); |
|
|
if(contains){ |
|
|
if (contains) { |
|
|
String[] split = vehicles.split(","); |
|
|
String[] split = vehicles.split(","); |
|
|
msg = Arrays.asList(split); |
|
|
msg = Arrays.asList(split); |
|
|
}else{ |
|
|
} else { |
|
|
msg.add(vehicles); |
|
|
msg.add(vehicles); |
|
|
} |
|
|
} |
|
|
Integer vehicle_qty = schBasePoint.getVehicle_qty(); |
|
|
Integer vehicle_qty = schBasePoint.getVehicle_qty(); |
|
@ -448,12 +452,12 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch |
|
|
.set(SchBasePoint::getVehicles, null)); |
|
|
.set(SchBasePoint::getVehicles, null)); |
|
|
} |
|
|
} |
|
|
SchBasePoint schBasePoint1 = null; |
|
|
SchBasePoint schBasePoint1 = null; |
|
|
if(vehicle_qty == 1){ |
|
|
if (vehicle_qty == 1) { |
|
|
schBasePoint1 = selectByPointCode(schBasePoint.getPoint_code()); |
|
|
schBasePoint1 = selectByPointCode(schBasePoint.getPoint_code()); |
|
|
}else{ |
|
|
} else { |
|
|
schBasePoint1 = selectByPointCode(schBasePoint.getPoint_code() + "_" + (vehicle_qty - 1)); |
|
|
schBasePoint1 = selectByPointCode(schBasePoint.getPoint_code() + "_" + (vehicle_qty - 1)); |
|
|
} |
|
|
} |
|
|
if(ObjectUtil.isEmpty(schBasePoint1)) throw new BadRequestException("该货位不存在!"); |
|
|
if (ObjectUtil.isEmpty(schBasePoint1)) throw new BadRequestException("该货位不存在!"); |
|
|
schBasePoint1.setVehicle_code(s); |
|
|
schBasePoint1.setVehicle_code(s); |
|
|
return schBasePoint1; |
|
|
return schBasePoint1; |
|
|
} |
|
|
} |
|
@ -523,7 +527,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch |
|
|
//查询满足条件的站点
|
|
|
//查询满足条件的站点
|
|
|
List<SchBasePoint> schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getIs_lock, false). |
|
|
List<SchBasePoint> schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getIs_lock, false). |
|
|
isNotNull(SchBasePoint::getVehicle_code) |
|
|
isNotNull(SchBasePoint::getVehicle_code) |
|
|
.eq(StrUtil.isNotEmpty(region_code),SchBasePoint::getRegion_code, region_code) |
|
|
.eq(StrUtil.isNotEmpty(region_code), SchBasePoint::getRegion_code, region_code) |
|
|
.eq(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue()) |
|
|
.eq(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue()) |
|
|
.in(SchBasePoint::getCan_vehicle_type, vehicleType) |
|
|
.in(SchBasePoint::getCan_vehicle_type, vehicleType) |
|
|
.eq(SchBasePoint::getIs_used, true)); |
|
|
.eq(SchBasePoint::getIs_used, true)); |
|
|