|
@ -190,10 +190,7 @@ public class YZSLTask extends AbstractTask { |
|
|
.eq(SchBasePoint::getIs_used, true); |
|
|
.eq(SchBasePoint::getIs_used, true); |
|
|
// 如果一个有货一个没货,但是载具数量又是5的时候,就要不需要检测不能为5
|
|
|
// 如果一个有货一个没货,但是载具数量又是5的时候,就要不需要检测不能为5
|
|
|
List<SchBasePoint> list = pointService.list(lam); |
|
|
List<SchBasePoint> list = pointService.list(lam); |
|
|
boolean doDetection = true; // 如果只有一条符合的数据就不需要检验不符合5个托
|
|
|
boolean doDetection = list.size() != 1; // 如果只有一条符合的数据就不需要检验不符合5个托
|
|
|
if (list.size() == 1) { |
|
|
|
|
|
doDetection = false; |
|
|
|
|
|
} |
|
|
|
|
|
lam.ne(doDetection, SchBasePoint::getVehicle_qty, 5) // 载具数量不能等于5
|
|
|
lam.ne(doDetection, SchBasePoint::getVehicle_qty, 5) // 载具数量不能等于5
|
|
|
.orderByDesc(SchBasePoint::getVehicle_qty); |
|
|
.orderByDesc(SchBasePoint::getVehicle_qty); |
|
|
List<SchBasePoint> schBasePoints = pointService.list(lam); |
|
|
List<SchBasePoint> schBasePoints = pointService.list(lam); |
|
@ -251,10 +248,15 @@ public class YZSLTask extends AbstractTask { |
|
|
SchBasePoint basePoint = pointService.getById(deviceCode); |
|
|
SchBasePoint basePoint = pointService.getById(deviceCode); |
|
|
PdmBdWorkorder workorderObject = workorderService.getDeviceProductionTask(basePoint.getParent_point_code()); |
|
|
PdmBdWorkorder workorderObject = workorderService.getDeviceProductionTask(basePoint.getParent_point_code()); |
|
|
// 找到相同组盘信息就修改,避免任务取消组盘信息还存在,重复插入
|
|
|
// 找到相同组盘信息就修改,避免任务取消组盘信息还存在,重复插入
|
|
|
|
|
|
SchBaseVehiclematerialgroup groupInfo = vehiclematerialgroupService |
|
|
|
|
|
.getGroupInfo(vehicleCode, vehicleType, GroupBindMaterialStatusEnum.BOUND.getValue()); |
|
|
|
|
|
if (ObjectUtil.isNotEmpty(groupInfo)) { |
|
|
|
|
|
throw new BadRequestException("载具号[" + vehicleCode + "]组盘信息已存在"); |
|
|
|
|
|
} |
|
|
SchBaseVehiclematerialgroup groupEntity = new SchBaseVehiclematerialgroup(); |
|
|
SchBaseVehiclematerialgroup groupEntity = new SchBaseVehiclematerialgroup(); |
|
|
groupEntity.setGroup_id(IdUtil.getSnowflake(1, 1).nextIdStr()); |
|
|
groupEntity.setGroup_id(IdUtil.getSnowflake(1, 1).nextIdStr()); |
|
|
// 解绑同载具的信息
|
|
|
// 解绑同载具的信息
|
|
|
vehiclematerialgroupService.unBindingSameVehicleMaterial(vehicleCode, vehicleType); |
|
|
// vehiclematerialgroupService.unBindingSameVehicleMaterial(vehicleCode, vehicleType);
|
|
|
// 要把数据存到组盘表
|
|
|
// 要把数据存到组盘表
|
|
|
groupEntity.setMaterial_id(ObjectUtil.isNotEmpty(workorderObject) |
|
|
groupEntity.setMaterial_id(ObjectUtil.isNotEmpty(workorderObject) |
|
|
? workorderObject.getMaterial_id() |
|
|
? workorderObject.getMaterial_id() |
|
@ -281,7 +283,7 @@ public class YZSLTask extends AbstractTask { |
|
|
? workorderObject.getBatch_no() |
|
|
? workorderObject.getBatch_no() |
|
|
: DateUtil.format(DateUtil.date(), "yyyyMMdd")); |
|
|
: DateUtil.format(DateUtil.date(), "yyyyMMdd")); |
|
|
groupEntity.setInstorage_time(DateUtil.now()); |
|
|
groupEntity.setInstorage_time(DateUtil.now()); |
|
|
groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.WAIT_BIND.getValue()); // 待绑定
|
|
|
groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 绑定
|
|
|
groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。
|
|
|
groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。
|
|
|
groupEntity.setIs_delete(false); |
|
|
groupEntity.setIs_delete(false); |
|
|
groupEntity.setIs_full(isFull.equals(GeneralDefinition.YES) ? true : false); |
|
|
groupEntity.setIs_full(isFull.equals(GeneralDefinition.YES) ? true : false); |
|
|