Browse Source

订单操作缓存限制时间修改为一分钟

pull/12/head
汤建军 1 year ago
parent
commit
0fe7e786e1
  1. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  2. 18
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -2940,8 +2940,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (flag){
throw new RuntimeException(s.getOrderCode()+"正在操作,请刷新后尝试");
}else {
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + s.getOrderCode(),packageLockIds,5*60L);
packageLockIds.addAll(a);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + s.getOrderCode(),packageLockIds,1*60L);
}
}else {
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + s.getOrderCode(),packageLockIds,1*60L);
}
}
});

18
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -1687,7 +1687,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
int indexOf = ids.indexOf(parcelListEntity.getId());
if (indexOf>0){
ids.remove(indexOf);
bladeRedis.set("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + parcelListEntity.getOrderCode(),ids);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + parcelListEntity.getOrderCode(),ids,1*60L);
}
}
//移除缓存
@ -1802,8 +1802,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
throw new RuntimeException(v.get(0).getOrderCode()+"正在操作,请刷新后尝试");
}else {
packageLockIds.addAll(a);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + v.get(0).getOrderCode(),packageLockIds,5*60L);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + v.get(0).getOrderCode(),packageLockIds,1*60L);
}
}else {
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + v.get(0).getOrderCode(),packageLockIds,1*60L);
}
}
});
@ -2356,9 +2358,13 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
if (flag){
log.info("###################商配存在同时操作订单,订单号:" + s.getOrderCode() + "###################");
throw new RuntimeException(s.getOrderCode()+"正在操作,请刷新后尝试");
}else {
packageLockIds.addAll(a);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + s.getOrderCode(),packageLockIds,1*60L);
}
}else {
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + s.getOrderCode(),packageLockIds,5*60L);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + s.getOrderCode(),packageLockIds,1*60L);
}
}
});
@ -3390,10 +3396,12 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//当前操作包件存在于缓存中,此次操作无效
throw new RuntimeException(s.getOrderCode()+"正在操作,请刷新后尝试");
}else {
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + s.getOrderCode(),packageLockIds,5*60L);
packageLockIds.addAll(a);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + s.getOrderCode(),packageLockIds,1*60L);
}
}else {
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId()+"orderCode:" + s.getOrderCode(),packageLockIds,5*60L);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + s.getOrderCode(),packageLockIds,1*60L);
}
}
});

Loading…
Cancel
Save