Commit 6b7c698b authored by libin's avatar libin

Merge branch 'master-ucc-feature' into base-modify

# Conflicts:
#	xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
#	xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/BranchCompanyMapper.java
parents 127049c8 eb902b27
...@@ -17,4 +17,6 @@ public class CampsiteShopFindDTO extends PageParam { ...@@ -17,4 +17,6 @@ public class CampsiteShopFindDTO extends PageParam {
private Integer addrCity; private Integer addrCity;
private Integer type; private Integer type;
private String name;
} }
...@@ -4,11 +4,15 @@ package com.xxfc.platform.campsite.feign; ...@@ -4,11 +4,15 @@ package com.xxfc.platform.campsite.feign;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.GoodDataVO; import com.github.wxiaoqi.security.common.vo.GoodDataVO;
import com.github.wxiaoqi.security.common.vo.PageDataVO; 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.CampsiteShopDetailVo;
import com.xxfc.platform.campsite.vo.CampsiteShopPageVo; import com.xxfc.platform.campsite.vo.CampsiteShopPageVo;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; 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 org.springframework.web.bind.annotation.RequestParam;
import java.util.List; import java.util.List;
...@@ -30,9 +34,10 @@ public interface CampsiteFeign { ...@@ -30,9 +34,10 @@ public interface CampsiteFeign {
@ApiOperation("分页查询营地列表") @ApiOperation("分页查询营地列表")
@GetMapping("/app/unauth/shops") @GetMapping("/app/unauth/shops")
ObjectRestResponse<PageDataVO<CampsiteShopPageVo>> findCampsiteShopPageByType(@RequestParam(value = "type", required = false) Integer type, ObjectRestResponse<PageDataVO<CampsiteShopPageVo>> findCampsiteShopPageByTypeAndName(@RequestParam(value = "type", required = false) Integer type,
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo, @RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", required = false, defaultValue = "6") Integer pageSize); @RequestParam(value = "pageSize", required = false, defaultValue = "6") Integer pageSize,
@RequestParam(value = "name",required = false) String name);
/** /**
* @param longitude 经度 * @param longitude 经度
...@@ -44,4 +49,7 @@ public interface CampsiteFeign { ...@@ -44,4 +49,7 @@ public interface CampsiteFeign {
ObjectRestResponse<CampsiteShopDetailVo> findCampsiteShopDetailById(@RequestParam(value = "id") Integer id, ObjectRestResponse<CampsiteShopDetailVo> findCampsiteShopDetailById(@RequestParam(value = "id") Integer id,
@RequestParam(value = "longitude", required = false) Double longitude, @RequestParam(value = "longitude", required = false) Double longitude,
@RequestParam(value = "latitude", required = false) Double latitude); @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> { ...@@ -91,9 +91,17 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
return JSONObject.parseObject(result, new TypeReference<PageDataVO<CampsiteShopPageVo>>() { 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(); List<CampsiteShopPageDTO> campsiteShopPageDTOS = pageDataVO.getData();
if (CollectionUtils.isEmpty(campsiteShopPageDTOS)) { if (CollectionUtils.isEmpty(campsiteShopPageDTOS)) {
campsiteShopPageDataVO.setPageNum(campsiteShopFindDTO.getPage()); campsiteShopPageDataVO.setPageNum(campsiteShopFindDTO.getPage());
...@@ -106,7 +114,6 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> { ...@@ -106,7 +114,6 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("根据type=【{}】查询到的店铺数据:【{}】", campsiteShopFindDTO.getType(), campsiteShopPageDTOS); log.debug("根据type=【{}】查询到的店铺数据:【{}】", campsiteShopFindDTO.getType(), campsiteShopPageDTOS);
} }
List<CampsiteShopPageVo> campsiteShopPageVoList = new ArrayList<>(); List<CampsiteShopPageVo> campsiteShopPageVoList = new ArrayList<>();
campsiteShopPageDTOS = campsiteShopPageDTOS.stream().distinct().collect(Collectors.toList()); campsiteShopPageDTOS = campsiteShopPageDTOS.stream().distinct().collect(Collectors.toList());
for (CampsiteShopPageDTO campsiteShopPageDTO : campsiteShopPageDTOS) { for (CampsiteShopPageDTO campsiteShopPageDTO : campsiteShopPageDTOS) {
...@@ -115,14 +122,11 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> { ...@@ -115,14 +122,11 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
campsiteShopPageVoList.add(campsiteShopPageVo); campsiteShopPageVoList.add(campsiteShopPageVo);
} }
campsiteShopPageVoList.sort(Comparator.comparing(CampsiteShopPageVo::getHot).reversed().thenComparing(CampsiteShopPageVo::getCrtTime).reversed()); campsiteShopPageVoList.sort(Comparator.comparing(CampsiteShopPageVo::getHot).reversed().thenComparing(CampsiteShopPageVo::getCrtTime).reversed());
campsiteShopPageDataVO.setTotalPage(pageDataVO.getTotalPage()); campsiteShopPageDataVO.setTotalPage(pageDataVO.getTotalPage());
campsiteShopPageDataVO.setTotalCount(pageDataVO.getTotalCount()); campsiteShopPageDataVO.setTotalCount(pageDataVO.getTotalCount());
campsiteShopPageDataVO.setPageSize(pageDataVO.getPageSize()); campsiteShopPageDataVO.setPageSize(pageDataVO.getPageSize());
campsiteShopPageDataVO.setPageNum(pageDataVO.getPageNum()); campsiteShopPageDataVO.setPageNum(pageDataVO.getPageNum());
campsiteShopPageDataVO.setData(campsiteShopPageVoList); campsiteShopPageDataVO.setData(campsiteShopPageVoList);
campHashOperations.put(CAMPSITE_LIST_CACHE_PREKEY,campsite_cache_key,JSONObject.toJSONString(campsiteShopPageDataVO));
return campsiteShopPageDataVO; return campsiteShopPageDataVO;
} }
...@@ -329,6 +333,11 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> { ...@@ -329,6 +333,11 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
return true; return true;
} }
public PageDataVO<CampsiteShopPageVo> findCampsiteShopPageForUncc(CampsiteShopFindDTO campsiteShopFindDTO) {
return findCampsiteShopPageByTypeAndName(campsiteShopFindDTO);
}
private long transformStartTime(Long startTime) { private long transformStartTime(Long startTime) {
return LocalDateTime.ofInstant(new Date(startTime).toInstant(), ZoneOffset.ofHours(+8)) return LocalDateTime.ofInstant(new Date(startTime).toInstant(), ZoneOffset.ofHours(+8))
.withHour(0) .withHour(0)
...@@ -399,4 +408,5 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> { ...@@ -399,4 +408,5 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
s = s * EARTH_RADIUS; s = s * EARTH_RADIUS;
return s; return s;
} }
} }
\ No newline at end of file
...@@ -26,9 +26,10 @@ public interface CampsiteShopMapper extends Mapper<CampsiteShop> { ...@@ -26,9 +26,10 @@ public interface CampsiteShopMapper extends Mapper<CampsiteShop> {
* *
* @param typeId * @param typeId
*/ */
List<CampsiteShopPageDTO> findAllCampsiteShopsByTypeOrCode(@Param("typeId") Integer typeId, List<CampsiteShopPageDTO> findAllCampsiteShopsByTypeOrCodeOrName(@Param("typeId") Integer typeId,
@Param("proviceCode") Integer proviceCode, @Param("proviceCode") Integer proviceCode,
@Param("cityCode") Integer cityCode); @Param("cityCode") Integer cityCode,
@Param("name") String name);
/** /**
* 首页营地列表 * 首页营地列表
...@@ -82,7 +83,7 @@ public interface CampsiteShopMapper extends Mapper<CampsiteShop> { ...@@ -82,7 +83,7 @@ public interface CampsiteShopMapper extends Mapper<CampsiteShop> {
* @param name * @param name
* @return * @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 ...@@ -29,17 +29,22 @@ public class CampsiteShopController extends BaseController<CampsiteShopBiz, Camp
@ApiOperation("分页查询营地列表") @ApiOperation("分页查询营地列表")
@GetMapping("/app/unauth/shops") @GetMapping("/app/unauth/shops")
public ObjectRestResponse<PageDataVO<CampsiteShopPageVo>> findCampsiteShopPageByType(@RequestParam(value = "type", required = false) Integer type, public ObjectRestResponse<PageDataVO<CampsiteShopPageVo>> findCampsiteShopPageByTypeAndName(@RequestParam(value = "type", required = false) Integer type,
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo, @RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", required = false, defaultValue = "6") Integer pageSize) { @RequestParam(value = "pageSize", required = false, defaultValue = "6") Integer pageSize) {
CampsiteShopFindDTO campsiteShopFindDTO = new CampsiteShopFindDTO(); CampsiteShopFindDTO campsiteShopFindDTO = new CampsiteShopFindDTO();
campsiteShopFindDTO.setType(type); campsiteShopFindDTO.setType(type);
campsiteShopFindDTO.setPage(pageNo); campsiteShopFindDTO.setPage(pageNo);
campsiteShopFindDTO.setLimit(pageSize); campsiteShopFindDTO.setLimit(pageSize);
PageDataVO<CampsiteShopPageVo> pageDataVO = getBaseBiz().findCampsiteShopPageByType(campsiteShopFindDTO); PageDataVO<CampsiteShopPageVo> pageDataVO = getBaseBiz().findCampsiteShopPageByType(campsiteShopFindDTO);
return ObjectRestResponse.succ(pageDataVO); 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 经度 * @param longitude 经度
...@@ -49,8 +54,8 @@ public class CampsiteShopController extends BaseController<CampsiteShopBiz, Camp ...@@ -49,8 +54,8 @@ public class CampsiteShopController extends BaseController<CampsiteShopBiz, Camp
@ApiOperation("查询营地详情") @ApiOperation("查询营地详情")
@GetMapping("/app/unauth/shop") @GetMapping("/app/unauth/shop")
public ObjectRestResponse<CampsiteShopDetailVo> findCampsiteShopDetailById(@RequestParam(value = "id") Integer id, public ObjectRestResponse<CampsiteShopDetailVo> findCampsiteShopDetailById(@RequestParam(value = "id") Integer id,
@RequestParam(value = "longitude",required = false) Double longitude, @RequestParam(value = "longitude", required = false) Double longitude,
@RequestParam(value = "latitude",required = false) Double latitude) { @RequestParam(value = "latitude", required = false) Double latitude) {
CampsiteShopDetailVo campsiteShopDetailVo = getBaseBiz().findCampsiteShopDetailById(id, longitude, latitude); CampsiteShopDetailVo campsiteShopDetailVo = getBaseBiz().findCampsiteShopDetailById(id, longitude, latitude);
return ObjectRestResponse.succ(campsiteShopDetailVo); return ObjectRestResponse.succ(campsiteShopDetailVo);
} }
...@@ -58,8 +63,8 @@ public class CampsiteShopController extends BaseController<CampsiteShopBiz, Camp ...@@ -58,8 +63,8 @@ public class CampsiteShopController extends BaseController<CampsiteShopBiz, Camp
@ApiOperation("首页营地列表") @ApiOperation("首页营地列表")
@GetMapping(value = "/app/shopList") @GetMapping(value = "/app/shopList")
public List<GoodDataVO> goodList(@RequestParam(value = "page", defaultValue = "1") Integer page, 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) {
return getBaseBiz().getAllByHome(page,limit); return getBaseBiz().getAllByHome(page, limit);
} }
@ApiOperation("随机获取营地") @ApiOperation("随机获取营地")
...@@ -67,8 +72,9 @@ public class CampsiteShopController extends BaseController<CampsiteShopBiz, Camp ...@@ -67,8 +72,9 @@ public class CampsiteShopController extends BaseController<CampsiteShopBiz, Camp
public ObjectRestResponse findRandomVehicle(Integer number) { public ObjectRestResponse findRandomVehicle(Integer number) {
return baseBiz.findRandomVehicle(number); return baseBiz.findRandomVehicle(number);
} }
@PostMapping(value = "/app/unauth/webchat_official/campsites") @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); PageDataVO<CampsiteShopPageVo> campsiteShops = baseBiz.findCampsiteShopPageByType(campsiteShopFindDTO);
return ObjectRestResponse.succ(campsiteShops); return ObjectRestResponse.succ(campsiteShops);
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</resultMap> </resultMap>
<!--根据类型查询全部--> <!--根据类型查询全部-->
<select id="findAllCampsiteShopsByTypeOrCode" resultType="com.xxfc.platform.campsite.dto.CampsiteShopPageDTO"> <select id="findAllCampsiteShopsByTypeOrCodeOrName" resultType="com.xxfc.platform.campsite.dto.CampsiteShopPageDTO">
SELECT SELECT
cs.id AS `id`, cs.id AS `id`,
cs. NAME AS `name`, cs. NAME AS `name`,
...@@ -63,10 +63,13 @@ ...@@ -63,10 +63,13 @@
and cst.tag_id=#{typeId} and cst.tag_id=#{typeId}
</if> </if>
<if test="proviceCode != null"> <if test="proviceCode != null">
and `province`=#{proviceCode} and cs.`province`=#{proviceCode}
</if> </if>
<if test="cityCode != null"> <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> </if>
GROUP BY cs.id GROUP BY cs.id
order by cs.hot DESC,cs.crt_time DESC order by cs.hot DESC,cs.crt_time DESC
......
...@@ -37,6 +37,7 @@ public interface TourFeign { ...@@ -37,6 +37,7 @@ public interface TourFeign {
/** /**
* 计算价格 * 计算价格
*
* @param spePriceDto * @param spePriceDto
* @return * @return
*/ */
...@@ -44,10 +45,9 @@ public interface TourFeign { ...@@ -44,10 +45,9 @@ public interface TourFeign {
public ObjectRestResponse<TourSpePriceVo> refund(@RequestBody TourSpePriceDTO spePriceDto); public ObjectRestResponse<TourSpePriceVo> refund(@RequestBody TourSpePriceDTO spePriceDto);
/** /**
*
* @param speId * @param speId
* @param number * @param number
* @param type 1--减库存,2--加库存 * @param type 1--减库存,2--加库存
* @return * @return
*/ */
@RequestMapping(value = "/spe/stock", method = RequestMethod.GET) @RequestMapping(value = "/spe/stock", method = RequestMethod.GET)
...@@ -58,13 +58,14 @@ public interface TourFeign { ...@@ -58,13 +58,14 @@ public interface TourFeign {
public ObjectRestResponse<TourGood> usableGet(@PathVariable(value = "id") int id); public ObjectRestResponse<TourGood> usableGet(@PathVariable(value = "id") int id);
@GetMapping("/tourUser/app/unauth/getTourUsers") @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") @GetMapping("/tourGood/verfication/entityList")
public ObjectRestResponse<List<TourGoodVerification>> entityList(@RequestParam("entity") Map<String, Object> entity); public ObjectRestResponse<List<TourGoodVerification>> entityList(@RequestParam("entity") Map<String, Object> entity);
/** /**
* 更新发车状态 * 更新发车状态
*
* @param verficationId * @param verficationId
* @return * @return
*/ */
...@@ -73,15 +74,17 @@ public interface TourFeign { ...@@ -73,15 +74,17 @@ public interface TourFeign {
/** /**
* 更新总人数或上车人数 * 更新总人数或上车人数
*
* @param verficationId * @param verficationId
* @param properties * @param properties
* @return * @return
*/ */
@PutMapping("/tourGood/verfication/personnums") @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 * @param tourGoodOrderFindVo
* @return * @return
*/ */
...@@ -91,11 +94,11 @@ public interface TourFeign { ...@@ -91,11 +94,11 @@ public interface TourFeign {
@ApiOperation("首页旅游列表") @ApiOperation("首页旅游列表")
@GetMapping(value = "/tourGood/app/shopList") @GetMapping(value = "/tourGood/app/shopList")
public List<GoodDataVO> goodList(@RequestParam(value = "page", defaultValue = "1") Integer page, 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) @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") @GetMapping("/tourGoodSite/departure_time")
Long selectDepartureTimeByStartCompanyIdAndRouteId(@RequestParam(value = "companyId") Integer companyId, @RequestParam(value = "goodId") Integer routeId); Long selectDepartureTimeByStartCompanyIdAndRouteId(@RequestParam(value = "companyId") Integer companyId, @RequestParam(value = "goodId") Integer routeId);
...@@ -107,13 +110,15 @@ public interface TourFeign { ...@@ -107,13 +110,15 @@ public interface TourFeign {
Date selectDepartureDataBySpeId(@RequestParam(value = "speIds") Integer speIds); Date selectDepartureDataBySpeId(@RequestParam(value = "speIds") Integer speIds);
@GetMapping(value = "/tourGood/app/unauth/findRandomVehicle") @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) @RequestMapping(value = "/gw/app/unauth/getGoodList", method = RequestMethod.GET)
ObjectRestResponse getGoodList(@RequestParam(value = "page",defaultValue = "1") Integer page, ObjectRestResponse<PageDataVO<TourGood>> getGoodList(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "10") Integer limit, @RequestParam(value = "limit", defaultValue = "10") Integer limit,
@RequestParam(value = "tagId", required = false) Integer tagId); @RequestParam(value = "tagId", required = false) Integer tagId,
@RequestParam(value = "name", required = false) String name);
//获取公司详情 //获取公司详情
@GetMapping("/gw/app/unauth/detail/{id}") @GetMapping("/gw/app/unauth/detail/{id}")
ObjectRestResponse getOne(@PathVariable Integer id); ObjectRestResponse getOne(@PathVariable Integer id);
...@@ -121,11 +126,11 @@ public interface TourFeign { ...@@ -121,11 +126,11 @@ public interface TourFeign {
//首页旅游列表 //首页旅游列表
@GetMapping(value = "/gw/shopList") @GetMapping(value = "/gw/shopList")
List<GoodDataVO> goodListAll(@RequestParam(value = "page", defaultValue = "1") Integer page, 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") @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> { ...@@ -63,7 +63,7 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
* @param distance * @param distance
* @return * @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); Map<String, Object> params = initParam(page, limit, query, latitude, longitude, tagId, distance);
PageDataVO<TourGood> dataVO=null; PageDataVO<TourGood> dataVO=null;
if(latitude!=null&&latitude>0&&longitude!=null&&longitude>0){ if(latitude!=null&&latitude>0&&longitude!=null&&longitude>0){
......
...@@ -4,6 +4,7 @@ import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken; ...@@ -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.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.vo.GoodDataVO; 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.TourGoodBiz;
import com.xxfc.platform.tour.dto.GoodSearchDTO; import com.xxfc.platform.tour.dto.GoodSearchDTO;
import com.xxfc.platform.tour.entity.TourGood; import com.xxfc.platform.tour.entity.TourGood;
...@@ -33,10 +34,10 @@ public class TourGoodController extends BaseController<TourGoodBiz, TourGood> { ...@@ -33,10 +34,10 @@ public class TourGoodController extends BaseController<TourGoodBiz, TourGood> {
@RequestMapping(value = "/app/unauth/getGoodList", method = RequestMethod.GET) @RequestMapping(value = "/app/unauth/getGoodList", method = RequestMethod.GET)
@IgnoreClientToken @IgnoreClientToken
@ResponseBody @ResponseBody
public ObjectRestResponse<TourGood> getGoodList(@RequestParam(value = "page", required = true) Integer page, @RequestParam(value = "limit",defaultValue = "10") Integer limit, 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 = "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 = "longitude", required = false) Double longitude, @RequestParam(value = "tagId", required = false) Integer tagId,
@RequestParam(value = "distance", defaultValue = "100") Double distance) { @RequestParam(value = "distance", defaultValue = "100") Double distance) {
return baseBiz.getGoodList(page, limit, query, latitude, longitude, tagId, distance); return baseBiz.getGoodList(page, limit, query, latitude, longitude, tagId, distance);
} }
......
...@@ -5,6 +5,7 @@ import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken; ...@@ -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.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.vo.GoodDataVO; 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.TourGoodBiz;
import com.xxfc.platform.tour.biz.TourGoodDetailBiz; import com.xxfc.platform.tour.biz.TourGoodDetailBiz;
import com.xxfc.platform.tour.biz.TourTagBiz; import com.xxfc.platform.tour.biz.TourTagBiz;
...@@ -38,10 +39,11 @@ public class TourGwController extends BaseController<TourGoodBiz, TourGood> { ...@@ -38,10 +39,11 @@ public class TourGwController extends BaseController<TourGoodBiz, TourGood> {
*/ */
@ApiOperation("查询旅游路线列表") @ApiOperation("查询旅游路线列表")
@RequestMapping(value = "/app/unauth/getGoodList", method = RequestMethod.GET) @RequestMapping(value = "/app/unauth/getGoodList", method = RequestMethod.GET)
public ObjectRestResponse getGoodList(@RequestParam(value = "page",defaultValue = "1") Integer page, public ObjectRestResponse<PageDataVO<TourGood>> getGoodList(@RequestParam(value = "page",defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "10") Integer limit, @RequestParam(value = "limit",defaultValue = "10") Integer limit,
@RequestParam(value = "tagId", required = false) Integer tagId) { @RequestParam(value = "tagId", required = false) Integer tagId,
return baseBiz.getGoodList(page, limit, "", null, null, tagId, null); @RequestParam(value = "name",required = false) String name) {
return baseBiz.getGoodList(page, limit, name, null, null, tagId, null);
} }
@GetMapping("/app/unauth/detail/{id}") @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> { ...@@ -43,9 +43,9 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
* @param type * @param type
* @return * @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); PageHelper.startPage(page, limit);
List articleList = mapper.getArticleList(type,null,null); List articleList = mapper.getArticleList(type,null,null,title);
return PageInfo.of(articleList); return PageInfo.of(articleList);
} }
...@@ -81,7 +81,7 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> { ...@@ -81,7 +81,7 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
*/ */
public List getThree( Integer type, Integer number, Integer id) { public List getThree( Integer type, Integer number, Integer id) {
number = number == null ? RANDOM_NUMBER : number; 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)) { if (!Objects.isNull(articleList)) {
int size = articleList.size(); int size = articleList.size();
if (number >= size) { if (number >= size) {
...@@ -108,7 +108,7 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> { ...@@ -108,7 +108,7 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
* @return * @return
*/ */
public List getHomePageArticle(Integer type) { 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)) { // if (Objects.isNull(articleList)) {
// return new ArrayList(); // return new ArrayList();
// } else { // } else {
......
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;
import com.xxfc.platform.campsite.dto.CampsiteShopFindDTO;
import com.xxfc.platform.campsite.feign.CampsiteFeign;
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;
import com.xxfc.platform.vehicle.entity.VehiclePlatCata;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition;
import com.xxfc.platform.vehicle.pojo.VehicleModelVo;
import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyFindDTO;
import com.xxfc.platform.vehicle.pojo.vo.BranchCompanyListVO;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.stream.Collectors;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/17 10:19
*/
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class SearchBiz {
/**
* 车型与分公司
*/
private final VehicleFeign vehicleFeign;
/**
* 旅游
*/
private final TourFeign tourFeign;
/**
* 营地
*/
private final CampsiteFeign campsiteFeign;
/**
* 新闻
*/
private final ArticleBiz articleBiz;
/**
* 活动
*/
private final SummitActivityBiz summitActivityBiz;
/**
* 业务个数
*/
private static final int SERVICE_COUNT = 5;
private final ThreadPoolTaskExecutor threadPoolTaskExecutor;
/**
* 综合搜索
*
* @param keyWord 关键字
* @return
*/
public SearchResultVo searchWithKeyWords(String keyWord) {
SearchResultVo searchResultVo = new SearchResultVo();
CountDownLatch latch = new CountDownLatch(SERVICE_COUNT);
//车型
threadPoolTaskExecutor.execute(new Runnable() {
@Override
public void run() {
try {
ServiceResultVo<VehicleModelVo> vehicleModelVoServiceResultVo = new ServiceResultVo<>();
VehicleModelQueryCondition vmqc = new VehicleModelQueryCondition();
vmqc.setNotInIds("67");
vmqc.setPage(1);
vmqc.setLimit(ServiceConstant.VEHICLE_LIMIT);
vmqc.setVehicleName(keyWord);
ObjectRestResponse<PageDataVO<VehicleModelVo>> objectRestResponse = vehicleFeign.findVehicleModelPageUnauthfind(vmqc);
PageDataVO<VehicleModelVo> pageDataVOs = objectRestResponse.getData();
pageDataVOs.getData().forEach(v -> {
v.setUccnCataList(initUccnCataCollect(v.getConfig()));
});
vehicleModelVoServiceResultVo.setTotalCount(pageDataVOs.getTotalCount());
vehicleModelVoServiceResultVo.setData(pageDataVOs.getData());
searchResultVo.put(ServiceConstant.VEHICLE, vehicleModelVoServiceResultVo);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
latch.countDown();
}
}
});
//分公司
threadPoolTaskExecutor.execute(new Runnable() {
@Override
public void run() {
try {
ServiceResultVo<BranchCompanyListVO> branchCompanyListVOServiceResultVo = new ServiceResultVo<>();
BranchCompanyFindDTO branchCompanyFindDTO = new BranchCompanyFindDTO();
branchCompanyFindDTO.setPage(1);
branchCompanyFindDTO.setLimit(ServiceConstant.BRANCH_COMPANY_LIMIT);
branchCompanyFindDTO.setName(keyWord);
PageDataVO<BranchCompanyListVO> branchCompanyWithPage = vehicleFeign.findBranchCompanyWithPage(branchCompanyFindDTO);
branchCompanyListVOServiceResultVo.setTotalCount(branchCompanyWithPage.getTotalCount());
branchCompanyListVOServiceResultVo.setData(branchCompanyWithPage.getData());
searchResultVo.put(ServiceConstant.BRANCH_COMPANY, branchCompanyListVOServiceResultVo);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
latch.countDown();
}
}
});
//旅游
threadPoolTaskExecutor.execute(new Runnable() {
@Override
public void run() {
try {
ServiceResultVo<TourGood> tourGoodServiceResultVo = new ServiceResultVo<>();
ObjectRestResponse<PageDataVO<TourGood>> goodList = tourFeign.getGoodList(1, ServiceConstant.TOUR_LIMIT, null, keyWord);
PageDataVO<TourGood> data = goodList.getData();
tourGoodServiceResultVo.setData(data.getData());
tourGoodServiceResultVo.setTotalCount(data.getTotalCount());
searchResultVo.put(ServiceConstant.TROUR, tourGoodServiceResultVo);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
latch.countDown();
}
}
});
//营地
threadPoolTaskExecutor.execute(new Runnable() {
@Override
public void run() {
try {
ServiceResultVo<CampsiteShopPageVo> campsiteShopPageVoServiceResultVo = new ServiceResultVo<>();
CampsiteShopFindDTO campsiteShopFindDTO = new CampsiteShopFindDTO();
campsiteShopFindDTO.setPage(1);
campsiteShopFindDTO.setLimit(ServiceConstant.CAMPSITE_LIMIT);
campsiteShopFindDTO.setName(keyWord);
ObjectRestResponse<PageDataVO<CampsiteShopPageVo>> campsiteShopPageForUncc = campsiteFeign.findCampsiteShopPageForUncc(campsiteShopFindDTO);
PageDataVO<CampsiteShopPageVo> data = campsiteShopPageForUncc.getData();
campsiteShopPageVoServiceResultVo.setData(data.getData());
campsiteShopPageVoServiceResultVo.setTotalCount(data.getTotalCount());
searchResultVo.put(ServiceConstant.CAMPSITE, campsiteShopPageVoServiceResultVo);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
latch.countDown();
}
}
});
//活动
threadPoolTaskExecutor.execute(new Runnable() {
@Override
public void run() {
try {
ServiceResultVo<SummitActivityVo> activityVoServiceResultVo = new ServiceResultVo<>();
PageDataVO<SummitActivityVo> summitActivityWithPage = summitActivityBiz.findSummitActivityWithPage(1, ServiceConstant.ACTIVITY_LIMIT, null, keyWord);
activityVoServiceResultVo.setTotalCount(summitActivityWithPage.getTotalCount());
activityVoServiceResultVo.setData(summitActivityWithPage.getData());
searchResultVo.put(ServiceConstant.ACTIVITY, activityVoServiceResultVo);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
latch.countDown();
}
}
});
//新闻
threadPoolTaskExecutor.execute(new Runnable() {
@Override
public void run() {
try {
ServiceResultVo<Article> articleServiceResultVo = new ServiceResultVo<>();
PageInfo articleList = articleBiz.getArticleList(1, ServiceConstant.NEWS_LIMIT, 1, keyWord);
articleServiceResultVo.setData(articleList.getList());
articleServiceResultVo.setTotalCount(articleList.getTotal());
searchResultVo.put(ServiceConstant.NEWS, articleServiceResultVo);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
latch.countDown();
}
}
});
try {
latch.await();
} catch (InterruptedException e) {
throw new BaseException(e);
}
return searchResultVo;
}
private List<VehiclePlatCata> initUccnCataCollect(String modelConfig) {
List<VehiclePlatCata> vehiclePlatCataList = vehicleFeign.getCatasByIds(modelConfig).getData();
int[] array = StrUtil.splitToInt("14,7,11", ",");
return vehiclePlatCataList.parallelStream()
.filter(v1 -> {
return ArrayUtil.contains(array, v1.getParentId());
})
.sorted(Comparator.comparing(VehiclePlatCata::getParentId, (x, y) -> {
int xx = 0, yy = 0;
for (int i = 0; i < array.length; i++) {
if (x == array[i]) {
xx = i;
} else if (y == array[i]) {
yy = i;
}
}
return (xx - yy);
})).collect(Collectors.toList());
}
}
...@@ -204,7 +204,7 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv ...@@ -204,7 +204,7 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv
return summitActivityVos; 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<>(); PageDataVO<SummitActivityVo> dataVO = new PageDataVO<>();
Example example = new Example(SummitActivity.class); Example example = new Example(SummitActivity.class);
...@@ -218,6 +218,10 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv ...@@ -218,6 +218,10 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv
criteria.andEqualTo("isShow", 1); criteria.andEqualTo("isShow", 1);
//位置 //位置
criteria.andIn("location", Arrays.asList(location, 0)); 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)); PageDataVO<SummitActivity> summitActivityPageDataVO = PageDataVO.pageInfo(page, limit, () -> mapper.selectByExample(example));
List<SummitActivity> summitActivities = summitActivityPageDataVO.getData(); List<SummitActivity> summitActivities = summitActivityPageDataVO.getData();
if (CollectionUtils.isEmpty(summitActivities)){ if (CollectionUtils.isEmpty(summitActivities)){
......
...@@ -17,5 +17,5 @@ public interface ArticleMapper extends Mapper<Article> { ...@@ -17,5 +17,5 @@ public interface ArticleMapper extends Mapper<Article> {
* @param id 当前文章id ,无就传null * @param id 当前文章id ,无就传null
* @return * @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> { ...@@ -25,8 +25,9 @@ public class ArticleController extends BaseController<ArticleBiz, Article> {
public ObjectRestResponse getArticleList( public ObjectRestResponse getArticleList(
@RequestParam(name = "page", defaultValue = "1") Integer page, @RequestParam(name = "page", defaultValue = "1") Integer page,
@RequestParam(name = "limit", defaultValue = "10") Integer limit, @RequestParam(name = "limit", defaultValue = "10") Integer limit,
@RequestParam(name = "type", defaultValue = "1") Integer type) { @RequestParam(name = "type", defaultValue = "1") Integer type,
return ObjectRestResponse.succ(baseBiz.getArticleList(page, limit, type)); @RequestParam(value = "title",required = false) String title) {
return ObjectRestResponse.succ(baseBiz.getArticleList(page, limit, type,title));
} }
@GetMapping("/app/unauth/one") @GetMapping("/app/unauth/one")
......
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.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyFindDTO;
import com.xxfc.platform.vehicle.pojo.vo.BranchCompanyListVO;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/17 15:24
*/
@RestController
@RequestMapping("/app/unauth/branch_company")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class BranchCompanyController {
private final VehicleFeign vehicleFeign;
@PostMapping("/page")
public ObjectRestResponse<PageDataVO> listBranchCompanyWithPage(@RequestBody BranchCompanyFindDTO branchCompanyFindDTO) {
PageDataVO<BranchCompanyListVO> branchCompanyWithPage = vehicleFeign.findBranchCompanyWithPage(branchCompanyFindDTO);
return ObjectRestResponse.succ(branchCompanyWithPage);
}
}
...@@ -2,6 +2,7 @@ package com.xxfc.platform.uccn.rest; ...@@ -2,6 +2,7 @@ package com.xxfc.platform.uccn.rest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO; 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.feign.CampsiteFeign;
import com.xxfc.platform.campsite.vo.CampsiteShopDetailVo; import com.xxfc.platform.campsite.vo.CampsiteShopDetailVo;
import com.xxfc.platform.campsite.vo.CampsiteShopPageVo; import com.xxfc.platform.campsite.vo.CampsiteShopPageVo;
...@@ -31,8 +32,14 @@ public class CampsiteUccnController { ...@@ -31,8 +32,14 @@ public class CampsiteUccnController {
@GetMapping("/shops") @GetMapping("/shops")
public ObjectRestResponse<PageDataVO<CampsiteShopPageVo>> findCampsiteShopPageByType(@RequestParam(value = "type", required = false) Integer type, public ObjectRestResponse<PageDataVO<CampsiteShopPageVo>> findCampsiteShopPageByType(@RequestParam(value = "type", required = false) Integer type,
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo, @RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", required = false, defaultValue = "6") Integer pageSize) { @RequestParam(value = "pageSize", required = false, defaultValue = "6") Integer pageSize,
return campsiteFeign.findCampsiteShopPageByType(type, pageNo, 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 { ...@@ -23,9 +23,11 @@ public class GwTourController extends CommonBaseController {
@ApiOperation("查询旅游路线列表") @ApiOperation("查询旅游路线列表")
@RequestMapping(value = "/getGoodList", method = RequestMethod.GET) @RequestMapping(value = "/getGoodList", method = RequestMethod.GET)
@IgnoreUserToken @IgnoreUserToken
public ObjectRestResponse getGoodList(@RequestParam(value = "page",defaultValue = "1") Integer page, @RequestParam(value = "limit",defaultValue = "10") Integer limit, public ObjectRestResponse getGoodList(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "tagId", required = false) Integer tagId) { @RequestParam(value = "limit", defaultValue = "10") Integer limit,
return tourFeign.getGoodList(page, limit, tagId); @RequestParam(value = "tagId", required = false) Integer tagId,
@RequestParam(value = "name",required = false) String name) {
return tourFeign.getGoodList(page, limit, tagId,name);
} }
@GetMapping("/detail/{id}") @GetMapping("/detail/{id}")
...@@ -38,12 +40,13 @@ public class GwTourController extends CommonBaseController { ...@@ -38,12 +40,13 @@ public class GwTourController extends CommonBaseController {
@GetMapping(value = "/shopList") @GetMapping(value = "/shopList")
@IgnoreUserToken @IgnoreUserToken
public ObjectRestResponse goodListAll(@RequestParam(value = "page", defaultValue = "1") Integer page, public ObjectRestResponse goodListAll(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "4") Integer limit) { @RequestParam(value = "limit", defaultValue = "4") Integer limit) {
return ObjectRestResponse.succ(tourFeign.goodListAll(page,limit)); return ObjectRestResponse.succ(tourFeign.goodListAll(page, limit));
} }
@GetMapping("/tagList") @GetMapping("/tagList")
@IgnoreUserToken @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)); 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 { ...@@ -55,8 +55,9 @@ public class SummitActivityController {
@GetMapping("/list") @GetMapping("/list")
public ObjectRestResponse<PageDataVO<SummitActivityVo>> findSummitActivityWithPage(@RequestParam(value = "page", defaultValue = "1", required = false) Integer page, 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 = "limit", defaultValue = "6", required = false) Integer limit,
@RequestParam(value = "location", defaultValue = "0", required = false) Integer location) { @RequestParam(value = "location", defaultValue = "0", required = false) Integer location,
PageDataVO<SummitActivityVo> pageDataVO = summitActivityBiz.findSummitActivityWithPage(page, limit,location); @RequestParam(value = "title",required = false) String title) {
PageDataVO<SummitActivityVo> pageDataVO = summitActivityBiz.findSummitActivityWithPage(page, limit,location,title);
return ObjectRestResponse.succ(pageDataVO); return ObjectRestResponse.succ(pageDataVO);
} }
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
<if test="id != null"> <if test="id != null">
and id != #{id} and id != #{id}
</if> </if>
<if test="title !=null and title !=''">
and `title` like concat('%',#{title},'%')
</if>
and (type=#{type} or type=0) and (type=#{type} or type=0)
order by order by
......
...@@ -6,8 +6,10 @@ import com.github.wxiaoqi.security.common.vo.PageDataVO; ...@@ -6,8 +6,10 @@ import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.vehicle.common.RestResponse; import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.entity.*; import com.xxfc.platform.vehicle.entity.*;
import com.xxfc.platform.vehicle.pojo.*; import com.xxfc.platform.vehicle.pojo.*;
import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyFindDTO;
import com.xxfc.platform.vehicle.pojo.vo.AccompanyingItemVo; import com.xxfc.platform.vehicle.pojo.vo.AccompanyingItemVo;
import com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo; import com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo;
import com.xxfc.platform.vehicle.pojo.vo.BranchCompanyListVO;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -153,6 +155,14 @@ public interface VehicleFeign { ...@@ -153,6 +155,14 @@ public interface VehicleFeign {
@GetMapping("/vehicleInfo/findwith_plate_number") @GetMapping("/vehicleInfo/findwith_plate_number")
List<String> findbyPlateNumber(@RequestParam(value = "plateNumber") String plateNumber); List<String> findbyPlateNumber(@RequestParam(value = "plateNumber") String plateNumber);
/**
* 根据位置查询
* @param branchCompanyFindDTO
* @return
*/
@PostMapping("/branchCompany/app/unauth/companys")
PageDataVO<BranchCompanyListVO> findBranchCompanyWithPage(@RequestBody BranchCompanyFindDTO branchCompanyFindDTO);
@GetMapping("/vehicleInfo/findVehicleIds") @GetMapping("/vehicleInfo/findVehicleIds")
List<String> findbyPlateNumberAndVehicleCod(@RequestParam(value = "plateNumber") String plateNumber,@RequestParam(value = "vehicleCode") String vehicleCode); List<String> findbyPlateNumberAndVehicleCod(@RequestParam(value = "plateNumber") String plateNumber,@RequestParam(value = "vehicleCode") String vehicleCode);
} }
...@@ -15,4 +15,6 @@ public class BranchCompanyFindDTO extends PageParam { ...@@ -15,4 +15,6 @@ public class BranchCompanyFindDTO extends PageParam {
private Integer addrProvince; private Integer addrProvince;
private Integer addrCity; private Integer addrCity;
private String name;
} }
package com.xxfc.platform.vehicle.pojo.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/17 14:48
*/
@Data
@Builder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
public class VehiclePlatCataVo {
private Integer id;
private String name;
}
...@@ -375,7 +375,7 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany ...@@ -375,7 +375,7 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
public PageDataVO<BranchCompanyListVO> findBranchCompanyWithPage(BranchCompanyFindDTO branchCompanyFindDTO) { public PageDataVO<BranchCompanyListVO> findBranchCompanyWithPage(BranchCompanyFindDTO branchCompanyFindDTO) {
PageDataVO<BranchCompanyListVO> pageDataVO = new PageDataVO<>(); PageDataVO<BranchCompanyListVO> pageDataVO = new PageDataVO<>();
PageDataVO<BranchCompanyListDTO> dataVO = PageDataVO.pageInfo(branchCompanyFindDTO.getPage(), branchCompanyFindDTO.getLimit(), () -> mapper.findBranchCompanys(branchCompanyFindDTO.getAddrProvince(), branchCompanyFindDTO.getAddrCity())); PageDataVO<BranchCompanyListDTO> dataVO = PageDataVO.pageInfo(branchCompanyFindDTO.getPage(), branchCompanyFindDTO.getLimit(), () -> mapper.findBranchCompanys(branchCompanyFindDTO.getAddrProvince(), branchCompanyFindDTO.getAddrCity(),branchCompanyFindDTO.getName()));
List<BranchCompanyListDTO> data = dataVO.getData(); List<BranchCompanyListDTO> data = dataVO.getData();
if (CollectionUtils.isEmpty(data)) { if (CollectionUtils.isEmpty(data)) {
return pageDataVO; return pageDataVO;
......
...@@ -3,7 +3,9 @@ package com.xxfc.platform.vehicle.biz; ...@@ -3,7 +3,9 @@ package com.xxfc.platform.vehicle.biz;
import com.ace.cache.annotation.Cache; import com.ace.cache.annotation.Cache;
import com.ace.cache.annotation.CacheClear; import com.ace.cache.annotation.CacheClear;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.exception.BaseException; import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
...@@ -16,7 +18,9 @@ import com.xxfc.platform.vehicle.entity.VehiclePlatCata; ...@@ -16,7 +18,9 @@ import com.xxfc.platform.vehicle.entity.VehiclePlatCata;
import com.xxfc.platform.vehicle.mapper.VehiclePlatCataMapper; import com.xxfc.platform.vehicle.mapper.VehiclePlatCataMapper;
import com.xxfc.platform.vehicle.pojo.Cascade; import com.xxfc.platform.vehicle.pojo.Cascade;
import com.xxfc.platform.vehicle.pojo.CataVo; import com.xxfc.platform.vehicle.pojo.CataVo;
import com.xxfc.platform.vehicle.pojo.vo.VehiclePlatCataVo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.assertj.core.util.Arrays; import org.assertj.core.util.Arrays;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -492,4 +496,19 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl ...@@ -492,4 +496,19 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
} }
return vpcMap; return vpcMap;
} }
public List<VehiclePlatCataVo> findVehicleCategoryByParentId(Integer parentId){
List<VehiclePlatCataVo> cataVos = new ArrayList<>();
Example example = new Example(VehiclePlatCata.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("parentId",parentId);
criteria.andEqualTo("state",0);
List<VehiclePlatCata> vehiclePlatCatas = mapper.selectByExample(example);
if (CollectionUtils.isEmpty(vehiclePlatCatas)){
return cataVos;
}
cataVos= JSON.parseObject(JSON.toJSONString(vehiclePlatCatas), new TypeReference<List<VehiclePlatCataVo>>() {
});
return cataVos;
}
} }
...@@ -18,6 +18,7 @@ public interface BranchCompanyMapper extends Mapper<BranchCompany>, SelectByIdLi ...@@ -18,6 +18,7 @@ public interface BranchCompanyMapper extends Mapper<BranchCompany>, SelectByIdLi
List<Integer> findCompanyIdsByAreaId(@Param("areaId") Integer areaId); List<Integer> findCompanyIdsByAreaId(@Param("areaId") Integer areaId);
List<BranchCompanyListDTO > findBranchCompanys(@Param("provinceCode") Integer provinceCode,@Param("cityCode") Integer cityCode,@Param("name") String name);
List<BranchCompanyListDTO > findBranchCompanys(@Param("provinceCode") Integer provinceCode,@Param("cityCode") Integer cityCode); List<BranchCompanyListDTO > findBranchCompanys(@Param("provinceCode") Integer provinceCode,@Param("cityCode") Integer cityCode);
......
...@@ -202,8 +202,8 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> { ...@@ -202,8 +202,8 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
} }
@PostMapping("/app/unauth/companys") @PostMapping("/app/unauth/companys")
public ObjectRestResponse<PageDataVO<BranchCompanyListVO>> findBranchCompanyWithPage(@RequestBody BranchCompanyFindDTO branchCompanyFindDTO){ public PageDataVO<BranchCompanyListVO> findBranchCompanyWithPage(@RequestBody BranchCompanyFindDTO branchCompanyFindDTO){
PageDataVO<BranchCompanyListVO> pageDataVO = baseBiz.findBranchCompanyWithPage(branchCompanyFindDTO); PageDataVO<BranchCompanyListVO> pageDataVO = baseBiz.findBranchCompanyWithPage(branchCompanyFindDTO);
return ObjectRestResponse.succ(pageDataVO); return pageDataVO;
} }
} }
...@@ -11,6 +11,7 @@ import com.xxfc.platform.vehicle.common.VehicleBaseController; ...@@ -11,6 +11,7 @@ import com.xxfc.platform.vehicle.common.VehicleBaseController;
import com.xxfc.platform.vehicle.entity.VehiclePlatCata; import com.xxfc.platform.vehicle.entity.VehiclePlatCata;
import com.xxfc.platform.vehicle.pojo.Cascade; import com.xxfc.platform.vehicle.pojo.Cascade;
import com.xxfc.platform.vehicle.pojo.CataVo; import com.xxfc.platform.vehicle.pojo.CataVo;
import com.xxfc.platform.vehicle.pojo.vo.VehiclePlatCataVo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -185,6 +186,16 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata ...@@ -185,6 +186,16 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
return baseBiz.setIsore(id,isMore); return baseBiz.setIsore(id,isMore);
} }
/**
* 根据类型id查询分类
* @param type
* @return
*/
@GetMapping("/types")
public ObjectRestResponse<List<VehiclePlatCataVo>> findVehiclePlatCate(@RequestParam(value = "type",required = false,defaultValue = "7") Integer type){
List<VehiclePlatCataVo> category = baseBiz.findVehicleCategoryByParentId(type);
return ObjectRestResponse.succ(category);
}
......
...@@ -70,7 +70,11 @@ ...@@ -70,7 +70,11 @@
bc.longitude, bc.longitude,
bc.latitude bc.latitude
FROM FROM
(SELECT * FROM `branch_company` WHERE `is_del`=0 AND `state`=1) AS `bc` (SELECT * FROM `branch_company` WHERE `is_del`=0 AND `state`=1
<if test="name !=null and name !='' ">
and name like concat('%',#{name},'%')
</if>
) AS `bc`
INNER JOIN (SELECT * FROM `company_base` WHERE `is_del`=0 INNER JOIN (SELECT * FROM `company_base` WHERE `is_del`=0
<if test="provinceCode != null"> <if test="provinceCode != null">
AND `addr_province`=#{provinceCode} AND `addr_province`=#{provinceCode}
......
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