记得上下班打卡 | git大法好,push需谨慎

Commit 2de2e50b authored by 胡佳晨's avatar 胡佳晨

订单关闭接口修改

parent d6aad6c6
...@@ -110,6 +110,8 @@ public class GoblinStoreOrderVo implements Serializable, Cloneable { ...@@ -110,6 +110,8 @@ public class GoblinStoreOrderVo implements Serializable, Cloneable {
private String marketId; private String marketId;
@ApiModelProperty(value = " 创建时间") @ApiModelProperty(value = " 创建时间")
private String createdAt; private String createdAt;
@ApiModelProperty(value = " 创建时间")
private int randomKey;
@ApiModelProperty(value = "orderAttr") @ApiModelProperty(value = "orderAttr")
private GoblinOrderAttrVo orderAttrVo; private GoblinOrderAttrVo orderAttrVo;
......
...@@ -570,7 +570,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -570,7 +570,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
redisUtils.setGoblinOrder(orderId, orderVo); redisUtils.setGoblinOrder(orderId, orderVo);
redisUtils.setOffCode(orderVo.getWriteOffCode(), orderVo.getMasterOrderCode()); redisUtils.setOffCode(orderVo.getWriteOffCode(), orderVo.getMasterOrderCode());
//删除未支付订单 //删除未支付订单
redisUtils.removeGoblinOrder(null, orderId); redisUtils.removeGoblinOrder(orderVo.getRandomKey()+"", orderId);
//mongo //mongo
mongoUtils.updateGoblinStoreOrderVo(orderId, orderVo); mongoUtils.updateGoblinStoreOrderVo(orderId, orderVo);
//mysql //mysql
......
...@@ -514,15 +514,16 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -514,15 +514,16 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
//订单attr vo //订单attr vo
GoblinOrderAttrVo orderAttrVo = GoblinOrderAttrVo.getNew(); GoblinOrderAttrVo orderAttrVo = GoblinOrderAttrVo.getNew();
BeanUtils.copyProperties(orderAttr, orderAttrVo); BeanUtils.copyProperties(orderAttr, orderAttrVo);
//redis 添加未支付列表
int randomKey = redisUtils.addUnPayOrder(orderVo.getOrderId());
//redis 赋值 //redis 赋值
orderVo.setRandomKey(randomKey);
orderVo.setOrderAttrVo(orderAttrVo); orderVo.setOrderAttrVo(orderAttrVo);
orderVo.setOrderSkuVoIds(goblinOrderSkuIdList); orderVo.setOrderSkuVoIds(goblinOrderSkuIdList);
orderVo.setCreatedAt(getNowTime()); orderVo.setCreatedAt(getNowTime());
redisUtils.setGoblinOrder(orderVo.getOrderId(), orderVo); redisUtils.setGoblinOrder(orderVo.getOrderId(), orderVo);
redisUtils.setMasterCode(preParam.getOrderMasterCode(), preParam.getOrderIdList().substring(1)); redisUtils.setMasterCode(preParam.getOrderMasterCode(), preParam.getOrderIdList().substring(1));
mongoUtils.insertGoblinStoreOrderVo(orderVo); mongoUtils.insertGoblinStoreOrderVo(orderVo);
//redis 添加未支付列表
redisUtils.addUnPayOrder(orderVo.getOrderId());
//redis 订单列表 //redis 订单列表
if (noZhengzaiOrder(uid)) { if (noZhengzaiOrder(uid)) {
if (orderVo.getMarketType() == null) { if (orderVo.getMarketType() == null) {
...@@ -746,7 +747,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -746,7 +747,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
redisUtils.setGoblinOrder(orderId, orderVo); redisUtils.setGoblinOrder(orderId, orderVo);
redisUtils.setOffCode(orderVo.getWriteOffCode(), orderVo.getMasterOrderCode()); redisUtils.setOffCode(orderVo.getWriteOffCode(), orderVo.getMasterOrderCode());
//删除未支付订单 //删除未支付订单
redisUtils.removeGoblinOrder(null, orderId); redisUtils.removeGoblinOrder(orderVo.getRandomKey()+"", orderId);
//mongo //mongo
mongoUtils.updateGoblinStoreOrderVo(orderId, orderVo); mongoUtils.updateGoblinStoreOrderVo(orderId, orderVo);
//mysql //mysql
......
...@@ -328,7 +328,7 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService { ...@@ -328,7 +328,7 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
redisUtils.incrSkuStock(null, skuId, restStock + restStockDe); redisUtils.incrSkuStock(null, skuId, restStock + restStockDe);
mongoUtils.delGoodsSkuInfoVo(marketSkuId); mongoUtils.delGoodsSkuInfoVo(marketSkuId);
redisUtils.delGoodsSkuInfoVo(marketSkuId); redisUtils.delGoodsSkuInfoVo(marketSkuId);
redisUtils.removeGoblinOrder(skuId, marketSkuId); redisUtils.removeGoblinOrder(null, marketSkuId);
} }
//mongo //mongo
mongoUtils.delGoodsInfoVo(marketSpuId); mongoUtils.delGoodsInfoVo(marketSpuId);
......
...@@ -804,13 +804,14 @@ public class GoblinRedisUtils { ...@@ -804,13 +804,14 @@ public class GoblinRedisUtils {
} }
} }
// 添加 未支付订单id列表 // 添加 未支付订单id列表 返回 radomKey
public void addUnPayOrder(String orderId) { public int addUnPayOrder(String orderId) {
int randomKey = RandomUtil.getRandomInt(0, randomMax); int randomKey = RandomUtil.getRandomInt(0, randomMax);
String redisKey = GoblinRedisConst.REDIS_GOBLIN_ORDER_UN_PAY.concat(randomKey + ""); String redisKey = GoblinRedisConst.REDIS_GOBLIN_ORDER_UN_PAY.concat(randomKey + "");
List<String> list = getUnPayOrder(randomKey + ""); List<String> list = getUnPayOrder(randomKey + "");
list.add(orderId); list.add(orderId);
redisUtil.set(redisKey, list); redisUtil.set(redisKey, list);
return randomKey;
} }
// 删除 未支付订单id列表 // 删除 未支付订单id列表
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment