Commit 59c506c4 authored by 周健威's avatar 周健威

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

parents d645c5b1 3642229b
...@@ -36,7 +36,7 @@ public class TourGoodController extends BaseController<TourGoodBiz, TourGood> { ...@@ -36,7 +36,7 @@ public class TourGoodController extends BaseController<TourGoodBiz, TourGood> {
public ObjectRestResponse<TourGood> getGoodList(@RequestParam(value = "page", required = true) Integer page, @RequestParam(value = "limit",defaultValue = "10") Integer limit, 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 = "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.00") Double distance) { @RequestParam(value = "distance", defaultValue = "0.00") Double distance) {
return baseBiz.getGoodList(page, limit, query, latitude, longitude, tagId, distance); return baseBiz.getGoodList(page, limit, query, latitude, longitude, tagId, distance);
} }
......
...@@ -59,7 +59,10 @@ ...@@ -59,7 +59,10 @@
IFNULL(ROUND(( (2 * ASIN( SQRT( POW( SIN((latitude * PI() / 180.0- #{params.latitude}* PI() / 180.0)/2), 2)+COS( latitude * PI() / 180.0)*COS( #{params.latitude} * PI() / 180.0) IFNULL(ROUND(( (2 * ASIN( SQRT( POW( SIN((latitude * PI() / 180.0- #{params.latitude}* PI() / 180.0)/2), 2)+COS( latitude * PI() / 180.0)*COS( #{params.latitude} * PI() / 180.0)
*POW(SIN((longitude * PI() / 180.0 - #{params.longitude}* PI() /180.0)/2),2))))*6378.137)*10000)/10000 ,0 ) AS distance *POW(SIN((longitude * PI() / 180.0 - #{params.longitude}* PI() /180.0)/2),2))))*6378.137)*10000)/10000 ,0 ) AS distance
FROM tour_good_site WHERE type=2 ) gs ON t.id=gs.good_id FROM tour_good_site WHERE type=2 ) gs ON t.id=gs.good_id
where t.is_del=0 AND t.status=1 and gs.distance &lt; #{params.distance} where t.is_del=0 AND t.status=1
<if test="params.distance != null and params.distance != ''and params.distance >0">
and gs.distance &lt; #{params.distance}
</if>
<if test="params.query != null and params.query != ''"> <if test="params.query != null and params.query != ''">
and (t.`name` like CONCAT('%',#{params.query},'%') or t.introduce like CONCAT('%',#{params.query},'%')) and (t.`name` like CONCAT('%',#{params.query},'%') or t.introduce like CONCAT('%',#{params.query},'%'))
</if> </if>
......
package com.xxfc.platform.user.behavior.common; package com.xxfc.platform.user.behavior.common;
/** /**
* @author libin * @author libin
* @version 1.0 * @version 1.0
...@@ -7,4 +8,68 @@ package com.xxfc.platform.user.behavior.common; ...@@ -7,4 +8,68 @@ package com.xxfc.platform.user.behavior.common;
*/ */
public enum BehaviorEnum { public enum BehaviorEnum {
/**
* 弹窗曝光
*/
DIALOG_WINDOW(0, "弹窗曝光"),
/**
* 立即前往(弹窗)
*/
DIALOG_WINDOW_TO(1, "立即前往"),
/**
* banner 点击
*/
BANNER_CLICK(2, "banner点击"),
/**
* 精彩活动点击
*/
WONDERFUL_ACTIVITY_CLICK(3, "精彩活动点击"),
/**
* 注册
*/
REGISTRY(4, "注册"),
/**
* 领取任务
*/
CLAIM_TASK(5, "领取任务"),
/**
* 分享
*/
SHARE(6, "分享"),
/**
* 邀请
*/
INVITATION(7, "邀请");
BehaviorEnum(int code, String name) {
this.code = code;
this.name = name;
}
private int code;
private String name;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
} }
...@@ -37,4 +37,6 @@ public class CustomerBehaviorNoteDTO implements Serializable { ...@@ -37,4 +37,6 @@ public class CustomerBehaviorNoteDTO implements Serializable {
@ApiModelProperty(value = "类型id") @ApiModelProperty(value = "类型id")
private Integer typeId; private Integer typeId;
@ApiModelProperty(value = "请求id")
private String requestId;
} }
...@@ -22,17 +22,13 @@ import java.io.Serializable; ...@@ -22,17 +22,13 @@ import java.io.Serializable;
public class CustomerBehaviorNotes implements Serializable { public class CustomerBehaviorNotes implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@Id @Id
@GeneratedValue(generator = "JDBC") @GeneratedValue(generator = "JDBC")
@ApiModelProperty("主键id") @ApiModelProperty("主键id")
private Integer id; private Integer id;
/**
* 用户id
*/
@Column(name = "customer_id") @Column(name = "customer_id")
@ApiModelProperty(value = "用户id") @ApiModelProperty(value = "用户id")
private String customerId; private String customerId;
...@@ -48,21 +44,21 @@ public class CustomerBehaviorNotes implements Serializable { ...@@ -48,21 +44,21 @@ public class CustomerBehaviorNotes implements Serializable {
* 行为类型 {@link com.xxfc.platform.user.behavior.common.BehaviorEnum} * 行为类型 {@link com.xxfc.platform.user.behavior.common.BehaviorEnum}
*/ */
@Column(name = "type") @Column(name = "type")
@ApiModelProperty(value = "行为类型(见枚举)") @ApiModelProperty(value = "行为类型")
private Integer type; private Integer type;
/**
* 类型id
*/
@Column(name = "type_id") @Column(name = "type_id")
@ApiModelProperty(value = "类型id") @ApiModelProperty(value = "类型id")
private Integer typeId; private Integer typeId;
/**
* 创建时间
*/
@Column(name = "crt_time") @Column(name = "crt_time")
@ApiModelProperty(value = "创建时间", hidden = true) @ApiModelProperty(value = "创建时间", hidden = true)
private Long crtTime; private Long crtTime;
@Column(name = "request_id")
@ApiModelProperty(value = "请求id")
private String requestId;
} }
package com.xxfc.platform.vehicle.pojo.dto;
import com.github.wxiaoqi.security.common.vo.PageParam;
import lombok.Data;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/12 16:08
*/
@Data
public class AccompanyingItemFindDTO extends PageParam {
private String name;
private Integer type;
}
...@@ -13,7 +13,7 @@ import com.xxfc.platform.vehicle.constant.RedisKey; ...@@ -13,7 +13,7 @@ import com.xxfc.platform.vehicle.constant.RedisKey;
import com.xxfc.platform.vehicle.entity.AccompanyingItem; import com.xxfc.platform.vehicle.entity.AccompanyingItem;
import com.xxfc.platform.vehicle.mapper.AccompanyingItemMapper; import com.xxfc.platform.vehicle.mapper.AccompanyingItemMapper;
import com.xxfc.platform.vehicle.pojo.AddOrUpdateAccompanyingItem; import com.xxfc.platform.vehicle.pojo.AddOrUpdateAccompanyingItem;
import com.xxfc.platform.vehicle.pojo.QueryAccompanyItemVo; import com.xxfc.platform.vehicle.pojo.dto.AccompanyingItemFindDTO;
import com.xxfc.platform.vehicle.pojo.vo.AccompanyingItemVo; import com.xxfc.platform.vehicle.pojo.vo.AccompanyingItemVo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtils;
...@@ -29,7 +29,6 @@ import javax.annotation.Resource; ...@@ -29,7 +29,6 @@ import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
...@@ -69,15 +68,12 @@ public class AccompanyingItemBiz extends BaseBiz<AccompanyingItemMapper, Accompa ...@@ -69,15 +68,12 @@ public class AccompanyingItemBiz extends BaseBiz<AccompanyingItemMapper, Accompa
/** /**
* 按页查询, * 按页查询,
* 注意,此处一共名称的模糊查询是预测其数据量较少,有变化后考虑加入全文索引
* @param queryAccompanyItemVo
* @return * @return
* @throws Exception * @throws Exception
*/ */
public PageDataVO<AccompanyingItem> getByPage(QueryAccompanyItemVo queryAccompanyItemVo) throws Exception{ public PageDataVO<AccompanyingItem> getByPage(AccompanyingItemFindDTO accompanyingItemFindDTO){
Map<String,String> params = BeanUtils.describe(queryAccompanyItemVo); PageHelper.startPage(accompanyingItemFindDTO.getPage(),accompanyingItemFindDTO.getLimit());
PageHelper.startPage(queryAccompanyItemVo.getPage(),queryAccompanyItemVo.getLimit()); List<AccompanyingItem> accompanyingItems = mapper.getAllPageByNameOrType(accompanyingItemFindDTO.getName(),accompanyingItemFindDTO.getType());
List<AccompanyingItem> accompanyingItems = mapper.getAllByPage(params);
PageInfo<AccompanyingItem> accompanyingItemsPageInfo = new PageInfo<>(accompanyingItems); PageInfo<AccompanyingItem> accompanyingItemsPageInfo = new PageInfo<>(accompanyingItems);
return PageDataVO.pageInfo(accompanyingItemsPageInfo); return PageDataVO.pageInfo(accompanyingItemsPageInfo);
} }
......
package com.xxfc.platform.vehicle.mapper; package com.xxfc.platform.vehicle.mapper;
import com.xxfc.platform.vehicle.entity.AccompanyingItem; import com.xxfc.platform.vehicle.entity.AccompanyingItem;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper; import tk.mybatis.mapper.common.Mapper;
import java.util.List; import java.util.List;
import java.util.Map;
public interface AccompanyingItemMapper extends Mapper<AccompanyingItem> { public interface AccompanyingItemMapper extends Mapper<AccompanyingItem> {
public List<AccompanyingItem> getAllByPage(Map<String, String> params); List<AccompanyingItem> getAllPageByNameOrType(@Param("name") String name, @Param("type") Integer type);
public List<AccompanyingItem> getByIdList(List<Integer> idList); List<AccompanyingItem> getByIdList(List<Integer> idList);
} }
package com.xxfc.platform.vehicle.rest; package com.xxfc.platform.vehicle.rest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken; import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.vehicle.biz.AccompanyingItemBiz; import com.xxfc.platform.vehicle.biz.AccompanyingItemBiz;
import com.xxfc.platform.vehicle.common.BaseController; import com.xxfc.platform.vehicle.common.BaseController;
import com.xxfc.platform.vehicle.common.CustomIllegalParamException;
import com.xxfc.platform.vehicle.common.RestResponse; import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import com.xxfc.platform.vehicle.entity.AccompanyingItem; import com.xxfc.platform.vehicle.entity.AccompanyingItem;
import com.xxfc.platform.vehicle.pojo.AddOrUpdateAccompanyingItem; import com.xxfc.platform.vehicle.pojo.AddOrUpdateAccompanyingItem;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.xxfc.platform.vehicle.pojo.dto.AccompanyingItemFindDTO;
import com.xxfc.platform.vehicle.pojo.QueryAccompanyItemVo;
import com.xxfc.platform.vehicle.pojo.vo.AccompanyingItemVo; import com.xxfc.platform.vehicle.pojo.vo.AccompanyingItemVo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -46,17 +42,9 @@ public class AccompanyingItemController extends BaseController<AccompanyingItemB ...@@ -46,17 +42,9 @@ public class AccompanyingItemController extends BaseController<AccompanyingItemB
} }
@RequestMapping(value ="/page",method = RequestMethod.GET) @RequestMapping(value ="/page",method = RequestMethod.POST)
public RestResponse<PageDataVO<AccompanyingItem>> getByPage(@RequestParam String queryAccompanyItemVoJson) throws Exception{ public RestResponse<PageDataVO<AccompanyingItem>> getByPage(@RequestBody AccompanyingItemFindDTO accompanyingItemFindDTO){
QueryAccompanyItemVo queryAccompanyItemVo = null; return RestResponse.data(baseBiz.getByPage(accompanyingItemFindDTO));
try {
queryAccompanyItemVo = JSON.parseObject(queryAccompanyItemVoJson,QueryAccompanyItemVo.class);
return RestResponse.data(baseBiz.getByPage(queryAccompanyItemVo));
} catch (JSONException ex) {
return RestResponse.code(ResCode.INVALID_REST_REQ_PARAM.getCode());
} catch (CustomIllegalParamException ex){
return RestResponse.code(ResCode.INVALID_REST_REQ_PARAM.getCode());
}
} }
@RequestMapping(value ="",method = RequestMethod.POST) @RequestMapping(value ="",method = RequestMethod.POST)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xxfc.platform.vehicle.mapper.AccompanyingItemMapper"> <mapper namespace="com.xxfc.platform.vehicle.mapper.AccompanyingItemMapper">
<select id="getAllByPage" parameterType="java.util.Map" resultType="com.xxfc.platform.vehicle.entity.AccompanyingItem"> <select id="getAllPageByNameOrType" parameterType="java.util.Map" resultType="com.xxfc.platform.vehicle.entity.AccompanyingItem">
select select
`id`, `type`, `name`, `remark`,`price`, `create_time`, `update_time` `id`, `type`, `name`, `remark`,`price`, `create_time`, `update_time`
from from
......
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