|
|
|
@ -1588,6 +1588,67 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public UpShelfAllocationVO moveAllocationScanAllocation(Long allocationId, Long warehouseId) { |
|
|
|
|
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId); |
|
|
|
|
if(Objects.isNull(goodsAllocationEntity)){ |
|
|
|
|
log.warn("#############moveAllocationScanAllocation: 库位信息不存在 allocationId={}",allocationId); |
|
|
|
|
throw new CustomerException(403,"库位信息不存在"); |
|
|
|
|
} |
|
|
|
|
String goodsAllocationName = goodsAllocationEntity.getGoodsAllocationName(); |
|
|
|
|
Long goodsShelfId = goodsAllocationEntity.getGoodsShelfId(); |
|
|
|
|
BasicdataGoodsShelfEntity basicdataGoodsShelfEntity = basicdataGoodsShelfClient.getEntityByGoodsShelfId(goodsShelfId); |
|
|
|
|
if(Objects.isNull(basicdataGoodsShelfEntity)){ |
|
|
|
|
log.warn("#################moveAllocationScanAllocation: 货架信息不存在 goodsShelfId={}",goodsShelfId); |
|
|
|
|
throw new CustomerException(403,"货架信息不存在"); |
|
|
|
|
} |
|
|
|
|
String goodsShelfName = basicdataGoodsShelfEntity.getGoodsShelfName(); |
|
|
|
|
Long goodsAreaId = basicdataGoodsShelfEntity.getGoodsAreaId();//货区id
|
|
|
|
|
BasicdataGoodsAreaEntity basicdataGoodsAreaEntity = basicdataGoodsAreaClient.getEntityByGoodsAreaId(goodsAreaId); |
|
|
|
|
if(Objects.isNull(basicdataGoodsAreaEntity)){ |
|
|
|
|
log.warn("#################moveAllocationScanAllocation: 货区信息不存在 goodsAreaId={}",goodsAreaId); |
|
|
|
|
throw new CustomerException(403,"货区信息不存在"); |
|
|
|
|
} |
|
|
|
|
Long wid = basicdataGoodsAreaEntity.getWarehouseId(); |
|
|
|
|
String goodsAreaName = basicdataGoodsAreaEntity.getHeadline();//货区名称
|
|
|
|
|
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(wid); |
|
|
|
|
if(Objects.isNull(basicdataWarehouseEntity)){ |
|
|
|
|
log.warn("#################moveAllocationScanAllocation: 仓库信息不存在 wid={}",wid); |
|
|
|
|
throw new CustomerException(403,"仓库信息不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(!wid.equals(warehouseId)){ |
|
|
|
|
log.warn("#################moveAllocationScanAllocation: 库位不在当前仓"); |
|
|
|
|
throw new CustomerException(403,"库位不在当前仓"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String warehouseName = basicdataWarehouseEntity.getName();//仓库名称
|
|
|
|
|
|
|
|
|
|
UpShelfAllocationVO upShelfAllocationVO = new UpShelfAllocationVO(); |
|
|
|
|
upShelfAllocationVO.setWarehouseId(warehouseId); |
|
|
|
|
upShelfAllocationVO.setWarehouseName(warehouseName); |
|
|
|
|
upShelfAllocationVO.setAreaId(goodsAreaId); |
|
|
|
|
upShelfAllocationVO.setAreaTitle(goodsAreaName); |
|
|
|
|
upShelfAllocationVO.setShelfId(goodsShelfId); |
|
|
|
|
upShelfAllocationVO.setShelfTitle(goodsShelfName); |
|
|
|
|
upShelfAllocationVO.setAllocationId(allocationId); |
|
|
|
|
upShelfAllocationVO.setAllocationTitle(goodsAllocationName); |
|
|
|
|
//就去查对应的库位绑定数据
|
|
|
|
|
QueryWrapper<WarehouseUpdownTypeEntity> updownTypeEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
updownTypeEntityQueryWrapper.eq("area_id",goodsAreaId) |
|
|
|
|
.eq("shelf_id",goodsShelfId) |
|
|
|
|
.eq("allocation_id",allocationId) |
|
|
|
|
.eq("is_deleted",0); |
|
|
|
|
WarehouseUpdownTypeEntity updownTypeEntity = baseMapper.selectOne(updownTypeEntityQueryWrapper); |
|
|
|
|
if(Objects.isNull(updownTypeEntity)){ |
|
|
|
|
log.warn("#############moveAllocationScanAllocation: 库位暂无数据 allocationId={}",allocationId); |
|
|
|
|
return upShelfAllocationVO; |
|
|
|
|
}else{ |
|
|
|
|
log.warn("#############moveAllocationScanAllocation: 库位已有绑定货物 allocationId={}",allocationId); |
|
|
|
|
throw new CustomerException(403,"库位已有绑定货物"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void saveUpdownGoodsLogPart(List<WarehouseUpdownGoodsEntity> updownGoodsList, int residue, String bindingType, Integer isAlltrays, String remark,Long warehouseId) { |
|
|
|
|
List<WarehouseUpdownGoodsLogEntity> updownGoodsLogList = new ArrayList<>(); |
|
|
|
|