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

Commit ed5845e4 authored by 胡佳晨's avatar 胡佳晨

下架商品不扫出来

order goblin 的获取sku spu信息接口修改
parent 527ed4ba
...@@ -85,12 +85,12 @@ public class GoblinPosController { ...@@ -85,12 +85,12 @@ public class GoblinPosController {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "店铺不存在"); return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "店铺不存在");
} }
String storeId = storeInfoVo.getStoreId(); String storeId = storeInfoVo.getStoreId();
skuids = skuids.replaceAll("\"",""); skuids = skuids.replaceAll("\"", "");
String[] skuIdArr = skuids.split(","); String[] skuIdArr = skuids.split(",");
List<GoblinPosGoodsVo> posGoodsVoList = ObjectUtil.getGoblinPosGoodsVoArrayList(); List<GoblinPosGoodsVo> posGoodsVoList = ObjectUtil.getGoblinPosGoodsVoArrayList();
for (String skuId : skuIdArr) { for (String skuId : skuIdArr) {
GoblinGoodsSkuInfoVo goodsSkuInfoVo = goblinRedisUtils.getGoodsSkuInfoVo(skuId); GoblinGoodsSkuInfoVo goodsSkuInfoVo = goblinRedisUtils.getGoodsSkuInfoVo(skuId);
if (null != goodsSkuInfoVo && goodsSkuInfoVo.getDelFlg().equals("0") && storeId.equals(goodsSkuInfoVo.getStoreId())) { if (null != goodsSkuInfoVo && goodsSkuInfoVo.getDelFlg().equals("0") && storeId.equals(goodsSkuInfoVo.getStoreId()) && goodsSkuInfoVo.getShelvesStatus().equals("3")) {
String spuId = goodsSkuInfoVo.getSpuId(); String spuId = goodsSkuInfoVo.getSpuId();
GoblinGoodsInfoVo goodsInfoVo = goblinRedisUtils.getGoodsInfoVo(spuId); GoblinGoodsInfoVo goodsInfoVo = goblinRedisUtils.getGoodsInfoVo(spuId);
if (null != goodsInfoVo && goodsInfoVo.getDelFlg().equals("0")) { if (null != goodsInfoVo && goodsInfoVo.getDelFlg().equals("0")) {
......
...@@ -63,8 +63,6 @@ public class GoblinStoreMgtGoodsController { ...@@ -63,8 +63,6 @@ public class GoblinStoreMgtGoodsController {
GoblinRedisUtils goblinRedisUtils; GoblinRedisUtils goblinRedisUtils;
@Autowired @Autowired
GoblinMongoUtils goblinMongoUtils; GoblinMongoUtils goblinMongoUtils;
@Autowired
IGoblinZhengzaiService goblinZhengzaiService;
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "SPU列表") @ApiOperation(value = "SPU列表")
...@@ -674,9 +672,6 @@ public class GoblinStoreMgtGoodsController { ...@@ -674,9 +672,6 @@ public class GoblinStoreMgtGoodsController {
List<GoblinGoodsSpecDto> paramSkuSpecDtoList = mgtGoodsEditSkuParam.getSkuSpecList(); List<GoblinGoodsSpecDto> paramSkuSpecDtoList = mgtGoodsEditSkuParam.getSkuSpecList();
for (String skuId : skuIdList) {// 比对所有SKU规格信息 for (String skuId : skuIdList) {// 比对所有SKU规格信息
GoblinGoodsSkuInfoVo mgtGoodsSkuInfoVo = goblinRedisUtils.getGoodsSkuInfoVo(skuId); GoblinGoodsSkuInfoVo mgtGoodsSkuInfoVo = goblinRedisUtils.getGoodsSkuInfoVo(skuId);
if (!mgtGoodsSkuInfoVo.getDelFlg().equals("0") || !mgtGoodsSkuInfoVo.getShelvesStatus().equals("3")) {
continue;
}
if (mgtGoodsSkuInfoVo.getSkuSpecList().size() != paramSkuSpecDtoList.size()) { if (mgtGoodsSkuInfoVo.getSkuSpecList().size() != paramSkuSpecDtoList.size()) {
log.warn("商品管理:商品编辑:SKU添加:规格信息有误[skuSpecMap={},paramSkuSpecMap={}]", JsonUtils.toJson(mgtGoodsSkuInfoVo.getSkuSpecList()), JsonUtils.toJson(paramSkuSpecDtoList)); log.warn("商品管理:商品编辑:SKU添加:规格信息有误[skuSpecMap={},paramSkuSpecMap={}]", JsonUtils.toJson(mgtGoodsSkuInfoVo.getSkuSpecList()), JsonUtils.toJson(paramSkuSpecDtoList));
return ResponseDto.failure(ErrorMapping.get("149014")); return ResponseDto.failure(ErrorMapping.get("149014"));
...@@ -730,11 +725,6 @@ public class GoblinStoreMgtGoodsController { ...@@ -730,11 +725,6 @@ public class GoblinStoreMgtGoodsController {
log.debug("商品管理:商品编辑:SKU添加:[GoblinStoreMgtGoodsEditSkuParam={}]", JsonUtils.toJson(mgtGoodsEditSkuParam)); log.debug("商品管理:商品编辑:SKU添加:[GoblinStoreMgtGoodsEditSkuParam={}]", JsonUtils.toJson(mgtGoodsEditSkuParam));
} }
goblinstoreMgtGoodsService.goodsEditSkuAdd(currentUid, mgtGoodsEditSkuParam, goodsInfoVo); goblinstoreMgtGoodsService.goodsEditSkuAdd(currentUid, mgtGoodsEditSkuParam, goodsInfoVo);
//同步正在下单商品
GoblinStoreZhengzaiCommonSingleParam param = GoblinStoreZhengzaiCommonSingleParam.getNew();
param.setSkuId(mgtGoodsEditSkuParam.getSkuId());
param.setSpuId(mgtGoodsEditSkuParam.getSpuId());
goblinZhengzaiService.zhengzaiSkuInsertSingle(param);
return ResponseDto.success(); return ResponseDto.success();
} }
......
...@@ -7,16 +7,14 @@ import com.liquidnet.service.base.SqlMapping; ...@@ -7,16 +7,14 @@ import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst; import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.goblin.constant.GoblinStatusConst; import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto; import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsActionParam; import com.liquidnet.service.goblin.dto.manage.*;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsAddParam;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsEditSkuParam;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsFilterParam;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinMgtCategorySpecVo; import com.liquidnet.service.goblin.dto.manage.vo.GoblinMgtCategorySpecVo;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsInfoVo; import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsInfoVo;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsListVo; import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsListVo;
import com.liquidnet.service.goblin.dto.vo.*; import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.enums.GoblinStoreConf; import com.liquidnet.service.goblin.enums.GoblinStoreConf;
import com.liquidnet.service.goblin.service.manage.IGoblinStoreMgtExtraService; import com.liquidnet.service.goblin.service.manage.IGoblinStoreMgtExtraService;
import com.liquidnet.service.goblin.service.manage.IGoblinZhengzaiService;
import com.liquidnet.service.goblin.service.manage.IGoblinstoreMgtGoodsService; import com.liquidnet.service.goblin.service.manage.IGoblinstoreMgtGoodsService;
import com.liquidnet.service.goblin.util.GoblinMongoUtils; import com.liquidnet.service.goblin.util.GoblinMongoUtils;
import com.liquidnet.service.goblin.util.GoblinRedisUtils; import com.liquidnet.service.goblin.util.GoblinRedisUtils;
...@@ -44,6 +42,8 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -44,6 +42,8 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
GoblinMongoUtils goblinMongoUtils; GoblinMongoUtils goblinMongoUtils;
@Autowired @Autowired
IGoblinStoreMgtExtraService goblinStoreMgtExtraService; IGoblinStoreMgtExtraService goblinStoreMgtExtraService;
@Autowired
IGoblinZhengzaiService goblinZhengzaiService;
@Override @Override
public PagedResult<GoblinStoreMgtGoodsListVo> goodsList(GoblinStoreMgtGoodsFilterParam mgtGoodsFilterParam) { public PagedResult<GoblinStoreMgtGoodsListVo> goodsList(GoblinStoreMgtGoodsFilterParam mgtGoodsFilterParam) {
...@@ -737,6 +737,12 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -737,6 +737,12 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
}); });
} }
//同步正在下单商品
GoblinStoreZhengzaiCommonSingleParam param = GoblinStoreZhengzaiCommonSingleParam.getNew();
param.setSkuId(skuId);
param.setSpuId(spuId);
goblinZhengzaiService.zhengzaiSkuInsertSingle(param);
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_GOODS.getKey(), queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_GOODS.getKey(),
SqlMapping.gets(toMqSqls, initGoodsSkuObjs, initGoodsSpecObjs, SqlMapping.gets(toMqSqls, initGoodsSkuObjs, initGoodsSpecObjs,
initGoodsSpecValueObjs, initGoodsSpuSpecValueObjs, initGoodsSkuSpecValueObjs, updateGoodsObjs) initGoodsSpecValueObjs, initGoodsSpuSpecValueObjs, initGoodsSkuSpecValueObjs, updateGoodsObjs)
......
...@@ -1234,7 +1234,7 @@ public class GoblinMongoUtils { ...@@ -1234,7 +1234,7 @@ public class GoblinMongoUtils {
//根据spuId查询活动id //根据spuId查询活动id
public List<String> getMarketIdListBySpuId(String spuId) { public List<String> getMarketIdListBySpuId(String spuId) {
Query query = Query.query(Criteria.where("marketId").ne(null).regex(spuId.concat(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue()).concat(".*"))); Query query = Query.query(Criteria.where("marketId").ne(null).and("spuId").regex(spuId.concat(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue()).concat(".*")));
query.fields().include("marketId"); query.fields().include("marketId");
return mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName()).stream().map(GoblinGoodsInfoVo::getMarketId).collect(Collectors.toList()); return mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName()).stream().map(GoblinGoodsInfoVo::getMarketId).collect(Collectors.toList());
} }
......
...@@ -408,6 +408,7 @@ public class GoblinRedisUtils { ...@@ -408,6 +408,7 @@ public class GoblinRedisUtils {
vo.setPriceGe(marketVo.getPriceGe()); vo.setPriceGe(marketVo.getPriceGe());
vo.setPriceLe(marketVo.getPriceLe()); vo.setPriceLe(marketVo.getPriceLe());
vo.setMarketId(marketVo.getMarketId()); vo.setMarketId(marketVo.getMarketId());
vo.setDelFlg(marketVo.getDelFlg().equals("1") ? marketVo.getDelFlg() : vo.getDelFlg());
return vo; return vo;
} else { } else {
String rk = GoblinRedisConst.BASIC_GOODS.concat(spuId); String rk = GoblinRedisConst.BASIC_GOODS.concat(spuId);
...@@ -506,7 +507,8 @@ public class GoblinRedisUtils { ...@@ -506,7 +507,8 @@ public class GoblinRedisUtils {
vo.setBuyLimit(marketVo.getBuyLimit()); vo.setBuyLimit(marketVo.getBuyLimit());
vo.setBuyRoster(marketVo.getBuyRoster()); vo.setBuyRoster(marketVo.getBuyRoster());
vo.setBuyFactor(marketVo.getBuyFactor()); vo.setBuyFactor(marketVo.getBuyFactor());
vo.setDelFlg("0"); // vo.setDelFlg("0");
vo.setDelFlg(marketVo.getDelFlg().equals("1") ? marketVo.getDelFlg() : vo.getDelFlg());
vo.setMarketId(marketVo.getMarketId()); vo.setMarketId(marketVo.getMarketId());
vo.setCreatedAt(LocalDateTime.now()); vo.setCreatedAt(LocalDateTime.now());
return vo; return vo;
......
...@@ -99,6 +99,7 @@ public class GoblinRedisUtils { ...@@ -99,6 +99,7 @@ public class GoblinRedisUtils {
vo.setPriceGe(marketVo.getPriceGe()); vo.setPriceGe(marketVo.getPriceGe());
vo.setPriceLe(marketVo.getPriceLe()); vo.setPriceLe(marketVo.getPriceLe());
vo.setMarketId(marketVo.getMarketId()); vo.setMarketId(marketVo.getMarketId());
vo.setDelFlg(marketVo.getDelFlg().equals("1") ? marketVo.getDelFlg() : vo.getDelFlg());
return vo; return vo;
} else { } else {
String rk = GoblinRedisConst.BASIC_GOODS.concat(spuId); String rk = GoblinRedisConst.BASIC_GOODS.concat(spuId);
...@@ -144,7 +145,8 @@ public class GoblinRedisUtils { ...@@ -144,7 +145,8 @@ public class GoblinRedisUtils {
vo.setBuyLimit(marketVo.getBuyLimit()); vo.setBuyLimit(marketVo.getBuyLimit());
vo.setBuyRoster(marketVo.getBuyRoster()); vo.setBuyRoster(marketVo.getBuyRoster());
vo.setBuyFactor(marketVo.getBuyFactor()); vo.setBuyFactor(marketVo.getBuyFactor());
vo.setDelFlg("0"); // vo.setDelFlg("0");
vo.setDelFlg(marketVo.getDelFlg().equals("1") ? marketVo.getDelFlg() : vo.getDelFlg());
vo.setMarketId(marketVo.getMarketId()); vo.setMarketId(marketVo.getMarketId());
vo.setCreatedAt(LocalDateTime.now()); vo.setCreatedAt(LocalDateTime.now());
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