parent
d05e3ddf72
commit
2f53a85bf6
@ -0,0 +1,107 @@
|
|||||||
|
package com.ruoyi.system.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.io.IOException;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.ObjectUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.ruoyi.common.log.annotation.Log;
|
||||||
|
import com.ruoyi.common.log.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.ruoyi.system.domain.UserWxAqrCode;
|
||||||
|
import com.ruoyi.system.service.IUserWxAqrCodeService;
|
||||||
|
import com.ruoyi.common.core.web.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信用户小程序二维码Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2022-10-18
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/code")
|
||||||
|
public class UserWxAqrCodeController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IUserWxAqrCodeService userWxAqrCodeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询微信用户小程序二维码列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:code:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(UserWxAqrCode userWxAqrCode)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<UserWxAqrCode> list = userWxAqrCodeService.selectUserWxAqrCodeList(userWxAqrCode);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出微信用户小程序二维码列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:code:export")
|
||||||
|
@Log(title = "微信用户小程序二维码", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, UserWxAqrCode userWxAqrCode)
|
||||||
|
{
|
||||||
|
List<UserWxAqrCode> list = userWxAqrCodeService.selectUserWxAqrCodeList(userWxAqrCode);
|
||||||
|
ExcelUtil<UserWxAqrCode> util = new ExcelUtil<UserWxAqrCode>(UserWxAqrCode.class);
|
||||||
|
util.exportExcel(response, list, "微信用户小程序二维码数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取微信用户小程序二维码详细信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:code:query")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(userWxAqrCodeService.selectUserWxAqrCodeById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增微信用户小程序二维码
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:code:add")
|
||||||
|
@Log(title = "微信用户小程序二维码", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody UserWxAqrCode userWxAqrCode)
|
||||||
|
{
|
||||||
|
return toAjax(userWxAqrCodeService.insertUserWxAqrCode(userWxAqrCode));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改微信用户小程序二维码
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:code:edit")
|
||||||
|
@Log(title = "微信用户小程序二维码", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody UserWxAqrCode userWxAqrCode)
|
||||||
|
{
|
||||||
|
return toAjax(userWxAqrCodeService.updateUserWxAqrCode(userWxAqrCode));
|
||||||
|
}
|
||||||
|
@RequiresPermissions("system:code:genAqrCode")
|
||||||
|
@Log(title = "微信用户小程序二维码", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/genAqrCode")
|
||||||
|
public AjaxResult genAqrCode(@RequestParam(required = false) Integer genNumbers, @RequestBody UserWxAqrCode userWxAqrCode)
|
||||||
|
{
|
||||||
|
return toAjax(userWxAqrCodeService.genAqrCode(genNumbers,userWxAqrCode));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除微信用户小程序二维码
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:code:remove")
|
||||||
|
@Log(title = "微信用户小程序二维码", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(userWxAqrCodeService.deleteUserWxAqrCodeByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,208 @@
|
|||||||
|
package com.ruoyi.system.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.core.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信用户小程序二维码对象 user_wx_aqr_code
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2022-10-19
|
||||||
|
*/
|
||||||
|
public class UserWxAqrCode extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键ID */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 删除表示 */
|
||||||
|
@Excel(name = "删除表示")
|
||||||
|
private Long isDeleted;
|
||||||
|
|
||||||
|
/** 创建时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date createdTime;
|
||||||
|
|
||||||
|
/** 创建人 */
|
||||||
|
@Excel(name = "创建人")
|
||||||
|
private String createdBy;
|
||||||
|
|
||||||
|
/** 修改人 */
|
||||||
|
@Excel(name = "修改人")
|
||||||
|
private String modifiedBy;
|
||||||
|
|
||||||
|
/** 最新更新时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "最新更新时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date lastUpdatedTime;
|
||||||
|
|
||||||
|
/** 参数 */
|
||||||
|
@Excel(name = "参数")
|
||||||
|
private String scene;
|
||||||
|
|
||||||
|
/** 微信二维码的base64编码 */
|
||||||
|
@Excel(name = "微信二维码的base64编码")
|
||||||
|
private String base64;
|
||||||
|
|
||||||
|
/** 二维码地址 */
|
||||||
|
@Excel(name = "二维码地址")
|
||||||
|
private String codeImgUrl;
|
||||||
|
|
||||||
|
/** 用户ID */
|
||||||
|
@Excel(name = "用户ID")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/** 业务分类枚举 */
|
||||||
|
@Excel(name = "业务分类枚举")
|
||||||
|
private String busType;
|
||||||
|
|
||||||
|
/** 页面路径 */
|
||||||
|
@Excel(name = "页面路径")
|
||||||
|
private String page;
|
||||||
|
|
||||||
|
/** 宽度 */
|
||||||
|
@Excel(name = "宽度")
|
||||||
|
private Integer width;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setIsDeleted(Long isDeleted)
|
||||||
|
{
|
||||||
|
this.isDeleted = isDeleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getIsDeleted()
|
||||||
|
{
|
||||||
|
return isDeleted;
|
||||||
|
}
|
||||||
|
public void setCreatedTime(Date createdTime)
|
||||||
|
{
|
||||||
|
this.createdTime = createdTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCreatedTime()
|
||||||
|
{
|
||||||
|
return createdTime;
|
||||||
|
}
|
||||||
|
public void setCreatedBy(String createdBy)
|
||||||
|
{
|
||||||
|
this.createdBy = createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreatedBy()
|
||||||
|
{
|
||||||
|
return createdBy;
|
||||||
|
}
|
||||||
|
public void setModifiedBy(String modifiedBy)
|
||||||
|
{
|
||||||
|
this.modifiedBy = modifiedBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getModifiedBy()
|
||||||
|
{
|
||||||
|
return modifiedBy;
|
||||||
|
}
|
||||||
|
public void setLastUpdatedTime(Date lastUpdatedTime)
|
||||||
|
{
|
||||||
|
this.lastUpdatedTime = lastUpdatedTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getLastUpdatedTime()
|
||||||
|
{
|
||||||
|
return lastUpdatedTime;
|
||||||
|
}
|
||||||
|
public void setScene(String scene)
|
||||||
|
{
|
||||||
|
this.scene = scene;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getScene()
|
||||||
|
{
|
||||||
|
return scene;
|
||||||
|
}
|
||||||
|
public void setBase64(String base64)
|
||||||
|
{
|
||||||
|
this.base64 = base64;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBase64()
|
||||||
|
{
|
||||||
|
return base64;
|
||||||
|
}
|
||||||
|
public void setCodeImgUrl(String codeImgUrl)
|
||||||
|
{
|
||||||
|
this.codeImgUrl = codeImgUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodeImgUrl()
|
||||||
|
{
|
||||||
|
return codeImgUrl;
|
||||||
|
}
|
||||||
|
public void setUserId(Long userId)
|
||||||
|
{
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getUserId()
|
||||||
|
{
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
public void setBusType(String busType)
|
||||||
|
{
|
||||||
|
this.busType = busType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBusType()
|
||||||
|
{
|
||||||
|
return busType;
|
||||||
|
}
|
||||||
|
public void setPage(String page)
|
||||||
|
{
|
||||||
|
this.page = page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPage()
|
||||||
|
{
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
public void setWidth(Integer width)
|
||||||
|
{
|
||||||
|
this.width = width;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getWidth()
|
||||||
|
{
|
||||||
|
return width;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("isDeleted", getIsDeleted())
|
||||||
|
.append("createdTime", getCreatedTime())
|
||||||
|
.append("createdBy", getCreatedBy())
|
||||||
|
.append("modifiedBy", getModifiedBy())
|
||||||
|
.append("lastUpdatedTime", getLastUpdatedTime())
|
||||||
|
.append("scene", getScene())
|
||||||
|
.append("base64", getBase64())
|
||||||
|
.append("codeImgUrl", getCodeImgUrl())
|
||||||
|
.append("userId", getUserId())
|
||||||
|
.append("busType", getBusType())
|
||||||
|
.append("page", getPage())
|
||||||
|
.append("width", getWidth())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.system.domain.UserWxAqrCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信用户小程序二维码Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2022-10-18
|
||||||
|
*/
|
||||||
|
public interface UserWxAqrCodeMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询微信用户小程序二维码
|
||||||
|
*
|
||||||
|
* @param id 微信用户小程序二维码主键
|
||||||
|
* @return 微信用户小程序二维码
|
||||||
|
*/
|
||||||
|
public UserWxAqrCode selectUserWxAqrCodeById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询微信用户小程序二维码列表
|
||||||
|
*
|
||||||
|
* @param userWxAqrCode 微信用户小程序二维码
|
||||||
|
* @return 微信用户小程序二维码集合
|
||||||
|
*/
|
||||||
|
public List<UserWxAqrCode> selectUserWxAqrCodeList(UserWxAqrCode userWxAqrCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增微信用户小程序二维码
|
||||||
|
*
|
||||||
|
* @param userWxAqrCode 微信用户小程序二维码
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertUserWxAqrCode(UserWxAqrCode userWxAqrCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改微信用户小程序二维码
|
||||||
|
*
|
||||||
|
* @param userWxAqrCode 微信用户小程序二维码
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateUserWxAqrCode(UserWxAqrCode userWxAqrCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除微信用户小程序二维码
|
||||||
|
*
|
||||||
|
* @param id 微信用户小程序二维码主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteUserWxAqrCodeById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除微信用户小程序二维码
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteUserWxAqrCodeByIds(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.system.domain.UserWxAqrCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信用户小程序二维码Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2022-10-18
|
||||||
|
*/
|
||||||
|
public interface IUserWxAqrCodeService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询微信用户小程序二维码
|
||||||
|
*
|
||||||
|
* @param id 微信用户小程序二维码主键
|
||||||
|
* @return 微信用户小程序二维码
|
||||||
|
*/
|
||||||
|
public UserWxAqrCode selectUserWxAqrCodeById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询微信用户小程序二维码列表
|
||||||
|
*
|
||||||
|
* @param userWxAqrCode 微信用户小程序二维码
|
||||||
|
* @return 微信用户小程序二维码集合
|
||||||
|
*/
|
||||||
|
public List<UserWxAqrCode> selectUserWxAqrCodeList(UserWxAqrCode userWxAqrCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增微信用户小程序二维码
|
||||||
|
*
|
||||||
|
* @param userWxAqrCode 微信用户小程序二维码
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertUserWxAqrCode(UserWxAqrCode userWxAqrCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改微信用户小程序二维码
|
||||||
|
*
|
||||||
|
* @param userWxAqrCode 微信用户小程序二维码
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateUserWxAqrCode(UserWxAqrCode userWxAqrCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除微信用户小程序二维码
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的微信用户小程序二维码主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteUserWxAqrCodeByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除微信用户小程序二维码信息
|
||||||
|
*
|
||||||
|
* @param id 微信用户小程序二维码主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteUserWxAqrCodeById(Long id);
|
||||||
|
|
||||||
|
Boolean genAqrCode(Integer genNumbers, UserWxAqrCode userWxAqrCode);
|
||||||
|
}
|
@ -0,0 +1,124 @@
|
|||||||
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.system.api.domain.vo.WxAppletsCodeVo;
|
||||||
|
import com.ruoyi.system.api.feign.WxAppletsFeign;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.system.mapper.UserWxAqrCodeMapper;
|
||||||
|
import com.ruoyi.system.domain.UserWxAqrCode;
|
||||||
|
import com.ruoyi.system.service.IUserWxAqrCodeService;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信用户小程序二维码Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2022-10-18
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class UserWxAqrCodeServiceImpl implements IUserWxAqrCodeService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private UserWxAqrCodeMapper userWxAqrCodeMapper;
|
||||||
|
@Resource
|
||||||
|
private WxAppletsFeign wxAppletsFeign;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询微信用户小程序二维码
|
||||||
|
*
|
||||||
|
* @param id 微信用户小程序二维码主键
|
||||||
|
* @return 微信用户小程序二维码
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public UserWxAqrCode selectUserWxAqrCodeById(Long id)
|
||||||
|
{
|
||||||
|
return userWxAqrCodeMapper.selectUserWxAqrCodeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询微信用户小程序二维码列表
|
||||||
|
*
|
||||||
|
* @param userWxAqrCode 微信用户小程序二维码
|
||||||
|
* @return 微信用户小程序二维码
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<UserWxAqrCode> selectUserWxAqrCodeList(UserWxAqrCode userWxAqrCode)
|
||||||
|
{
|
||||||
|
return userWxAqrCodeMapper.selectUserWxAqrCodeList(userWxAqrCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增微信用户小程序二维码
|
||||||
|
*
|
||||||
|
* @param userWxAqrCode 微信用户小程序二维码
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertUserWxAqrCode(UserWxAqrCode userWxAqrCode)
|
||||||
|
{
|
||||||
|
return userWxAqrCodeMapper.insertUserWxAqrCode(userWxAqrCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改微信用户小程序二维码
|
||||||
|
*
|
||||||
|
* @param userWxAqrCode 微信用户小程序二维码
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateUserWxAqrCode(UserWxAqrCode userWxAqrCode)
|
||||||
|
{
|
||||||
|
return userWxAqrCodeMapper.updateUserWxAqrCode(userWxAqrCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除微信用户小程序二维码
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的微信用户小程序二维码主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteUserWxAqrCodeByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return userWxAqrCodeMapper.deleteUserWxAqrCodeByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除微信用户小程序二维码信息
|
||||||
|
*
|
||||||
|
* @param id 微信用户小程序二维码主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteUserWxAqrCodeById(Long id)
|
||||||
|
{
|
||||||
|
return userWxAqrCodeMapper.deleteUserWxAqrCodeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean genAqrCode(Integer genNumbers, UserWxAqrCode userWxAqrCode) {
|
||||||
|
String accessToken = wxAppletsFeign.getAccessToken();
|
||||||
|
userWxAqrCode.setCreatedBy(SecurityUtils.getUsername());
|
||||||
|
userWxAqrCode.setCreatedTime(new Date());
|
||||||
|
int id = userWxAqrCodeMapper.insertUserWxAqrCode(userWxAqrCode);
|
||||||
|
System.out.println("id = "+userWxAqrCode.getId()+" accessToken = "+ accessToken);
|
||||||
|
WxAppletsCodeVo wxAppletsCodeVo = new WxAppletsCodeVo();
|
||||||
|
wxAppletsCodeVo.setScene(String.valueOf(userWxAqrCode.getId()));
|
||||||
|
wxAppletsCodeVo.setPage("pages/index2/index2");
|
||||||
|
wxAppletsCodeVo = wxAppletsFeign.getWxacodeunlimit(wxAppletsCodeVo,accessToken);
|
||||||
|
//更新二维码表
|
||||||
|
userWxAqrCode.setCodeImgUrl(wxAppletsCodeVo.getCodeImgUrl());
|
||||||
|
userWxAqrCode.setBase64(wxAppletsCodeVo.getBase64());
|
||||||
|
userWxAqrCode.setPage(wxAppletsCodeVo.getPage());
|
||||||
|
userWxAqrCode.setScene(wxAppletsCodeVo.getScene());
|
||||||
|
userWxAqrCode.setWidth(wxAppletsCodeVo.getWidth());
|
||||||
|
userWxAqrCodeMapper.updateUserWxAqrCode(userWxAqrCode);
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,111 @@
|
|||||||
|
<?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.system.mapper.UserWxAqrCodeMapper">
|
||||||
|
|
||||||
|
<resultMap type="UserWxAqrCode" id="UserWxAqrCodeResult">
|
||||||
|
<result property="id" column="ID" />
|
||||||
|
<result property="isDeleted" column="IS_DELETED" />
|
||||||
|
<result property="createdTime" column="CREATED_TIME" />
|
||||||
|
<result property="createdBy" column="CREATED_BY" />
|
||||||
|
<result property="modifiedBy" column="MODIFIED_BY" />
|
||||||
|
<result property="lastUpdatedTime" column="LAST_UPDATED_TIME" />
|
||||||
|
<result property="scene" column="scene" />
|
||||||
|
<result property="base64" column="base64" />
|
||||||
|
<result property="codeImgUrl" column="code_img_url" />
|
||||||
|
<result property="userId" column="user_id" />
|
||||||
|
<result property="busType" column="bus_type" />
|
||||||
|
<result property="page" column="page" />
|
||||||
|
<result property="width" column="width" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectUserWxAqrCodeVo">
|
||||||
|
select ID, IS_DELETED, CREATED_TIME, CREATED_BY, MODIFIED_BY, LAST_UPDATED_TIME, scene, base64, code_img_url, user_id, bus_type, page, width from user_wx_aqr_code
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectUserWxAqrCodeList" parameterType="UserWxAqrCode" resultMap="UserWxAqrCodeResult">
|
||||||
|
<include refid="selectUserWxAqrCodeVo"/>
|
||||||
|
<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="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="base64 != null and base64 != ''"> and base64 = #{base64}</if>
|
||||||
|
<if test="codeImgUrl != null and codeImgUrl != ''"> and code_img_url = #{codeImgUrl}</if>
|
||||||
|
<if test="userId != null "> and user_id = #{userId}</if>
|
||||||
|
<if test="busType != null and busType != ''"> and bus_type = #{busType}</if>
|
||||||
|
<if test="page != null and page != ''"> and page = #{page}</if>
|
||||||
|
<if test="width != null "> and width = #{width}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectUserWxAqrCodeById" parameterType="Long" resultMap="UserWxAqrCodeResult">
|
||||||
|
<include refid="selectUserWxAqrCodeVo"/>
|
||||||
|
where ID = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertUserWxAqrCode" parameterType="UserWxAqrCode" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into user_wx_aqr_code
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="isDeleted != null">IS_DELETED,</if>
|
||||||
|
<if test="createdTime != null">CREATED_TIME,</if>
|
||||||
|
<if test="createdBy != null">CREATED_BY,</if>
|
||||||
|
<if test="modifiedBy != null">MODIFIED_BY,</if>
|
||||||
|
<if test="lastUpdatedTime != null">LAST_UPDATED_TIME,</if>
|
||||||
|
<if test="scene != null">scene,</if>
|
||||||
|
<if test="base64 != null">base64,</if>
|
||||||
|
<if test="codeImgUrl != null">code_img_url,</if>
|
||||||
|
<if test="userId != null">user_id,</if>
|
||||||
|
<if test="busType != null">bus_type,</if>
|
||||||
|
<if test="page != null">page,</if>
|
||||||
|
<if test="width != null">width,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="isDeleted != null">#{isDeleted},</if>
|
||||||
|
<if test="createdTime != null">#{createdTime},</if>
|
||||||
|
<if test="createdBy != null">#{createdBy},</if>
|
||||||
|
<if test="modifiedBy != null">#{modifiedBy},</if>
|
||||||
|
<if test="lastUpdatedTime != null">#{lastUpdatedTime},</if>
|
||||||
|
<if test="scene != null">#{scene},</if>
|
||||||
|
<if test="base64 != null">#{base64},</if>
|
||||||
|
<if test="codeImgUrl != null">#{codeImgUrl},</if>
|
||||||
|
<if test="userId != null">#{userId},</if>
|
||||||
|
<if test="busType != null">#{busType},</if>
|
||||||
|
<if test="page != null">#{page},</if>
|
||||||
|
<if test="width != null">#{width},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateUserWxAqrCode" parameterType="UserWxAqrCode">
|
||||||
|
update user_wx_aqr_code
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="isDeleted != null">IS_DELETED = #{isDeleted},</if>
|
||||||
|
<if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
|
||||||
|
<if test="createdBy != null">CREATED_BY = #{createdBy},</if>
|
||||||
|
<if test="modifiedBy != null">MODIFIED_BY = #{modifiedBy},</if>
|
||||||
|
<if test="lastUpdatedTime != null">LAST_UPDATED_TIME = #{lastUpdatedTime},</if>
|
||||||
|
<if test="scene != null">scene = #{scene},</if>
|
||||||
|
<if test="base64 != null">base64 = #{base64},</if>
|
||||||
|
<if test="codeImgUrl != null">code_img_url = #{codeImgUrl},</if>
|
||||||
|
<if test="userId != null">user_id = #{userId},</if>
|
||||||
|
<if test="busType != null">bus_type = #{busType},</if>
|
||||||
|
<if test="page != null">page = #{page},</if>
|
||||||
|
<if test="width != null">width = #{width},</if>
|
||||||
|
</trim>
|
||||||
|
where ID = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteUserWxAqrCodeById" parameterType="Long">
|
||||||
|
delete from user_wx_aqr_code where ID = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteUserWxAqrCodeByIds" parameterType="String">
|
||||||
|
delete from user_wx_aqr_code where ID in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -0,0 +1,51 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询微信用户小程序二维码列表
|
||||||
|
export function listCode(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/code/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询微信用户小程序二维码详细
|
||||||
|
export function getCode(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/code/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增微信用户小程序二维码
|
||||||
|
export function addCode(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/code',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改微信用户小程序二维码
|
||||||
|
export function updateCode(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/code',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 新增微信用户小程序二维码
|
||||||
|
export function genAqrCode(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/code/genAqrCode',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 删除微信用户小程序二维码
|
||||||
|
export function delCode(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/code/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,410 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="创建人" prop="createdBy">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.createdBy"
|
||||||
|
placeholder="请输入创建人"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="参数" prop="scene">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.scene"
|
||||||
|
placeholder="请输入参数"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户ID" prop="userId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.userId"
|
||||||
|
placeholder="请输入用户ID"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="业务分类枚举" prop="busType">
|
||||||
|
<el-select v-model="queryParams.busType" placeholder="请选择业务分类枚举" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.wx_aqr_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</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="genAqrCode"
|
||||||
|
v-hasPermi="['system:code:genAqrCode']">生成单个二维码</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="genAqrCode"
|
||||||
|
v-hasPermi="['system:code:genAqrCode']">生成多个二维码</el-button>
|
||||||
|
</el-col>
|
||||||
|
<!-- <el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['system:code: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="['system:code: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="['system:code: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="['system:code:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="codeList" @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="createdTime" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createdTime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建人" align="center" prop="createdBy" />
|
||||||
|
<el-table-column label="参数" align="center" prop="scene" />
|
||||||
|
<el-table-column label="二维码地址" align="center" prop="codeImgUrl" />
|
||||||
|
<el-table-column label="用户ID" align="center" prop="userId" />
|
||||||
|
<el-table-column label="业务分类枚举" align="center" prop="busType">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.wx_aqr_type" :value="scope.row.busType"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="页面路径" align="center" prop="page" />
|
||||||
|
<el-table-column label="宽度" align="center" prop="width" />
|
||||||
|
<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="['system:code:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['system:code: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="isDeleted">
|
||||||
|
<el-input v-model="form.isDeleted" placeholder="请输入删除表示" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" prop="createdTime">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.createdTime"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择创建时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建人" prop="createdBy">
|
||||||
|
<el-input v-model="form.createdBy" placeholder="请输入创建人" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="参数" prop="scene">
|
||||||
|
<el-input v-model="form.scene" placeholder="请输入参数" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="二维码地址" prop="codeImgUrl">
|
||||||
|
<el-input v-model="form.codeImgUrl" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户ID" prop="userId">
|
||||||
|
<el-input v-model="form.userId" placeholder="请输入用户ID" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="业务分类枚举" prop="busType">
|
||||||
|
<el-select v-model="form.busType" placeholder="请选择业务分类枚举">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.wx_aqr_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="页面路径" prop="page">
|
||||||
|
<el-input v-model="form.page" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="宽度" prop="width">
|
||||||
|
<el-input v-model="form.width" 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>
|
||||||
|
<!-- 生成微信用户小程序二维码对话框 -->
|
||||||
|
<el-dialog :title="aqrTitle" :visible.sync="aqrOpen" width="500px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="用户ID" prop="userId">
|
||||||
|
<el-input v-model="form.userId" placeholder="请输入用户ID" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="业务分类" prop="busType">
|
||||||
|
<el-select v-model="form.busType" placeholder="请选择业务分类枚举">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.wx_aqr_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitAqrForm">确 定</el-button>
|
||||||
|
<el-button @click="aqrCancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {listCode, getCode, delCode, addCode, updateCode, genAqrCode} from "@/api/system/code";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Code",
|
||||||
|
dicts: ['wx_aqr_type'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 微信用户小程序二维码表格数据
|
||||||
|
codeList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
|
||||||
|
// 生成二维码弹出层标题
|
||||||
|
aqrTitle: "",
|
||||||
|
// 生成二维码是否显示弹出层
|
||||||
|
aqrOpen: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
createdBy: null,
|
||||||
|
modifiedBy: null,
|
||||||
|
contentType: null,
|
||||||
|
buffer: null,
|
||||||
|
errcode: null,
|
||||||
|
errmsg: null,
|
||||||
|
userId: null,
|
||||||
|
busType: null,
|
||||||
|
busTypeDesc: null
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询微信用户小程序二维码列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listCode(this.queryParams).then(response => {
|
||||||
|
this.codeList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
isDeleted: null,
|
||||||
|
createdTime: null,
|
||||||
|
createdBy: null,
|
||||||
|
modifiedBy: null,
|
||||||
|
lastUpdatedTime: null,
|
||||||
|
contentType: null,
|
||||||
|
buffer: null,
|
||||||
|
errcode: null,
|
||||||
|
errmsg: null,
|
||||||
|
userId: null,
|
||||||
|
busType: null,
|
||||||
|
busTypeDesc: 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
|
||||||
|
getCode(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) {
|
||||||
|
updateCode(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addCode(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 生成微信用户小程序二维码按钮操作 */
|
||||||
|
genAqrCode(){
|
||||||
|
this.reset();
|
||||||
|
this.aqrOpen = true;
|
||||||
|
this.aqrTitle = "生成微信用户小程序二维码";
|
||||||
|
},
|
||||||
|
aqrCancel() {
|
||||||
|
this.aqrOpen = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitAqrForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
genAqrCode(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("生成成功");
|
||||||
|
this.aqrOpen = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除微信用户小程序二维码编号为"' + ids + '"的数据项?').then(function() {
|
||||||
|
return delCode(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('system/code/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `code_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in new issue