代码修改
This commit is contained in:
parent
506ca3760b
commit
bdac2c81c0
@ -34,6 +34,14 @@
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
@ -46,6 +46,18 @@ public class PAddressController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询地址详情列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('address:address:list')")
|
||||
@GetMapping("/queryALl")
|
||||
public AjaxResult queryALl(PAddress pAddress)
|
||||
{
|
||||
List<PAddress> list = pAddressService.selectPAddressList(pAddress);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出地址详情列表
|
||||
*/
|
||||
|
@ -2,18 +2,24 @@ package com.ruoyi.carpool.controller;
|
||||
|
||||
|
||||
import com.ruoyi.carpool.domain.CommonVO;
|
||||
import com.ruoyi.carpool.domain.PMember;
|
||||
import com.ruoyi.carpool.domain.PPassenger;
|
||||
import com.ruoyi.carpool.service.IPCommonService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/carpool/common")
|
||||
@Api(value = "小程序拼单-公共模块", tags = "公共模块")
|
||||
public class PCommonController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IPCommonService ipCommonService;
|
||||
private IPCommonService pCommonService;
|
||||
|
||||
|
||||
/**
|
||||
@ -24,7 +30,7 @@ public class PCommonController {
|
||||
@PostMapping(value = "/cancelOrder")
|
||||
public AjaxResult getDriverInfo(@RequestBody CommonVO commonVO)
|
||||
{
|
||||
return ipCommonService.cancelOrder(commonVO);
|
||||
return pCommonService.cancelOrder(commonVO);
|
||||
}
|
||||
|
||||
|
||||
@ -37,13 +43,22 @@ public class PCommonController {
|
||||
@PostMapping(value = "/joinOrderList")
|
||||
public AjaxResult joinOrderList(@RequestBody CommonVO commonVO)
|
||||
{
|
||||
return ipCommonService.joinOrderList(commonVO);
|
||||
return pCommonService.joinOrderList(commonVO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化微信用户信息
|
||||
* @param pPassenger
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/initMember")
|
||||
@ApiOperation(value = "carpool_02_初始化微信用户信息", notes = "初始化微信用户信息,新用户系统会创建一个乘客的信息,非新用户会返回系统用户的信息。")
|
||||
public AjaxResult initMember( @Validated @RequestBody PPassenger pPassenger)
|
||||
{
|
||||
return pCommonService.initMember(pPassenger);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -4,16 +4,12 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
@ -31,6 +27,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/carpool/order")
|
||||
@Api(value = "小程序拼单-公共模块", tags = "订单模块")
|
||||
public class POrderController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
@ -48,6 +45,21 @@ public class POrderController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过openID查询订单信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('carpool:order:list')")
|
||||
@GetMapping("/queryOrderInfo")
|
||||
@ApiOperation(value = "carpool_04_通过openID查询当前用户的所有订单", notes = "通过openID查询当前用户的所有订单,不传则获取全都。返回参数参照 POrder 模块")
|
||||
public TableDataInfo queryOrderInfoByOpenId(@ApiParam(name = "openId必传", required = false ) @RequestParam(value = "openId" , required = false) String openId)
|
||||
{
|
||||
startPage();
|
||||
List<POrder> list = pOrderService.queryOrderInfoByOpenId(openId);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 导出订单信息列表
|
||||
*/
|
||||
@ -77,9 +89,10 @@ public class POrderController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('carpool:order:add')")
|
||||
@Log(title = "订单信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ApiOperation(value = "carpool_03_创建订单(发起拼单的接口)", notes = "发起拼单的接口")
|
||||
public AjaxResult add(@RequestBody POrder pOrder)
|
||||
{
|
||||
return toAjax(pOrderService.insertPOrder(pOrder));
|
||||
return pOrderService.insertPOrderWx(pOrder);
|
||||
}
|
||||
/**
|
||||
* 司机接单
|
||||
|
@ -3,7 +3,10 @@ package com.ruoyi.carpool.domain;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
public class CommonVO {
|
||||
import java.io.Serializable;
|
||||
|
||||
public class CommonVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 订单流水号
|
||||
*/
|
||||
@ -15,6 +18,21 @@ public class CommonVO {
|
||||
private String userID;
|
||||
|
||||
|
||||
/**
|
||||
* 参与拼单人的openID
|
||||
*/
|
||||
private String openId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String name ;
|
||||
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
private String phone ;
|
||||
|
||||
/**
|
||||
* 申请拼单的人数
|
||||
*/
|
||||
@ -46,12 +64,39 @@ public class CommonVO {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public String getOpenId() {
|
||||
return openId;
|
||||
}
|
||||
|
||||
public void setOpenId(String openId) {
|
||||
this.openId = openId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("orderNum", getOrderNum())
|
||||
.append("userID", getUserID())
|
||||
.append("num", getNum())
|
||||
.toString();
|
||||
return "CommonVO{" +
|
||||
"orderNum='" + orderNum + '\'' +
|
||||
", userID='" + userID + '\'' +
|
||||
", openId='" + openId + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", phone='" + phone + '\'' +
|
||||
", num=" + num +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
@ -2,89 +2,119 @@ package com.ruoyi.carpool.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 微信注册用户信息对象 p_member
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2021-12-25
|
||||
*/
|
||||
@ApiModel(value ="PMember" ,description = "微信用户注册信息")
|
||||
public class PMember extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 自增id */
|
||||
@ApiModelProperty(value = "自增id")
|
||||
private Integer id;
|
||||
|
||||
/** 平台编号 */
|
||||
@Excel(name = "平台编号")
|
||||
@ApiModelProperty(value = "平台编号")
|
||||
private String custId;
|
||||
|
||||
/** 用户类型 */
|
||||
@Excel(name = "用户类型")
|
||||
@ApiModelProperty(value = "用户类型:1乘客,2司机")
|
||||
private String custType;
|
||||
|
||||
/** 微信唯一标识 */
|
||||
@Excel(name = "微信唯一标识")
|
||||
@Excel(name = "微信唯一标识openid")
|
||||
@NotBlank(message = "openId必传")
|
||||
@ApiModelProperty(value = "微信唯一标识openid",required = true)
|
||||
private String openId;
|
||||
|
||||
/** 微信unionId */
|
||||
@Excel(name = "微信unionId")
|
||||
@ApiModelProperty(value = "微信unionId")
|
||||
private Long unionId;
|
||||
|
||||
/** 姓名 */
|
||||
@Excel(name = "姓名")
|
||||
@ApiModelProperty(value = "姓名")
|
||||
private String custName;
|
||||
|
||||
/** 微信昵称 */
|
||||
@Excel(name = "微信昵称")
|
||||
@ApiModelProperty(value = "微信昵称")
|
||||
private String nickName;
|
||||
|
||||
/** 手机号1 */
|
||||
@Excel(name = "手机号1")
|
||||
@ApiModelProperty(value = "手机号1")
|
||||
private String custPhoneA;
|
||||
|
||||
/** 手机号2 */
|
||||
@Excel(name = "手机号2")
|
||||
@ApiModelProperty(value = "手机号2")
|
||||
private String custPhoneB;
|
||||
|
||||
/** 性别 */
|
||||
@Excel(name = "性别")
|
||||
@ApiModelProperty(value = "性别")
|
||||
private String sex;
|
||||
|
||||
/** 生日 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "生日")
|
||||
private Date birthday;
|
||||
|
||||
/** 所在城市 */
|
||||
@Excel(name = "所在城市")
|
||||
@ApiModelProperty(value = "所在城市")
|
||||
private String city;
|
||||
|
||||
/** 所在省份 */
|
||||
@Excel(name = "所在省份")
|
||||
@ApiModelProperty(value = "所在省份")
|
||||
private String province;
|
||||
|
||||
/** 所在国家 */
|
||||
@Excel(name = "所在国家")
|
||||
@ApiModelProperty(value = "所在国家")
|
||||
private String country;
|
||||
|
||||
/** 用户头像 */
|
||||
@Excel(name = "用户头像")
|
||||
@ApiModelProperty(value = "用户头像")
|
||||
private String headimgurl;
|
||||
|
||||
/** 证件类型 */
|
||||
@Excel(name = "证件类型")
|
||||
@ApiModelProperty(value = "证件类型")
|
||||
private String idType;
|
||||
|
||||
/** 证件号 */
|
||||
@Excel(name = "证件号")
|
||||
@ApiModelProperty(value = "证件号")
|
||||
private String idNo;
|
||||
|
||||
/** 是否黑名单 */
|
||||
@Excel(name = "是否黑名单")
|
||||
@ApiModelProperty(value = "是否黑名单:0否,1是")
|
||||
private String isBlackList;
|
||||
|
||||
|
||||
|
||||
public void setId(Integer id)
|
||||
{
|
||||
this.id = id;
|
||||
@ -239,6 +269,14 @@ public class PMember extends BaseEntity
|
||||
return idNo;
|
||||
}
|
||||
|
||||
public String getIsBlackList() {
|
||||
return isBlackList;
|
||||
}
|
||||
|
||||
public void setIsBlackList(String isBlackList) {
|
||||
this.isBlackList = isBlackList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
@ -264,6 +302,7 @@ public class PMember extends BaseEntity
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("isBlackList", getIsBlackList())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package com.ruoyi.carpool.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
@ -13,59 +15,90 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
* @author ruoyi
|
||||
* @date 2021-12-03
|
||||
*/
|
||||
@ApiModel(value ="POrder" ,description = "订单模块入参")
|
||||
public class POrder extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** autoID */
|
||||
@ApiModelProperty(value = "自增id")
|
||||
private Long id;
|
||||
|
||||
/** 订单号 */
|
||||
@Excel(name = "订单号")
|
||||
@ApiModelProperty(value = "订单号")
|
||||
private String orderNum;
|
||||
|
||||
/** 出发地 */
|
||||
@Excel(name = "出发地")
|
||||
@ApiModelProperty(value = "出发地")
|
||||
private String departure;
|
||||
|
||||
/** 目的地 */
|
||||
@Excel(name = "目的地")
|
||||
@ApiModelProperty(value = "目的地")
|
||||
private String destination;
|
||||
|
||||
/** 出发时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "出发时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "出发时间")
|
||||
private Date departureTime;
|
||||
|
||||
/** 当前人数 */
|
||||
@Excel(name = "当前人数")
|
||||
@ApiModelProperty(value = "当前人数")
|
||||
private Integer member;
|
||||
|
||||
/** 订单当前的状态,0:拼单中;1:拼单完成;2:取消拼单 */
|
||||
@Excel(name = "订单当前的状态,0:拼单中;1:拼单完成;2:取消拼单")
|
||||
@ApiModelProperty(value = "订单当前的状态,0:拼单中;1:拼单完成;2:取消拼单")
|
||||
private String state;
|
||||
|
||||
/** 逻辑删除:1:删除 */
|
||||
@Excel(name = "逻辑删除:1:删除")
|
||||
@ApiModelProperty(value = "逻辑删除")
|
||||
private String isdelete;
|
||||
|
||||
/** 用户唯一平台ID */
|
||||
@Excel(name = "用户唯一平台ID")
|
||||
@ApiModelProperty(value = "用户唯一平台ID")
|
||||
private String createUser;
|
||||
|
||||
/** 订单更新人ID,使用逗号分割 */
|
||||
@Excel(name = "订单更新人ID,使用逗号分割")
|
||||
@ApiModelProperty(value = "订单更新人ID,使用逗号分割")
|
||||
private String updateUser;
|
||||
|
||||
@Excel(name = "是否接单")
|
||||
@ApiModelProperty(value = "是否接单")
|
||||
private String isTake;
|
||||
|
||||
@Excel(name = "司机平台ID")
|
||||
@ApiModelProperty(value = "司机平台ID")
|
||||
private String driverId;
|
||||
|
||||
@Excel(name = "司机姓名")
|
||||
@ApiModelProperty(value = "司机姓名")
|
||||
private String driverName;
|
||||
|
||||
@Excel(name = "司机微信端的openid")
|
||||
@ApiModelProperty(value = "司机微信端的openid")
|
||||
private String driverOpenId;
|
||||
|
||||
@Excel(name = "发起者姓名")
|
||||
@ApiModelProperty(value = "发起者姓名")
|
||||
private String createrName;
|
||||
|
||||
@Excel(name = "发起者openId")
|
||||
@ApiModelProperty(value = "发起者openId")
|
||||
private String createrOpenId;
|
||||
|
||||
@Excel(name = "发起者手机号")
|
||||
@ApiModelProperty(value = "发起者手机号")
|
||||
private String createrPhone;
|
||||
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
@ -181,6 +214,39 @@ public class POrder extends BaseEntity
|
||||
this.driverName = driverName;
|
||||
}
|
||||
|
||||
public String getDriverOpenId() {
|
||||
return driverOpenId;
|
||||
}
|
||||
|
||||
public void setDriverOpenId(String driverOpenId) {
|
||||
this.driverOpenId = driverOpenId;
|
||||
}
|
||||
|
||||
|
||||
public String getCreaterName() {
|
||||
return createrName;
|
||||
}
|
||||
|
||||
public void setCreaterName(String createrName) {
|
||||
this.createrName = createrName;
|
||||
}
|
||||
|
||||
public String getCreaterPhone() {
|
||||
return createrPhone;
|
||||
}
|
||||
|
||||
public void setCreaterPhone(String createrPhone) {
|
||||
this.createrPhone = createrPhone;
|
||||
}
|
||||
|
||||
public String getCreaterOpenId() {
|
||||
return createrOpenId;
|
||||
}
|
||||
|
||||
public void setCreaterOpenId(String createrOpenId) {
|
||||
this.createrOpenId = createrOpenId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
@ -199,6 +265,10 @@ public class POrder extends BaseEntity
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateUser", getUpdateUser())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("driverOpenId", getDriverOpenId())
|
||||
.append("createrName", getCreaterName())
|
||||
.append("CreaterPhone", getCreaterPhone())
|
||||
.append("createrOpenId", getCreaterOpenId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package com.ruoyi.carpool.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
@ -14,113 +16,136 @@ import org.omg.CORBA.INTERNAL;
|
||||
* @author ruoyi
|
||||
* @date 2021-12-03
|
||||
*/
|
||||
@ApiModel(value ="PPassenger" ,description = "乘客信息入参")
|
||||
public class PPassenger extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** autoID */
|
||||
@ApiModelProperty(value = "自增id")
|
||||
private Long id;
|
||||
|
||||
/** 用户平台唯一ID */
|
||||
@Excel(name = "用户平台唯一ID")
|
||||
@ApiModelProperty(value = "用户平台唯一ID")
|
||||
private String custId;
|
||||
|
||||
/** 用户名 */
|
||||
@Excel(name = "用户名")
|
||||
@ApiModelProperty(value = "用户名")
|
||||
private String custName;
|
||||
|
||||
/** 微信昵称 */
|
||||
@Excel(name = "微信昵称")
|
||||
@ApiModelProperty(value = "微信昵称")
|
||||
private String nickName;
|
||||
|
||||
/** 用户头像 */
|
||||
@Excel(name = "用户头像")
|
||||
@ApiModelProperty(value = "用户头像")
|
||||
private String headImgUrl;
|
||||
|
||||
/** 微信用户唯一标识 */
|
||||
@Excel(name = "微信用户唯一标识")
|
||||
@ApiModelProperty(value = "微信用户唯一标识openId")
|
||||
private String openId;
|
||||
|
||||
/** 用户手机号码 */
|
||||
@Excel(name = "用户手机号码")
|
||||
@ApiModelProperty(value = "用户手机号码")
|
||||
private String custPhone;
|
||||
|
||||
/** 性别:1男性,0女性 */
|
||||
@Excel(name = "性别:1男性,0女性")
|
||||
@ApiModelProperty(value = "性别:1男性,0女性")
|
||||
private String sex;
|
||||
|
||||
/** 身份证号码 */
|
||||
@Excel(name = "身份证号码")
|
||||
@ApiModelProperty(value = "身份证号码")
|
||||
private String idCard;
|
||||
|
||||
/** 生日 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "生日")
|
||||
private Date birthday;
|
||||
|
||||
/** 所在城市 */
|
||||
@Excel(name = "所在城市")
|
||||
@ApiModelProperty(value = "所在城市")
|
||||
private String city;
|
||||
|
||||
/** 年龄 */
|
||||
@Excel(name = "年龄")
|
||||
@ApiModelProperty(value = "年龄")
|
||||
private Integer age;
|
||||
|
||||
/** 所在省份 */
|
||||
@Excel(name = "所在省份")
|
||||
@ApiModelProperty(value = "所在省份")
|
||||
private String province;
|
||||
|
||||
/** 是否黑名单用户:0否,1是s */
|
||||
@Excel(name = "是否黑名单用户:0否,1是s")
|
||||
@ApiModelProperty(value = "是否黑名单用户:0否,1是")
|
||||
private String isBlacklist;
|
||||
|
||||
public void setId(Long id)
|
||||
@Excel(name = "当前的身份")
|
||||
@ApiModelProperty(value = "当前的身份:0乘客 1司机")
|
||||
private String applyState;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setCustId(String custId)
|
||||
public void setCustId(String custId)
|
||||
{
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public String getCustId()
|
||||
public String getCustId()
|
||||
{
|
||||
return custId;
|
||||
}
|
||||
public void setCustName(String custName)
|
||||
public void setCustName(String custName)
|
||||
{
|
||||
this.custName = custName;
|
||||
}
|
||||
|
||||
public String getCustName()
|
||||
public String getCustName()
|
||||
{
|
||||
return custName;
|
||||
}
|
||||
public void setNickName(String nickName)
|
||||
public void setNickName(String nickName)
|
||||
{
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
public String getNickName()
|
||||
public String getNickName()
|
||||
{
|
||||
return nickName;
|
||||
}
|
||||
public void setOpenId(String openId)
|
||||
public void setOpenId(String openId)
|
||||
{
|
||||
this.openId = openId;
|
||||
}
|
||||
|
||||
public String getOpenId()
|
||||
public String getOpenId()
|
||||
{
|
||||
return openId;
|
||||
}
|
||||
public void setCustPhone(String custPhone)
|
||||
public void setCustPhone(String custPhone)
|
||||
{
|
||||
this.custPhone = custPhone;
|
||||
}
|
||||
|
||||
public String getCustPhone()
|
||||
public String getCustPhone()
|
||||
{
|
||||
return custPhone;
|
||||
}
|
||||
@ -133,30 +158,30 @@ public class PPassenger extends BaseEntity
|
||||
{
|
||||
return sex;
|
||||
}
|
||||
public void setBirthday(Date birthday)
|
||||
public void setBirthday(Date birthday)
|
||||
{
|
||||
this.birthday = birthday;
|
||||
}
|
||||
|
||||
public Date getBirthday()
|
||||
public Date getBirthday()
|
||||
{
|
||||
return birthday;
|
||||
}
|
||||
public void setCity(String city)
|
||||
public void setCity(String city)
|
||||
{
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getCity()
|
||||
public String getCity()
|
||||
{
|
||||
return city;
|
||||
}
|
||||
public void setProvince(String province)
|
||||
public void setProvince(String province)
|
||||
{
|
||||
this.province = province;
|
||||
}
|
||||
|
||||
public String getProvince()
|
||||
public String getProvince()
|
||||
{
|
||||
return province;
|
||||
}
|
||||
@ -186,6 +211,22 @@ public class PPassenger extends BaseEntity
|
||||
this.idCard = idCard;
|
||||
}
|
||||
|
||||
public String getHeadImgUrl() {
|
||||
return headImgUrl;
|
||||
}
|
||||
|
||||
public void setHeadImgUrl(String headImgUrl) {
|
||||
this.headImgUrl = headImgUrl;
|
||||
}
|
||||
|
||||
public String getApplyState() {
|
||||
return applyState;
|
||||
}
|
||||
|
||||
public void setApplyState(String applyState) {
|
||||
this.applyState = applyState;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
@ -204,6 +245,8 @@ public class PPassenger extends BaseEntity
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("age", getAge())
|
||||
.append("idCard", getIdCard())
|
||||
.append("HeadImgUrl", getHeadImgUrl())
|
||||
.append("applyState", getApplyState())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
@ -58,4 +58,13 @@ public interface PMemberMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePMemberByIds(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 查询微信注册用户信息
|
||||
*
|
||||
* @param OpenId 微信注册用户信息主键
|
||||
* @return 微信注册用户信息
|
||||
*/
|
||||
public PMember selectPMemberByOpenId(String OpenId);
|
||||
|
||||
}
|
||||
|
@ -82,5 +82,22 @@ public interface POrderMapper
|
||||
*/
|
||||
public int updateOrderMemberNum(POrder pOrder);
|
||||
|
||||
/**
|
||||
* 通过openID查询订单信息
|
||||
* @param openId
|
||||
* @return
|
||||
*/
|
||||
public List<POrder> queryOrderInfoByOpenId(String openId);
|
||||
|
||||
/**
|
||||
* 通过openID查询订单信息
|
||||
* @param openId
|
||||
* @return
|
||||
*/
|
||||
public List<POrder> queryOrderInfoByOpenIdAndState(String openId);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.ruoyi.carpool.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.carpool.domain.PPassenger;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
|
||||
/**
|
||||
* 乘客信息Mapper接口
|
||||
@ -65,4 +66,11 @@ public interface PPassengerMapper
|
||||
* @return
|
||||
*/
|
||||
public PPassenger queryUserInfo(PPassenger pPassenger);
|
||||
|
||||
/**
|
||||
* 通过openId查询乘客的信息
|
||||
* @param openId
|
||||
* @return
|
||||
*/
|
||||
public PPassenger selectPPassengerByOpenId(String openId);
|
||||
}
|
||||
|
@ -1,13 +1,15 @@
|
||||
package com.ruoyi.carpool.service;
|
||||
|
||||
import com.ruoyi.carpool.domain.CommonVO;
|
||||
import com.ruoyi.carpool.domain.PMember;
|
||||
import com.ruoyi.carpool.domain.PPassenger;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
||||
public interface IPCommonService {
|
||||
|
||||
/**
|
||||
* 取消订单
|
||||
* @param orderNum
|
||||
* @param commonVO
|
||||
* @return
|
||||
*/
|
||||
public AjaxResult cancelOrder(CommonVO commonVO);
|
||||
@ -20,4 +22,12 @@ public interface IPCommonService {
|
||||
*/
|
||||
public AjaxResult joinOrderList(CommonVO commonVO);
|
||||
|
||||
|
||||
/**
|
||||
* 初始化微信用户信息
|
||||
* @param pMember
|
||||
* @return
|
||||
*/
|
||||
public AjaxResult initMember(PPassenger pPassenger);
|
||||
|
||||
}
|
||||
|
@ -58,4 +58,12 @@ public interface IPMemberService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePMemberById(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 通过OpenId查询用户的信息
|
||||
* @param OpenId
|
||||
* @return
|
||||
*/
|
||||
public PMember selectPMemberByOpenId(String OpenId);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.ruoyi.carpool.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.carpool.domain.POrder;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
||||
/**
|
||||
* 订单信息Service接口
|
||||
@ -27,6 +28,14 @@ public interface IPOrderService
|
||||
*/
|
||||
public List<POrder> selectPOrderList(POrder pOrder);
|
||||
|
||||
|
||||
/**
|
||||
* 通过openID查询订单信息列表
|
||||
* @param openID
|
||||
* @return
|
||||
*/
|
||||
public List<POrder> queryOrderInfoByOpenId(String openID);
|
||||
|
||||
/**
|
||||
* 新增订单信息
|
||||
*
|
||||
@ -35,6 +44,14 @@ public interface IPOrderService
|
||||
*/
|
||||
public int insertPOrder(POrder pOrder);
|
||||
|
||||
/**
|
||||
* 新增订单信息
|
||||
*
|
||||
* @param pOrder 订单信息
|
||||
* @return 结果
|
||||
*/
|
||||
public AjaxResult insertPOrderWx(POrder pOrder);
|
||||
|
||||
/**
|
||||
* 修改订单信息
|
||||
*
|
||||
|
@ -1,14 +1,16 @@
|
||||
package com.ruoyi.carpool.service.impl;
|
||||
|
||||
import com.ruoyi.carpool.domain.CommonVO;
|
||||
import com.ruoyi.carpool.domain.PMember;
|
||||
import com.ruoyi.carpool.domain.POrder;
|
||||
import com.ruoyi.carpool.mapper.PCommonMapper;
|
||||
import com.ruoyi.carpool.mapper.PDriverMapper;
|
||||
import com.ruoyi.carpool.mapper.POrderMapper;
|
||||
import com.ruoyi.carpool.domain.PPassenger;
|
||||
import com.ruoyi.carpool.mapper.*;
|
||||
import com.ruoyi.carpool.service.IPCommonService;
|
||||
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;
|
||||
@ -31,6 +33,12 @@ public class IPCommonServiceImpl implements IPCommonService {
|
||||
@Autowired
|
||||
private POrderMapper pOrderMapper;
|
||||
|
||||
@Autowired
|
||||
private PMemberMapper pMemberMapper;
|
||||
|
||||
@Autowired
|
||||
private PPassengerMapper pPassengerMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public AjaxResult cancelOrder(CommonVO commonVO) {
|
||||
@ -96,9 +104,34 @@ public class IPCommonServiceImpl implements IPCommonService {
|
||||
data.put("orderNum",orderNum);
|
||||
data.put("custId" ,userId);
|
||||
data.put("num" ,num);
|
||||
data.put("cust_name" ,commonVO.getName());
|
||||
data.put("open_id" ,commonVO.getOpenId());
|
||||
data.put("cust_phone" ,commonVO.getPhone());
|
||||
data.put("state" ,0);
|
||||
data.put("createTime" , DateUtils.dateTimeNow());
|
||||
pCommonMapper.insertOrderMemberInfo(data);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult initMember(PPassenger pPassenger) {
|
||||
String openId = pPassenger.getOpenId();
|
||||
if(StringUtils.isEmpty(openId)) return AjaxResult.error("请求参数错误!");
|
||||
PPassenger passemger = pPassengerMapper.selectPPassengerByOpenId(openId);
|
||||
if(passemger != null){
|
||||
/*TODO 需要判断当前用户是否申请成为看司机 */
|
||||
return AjaxResult.success(passemger);
|
||||
}else {
|
||||
/*系统没有用户,初始化一个乘客信息*/
|
||||
pPassenger.setIsBlacklist("0");
|
||||
if(StringUtils.isEmpty(pPassenger.getCustName())) pPassenger.setCustName(pPassenger.getNickName());/*用户名为空取昵称*/
|
||||
if(StringUtils.isEmpty(pPassenger.getSex())) pPassenger.setSex("2");/*性别设置为未知*/
|
||||
pPassenger.setCreateBy("weixi_mini_admin");
|
||||
pPassenger.setCreateTime(DateUtils.getNowDate());
|
||||
pPassenger.setCustId("wxmini"+IdUtils.simpleUUID());
|
||||
pPassenger.setApplyState("0");/*默认是乘客*/
|
||||
pPassengerMapper.insertPPassenger(pPassenger);
|
||||
}
|
||||
return AjaxResult.success(pPassenger);
|
||||
}
|
||||
}
|
||||
|
@ -93,4 +93,10 @@ public class PMemberServiceImpl implements IPMemberService
|
||||
{
|
||||
return pMemberMapper.deletePMemberById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PMember selectPMemberByOpenId(String OpenId)
|
||||
{
|
||||
return pMemberMapper.selectPMemberByOpenId(OpenId);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,12 @@
|
||||
package com.ruoyi.carpool.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.carpool.domain.PPassenger;
|
||||
import com.ruoyi.carpool.mapper.PPassengerMapper;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.carpool.mapper.POrderMapper;
|
||||
@ -20,6 +25,9 @@ public class POrderServiceImpl implements IPOrderService
|
||||
@Autowired
|
||||
private POrderMapper pOrderMapper;
|
||||
|
||||
@Autowired
|
||||
private PPassengerMapper pPassengerMapper;
|
||||
|
||||
/**
|
||||
* 查询订单信息
|
||||
*
|
||||
@ -44,6 +52,12 @@ public class POrderServiceImpl implements IPOrderService
|
||||
return pOrderMapper.selectPOrderList(pOrder);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<POrder> queryOrderInfoByOpenId(String openId) {
|
||||
return pOrderMapper.queryOrderInfoByOpenId(openId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单信息
|
||||
*
|
||||
@ -57,11 +71,42 @@ public class POrderServiceImpl implements IPOrderService
|
||||
pOrder.setOrderNum("carpool_"+orderNum);
|
||||
pOrder.setIsTake("0");
|
||||
pOrder.setState("0");
|
||||
pOrder.setMember(0);
|
||||
pOrder.setCreateTime(DateUtils.getNowDate());
|
||||
return pOrderMapper.insertPOrder(pOrder);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增订单信息
|
||||
*
|
||||
* @param pOrder 订单信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult insertPOrderWx(POrder pOrder)
|
||||
{
|
||||
/*校验当前用户是否存在未完成的订单*/
|
||||
String openId = pOrder.getCreaterOpenId();
|
||||
if(StringUtils.isEmpty(openId)) return AjaxResult.error("openId 必传");
|
||||
/*判断当前用户是否是黑名单*/
|
||||
PPassenger pPassenger = pPassengerMapper.selectPPassengerByOpenId(openId);
|
||||
if("1".equals(pPassenger.getIsBlacklist())) return AjaxResult.error("您现在处于系统黑名单,请联系管理员。");
|
||||
/*查询当前用户是否存在拼单中的订单*/
|
||||
List<POrder> pOrders = pOrderMapper.queryOrderInfoByOpenIdAndState(openId);
|
||||
if(pOrders.size() > 0){
|
||||
return AjaxResult.error("您在系统中存在拼单中的订单。");
|
||||
}
|
||||
String orderNum = DateUtils.dateTimeNow();
|
||||
pOrder.setOrderNum("carpool_"+orderNum);
|
||||
pOrder.setIsTake("0");
|
||||
pOrder.setState("0");
|
||||
pOrder.setCreateTime(DateUtils.getNowDate());
|
||||
pOrderMapper.insertPOrder(pOrder);
|
||||
return AjaxResult.success("发起拼单成功。");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改订单信息
|
||||
*
|
||||
@ -102,7 +147,7 @@ public class POrderServiceImpl implements IPOrderService
|
||||
/**
|
||||
* 删除订单信息信息
|
||||
*
|
||||
* @param id 订单信息主键
|
||||
* @param
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
@ -41,6 +41,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="num != null">num,</if>
|
||||
<if test="state != null">state,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="cust_name != null">cust_name,</if>
|
||||
<if test="cust_phone != null">cust_phone,</if>
|
||||
<if test="open_id != null">open_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
@ -48,6 +51,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="num != null">#{num},</if>
|
||||
<if test="state != null">#{state},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="cust_name != null">#{cust_name},</if>
|
||||
<if test="cust_phone != null">#{cust_phone},</if>
|
||||
<if test="open_id != null">#{open_id},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -148,4 +148,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectPMemberByOpenId" parameterType="String" resultMap="PMemberResult">
|
||||
<include refid="selectPMemberVo"/>
|
||||
where open_id = #{OpenId}
|
||||
</select>
|
||||
</mapper>
|
@ -12,33 +12,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="departureTime" column="departure_time" />
|
||||
<result property="member" column="member" />
|
||||
<result property="state" column="state" />
|
||||
<result property="createrOpenId" column="creater_openid" />
|
||||
<result property="isdelete" column="isDelete" />
|
||||
<result property="isTake" column="is_take" />
|
||||
<result property="createrName" column="creater_name" />
|
||||
<result property="createrPhone" column="creater_phone" />
|
||||
<result property="driverId" column="driver_id" />
|
||||
<result property="driverName" column="driver_name" />
|
||||
<result property="createUser" column="create_user" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateUser" column="update_user" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="driverOpenId" column="driver_open_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPOrderVo">
|
||||
select id, order_num, departure, destination, departure_time, member, state, isDelete, create_user, create_time, update_user, update_time from p_order
|
||||
select
|
||||
id, order_num, departure, destination, departure_time, member, state,creater_name,creater_phone,creater_openid
|
||||
isDelete, create_user, create_time, update_user, update_time
|
||||
from p_order
|
||||
</sql>
|
||||
|
||||
<select id="selectPOrderList" parameterType="POrder" resultMap="POrderResult">
|
||||
<!-- <include refid="selectPOrderVo"/>-->
|
||||
<!-- <where> -->
|
||||
<!-- <if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum}</if>-->
|
||||
<!-- <if test="departure != null and departure != ''"> and departure = #{departure}</if>-->
|
||||
<!-- <if test="destination != null and destination != ''"> and destination = #{destination}</if>-->
|
||||
<!-- <if test="departureTime != null "> and departure_time = #{departureTime}</if>-->
|
||||
<!-- <if test="member != null "> and member = #{member}</if>-->
|
||||
<!-- <if test="state != null "> and state = #{state}</if>-->
|
||||
<!-- <if test="isdelete != null "> and isDelete = #{isdelete}</if>-->
|
||||
<!-- <if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if>-->
|
||||
<!-- <if test="updateUser != null and updateUser != ''"> and update_user = #{updateUser}</if>-->
|
||||
<!-- </where>-->
|
||||
SELECT A.* , B.name as driver_name FROM p_order A
|
||||
LEFT JOIN p_driver B ON A.driver_id = B.driver_id
|
||||
where 1=1
|
||||
@ -53,7 +48,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="driverName != null "> and B.name = #{driverName}</if>
|
||||
<if test="createUser != null and createUser != ''"> and A.create_user = #{createUser}</if>
|
||||
<if test="updateUser != null and updateUser != ''"> and A.update_user = #{updateUser}</if>
|
||||
|
||||
<if test="driverOpenId != null and driverOpenId != ''"> and A.driver_open_id = #{driverOpenId}</if>
|
||||
<if test="createrOpenId != null and createrOpenId != ''"> and A.creater_openid = #{createrOpenId}</if>
|
||||
<if test="createrPhone != null and createrPhone != ''"> and A.creater_phone = #{createrPhone}</if>
|
||||
<if test="createrName != null and createrName != ''"> and A.creater_name = #{createrName}</if>
|
||||
</select>
|
||||
|
||||
<select id="selectPOrderById" parameterType="Long" resultMap="POrderResult">
|
||||
@ -71,11 +69,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="member != null">member,</if>
|
||||
<if test="state != null">state,</if>
|
||||
<if test="isTake != null ">is_take,</if>
|
||||
<if test="createrPhone != null ">creater_phone,</if>
|
||||
<if test="createrName != null ">creater_name,</if>
|
||||
<if test="isdelete != null">isDelete,</if>
|
||||
<if test="createUser != null">create_user,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateUser != null">update_user,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createrOpenId != null">creater_openid,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
@ -85,11 +86,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="member != null">#{member},</if>
|
||||
<if test="state != null">#{state},</if>
|
||||
<if test="isTake != null ">#{isTake},</if>
|
||||
<if test="createrPhone != null ">#{createrPhone},</if>
|
||||
<if test="createrName != null ">#{createrName},</if>
|
||||
<if test="isdelete != null">#{isdelete},</if>
|
||||
<if test="createUser != null">#{createUser},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateUser != null">#{updateUser},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createrOpenId != null">#{createrOpenId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -142,6 +146,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
update p_order set member = #{member} where order_num = #{orderNum}
|
||||
</update>
|
||||
|
||||
<select id="queryOrderInfoByOpenId" parameterType="String" resultMap="POrderResult" >
|
||||
<include refid="selectPOrderVo"/>
|
||||
where
|
||||
driver_open_id = #{openId} or creater_openid = #{openId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryOrderInfoByOpenIdAndState" parameterType="String" resultMap="POrderResult" >
|
||||
<include refid="selectPOrderVo"/>
|
||||
where creater_openid = #{openId} and state = 0
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
@ -10,6 +10,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="custName" column="cust_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="openId" column="open_id" />
|
||||
<result property="headImgUrl" column="head_img_url" />
|
||||
<result property="applyState" column="apply_state" />
|
||||
<result property="custPhone" column="cust_phone" />
|
||||
<result property="sex" column="sex" />
|
||||
<result property="idCard" column="id_card" />
|
||||
@ -23,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPPassengerVo">
|
||||
select id, cust_id, cust_name, nick_name, open_id, cust_phone, sex, id_card, birthday, city, province, is_blacklist, create_time, update_time from p_passenger
|
||||
select id, cust_id, cust_name, nick_name, open_id,head_img_url,apply_state, cust_phone, sex, id_card, birthday, city, province, is_blacklist, create_time, update_time from p_passenger
|
||||
</sql>
|
||||
|
||||
<select id="selectPPassengerList" parameterType="PPassenger" resultMap="PPassengerResult">
|
||||
@ -56,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="custName != null">cust_name,</if>
|
||||
<if test="nickName != null">nick_name,</if>
|
||||
<if test="openId != null">open_id,</if>
|
||||
<if test="headImgUrl != null">head_img_url,</if>
|
||||
<if test="custPhone != null">cust_phone,</if>
|
||||
<if test="sex != null">sex,</if>
|
||||
<if test="idCard != null "> and id_card = #{idCard}</if>
|
||||
@ -72,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="custName != null">#{custName},</if>
|
||||
<if test="nickName != null">#{nickName},</if>
|
||||
<if test="openId != null">#{openId},</if>
|
||||
<if test="headImgUrl != null">#{headImgUrl},</if>
|
||||
<if test="custPhone != null">#{custPhone},</if>
|
||||
<if test="sex != null">#{sex},</if>
|
||||
<if test="idCard != null "> and id_card = #{idCard}</if>
|
||||
@ -133,4 +137,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="isBlacklist != null "> and is_blacklist = #{isBlacklist}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPPassengerByOpenId" parameterType="String" resultMap="PPassengerResult">
|
||||
<include refid="selectPPassengerVo"/>
|
||||
where open_id = #{openId}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
@ -37,6 +37,14 @@
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- swagger2-UI-->
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>swagger-bootstrap-ui</artifactId>
|
||||
<version>1.9.6</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Mysql驱动包 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
@ -61,6 +69,7 @@
|
||||
<artifactId>ruoyi-generator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--添加小程序模块的依赖-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruiyi-carpool</artifactId>
|
||||
|
@ -2,11 +2,12 @@ package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.context.annotation.Description;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysMenu;
|
||||
@ -56,7 +57,10 @@ public class SysLoginController
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/weixiMiniLogin")
|
||||
public AjaxResult weixiMiniLogin()
|
||||
@ApiOperation(value = "carpool_01_微信小程序获取后台系统token", notes = "获取小程序accessToken")
|
||||
public AjaxResult weixiMiniLogin(
|
||||
@ApiParam( name = "openId",value = "微信openId",required = false) @RequestParam(value = "openId" ,required = false) String openId
|
||||
)
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
// 微信小程序登入生成令牌
|
||||
|
@ -9,6 +9,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
@ -48,7 +49,7 @@ public class SwaggerConfig
|
||||
@Bean
|
||||
public Docket createRestApi()
|
||||
{
|
||||
return new Docket(DocumentationType.OAS_30)
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
// 是否启用Swagger
|
||||
.enable(enabled)
|
||||
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
|
||||
@ -58,9 +59,9 @@ public class SwaggerConfig
|
||||
// 扫描所有有注解的api,用这种方式更灵活
|
||||
// .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
||||
// 扫描指定包中的swagger注解
|
||||
.apis(RequestHandlerSelectors.basePackage("com.ruoyi.carpool"))
|
||||
// .apis(RequestHandlerSelectors.basePackage("com.ruoyi.carpool"))
|
||||
// 扫描所有
|
||||
// .apis(RequestHandlerSelectors.any())
|
||||
.apis(RequestHandlerSelectors.any())
|
||||
.paths(PathSelectors.any())
|
||||
.build()
|
||||
/* 设置安全模式,swagger可以设置访问token */
|
||||
|
@ -125,6 +125,12 @@
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -132,6 +132,19 @@ public class BaseController
|
||||
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 响应返回结果
|
||||
*
|
||||
* @param rows 影响行数
|
||||
* @return 操作结果
|
||||
*/
|
||||
protected AjaxResult toAjax(int rows , String msg)
|
||||
{
|
||||
return rows > 0 ? AjaxResult.success(msg) : AjaxResult.error(msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 响应返回结果
|
||||
*
|
||||
|
@ -5,6 +5,7 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Entity基类
|
||||
@ -19,20 +20,25 @@ public class BaseEntity implements Serializable
|
||||
private String searchValue;
|
||||
|
||||
/** 创建者 */
|
||||
@ApiModelProperty(value = "创建者")
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新者 */
|
||||
@ApiModelProperty(value = "更新者")
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/** 备注 */
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/** 请求参数 */
|
||||
|
@ -90,7 +90,6 @@ public class SysLoginService
|
||||
// 生成token
|
||||
return tokenService.createToken(loginUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验验证码
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user