Browse Source

1.取消首页的缓存数据

master
pref_mail@163.com 6 months ago
parent
commit
9996a59c60
  1. 3
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml
  2. 111
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java

3
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml

@ -125,11 +125,10 @@
IFNULL(sum(ldpl.weight),0) handleWeight,
IFNULL(sum(ldpl.volume),0) handleVolume
from logpm_distribution_parcel_list ldpl
left join logpm_distribution_stock_article ldsa on ldsa.id = ldpl.stock_article_id
left join logpm_warehouse_waybill lww on ldpl.waybill_number = lww.waybill_no and lww.departure_warehouse_id =
ldpl.warehouse_id
where 1=1
and ldsa.is_zero = 0
and ldpl.order_package_code != null
and ldpl.order_package_status = '20'
and ldpl.warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">

111
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java

@ -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;
}

Loading…
Cancel
Save