opt:合托优化

This commit is contained in:
2025-12-19 10:04:37 +08:00
parent a41f345b4e
commit e6f3a6d92a

View File

@@ -871,7 +871,9 @@ public class HandheldServiceImpl implements HandheldService {
try {
// 4. 查询源托盘的所有物料信息
List<SchBaseVehiclematerialgroup> allSourceMaterials = iSchBaseVehiclematerialgroupService.selectByVehicleCode(sourceVehicleCode);
if(CollectionUtils.isEmpty(allSourceMaterials)){
throw new BadRequestException("源托盘中不存在物料,无法合托");
}
// 7. 执行合托操作
for (int i = 0; i < selectedMaterials.size(); i++) {
@@ -896,6 +898,19 @@ public class HandheldServiceImpl implements HandheldService {
}
}
if(allSourceMaterials.size() == selectedMaterials.size()) {
//源托盘点位变成空载具状态
iSchBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getVehicle_code, sourceVehicleCode)
.set(SchBasePoint::getPoint_status, "1"));
}
//目标托盘变成有货状态
iSchBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getVehicle_code, targetVehicleCode)
.set(SchBasePoint::getPoint_status, "2"));
// 8. 判断是否需要入库:如果两个托盘都不在货架上,则需要入库
boolean needStoreIn = ObjectUtil.isEmpty(sourcePoint) && ObjectUtil.isEmpty(targetPoint);