Commit 67d3f389bd098a677be430e3e076f86a4e2e828f

Authored by wangyanxiong
1 parent 6b8254fb

出库完成完善

src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
@@ -1069,22 +1069,29 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea @@ -1069,22 +1069,29 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
1069 locationService.update(locationLambdaUpdateWrapper); 1069 locationService.update(locationLambdaUpdateWrapper);
1070 //如果是整出,删掉这个库位上的这个托盘,否则更改托盘状态 1070 //如果是整出,删掉这个库位上的这个托盘,否则更改托盘状态
1071 Container containerRecord = new Container(); 1071 Container containerRecord = new Container();
1072 -// if(task.getTaskType()==300) {  
1073 -// containerService.updateLocationCodeAndStatus(task.getContainerCode(),"","empty");  
1074 -// }  
1075 -// else{  
1076 -// //查询是否存在关联的库存,入如果没有就修改容器状态为empty  
1077 -// Inventory inventoryCondition = new Inventory();  
1078 -// inventoryCondition.setLocationCode(task.getSourceLocation());  
1079 -// Map<String, Object> map = inventoryService.selectFirstMap("id", inventoryCondition);  
1080 -// if (map == null) {  
1081 -// //如果没有库存就设置为empty  
1082 -// containerService.updateStatus(task.getContainerCode(), "empty");  
1083 -// }  
1084 -// } 1072 + if(task.getTaskType()==300) {
  1073 + containerService.updateLocationCodeAndStatus(task.getContainerCode(),"","empty");
  1074 + }
  1075 + else{
  1076 + //查询是否存在关联的库存,入如果没有就修改容器状态为empty
  1077 + InventoryDetail inventoryCondition = new InventoryDetail();
  1078 + inventoryCondition.setLocationCode(task.getToLocation());
  1079 + LambdaQueryWrapper<InventoryDetail> inventoryDetaillambdaQueryWrapper = Wrappers.lambdaQuery();
  1080 + inventoryDetaillambdaQueryWrapper.eq(InventoryDetail::getLocationCode,task.getToLocation());
  1081 + List<InventoryDetail> detailList= inventoryDetailService.list();
  1082 + //库存查询不到该容器就把容器状态改为可用
  1083 + if (detailList.size()<1) {
  1084 + Container container =new Container();
  1085 + container.setCode(task.getToLocation());
  1086 + condition.setToLocation("");
  1087 + LambdaUpdateWrapper<Container> containerLambdaUpdateWrapper = Wrappers.lambdaUpdate();
  1088 + containerLambdaUpdateWrapper.eq(Container::getCode,task.getToLocation());
  1089 + containerService.update(containerLambdaUpdateWrapper);
  1090 + }
  1091 + }
1085 // //设置出库货箱状态为拣货任务完成 1092 // //设置出库货箱状态为拣货任务完成
1086 // shipmentContainerHeaderService.resetStatusShipmentContainer(task.getAllocationHeadId(),(short)20); 1093 // shipmentContainerHeaderService.resetStatusShipmentContainer(task.getAllocationHeadId(),(short)20);
1087 - //最后更新单据状态 1094 + // 最后更新单据状态
1088 shipmentHeadIds.stream().distinct().forEach(t->shipmentHeaderService.updateShipmentStatus(t)); 1095 shipmentHeadIds.stream().distinct().forEach(t->shipmentHeaderService.updateShipmentStatus(t));
1089 1096
1090 } 1097 }