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

Commit 2aa30b4e authored by 张国柄's avatar 张国柄

~api:正在下单-参与活动的SPU:搜索排序调整;

parent 4fcb6947
......@@ -17,6 +17,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.time.LocalDateTime;
......@@ -84,13 +85,18 @@ public class GoblinStoreZhengzaiServiceImpl implements IGoblinStoreZhengzaiServi
}
List<GoblinMarketRelationVo> relationVo = redisUtils.getMarketRelation(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue(), marketId);
List<String> spuIdList = relationVo.stream().map(GoblinMarketRelationVo::getSpuId).collect(Collectors.toList());
if (StringUtils.isNotBlank(keyword)) {
spuIdList = mongoUtils.getSpuIdListBySpuIdListAndKeyword(spuIdList, keyword);
}
// 支持搜索SPU
boolean toSearchFlg = StringUtils.isNotBlank(keyword);
List<String> hitSpuIdList = toSearchFlg ? mongoUtils.getSpuIdListBySpuIdListAndKeyword(spuIdList, keyword) : null;
List<GoblinZhengzaiGoodVo> voList = ObjectUtil.getGoblinZhengzaiGoodVoArrayList();
if (toSearchFlg && CollectionUtils.isEmpty(hitSpuIdList)) {
return ResponseDto.success(voList);
}
for (String spuId : spuIdList) {
GoblinGoodsInfoVo vo = redisUtils.getGoodsInfoVo(spuId);
if (vo.getShelvesStatus().equals("3") && vo.getStoreId().equals(storeId)) {
GoblinGoodsInfoVo vo = !toSearchFlg || hitSpuIdList.contains(spuId) ? redisUtils.getGoodsInfoVo(spuId) : null;
if (null != vo && vo.getShelvesStatus().equals("3") && vo.getStoreId().equals(storeId)) {
GoblinZhengzaiGoodVo returnVo = GoblinZhengzaiGoodVo.getNew();
BeanUtils.copyProperties(vo, returnVo);
voList.add(returnVo);
......
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