opt:健壮性优化

This commit is contained in:
zhaoyf
2026-06-29 09:41:42 +08:00
parent d93fa3f35d
commit f744da31b7
2 changed files with 6 additions and 2 deletions

View File

@@ -86,7 +86,8 @@ public class MesToWmsServiceImpl implements MesToWmsService {
if (groupList.isEmpty()){ if (groupList.isEmpty()){
throw new BadRequestException("叫满任务失败,库存没有当前下料口的组盘物料"); throw new BadRequestException("叫满任务失败,库存没有当前下料口的组盘物料");
} }
String storagevehicleCode = groupList.get(0).getStoragevehicle_code(); GroupPlate groupPlate = groupList.get(0);
String storagevehicleCode = groupPlate.getStoragevehicle_code();
//根据托盘获取当前起点 //根据托盘获取当前起点
SchBasePoint start_point = iSchBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>() SchBasePoint start_point = iSchBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getVehicle_code, storagevehicleCode)); .eq(SchBasePoint::getVehicle_code, storagevehicleCode));
@@ -116,7 +117,7 @@ public class MesToWmsServiceImpl implements MesToWmsService {
// 创建第一个entry对象 // 创建第一个entry对象
JSONObject entry = new JSONObject(); JSONObject entry = new JSONObject();
for (WorkOrderBomDao orderBomItem : orderBomItems) { for (WorkOrderBomDao orderBomItem : orderBomItems) {
entry.put("qty", groupList.get(0).getQty()); entry.put("qty", groupPlate.getQty());
entry.put("sourceBillId", workOrder.getOrder_id()); entry.put("sourceBillId", workOrder.getOrder_id());
entry.put("sourceBillEntryId", orderBomItem.getItem_id()); entry.put("sourceBillEntryId", orderBomItem.getItem_id());
entry.put("sourceBillNo", workOrder.getOrder_code()); entry.put("sourceBillNo", workOrder.getOrder_code());

View File

@@ -422,6 +422,9 @@ public class InboundPdaServiceImpl implements InboundPdaService {
.reduce(Double::sum).orElse(0.0); .reduce(Double::sum).orElse(0.0);
// 查询库位 // 查询库位
Structattr struct = iStructattrService.findByCode(dto.getStruct_code()); Structattr struct = iStructattrService.findByCode(dto.getStruct_code());
if (struct == null){
throw new BadRequestException("入库失败:库位" + dto.getStruct_code() + "不存在");
}
// 查询库区 // 查询库区
Sectattr sectDao = iSectattrService.findByCode(struct.getSect_code()); Sectattr sectDao = iSectattrService.findByCode(struct.getSect_code());
// 组织主表数据 // 组织主表数据