创建订单发送库存预警
This commit is contained in:
parent
b1199d80ae
commit
dcec5e01f3
|
|
@ -234,7 +234,6 @@ public class OrderService {
|
|||
redisUtil.saveMessage("SHOP:CODE:SET" + clientType + ":" + shopId + ":" + DateUtils.getDay(),masterId.substring(1,masterId.length()));
|
||||
|
||||
|
||||
CompletableFuture.runAsync(() -> checkWarnLineAndSendMsg(skuWithBLOBs, product, shopInfo, number));
|
||||
|
||||
return Result.success(CodeEnum.SUCCESS, masterId);
|
||||
}
|
||||
|
|
@ -244,7 +243,8 @@ public class OrderService {
|
|||
*
|
||||
* @param productSku sku
|
||||
*/
|
||||
private void checkWarnLineAndSendMsg(TbProductSku productSku, TbProduct product, TbShopInfo shopInfo, Integer num) {
|
||||
private void checkWarnLineAndSendMsg(TbProductSku productSku, TbProduct product, Integer shopId, Integer num) {
|
||||
TbShopInfo shopInfo = tbShopInfoMapper.selectByPrimaryKey(shopId);
|
||||
if (productSku.getWarnLine() == null) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -486,6 +486,12 @@ public class OrderService {
|
|||
}
|
||||
boolean flag = true;
|
||||
for (TbCashierCart cashierCart : list) {
|
||||
TbProductWithBLOBs product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId()));
|
||||
TbProductSkuWithBLOBs skuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getSkuId()));
|
||||
|
||||
log.info("下单,开始校验库存预警,购物车id:{}", cashierCart.getId());
|
||||
CompletableFuture.runAsync(() -> checkWarnLineAndSendMsg(skuWithBLOBs, product, Integer.valueOf(cashierCart.getShopId()), cashierCart.getNumber()));
|
||||
|
||||
// 已经添加的商品,修改数量
|
||||
if (StringUtils.isNotEmpty(cashierCart.getOrderId())) {
|
||||
flag = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue