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

Commit 441ba20b authored by zhengfuxin's avatar zhengfuxin

修改搜索条件

parent 3e1b1340
...@@ -309,9 +309,10 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -309,9 +309,10 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
} }
public GoblinStoreInfoVo getStore(String storId){ public GoblinStoreInfoVo getStore(String storId){
Query query = new Query(); Query query = new Query();
query.addCriteria(Criteria.where("storeId").is(storId)); query.addCriteria(Criteria.where("storeId").is(storId).and("spuAppear").is("0").and("delFlg").is("0").and("shelvesStatus").is("3"));
long count = mongoTemplate.count(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName()); long count = mongoTemplate.count(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
GoblinStoreInfoVo goblinStoreInfoVo=goblinRedisUtils.getStoreInfoVo(storId); GoblinStoreInfoVo goblinStoreInfoVo=goblinRedisUtils.getStoreInfoVo(storId);
//GoblinStoreNoticeVo goblinStoreNoticeVo=goblinRedisUtils.getStoreNoticeVo(storId,LocalDateTime.now());
goblinStoreInfoVo.setCount((int) count); goblinStoreInfoVo.setCount((int) count);
return goblinStoreInfoVo; return goblinStoreInfoVo;
} }
...@@ -357,7 +358,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -357,7 +358,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
public List<GoblinGoodsInfoVo> searchGoodesName(String name){ public List<GoblinGoodsInfoVo> searchGoodesName(String name){
Pattern pattern = Pattern.compile("^.*"+name+".*$", Pattern.CASE_INSENSITIVE); Pattern pattern = Pattern.compile("^.*"+name+".*$", Pattern.CASE_INSENSITIVE);
Query query = new Query(); Query query = new Query();
query.addCriteria(Criteria.where("name").regex(pattern)); query.addCriteria(Criteria.where("name").regex(pattern).and("spuAppear").is("0").and("delFlg").is("0").and("shelvesStatus").is("3"));
query.with(Sort.by( query.with(Sort.by(
Sort.Order.desc("count"), Sort.Order.desc("count"),
Sort.Order.desc("createdAt") Sort.Order.desc("createdAt")
...@@ -389,7 +390,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -389,7 +390,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
public GoblinFrontCategoryListVo getStoreGoodes(String storeId,String categoryId,String name){ public GoblinFrontCategoryListVo getStoreGoodes(String storeId,String categoryId,String name){
// //
Query query = new Query(); Query query = new Query();
query.addCriteria(Criteria.where("storeId").is(storeId)); query.addCriteria(Criteria.where("storeId").is(storeId).and("spuAppear").is("0").and("delFlg").is("0").and("shelvesStatus").is("3"));
if(StringUtil.isNotBlank(categoryId)){ if(StringUtil.isNotBlank(categoryId)){
query.addCriteria(new Criteria().orOperator( query.addCriteria(new Criteria().orOperator(
Criteria.where("storeCateFid").is(categoryId), Criteria.where("storeCateFid").is(categoryId),
...@@ -431,7 +432,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -431,7 +432,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
// //
Query query = new Query(); Query query = new Query();
query.addCriteria(new Criteria().orOperator( query.addCriteria(new Criteria().orOperator(
Criteria.where("extagVoList.tagId").is(tagId) Criteria.where("extagVoList.tagId").is(tagId).and("spuAppear").is("0").and("delFlg").is("0").and("shelvesStatus").is("3")
)); ));
Pageable pageable=null; Pageable pageable=null;
// //
...@@ -484,6 +485,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -484,6 +485,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
Criteria.where("cateSid").is(categoryId), Criteria.where("cateSid").is(categoryId),
Criteria.where("cateTid").is(categoryId) Criteria.where("cateTid").is(categoryId)
)); ));
query.addCriteria(Criteria.where("spuAppear").is("0").and("delFlg").is("0").and("shelvesStatus").is("3"));
Pageable pageable=null; Pageable pageable=null;
// //
if(type.equals("1")){ if(type.equals("1")){
...@@ -532,7 +534,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -532,7 +534,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
if(StringUtil.isNotBlank(spuids)){ if(StringUtil.isNotBlank(spuids)){
query.addCriteria(Criteria.where("spuId").nin(spuids.split(","))); query.addCriteria(Criteria.where("spuId").nin(spuids.split(",")));
} }
query.addCriteria(Criteria.where("delFlg").is("0").and("shelvesStatus").is("3")); query.addCriteria(Criteria.where("delFlg").is("0").and("shelvesStatus").is("3").and("spuAppear").is("0"));
//redis里面获取排序规则 1、上架时间2、销量3、价格高到低4、价格低到高 //redis里面获取排序规则 1、上架时间2、销量3、价格高到低4、价格低到高
int sortType=0; int sortType=0;
......
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