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

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

提交

parent e435dbae
...@@ -166,6 +166,8 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS ...@@ -166,6 +166,8 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
@Override @Override
public ResponseDto<String> purchasingSkuList(String marketId, String storeId, int page) { public ResponseDto<String> purchasingSkuList(String marketId, String storeId, int page) {
List<String> spuIds = goblinRedisUtils.getStoreMarketIsConfig(marketId, storeId);
return null; return null;
} }
...@@ -224,7 +226,7 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS ...@@ -224,7 +226,7 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
goblinRedisUtils.setGoodsInfoVo(spuVo); goblinRedisUtils.setGoodsInfoVo(spuVo);
relationVo.setSkuList(skuList); relationVo.setSkuList(skuList);
goblinRedisUtils.addMarketRelation(GoblinStatusConst.MarketPreStatus.MARKET_PRE_PURCHASE.getValue(), params.getStoreMarketId(), relationVo); goblinRedisUtils.addMarketRelation(GoblinStatusConst.MarketPreStatus.MARKET_PRE_PURCHASE.getValue(), params.getStoreMarketId(), relationVo);
goblinRedisUtils.addStoreMarketIsConfig(params.getStoreMarketId(), params.getStoreId(), params.getSpuId()); goblinRedisUtils.addStoreMarketIsConfig(params.getStoreMarketId(), params.getStoreId(), params.getSpuId(),marketSpuId);
// 执行sql // 执行sql
String sqlData = SqlMapping.gets(sqls, sqlsData); String sqlData = SqlMapping.gets(sqls, sqlsData);
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_STORE_MARKET.getKey(), queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_STORE_MARKET.getKey(),
...@@ -289,7 +291,7 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS ...@@ -289,7 +291,7 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
//redis //redis
goblinRedisUtils.delGoodsInfoVo(marketSpuId); goblinRedisUtils.delGoodsInfoVo(marketSpuId);
goblinRedisUtils.removeMarketRelation(GoblinStatusConst.MarketPreStatus.MARKET_PRE_PURCHASE.getValue(), marketId, spuId); goblinRedisUtils.removeMarketRelation(GoblinStatusConst.MarketPreStatus.MARKET_PRE_PURCHASE.getValue(), marketId, spuId);
goblinRedisUtils.delStoreMarketIsConfig(marketId, storeId, spuId); goblinRedisUtils.delStoreMarketIsConfig(marketId, storeId, spuId,marketSpuId);
//mysql //mysql
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_STORE_MARKET.getKey(), queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_STORE_MARKET.getKey(),
SqlMapping.get("goblin.store.market.delSpuRelation", bean.getDelFlag(), bean.getUpdatedAt(), marketId, storeId, spuId)); SqlMapping.get("goblin.store.market.delSpuRelation", bean.getDelFlag(), bean.getUpdatedAt(), marketId, storeId, spuId));
......
...@@ -112,28 +112,35 @@ public class GoblinRedisUtils { ...@@ -112,28 +112,35 @@ public class GoblinRedisUtils {
redisUtil.del(redisKey); redisUtil.del(redisKey);
} }
public List<String> getStoreMarketIsConfig(String marketId,String storeId){
/**
* 获取 配置的商铺id
*
* @param marketId
* @param storeId
*/
public List<String> getStoreMarketIsConfig(String marketId, String storeId) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_STORE_MARKET_ISCONFIG.concat(marketId).concat(":store_id:" + storeId); String redisKey = GoblinRedisConst.REDIS_GOBLIN_STORE_MARKET_ISCONFIG.concat(marketId).concat(":store_id:" + storeId);
Object obj = redisUtil.get(redisKey); Object obj = redisUtil.get(redisKey);
if(obj==null){ if (obj == null) {
return CollectionUtil.arrayListString(); return CollectionUtil.arrayListString();
}else{ } else {
return (List<String>) obj; return (List<String>) obj;
} }
} }
public void addStoreMarketIsConfig(String marketId,String storeId,String spuId){ public void addStoreMarketIsConfig(String marketId, String storeId, String spuId,String marketSpuId) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_STORE_MARKET_ISCONFIG.concat(marketId).concat(":store_id:" + storeId); String redisKey = GoblinRedisConst.REDIS_GOBLIN_STORE_MARKET_ISCONFIG.concat(marketId).concat(":store_id:" + storeId);
List<String> voList = getStoreMarketIsConfig(marketId,storeId); List<String> voList = getStoreMarketIsConfig(marketId, storeId);
voList.add(spuId); voList.add(spuId+","+marketSpuId);
redisUtil.set(redisKey,voList); redisUtil.set(redisKey, voList);
} }
public void delStoreMarketIsConfig(String marketId,String storeId,String spuId){ public void delStoreMarketIsConfig(String marketId, String storeId, String spuId,String marketSpuId) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_STORE_MARKET_ISCONFIG.concat(marketId).concat(":store_id:" + storeId); String redisKey = GoblinRedisConst.REDIS_GOBLIN_STORE_MARKET_ISCONFIG.concat(marketId).concat(":store_id:" + storeId);
List<String> voList = getStoreMarketIsConfig(marketId,storeId); List<String> voList = getStoreMarketIsConfig(marketId, storeId);
voList.remove(spuId); voList.remove(spuId+","+marketSpuId);
redisUtil.set(redisKey,voList); redisUtil.set(redisKey, voList);
} }
/** /**
......
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