From 2f53a85bf6e7555596f8b763f890275fb3a04f84 Mon Sep 17 00:00:00 2001
From: wuyibo <771227828@qq.com>
Date: Wed, 19 Oct 2022 16:55:55 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BE=AE=E4=BF=A1=E4=BA=8C?=
=?UTF-8?q?=E7=BB=B4=E7=A0=81=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 7 +-
ruoyi-api/ruoyi-api-system/pom.xml | 5 +-
.../system/api/domain/vo/WxAppletsCodeVo.java | 30 ++
.../system/api/feign/WxAppletsFeign.java | 31 ++
ruoyi-common/ruoyi-common-core/pom.xml | 5 +-
.../common/core/utils/file/FileUtils.java | 1 +
ruoyi-modules/ruoyi-system/pom.xml | 5 +-
.../controller/UserWxAqrCodeController.java | 107 +++++
.../ruoyi/system/domain/UserWxAqrCode.java | 208 +++++++++
.../system/mapper/UserWxAqrCodeMapper.java | 61 +++
.../system/service/IUserWxAqrCodeService.java | 63 +++
.../impl/UserWxAqrCodeServiceImpl.java | 124 ++++++
.../src/main/resources/logback.xml | 4 +-
.../mapper/system/UserWxAqrCodeMapper.xml | 111 +++++
ruoyi-ui/package.json | 1 +
ruoyi-ui/src/api/system/code.js | 51 +++
.../src/views/system/WxBuilding/index.vue | 115 ++---
.../src/views/system/basketBallTeam/index.vue | 21 +-
ruoyi-ui/src/views/system/code/index.vue | 410 ++++++++++++++++++
ruoyi-ui/src/views/system/wxUser/index.vue | 11 +-
ruoyi-ui/vue.config.js | 3 +-
21 files changed, 1280 insertions(+), 94 deletions(-)
create mode 100644 ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/vo/WxAppletsCodeVo.java
create mode 100644 ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feign/WxAppletsFeign.java
create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserWxAqrCodeController.java
create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserWxAqrCode.java
create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserWxAqrCodeMapper.java
create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserWxAqrCodeService.java
create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserWxAqrCodeServiceImpl.java
create mode 100644 ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/UserWxAqrCodeMapper.xml
create mode 100644 ruoyi-ui/src/api/system/code.js
create mode 100644 ruoyi-ui/src/views/system/code/index.vue
diff --git a/pom.xml b/pom.xml
index bfc0fd58..893dea1d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -239,7 +239,12 @@
${ruoyi.version}
-
+
+ org.projectlombok
+ lombok
+ 1.16.18
+ provided
+
diff --git a/ruoyi-api/ruoyi-api-system/pom.xml b/ruoyi-api/ruoyi-api-system/pom.xml
index 583b63a7..b070e54d 100644
--- a/ruoyi-api/ruoyi-api-system/pom.xml
+++ b/ruoyi-api/ruoyi-api-system/pom.xml
@@ -22,7 +22,10 @@
com.ruoyi
ruoyi-common-core
-
+
+ org.projectlombok
+ lombok
+
\ No newline at end of file
diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/vo/WxAppletsCodeVo.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/vo/WxAppletsCodeVo.java
new file mode 100644
index 00000000..e0695d09
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/vo/WxAppletsCodeVo.java
@@ -0,0 +1,30 @@
+package com.ruoyi.system.api.domain.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+@ApiModel(value="微信小程序生成二维码")
+@Setter
+@Getter
+public class WxAppletsCodeVo {
+ @ApiModelProperty(value="最大32个可见字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~,其它字符请自行编码为合法字符(因不支持%,中文无法使用 urlencode 处理,请使用其他编码方式)",required=false)
+ public String scene;
+ @ApiModelProperty(value="必须是已经发布的小程序存在的页面(否则报错),例如 pages/index/index, 根路径前不要填加 /,不能携带参数(参数请放在scene字段里),如果不填写这个字段,默认跳主页面",required=false)
+ public String page;
+ @ApiModelProperty(value="二维码的宽度,单位 px,最小 280px,最大 1280px",required=false)
+ public Integer width;
+ @ApiModelProperty(value="自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调,默认 false",required=false)
+ public Boolean autoColor;
+ @ApiModelProperty(value="auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {\"r\":\"xxx\",\"g\":\"xxx\",\"b\":\"xxx\"} 十进制表示",required=false)
+ public Object lineColor;
+ @ApiModelProperty(value="是否需要透明底色,为 true 时,生成透明底色的小程序",required=false)
+ public Boolean isHyaline;
+ @ApiModelProperty(value="返回的base64的图片字符串",required=false)
+ public String base64;
+ @ApiModelProperty(value="二维码存放url",required=false)
+ public String codeImgUrl;
+ @ApiModelProperty(value="返回的base64",required=false)
+ public byte[] bytesBase64;
+}
diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feign/WxAppletsFeign.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feign/WxAppletsFeign.java
new file mode 100644
index 00000000..35d4c869
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feign/WxAppletsFeign.java
@@ -0,0 +1,31 @@
+package com.ruoyi.system.api.feign;
+import com.ruoyi.system.api.domain.vo.WxAppletsCodeVo;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ *
+ * 系统名称:future篮球后台系统系统
+ * 模块名称:BASKETBALL-FEIGN
+ * 中文类名:微信小程序专用 FEIGN
+ * 概要说明:微信小程序专用 FEIGN
+ * @version:v1.0
+ * 版本 修改人 备注
+ * @author : wyb
+ * @date : 2019年10月19日
+ */
+@FeignClient(value = "basketball-service", path = "/wxApplets")
+public interface WxAppletsFeign {
+ /**
+ * 获取access_token
+ * appid和appsecret到小程序后台获取,当然也可以让小程序开发人员给你传过来
+ * */
+ @GetMapping("/getAccessToken")
+ String getAccessToken();
+
+ @PostMapping("/getWxacodeunlimit")
+ @ApiOperation("微信小程序-获取小程序码")
+ public WxAppletsCodeVo getWxacodeunlimit(@RequestBody WxAppletsCodeVo wxAppletsCodeVo, @RequestParam("accessToken") String accessToken);
+
+}
\ No newline at end of file
diff --git a/ruoyi-common/ruoyi-common-core/pom.xml b/ruoyi-common/ruoyi-common-core/pom.xml
index 7d62624a..f3fba33f 100644
--- a/ruoyi-common/ruoyi-common-core/pom.xml
+++ b/ruoyi-common/ruoyi-common-core/pom.xml
@@ -118,7 +118,10 @@
io.swagger
swagger-annotations
-
+
+ org.projectlombok
+ lombok
+
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/FileUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/FileUtils.java
index f76bb34b..3e45747d 100644
--- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/FileUtils.java
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/FileUtils.java
@@ -12,6 +12,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.ArrayUtils;
import com.ruoyi.common.core.utils.StringUtils;
+import sun.misc.BASE64Encoder;
/**
* 文件处理工具类
diff --git a/ruoyi-modules/ruoyi-system/pom.xml b/ruoyi-modules/ruoyi-system/pom.xml
index 545e833b..b29962c7 100644
--- a/ruoyi-modules/ruoyi-system/pom.xml
+++ b/ruoyi-modules/ruoyi-system/pom.xml
@@ -77,7 +77,10 @@
com.ruoyi
ruoyi-common-swagger
-
+
+ org.projectlombok
+ lombok
+
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserWxAqrCodeController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserWxAqrCodeController.java
new file mode 100644
index 00000000..30b25d10
--- /dev/null
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserWxAqrCodeController.java
@@ -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 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 list = userWxAqrCodeService.selectUserWxAqrCodeList(userWxAqrCode);
+ ExcelUtil util = new ExcelUtil(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));
+ }
+}
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserWxAqrCode.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserWxAqrCode.java
new file mode 100644
index 00000000..b1ebc826
--- /dev/null
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserWxAqrCode.java
@@ -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();
+ }
+}
\ No newline at end of file
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserWxAqrCodeMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserWxAqrCodeMapper.java
new file mode 100644
index 00000000..fcb94ac3
--- /dev/null
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserWxAqrCodeMapper.java
@@ -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 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);
+}
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserWxAqrCodeService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserWxAqrCodeService.java
new file mode 100644
index 00000000..458a4ad3
--- /dev/null
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserWxAqrCodeService.java
@@ -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 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);
+}
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserWxAqrCodeServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserWxAqrCodeServiceImpl.java
new file mode 100644
index 00000000..741512f1
--- /dev/null
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserWxAqrCodeServiceImpl.java
@@ -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 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;
+ }
+}
diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/logback.xml b/ruoyi-modules/ruoyi-system/src/main/resources/logback.xml
index 96bc0bbe..481fc047 100644
--- a/ruoyi-modules/ruoyi-system/src/main/resources/logback.xml
+++ b/ruoyi-modules/ruoyi-system/src/main/resources/logback.xml
@@ -58,11 +58,11 @@
-
+
-
+
diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/UserWxAqrCodeMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/UserWxAqrCodeMapper.xml
new file mode 100644
index 00000000..d5b1b332
--- /dev/null
+++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/UserWxAqrCodeMapper.xml
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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
+
+
+
+
+
+
+
+ insert into user_wx_aqr_code
+
+ IS_DELETED,
+ CREATED_TIME,
+ CREATED_BY,
+ MODIFIED_BY,
+ LAST_UPDATED_TIME,
+ scene,
+ base64,
+ code_img_url,
+ user_id,
+ bus_type,
+ page,
+ width,
+
+
+ #{isDeleted},
+ #{createdTime},
+ #{createdBy},
+ #{modifiedBy},
+ #{lastUpdatedTime},
+ #{scene},
+ #{base64},
+ #{codeImgUrl},
+ #{userId},
+ #{busType},
+ #{page},
+ #{width},
+
+
+
+
+ update user_wx_aqr_code
+
+ IS_DELETED = #{isDeleted},
+ CREATED_TIME = #{createdTime},
+ CREATED_BY = #{createdBy},
+ MODIFIED_BY = #{modifiedBy},
+ LAST_UPDATED_TIME = #{lastUpdatedTime},
+ scene = #{scene},
+ base64 = #{base64},
+ code_img_url = #{codeImgUrl},
+ user_id = #{userId},
+ bus_type = #{busType},
+ page = #{page},
+ width = #{width},
+
+ where ID = #{id}
+
+
+
+ delete from user_wx_aqr_code where ID = #{id}
+
+
+
+ delete from user_wx_aqr_code where ID in
+
+ #{id}
+
+
+
\ No newline at end of file
diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json
index 97bdbebf..f7440542 100644
--- a/ruoyi-ui/package.json
+++ b/ruoyi-ui/package.json
@@ -53,6 +53,7 @@
"screenfull": "5.0.2",
"sortablejs": "1.10.2",
"vue": "2.6.12",
+ "vue-qr": "^2.3.0",
"vue-count-to": "1.0.13",
"vue-cropper": "0.5.5",
"vue-meta": "2.4.0",
diff --git a/ruoyi-ui/src/api/system/code.js b/ruoyi-ui/src/api/system/code.js
new file mode 100644
index 00000000..a65e5468
--- /dev/null
+++ b/ruoyi-ui/src/api/system/code.js
@@ -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'
+ })
+}
diff --git a/ruoyi-ui/src/views/system/WxBuilding/index.vue b/ruoyi-ui/src/views/system/WxBuilding/index.vue
index a3d330de..657dc14b 100644
--- a/ruoyi-ui/src/views/system/WxBuilding/index.vue
+++ b/ruoyi-ui/src/views/system/WxBuilding/index.vue
@@ -9,22 +9,6 @@
@keyup.enter.native="handleQuery"
/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
+
搜索
重置
@@ -160,29 +98,46 @@
-
+
+
- {{ parseTime(scope.row.createdTime, '{y}-{m}-{d}') }}
+
-
-
-
-
-
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
-
+
+
+
+ {{ parseTime(scope.row.createdTime, '{y}-{m}-{d}') }}
+
+
+
-
-
-
-
+
- {{ parseTime(scope.row.createdTime, '{y}-{m}-{d}') }}
+
-
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.createdTime, '{y}-{m}-{d}') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 生成单个二维码
+
+
+ 生成多个二维码
+
+
+
+ 修改
+
+
+ 删除
+
+
+ 导出
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.createdTime, '{y}-{m}-{d}') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 修改
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ruoyi-ui/src/views/system/wxUser/index.vue b/ruoyi-ui/src/views/system/wxUser/index.vue
index 4f4decc4..8c9553e3 100644
--- a/ruoyi-ui/src/views/system/wxUser/index.vue
+++ b/ruoyi-ui/src/views/system/wxUser/index.vue
@@ -72,12 +72,11 @@
-
+
- {{ parseTime(scope.row.createdTime, '{y}-{m}-{d}') }}
+
-
@@ -104,6 +103,12 @@
>
+
+
+ {{ parseTime(scope.row.createdTime, '{y}-{m}-{d}') }}
+
+
+