|
|
|
@ -1953,34 +1953,32 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
carsLoadEntity.setCarsLineName(loadLineTitleName); |
|
|
|
|
Long lastEndWarehouseId = null; |
|
|
|
|
if(!StringUtil.equals("4",loadType)){ |
|
|
|
|
carsLoadEntity.setEndWarehouseIds(endWarehouseIds); |
|
|
|
|
carsLoadEntity.setEndWarehouseNames(endWarehouseNames); |
|
|
|
|
String[] split = endWarehouseIds.split(","); |
|
|
|
|
int length = split.length; |
|
|
|
|
Long.parseLong(split[length - 1]); |
|
|
|
|
}else{ |
|
|
|
|
lastEndWarehouseId = warehouseId; |
|
|
|
|
} |
|
|
|
|
if(lastEndWarehouseId.equals(warehouseId)){ |
|
|
|
|
//移除当前仓作为目的仓的装车记录
|
|
|
|
|
QueryWrapper<TrunklineCarsLoadScanEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("load_id",loadId) |
|
|
|
|
Long lastEndWarehouseId = Long.parseLong(split[length - 1]); |
|
|
|
|
|
|
|
|
|
if(lastEndWarehouseId.equals(warehouseId)){ |
|
|
|
|
//移除当前仓作为目的仓的装车记录
|
|
|
|
|
QueryWrapper<TrunklineCarsLoadScanEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("load_id",loadId) |
|
|
|
|
.eq("warehouse_id",warehouseId).isNull("final_node_id"); |
|
|
|
|
List<TrunklineCarsLoadScanEntity> carsLoadScanEntityList = trunklineCarsLoadScanService.list(queryWrapper); |
|
|
|
|
if(CollUtil.isNotEmpty(carsLoadScanEntityList)){ |
|
|
|
|
//把carsLoadScanEntityList中所有元素的id放入一个List
|
|
|
|
|
List<Long> ids = carsLoadScanEntityList.stream().map(TrunklineCarsLoadScanEntity::getId).collect(Collectors.toList()); |
|
|
|
|
removeCarsLoadScan(ids,warehouseId); |
|
|
|
|
} |
|
|
|
|
carsLoadEntity.setLoadStatus("40"); |
|
|
|
|
}else{ |
|
|
|
|
Long startWarehouseId = carsLoadEntity.getStartWarehouseId(); |
|
|
|
|
if(startWarehouseId.equals(warehouseId)){ |
|
|
|
|
carsLoadEntity.setLoadStatus("0"); |
|
|
|
|
List<TrunklineCarsLoadScanEntity> carsLoadScanEntityList = trunklineCarsLoadScanService.list(queryWrapper); |
|
|
|
|
if(CollUtil.isNotEmpty(carsLoadScanEntityList)){ |
|
|
|
|
//把carsLoadScanEntityList中所有元素的id放入一个List
|
|
|
|
|
List<Long> ids = carsLoadScanEntityList.stream().map(TrunklineCarsLoadScanEntity::getId).collect(Collectors.toList()); |
|
|
|
|
removeCarsLoadScan(ids,warehouseId); |
|
|
|
|
} |
|
|
|
|
carsLoadEntity.setLoadStatus("40"); |
|
|
|
|
}else{ |
|
|
|
|
carsLoadEntity.setLoadStatus("20"); |
|
|
|
|
Long startWarehouseId = carsLoadEntity.getStartWarehouseId(); |
|
|
|
|
if(startWarehouseId.equals(warehouseId)){ |
|
|
|
|
carsLoadEntity.setLoadStatus("0"); |
|
|
|
|
}else{ |
|
|
|
|
carsLoadEntity.setLoadStatus("20"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|