Commit 5aead0b6 by lpx

# 修复商家端列表查询接口未带mc_id条件查询问题

parent 1013a3d1
......@@ -34,6 +34,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -57,6 +58,7 @@ public class StrokeController extends BaseController {
private StrokeService strokeService;
@Autowired
private StrokeDiscountService strokeDiscountService;
/**
* 填写付款信息
*/
......@@ -236,8 +238,8 @@ public class StrokeController extends BaseController {
@PostMapping("/getMyStrokePageList")
@OperationLog(name = "行程分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "行程分页列表")
public ApiResult<Paging<StrokeQueryVo>> getMyStrokePageList(@Validated @RequestBody StrokePageParam strokePageParam) throws Exception {
Paging<StrokeQueryVo> paging = strokeService.getStrokePageList(strokePageParam);
public ApiResult<Paging<StrokeQueryVo>> getMyStrokePageList(@Validated @RequestBody StrokePageParam strokePageParam, @RequestHeader(required = false) String language) throws Exception {
Paging<StrokeQueryVo> paging = strokeService.getStrokePageList(strokePageParam, language);
return ApiResult.ok(paging);
}
......
......@@ -175,4 +175,8 @@ public class Stroke extends BaseEntity {
@ApiModelProperty("是否是优惠调机,0-否,1-是")
private Boolean isDiscount;
@NotNull(message = "付款渠道不能为空")
@ApiModelProperty("付款渠道,0-线下渠道,1-线上渠道")
private Integer paymentChannel;
}
......@@ -38,18 +38,26 @@ public interface StrokeMapper extends BaseMapper<Stroke> {
*
* @param page
* @param strokePageParam
* @param language
* @param userId
* @return
*/
IPage<StrokeQueryVo> getStrokePageList(@Param("page") Page page, @Param("param") StrokePageParam strokePageParam, @Param("userId") Long userId);
IPage<StrokeQueryVo> getStrokePageList(
@Param("page") Page page, @Param("param") StrokePageParam strokePageParam,
@Param("userId") Long userId, @Param("language") String language);
/**
* 查询已完成行程
*
* @param page
* @param strokePageParam
* @param userId
* @param language
* @return
*/
IPage<StrokeQueryVo> getStrokePageListWithFinish(@Param("page") Page page, @Param("param") StrokePageParam strokePageParam, @Param("userId") Long userId);
IPage<StrokeQueryVo> getStrokePageListWithFinish(
@Param("page") Page page, @Param("param") StrokePageParam strokePageParam,
@Param("userId") Long userId, @Param("language") String language);
/**
* 商家端 获取行程分页对象
......@@ -61,17 +69,18 @@ public interface StrokeMapper extends BaseMapper<Stroke> {
*/
IPage<McStrokeQueryVo> getMcStrokePageList(
@Param("page") Page page, @Param("mcStrokePageParam") McStrokePageParam mcStrokePageParam,
@Param("mcId") Long mcId);
@Param("mcId") long mcId);
/**
* 收款记录
*
* @param page
* @param mcStrokePaymentPageParam
* @param mcId
* @return
*/
IPage<McStrokePaymentQueryVo> getPaymentPageList(
Page<StrokeQueryVo> page,@Param("param") McStrokePaymentPageParam mcStrokePaymentPageParam,
Page<StrokeQueryVo> page, @Param("param") McStrokePaymentPageParam mcStrokePaymentPageParam,
@Param("mcId") Long mcId);
}
......@@ -63,20 +63,23 @@ public interface StrokeService extends BaseService<Stroke> {
* 获取分页对象
*
* @param strokePageParam
* @param language
* @return
* @throws Exception
*/
Paging<StrokeQueryVo> getStrokePageList(StrokePageParam strokePageParam) throws Exception;
Paging<StrokeQueryVo> getStrokePageList(StrokePageParam strokePageParam, String language) throws Exception;
/**
* 商家端,分页获取行程接口
*
* @param mcStrokePageParam
* @return
*/
Paging<McStrokeQueryVo> getMcStrokePageList(McStrokePageParam mcStrokePageParam);
/**
* 收款记录
* 收款记录
*
* @param mcStrokePaymentPageParam
* @return
*/
......
......@@ -96,22 +96,22 @@ public class StrokeServiceImpl extends BaseServiceImpl<StrokeMapper, Stroke> imp
}
@Override
public Paging<StrokeQueryVo> getStrokePageList(StrokePageParam strokePageParam) throws Exception {
public Paging<StrokeQueryVo> getStrokePageList(StrokePageParam strokePageParam, String language) throws Exception {
// Page<StrokeQueryVo> page = new PageInfo<>(strokePageParam, OrderItem.asc(getLambdaColumn(Stroke::getCreateTime)));
Page<StrokeQueryVo> page = new PageInfo<>(strokePageParam, OrderItem.desc("s.create_time"));
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
// 查询已完成 需要额外查询已取消状态
if (strokePageParam.getStatus().equals(StrokeStatusEnum.COMPLETED.getCode())) {
IPage<StrokeQueryVo> iPage = strokeMapper.getStrokePageListWithFinish(page, strokePageParam, jwtToken.getUserId());
IPage<StrokeQueryVo> iPage = strokeMapper.getStrokePageListWithFinish(page, strokePageParam, jwtToken.getUserId(), language);
return new Paging<StrokeQueryVo>(iPage);
}
IPage<StrokeQueryVo> iPage = strokeMapper.getStrokePageList(page, strokePageParam, jwtToken.getUserId());
IPage<StrokeQueryVo> iPage = strokeMapper.getStrokePageList(page, strokePageParam, jwtToken.getUserId(), language);
return new Paging<StrokeQueryVo>(iPage);
}
@Override
public Paging<McStrokeQueryVo> getMcStrokePageList(McStrokePageParam mcStrokePageParam) {
Page<StrokeQueryVo> page = new PageInfo<>(mcStrokePageParam, OrderItem.asc(getLambdaColumn(Stroke::getCreateTime)));
Page<StrokeQueryVo> page = new PageInfo<>(mcStrokePageParam);
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
IPage<McStrokeQueryVo> mcStrokePageList = strokeMapper.getMcStrokePageList(page, mcStrokePageParam, jwtToken.getMcId());
return new Paging<McStrokeQueryVo>(mcStrokePageList);
......
......@@ -76,10 +76,20 @@
<select id="getStrokePageList" parameterType="com.jumeirah.common.param.StrokePageParam"
resultType="com.jumeirah.common.vo.StrokeQueryVo">
select
ctco.city_name_cn as city_outset_name,
ctco.airport_name_cn as outset_airport_name,
ctca.city_name_cn as city_arrive_name,
ctca.airport_name_cn as arrive_airport_name,
<choose>
<when test="language !='zh_CN'">
ctco.city_name_en as city_outset_name,
ctco.airport_name_en as outset_airport_name,
ctca.city_name_en as city_arrive_name,
ctca.airport_name_en as arrive_airport_name,
</when>
<otherwise>
ctco.city_name_cn as city_outset_name,
ctco.airport_name_cn as outset_airport_name,
ctca.city_name_cn as city_arrive_name,
ctca.airport_name_cn as arrive_airport_name,
</otherwise>
</choose>
<include refid="Page_Column_List"/>
from stroke s
INNER JOIN merchant_user mu ON mu.id = s.mc_id
......@@ -101,10 +111,20 @@
<select id="getStrokePageListWithFinish" parameterType="com.jumeirah.common.param.StrokePageParam"
resultType="com.jumeirah.common.vo.StrokeQueryVo">
select
ctco.city_name_cn as city_outset_name,
ctco.airport_name_cn as outset_airport_name,
ctca.city_name_cn as city_arrive_name,
ctca.airport_name_cn as arrive_airport_name,
<choose>
<when test="language !='zh_CN'">
ctco.city_name_en as city_outset_name,
ctco.airport_name_en as outset_airport_name,
ctca.city_name_en as city_arrive_name,
ctca.airport_name_en as arrive_airport_name,
</when>
<otherwise>
ctco.city_name_cn as city_outset_name,
ctco.airport_name_cn as outset_airport_name,
ctca.city_name_cn as city_arrive_name,
ctca.airport_name_cn as arrive_airport_name,
</otherwise>
</choose>
<include refid="Page_Column_List"/>
from stroke s
INNER JOIN merchant_user mu ON mu.id = s.mc_id
......@@ -121,12 +141,47 @@
<select id="getMcStrokePageList" parameterType="com.jumeirah.common.param.McStrokePageParam"
resultType="com.jumeirah.common.vo.McStrokeQueryVo">
SELECT
s.*,
s.id,
s.city_outset_id,
s.deleted,
s.city_arrive_id,
s.people_num,
s.plain_type_id,
s.outset_time,
s.return_time,
s.type,
s.status,
s.create_time,
s.update_time,
s.goods_name,
s.goods_size,
s.goods_weight,
s.disease_name,
s.medical_certificate_url,
s.instruments,
s.medical_persons,
s.remarks,
s.money,
s.user_id,
s.arrive_plain_type_id,
s.back_outset_airport_name,
s.back_arrive_airport_name,
s.choose_plain_type,
s.payment_status,
s.audit_status,
s.user_recharge_money,
s.user_recharge_bank,
s.user_recharge_name,
s.user_recharge_bank_number,
s.user_recharge_credentials_url,
s.user_recharge_time,
s.is_discount,
s.payment_channel,
ctco.city_name_cn as city_outset_name,
ctco.airport_name_cn as outset_airport_name,
ctca.city_name_cn as city_arrive_name,
ctca.airport_name_cn as arrive_airport_name,
CONCAT( au.surname, au.`name` ) AS applicant,
CONCAT( au.surname, au.name) AS applicant,
pt.name AS plain_type_name,
au.phone AS phone_number
FROM
......@@ -153,7 +208,7 @@
AND s.create_time &lt;= #{mcStrokePageParam.endTime}
</if>
<if test="mcStrokePageParam.applicant != null and mcStrokePageParam.applicant != ''">
AND CONCAT( au.surname, au.`name` ) LIKE CONCAT('%',#{mcStrokePageParam.applicant},'%')
AND CONCAT( au.surname, au.`name`) LIKE CONCAT('%',#{mcStrokePageParam.applicant},'%')
</if>
</where>
ORDER BY s.create_time DESC
......
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