清空购物车返还耗材
This commit is contained in:
@@ -538,6 +538,7 @@ public class OrderService {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
log.info("创建订单,发送更新耗材消息,订单id:{}", orderInfo.getId());
|
||||||
//修改耗材数据
|
//修改耗材数据
|
||||||
JSONObject jsonObject=new JSONObject();
|
JSONObject jsonObject=new JSONObject();
|
||||||
jsonObject.put("orderId",orderInfo.getId());
|
jsonObject.put("orderId",orderInfo.getId());
|
||||||
@@ -801,7 +802,7 @@ public class OrderService {
|
|||||||
productService.incrStock(cashierCart.getProductId(), cashierCart.getSkuId(), Integer.parseInt(message));
|
productService.incrStock(cashierCart.getProductId(), cashierCart.getSkuId(), Integer.parseInt(message));
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotEmpty(cashierCart.getOrderId())) {
|
if (StringUtils.isNotEmpty(cashierCart.getOrderId())) {
|
||||||
orderId = Integer.valueOf(cashierCart.getOrderId());
|
orderId = Integer.parseInt(cashierCart.getOrderId());
|
||||||
|
|
||||||
}
|
}
|
||||||
TbProductWithBLOBs product= tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId()));
|
TbProductWithBLOBs product= tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId()));
|
||||||
@@ -815,6 +816,13 @@ public class OrderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (orderId > 0) {
|
if (orderId > 0) {
|
||||||
|
// 返还耗材
|
||||||
|
JSONObject jsonObject1=new JSONObject();
|
||||||
|
jsonObject1.put("orderId", orderId);
|
||||||
|
jsonObject1.put("type","delete");
|
||||||
|
log.info("清空购物车 发送返还耗材mq消息,订单id:{},消息内容:{}", orderId, jsonObject1);
|
||||||
|
producer.cons(jsonObject1.toString());
|
||||||
|
|
||||||
TbOrderInfo orderInfo = tbOrderInfoMapper.selectByPrimaryKey(orderId);
|
TbOrderInfo orderInfo = tbOrderInfoMapper.selectByPrimaryKey(orderId);
|
||||||
if (Objects.nonNull(orderInfo) && !orderInfo.getStatus().equals("pending")){
|
if (Objects.nonNull(orderInfo) && !orderInfo.getStatus().equals("pending")){
|
||||||
tbOrderInfoMapper.updateStatusById(orderId, "cancelled");
|
tbOrderInfoMapper.updateStatusById(orderId, "cancelled");
|
||||||
|
|||||||
Reference in New Issue
Block a user