添加微信用户注册和小程序登入的接口
This commit is contained in:
parent
f04023a492
commit
506ca3760b
@ -0,0 +1,104 @@
|
||||
package com.ruoyi.carpool.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
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 com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.carpool.domain.PMember;
|
||||
import com.ruoyi.carpool.service.IPMemberService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 微信注册用户信息Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2021-12-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/carpool/member")
|
||||
public class PMemberController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IPMemberService pMemberService;
|
||||
|
||||
/**
|
||||
* 查询微信注册用户信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('carpool:member:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(PMember pMember)
|
||||
{
|
||||
startPage();
|
||||
List<PMember> list = pMemberService.selectPMemberList(pMember);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出微信注册用户信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('carpool:member:export')")
|
||||
@Log(title = "微信注册用户信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, PMember pMember)
|
||||
{
|
||||
List<PMember> list = pMemberService.selectPMemberList(pMember);
|
||||
ExcelUtil<PMember> util = new ExcelUtil<PMember>(PMember.class);
|
||||
util.exportExcel(response, list, "微信注册用户信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取微信注册用户信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('carpool:member:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Integer id)
|
||||
{
|
||||
return AjaxResult.success(pMemberService.selectPMemberById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增微信注册用户信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('carpool:member:add')")
|
||||
@Log(title = "微信注册用户信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody PMember pMember)
|
||||
{
|
||||
return toAjax(pMemberService.insertPMember(pMember));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改微信注册用户信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('carpool:member:edit')")
|
||||
@Log(title = "微信注册用户信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody PMember pMember)
|
||||
{
|
||||
return toAjax(pMemberService.updatePMember(pMember));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除微信注册用户信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('carpool:member:remove')")
|
||||
@Log(title = "微信注册用户信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Integer[] ids)
|
||||
{
|
||||
return toAjax(pMemberService.deletePMemberByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,269 @@
|
||||
package com.ruoyi.carpool.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 微信注册用户信息对象 p_member
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2021-12-25
|
||||
*/
|
||||
public class PMember extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 自增id */
|
||||
private Integer id;
|
||||
|
||||
/** 平台编号 */
|
||||
@Excel(name = "平台编号")
|
||||
private String custId;
|
||||
|
||||
/** 用户类型 */
|
||||
@Excel(name = "用户类型")
|
||||
private String custType;
|
||||
|
||||
/** 微信唯一标识 */
|
||||
@Excel(name = "微信唯一标识")
|
||||
private String openId;
|
||||
|
||||
/** 微信unionId */
|
||||
@Excel(name = "微信unionId")
|
||||
private Long unionId;
|
||||
|
||||
/** 姓名 */
|
||||
@Excel(name = "姓名")
|
||||
private String custName;
|
||||
|
||||
/** 微信昵称 */
|
||||
@Excel(name = "微信昵称")
|
||||
private String nickName;
|
||||
|
||||
/** 手机号1 */
|
||||
@Excel(name = "手机号1")
|
||||
private String custPhoneA;
|
||||
|
||||
/** 手机号2 */
|
||||
@Excel(name = "手机号2")
|
||||
private String custPhoneB;
|
||||
|
||||
/** 性别 */
|
||||
@Excel(name = "性别")
|
||||
private String sex;
|
||||
|
||||
/** 生日 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date birthday;
|
||||
|
||||
/** 所在城市 */
|
||||
@Excel(name = "所在城市")
|
||||
private String city;
|
||||
|
||||
/** 所在省份 */
|
||||
@Excel(name = "所在省份")
|
||||
private String province;
|
||||
|
||||
/** 所在国家 */
|
||||
@Excel(name = "所在国家")
|
||||
private String country;
|
||||
|
||||
/** 用户头像 */
|
||||
@Excel(name = "用户头像")
|
||||
private String headimgurl;
|
||||
|
||||
/** 证件类型 */
|
||||
@Excel(name = "证件类型")
|
||||
private String idType;
|
||||
|
||||
/** 证件号 */
|
||||
@Excel(name = "证件号")
|
||||
private String idNo;
|
||||
|
||||
public void setId(Integer id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setCustId(String custId)
|
||||
{
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public String getCustId()
|
||||
{
|
||||
return custId;
|
||||
}
|
||||
public void setCustType(String custType)
|
||||
{
|
||||
this.custType = custType;
|
||||
}
|
||||
|
||||
public String getCustType()
|
||||
{
|
||||
return custType;
|
||||
}
|
||||
public void setOpenId(String openId)
|
||||
{
|
||||
this.openId = openId;
|
||||
}
|
||||
|
||||
public String getOpenId()
|
||||
{
|
||||
return openId;
|
||||
}
|
||||
public void setUnionId(Long unionId)
|
||||
{
|
||||
this.unionId = unionId;
|
||||
}
|
||||
|
||||
public Long getUnionId()
|
||||
{
|
||||
return unionId;
|
||||
}
|
||||
public void setCustName(String custName)
|
||||
{
|
||||
this.custName = custName;
|
||||
}
|
||||
|
||||
public String getCustName()
|
||||
{
|
||||
return custName;
|
||||
}
|
||||
public void setNickName(String nickName)
|
||||
{
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
public String getNickName()
|
||||
{
|
||||
return nickName;
|
||||
}
|
||||
public void setCustPhoneA(String custPhoneA)
|
||||
{
|
||||
this.custPhoneA = custPhoneA;
|
||||
}
|
||||
|
||||
public String getCustPhoneA()
|
||||
{
|
||||
return custPhoneA;
|
||||
}
|
||||
public void setCustPhoneB(String custPhoneB)
|
||||
{
|
||||
this.custPhoneB = custPhoneB;
|
||||
}
|
||||
|
||||
public String getCustPhoneB()
|
||||
{
|
||||
return custPhoneB;
|
||||
}
|
||||
public void setSex(String sex)
|
||||
{
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getSex()
|
||||
{
|
||||
return sex;
|
||||
}
|
||||
public void setBirthday(Date birthday)
|
||||
{
|
||||
this.birthday = birthday;
|
||||
}
|
||||
|
||||
public Date getBirthday()
|
||||
{
|
||||
return birthday;
|
||||
}
|
||||
public void setCity(String city)
|
||||
{
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getCity()
|
||||
{
|
||||
return city;
|
||||
}
|
||||
public void setProvince(String province)
|
||||
{
|
||||
this.province = province;
|
||||
}
|
||||
|
||||
public String getProvince()
|
||||
{
|
||||
return province;
|
||||
}
|
||||
public void setCountry(String country)
|
||||
{
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public String getCountry()
|
||||
{
|
||||
return country;
|
||||
}
|
||||
public void setHeadimgurl(String headimgurl)
|
||||
{
|
||||
this.headimgurl = headimgurl;
|
||||
}
|
||||
|
||||
public String getHeadimgurl()
|
||||
{
|
||||
return headimgurl;
|
||||
}
|
||||
public void setIdType(String idType)
|
||||
{
|
||||
this.idType = idType;
|
||||
}
|
||||
|
||||
public String getIdType()
|
||||
{
|
||||
return idType;
|
||||
}
|
||||
public void setIdNo(String idNo)
|
||||
{
|
||||
this.idNo = idNo;
|
||||
}
|
||||
|
||||
public String getIdNo()
|
||||
{
|
||||
return idNo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("custId", getCustId())
|
||||
.append("custType", getCustType())
|
||||
.append("openId", getOpenId())
|
||||
.append("unionId", getUnionId())
|
||||
.append("custName", getCustName())
|
||||
.append("nickName", getNickName())
|
||||
.append("custPhoneA", getCustPhoneA())
|
||||
.append("custPhoneB", getCustPhoneB())
|
||||
.append("sex", getSex())
|
||||
.append("birthday", getBirthday())
|
||||
.append("city", getCity())
|
||||
.append("province", getProvince())
|
||||
.append("country", getCountry())
|
||||
.append("headimgurl", getHeadimgurl())
|
||||
.append("idType", getIdType())
|
||||
.append("idNo", getIdNo())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.carpool.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.carpool.domain.PMember;
|
||||
|
||||
/**
|
||||
* 微信注册用户信息Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2021-12-25
|
||||
*/
|
||||
public interface PMemberMapper
|
||||
{
|
||||
/**
|
||||
* 查询微信注册用户信息
|
||||
*
|
||||
* @param id 微信注册用户信息主键
|
||||
* @return 微信注册用户信息
|
||||
*/
|
||||
public PMember selectPMemberById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询微信注册用户信息列表
|
||||
*
|
||||
* @param pMember 微信注册用户信息
|
||||
* @return 微信注册用户信息集合
|
||||
*/
|
||||
public List<PMember> selectPMemberList(PMember pMember);
|
||||
|
||||
/**
|
||||
* 新增微信注册用户信息
|
||||
*
|
||||
* @param pMember 微信注册用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPMember(PMember pMember);
|
||||
|
||||
/**
|
||||
* 修改微信注册用户信息
|
||||
*
|
||||
* @param pMember 微信注册用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePMember(PMember pMember);
|
||||
|
||||
/**
|
||||
* 删除微信注册用户信息
|
||||
*
|
||||
* @param id 微信注册用户信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePMemberById(Integer id);
|
||||
|
||||
/**
|
||||
* 批量删除微信注册用户信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePMemberByIds(Integer[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.carpool.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.carpool.domain.PMember;
|
||||
|
||||
/**
|
||||
* 微信注册用户信息Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2021-12-25
|
||||
*/
|
||||
public interface IPMemberService
|
||||
{
|
||||
/**
|
||||
* 查询微信注册用户信息
|
||||
*
|
||||
* @param id 微信注册用户信息主键
|
||||
* @return 微信注册用户信息
|
||||
*/
|
||||
public PMember selectPMemberById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询微信注册用户信息列表
|
||||
*
|
||||
* @param pMember 微信注册用户信息
|
||||
* @return 微信注册用户信息集合
|
||||
*/
|
||||
public List<PMember> selectPMemberList(PMember pMember);
|
||||
|
||||
/**
|
||||
* 新增微信注册用户信息
|
||||
*
|
||||
* @param pMember 微信注册用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPMember(PMember pMember);
|
||||
|
||||
/**
|
||||
* 修改微信注册用户信息
|
||||
*
|
||||
* @param pMember 微信注册用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePMember(PMember pMember);
|
||||
|
||||
/**
|
||||
* 批量删除微信注册用户信息
|
||||
*
|
||||
* @param ids 需要删除的微信注册用户信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePMemberByIds(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 删除微信注册用户信息信息
|
||||
*
|
||||
* @param id 微信注册用户信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePMemberById(Integer id);
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.ruoyi.carpool.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.carpool.mapper.PMemberMapper;
|
||||
import com.ruoyi.carpool.domain.PMember;
|
||||
import com.ruoyi.carpool.service.IPMemberService;
|
||||
|
||||
/**
|
||||
* 微信注册用户信息Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2021-12-25
|
||||
*/
|
||||
@Service
|
||||
public class PMemberServiceImpl implements IPMemberService
|
||||
{
|
||||
@Autowired
|
||||
private PMemberMapper pMemberMapper;
|
||||
|
||||
/**
|
||||
* 查询微信注册用户信息
|
||||
*
|
||||
* @param id 微信注册用户信息主键
|
||||
* @return 微信注册用户信息
|
||||
*/
|
||||
@Override
|
||||
public PMember selectPMemberById(Integer id)
|
||||
{
|
||||
return pMemberMapper.selectPMemberById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询微信注册用户信息列表
|
||||
*
|
||||
* @param pMember 微信注册用户信息
|
||||
* @return 微信注册用户信息
|
||||
*/
|
||||
@Override
|
||||
public List<PMember> selectPMemberList(PMember pMember)
|
||||
{
|
||||
return pMemberMapper.selectPMemberList(pMember);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增微信注册用户信息
|
||||
*
|
||||
* @param pMember 微信注册用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertPMember(PMember pMember)
|
||||
{
|
||||
pMember.setCreateTime(DateUtils.getNowDate());
|
||||
return pMemberMapper.insertPMember(pMember);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改微信注册用户信息
|
||||
*
|
||||
* @param pMember 微信注册用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updatePMember(PMember pMember)
|
||||
{
|
||||
pMember.setUpdateTime(DateUtils.getNowDate());
|
||||
return pMemberMapper.updatePMember(pMember);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除微信注册用户信息
|
||||
*
|
||||
* @param ids 需要删除的微信注册用户信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePMemberByIds(Integer[] ids)
|
||||
{
|
||||
return pMemberMapper.deletePMemberByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除微信注册用户信息信息
|
||||
*
|
||||
* @param id 微信注册用户信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePMemberById(Integer id)
|
||||
{
|
||||
return pMemberMapper.deletePMemberById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,151 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.carpool.mapper.PMemberMapper">
|
||||
|
||||
<resultMap type="PMember" id="PMemberResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="custId" column="cust_id" />
|
||||
<result property="custType" column="cust_type" />
|
||||
<result property="openId" column="open_id" />
|
||||
<result property="unionId" column="union_id" />
|
||||
<result property="custName" column="cust_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="custPhoneA" column="cust_phone_a" />
|
||||
<result property="custPhoneB" column="cust_phone_b" />
|
||||
<result property="sex" column="sex" />
|
||||
<result property="birthday" column="birthday" />
|
||||
<result property="city" column="city" />
|
||||
<result property="province" column="province" />
|
||||
<result property="country" column="country" />
|
||||
<result property="headimgurl" column="headimgurl" />
|
||||
<result property="idType" column="id_type" />
|
||||
<result property="idNo" column="id_no" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPMemberVo">
|
||||
select id, cust_id, cust_type, open_id, union_id, cust_name, nick_name, cust_phone_a, cust_phone_b, sex, birthday, city, province, country, headimgurl, id_type, id_no, remark, create_by, create_time, update_by, update_time from p_member
|
||||
</sql>
|
||||
|
||||
<select id="selectPMemberList" parameterType="PMember" resultMap="PMemberResult">
|
||||
<include refid="selectPMemberVo"/>
|
||||
<where>
|
||||
<if test="custId != null and custId != ''"> and cust_id = #{custId}</if>
|
||||
<if test="custType != null and custType != ''"> and cust_type = #{custType}</if>
|
||||
<if test="openId != null and openId != ''"> and open_id = #{openId}</if>
|
||||
<if test="unionId != null "> and union_id = #{unionId}</if>
|
||||
<if test="custName != null and custName != ''"> and cust_name like concat('%', #{custName}, '%')</if>
|
||||
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
||||
<if test="custPhoneA != null and custPhoneA != ''"> and cust_phone_a = #{custPhoneA}</if>
|
||||
<if test="custPhoneB != null and custPhoneB != ''"> and cust_phone_b = #{custPhoneB}</if>
|
||||
<if test="sex != null and sex != ''"> and sex = #{sex}</if>
|
||||
<if test="birthday != null "> and birthday = #{birthday}</if>
|
||||
<if test="city != null and city != ''"> and city = #{city}</if>
|
||||
<if test="province != null and province != ''"> and province = #{province}</if>
|
||||
<if test="country != null and country != ''"> and country = #{country}</if>
|
||||
<if test="headimgurl != null and headimgurl != ''"> and headimgurl = #{headimgurl}</if>
|
||||
<if test="idType != null and idType != ''"> and id_type = #{idType}</if>
|
||||
<if test="idNo != null and idNo != ''"> and id_no = #{idNo}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPMemberById" parameterType="Integer" resultMap="PMemberResult">
|
||||
<include refid="selectPMemberVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertPMember" parameterType="PMember" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into p_member
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="custId != null">cust_id,</if>
|
||||
<if test="custType != null">cust_type,</if>
|
||||
<if test="openId != null">open_id,</if>
|
||||
<if test="unionId != null">union_id,</if>
|
||||
<if test="custName != null">cust_name,</if>
|
||||
<if test="nickName != null">nick_name,</if>
|
||||
<if test="custPhoneA != null">cust_phone_a,</if>
|
||||
<if test="custPhoneB != null">cust_phone_b,</if>
|
||||
<if test="sex != null">sex,</if>
|
||||
<if test="birthday != null">birthday,</if>
|
||||
<if test="city != null">city,</if>
|
||||
<if test="province != null">province,</if>
|
||||
<if test="country != null">country,</if>
|
||||
<if test="headimgurl != null">headimgurl,</if>
|
||||
<if test="idType != null">id_type,</if>
|
||||
<if test="idNo != null">id_no,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="custId != null">#{custId},</if>
|
||||
<if test="custType != null">#{custType},</if>
|
||||
<if test="openId != null">#{openId},</if>
|
||||
<if test="unionId != null">#{unionId},</if>
|
||||
<if test="custName != null">#{custName},</if>
|
||||
<if test="nickName != null">#{nickName},</if>
|
||||
<if test="custPhoneA != null">#{custPhoneA},</if>
|
||||
<if test="custPhoneB != null">#{custPhoneB},</if>
|
||||
<if test="sex != null">#{sex},</if>
|
||||
<if test="birthday != null">#{birthday},</if>
|
||||
<if test="city != null">#{city},</if>
|
||||
<if test="province != null">#{province},</if>
|
||||
<if test="country != null">#{country},</if>
|
||||
<if test="headimgurl != null">#{headimgurl},</if>
|
||||
<if test="idType != null">#{idType},</if>
|
||||
<if test="idNo != null">#{idNo},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updatePMember" parameterType="PMember">
|
||||
update p_member
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="custId != null">cust_id = #{custId},</if>
|
||||
<if test="custType != null">cust_type = #{custType},</if>
|
||||
<if test="openId != null">open_id = #{openId},</if>
|
||||
<if test="unionId != null">union_id = #{unionId},</if>
|
||||
<if test="custName != null">cust_name = #{custName},</if>
|
||||
<if test="nickName != null">nick_name = #{nickName},</if>
|
||||
<if test="custPhoneA != null">cust_phone_a = #{custPhoneA},</if>
|
||||
<if test="custPhoneB != null">cust_phone_b = #{custPhoneB},</if>
|
||||
<if test="sex != null">sex = #{sex},</if>
|
||||
<if test="birthday != null">birthday = #{birthday},</if>
|
||||
<if test="city != null">city = #{city},</if>
|
||||
<if test="province != null">province = #{province},</if>
|
||||
<if test="country != null">country = #{country},</if>
|
||||
<if test="headimgurl != null">headimgurl = #{headimgurl},</if>
|
||||
<if test="idType != null">id_type = #{idType},</if>
|
||||
<if test="idNo != null">id_no = #{idNo},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deletePMemberById" parameterType="Integer">
|
||||
delete from p_member where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePMemberByIds" parameterType="String">
|
||||
delete from p_member where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -50,6 +50,23 @@ public class SysLoginController
|
||||
return ajax;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 微信小程序登录方法
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/weixiMiniLogin")
|
||||
public AjaxResult weixiMiniLogin()
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
// 微信小程序登入生成令牌
|
||||
String username = "weixi_mini_admin" ;
|
||||
String password = "qwerasdf123" ;
|
||||
String token = loginService.login(username, password, "", "");
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*
|
||||
|
@ -96,8 +96,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
|
||||
// 过滤请求
|
||||
.authorizeRequests()
|
||||
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
||||
.antMatchers("/login", "/register", "/captchaImage").anonymous()
|
||||
// 对于登录login 注册register 验证码captchaImage 微信小程序weixiMiniLogin 允许匿名访问
|
||||
.antMatchers("/login", "/register", "/captchaImage","/weixiMiniLogin").anonymous()
|
||||
.antMatchers(
|
||||
HttpMethod.GET,
|
||||
"/",
|
||||
|
53
ruoyi-ui/src/api/carpool/member.js
Normal file
53
ruoyi-ui/src/api/carpool/member.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询微信注册用户信息列表
|
||||
export function listMember(query) {
|
||||
return request({
|
||||
url: '/carpool/member/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询微信注册用户信息详细
|
||||
export function getMember(id) {
|
||||
return request({
|
||||
url: '/carpool/member/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增微信注册用户信息
|
||||
export function addMember(data) {
|
||||
return request({
|
||||
url: '/carpool/member',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改微信注册用户信息
|
||||
export function updateMember(data) {
|
||||
return request({
|
||||
url: '/carpool/member',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除微信注册用户信息
|
||||
export function delMember(id) {
|
||||
return request({
|
||||
url: '/carpool/member/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出微信注册用户信息
|
||||
export function exportMember(query) {
|
||||
return request({
|
||||
url: '/carpool/member/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
482
ruoyi-ui/src/views/carpool/member/index.vue
Normal file
482
ruoyi-ui/src/views/carpool/member/index.vue
Normal file
@ -0,0 +1,482 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="平台编号" prop="custId">
|
||||
<el-input
|
||||
v-model="queryParams.custId"
|
||||
placeholder="请输入平台编号"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户类型" prop="custType">
|
||||
<el-select v-model="queryParams.custType" placeholder="请选择用户类型" clearable size="small">
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="微信唯一标识" prop="openId">
|
||||
<el-input
|
||||
v-model="queryParams.openId"
|
||||
placeholder="请输入微信唯一标识"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="微信unionId" prop="unionId">
|
||||
<el-input
|
||||
v-model="queryParams.unionId"
|
||||
placeholder="请输入微信unionId"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="custName">
|
||||
<el-input
|
||||
v-model="queryParams.custName"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="微信昵称" prop="nickName">
|
||||
<el-input
|
||||
v-model="queryParams.nickName"
|
||||
placeholder="请输入微信昵称"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号1" prop="custPhoneA">
|
||||
<el-input
|
||||
v-model="queryParams.custPhoneA"
|
||||
placeholder="请输入手机号1"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号2" prop="custPhoneB">
|
||||
<el-input
|
||||
v-model="queryParams.custPhoneB"
|
||||
placeholder="请输入手机号2"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-select v-model="queryParams.sex" placeholder="请选择性别" clearable size="small">
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="生日" prop="birthday">
|
||||
<el-date-picker clearable size="small"
|
||||
v-model="queryParams.birthday"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择生日">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="所在城市" prop="city">
|
||||
<el-input
|
||||
v-model="queryParams.city"
|
||||
placeholder="请输入所在城市"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所在省份" prop="province">
|
||||
<el-input
|
||||
v-model="queryParams.province"
|
||||
placeholder="请输入所在省份"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所在国家" prop="country">
|
||||
<el-input
|
||||
v-model="queryParams.country"
|
||||
placeholder="请输入所在国家"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户头像" prop="headimgurl">
|
||||
<el-input
|
||||
v-model="queryParams.headimgurl"
|
||||
placeholder="请输入用户头像"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="证件类型" prop="idType">
|
||||
<el-select v-model="queryParams.idType" placeholder="请选择证件类型" clearable size="small">
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="证件号" prop="idNo">
|
||||
<el-input
|
||||
v-model="queryParams.idNo"
|
||||
placeholder="请输入证件号"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['carpool:member:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['carpool:member:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['carpool:member:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['carpool:member:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="memberList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="自增id" align="center" prop="id" />
|
||||
<el-table-column label="平台编号" align="center" prop="custId" />
|
||||
<el-table-column label="用户类型" align="center" prop="custType" />
|
||||
<el-table-column label="微信唯一标识" align="center" prop="openId" />
|
||||
<el-table-column label="微信unionId" align="center" prop="unionId" />
|
||||
<el-table-column label="姓名" align="center" prop="custName" />
|
||||
<el-table-column label="微信昵称" align="center" prop="nickName" />
|
||||
<el-table-column label="手机号1" align="center" prop="custPhoneA" />
|
||||
<el-table-column label="手机号2" align="center" prop="custPhoneB" />
|
||||
<el-table-column label="性别" align="center" prop="sex" />
|
||||
<el-table-column label="生日" align="center" prop="birthday" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.birthday, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="所在城市" align="center" prop="city" />
|
||||
<el-table-column label="所在省份" align="center" prop="province" />
|
||||
<el-table-column label="所在国家" align="center" prop="country" />
|
||||
<el-table-column label="用户头像" align="center" prop="headimgurl" />
|
||||
<el-table-column label="证件类型" align="center" prop="idType" />
|
||||
<el-table-column label="证件号" align="center" prop="idNo" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['carpool:member:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['carpool:member:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改微信注册用户信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="平台编号" prop="custId">
|
||||
<el-input v-model="form.custId" placeholder="请输入平台编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户类型" prop="custType">
|
||||
<el-select v-model="form.custType" placeholder="请选择用户类型">
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="微信唯一标识" prop="openId">
|
||||
<el-input v-model="form.openId" placeholder="请输入微信唯一标识" />
|
||||
</el-form-item>
|
||||
<el-form-item label="微信unionId" prop="unionId">
|
||||
<el-input v-model="form.unionId" placeholder="请输入微信unionId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="custName">
|
||||
<el-input v-model="form.custName" placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="微信昵称" prop="nickName">
|
||||
<el-input v-model="form.nickName" placeholder="请输入微信昵称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号1" prop="custPhoneA">
|
||||
<el-input v-model="form.custPhoneA" placeholder="请输入手机号1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号2" prop="custPhoneB">
|
||||
<el-input v-model="form.custPhoneB" placeholder="请输入手机号2" />
|
||||
</el-form-item>
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-select v-model="form.sex" placeholder="请选择性别">
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="生日" prop="birthday">
|
||||
<el-date-picker clearable size="small"
|
||||
v-model="form.birthday"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择生日">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="所在城市" prop="city">
|
||||
<el-input v-model="form.city" placeholder="请输入所在城市" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所在省份" prop="province">
|
||||
<el-input v-model="form.province" placeholder="请输入所在省份" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所在国家" prop="country">
|
||||
<el-input v-model="form.country" placeholder="请输入所在国家" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户头像" prop="headimgurl">
|
||||
<el-input v-model="form.headimgurl" placeholder="请输入用户头像" />
|
||||
</el-form-item>
|
||||
<el-form-item label="证件类型" prop="idType">
|
||||
<el-select v-model="form.idType" placeholder="请选择证件类型">
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="证件号" prop="idNo">
|
||||
<el-input v-model="form.idNo" placeholder="请输入证件号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listMember, getMember, delMember, addMember, updateMember } from "@/api/carpool/member";
|
||||
|
||||
export default {
|
||||
name: "Member",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 微信注册用户信息表格数据
|
||||
memberList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
custId: null,
|
||||
custType: null,
|
||||
openId: null,
|
||||
unionId: null,
|
||||
custName: null,
|
||||
nickName: null,
|
||||
custPhoneA: null,
|
||||
custPhoneB: null,
|
||||
sex: null,
|
||||
birthday: null,
|
||||
city: null,
|
||||
province: null,
|
||||
country: null,
|
||||
headimgurl: null,
|
||||
idType: null,
|
||||
idNo: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询微信注册用户信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listMember(this.queryParams).then(response => {
|
||||
this.memberList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
custId: null,
|
||||
custType: null,
|
||||
openId: null,
|
||||
unionId: null,
|
||||
custName: null,
|
||||
nickName: null,
|
||||
custPhoneA: null,
|
||||
custPhoneB: null,
|
||||
sex: null,
|
||||
birthday: null,
|
||||
city: null,
|
||||
province: null,
|
||||
country: null,
|
||||
headimgurl: null,
|
||||
idType: null,
|
||||
idNo: null,
|
||||
remark: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加微信注册用户信息";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getMember(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改微信注册用户信息";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateMember(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addMember(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除微信注册用户信息编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delMember(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('carpool/member/export', {
|
||||
...this.queryParams
|
||||
}, `member_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user