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

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

订单关闭接口修改

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