@ -99,7 +99,7 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
) ;
//获取货架的所有货位
//查询该货区下的总货位
locationsnubVO num1 = this . getNum ( goodsAreaId , goodsShelfId ) ;
locationsnubVO num1 = this . getNum ( null , goodsAreaId , goodsShelfId ) ;
Func . copy ( num1 , warehouseShelfVO ) ;
//查询所有包件数量
Integer num = warehouseUpdownGoodsService . selectCountNumByshelf ( goodsAreaId , goodsShelfId ) ;
@ -295,8 +295,9 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
}
@Override
public locationsnubVO selectlocationsnub ( ) {
locationsnubVO locationsnubVO = this . getNum ( null , null ) ;
public locationsnubVO selectlocationsnub ( Long warehouseId ) {
// locationsnubVO locationsnubVO = this.getNum(null,null);
locationsnubVO locationsnubVO = this . getNum ( warehouseId , null , null ) ;
return locationsnubVO ;
}
@ -307,7 +308,7 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
ArrayList < WarehouseCargoSumVO > list = new ArrayList < > ( ) ;
for ( Long id : ids ) {
WarehouseCargoSumVO warehouseCargoSumVO = new WarehouseCargoSumVO ( ) ;
locationsnubVO locationsnubVO = this . getNum ( id , null ) ;
locationsnubVO locationsnubVO = this . getNum ( null , id , null ) ;
Func . copy ( locationsnubVO , warehouseCargoSumVO ) ;
warehouseCargoSumVO . setId ( id ) ;
list . add ( warehouseCargoSumVO ) ;
@ -315,41 +316,53 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
return list ;
}
public locationsnubVO getNum ( Long areaId , Long shelfId ) {
locationsnubVO locationsnubVO = new locationsnubVO ( ) ;
//查询该货区下的总货位(除开备货区)
Integer cargoNub = baseMapper . selectCount ( new QueryWrapper < WarehouseGoodsAllocationEntity > ( ) . lambda ( )
. eq ( WarehouseGoodsAllocationEntity : : getIsDeleted , 0 )
. eq ( null ! = areaId , WarehouseGoodsAllocationEntity : : getGoodsAreaId , areaId )
. eq ( null ! = shelfId , WarehouseGoodsAllocationEntity : : getGoodsShelfId , shelfId )
) . intValue ( ) ;
//查询所有使用货位(除开备货区)
Integer employNub = baseMapper . selectCount ( new QueryWrapper < WarehouseGoodsAllocationEntity > ( ) . lambda ( )
. eq ( WarehouseGoodsAllocationEntity : : getIsDeleted , 0 )
. eq ( WarehouseGoodsAllocationEntity : : getAllocationStatus , 2 )
. eq ( null ! = areaId , WarehouseGoodsAllocationEntity : : getGoodsAreaId , areaId )
. eq ( null ! = shelfId , WarehouseGoodsAllocationEntity : : getGoodsShelfId , shelfId )
) . intValue ( ) ;
//查询所有禁用(除开备货区)
Integer disableNub = baseMapper . selectCount ( new QueryWrapper < WarehouseGoodsAllocationEntity > ( ) . lambda ( )
. eq ( WarehouseGoodsAllocationEntity : : getIsDeleted , 0 )
. eq ( WarehouseGoodsAllocationEntity : : getEnableStatus , 2 )
. eq ( null ! = areaId , WarehouseGoodsAllocationEntity : : getGoodsAreaId , areaId )
. eq ( null ! = shelfId , WarehouseGoodsAllocationEntity : : getGoodsShelfId , shelfId )
) . intValue ( ) ;
//查询可用货位(除开备货区)
Integer unusedNub = baseMapper . selectCount ( new QueryWrapper < WarehouseGoodsAllocationEntity > ( ) . lambda ( )
. eq ( WarehouseGoodsAllocationEntity : : getIsDeleted , 0 )
. eq ( WarehouseGoodsAllocationEntity : : getEnableStatus , 1 )
. eq ( WarehouseGoodsAllocationEntity : : getAllocationStatus , 1 )
. eq ( null ! = areaId , WarehouseGoodsAllocationEntity : : getGoodsAreaId , areaId )
. eq ( null ! = shelfId , WarehouseGoodsAllocationEntity : : getGoodsShelfId , shelfId )
) . intValue ( ) ;
locationsnubVO . setCargoNub ( cargoNub ) ;
locationsnubVO . setEmployNub ( employNub ) ;
locationsnubVO . setDisableNub ( disableNub ) ;
locationsnubVO . setUnusedNub ( unusedNub ) ;
return locationsnubVO ;
public locationsnubVO getNum ( Long warehouseId , Long areaId , Long shelfId ) {
if ( null = = warehouseId ) {
locationsnubVO locationsnubVO = new locationsnubVO ( ) ;
//查询该货区下的总货位(除开备货区)
Integer cargoNub = baseMapper . selectCount ( new QueryWrapper < WarehouseGoodsAllocationEntity > ( ) . lambda ( )
. eq ( WarehouseGoodsAllocationEntity : : getIsDeleted , 0 )
. eq ( null ! = areaId , WarehouseGoodsAllocationEntity : : getGoodsAreaId , areaId )
. eq ( null ! = shelfId , WarehouseGoodsAllocationEntity : : getGoodsShelfId , shelfId )
) . intValue ( ) ;
//查询所有使用货位(除开备货区)
Integer employNub = baseMapper . selectCount ( new QueryWrapper < WarehouseGoodsAllocationEntity > ( ) . lambda ( )
. eq ( WarehouseGoodsAllocationEntity : : getIsDeleted , 0 )
. eq ( WarehouseGoodsAllocationEntity : : getAllocationStatus , 2 )
. eq ( null ! = areaId , WarehouseGoodsAllocationEntity : : getGoodsAreaId , areaId )
. eq ( null ! = shelfId , WarehouseGoodsAllocationEntity : : getGoodsShelfId , shelfId )
) . intValue ( ) ;
//查询所有禁用(除开备货区)
Integer disableNub = baseMapper . selectCount ( new QueryWrapper < WarehouseGoodsAllocationEntity > ( ) . lambda ( )
. eq ( WarehouseGoodsAllocationEntity : : getIsDeleted , 0 )
. eq ( WarehouseGoodsAllocationEntity : : getEnableStatus , 2 )
. eq ( null ! = areaId , WarehouseGoodsAllocationEntity : : getGoodsAreaId , areaId )
. eq ( null ! = shelfId , WarehouseGoodsAllocationEntity : : getGoodsShelfId , shelfId )
) . intValue ( ) ;
//查询可用货位(除开备货区)
Integer unusedNub = baseMapper . selectCount ( new QueryWrapper < WarehouseGoodsAllocationEntity > ( ) . lambda ( )
. eq ( WarehouseGoodsAllocationEntity : : getIsDeleted , 0 )
. eq ( WarehouseGoodsAllocationEntity : : getEnableStatus , 1 )
. eq ( WarehouseGoodsAllocationEntity : : getAllocationStatus , 1 )
. eq ( null ! = areaId , WarehouseGoodsAllocationEntity : : getGoodsAreaId , areaId )
. eq ( null ! = shelfId , WarehouseGoodsAllocationEntity : : getGoodsShelfId , shelfId )
) . intValue ( ) ;
locationsnubVO . setCargoNub ( cargoNub ) ;
locationsnubVO . setEmployNub ( employNub ) ;
locationsnubVO . setDisableNub ( disableNub ) ;
locationsnubVO . setUnusedNub ( unusedNub ) ;
return locationsnubVO ;
} else {
locationsnubVO locationsnubVO = baseMapper . selectAllocationNumInfo ( warehouseId , areaId , shelfId ) ;
return locationsnubVO ;
}
}
@Override
@ -372,7 +385,7 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
warehouseGoodsAllocationVOList = warehouseGoodsAllocationVOList . stream ( ) . map ( obj - > obj . getId ( ) . equals ( warehouseGoodsAllocationVO . getId ( ) ) ? warehouseGoodsAllocationVO : obj ) . collect ( Collectors . toList ( ) ) ;
//计算数量
//查询该货区下的总货位
locationsnubVO num1 = this . getNum ( goodsAreaId , goodsShelfId ) ;
locationsnubVO num1 = this . getNum ( null , goodsAreaId , goodsShelfId ) ;
Func . copy ( num1 , warehouseShelfVO ) ;
Integer num = warehouseUpdownGoodsService . selectCountNumByshelf ( goodsAreaId , goodsShelfId ) ;
warehouseShelfVO . setGoodsNub ( null = = num ? 0 : num ) ;