Commit bedaafbd by zhangjw

Merge branch 'master' of http://119.28.51.83/hewei/Jumeirah into Jw

 Conflicts:
	common/src/main/resources/mapper/StrokeMapper.xml
parents bb49754d ad9a032c
......@@ -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);
}
......
......@@ -28,7 +28,7 @@ import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
import com.fasterxml.jackson.module.paramnames.ParameterNamesModule;
import io.geekidea.springbootplus.config.constant.DatePattern;
import io.geekidea.springbootplus.framework.config.jackson.deserializer.JacksonDoubleDeserializer;
import io.geekidea.springbootplus.framework.config.jackson.serializer.JacksonIntegerDeserializer;
import io.geekidea.springbootplus.framework.config.jackson.deserializer.JacksonIntegerDeserializer;
import io.geekidea.springbootplus.framework.core.xss.XssJacksonDeserializer;
import io.geekidea.springbootplus.framework.core.xss.XssJacksonSerializer;
import org.springframework.beans.factory.annotation.Value;
......@@ -76,6 +76,10 @@ public class JacksonConfig implements WebMvcConfigurer {
// simpleModule.addSerializer(Date.class, new JacksonDateSerializer());
// simpleModule.addDeserializer(Date.class, new JacksonDateDeserializer());
// response数据Long型转String simpleModule.addSerializer(Long.class, new JacksonLongSerializer());
simpleModule.addDeserializer(Integer.class, new JacksonIntegerDeserializer());
simpleModule.addDeserializer(Double.class, new JacksonDoubleDeserializer());
......
......@@ -175,4 +175,8 @@ public class Stroke extends BaseEntity {
@ApiModelProperty("是否是优惠调机,0-否,1-是")
private Boolean isDiscount;
@NotNull(message = "付款渠道不能为空")
@ApiModelProperty("付款渠道,0-线下渠道,1-线上渠道")
private Integer paymentChannel;
}
......@@ -38,9 +38,13 @@ 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);
/**
* 查询已完成行程
......@@ -48,9 +52,12 @@ public interface StrokeMapper extends BaseMapper<Stroke> {
* @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);
/**
* 商家端 获取行程分页对象
......@@ -62,7 +69,7 @@ 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);
/**
* 收款记录
......
......@@ -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
*/
......
......@@ -97,22 +97,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);
......
......@@ -38,4 +38,7 @@ public class CharterIntroductionQueryForAppVo implements Serializable {
@ApiModelProperty("包机标题")
private String title;
@ApiModelProperty("推荐: 0不推荐 1推荐")
private Integer recommend;
}
\ No newline at end of file
......@@ -4,10 +4,10 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, mc_id, status, create_time,update_time,type,text,img_url
id, mc_id, status, create_time,update_time,type,text,img_url,recommend
</sql>
<sql id="Base_Column_ListForApp">
title,text,img_url,m.head AS mcHead,m.name AS mcName
title,text,img_url,m.head AS mcHead,m.name AS mcName,ci.recommend
</sql>
<select id="getCharterIntroductionById" resultType="com.jumeirah.common.vo.CharterIntroductionQueryVo">
......@@ -33,6 +33,7 @@
where ci.type = #{param.type}
AND m.state=1 and m.audit_register_status=1
ORDER BY ci.recommend DESC
</select>
......
......@@ -81,6 +81,21 @@
ctca.city_name_cn as city_arrive_name,
ctca.airport_name_cn as arrive_airport_name,
<include refid="Page_Column_List"/>
<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
INNER JOIN city_three_code ctco ON ctco.id = s.city_outset_id
......@@ -106,6 +121,21 @@
ctca.city_name_cn as city_arrive_name,
ctca.airport_name_cn as arrive_airport_name,
<include refid="Page_Column_List"/>
<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
INNER JOIN city_three_code ctco ON ctco.id = s.city_outset_id
......@@ -129,6 +159,49 @@
CONCAT( au.surname, au.`name` ) AS applicant,
pt.name AS plain_type_name,
au.phone AS phone_number
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,
pt.name AS plain_type_name,
au.phone AS phone_number
FROM
stroke s
LEFT JOIN app_user au ON au.id = s.user_id
......@@ -157,6 +230,33 @@
</if>
</where>
ORDER BY s.create_time DESC
stroke s
LEFT JOIN app_user au ON au.id = s.user_id
LEFT JOIN plain_type pt ON pt.id = s.plain_type_id
INNER JOIN city_three_code ctco ON ctco.id = s.city_outset_id
INNER JOIN city_three_code ctca ON ctca.id = s.city_arrive_id
<where>
s.mc_id = #{mcId}
<if test="mcStrokePageParam.status != null and mcStrokePageParam.status != -1">
AND s.status = #{mcStrokePageParam.status}
</if>
<if test="mcStrokePageParam.type != null and mcStrokePageParam.type != -1">
AND s.type = #{mcStrokePageParam.type}
</if>
<if test="mcStrokePageParam.id != null and mcStrokePageParam.id != 0">
AND s.id = #{mcStrokePageParam.id}
</if>
<if test="mcStrokePageParam.startTime != null and mcStrokePageParam.startTime != ''">
AND s.create_time &gt;= #{mcStrokePageParam.startTime}
</if>
<if test="mcStrokePageParam.endTime != null and mcStrokePageParam.endTime != ''">
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},'%')
</if>
</where>
ORDER BY s.create_time DESC
</select>
<select id="getPaymentPageList" parameterType="com.jumeirah.common.param.McStrokePaymentPageParam"
......
......@@ -26,13 +26,6 @@ spring:
password: temple123456
port: 6379
rabbitmq:
host: 47.99.47.225
port: 5672
username: root
password: root
order-queue-name: push.order
# 打印SQL语句和结果集,本地开发环境可开启,线上注释掉
mybatis-plus:
configuration:
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.geekidea.springbootplus.framework.config.jackson.serializer;
package io.geekidea.springbootplus.framework.config.jackson.deserializer;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
......
/*
* Copyright 2019-2029 geekidea(https://github.com/geekidea)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.geekidea.springbootplus.framework.config.jackson.deserializer;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import io.geekidea.springbootplus.framework.config.converter.StringToDoubleUtil;
import java.io.IOException;
/**
* @author geekidea
* @date 2018-11-08
*/
public class JacksonLongDeserializer extends JsonDeserializer<Double> {
@Override
public Double deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
String string = jsonParser.getText();
return StringToDoubleUtil.convert(string);
}
}
/*
* Copyright 2019-2029 geekidea(https://github.com/geekidea)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.geekidea.springbootplus.framework.config.jackson.serializer;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
/**
* <p>
* Jackson Long反序列化器
* </p>
*
* @author geekidea
* @date 2018-11-08
*/
public class JacksonLongSerializer extends JsonSerializer<Long> {
@Override
public void serialize(Long aLong, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
String string = null;
if (aLong != null) {
string = aLong.toString();
}
jsonGenerator.writeString(string);
}
}
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