Commit eb902b27 authored by libin's avatar libin

官网二期优化综合搜索

parent a1c8b028
......@@ -17,4 +17,6 @@ public class CampsiteShopFindDTO extends PageParam {
private Integer addrCity;
private Integer type;
private String name;
}
......@@ -4,11 +4,15 @@ package com.xxfc.platform.campsite.feign;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.GoodDataVO;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.sun.org.apache.regexp.internal.RE;
import com.xxfc.platform.campsite.dto.CampsiteShopFindDTO;
import com.xxfc.platform.campsite.vo.CampsiteShopDetailVo;
import com.xxfc.platform.campsite.vo.CampsiteShopPageVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
......@@ -30,9 +34,10 @@ public interface CampsiteFeign {
@ApiOperation("分页查询营地列表")
@GetMapping("/app/unauth/shops")
ObjectRestResponse<PageDataVO<CampsiteShopPageVo>> findCampsiteShopPageByType(@RequestParam(value = "type", required = false) Integer type,
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", required = false, defaultValue = "6") Integer pageSize);
ObjectRestResponse<PageDataVO<CampsiteShopPageVo>> findCampsiteShopPageByTypeAndName(@RequestParam(value = "type", required = false) Integer type,
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", required = false, defaultValue = "6") Integer pageSize,
@RequestParam(value = "name",required = false) String name);
/**
* @param longitude 经度
......@@ -44,4 +49,7 @@ public interface CampsiteFeign {
ObjectRestResponse<CampsiteShopDetailVo> findCampsiteShopDetailById(@RequestParam(value = "id") Integer id,
@RequestParam(value = "longitude", required = false) Double longitude,
@RequestParam(value = "latitude", required = false) Double latitude);
@PostMapping(value = "/app/unauth/campsites")
ObjectRestResponse<PageDataVO<CampsiteShopPageVo>> findCampsiteShopPageForUncc(@RequestBody CampsiteShopFindDTO campsiteShopFindDTO);
}
......@@ -91,9 +91,17 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
return JSONObject.parseObject(result, new TypeReference<PageDataVO<CampsiteShopPageVo>>() {
});
}
PageDataVO<CampsiteShopPageVo> campsiteShopPageDataVO = new PageDataVO<>();
PageDataVO<CampsiteShopPageVo> campsiteShopPageDataVO = findCampsiteShopPageByTypeAndName(campsiteShopFindDTO);
campHashOperations.put(CAMPSITE_LIST_CACHE_PREKEY,campsite_cache_key,JSONObject.toJSONString(campsiteShopPageDataVO));
return campsiteShopPageDataVO;
}
PageDataVO<CampsiteShopPageDTO> pageDataVO = PageDataVO.pageInfo(campsiteShopFindDTO.getPage(), campsiteShopFindDTO.getLimit(), () -> mapper.findAllCampsiteShopsByTypeOrCode(campsiteShopFindDTO.getType(),campsiteShopFindDTO.getAddrProvince(),campsiteShopFindDTO.getAddrCity()));
public PageDataVO<CampsiteShopPageVo> findCampsiteShopPageByTypeAndName(CampsiteShopFindDTO campsiteShopFindDTO){
PageDataVO<CampsiteShopPageVo> campsiteShopPageDataVO = new PageDataVO<>();
PageDataVO<CampsiteShopPageDTO> pageDataVO = PageDataVO.pageInfo(campsiteShopFindDTO.getPage(), campsiteShopFindDTO.getLimit(),
() -> mapper.findAllCampsiteShopsByTypeOrCodeOrName(campsiteShopFindDTO.getType(),campsiteShopFindDTO.getAddrProvince(),
campsiteShopFindDTO.getAddrCity(),campsiteShopFindDTO.getName()));
List<CampsiteShopPageDTO> campsiteShopPageDTOS = pageDataVO.getData();
if (CollectionUtils.isEmpty(campsiteShopPageDTOS)) {
campsiteShopPageDataVO.setPageNum(campsiteShopFindDTO.getPage());
......@@ -106,7 +114,6 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
if (log.isDebugEnabled()) {
log.debug("根据type=【{}】查询到的店铺数据:【{}】", campsiteShopFindDTO.getType(), campsiteShopPageDTOS);
}
List<CampsiteShopPageVo> campsiteShopPageVoList = new ArrayList<>();
campsiteShopPageDTOS = campsiteShopPageDTOS.stream().distinct().collect(Collectors.toList());
for (CampsiteShopPageDTO campsiteShopPageDTO : campsiteShopPageDTOS) {
......@@ -115,14 +122,11 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
campsiteShopPageVoList.add(campsiteShopPageVo);
}
campsiteShopPageVoList.sort(Comparator.comparing(CampsiteShopPageVo::getHot).reversed().thenComparing(CampsiteShopPageVo::getCrtTime).reversed());
campsiteShopPageDataVO.setTotalPage(pageDataVO.getTotalPage());
campsiteShopPageDataVO.setTotalCount(pageDataVO.getTotalCount());
campsiteShopPageDataVO.setPageSize(pageDataVO.getPageSize());
campsiteShopPageDataVO.setPageNum(pageDataVO.getPageNum());
campsiteShopPageDataVO.setData(campsiteShopPageVoList);
campHashOperations.put(CAMPSITE_LIST_CACHE_PREKEY,campsite_cache_key,JSONObject.toJSONString(campsiteShopPageDataVO));
return campsiteShopPageDataVO;
}
......@@ -329,6 +333,11 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
return true;
}
public PageDataVO<CampsiteShopPageVo> findCampsiteShopPageForUncc(CampsiteShopFindDTO campsiteShopFindDTO) {
return findCampsiteShopPageByTypeAndName(campsiteShopFindDTO);
}
private long transformStartTime(Long startTime) {
return LocalDateTime.ofInstant(new Date(startTime).toInstant(), ZoneOffset.ofHours(+8))
.withHour(0)
......@@ -399,4 +408,5 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
s = s * EARTH_RADIUS;
return s;
}
}
\ No newline at end of file
......@@ -26,9 +26,10 @@ public interface CampsiteShopMapper extends Mapper<CampsiteShop> {
*
* @param typeId
*/
List<CampsiteShopPageDTO> findAllCampsiteShopsByTypeOrCode(@Param("typeId") Integer typeId,
@Param("proviceCode") Integer proviceCode,
@Param("cityCode") Integer cityCode);
List<CampsiteShopPageDTO> findAllCampsiteShopsByTypeOrCodeOrName(@Param("typeId") Integer typeId,
@Param("proviceCode") Integer proviceCode,
@Param("cityCode") Integer cityCode,
@Param("name") String name);
/**
* 首页营地列表
......@@ -82,7 +83,7 @@ public interface CampsiteShopMapper extends Mapper<CampsiteShop> {
* @param name
* @return
*/
int checkNameExist(@Param("id") Integer id,@Param("name") String name);
int checkNameExist(@Param("id") Integer id, @Param("name") String name);
}
......@@ -29,17 +29,22 @@ public class CampsiteShopController extends BaseController<CampsiteShopBiz, Camp
@ApiOperation("分页查询营地列表")
@GetMapping("/app/unauth/shops")
public ObjectRestResponse<PageDataVO<CampsiteShopPageVo>> findCampsiteShopPageByType(@RequestParam(value = "type", required = false) Integer type,
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", required = false, defaultValue = "6") Integer pageSize) {
public ObjectRestResponse<PageDataVO<CampsiteShopPageVo>> findCampsiteShopPageByTypeAndName(@RequestParam(value = "type", required = false) Integer type,
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", required = false, defaultValue = "6") Integer pageSize) {
CampsiteShopFindDTO campsiteShopFindDTO = new CampsiteShopFindDTO();
campsiteShopFindDTO.setType(type);
campsiteShopFindDTO.setPage(pageNo);
campsiteShopFindDTO.setLimit(pageSize);
PageDataVO<CampsiteShopPageVo> pageDataVO = getBaseBiz().findCampsiteShopPageByType(campsiteShopFindDTO);
return ObjectRestResponse.succ(pageDataVO);
}
}
@PostMapping(value = "/app/unauth/campsites")
public ObjectRestResponse<PageDataVO<CampsiteShopPageVo>> findCampsiteShopPageForUncc(@RequestBody CampsiteShopFindDTO campsiteShopFindDTO) {
PageDataVO<CampsiteShopPageVo> campsiteShops = baseBiz.findCampsiteShopPageForUncc(campsiteShopFindDTO);
return ObjectRestResponse.succ(campsiteShops);
}
/**
* @param longitude 经度
......@@ -49,8 +54,8 @@ public class CampsiteShopController extends BaseController<CampsiteShopBiz, Camp
@ApiOperation("查询营地详情")
@GetMapping("/app/unauth/shop")
public ObjectRestResponse<CampsiteShopDetailVo> findCampsiteShopDetailById(@RequestParam(value = "id") Integer id,
@RequestParam(value = "longitude",required = false) Double longitude,
@RequestParam(value = "latitude",required = false) Double latitude) {
@RequestParam(value = "longitude", required = false) Double longitude,
@RequestParam(value = "latitude", required = false) Double latitude) {
CampsiteShopDetailVo campsiteShopDetailVo = getBaseBiz().findCampsiteShopDetailById(id, longitude, latitude);
return ObjectRestResponse.succ(campsiteShopDetailVo);
}
......@@ -58,8 +63,8 @@ public class CampsiteShopController extends BaseController<CampsiteShopBiz, Camp
@ApiOperation("首页营地列表")
@GetMapping(value = "/app/shopList")
public List<GoodDataVO> goodList(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "4") Integer limit) {
return getBaseBiz().getAllByHome(page,limit);
@RequestParam(value = "limit", defaultValue = "4") Integer limit) {
return getBaseBiz().getAllByHome(page, limit);
}
@ApiOperation("随机获取营地")
......@@ -67,8 +72,9 @@ public class CampsiteShopController extends BaseController<CampsiteShopBiz, Camp
public ObjectRestResponse findRandomVehicle(Integer number) {
return baseBiz.findRandomVehicle(number);
}
@PostMapping(value = "/app/unauth/webchat_official/campsites")
public ObjectRestResponse<PageDataVO<CampsiteShopPageVo>> findCampsitesForPublicNumber(@RequestBody CampsiteShopFindDTO campsiteShopFindDTO){
public ObjectRestResponse<PageDataVO<CampsiteShopPageVo>> findCampsitesForPublicNumber(@RequestBody CampsiteShopFindDTO campsiteShopFindDTO) {
PageDataVO<CampsiteShopPageVo> campsiteShops = baseBiz.findCampsiteShopPageByType(campsiteShopFindDTO);
return ObjectRestResponse.succ(campsiteShops);
......
......@@ -36,7 +36,7 @@
</resultMap>
<!--根据类型查询全部-->
<select id="findAllCampsiteShopsByTypeOrCode" resultType="com.xxfc.platform.campsite.dto.CampsiteShopPageDTO">
<select id="findAllCampsiteShopsByTypeOrCodeOrName" resultType="com.xxfc.platform.campsite.dto.CampsiteShopPageDTO">
SELECT
cs.id AS `id`,
cs. NAME AS `name`,
......@@ -63,10 +63,13 @@
and cst.tag_id=#{typeId}
</if>
<if test="proviceCode != null">
and `province`=#{proviceCode}
and cs.`province`=#{proviceCode}
</if>
<if test="cityCode != null">
and `city`=#{cityCode}
and cs.`city`=#{cityCode}
</if>
<if test="name!=null and name!=''">
and cs.`name` like concat('%',#{name},'%')
</if>
GROUP BY cs.id
order by cs.hot DESC,cs.crt_time DESC
......
......@@ -37,6 +37,7 @@ public interface TourFeign {
/**
* 计算价格
*
* @param spePriceDto
* @return
*/
......@@ -44,10 +45,9 @@ public interface TourFeign {
public ObjectRestResponse<TourSpePriceVo> refund(@RequestBody TourSpePriceDTO spePriceDto);
/**
*
* @param speId
* @param number
* @param type 1--减库存,2--加库存
* @param type 1--减库存,2--加库存
* @return
*/
@RequestMapping(value = "/spe/stock", method = RequestMethod.GET)
......@@ -58,13 +58,14 @@ public interface TourFeign {
public ObjectRestResponse<TourGood> usableGet(@PathVariable(value = "id") int id);
@GetMapping("/tourUser/app/unauth/getTourUsers")
public ObjectRestResponse<List<TourUser>> getTourUsers(@RequestParam("ids") String ids);
public ObjectRestResponse<List<TourUser>> getTourUsers(@RequestParam("ids") String ids);
@GetMapping("/tourGood/verfication/entityList")
public ObjectRestResponse<List<TourGoodVerification>> entityList(@RequestParam("entity") Map<String, Object> entity);
/**
* 更新发车状态
*
* @param verficationId
* @return
*/
......@@ -73,15 +74,17 @@ public interface TourFeign {
/**
* 更新总人数或上车人数
*
* @param verficationId
* @param properties
* @return
*/
@PutMapping("/tourGood/verfication/personnums")
ObjectRestResponse<Void> updateTourGoodPersonNum(@RequestParam("verficationId") Integer verficationId,@RequestParam("properties") String properties,@RequestParam("number") Integer number);
ObjectRestResponse<Void> updateTourGoodPersonNum(@RequestParam("verficationId") Integer verficationId, @RequestParam("properties") String properties, @RequestParam("number") Integer number);
/**
* 查询订单列表
*
* @param tourGoodOrderFindVo
* @return
*/
......@@ -91,11 +94,11 @@ public interface TourFeign {
@ApiOperation("首页旅游列表")
@GetMapping(value = "/tourGood/app/shopList")
public List<GoodDataVO> goodList(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "4") Integer limit);
@RequestParam(value = "limit", defaultValue = "4") Integer limit);
//获取商品信息
@RequestMapping(value = "/good/app/unauth/one", method = RequestMethod.GET)
public TourGood one(@RequestParam(value = "goodId",defaultValue = "0") Integer goodId);
public TourGood one(@RequestParam(value = "goodId", defaultValue = "0") Integer goodId);
@GetMapping("/tourGoodSite/departure_time")
Long selectDepartureTimeByStartCompanyIdAndRouteId(@RequestParam(value = "companyId") Integer companyId, @RequestParam(value = "goodId") Integer routeId);
......@@ -107,13 +110,15 @@ public interface TourFeign {
Date selectDepartureDataBySpeId(@RequestParam(value = "speIds") Integer speIds);
@GetMapping(value = "/tourGood/app/unauth/findRandomVehicle")
public ObjectRestResponse findRandomVehicle(@RequestParam(value = "number")Integer number);
public ObjectRestResponse findRandomVehicle(@RequestParam(value = "number") Integer number);
//查询旅游路线列表
@RequestMapping(value = "/gw/app/unauth/getGoodList", method = RequestMethod.GET)
ObjectRestResponse getGoodList(@RequestParam(value = "page",defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "10") Integer limit,
@RequestParam(value = "tagId", required = false) Integer tagId);
ObjectRestResponse<PageDataVO<TourGood>> getGoodList(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit", defaultValue = "10") Integer limit,
@RequestParam(value = "tagId", required = false) Integer tagId,
@RequestParam(value = "name", required = false) String name);
//获取公司详情
@GetMapping("/gw/app/unauth/detail/{id}")
ObjectRestResponse getOne(@PathVariable Integer id);
......@@ -121,11 +126,11 @@ public interface TourFeign {
//首页旅游列表
@GetMapping(value = "/gw/shopList")
List<GoodDataVO> goodListAll(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "4") Integer limit);
@RequestParam(value = "limit", defaultValue = "4") Integer limit);
//旅游标签列表
@GetMapping(value = "/gw/tagList")
List<TourTag> tagList(@RequestParam(value = "isHot",defaultValue = "0")Integer isHot);
List<TourTag> tagList(@RequestParam(value = "isHot", defaultValue = "0") Integer isHot);
}
......@@ -63,7 +63,7 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
* @param distance
* @return
*/
public ObjectRestResponse<TourGood> getGoodList(int page, int limit , String query , Double latitude, Double longitude, Integer tagId, Double distance){
public ObjectRestResponse<PageDataVO<TourGood>> getGoodList(int page, int limit , String query , Double latitude, Double longitude, Integer tagId, Double distance){
Map<String, Object> params = initParam(page, limit, query, latitude, longitude, tagId, distance);
PageDataVO<TourGood> dataVO=null;
if(latitude!=null&&latitude>0&&longitude!=null&&longitude>0){
......
......@@ -4,6 +4,7 @@ import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.vo.GoodDataVO;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.tour.biz.TourGoodBiz;
import com.xxfc.platform.tour.dto.GoodSearchDTO;
import com.xxfc.platform.tour.entity.TourGood;
......@@ -33,10 +34,10 @@ public class TourGoodController extends BaseController<TourGoodBiz, TourGood> {
@RequestMapping(value = "/app/unauth/getGoodList", method = RequestMethod.GET)
@IgnoreClientToken
@ResponseBody
public ObjectRestResponse<TourGood> getGoodList(@RequestParam(value = "page", required = true) Integer page, @RequestParam(value = "limit",defaultValue = "10") Integer limit,
@RequestParam(value = "query", required = false) String query, @RequestParam(value = "latitude", required = false) Double latitude,
@RequestParam(value = "longitude", required = false) Double longitude, @RequestParam(value = "tagId", required = false) Integer tagId,
@RequestParam(value = "distance", defaultValue = "100") Double distance) {
public ObjectRestResponse<PageDataVO<TourGood>> getGoodList(@RequestParam(value = "page", required = true) Integer page, @RequestParam(value = "limit",defaultValue = "10") Integer limit,
@RequestParam(value = "query", required = false) String query, @RequestParam(value = "latitude", required = false) Double latitude,
@RequestParam(value = "longitude", required = false) Double longitude, @RequestParam(value = "tagId", required = false) Integer tagId,
@RequestParam(value = "distance", defaultValue = "100") Double distance) {
return baseBiz.getGoodList(page, limit, query, latitude, longitude, tagId, distance);
}
......
......@@ -5,6 +5,7 @@ import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.vo.GoodDataVO;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.tour.biz.TourGoodBiz;
import com.xxfc.platform.tour.biz.TourGoodDetailBiz;
import com.xxfc.platform.tour.biz.TourTagBiz;
......@@ -38,10 +39,11 @@ public class TourGwController extends BaseController<TourGoodBiz, TourGood> {
*/
@ApiOperation("查询旅游路线列表")
@RequestMapping(value = "/app/unauth/getGoodList", method = RequestMethod.GET)
public ObjectRestResponse getGoodList(@RequestParam(value = "page",defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "10") Integer limit,
@RequestParam(value = "tagId", required = false) Integer tagId) {
return baseBiz.getGoodList(page, limit, "", null, null, tagId, null);
public ObjectRestResponse<PageDataVO<TourGood>> getGoodList(@RequestParam(value = "page",defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "10") Integer limit,
@RequestParam(value = "tagId", required = false) Integer tagId,
@RequestParam(value = "name",required = false) String name) {
return baseBiz.getGoodList(page, limit, name, null, null, tagId, null);
}
@GetMapping("/app/unauth/detail/{id}")
......
package com.xxfc.platform.uccn.comstnt;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/18 9:21
*/
public class ServiceConstant {
/**
* 车型
*/
public static final String VEHICLE = "vehicle";
public static final Integer VEHICLE_LIMIT=2;
/**
* 分公司
*/
public static final String BRANCH_COMPANY = "company";
public static final Integer BRANCH_COMPANY_LIMIT=4;
/**
* 旅游
*/
public static final String TROUR = "tour";
public static final Integer TOUR_LIMIT=2;
/**
* 营地
*/
public static final String CAMPSITE = "campsite";
public static final Integer CAMPSITE_LIMIT=2;
/**
* 新闻
*/
public static final String NEWS = "news";
public static final Integer NEWS_LIMIT=4;
/**
* 活动
*/
public static final String ACTIVITY = "activity";
public static final Integer ACTIVITY_LIMIT=4;
}
package com.xxfc.platform.uccn.vo;
import lombok.Builder;
import lombok.NoArgsConstructor;
import java.util.HashMap;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/17 10:00
*/
@Builder(toBuilder = true)
@NoArgsConstructor
public class SearchResultVo extends HashMap<String,Object> {
}
package com.xxfc.platform.uccn.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/18 9:30
*/
@Data
@Builder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
public class ServiceResultVo<T> {
private long totalCount;
private List<T> data;
}
......@@ -43,9 +43,9 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
* @param type
* @return
*/
public PageInfo getArticleList(Integer page, Integer limit, Integer type) {
public PageInfo getArticleList(Integer page, Integer limit, Integer type,String title) {
PageHelper.startPage(page, limit);
List articleList = mapper.getArticleList(type,null,null);
List articleList = mapper.getArticleList(type,null,null,title);
return PageInfo.of(articleList);
}
......@@ -81,7 +81,7 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
*/
public List getThree( Integer type, Integer number, Integer id) {
number = number == null ? RANDOM_NUMBER : number;
List<Article> articleList = mapper.getArticleList(type,null,id);
List<Article> articleList = mapper.getArticleList(type,null,id,null);
if (!Objects.isNull(articleList)) {
int size = articleList.size();
if (number >= size) {
......@@ -108,7 +108,7 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
* @return
*/
public List getHomePageArticle(Integer type) {
List<Article> articleList = mapper.getArticleList(type,HOME_PAGE_NUMBER,null);
List<Article> articleList = mapper.getArticleList(type,HOME_PAGE_NUMBER,null,null);
// if (Objects.isNull(articleList)) {
// return new ArrayList();
// } else {
......
......@@ -204,7 +204,7 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv
return summitActivityVos;
}
public PageDataVO<SummitActivityVo> findSummitActivityWithPage(Integer page, Integer limit, Integer location) {
public PageDataVO<SummitActivityVo> findSummitActivityWithPage(Integer page, Integer limit, Integer location,String title) {
PageDataVO<SummitActivityVo> dataVO = new PageDataVO<>();
Example example = new Example(SummitActivity.class);
......@@ -218,6 +218,10 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv
criteria.andEqualTo("isShow", 1);
//位置
criteria.andIn("location", Arrays.asList(location, 0));
//标题
if (StringUtils.isNotEmpty(title)){
criteria.andLike("title",String.format("%%%s%%",title.trim()));
}
PageDataVO<SummitActivity> summitActivityPageDataVO = PageDataVO.pageInfo(page, limit, () -> mapper.selectByExample(example));
List<SummitActivity> summitActivities = summitActivityPageDataVO.getData();
if (CollectionUtils.isEmpty(summitActivities)){
......
......@@ -17,5 +17,5 @@ public interface ArticleMapper extends Mapper<Article> {
* @param id 当前文章id ,无就传null
* @return
*/
List<Article> getArticleList(@Param("type") Integer type,@Param( "limit") Integer limit,@Param("id") Integer id);
List<Article> getArticleList(@Param("type") Integer type,@Param( "limit") Integer limit,@Param("id") Integer id,@Param("title") String title);
}
......@@ -25,8 +25,9 @@ public class ArticleController extends BaseController<ArticleBiz, Article> {
public ObjectRestResponse getArticleList(
@RequestParam(name = "page", defaultValue = "1") Integer page,
@RequestParam(name = "limit", defaultValue = "10") Integer limit,
@RequestParam(name = "type", defaultValue = "1") Integer type) {
return ObjectRestResponse.succ(baseBiz.getArticleList(page, limit, type));
@RequestParam(name = "type", defaultValue = "1") Integer type,
@RequestParam(value = "title",required = false) String title) {
return ObjectRestResponse.succ(baseBiz.getArticleList(page, limit, type,title));
}
@GetMapping("/app/unauth/one")
......
......@@ -2,6 +2,7 @@ package com.xxfc.platform.uccn.rest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.campsite.dto.CampsiteShopFindDTO;
import com.xxfc.platform.campsite.feign.CampsiteFeign;
import com.xxfc.platform.campsite.vo.CampsiteShopDetailVo;
import com.xxfc.platform.campsite.vo.CampsiteShopPageVo;
......@@ -31,8 +32,14 @@ public class CampsiteUccnController {
@GetMapping("/shops")
public ObjectRestResponse<PageDataVO<CampsiteShopPageVo>> findCampsiteShopPageByType(@RequestParam(value = "type", required = false) Integer type,
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", required = false, defaultValue = "6") Integer pageSize) {
return campsiteFeign.findCampsiteShopPageByType(type, pageNo, pageSize);
@RequestParam(value = "pageSize", required = false, defaultValue = "6") Integer pageSize,
@RequestParam(value = "name",required = false) String name) {
CampsiteShopFindDTO campsiteShopFindDTO = new CampsiteShopFindDTO();
campsiteShopFindDTO.setType(type);
campsiteShopFindDTO.setPage(pageNo);
campsiteShopFindDTO.setLimit(pageSize);
campsiteShopFindDTO.setName(name);
return campsiteFeign.findCampsiteShopPageForUncc(campsiteShopFindDTO);
}
/**
......
......@@ -23,9 +23,11 @@ public class GwTourController extends CommonBaseController {
@ApiOperation("查询旅游路线列表")
@RequestMapping(value = "/getGoodList", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse getGoodList(@RequestParam(value = "page",defaultValue = "1") Integer page, @RequestParam(value = "limit",defaultValue = "10") Integer limit,
@RequestParam(value = "tagId", required = false) Integer tagId) {
return tourFeign.getGoodList(page, limit, tagId);
public ObjectRestResponse getGoodList(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit", defaultValue = "10") Integer limit,
@RequestParam(value = "tagId", required = false) Integer tagId,
@RequestParam(value = "name",required = false) String name) {
return tourFeign.getGoodList(page, limit, tagId,name);
}
@GetMapping("/detail/{id}")
......@@ -38,12 +40,13 @@ public class GwTourController extends CommonBaseController {
@GetMapping(value = "/shopList")
@IgnoreUserToken
public ObjectRestResponse goodListAll(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "4") Integer limit) {
return ObjectRestResponse.succ(tourFeign.goodListAll(page,limit));
@RequestParam(value = "limit", defaultValue = "4") Integer limit) {
return ObjectRestResponse.succ(tourFeign.goodListAll(page, limit));
}
@GetMapping("/tagList")
@IgnoreUserToken
public ObjectRestResponse getTagList(@RequestParam(value = "isHot",defaultValue = "0")Integer isHot) {
public ObjectRestResponse getTagList(@RequestParam(value = "isHot", defaultValue = "0") Integer isHot) {
return ObjectRestResponse.succ(tourFeign.tagList(isHot));
}
......
package com.xxfc.platform.uccn.rest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.uccn.biz.SearchBiz;
import com.xxfc.platform.uccn.vo.SearchResultVo;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
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;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/17 9:47
*/
@RestController
@RequestMapping("/app/unauth/search")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@Api(tags = "官网*综合搜索")
public class SearchController {
private final SearchBiz searchBiz;
@GetMapping
public ObjectRestResponse<SearchResultVo> search(@RequestParam(value = "keyword",required = false) String keyWord ){
SearchResultVo searchResultVo = searchBiz.searchWithKeyWords(keyWord);
return ObjectRestResponse.succ(searchResultVo);
}
}
......@@ -55,8 +55,9 @@ public class SummitActivityController {
@GetMapping("/list")
public ObjectRestResponse<PageDataVO<SummitActivityVo>> findSummitActivityWithPage(@RequestParam(value = "page", defaultValue = "1", required = false) Integer page,
@RequestParam(value = "limit", defaultValue = "6", required = false) Integer limit,
@RequestParam(value = "location", defaultValue = "0", required = false) Integer location) {
PageDataVO<SummitActivityVo> pageDataVO = summitActivityBiz.findSummitActivityWithPage(page, limit,location);
@RequestParam(value = "location", defaultValue = "0", required = false) Integer location,
@RequestParam(value = "title",required = false) String title) {
PageDataVO<SummitActivityVo> pageDataVO = summitActivityBiz.findSummitActivityWithPage(page, limit,location,title);
return ObjectRestResponse.succ(pageDataVO);
}
......
......@@ -11,6 +11,9 @@
<if test="id != null">
and id != #{id}
</if>
<if test="title !=null and title !=''">
and `title` like concat('%',#{title},'%')
</if>
and (type=#{type} or type=0)
order by
......
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