Commit f49d3c1c by zhangjw

1:完善推送订单,保存订单信息逻辑

parent 08ef93c7
...@@ -44,6 +44,7 @@ public interface StrokeMapper extends BaseMapper<Stroke> { ...@@ -44,6 +44,7 @@ public interface StrokeMapper extends BaseMapper<Stroke> {
/** /**
* 查询已完成行程 * 查询已完成行程
*
* @param page * @param page
* @param strokePageParam * @param strokePageParam
* @param userId * @param userId
...@@ -65,13 +66,23 @@ public interface StrokeMapper extends BaseMapper<Stroke> { ...@@ -65,13 +66,23 @@ public interface StrokeMapper extends BaseMapper<Stroke> {
/** /**
* 收款记录 * 收款记录
*
* @param page * @param page
* @param mcStrokePaymentPageParam * @param mcStrokePaymentPageParam
* @param mcId * @param mcId
* @return * @return
*/ */
IPage<McStrokePaymentQueryVo> getPaymentPageList( IPage<McStrokePaymentQueryVo> getPaymentPageList(
Page<StrokeQueryVo> page,@Param("param") McStrokePaymentPageParam mcStrokePaymentPageParam, Page<StrokeQueryVo> page, @Param("param") McStrokePaymentPageParam mcStrokePaymentPageParam,
@Param("mcId") Long mcId); @Param("mcId") Long mcId);
/**
* 查询行程明细
*
* @param id
* @return
*/
McStrokeQueryVo getStrokeInfo(@Param("mcId") Long mcId,@Param("id") Long id);
} }
...@@ -16,7 +16,6 @@ import com.jumeirah.common.vo.McStrokePaymentQueryVo; ...@@ -16,7 +16,6 @@ import com.jumeirah.common.vo.McStrokePaymentQueryVo;
import com.jumeirah.common.vo.McStrokeQueryVo; import com.jumeirah.common.vo.McStrokeQueryVo;
import com.jumeirah.common.vo.StrokeDetailVo; import com.jumeirah.common.vo.StrokeDetailVo;
import com.jumeirah.common.vo.StrokeQueryVo; import com.jumeirah.common.vo.StrokeQueryVo;
import com.rabbitmq.tools.json.JSONUtil;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl; import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import io.geekidea.springbootplus.framework.core.pagination.PageInfo; import io.geekidea.springbootplus.framework.core.pagination.PageInfo;
import io.geekidea.springbootplus.framework.core.pagination.Paging; import io.geekidea.springbootplus.framework.core.pagination.Paging;
...@@ -48,7 +47,7 @@ public class StrokeServiceImpl extends BaseServiceImpl<StrokeMapper, Stroke> imp ...@@ -48,7 +47,7 @@ public class StrokeServiceImpl extends BaseServiceImpl<StrokeMapper, Stroke> imp
public boolean saveStroke(Stroke stroke) throws Exception { public boolean saveStroke(Stroke stroke) throws Exception {
final boolean save = super.save(stroke); final boolean save = super.save(stroke);
if (save) {//推送订单到客服系统 if (save) {//推送订单到客服系统
queue.pushOrder(JSON.toJSONString(stroke)); queue.pushOrder(JSON.toJSONString(baseMapper.getStrokeInfo(stroke.getMcId(), stroke.getId())));
} }
return save; return save;
} }
...@@ -126,5 +125,4 @@ public class StrokeServiceImpl extends BaseServiceImpl<StrokeMapper, Stroke> imp ...@@ -126,5 +125,4 @@ public class StrokeServiceImpl extends BaseServiceImpl<StrokeMapper, Stroke> imp
IPage<McStrokePaymentQueryVo> mcStrokePageList = strokeMapper.getPaymentPageList(page, mcStrokePaymentPageParam, jwtToken.getMcId()); IPage<McStrokePaymentQueryVo> mcStrokePageList = strokeMapper.getPaymentPageList(page, mcStrokePaymentPageParam, jwtToken.getMcId());
return new Paging<McStrokePaymentQueryVo>(mcStrokePageList); return new Paging<McStrokePaymentQueryVo>(mcStrokePageList);
} }
} }
...@@ -76,11 +76,11 @@ ...@@ -76,11 +76,11 @@
<select id="getStrokePageList" parameterType="com.jumeirah.common.param.StrokePageParam" <select id="getStrokePageList" parameterType="com.jumeirah.common.param.StrokePageParam"
resultType="com.jumeirah.common.vo.StrokeQueryVo"> resultType="com.jumeirah.common.vo.StrokeQueryVo">
select select
ctco.city_name_cn as city_outset_name, ctco.city_name_cn as city_outset_name,
ctco.airport_name_cn as outset_airport_name, ctco.airport_name_cn as outset_airport_name,
ctca.city_name_cn as city_arrive_name, ctca.city_name_cn as city_arrive_name,
ctca.airport_name_cn as arrive_airport_name, ctca.airport_name_cn as arrive_airport_name,
<include refid="Page_Column_List"/> <include refid="Page_Column_List"/>
from stroke s from stroke s
INNER JOIN merchant_user mu ON mu.id = s.mc_id INNER JOIN merchant_user mu ON mu.id = s.mc_id
INNER JOIN city_three_code ctco ON ctco.id = s.city_outset_id INNER JOIN city_three_code ctco ON ctco.id = s.city_outset_id
...@@ -101,11 +101,11 @@ ...@@ -101,11 +101,11 @@
<select id="getStrokePageListWithFinish" parameterType="com.jumeirah.common.param.StrokePageParam" <select id="getStrokePageListWithFinish" parameterType="com.jumeirah.common.param.StrokePageParam"
resultType="com.jumeirah.common.vo.StrokeQueryVo"> resultType="com.jumeirah.common.vo.StrokeQueryVo">
select select
ctco.city_name_cn as city_outset_name, ctco.city_name_cn as city_outset_name,
ctco.airport_name_cn as outset_airport_name, ctco.airport_name_cn as outset_airport_name,
ctca.city_name_cn as city_arrive_name, ctca.city_name_cn as city_arrive_name,
ctca.airport_name_cn as arrive_airport_name, ctca.airport_name_cn as arrive_airport_name,
<include refid="Page_Column_List"/> <include refid="Page_Column_List"/>
from stroke s from stroke s
INNER JOIN merchant_user mu ON mu.id = s.mc_id INNER JOIN merchant_user mu ON mu.id = s.mc_id
INNER JOIN city_three_code ctco ON ctco.id = s.city_outset_id INNER JOIN city_three_code ctco ON ctco.id = s.city_outset_id
...@@ -121,57 +121,57 @@ ...@@ -121,57 +121,57 @@
<select id="getMcStrokePageList" parameterType="com.jumeirah.common.param.McStrokePageParam" <select id="getMcStrokePageList" parameterType="com.jumeirah.common.param.McStrokePageParam"
resultType="com.jumeirah.common.vo.McStrokeQueryVo"> resultType="com.jumeirah.common.vo.McStrokeQueryVo">
SELECT SELECT
s.*, s.*,
ctco.city_name_cn as city_outset_name, ctco.city_name_cn as city_outset_name,
ctco.airport_name_cn as outset_airport_name, ctco.airport_name_cn as outset_airport_name,
ctca.city_name_cn as city_arrive_name, ctca.city_name_cn as city_arrive_name,
ctca.airport_name_cn as arrive_airport_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, pt.name AS plain_type_name,
au.phone AS phone_number au.phone AS phone_number
FROM FROM
stroke s stroke s
LEFT JOIN app_user au ON au.id = s.user_id LEFT JOIN app_user au ON au.id = s.user_id
LEFT JOIN plain_type pt ON pt.id = s.plain_type_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 ctco ON ctco.id = s.city_outset_id
INNER JOIN city_three_code ctca ON ctca.id = s.city_arrive_id INNER JOIN city_three_code ctca ON ctca.id = s.city_arrive_id
<where> <where>
s.mc_id = #{mcId} s.mc_id = #{mcId}
<if test="mcStrokePageParam.status != null and mcStrokePageParam.status != -1"> <if test="mcStrokePageParam.status != null and mcStrokePageParam.status != -1">
AND s.status = #{mcStrokePageParam.status} AND s.status = #{mcStrokePageParam.status}
</if> </if>
<if test="mcStrokePageParam.type != null and mcStrokePageParam.type != -1"> <if test="mcStrokePageParam.type != null and mcStrokePageParam.type != -1">
AND s.type = #{mcStrokePageParam.type} AND s.type = #{mcStrokePageParam.type}
</if> </if>
<if test="mcStrokePageParam.id != null and mcStrokePageParam.id != 0"> <if test="mcStrokePageParam.id != null and mcStrokePageParam.id != 0">
AND s.id = #{mcStrokePageParam.id} AND s.id = #{mcStrokePageParam.id}
</if> </if>
<if test="mcStrokePageParam.startTime != null and mcStrokePageParam.startTime != ''"> <if test="mcStrokePageParam.startTime != null and mcStrokePageParam.startTime != ''">
AND s.create_time &gt;= #{mcStrokePageParam.startTime} AND s.create_time &gt;= #{mcStrokePageParam.startTime}
</if> </if>
<if test="mcStrokePageParam.endTime != null and mcStrokePageParam.endTime != ''"> <if test="mcStrokePageParam.endTime != null and mcStrokePageParam.endTime != ''">
AND s.create_time &lt;= #{mcStrokePageParam.endTime} AND s.create_time &lt;= #{mcStrokePageParam.endTime}
</if> </if>
<if test="mcStrokePageParam.applicant != null and mcStrokePageParam.applicant != ''"> <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> </if>
</where> </where>
ORDER BY s.create_time DESC ORDER BY s.create_time DESC
</select> </select>
<select id="getPaymentPageList" parameterType="com.jumeirah.common.param.McStrokePaymentPageParam" <select id="getPaymentPageList" parameterType="com.jumeirah.common.param.McStrokePaymentPageParam"
resultType="com.jumeirah.common.vo.McStrokePaymentQueryVo"> resultType="com.jumeirah.common.vo.McStrokePaymentQueryVo">
SELECT SELECT
s.id, s.id,
s.type, s.type,
s.user_recharge_time, s.user_recharge_time,
s.payment_status, s.payment_status,
s.user_recharge_money, s.user_recharge_money,
s.payment_channel, s.payment_channel,
CONCAT( au.surname, au.`name` ) AS applicant, CONCAT( au.surname, au.`name` ) AS applicant,
au.phone AS phone_number au.phone AS phone_number
FROM FROM
stroke s stroke s
LEFT JOIN app_user au ON au.id = s.user_id LEFT JOIN app_user au ON au.id = s.user_id
<where> <where>
s.mc_id = #{mcId} s.mc_id = #{mcId}
...@@ -191,4 +191,57 @@ ...@@ -191,4 +191,57 @@
ORDER BY s.create_time DESC ORDER BY s.create_time DESC
</select> </select>
<select id="getStrokeInfo" resultType="com.jumeirah.common.vo.McStrokeQueryVo">
SELECT 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.mc_id,
s.status,
s.create_time,
s.update_time,
s.goods_name,
s.goods_size,
s.goods_weight,
s.disease_name,
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.payment_status,
s.audit_status,
s.user_recharge_money,
s.user_recharge_bank,
s.user_recharge_name,
s.user_recharge_bank_number,
s.is_discount,
s.user_recharge_credentials_url,
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
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.id = #{id}
and s.mc_id = #{mcId}
</select>
</mapper> </mapper>
package com.ym.im.entity; package com.ym.im.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
/** /**
* 行程表 * 行程表
...@@ -17,126 +14,18 @@ import java.sql.Timestamp; ...@@ -17,126 +14,18 @@ import java.sql.Timestamp;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
public class Stroke implements Serializable { public class Stroke implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键ID")
private Long id; private Long id;
private String cityOutsetName;//起飞城市
@ApiModelProperty("出发城市id") private String cityArriveName;//到达城市
private Long cityOutsetId; private Long outsetTime;//起飞时间
private Long returnTime;//返程时间
@ApiModelProperty("逻辑删除,0:未删除,1:已删除") private int type;//行程类型 0-单程,1-往返行程,2-货运,3-医疗
private Integer deleted;
@ApiModelProperty("出发城市名称")
private String cityOutsetName;
@ApiModelProperty("到达城市id")
private Long cityArriveId;
@ApiModelProperty("到达城市名称")
private String cityArriveName;
@ApiModelProperty("人数")
private Integer peopleNum;
@ApiModelProperty("飞机型号ID")
private Long plainTypeId;
@ApiModelProperty("出发时间")
private Timestamp outsetTime;
@ApiModelProperty("返程时间")
private Timestamp returnTime;
@ApiModelProperty("行程类型,0-单程,1-往返行程,2-货运,3-医疗")
private Integer type;
@ApiModelProperty("状态,0-审核中,1-进行中,2-已完成,99-取消")
private Integer status;
@ApiModelProperty("创建时间")
private Timestamp createTime;
@ApiModelProperty("更新时间")
private Timestamp updateTime;
@ApiModelProperty("付款时间")
private Timestamp userRechargeTime;
@ApiModelProperty("货物名称")
private String goodsName;
@ApiModelProperty("货物体积(长*宽*高) 单位:CM,例如:100*102*120")
private String goodsSize;
@ApiModelProperty("货物重量,单位:吨")
private String goodsWeight;
@ApiModelProperty("病人疾病名称")
private String diseaseName;
@ApiModelProperty("病人病情诊断书")
private String medicalCertificateUrl;
@ApiModelProperty("配备器械(格式:1,2,3)逗号分隔")
private String instruments;
@ApiModelProperty("医护人员,0-医生,1-护士,2-护工(格式:0,1,2)逗号分隔")
private String medicalPersons;
@ApiModelProperty("备注")
private String remarks;
@ApiModelProperty("价格")
private BigDecimal money;
@ApiModelProperty("用户ID")
private Long userId; private Long userId;
@ApiModelProperty("出发机场名称")
private String outsetAirportName;
@ApiModelProperty("到达机场名称")
private String arriveAirportName;
@ApiModelProperty("返程飞机型号ID")
private Long arrivePlainTypeId;
@ApiModelProperty("返程出发机场名称")
private String backOutsetAirportName;
@ApiModelProperty("返程到达机场名称")
private String backArriveAirportName;
@ApiModelProperty("商家id")
private Long mcId; private Long mcId;
private String outsetAirportName;//出发机场名称
@ApiModelProperty("用户选择机型") private String arriveAirportName;//到达机场名称
private String choosePlainType; private String backOutsetAirportName;//返程出发机场名称
private String backArriveAirportName;//返程到达机场名称
@ApiModelProperty("付款状态,0-未付款,1-付款中,2-已付款,3-退款中,99-已退款") private boolean isDiscount;//是否是优惠调机
private Integer paymentStatus;
@ApiModelProperty("审核状态,0审核中,1审核通过,2审核未通过")
private Integer auditStatus;
@ApiModelProperty("用户充值金额")
private BigDecimal userRechargeMoney;
@ApiModelProperty("用户充值银行名称")
private String userRechargeBank;
@ApiModelProperty("用户充值账户名")
private String userRechargeName;
@ApiModelProperty("用户充值卡号")
private String userRechargeBankNumber;
@ApiModelProperty("用户充值截图证据, 传入数组")
private String userRechargeCredentialsUrl;
@ApiModelProperty("是否是优惠调机,0-否,1-是")
private Boolean isDiscount;
} }
...@@ -79,10 +79,10 @@ public class Receiver { ...@@ -79,10 +79,10 @@ public class Receiver {
return; return;
} }
final StaffSocketInfo staffSocketInfo = channelGroup.getMerchantStaff(userSocketInfo.getStaffId(stroke.getMcId())) == null ? staffService.getIdleStaff(mcId, userId) : channelGroup.getMerchantStaff(userSocketInfo.getStaffId(stroke.getMcId())); final StaffSocketInfo staffSocketInfo = channelGroup.getMerchantStaff(userSocketInfo.getStaffId(stroke.getMcId())) == null ? staffService.getIdleStaff(mcId, userId) : channelGroup.getMerchantStaff(userSocketInfo.getStaffId(stroke.getMcId()));
final ChatRecord chatRecord = new ChatRecord().setMsgInfo(json).setUserId(userId).setSendTime(new Date()).setMsgType(MsgBody.ORDER);
final MsgBody<ChatRecord> orderInfo = new MsgBody<ChatRecord>().setCode(MsgBody.ORDER).setData(chatRecord);
staffSingleChatServiceImpl.save(staffSocketInfo.getStaffId(), orderInfo);
if (staffSocketInfo != null) { if (staffSocketInfo != null) {
final ChatRecord chatRecord = new ChatRecord().setMsgInfo(json).setUserId(userId).setSendTime(new Date()).setMsgType(MsgBody.ORDER);
final MsgBody<ChatRecord> orderInfo = new MsgBody<ChatRecord>().setCode(MsgBody.ORDER).setData(chatRecord);
staffSingleChatServiceImpl.save(staffSocketInfo.getStaffId(), orderInfo);
staffSocketInfo.writeAndFlush(orderInfo); staffSocketInfo.writeAndFlush(orderInfo);
log.info("客服订单: " + "给客服(" + staffSocketInfo.getStaffId() + ")发送订单:" + json); log.info("客服订单: " + "给客服(" + staffSocketInfo.getStaffId() + ")发送订单:" + json);
} }
......
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