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

Commit 903a4eb9 authored by 张国柄's avatar 张国柄

opt;

parent 67c8d4ec
...@@ -352,20 +352,21 @@ public class GoblinStoreMgtGoodsController { ...@@ -352,20 +352,21 @@ public class GoblinStoreMgtGoodsController {
beUpdateSpuSpecFlg = true; beUpdateSpuSpecFlg = true;
specValues.add(GoblinGoodsSpecValueVo.getNew().setSpecVname(newSpecVname).setSpecVsort(specValues.size() + 2)); specValues.add(GoblinGoodsSpecValueVo.getNew().setSpecVname(newSpecVname).setSpecVsort(specValues.size() + 2));
}
boolean toDelOldSpecVnameFlg = true;// 其他SKU中只要存在该规格值,即不可删除该规格值 boolean toDelOldSpecVnameFlg = true;// 其他SKU中只要存在该规格值,即不可删除该规格值
Set<Map.Entry<String, List<GoblinGoodsSpecDto>>> entries = otherSkuSpecListMap.entrySet(); Set<Map.Entry<String, List<GoblinGoodsSpecDto>>> entries = otherSkuSpecListMap.entrySet();
for (Map.Entry<String, List<GoblinGoodsSpecDto>> ent : entries) { for (Map.Entry<String, List<GoblinGoodsSpecDto>> ent : entries) {
for (GoblinGoodsSpecDto specDto : ent.getValue()) { for (GoblinGoodsSpecDto specDto : ent.getValue()) {
if (specDto.getSpecName().equals(specName) && specDto.getSpecVname().equals(oldSpecVname)) { if (specDto.getSpecName().equals(specName) && specDto.getSpecVname().equals(oldSpecVname)) {
toDelOldSpecVnameFlg = false; toDelOldSpecVnameFlg = false;
}
} }
} }
if (toDelOldSpecVnameFlg) { }
specValues.removeIf(rmr -> rmr.getSpecVname().equals(oldSpecVname)); if (toDelOldSpecVnameFlg) {
delSpuSpecMap.put(specName, oldSpecVname); specValues.removeIf(rmr -> rmr.getSpecVname().equals(oldSpecVname));
} delSpuSpecMap.put(specName, oldSpecVname);
beUpdateSpuSpecFlg = true;
} }
} }
} }
......
...@@ -77,7 +77,7 @@ public class GoblinRedisUtils { ...@@ -77,7 +77,7 @@ public class GoblinRedisUtils {
List<GoblinSelfTagVo> vos; List<GoblinSelfTagVo> vos;
if (valStrIsEmptyFlg) { if (valStrIsEmptyFlg) {
if (!CollectionUtils.isEmpty(vos = goblinMongoUtils.getSelfTagVos("0"))) { if (!CollectionUtils.isEmpty(vos = goblinMongoUtils.getSelfTagVos("0"))) {
// redisUtil.set(GoblinRedisConst.BASIC_SELF_GOODS_TAG, JsonUtils.toJson(vos));// TODO: 2022/1/17 zhanggb== redisUtil.set(GoblinRedisConst.BASIC_SELF_GOODS_TAG, JsonUtils.toJson(vos));
} }
} else { } else {
vos = JsonUtils.fromJson(valStr, new TypeReference<List<GoblinSelfTagVo>>() { vos = JsonUtils.fromJson(valStr, new TypeReference<List<GoblinSelfTagVo>>() {
...@@ -92,7 +92,7 @@ public class GoblinRedisUtils { ...@@ -92,7 +92,7 @@ public class GoblinRedisUtils {
List<GoblinSelfTagVo> vos; List<GoblinSelfTagVo> vos;
if (valStrIsEmptyFlg) { if (valStrIsEmptyFlg) {
if (!CollectionUtils.isEmpty(vos = goblinMongoUtils.getSelfTagVos("1"))) { if (!CollectionUtils.isEmpty(vos = goblinMongoUtils.getSelfTagVos("1"))) {
// redisUtil.set(GoblinRedisConst.BASIC_SELF_GOODS_TAG, JsonUtils.toJson(vos));// TODO: 2022/1/17 zhanggb== redisUtil.set(GoblinRedisConst.BASIC_SELF_GOODS_TAG, JsonUtils.toJson(vos));
} }
} else { } else {
vos = JsonUtils.fromJson(valStr, new TypeReference<List<GoblinSelfTagVo>>() { vos = JsonUtils.fromJson(valStr, new TypeReference<List<GoblinSelfTagVo>>() {
...@@ -109,7 +109,7 @@ public class GoblinRedisUtils { ...@@ -109,7 +109,7 @@ public class GoblinRedisUtils {
List<GoblinSelfGoodsCategoryVo> vos; List<GoblinSelfGoodsCategoryVo> vos;
if (valStrIsEmptyFlg) { if (valStrIsEmptyFlg) {
if (!CollectionUtils.isEmpty(vos = goblinMongoUtils.getSelfGoodsCategoryVos())) { if (!CollectionUtils.isEmpty(vos = goblinMongoUtils.getSelfGoodsCategoryVos())) {
// redisUtil.set(GoblinRedisConst.BASIC_SELF_GOODS_CATEGORY, JsonUtils.toJson(vos));// TODO: 2022/1/17 zhanggb== redisUtil.set(GoblinRedisConst.BASIC_SELF_GOODS_CATEGORY, JsonUtils.toJson(vos));
} }
} else { } else {
vos = JsonUtils.fromJson(valStr, new TypeReference<List<GoblinSelfGoodsCategoryVo>>() { vos = JsonUtils.fromJson(valStr, new TypeReference<List<GoblinSelfGoodsCategoryVo>>() {
...@@ -131,7 +131,7 @@ public class GoblinRedisUtils { ...@@ -131,7 +131,7 @@ public class GoblinRedisUtils {
List<GoblinStoreGoodsCategoryVo> vos = null; List<GoblinStoreGoodsCategoryVo> vos = null;
if (valStrIsEmptyFlg && !CollectionUtils.isEmpty(vos = goblinMongoUtils.getStoreGoodsCategoryVos(storeId))) { if (valStrIsEmptyFlg && !CollectionUtils.isEmpty(vos = goblinMongoUtils.getStoreGoodsCategoryVos(storeId))) {
valStr = JsonUtils.toJson(vos); valStr = JsonUtils.toJson(vos);
// redisUtil.set(rk, valStr);// TODO: 2022/1/11 zhanggb== redisUtil.set(rk, valStr);
} else if (!valStrIsEmptyFlg) { } else if (!valStrIsEmptyFlg) {
vos = JsonUtils.fromJson(valStr, new TypeReference<List<GoblinStoreGoodsCategoryVo>>() { vos = JsonUtils.fromJson(valStr, new TypeReference<List<GoblinStoreGoodsCategoryVo>>() {
}); });
...@@ -149,7 +149,7 @@ public class GoblinRedisUtils { ...@@ -149,7 +149,7 @@ public class GoblinRedisUtils {
String rk = GoblinRedisConst.BASIC_SELF_GOODS_CATEGORY_SPEC.concat(cateId); String rk = GoblinRedisConst.BASIC_SELF_GOODS_CATEGORY_SPEC.concat(cateId);
GoblinMgtCategorySpecVo vo = (GoblinMgtCategorySpecVo) redisUtil.get(rk); GoblinMgtCategorySpecVo vo = (GoblinMgtCategorySpecVo) redisUtil.get(rk);
if (null == vo && null != (vo = goblinMongoUtils.getCategorySpecVo(cateId))) { if (null == vo && null != (vo = goblinMongoUtils.getCategorySpecVo(cateId))) {
// redisUtil.set(rk, vo);// TODO: 2022/1/18 zhanggb== redisUtil.set(rk, vo);
} }
return vo; return vo;
} }
...@@ -162,7 +162,7 @@ public class GoblinRedisUtils { ...@@ -162,7 +162,7 @@ public class GoblinRedisUtils {
List<GoblinServiceSupportVo> vos; List<GoblinServiceSupportVo> vos;
if (valStrIsEmptyFlg) { if (valStrIsEmptyFlg) {
if (!CollectionUtils.isEmpty(vos = goblinMongoUtils.getMgtServiceSupportVos())) { if (!CollectionUtils.isEmpty(vos = goblinMongoUtils.getMgtServiceSupportVos())) {
// redisUtil.set(GoblinRedisConst.BASIC_SERVICE_SUPPORT, JsonUtils.toJson(vos));// TODO: 2022/1/17 zhanggb== redisUtil.set(GoblinRedisConst.BASIC_SERVICE_SUPPORT, JsonUtils.toJson(vos));
} }
} else { } else {
vos = JsonUtils.fromJson(valStr, new TypeReference<List<GoblinServiceSupportVo>>() { vos = JsonUtils.fromJson(valStr, new TypeReference<List<GoblinServiceSupportVo>>() {
...@@ -209,7 +209,7 @@ public class GoblinRedisUtils { ...@@ -209,7 +209,7 @@ public class GoblinRedisUtils {
String rk = GoblinRedisConst.BASIC_STORE_CONF.concat(storeId); String rk = GoblinRedisConst.BASIC_STORE_CONF.concat(storeId);
List<GoblinStoreConfigVo> vos = (List<GoblinStoreConfigVo>) redisUtil.get(rk); List<GoblinStoreConfigVo> vos = (List<GoblinStoreConfigVo>) redisUtil.get(rk);
if (CollectionUtils.isEmpty(vos) && !CollectionUtils.isEmpty(vos = goblinMongoUtils.getStoreConfigVos(storeId))) { if (CollectionUtils.isEmpty(vos) && !CollectionUtils.isEmpty(vos = goblinMongoUtils.getStoreConfigVos(storeId))) {
// redisUtil.set(rk, vos);// TODO: 2022/1/12 zhanggb== redisUtil.set(rk, vos);
} }
return vos; return vos;
} }
...@@ -230,8 +230,7 @@ public class GoblinRedisUtils { ...@@ -230,8 +230,7 @@ public class GoblinRedisUtils {
public boolean addStoreId(String uid, String storeId) { public boolean addStoreId(String uid, String storeId) {
List<String> storeIds = this.getStoreIds(uid); List<String> storeIds = this.getStoreIds(uid);
// if (CollectionUtils.isEmpty(storeIds)) { if (CollectionUtils.isEmpty(storeIds)) {
if (CollectionUtils.isEmpty(storeIds) || storeIds.contains("1")) {// TODO: 2022/1/6 zhanggb del
storeIds = CollectionUtil.arrayListString(); storeIds = CollectionUtil.arrayListString();
} }
storeIds.add(storeId); storeIds.add(storeId);
...@@ -279,7 +278,7 @@ public class GoblinRedisUtils { ...@@ -279,7 +278,7 @@ public class GoblinRedisUtils {
String rk = GoblinRedisConst.BASIC_STORE.concat(storeId); String rk = GoblinRedisConst.BASIC_STORE.concat(storeId);
GoblinStoreInfoVo vo = (GoblinStoreInfoVo) redisUtil.get(rk); GoblinStoreInfoVo vo = (GoblinStoreInfoVo) redisUtil.get(rk);
if (null == vo && null != (vo = goblinMongoUtils.getStoreInfoVo(storeId))) { if (null == vo && null != (vo = goblinMongoUtils.getStoreInfoVo(storeId))) {
// redisUtil.set(rk, vo);// TODO: 2022/1/4 zhanggb== redisUtil.set(rk, vo);
} }
return vo; return vo;
} }
...@@ -348,7 +347,7 @@ public class GoblinRedisUtils { ...@@ -348,7 +347,7 @@ public class GoblinRedisUtils {
String rk = GoblinRedisConst.BASIC_GOODS.concat(spuId); String rk = GoblinRedisConst.BASIC_GOODS.concat(spuId);
GoblinGoodsInfoVo vo = (GoblinGoodsInfoVo) redisUtil.get(rk); GoblinGoodsInfoVo vo = (GoblinGoodsInfoVo) redisUtil.get(rk);
if (null == vo && null != (vo = goblinMongoUtils.getMgtGoodsInfoVo(spuId))) { if (null == vo && null != (vo = goblinMongoUtils.getMgtGoodsInfoVo(spuId))) {
// redisUtil.set(rk, vo);// TODO: 2022/1/4 zhanggb== redisUtil.set(rk, vo);
} }
return vo; return vo;
} }
...@@ -399,7 +398,7 @@ public class GoblinRedisUtils { ...@@ -399,7 +398,7 @@ public class GoblinRedisUtils {
String rk = GoblinRedisConst.BASIC_GOODS_SKU.concat(skuId); String rk = GoblinRedisConst.BASIC_GOODS_SKU.concat(skuId);
GoblinGoodsSkuInfoVo vo = (GoblinGoodsSkuInfoVo) redisUtil.get(rk); GoblinGoodsSkuInfoVo vo = (GoblinGoodsSkuInfoVo) redisUtil.get(rk);
if (null == vo && null != (vo = goblinMongoUtils.getMgtGoodsSkuInfoVo(skuId))) { if (null == vo && null != (vo = goblinMongoUtils.getMgtGoodsSkuInfoVo(skuId))) {
// redisUtil.set(rk, vo);// TODO: 2022/1/4 zhanggb== redisUtil.set(rk, vo);
} }
return vo; return vo;
} }
......
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