新增微信二维码代码
parent
fbefdd0d53
commit
4b5624dfa6
|
|
@ -4,6 +4,11 @@ import java.util.List;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.ruoyi.system.domain.WxBasketballTeam;
|
||||||
|
import com.ruoyi.system.domain.WxUser;
|
||||||
|
import com.ruoyi.system.domain.vo.UserWxAqrCodeVo;
|
||||||
|
import com.ruoyi.system.service.IWxBasketballTeamService;
|
||||||
|
import com.ruoyi.system.service.IWxUserService;
|
||||||
import org.apache.commons.lang.ObjectUtils;
|
import org.apache.commons.lang.ObjectUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
@ -29,16 +34,20 @@ public class UserWxAqrCodeController extends BaseController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private IUserWxAqrCodeService userWxAqrCodeService;
|
private IUserWxAqrCodeService userWxAqrCodeService;
|
||||||
|
@Autowired
|
||||||
|
private IWxUserService wxUserService;
|
||||||
|
@Autowired
|
||||||
|
private IWxBasketballTeamService wxBasketballTeamService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询微信用户小程序二维码列表
|
* 查询微信用户小程序二维码列表
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:code:list")
|
@RequiresPermissions("system:code:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(UserWxAqrCode userWxAqrCode)
|
public TableDataInfo list(UserWxAqrCodeVo userWxAqrCode)
|
||||||
{
|
{
|
||||||
startPage();
|
startPage();
|
||||||
List<UserWxAqrCode> list = userWxAqrCodeService.selectUserWxAqrCodeList(userWxAqrCode);
|
List<UserWxAqrCodeVo> list = userWxAqrCodeService.selectUserWxAqrCodeList(userWxAqrCode);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -48,10 +57,10 @@ public class UserWxAqrCodeController extends BaseController
|
||||||
@RequiresPermissions("system:code:export")
|
@RequiresPermissions("system:code:export")
|
||||||
@Log(title = "微信用户小程序二维码", businessType = BusinessType.EXPORT)
|
@Log(title = "微信用户小程序二维码", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, UserWxAqrCode userWxAqrCode)
|
public void export(HttpServletResponse response, UserWxAqrCodeVo userWxAqrCode)
|
||||||
{
|
{
|
||||||
List<UserWxAqrCode> list = userWxAqrCodeService.selectUserWxAqrCodeList(userWxAqrCode);
|
List<UserWxAqrCodeVo> list = userWxAqrCodeService.selectUserWxAqrCodeList(userWxAqrCode);
|
||||||
ExcelUtil<UserWxAqrCode> util = new ExcelUtil<UserWxAqrCode>(UserWxAqrCode.class);
|
ExcelUtil<UserWxAqrCodeVo> util = new ExcelUtil<UserWxAqrCodeVo>(UserWxAqrCodeVo.class);
|
||||||
util.exportExcel(response, list, "微信用户小程序二维码数据");
|
util.exportExcel(response, list, "微信用户小程序二维码数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -64,6 +73,21 @@ public class UserWxAqrCodeController extends BaseController
|
||||||
{
|
{
|
||||||
return AjaxResult.success(userWxAqrCodeService.selectUserWxAqrCodeById(id));
|
return AjaxResult.success(userWxAqrCodeService.selectUserWxAqrCodeById(id));
|
||||||
}
|
}
|
||||||
|
@RequiresPermissions("system:code:getUserAndTeams")
|
||||||
|
@GetMapping(value = "/getUserAndTeams")
|
||||||
|
public AjaxResult getUserAndTeam()
|
||||||
|
{
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
WxUser wxUser = new WxUser();
|
||||||
|
wxUser.setIsDeleted(0);
|
||||||
|
List<WxUser> users = wxUserService.selectWxUserList(wxUser);
|
||||||
|
WxBasketballTeam team = new WxBasketballTeam();
|
||||||
|
team.setIsDeleted("0");
|
||||||
|
List<WxBasketballTeam> teams = wxBasketballTeamService.selectWxBasketballTeamList(team);
|
||||||
|
ajax.put("users", users);
|
||||||
|
ajax.put("teams", teams);
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增微信用户小程序二维码
|
* 新增微信用户小程序二维码
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||||
* 微信用户小程序二维码对象 user_wx_aqr_code
|
* 微信用户小程序二维码对象 user_wx_aqr_code
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
* @date 2022-10-19
|
* @date 2022-10-20
|
||||||
*/
|
*/
|
||||||
public class UserWxAqrCode extends BaseEntity
|
public class UserWxAqrCode extends BaseEntity
|
||||||
{
|
{
|
||||||
|
|
@ -70,6 +70,14 @@ public class UserWxAqrCode extends BaseEntity
|
||||||
@Excel(name = "用途说明")
|
@Excel(name = "用途说明")
|
||||||
private String useDesc;
|
private String useDesc;
|
||||||
|
|
||||||
|
/** 球衣号 */
|
||||||
|
@Excel(name = "球衣号")
|
||||||
|
private String jerseyNo;
|
||||||
|
|
||||||
|
/** 球队ID */
|
||||||
|
@Excel(name = "球队ID")
|
||||||
|
private Long teamId;
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
|
@ -187,6 +195,24 @@ public class UserWxAqrCode extends BaseEntity
|
||||||
{
|
{
|
||||||
return useDesc;
|
return useDesc;
|
||||||
}
|
}
|
||||||
|
public void setJerseyNo(String jerseyNo)
|
||||||
|
{
|
||||||
|
this.jerseyNo = jerseyNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getJerseyNo()
|
||||||
|
{
|
||||||
|
return jerseyNo;
|
||||||
|
}
|
||||||
|
public void setTeamId(Long teamId)
|
||||||
|
{
|
||||||
|
this.teamId = teamId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTeamId()
|
||||||
|
{
|
||||||
|
return teamId;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|
@ -204,6 +230,8 @@ public class UserWxAqrCode extends BaseEntity
|
||||||
.append("page", getPage())
|
.append("page", getPage())
|
||||||
.append("width", getWidth())
|
.append("width", getWidth())
|
||||||
.append("useDesc", getUseDesc())
|
.append("useDesc", getUseDesc())
|
||||||
|
.append("jerseyNo", getJerseyNo())
|
||||||
|
.append("teamId", getTeamId())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -23,7 +23,7 @@ public class WxUser extends BaseEntity
|
||||||
|
|
||||||
/** 删除 */
|
/** 删除 */
|
||||||
@Excel(name = "删除")
|
@Excel(name = "删除")
|
||||||
private Long isDeleted;
|
private Integer isDeleted;
|
||||||
|
|
||||||
/** 创建时间 */
|
/** 创建时间 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
|
@ -121,12 +121,12 @@ public class WxUser extends BaseEntity
|
||||||
{
|
{
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
public void setIsDeleted(Long isDeleted)
|
public void setIsDeleted(Integer isDeleted)
|
||||||
{
|
{
|
||||||
this.isDeleted = isDeleted;
|
this.isDeleted = isDeleted;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getIsDeleted()
|
public Integer getIsDeleted()
|
||||||
{
|
{
|
||||||
return isDeleted;
|
return isDeleted;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.ruoyi.system.domain.vo;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.annotation.Excel;
|
||||||
|
import com.ruoyi.system.domain.UserWxAqrCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 吴一博
|
||||||
|
* @date 2022年10月20日 13:42
|
||||||
|
* @Description
|
||||||
|
*/
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
public class UserWxAqrCodeVo extends UserWxAqrCode {
|
||||||
|
@Excel(name = "用户")
|
||||||
|
private String userName;
|
||||||
|
@Excel(name = "球队")
|
||||||
|
private String teamName;
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ruoyi.system.domain.UserWxAqrCode;
|
import com.ruoyi.system.domain.UserWxAqrCode;
|
||||||
|
import com.ruoyi.system.domain.vo.UserWxAqrCodeVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信用户小程序二维码Mapper接口
|
* 微信用户小程序二维码Mapper接口
|
||||||
|
|
@ -25,7 +26,7 @@ public interface UserWxAqrCodeMapper
|
||||||
* @param userWxAqrCode 微信用户小程序二维码
|
* @param userWxAqrCode 微信用户小程序二维码
|
||||||
* @return 微信用户小程序二维码集合
|
* @return 微信用户小程序二维码集合
|
||||||
*/
|
*/
|
||||||
public List<UserWxAqrCode> selectUserWxAqrCodeList(UserWxAqrCode userWxAqrCode);
|
public List<UserWxAqrCodeVo> selectUserWxAqrCodeList(UserWxAqrCodeVo userWxAqrCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增微信用户小程序二维码
|
* 新增微信用户小程序二维码
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.system.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ruoyi.system.domain.UserWxAqrCode;
|
import com.ruoyi.system.domain.UserWxAqrCode;
|
||||||
|
import com.ruoyi.system.domain.vo.UserWxAqrCodeVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信用户小程序二维码Service接口
|
* 微信用户小程序二维码Service接口
|
||||||
|
|
@ -25,7 +26,7 @@ public interface IUserWxAqrCodeService
|
||||||
* @param userWxAqrCode 微信用户小程序二维码
|
* @param userWxAqrCode 微信用户小程序二维码
|
||||||
* @return 微信用户小程序二维码集合
|
* @return 微信用户小程序二维码集合
|
||||||
*/
|
*/
|
||||||
public List<UserWxAqrCode> selectUserWxAqrCodeList(UserWxAqrCode userWxAqrCode);
|
public List<UserWxAqrCodeVo> selectUserWxAqrCodeList(UserWxAqrCodeVo userWxAqrCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增微信用户小程序二维码
|
* 新增微信用户小程序二维码
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,12 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||||
import com.ruoyi.system.api.domain.vo.WxAppletsCodeVo;
|
import com.ruoyi.system.api.domain.vo.WxAppletsCodeVo;
|
||||||
import com.ruoyi.system.api.feign.WxAppletsFeign;
|
import com.ruoyi.system.api.feign.WxAppletsFeign;
|
||||||
|
import com.ruoyi.system.domain.vo.UserWxAqrCodeVo;
|
||||||
|
import org.apache.commons.lang.ObjectUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.system.mapper.UserWxAqrCodeMapper;
|
import com.ruoyi.system.mapper.UserWxAqrCodeMapper;
|
||||||
|
|
@ -48,7 +51,7 @@ public class UserWxAqrCodeServiceImpl implements IUserWxAqrCodeService
|
||||||
* @return 微信用户小程序二维码
|
* @return 微信用户小程序二维码
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<UserWxAqrCode> selectUserWxAqrCodeList(UserWxAqrCode userWxAqrCode)
|
public List<UserWxAqrCodeVo> selectUserWxAqrCodeList(UserWxAqrCodeVo userWxAqrCode)
|
||||||
{
|
{
|
||||||
return userWxAqrCodeMapper.selectUserWxAqrCodeList(userWxAqrCode);
|
return userWxAqrCodeMapper.selectUserWxAqrCodeList(userWxAqrCode);
|
||||||
}
|
}
|
||||||
|
|
@ -109,8 +112,28 @@ public class UserWxAqrCodeServiceImpl implements IUserWxAqrCodeService
|
||||||
int id = userWxAqrCodeMapper.insertUserWxAqrCode(userWxAqrCode);
|
int id = userWxAqrCodeMapper.insertUserWxAqrCode(userWxAqrCode);
|
||||||
System.out.println("id = "+userWxAqrCode.getId()+" accessToken = "+ accessToken);
|
System.out.println("id = "+userWxAqrCode.getId()+" accessToken = "+ accessToken);
|
||||||
WxAppletsCodeVo wxAppletsCodeVo = new WxAppletsCodeVo();
|
WxAppletsCodeVo wxAppletsCodeVo = new WxAppletsCodeVo();
|
||||||
wxAppletsCodeVo.setScene(String.valueOf(userWxAqrCode.getId()));
|
if(StringUtils.isEmpty(userWxAqrCode.getScene())) {
|
||||||
|
StringBuffer sceneBuffer = new StringBuffer();
|
||||||
|
sceneBuffer.append("id=");
|
||||||
|
sceneBuffer.append(userWxAqrCode.getId());
|
||||||
|
sceneBuffer.append("&tid=");
|
||||||
|
sceneBuffer.append(userWxAqrCode.getTeamId());
|
||||||
|
sceneBuffer.append("&uid=");
|
||||||
|
sceneBuffer.append(userWxAqrCode.getUserId());
|
||||||
|
wxAppletsCodeVo.setScene(sceneBuffer.toString());
|
||||||
|
}else {
|
||||||
|
wxAppletsCodeVo.setScene(userWxAqrCode.getScene());
|
||||||
|
}
|
||||||
|
if(StringUtils.isEmpty(userWxAqrCode.getScene())) {
|
||||||
|
wxAppletsCodeVo.setPage("pages/index2/index2");
|
||||||
|
}else {
|
||||||
wxAppletsCodeVo.setPage(userWxAqrCode.getPage());
|
wxAppletsCodeVo.setPage(userWxAqrCode.getPage());
|
||||||
|
}
|
||||||
|
if(userWxAqrCode.getWidth() == null) {
|
||||||
|
wxAppletsCodeVo.setWidth(50);
|
||||||
|
}else {
|
||||||
|
wxAppletsCodeVo.setWidth(userWxAqrCode.getWidth());
|
||||||
|
}
|
||||||
wxAppletsCodeVo = wxAppletsFeign.getWxacodeunlimit(wxAppletsCodeVo,accessToken);
|
wxAppletsCodeVo = wxAppletsFeign.getWxacodeunlimit(wxAppletsCodeVo,accessToken);
|
||||||
//更新二维码表
|
//更新二维码表
|
||||||
userWxAqrCode.setCodeImgUrl(wxAppletsCodeVo.getCodeImgUrl());
|
userWxAqrCode.setCodeImgUrl(wxAppletsCodeVo.getCodeImgUrl());
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
# Tomcat
|
# Tomcat
|
||||||
server:
|
server:
|
||||||
port: 9201
|
port: 9201
|
||||||
|
# Mybatis开启驼峰映射
|
||||||
|
mybatis:
|
||||||
|
configuration:
|
||||||
|
mapUnderscoreToCamelCase: true
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
|
|
|
||||||
|
|
@ -18,20 +18,19 @@
|
||||||
<result property="page" column="page" />
|
<result property="page" column="page" />
|
||||||
<result property="width" column="width" />
|
<result property="width" column="width" />
|
||||||
<result property="useDesc" column="use_desc" />
|
<result property="useDesc" column="use_desc" />
|
||||||
|
<result property="jerseyNo" column="jersey_no" />
|
||||||
|
<result property="teamId" column="team_id" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectUserWxAqrCodeVo">
|
<sql id="selectUserWxAqrCodeVo">
|
||||||
select ID, IS_DELETED, CREATED_TIME, CREATED_BY, MODIFIED_BY, LAST_UPDATED_TIME, scene, code_img_url, user_id, bus_type, page, width, use_desc from user_wx_aqr_code
|
select ID, IS_DELETED, CREATED_TIME, CREATED_BY, MODIFIED_BY, LAST_UPDATED_TIME, scene, code_img_url, user_id, bus_type, page, width, use_desc, jersey_no, team_id from user_wx_aqr_code
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectUserWxAqrCodeList" parameterType="UserWxAqrCode" resultMap="UserWxAqrCodeResult">
|
<select id="selectUserWxAqrCodeList1" parameterType="UserWxAqrCode" resultMap="UserWxAqrCodeResult">
|
||||||
<include refid="selectUserWxAqrCodeVo"/>
|
<include refid="selectUserWxAqrCodeVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="isDeleted != null "> and IS_DELETED = #{isDeleted}</if>
|
|
||||||
<if test="createdTime != null "> and CREATED_TIME = #{createdTime}</if>
|
|
||||||
<if test="createdBy != null and createdBy != ''"> and CREATED_BY like concat('%', #{createdBy}, '%')</if>
|
<if test="createdBy != null and createdBy != ''"> and CREATED_BY like concat('%', #{createdBy}, '%')</if>
|
||||||
<if test="modifiedBy != null and modifiedBy != ''"> and MODIFIED_BY = #{modifiedBy}</if>
|
<if test="modifiedBy != null and modifiedBy != ''"> and MODIFIED_BY = #{modifiedBy}</if>
|
||||||
<if test="lastUpdatedTime != null "> and LAST_UPDATED_TIME = #{lastUpdatedTime}</if>
|
|
||||||
<if test="scene != null and scene != ''"> and scene = #{scene}</if>
|
<if test="scene != null and scene != ''"> and scene = #{scene}</if>
|
||||||
<if test="codeImgUrl != null and codeImgUrl != ''"> and code_img_url = #{codeImgUrl}</if>
|
<if test="codeImgUrl != null and codeImgUrl != ''"> and code_img_url = #{codeImgUrl}</if>
|
||||||
<if test="userId != null "> and user_id = #{userId}</if>
|
<if test="userId != null "> and user_id = #{userId}</if>
|
||||||
|
|
@ -39,6 +38,8 @@
|
||||||
<if test="page != null and page != ''"> and page = #{page}</if>
|
<if test="page != null and page != ''"> and page = #{page}</if>
|
||||||
<if test="width != null "> and width = #{width}</if>
|
<if test="width != null "> and width = #{width}</if>
|
||||||
<if test="useDesc != null and useDesc != ''"> and use_desc = #{useDesc}</if>
|
<if test="useDesc != null and useDesc != ''"> and use_desc = #{useDesc}</if>
|
||||||
|
<if test="jerseyNo != null and jerseyNo != ''"> and jersey_no = #{jerseyNo}</if>
|
||||||
|
<if test="teamId != null "> and team_id = #{teamId}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -46,6 +47,26 @@
|
||||||
<include refid="selectUserWxAqrCodeVo"/>
|
<include refid="selectUserWxAqrCodeVo"/>
|
||||||
where ID = #{id}
|
where ID = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectUserWxAqrCodeList" resultType="com.ruoyi.system.domain.vo.UserWxAqrCodeVo">
|
||||||
|
select t.*,u.USER_NAME,team.TEAM_NAME
|
||||||
|
from user_wx_aqr_code t left join user_info u on u.id = t.user_id
|
||||||
|
LEFT JOIN basketball_team team on team.id = t.team_id
|
||||||
|
<where>
|
||||||
|
<if test="createdBy != null and createdBy != ''"> and t.CREATED_BY like concat('%', #{createdBy}, '%')</if>
|
||||||
|
<if test="modifiedBy != null and modifiedBy != ''"> and t.MODIFIED_BY = #{modifiedBy}</if>
|
||||||
|
<if test="scene != null and scene != ''"> and t.scene = #{scene}</if>
|
||||||
|
<if test="codeImgUrl != null and codeImgUrl != ''"> and t.code_img_url = #{codeImgUrl}</if>
|
||||||
|
<if test="userId != null "> and t.user_id = #{userId}</if>
|
||||||
|
<if test="busType != null and busType != ''"> and t.bus_type = #{busType}</if>
|
||||||
|
<if test="page != null and page != ''"> and t.page = #{page}</if>
|
||||||
|
<if test="width != null "> and t.width = #{width}</if>
|
||||||
|
<if test="useDesc != null and useDesc != ''"> and t.use_desc = #{useDesc}</if>
|
||||||
|
<if test="jerseyNo != null and jerseyNo != ''"> and t.jersey_no = #{jerseyNo}</if>
|
||||||
|
<if test="teamId != null "> and t.team_id = #{teamId}</if>
|
||||||
|
<if test="teamName != null and teamName != ''"> and team.TEAM_NAME like concat('%', #{teamName}, '%')</if>
|
||||||
|
<if test="userName != null and userName != ''"> and u.USER_NAME like concat('%', #{userName}, '%')</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertUserWxAqrCode" parameterType="UserWxAqrCode" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertUserWxAqrCode" parameterType="UserWxAqrCode" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into user_wx_aqr_code
|
insert into user_wx_aqr_code
|
||||||
|
|
@ -55,13 +76,15 @@
|
||||||
<if test="createdBy != null">CREATED_BY,</if>
|
<if test="createdBy != null">CREATED_BY,</if>
|
||||||
<if test="modifiedBy != null">MODIFIED_BY,</if>
|
<if test="modifiedBy != null">MODIFIED_BY,</if>
|
||||||
<if test="lastUpdatedTime != null">LAST_UPDATED_TIME,</if>
|
<if test="lastUpdatedTime != null">LAST_UPDATED_TIME,</if>
|
||||||
<if test="scene != null">scene,</if>
|
<if test="scene != null and scene != ''">scene,</if>
|
||||||
<if test="codeImgUrl != null">code_img_url,</if>
|
<if test="codeImgUrl != null">code_img_url,</if>
|
||||||
<if test="userId != null">user_id,</if>
|
<if test="userId != null">user_id,</if>
|
||||||
<if test="busType != null">bus_type,</if>
|
<if test="busType != null and busType != ''">bus_type,</if>
|
||||||
<if test="page != null">page,</if>
|
<if test="page != null and page != ''">page,</if>
|
||||||
<if test="width != null">width,</if>
|
<if test="width != null">width,</if>
|
||||||
<if test="useDesc != null">use_desc,</if>
|
<if test="useDesc != null and useDesc != ''">use_desc,</if>
|
||||||
|
<if test="jerseyNo != null">jersey_no,</if>
|
||||||
|
<if test="teamId != null">team_id,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="isDeleted != null">#{isDeleted},</if>
|
<if test="isDeleted != null">#{isDeleted},</if>
|
||||||
|
|
@ -69,13 +92,15 @@
|
||||||
<if test="createdBy != null">#{createdBy},</if>
|
<if test="createdBy != null">#{createdBy},</if>
|
||||||
<if test="modifiedBy != null">#{modifiedBy},</if>
|
<if test="modifiedBy != null">#{modifiedBy},</if>
|
||||||
<if test="lastUpdatedTime != null">#{lastUpdatedTime},</if>
|
<if test="lastUpdatedTime != null">#{lastUpdatedTime},</if>
|
||||||
<if test="scene != null">#{scene},</if>
|
<if test="scene != null and scene != ''">#{scene},</if>
|
||||||
<if test="codeImgUrl != null">#{codeImgUrl},</if>
|
<if test="codeImgUrl != null">#{codeImgUrl},</if>
|
||||||
<if test="userId != null">#{userId},</if>
|
<if test="userId != null">#{userId},</if>
|
||||||
<if test="busType != null">#{busType},</if>
|
<if test="busType != null and busType != ''">#{busType},</if>
|
||||||
<if test="page != null">#{page},</if>
|
<if test="page != null and page != ''">#{page},</if>
|
||||||
<if test="width != null">#{width},</if>
|
<if test="width != null">#{width},</if>
|
||||||
<if test="useDesc != null">#{useDesc},</if>
|
<if test="useDesc != null and useDesc != ''">#{useDesc},</if>
|
||||||
|
<if test="jerseyNo != null">#{jerseyNo},</if>
|
||||||
|
<if test="teamId != null">#{teamId},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
@ -87,13 +112,15 @@
|
||||||
<if test="createdBy != null">CREATED_BY = #{createdBy},</if>
|
<if test="createdBy != null">CREATED_BY = #{createdBy},</if>
|
||||||
<if test="modifiedBy != null">MODIFIED_BY = #{modifiedBy},</if>
|
<if test="modifiedBy != null">MODIFIED_BY = #{modifiedBy},</if>
|
||||||
<if test="lastUpdatedTime != null">LAST_UPDATED_TIME = #{lastUpdatedTime},</if>
|
<if test="lastUpdatedTime != null">LAST_UPDATED_TIME = #{lastUpdatedTime},</if>
|
||||||
<if test="scene != null">scene = #{scene},</if>
|
<if test="scene != null and scene != ''">scene = #{scene},</if>
|
||||||
<if test="codeImgUrl != null">code_img_url = #{codeImgUrl},</if>
|
<if test="codeImgUrl != null">code_img_url = #{codeImgUrl},</if>
|
||||||
<if test="userId != null">user_id = #{userId},</if>
|
<if test="userId != null">user_id = #{userId},</if>
|
||||||
<if test="busType != null">bus_type = #{busType},</if>
|
<if test="busType != null and busType != ''">bus_type = #{busType},</if>
|
||||||
<if test="page != null">page = #{page},</if>
|
<if test="page != null and page != ''">page = #{page},</if>
|
||||||
<if test="width != null">width = #{width},</if>
|
<if test="width != null">width = #{width},</if>
|
||||||
<if test="useDesc != null">use_desc = #{useDesc},</if>
|
<if test="useDesc != null and useDesc != ''">use_desc = #{useDesc},</if>
|
||||||
|
<if test="jerseyNo != null">jersey_no = #{jerseyNo},</if>
|
||||||
|
<if test="teamId != null">team_id = #{teamId},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where ID = #{id}
|
where ID = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,13 @@ export function getCode(id) {
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 查询微信用户和球队列表
|
||||||
|
export function getUserAndTeams(){
|
||||||
|
return request({
|
||||||
|
url: '/system/code/getUserAndTeams',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
// 新增微信用户小程序二维码
|
// 新增微信用户小程序二维码
|
||||||
export function addCode(data) {
|
export function addCode(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
||||||
|
|
@ -9,16 +9,32 @@
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="用户ID" prop="userId">
|
<el-form-item label="绑定用户" prop="userName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.userId"
|
v-model="queryParams.userName"
|
||||||
placeholder="请输入用户ID"
|
placeholder="请输入用户"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="业务分类枚举" prop="busType">
|
<el-form-item label="球衣号" prop="jerseyNo">
|
||||||
<el-select v-model="queryParams.busType" placeholder="请选择业务分类枚举" clearable>
|
<el-input
|
||||||
|
v-model="queryParams.jerseyNo"
|
||||||
|
placeholder="请输入球衣号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="绑定球队" prop="teamName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.teamName"
|
||||||
|
placeholder="请输入球队"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="业务分类" prop="busType">
|
||||||
|
<el-select v-model="queryParams.busType" placeholder="请选择业务分类" clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.wx_aqr_type"
|
v-for="dict in dict.type.wx_aqr_type"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
|
@ -99,16 +115,27 @@
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="codeList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="codeList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="主键ID" align="center" prop="id" />
|
<el-table-column label="ID" align="center" prop="id" />
|
||||||
<el-table-column label="用途说明" align="center" prop="useDesc" />
|
<el-table-column label="二维码" align="center" prop="contactTel" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-image
|
||||||
|
style="width: 200px; height: 100px"
|
||||||
|
:src="scope.row.codeImgUrl"
|
||||||
|
:preview-src-list="[scope.row.codeImgUrl]"
|
||||||
|
:fit="imgfit"></el-image>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="用途说明" align="center" prop="useDesc" show-overflow-tooltip="true" />
|
||||||
<el-table-column label="参数" align="center" prop="scene" />
|
<el-table-column label="参数" align="center" prop="scene" />
|
||||||
<el-table-column label="用户ID" align="center" prop="userId" />
|
<el-table-column label="绑定用户" align="center" prop="userName" />
|
||||||
<el-table-column label="业务分类枚举" align="center" prop="busType">
|
<el-table-column label="绑定球队" align="center" prop="teamName" />
|
||||||
|
<el-table-column label="球衣号" align="center" prop="jerseyNo" />
|
||||||
|
<el-table-column label="业务分类" align="center" prop="busType">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.wx_aqr_type" :value="scope.row.busType"/>
|
<dict-tag :options="dict.type.wx_aqr_type" :value="scope.row.busType"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="页面路径" align="center" prop="page" />
|
<el-table-column label="页面路径" align="center" prop="page" show-overflow-tooltip="true"/>
|
||||||
<el-table-column label="宽度" align="center" prop="width" />
|
<el-table-column label="宽度" align="center" prop="width" />
|
||||||
<el-table-column label="创建时间" align="center" prop="createdTime" width="180">
|
<el-table-column label="创建时间" align="center" prop="createdTime" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
@ -156,8 +183,8 @@
|
||||||
<el-form-item label="用户ID" prop="userId">
|
<el-form-item label="用户ID" prop="userId">
|
||||||
<el-input v-model="form.userId" placeholder="请输入用户ID" />
|
<el-input v-model="form.userId" placeholder="请输入用户ID" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="业务分类枚举" prop="busType">
|
<el-form-item label="业务分类" prop="busType">
|
||||||
<el-select v-model="form.busType" placeholder="请选择业务分类枚举">
|
<el-select v-model="form.busType" placeholder="请选择业务分类">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.wx_aqr_type"
|
v-for="dict in dict.type.wx_aqr_type"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
|
@ -205,10 +232,30 @@
|
||||||
<el-form-item label="参数" prop="scene">
|
<el-form-item label="参数" prop="scene">
|
||||||
<el-input v-model="form.scene" placeholder="请输入参数" />
|
<el-input v-model="form.scene" placeholder="请输入参数" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="用户ID" prop="userId">
|
<el-form-item label="用户">
|
||||||
<el-input v-model="form.userId" placeholder="请输入用户ID" />
|
<el-select v-model="form.userId" filterable placeholder="请选择用户">
|
||||||
|
<el-option
|
||||||
|
v-for="item in userOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.userName"
|
||||||
|
:value="item.id"
|
||||||
|
:disabled="item.enabled == 0"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="球队">
|
||||||
|
<el-select v-model="form.teamId" filterable placeholder="请选择球队">
|
||||||
|
<el-option
|
||||||
|
v-for="item in teamOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.teamName"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="球衣号" prop="jerseyNo">
|
||||||
|
<el-input v-model="form.jerseyNo" placeholder="请输入球衣号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="宽度" prop="width">
|
<el-form-item label="宽度" prop="width">
|
||||||
<el-input v-model="form.width" placeholder="请输入宽度" />
|
<el-input v-model="form.width" placeholder="请输入宽度" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -222,8 +269,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {listCode, getCode, delCode, addCode, updateCode, genAqrCode} from "@/api/system/code";
|
import {listCode, getCode, delCode, addCode, updateCode, genAqrCode, getUserAndTeams} from "@/api/system/code";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Code",
|
name: "Code",
|
||||||
dicts: ['wx_aqr_type'],
|
dicts: ['wx_aqr_type'],
|
||||||
|
|
@ -233,6 +279,7 @@ export default {
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
ids: [],
|
ids: [],
|
||||||
|
imgfit:"fill",
|
||||||
// 非单个禁用
|
// 非单个禁用
|
||||||
single: true,
|
single: true,
|
||||||
// 非多个禁用
|
// 非多个禁用
|
||||||
|
|
@ -243,6 +290,10 @@ export default {
|
||||||
total: 0,
|
total: 0,
|
||||||
// 微信用户小程序二维码表格数据
|
// 微信用户小程序二维码表格数据
|
||||||
codeList: [],
|
codeList: [],
|
||||||
|
// 用户选项
|
||||||
|
userOptions: [],
|
||||||
|
// 球队选项
|
||||||
|
teamOptions: [],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
|
|
@ -284,6 +335,7 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
//this.getuserAndteamsList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询微信用户小程序二维码列表 */
|
/** 查询微信用户小程序二维码列表 */
|
||||||
|
|
@ -295,6 +347,14 @@ export default {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
getuserAndteamsList() {
|
||||||
|
this.loading = true;
|
||||||
|
getUserAndTeams().then(response => {
|
||||||
|
this.userOptions = response.users;
|
||||||
|
this.teamOptions = response.teams;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
|
@ -351,6 +411,12 @@ export default {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.aqrOpen = true;
|
this.aqrOpen = true;
|
||||||
this.aqrTitle = "生成微信用户小程序二维码";
|
this.aqrTitle = "生成微信用户小程序二维码";
|
||||||
|
getUserAndTeams().then(response => {
|
||||||
|
this.userOptions = response.users;
|
||||||
|
this.teamOptions = response.teams;
|
||||||
|
this.aqrOpen = true;
|
||||||
|
this.aqrTitle = "生成微信用户小程序二维码";
|
||||||
|
});
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue