|
|
|
@ -119,26 +119,26 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
|
|
|
|
|
public IndexHandOrderDataVO handOrderData(IndexDTO indexDTO) { |
|
|
|
|
//增加缓存
|
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
String key = CacheNames.tenantKey(user.getTenantId(), user.getUserId() + "", "handOrderData"); |
|
|
|
|
IndexHandOrderDataVO indexHandOrderDataVO = bladeRedis.get(key); |
|
|
|
|
|
|
|
|
|
if (Objects.isNull(indexHandOrderDataVO)) { |
|
|
|
|
List<Long> warehouseIds = indexDTO.getWarehouseIds(); |
|
|
|
|
indexHandOrderDataVO = new IndexHandOrderDataVO(); |
|
|
|
|
if (warehouseIds.isEmpty()) { |
|
|
|
|
return indexHandOrderDataVO; |
|
|
|
|
} |
|
|
|
|
//当前在库的数据 订制品 零担
|
|
|
|
|
indexHandOrderDataVO = warehouseIndexMapper.handOrderData(indexDTO); |
|
|
|
|
//当前在库的库存品
|
|
|
|
|
Integer stockListNum = warehouseIndexMapper.findHandStockListNum(indexDTO); |
|
|
|
|
indexHandOrderDataVO.setTotalNum(indexHandOrderDataVO.getTotalNum() + stockListNum); |
|
|
|
|
|
|
|
|
|
//已打托数量
|
|
|
|
|
Integer trayNum = warehouseIndexMapper.findTrayNum(indexDTO); |
|
|
|
|
indexHandOrderDataVO.setTrayNum(trayNum); |
|
|
|
|
bladeRedis.setEx(key, indexHandOrderDataVO, 3600L); |
|
|
|
|
// String key = CacheNames.tenantKey(user.getTenantId(), user.getUserId() + "", "handOrderData");
|
|
|
|
|
// IndexHandOrderDataVO indexHandOrderDataVO = bladeRedis.get(key);
|
|
|
|
|
//
|
|
|
|
|
// if (Objects.isNull(indexHandOrderDataVO)) {
|
|
|
|
|
List<Long> warehouseIds = indexDTO.getWarehouseIds(); |
|
|
|
|
IndexHandOrderDataVO indexHandOrderDataVO = new IndexHandOrderDataVO(); |
|
|
|
|
if (warehouseIds.isEmpty()) { |
|
|
|
|
return indexHandOrderDataVO; |
|
|
|
|
} |
|
|
|
|
//当前在库的数据 订制品 零担
|
|
|
|
|
indexHandOrderDataVO = warehouseIndexMapper.handOrderData(indexDTO); |
|
|
|
|
//当前在库的库存品
|
|
|
|
|
Integer stockListNum = warehouseIndexMapper.findHandStockListNum(indexDTO); |
|
|
|
|
indexHandOrderDataVO.setTotalNum(indexHandOrderDataVO.getTotalNum() + stockListNum); |
|
|
|
|
|
|
|
|
|
//已打托数量
|
|
|
|
|
Integer trayNum = warehouseIndexMapper.findTrayNum(indexDTO); |
|
|
|
|
indexHandOrderDataVO.setTrayNum(trayNum); |
|
|
|
|
// bladeRedis.setEx(key, indexHandOrderDataVO, 3600L);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return indexHandOrderDataVO; |
|
|
|
@ -148,49 +148,49 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
|
|
|
|
|
public IndexAllocationDataVO allocationData(IndexDTO indexDTO) { |
|
|
|
|
|
|
|
|
|
//增加缓存
|
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
String key = CacheNames.tenantKey(user.getTenantId(), user.getUserId() + "", "allocationData"); |
|
|
|
|
IndexAllocationDataVO indexAllocationDataVO = bladeRedis.get(key); |
|
|
|
|
|
|
|
|
|
if (Objects.isNull(indexAllocationDataVO)) { |
|
|
|
|
List<Long> warehouseIds = indexDTO.getWarehouseIds(); |
|
|
|
|
indexAllocationDataVO = new IndexAllocationDataVO(); |
|
|
|
|
if (warehouseIds.isEmpty()) { |
|
|
|
|
return indexAllocationDataVO; |
|
|
|
|
} |
|
|
|
|
//当前在库的数据 订制品 零担
|
|
|
|
|
IndexHandOrderDataVO indexHandOrderDataVO = warehouseIndexMapper.handOrderData(indexDTO); |
|
|
|
|
//当前在库的库存品
|
|
|
|
|
Integer stockListNum = warehouseIndexMapper.findHandStockListNum(indexDTO); |
|
|
|
|
Integer totalNum = indexHandOrderDataVO.getTotalNum() + stockListNum; |
|
|
|
|
|
|
|
|
|
//查询库位总数
|
|
|
|
|
Integer totalAllocationNum = warehouseIndexMapper.findTotalAllocationNum(indexDTO); |
|
|
|
|
//已使用库位数
|
|
|
|
|
Integer useAllocationNum = warehouseIndexMapper.findUseAllocationNum(indexDTO); |
|
|
|
|
//已上架件数
|
|
|
|
|
Integer upshelfNum = warehouseIndexMapper.findUpshelfNum(indexDTO); |
|
|
|
|
|
|
|
|
|
indexAllocationDataVO.setTotalNum(totalAllocationNum); |
|
|
|
|
indexAllocationDataVO.setUseNum(useAllocationNum); |
|
|
|
|
indexAllocationDataVO.setNullNum(totalAllocationNum - useAllocationNum); |
|
|
|
|
indexAllocationDataVO.setUpshelfNum(upshelfNum); |
|
|
|
|
indexAllocationDataVO.setNoUpshelfNum(totalNum - upshelfNum); |
|
|
|
|
bladeRedis.setEx(key, indexAllocationDataVO, 3600L); |
|
|
|
|
// BladeUser user = AuthUtil.getUser();
|
|
|
|
|
// String key = CacheNames.tenantKey(user.getTenantId(), user.getUserId() + "", "allocationData");
|
|
|
|
|
// IndexAllocationDataVO indexAllocationDataVO = bladeRedis.get(key);
|
|
|
|
|
//
|
|
|
|
|
// if (Objects.isNull(indexAllocationDataVO)) {
|
|
|
|
|
List<Long> warehouseIds = indexDTO.getWarehouseIds(); |
|
|
|
|
IndexAllocationDataVO indexAllocationDataVO = new IndexAllocationDataVO(); |
|
|
|
|
if (warehouseIds.isEmpty()) { |
|
|
|
|
return indexAllocationDataVO; |
|
|
|
|
} |
|
|
|
|
//当前在库的数据 订制品 零担
|
|
|
|
|
IndexHandOrderDataVO indexHandOrderDataVO = warehouseIndexMapper.handOrderData(indexDTO); |
|
|
|
|
//当前在库的库存品
|
|
|
|
|
Integer stockListNum = warehouseIndexMapper.findHandStockListNum(indexDTO); |
|
|
|
|
Integer totalNum = indexHandOrderDataVO.getTotalNum() + stockListNum; |
|
|
|
|
|
|
|
|
|
//查询库位总数
|
|
|
|
|
Integer totalAllocationNum = warehouseIndexMapper.findTotalAllocationNum(indexDTO); |
|
|
|
|
//已使用库位数
|
|
|
|
|
Integer useAllocationNum = warehouseIndexMapper.findUseAllocationNum(indexDTO); |
|
|
|
|
//已上架件数
|
|
|
|
|
Integer upshelfNum = warehouseIndexMapper.findUpshelfNum(indexDTO); |
|
|
|
|
|
|
|
|
|
indexAllocationDataVO.setTotalNum(totalAllocationNum); |
|
|
|
|
indexAllocationDataVO.setUseNum(useAllocationNum); |
|
|
|
|
indexAllocationDataVO.setNullNum(totalAllocationNum - useAllocationNum); |
|
|
|
|
indexAllocationDataVO.setUpshelfNum(upshelfNum); |
|
|
|
|
indexAllocationDataVO.setNoUpshelfNum(totalNum - upshelfNum); |
|
|
|
|
// bladeRedis.setEx(key, indexAllocationDataVO, 3600L);
|
|
|
|
|
// }
|
|
|
|
|
return indexAllocationDataVO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IndexTrunklineHandOrderDataVO trunklineHandOrderData(IndexDTO indexDTO) { |
|
|
|
|
|
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
String key = CacheNames.tenantKey(user.getTenantId(), user.getUserId() + "", "trunklineHandOrderData"); |
|
|
|
|
IndexTrunklineHandOrderDataVO indexTrunklineHandOrderDataVO = bladeRedis.get(key); |
|
|
|
|
|
|
|
|
|
if (Objects.isNull(indexTrunklineHandOrderDataVO)) { |
|
|
|
|
// BladeUser user = AuthUtil.getUser();
|
|
|
|
|
// String key = CacheNames.tenantKey(user.getTenantId(), user.getUserId() + "", "trunklineHandOrderData");
|
|
|
|
|
// IndexTrunklineHandOrderDataVO indexTrunklineHandOrderDataVO = bladeRedis.get(key);
|
|
|
|
|
//
|
|
|
|
|
// if (Objects.isNull(indexTrunklineHandOrderDataVO)) {
|
|
|
|
|
List<Long> warehouseIds = indexDTO.getWarehouseIds(); |
|
|
|
|
indexTrunklineHandOrderDataVO = new IndexTrunklineHandOrderDataVO(); |
|
|
|
|
IndexTrunklineHandOrderDataVO indexTrunklineHandOrderDataVO = new IndexTrunklineHandOrderDataVO(); |
|
|
|
|
if (warehouseIds.isEmpty()) { |
|
|
|
|
return indexTrunklineHandOrderDataVO; |
|
|
|
|
} |
|
|
|
@ -212,8 +212,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
|
|
|
|
|
indexTrunklineHandOrderDataVO.setHandleNum(packageHandleNum + zeroHandleNum); |
|
|
|
|
indexTrunklineHandOrderDataVO.setHandleWeight(packageHandleWeight.add(zeroHandleWeight)); |
|
|
|
|
indexTrunklineHandOrderDataVO.setHandleVolume(packageHandleVolume.add(zeroHandleVolume)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
return indexTrunklineHandOrderDataVO; |
|
|
|
|
} |
|
|
|
|