|
|
@ -651,87 +651,6 @@ public class WarehouseUpdownStockupAreaServiceImpl extends BaseServiceImpl<Wareh |
|
|
|
return R.status(this.saveBatch(warehouseUpdownStockupAreaEntities)); |
|
|
|
return R.status(this.saveBatch(warehouseUpdownStockupAreaEntities)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* @param trayCode |
|
|
|
|
|
|
|
* @param allocationId |
|
|
|
|
|
|
|
* @param warehouseId |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public R upShelfTray(String trayCode, Long allocationId, Long warehouseId) { |
|
|
|
|
|
|
|
int num = 0; |
|
|
|
|
|
|
|
//判断货位是否有托盘
|
|
|
|
|
|
|
|
BasicdataTrayEntity trayEntity = warehouseTaryAllocationService.getTrayByAllocationId(allocationId); |
|
|
|
|
|
|
|
if(!Objects.isNull(trayEntity)){ |
|
|
|
|
|
|
|
log.warn("##############upShelfTray: 库位上已有托盘 allocationId={}",allocationId); |
|
|
|
|
|
|
|
log.warn("##############upShelfTray: 库位上已有托盘 allocationId={}",allocationId); |
|
|
|
|
|
|
|
// return R.fail(403,"库位上已有托盘");
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// QueryWrapper<WarehouseUpdownTypeEntity> updownTypeEntityQueryWrapper = new QueryWrapper<>();
|
|
|
|
|
|
|
|
// updownTypeEntityQueryWrapper.eq("allocation_id",allocationId)
|
|
|
|
|
|
|
|
// .eq("is_deleted",0);
|
|
|
|
|
|
|
|
// WarehouseUpdownTypeEntity updownTypeEntity = baseMapper.selectOne(updownTypeEntityQueryWrapper);
|
|
|
|
|
|
|
|
// if(!Objects.isNull(updownTypeEntity)){
|
|
|
|
|
|
|
|
// log.warn("##############upShelfTray: 库位上已存在货物 allocationId={}",allocationId);
|
|
|
|
|
|
|
|
// return R.fail(403,"库位上已存在货物");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId); |
|
|
|
|
|
|
|
if(Objects.isNull(goodsAllocationEntity)){ |
|
|
|
|
|
|
|
log.warn("##############upShelfTray: 库位不存在 allocationId={}",allocationId); |
|
|
|
|
|
|
|
return R.fail(403,"库位不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String enableStatus = goodsAllocationEntity.getEnableStatus(); |
|
|
|
|
|
|
|
Long goodsShelfId = goodsAllocationEntity.getGoodsShelfId(); |
|
|
|
|
|
|
|
if("2".equals(enableStatus)){ |
|
|
|
|
|
|
|
log.warn("##############upShelfTray: 库位已被禁用 allocationId={}",allocationId); |
|
|
|
|
|
|
|
return R.fail(403,"库位已被禁用"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
BasicdataGoodsShelfEntity goodsShelfEntity = basicdataGoodsShelfClient.getEntityByGoodsShelfId(goodsShelfId); |
|
|
|
|
|
|
|
if(Objects.isNull(goodsShelfEntity)){ |
|
|
|
|
|
|
|
log.warn("##############upShelfTray: 货架不存在 goodsShelfId={}",goodsShelfId); |
|
|
|
|
|
|
|
return R.fail(403,"货架不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Long goodsAreaId = goodsShelfEntity.getGoodsAreaId(); |
|
|
|
|
|
|
|
BasicdataGoodsAreaEntity goodsAreaEntity = basicdataGoodsAreaClient.getEntityByGoodsAreaId(goodsAreaId); |
|
|
|
|
|
|
|
if(Objects.isNull(goodsAreaEntity)){ |
|
|
|
|
|
|
|
log.warn("##############upShelfTray: 货区不存在 goodsAreaId={}",goodsAreaId); |
|
|
|
|
|
|
|
return R.fail(403,"货区不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// String areaType = goodsAreaEntity.getAreaType();
|
|
|
|
|
|
|
|
// if("1".equals(areaType)){
|
|
|
|
|
|
|
|
// log.warn("#################upShelfTray: 备货区不能上下架 goodsAreaId={}",goodsAreaId);
|
|
|
|
|
|
|
|
// throw new CustomerException(403,"备货区不能上下架");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
Long wid = goodsAreaEntity.getWarehouseId(); |
|
|
|
|
|
|
|
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(wid); |
|
|
|
|
|
|
|
if(Objects.isNull(warehouseEntity)){ |
|
|
|
|
|
|
|
log.warn("##############upShelfTray: 仓库不存在 warehouseId={}",wid); |
|
|
|
|
|
|
|
return R.fail(403,"仓库不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(!wid.equals(warehouseId)){ |
|
|
|
|
|
|
|
log.warn("##############upShelfTray: 库位不在本仓库中 warehouseId={}",warehouseId); |
|
|
|
|
|
|
|
return R.fail(403,"库位不在本仓库中"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询托盘上有哪些货物,存入相同的绑定关系和记录
|
|
|
|
|
|
|
|
QueryWrapper<WarehouseTrayTypeEntity> trayTypeEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
trayTypeEntityQueryWrapper.eq("tray_code",trayCode) |
|
|
|
|
|
|
|
.eq("is_deleted",0); |
|
|
|
|
|
|
|
WarehouseTrayTypeEntity trayTypeEntity = warehouseTrayTypeService.getOne(trayTypeEntityQueryWrapper); |
|
|
|
|
|
|
|
if(Objects.isNull(trayTypeEntity)){ |
|
|
|
|
|
|
|
log.warn("##############upShelfTray: 托盘上没有货物信息 trayCode={}",trayCode); |
|
|
|
|
|
|
|
return R.fail(403,"托盘上没有货物信息"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//处理托盘上的货物到库位上
|
|
|
|
|
|
|
|
return saveTrayGoodsToAllocation(trayTypeEntity,goodsAllocationEntity,goodsShelfEntity,goodsAreaEntity,warehouseId); |
|
|
|
|
|
|
|
// return null;
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private R saveTrayGoodsToAllocation(WarehouseTrayTypeEntity trayTypeEntity, BasicdataGoodsAllocationEntity goodsAllocationEntity, BasicdataGoodsShelfEntity goodsShelfEntity, BasicdataGoodsAreaEntity goodsAreaEntity, Long warehouseId) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private WarehouseUpdownStockupAreaEntity createdNewUpShelfInventory(Long allocationId, Long warehouseId, UpShelfStockDTO upShelfStockDTO, WarehouseUpdownStockupAreaEntity updownTypeEntity, Long goodsAreaId, BasicdataGoodsAreaEntity goodsAreaEntity, Long goodsShelfId, BasicdataGoodsShelfEntity goodsShelfEntity, BasicdataGoodsAllocationEntity goodsAllocationEntity) { |
|
|
|
private WarehouseUpdownStockupAreaEntity createdNewUpShelfInventory(Long allocationId, Long warehouseId, UpShelfStockDTO upShelfStockDTO, WarehouseUpdownStockupAreaEntity updownTypeEntity, Long goodsAreaId, BasicdataGoodsAreaEntity goodsAreaEntity, Long goodsShelfId, BasicdataGoodsShelfEntity goodsShelfEntity, BasicdataGoodsAllocationEntity goodsAllocationEntity) { |
|
|
|
WarehouseUpdownStockupAreaEntity updownStockupAreaEntity = new WarehouseUpdownStockupAreaEntity(); |
|
|
|
WarehouseUpdownStockupAreaEntity updownStockupAreaEntity = new WarehouseUpdownStockupAreaEntity(); |
|
|
|