Przeglądaj źródła

修改个人生平

Alex 4 lat temu
rodzic
commit
ce71f12cbc

+ 37 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java

@@ -1,10 +1,16 @@
 package com.ruoyi.web.controller.common;
 
+import javax.imageio.ImageIO;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.utils.QRCodeUtils;
+import com.ruoyi.common.utils.sign.Base64;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.util.FastByteArrayOutputStream;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -18,7 +24,9 @@ import com.ruoyi.common.utils.file.FileUtils;
 import com.ruoyi.framework.config.ServerConfig;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
 
+import java.awt.image.BufferedImage;
 import java.io.File;
+import java.io.IOException;
 
 /**
  * 通用请求处理
@@ -131,4 +139,33 @@ public class CommonController {
                 "attachment;fileName=" + FileUtils.setFileDownloadHeader(request, downloadName));
         FileUtils.writeBytes(downloadPath, response.getOutputStream());
     }
+
+    /**
+     * 根据url获取二维码
+     * @param response
+     * @param url
+     * @return
+     * @throws Exception
+     */
+    @GetMapping("/common/qrcode")
+    public AjaxResult getQrcode(HttpServletResponse response, String url) throws Exception {
+
+        if (StringUtils.isBlank(url)) {
+            return AjaxResult.error("url为空");
+        }
+        //二维码图片
+        BufferedImage image = QRCodeUtils.createImage(url,null,true);
+        // 转换流信息写出
+        FastByteArrayOutputStream os = new FastByteArrayOutputStream();
+        try {
+            ImageIO.write(image, "jpg", os);
+        }
+        catch (IOException e) {
+            return AjaxResult.error(e.getMessage());
+        }
+
+        AjaxResult ajax = AjaxResult.success();
+        ajax.put("img", Base64.encode(os.toByteArray()));
+        return ajax;
+    }
 }

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/app/service/impl/TbFamilyMemberServiceImpl.java

@@ -234,7 +234,7 @@ public class TbFamilyMemberServiceImpl extends ServiceImpl<TbFamilyMemberMapper,
             return new ArrayList<>();
         }
         lqw.eq(AppMemberVo::getFamilyId, memberVo.getFamilyId());
-        lqw.eq(AppMemberVo::getState, "2"); // 已通过
+        lqw.eq(AppMemberVo::getStatus, "2"); // 已通过
         lqw.isNull(AppMemberVo::getParentId);
         if (StringUtils.isNotBlank(memberVo.getSearchValue())) {
             lqw.and(

+ 9 - 1
ruoyi-system/src/main/java/com/ruoyi/system/domain/TPersonalPage.java

@@ -37,9 +37,13 @@ public class TPersonalPage implements Serializable {
     private Long id;
 
     /** 客户id(会员id) */
-    @Excel(name = "客户id" , readConverterExp = "会=员id")
+    @Excel(name = "客户id" , readConverterExp = "会员id")
     private Long customerId;
 
+    /** 干系人id(会员id) */
+    @Excel(name = "干系人id" , readConverterExp = "会员id")
+    private Long stakeholderId;
+
     /** 客户姓名 */
     @Excel(name = "客户姓名")
     private String customer;
@@ -53,6 +57,10 @@ public class TPersonalPage implements Serializable {
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date stakeholderBirthday;
 
+    /** 个人生平页url */
+    @Excel(name = "个人生平页url")
+    private String qrcodeUrl;
+
     /** 离世时间 */
     @Excel(name = "离世时间" , width = 30, dateFormat = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd")

+ 2 - 0
ruoyi-system/src/main/resources/mapper/system/TPersonalPageMapper.xml

@@ -8,8 +8,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="customerId"    column="customer_id"    />
         <result property="customer"    column="customer"    />
+        <result property="stakeholderId"    column="stakeholder_id"    />
         <result property="stakeholder"    column="stakeholder"    />
         <result property="stakeholderBirthday"    column="stakeholder_birthday"    />
+        <result property="qrcodeUrl"    column="qrcode_url"    />
         <result property="deathsDate"    column="deaths_date"    />
         <result property="avatar"    column="avatar"    />
         <result property="templateId"    column="template_id"    />