This commit is contained in:
keivn 2021-12-29 00:39:19 +08:00
parent 71e8c7b15d
commit 863a8fe190
7 changed files with 191 additions and 5 deletions

View File

@ -35,7 +35,7 @@ public class PCommonController {
/**
* 乘客或者司机关闭订单
* 乘客或者司机完成订单
* @param commonVO
* @return
*/

View File

@ -1,6 +1,8 @@
package com.ruoyi.carpool.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -103,6 +105,10 @@ public class POrder extends BaseEntity
private String memberOpenId;
/**
* 订单成员信息
*/
private List<POrderMember> orderMemberList;
public void setId(Long id)
{
@ -260,6 +266,14 @@ public class POrder extends BaseEntity
this.memberOpenId = memberOpenId;
}
public List<POrderMember> getOrderMemberList() {
return orderMemberList;
}
public void setOrderMemberList(List<POrderMember> orderMemberList) {
this.orderMemberList = orderMemberList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -0,0 +1,151 @@
package com.ruoyi.carpool.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 请填写功能名称对象 p_order_member
*
* @author ruoyi
* @date 2021-12-29
*/
public class POrderMember extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 自增ID */
private Long id;
/** 订单号 */
@Excel(name = "订单号")
private String orderNum;
/** 微信openId */
@Excel(name = "微信openId")
private String openId;
/** 用户名 */
@Excel(name = "用户名")
private String custName;
/** 手机号 */
@Excel(name = "手机号")
private String custPhone;
/** 乘客ID */
@Excel(name = "乘客ID")
private String custId;
/** 乘客人数 */
@Excel(name = "乘客人数")
private Integer num;
/** 顺序 */
@Excel(name = "顺序")
private Integer index;
/** 当前状态0已经下单 1取消下单 */
@Excel(name = "当前状态0已经下单 1取消下单")
private Integer state;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setOrderNum(String orderNum)
{
this.orderNum = orderNum;
}
public String getOrderNum()
{
return orderNum;
}
public void setOpenId(String openId)
{
this.openId = openId;
}
public String getOpenId()
{
return openId;
}
public void setCustName(String custName)
{
this.custName = custName;
}
public String getCustName()
{
return custName;
}
public void setCustPhone(String custPhone)
{
this.custPhone = custPhone;
}
public String getCustPhone()
{
return custPhone;
}
public void setCustId(String custId)
{
this.custId = custId;
}
public String getCustId()
{
return custId;
}
public void setNum(Integer num)
{
this.num = num;
}
public Integer getNum()
{
return num;
}
public void setIndex(Integer index)
{
this.index = index;
}
public Integer getIndex()
{
return index;
}
public void setState(Integer state)
{
this.state = state;
}
public Integer getState()
{
return state;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("orderNum", getOrderNum())
.append("openId", getOpenId())
.append("custName", getCustName())
.append("custPhone", getCustPhone())
.append("custId", getCustId())
.append("num", getNum())
.append("index", getIndex())
.append("state", getState())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -2,6 +2,7 @@ package com.ruoyi.carpool.mapper;
import java.util.List;
import com.ruoyi.carpool.domain.POrder;
import com.ruoyi.carpool.domain.POrderMember;
/**
* 订单信息Mapper接口
@ -105,6 +106,7 @@ public interface POrderMapper
public List<POrder> queryOrderInfoByOpenIdAndState(String openId);
public List<POrderMember> queryOrderMenberListByOrderNum(String orderNum);

View File

@ -7,8 +7,6 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.common.utils.uuid.UUID;
import jdk.nashorn.api.scripting.AbstractJSObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -80,7 +78,7 @@ public class IPCommonServiceImpl implements IPCommonService {
return AjaxResult.success();
}
}
return AjaxResult.error();
return AjaxResult.error(200 , "请求参数有误");
}
@Override
@ -135,7 +133,7 @@ public class IPCommonServiceImpl implements IPCommonService {
if(StringUtils.isEmpty(pPassenger.getSex())) pPassenger.setSex("2");/*性别设置为未知*/
pPassenger.setCreateBy("weixi_mini_admin");
pPassenger.setCreateTime(DateUtils.getNowDate());
pPassenger.setCustId("wxmini"+IdUtils.simpleUUID());
pPassenger.setCustId("wxmini_passenger_"+IdUtils.simpleUUID());
pPassenger.setApplyState("0");/*默认是乘客*/
pPassengerMapper.insertPPassenger(pPassenger);
}

View File

@ -3,6 +3,7 @@ package com.ruoyi.carpool.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.ruoyi.carpool.domain.POrderMember;
import com.ruoyi.carpool.domain.PPassenger;
import com.ruoyi.carpool.mapper.PPassengerMapper;
import com.ruoyi.common.core.domain.AjaxResult;
@ -56,6 +57,11 @@ public class POrderServiceImpl implements IPOrderService
}else {
pOrders = pOrderMapper.selectPOrderList(pOrder);
}
/*查询成员信息*/
for (POrder order : pOrders) {
List<POrderMember> pOrderMembers = pOrderMapper.queryOrderMenberListByOrderNum(order.getOrderNum());
order.setOrderMemberList(pOrderMembers);
}
return pOrders;
}

View File

@ -26,6 +26,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="driverOpenId" column="driver_open_id" />
</resultMap>
<resultMap type="com.ruoyi.carpool.domain.POrderMember" id="POrderMemberResult">
<result property="id" column="id" />
<result property="openId" column="open_id" />
<result property="custName" column="cust_name" />
<result property="custPhone" column="cust_phone" />
<result property="custId" column="cust_id" />
<result property="num" column="num" />
<result property="index" column="index" />
<result property="state" column="state" />
</resultMap>
<sql id="selectPOrderVo">
select
id, order_num, departure, destination, departure_time, member, state,creater_name,creater_phone,creater_openid
@ -186,4 +197,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="queryOrderMenberListByOrderNum" parameterType="String" resultMap="POrderMemberResult">
SELECT * FROM p_order_member WHERE order_num = #{orderNum} ;
</select>
</mapper>