Commit 897b9df9 authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/dev-chw' into dev-chw

parents 1b72482d 3265528c
......@@ -47,12 +47,12 @@ public class BannerBiz extends BaseBiz<BannerMapper, Banner> {
* @param indexShow 是否首页展示
* @return
*/
public ObjectRestResponse<List<Banner>> getAll(Integer indexShow) {
public ObjectRestResponse<List<Banner>> getAll(Integer indexShow, Integer location) {
Example example = new Example(Banner.class);
if (indexShow != null) {
example.createCriteria().andEqualTo("isDel", 0).andEqualTo("status", 1).andEqualTo("indexShow",indexShow);
example.createCriteria().andEqualTo("isDel", 0).andEqualTo("status", 1).andEqualTo("indexShow",indexShow).andEqualTo("location", location);
} else {
example.createCriteria().andEqualTo("isDel", 0).andEqualTo("status", 1);
example.createCriteria().andEqualTo("isDel", 0).andEqualTo("status", 1).andEqualTo("location", location);
}
example.orderBy("rank");
return ObjectRestResponse.succ(mapper.selectByExample(example));
......
......@@ -2,7 +2,6 @@ package com.xxfc.platform.uccn.biz;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
......@@ -12,7 +11,6 @@ import com.xxfc.platform.campsite.vo.CampsiteShopPageVo;
import com.xxfc.platform.tour.entity.TourGood;
import com.xxfc.platform.tour.feign.TourFeign;
import com.xxfc.platform.uccn.comstnt.ServiceConstant;
import com.xxfc.platform.uccn.entity.Article;
import com.xxfc.platform.uccn.vo.SearchResultVo;
import com.xxfc.platform.uccn.vo.ServiceResultVo;
import com.xxfc.platform.uccn.vo.SummitActivityVo;
......@@ -198,25 +196,7 @@ public class SearchBiz {
}
}
});
//新闻
threadPoolTaskExecutor.execute(new Runnable() {
@Override
public void run() {
try {
ServiceResultVo<Article> articleServiceResultVo = new ServiceResultVo<>();
PageInfo articleList = articleBiz.getArticleList(1, ServiceConstant.NEWS_LIMIT, 1, keyWord);
List<Article> result = articleList == null ? Collections.EMPTY_LIST : articleList.getList() == null ? Collections.EMPTY_LIST : articleList.getList();
articleServiceResultVo.setData(result);
articleServiceResultVo.setTotalCount(articleList.getTotal());
searchResultVo.put(ServiceConstant.NEWS, articleServiceResultVo);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
latch.countDown();
}
}
});
try {
latch.await();
} catch (InterruptedException e) {
......
package com.xxfc.platform.uccn.rest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.uccn.biz.BannerBiz;
import com.xxfc.platform.uccn.entity.Banner;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("banner/web")
public class BannerWebController extends BaseController<BannerBiz, Banner> {
@GetMapping(value = "/app/unauth/getAll")
public ObjectRestResponse getAll(@RequestParam(value = "location", defaultValue = "1") Integer location) {
return baseBiz.getAll(1, location);
}
}
\ No newline at end of file
package com.xxfc.platform.uccn.rest;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.campsite.vo.CampsiteShopPageVo;
import com.xxfc.platform.tour.entity.TourGood;
import com.xxfc.platform.uccn.biz.SearchBiz;
import com.xxfc.platform.uccn.comstnt.ServiceConstant;
import com.xxfc.platform.uccn.entity.Article;
import com.xxfc.platform.uccn.vo.SearchResultVo;
import com.xxfc.platform.uccn.vo.ServiceResultVo;
import com.xxfc.platform.uccn.vo.SummitActivityVo;
import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition;
import com.xxfc.platform.vehicle.pojo.VehicleModelVo;
import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyFindDTO;
......@@ -19,7 +16,10 @@ import com.xxfc.platform.vehicle.pojo.vo.BranchCompanyListVO;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
......@@ -106,16 +106,16 @@ public class SearchController {
campsiteSearchResultVo.put(ServiceConstant.CAMPSITE,campsiteShopPageVoServiceResultVo);
return ObjectRestResponse.succ(campsiteSearchResultVo);
case ServiceConstant.NEWS:
ObjectRestResponse articleresult = articleController.getArticleList(page, limit, 1, keyWord);
PageInfo<Article> articlePageDataVO = (PageInfo<Article>)articleresult.getData();
List<Article> articleList = articlePageDataVO.getList();
Long articleTotalCount = articlePageDataVO.getTotal();
ServiceResultVo<Article> articleServiceResultVo = new ServiceResultVo<>();
articleServiceResultVo.setTotalCount(articleTotalCount);
articleServiceResultVo.setData(articleList);
SearchResultVo articleSearchResult= new SearchResultVo();
articleSearchResult.put(ServiceConstant.NEWS,articleServiceResultVo);
return ObjectRestResponse.succ(articleSearchResult);
// ObjectRestResponse articleresult = articleController.getArticleList(page, limit, 1, keyWord);
// PageInfo<Article> articlePageDataVO = (PageInfo<Article>)articleresult.getData();
// List<Article> articleList = articlePageDataVO.getList();
// Long articleTotalCount = articlePageDataVO.getTotal();
// ServiceResultVo<Article> articleServiceResultVo = new ServiceResultVo<>();
// articleServiceResultVo.setTotalCount(articleTotalCount);
// articleServiceResultVo.setData(articleList);
// SearchResultVo articleSearchResult= new SearchResultVo();
// articleSearchResult.put(ServiceConstant.NEWS,articleServiceResultVo);
// return ObjectRestResponse.succ(articleSearchResult);
case ServiceConstant.ACTIVITY:
ObjectRestResponse<PageDataVO<SummitActivityVo>> summitActivityWithPage = summitActivityController.findSummitActivityWithPage(page, limit, null, keyWord);
List<SummitActivityVo> summitActivityVos = summitActivityWithPage.getData().getData();
......
......@@ -21,8 +21,4 @@ public class BannerController extends BaseController<BannerBiz, Banner> {
return baseBiz.selectList(bannerDto);
}
@GetMapping(value = "/app/unauth/getAll")
public ObjectRestResponse getAll() {
return baseBiz.getAll(1);
}
}
\ No newline at end of file
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