소스 검색

企微卡片,发送消息状态

wangyunpeng 3 일 전
부모
커밋
8f17cfbbbd
16개의 변경된 파일312개의 추가작업 그리고 30개의 파일을 삭제
  1. 31 0
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/wecom/MsgSendStatusEnum.java
  2. 10 0
      api-module/src/main/java/com/tzld/piaoquan/api/component/WeComThirdPartyApiClient.java
  3. 2 2
      api-module/src/main/java/com/tzld/piaoquan/api/dao/generator/MybatisGeneratorMain.java
  4. 2 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/wecom/thirdpart/ext/ThirdPartWeComMapperExt.java
  5. 10 6
      api-module/src/main/java/com/tzld/piaoquan/api/job/wecom/thirdpart/WeComSendMsgJob.java
  6. 8 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/wecom/thirdpart/ExternalBusinessCardResponse.java
  7. 11 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/wecom/thirdpart/ThirdPartWeComMsg.java
  8. 60 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/wecom/thirdpart/ThirdPartWeComMsgExample.java
  9. 11 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/wecom/thirdpart/ThirdPartWeComStaff.java
  10. 70 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/wecom/thirdpart/ThirdPartWeComStaffExample.java
  11. 1 1
      api-module/src/main/java/com/tzld/piaoquan/api/service/wecom/thirdparty/WeComThirdPartyService.java
  12. 39 5
      api-module/src/main/java/com/tzld/piaoquan/api/service/wecom/thirdparty/impl/WeComThirdPartyServiceImpl.java
  13. 23 5
      api-module/src/main/resources/mapper/wecom/thirdpart/ThirdPartWeComMsgMapper.xml
  14. 23 6
      api-module/src/main/resources/mapper/wecom/thirdpart/ThirdPartWeComStaffMapper.xml
  15. 6 0
      api-module/src/main/resources/mapper/wecom/thirdpart/ext/ThirdPartWeComMapperExt.xml
  16. 5 5
      api-module/src/main/resources/mybatis-api-wecomThirdpart-generator-config.xml

+ 31 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/wecom/MsgSendStatusEnum.java

@@ -0,0 +1,31 @@
+package com.tzld.piaoquan.api.common.enums.wecom;
+
+import lombok.Getter;
+
+@Getter
+public enum MsgSendStatusEnum {
+    FAIL(0, "失败"),
+    NORMAL(1, "正常"),
+
+    other(999, "其他");
+
+    private final int val;
+    private final String description;
+
+    MsgSendStatusEnum(int val, String description) {
+        this.val = val;
+        this.description = description;
+    }
+
+    public static MsgSendStatusEnum from(int val) {
+        for (MsgSendStatusEnum statusEnum : MsgSendStatusEnum.values()) {
+            if (statusEnum.getVal() == val) {
+                return statusEnum;
+            }
+        }
+
+        return other;
+    }
+
+
+}

+ 10 - 0
api-module/src/main/java/com/tzld/piaoquan/api/component/WeComThirdPartyApiClient.java

@@ -79,6 +79,16 @@ public class WeComThirdPartyApiClient {
         return postRequest("/wxwork/GetRunClientByUuid", request);
     }
 
+    /**
+     * 获取当前账号对外名片二维码
+     *
+     * @param request 请求体
+     * @return 响应结果
+     */
+    public String getExternalBusinessCard(UuidRequest request) {
+        return postRequest("/wxwork/ExternalBusinessCard", request);
+    }
+
     /**
      * 获取内部联系人列表
      *

+ 2 - 2
api-module/src/main/java/com/tzld/piaoquan/api/dao/generator/MybatisGeneratorMain.java

@@ -22,8 +22,8 @@ public class MybatisGeneratorMain {
 
         //File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-generator-config.xml").getFile());
 //        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-api-generator-config.xml").getFile());
-        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-api-contentPlatform-generator-config.xml").getFile());
-//        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-api-wecomThirdpart-generator-config.xml").getFile());
+//        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-api-contentPlatform-generator-config.xml").getFile());
+        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-api-wecomThirdpart-generator-config.xml").getFile());
         ConfigurationParser cp = new ConfigurationParser(warnings);
         Configuration config = cp.parseConfiguration(configFile);
         DefaultShellCallback callback = new DefaultShellCallback(true);

+ 2 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/wecom/thirdpart/ext/ThirdPartWeComMapperExt.java

@@ -24,4 +24,6 @@ public interface ThirdPartWeComMapperExt {
     void batchInsertThirdPartWeComRoom(@Param("records") List<ThirdPartWeComRoom> partition);
 
     void batchUpdateThirdPartWeComRoom(@Param("records") List<ThirdPartWeComRoom> partition);
+
+    void updateStaffQrImageByUuid(@Param("uuid") String uuid, @Param("qrImage") String qrImage);
 }

+ 10 - 6
api-module/src/main/java/com/tzld/piaoquan/api/job/wecom/thirdpart/WeComSendMsgJob.java

@@ -3,13 +3,12 @@ package com.tzld.piaoquan.api.job.wecom.thirdpart;
 import com.alibaba.fastjson.JSONObject;
 import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import com.tzld.piaoquan.api.common.enums.wecom.MsgSendStatusEnum;
 import com.tzld.piaoquan.api.component.VideoApiService;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt;
 import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ThirdPartWeComMsgMapper;
 import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ThirdPartWeComRoomMapper;
-import com.tzld.piaoquan.api.model.param.wecom.thirdpart.CdnUploadImgLinkRequest;
-import com.tzld.piaoquan.api.model.param.wecom.thirdpart.CdnUploadImgLinkResponse;
-import com.tzld.piaoquan.api.model.param.wecom.thirdpart.SendAppMsgRequest;
+import com.tzld.piaoquan.api.model.param.wecom.thirdpart.*;
 import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo;
 import com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComMsg;
 import com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComMsgExample;
@@ -104,9 +103,9 @@ public class WeComSendMsgJob {
                             // build发送体
                             SendAppMsgRequest request = buildSendAppMsgRequest(cgiReplyBucketData, staff, room);
                             // 发送消息
-                            weComThirdPartyService.sendAppMsg(request);
+                            CommonResponse<SendAppMsgResponse> response = weComThirdPartyService.sendAppMsg(staff, room, request);
                             // 存储消息
-                            saveWeComMsg(staff.getId(), cgiReplyBucketData.getMiniVideoId(), request);
+                            saveWeComMsg(staff.getId(), cgiReplyBucketData.getMiniVideoId(), request, response);
                         }
                     }
                 });
@@ -273,7 +272,7 @@ public class WeComSendMsgJob {
         return msgList.stream().map(ThirdPartWeComMsg::getVideoId).collect(Collectors.toList());
     }
 
-    private void saveWeComMsg(Long staffId, Long videoId, SendAppMsgRequest request) {
+    private void saveWeComMsg(Long staffId, Long videoId, SendAppMsgRequest request, CommonResponse<SendAppMsgResponse> response) {
         ThirdPartWeComMsg msg = new ThirdPartWeComMsg();
         msg.setStaffId(staffId);
         msg.setVideoId(videoId);
@@ -292,6 +291,11 @@ public class WeComSendMsgJob {
         msg.setMd5(request.getMd5());
         msg.setAeskey(request.getAeskey());
         msg.setFilesize(request.getFileSize());
+        if (response.getErrcode() == 0) {
+            msg.setStatus(MsgSendStatusEnum.NORMAL.getVal());
+        } else {
+            msg.setStatus(MsgSendStatusEnum.FAIL.getVal());
+        }
         msgMapper.insertSelective(msg);
     }
 

+ 8 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/param/wecom/thirdpart/ExternalBusinessCardResponse.java

@@ -0,0 +1,8 @@
+package com.tzld.piaoquan.api.model.param.wecom.thirdpart;
+
+import lombok.Data;
+
+@Data
+public class ExternalBusinessCardResponse {
+    private String qr_image;
+}

+ 11 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/wecom/thirdpart/ThirdPartWeComMsg.java

@@ -37,6 +37,8 @@ public class ThirdPartWeComMsg {
 
     private Boolean isroom;
 
+    private Integer status;
+
     private Date createTime;
 
     private String desc;
@@ -177,6 +179,14 @@ public class ThirdPartWeComMsg {
         this.isroom = isroom;
     }
 
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
     public Date getCreateTime() {
         return createTime;
     }
@@ -216,6 +226,7 @@ public class ThirdPartWeComMsg {
         sb.append(", aeskey=").append(aeskey);
         sb.append(", filesize=").append(filesize);
         sb.append(", isroom=").append(isroom);
+        sb.append(", status=").append(status);
         sb.append(", createTime=").append(createTime);
         sb.append(", desc=").append(desc);
         sb.append("]");

+ 60 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/wecom/thirdpart/ThirdPartWeComMsgExample.java

@@ -1246,6 +1246,66 @@ public class ThirdPartWeComMsgExample {
             return (Criteria) this;
         }
 
+        public Criteria andStatusIsNull() {
+            addCriterion("`status` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNotNull() {
+            addCriterion("`status` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusEqualTo(Integer value) {
+            addCriterion("`status` =", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotEqualTo(Integer value) {
+            addCriterion("`status` <>", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThan(Integer value) {
+            addCriterion("`status` >", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
+            addCriterion("`status` >=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThan(Integer value) {
+            addCriterion("`status` <", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThanOrEqualTo(Integer value) {
+            addCriterion("`status` <=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIn(List<Integer> values) {
+            addCriterion("`status` in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotIn(List<Integer> values) {
+            addCriterion("`status` not in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusBetween(Integer value1, Integer value2) {
+            addCriterion("`status` between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotBetween(Integer value1, Integer value2) {
+            addCriterion("`status` not between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
         public Criteria andCreateTimeIsNull() {
             addCriterion("create_time is null");
             return (Criteria) this;

+ 11 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/wecom/thirdpart/ThirdPartWeComStaff.java

@@ -17,6 +17,8 @@ public class ThirdPartWeComStaff {
 
     private String avatar;
 
+    private String qrImage;
+
     private Integer status;
 
     private Integer autoCreateRoom;
@@ -81,6 +83,14 @@ public class ThirdPartWeComStaff {
         this.avatar = avatar;
     }
 
+    public String getQrImage() {
+        return qrImage;
+    }
+
+    public void setQrImage(String qrImage) {
+        this.qrImage = qrImage;
+    }
+
     public Integer getStatus() {
         return status;
     }
@@ -126,6 +136,7 @@ public class ThirdPartWeComStaff {
         sb.append(", thirdStaffId=").append(thirdStaffId);
         sb.append(", thirdUuid=").append(thirdUuid);
         sb.append(", avatar=").append(avatar);
+        sb.append(", qrImage=").append(qrImage);
         sb.append(", status=").append(status);
         sb.append(", autoCreateRoom=").append(autoCreateRoom);
         sb.append(", createTime=").append(createTime);

+ 70 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/wecom/thirdpart/ThirdPartWeComStaffExample.java

@@ -576,6 +576,76 @@ public class ThirdPartWeComStaffExample {
             return (Criteria) this;
         }
 
+        public Criteria andQrImageIsNull() {
+            addCriterion("qr_image is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andQrImageIsNotNull() {
+            addCriterion("qr_image is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andQrImageEqualTo(String value) {
+            addCriterion("qr_image =", value, "qrImage");
+            return (Criteria) this;
+        }
+
+        public Criteria andQrImageNotEqualTo(String value) {
+            addCriterion("qr_image <>", value, "qrImage");
+            return (Criteria) this;
+        }
+
+        public Criteria andQrImageGreaterThan(String value) {
+            addCriterion("qr_image >", value, "qrImage");
+            return (Criteria) this;
+        }
+
+        public Criteria andQrImageGreaterThanOrEqualTo(String value) {
+            addCriterion("qr_image >=", value, "qrImage");
+            return (Criteria) this;
+        }
+
+        public Criteria andQrImageLessThan(String value) {
+            addCriterion("qr_image <", value, "qrImage");
+            return (Criteria) this;
+        }
+
+        public Criteria andQrImageLessThanOrEqualTo(String value) {
+            addCriterion("qr_image <=", value, "qrImage");
+            return (Criteria) this;
+        }
+
+        public Criteria andQrImageLike(String value) {
+            addCriterion("qr_image like", value, "qrImage");
+            return (Criteria) this;
+        }
+
+        public Criteria andQrImageNotLike(String value) {
+            addCriterion("qr_image not like", value, "qrImage");
+            return (Criteria) this;
+        }
+
+        public Criteria andQrImageIn(List<String> values) {
+            addCriterion("qr_image in", values, "qrImage");
+            return (Criteria) this;
+        }
+
+        public Criteria andQrImageNotIn(List<String> values) {
+            addCriterion("qr_image not in", values, "qrImage");
+            return (Criteria) this;
+        }
+
+        public Criteria andQrImageBetween(String value1, String value2) {
+            addCriterion("qr_image between", value1, value2, "qrImage");
+            return (Criteria) this;
+        }
+
+        public Criteria andQrImageNotBetween(String value1, String value2) {
+            addCriterion("qr_image not between", value1, value2, "qrImage");
+            return (Criteria) this;
+        }
+
         public Criteria andStatusIsNull() {
             addCriterion("`status` is null");
             return (Criteria) this;

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/service/wecom/thirdparty/WeComThirdPartyService.java

@@ -30,7 +30,7 @@ public interface WeComThirdPartyService {
 
     CdnUploadImgLinkResponse cdnUploadImgLink(CdnUploadImgLinkRequest request);
 
-    void sendAppMsg(SendAppMsgRequest request);
+    CommonResponse<SendAppMsgResponse> sendAppMsg(ThirdPartWeComStaff staff, ThirdPartWeComRoom room, SendAppMsgRequest request);
 
     List<ThirdPartWeComStaff> getActiveStaffList();
 

+ 39 - 5
api-module/src/main/java/com/tzld/piaoquan/api/service/wecom/thirdparty/impl/WeComThirdPartyServiceImpl.java

@@ -2,20 +2,25 @@ package com.tzld.piaoquan.api.service.wecom.thirdparty.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.TypeReference;
+import com.stuuudy.commons.external.filestorage.enums.EnumFileType;
+import com.stuuudy.commons.external.filestorage.enums.EnumPublicBuckets;
 import com.tzld.piaoquan.api.common.enums.ExceptionEnum;
 import com.tzld.piaoquan.api.common.exception.CommonException;
 import com.tzld.piaoquan.api.component.WeComThirdPartyApiClient;
 import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ThirdPartWeComCorpMapper;
 import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ThirdPartWeComRoomMapper;
 import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ThirdPartWeComStaffMapper;
+import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ext.ThirdPartWeComMapperExt;
 import com.tzld.piaoquan.api.model.param.wecom.thirdpart.*;
 import com.tzld.piaoquan.api.model.po.wecom.thirdpart.*;
 import com.tzld.piaoquan.api.service.wecom.thirdparty.WeComThirdPartyService;
+import com.tzld.piaoquan.api.util.AliOssFileTool;
 import com.tzld.piaoquan.growth.common.dao.mapper.CorpMapper;
 import com.tzld.piaoquan.growth.common.model.po.Corp;
 import com.tzld.piaoquan.growth.common.model.po.CorpExample;
 import com.tzld.piaoquan.growth.common.utils.DateUtil;
 import com.tzld.piaoquan.growth.common.utils.LarkRobotUtil;
+import com.tzld.piaoquan.growth.common.utils.RandomUtil;
 import com.tzld.piaoquan.growth.common.utils.RedisUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
@@ -23,10 +28,9 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.*;
 
 @Slf4j
 @Service
@@ -41,6 +45,8 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
     @Autowired
     private ThirdPartWeComCorpMapper thirdPartWeComCorpMapper;
     @Autowired
+    private ThirdPartWeComMapperExt weComMapperExt;
+    @Autowired
     private CorpMapper corpMapper;
 
     @Autowired
@@ -158,9 +164,30 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
             existStaff.setAvatar(userObject.getAvatar());
             existStaff.setThirdUuid(uuid);
             existStaff.setStatus(0);
+            existStaff.setUpdateTime(new Date());
             thirdPartWeComStaffMapper.updateByPrimaryKeySelective(existStaff);
         }
 
+        // 获取名片二维码
+        String response = apiClient.getExternalBusinessCard(new UuidRequest(uuid));
+        CommonResponse<ExternalBusinessCardResponse> cardCommonResponse =
+                JSONObject.parseObject(response, new TypeReference<CommonResponse<ExternalBusinessCardResponse>>() {});
+        // base64 to inputStream
+        ExternalBusinessCardResponse cardResponse = cardCommonResponse.getData();
+        if (Objects.isNull(cardResponse)) {
+            return;
+        }
+        String qrImageBase64 = cardResponse.getQr_image();
+        if (StringUtils.isBlank(qrImageBase64)) {
+            return;
+        }
+        byte[] bytes = Base64.getDecoder().decode(qrImageBase64);
+        InputStream inputStream = new ByteArrayInputStream(bytes);
+        String fileUri = "temp/" + System.currentTimeMillis() + "_" + RandomUtil.generate18String() + ".png";
+        String qrImage = AliOssFileTool.saveInPublicReturnHost(inputStream, EnumPublicBuckets.PUBBUCKET, fileUri, EnumFileType.PICTURE);
+        weComMapperExt.updateStaffQrImageByUuid(uuid, qrImage);
+
+        // 清除掉线检测
         String offLineKey = "wecom:thirdpart:offline:" + uuid;
         redisUtils.del(offLineKey);
     }
@@ -291,13 +318,20 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
     }
 
     @Override
-    public void sendAppMsg(SendAppMsgRequest request) {
+    public CommonResponse<SendAppMsgResponse> sendAppMsg(ThirdPartWeComStaff staff, ThirdPartWeComRoom room, SendAppMsgRequest request) {
         String response = apiClient.sendAppMsg(request);
         CommonResponse<SendAppMsgResponse> commonResponse =
                 JSONObject.parseObject(response, new TypeReference<CommonResponse<SendAppMsgResponse>>() {});
         if (commonResponse.getErrcode() != 0) {
+            LarkRobotUtil.sendWeComThirdPartMessage(
+                    "【发送应用消息失败通知】\n" +
+                            "账号名称:" + staff.getName() + "\n" +
+                            "群名:" + room.getName() + "\n" +
+                            "错误码:" + commonResponse.getErrcode() + "\n" +
+                            "错误信息:" + commonResponse.getErrmsg());
             log.error("WeComThirdPartyService send app msg failed, request: {}, response: {}", request, response);
         }
+        return commonResponse;
     }
 
     @Override

+ 23 - 5
api-module/src/main/resources/mapper/wecom/thirdpart/ThirdPartWeComMsgMapper.xml

@@ -19,6 +19,7 @@
     <result column="aeskey" jdbcType="VARCHAR" property="aeskey" />
     <result column="fileSize" jdbcType="INTEGER" property="filesize" />
     <result column="isRoom" jdbcType="BIT" property="isroom" />
+    <result column="status" jdbcType="INTEGER" property="status" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComMsg">
@@ -84,7 +85,8 @@
   </sql>
   <sql id="Base_Column_List">
     id, uuid, send_userid, staff_id, video_id, appName, title, weappIconUrl, pagepath, 
-    root_source_id, username, appid, cdnkey, md5, aeskey, fileSize, isRoom, create_time
+    root_source_id, username, appid, cdnkey, md5, aeskey, fileSize, isRoom, `status`, 
+    create_time
   </sql>
   <sql id="Blob_Column_List">
     `desc`
@@ -149,15 +151,15 @@
       title, weappIconUrl, pagepath, 
       root_source_id, username, appid, 
       cdnkey, md5, aeskey, 
-      fileSize, isRoom, create_time, 
-      `desc`)
+      fileSize, isRoom, `status`, 
+      create_time, `desc`)
     values (#{id,jdbcType=BIGINT}, #{uuid,jdbcType=VARCHAR}, #{sendUserid,jdbcType=BIGINT}, 
       #{staffId,jdbcType=BIGINT}, #{videoId,jdbcType=BIGINT}, #{appname,jdbcType=VARCHAR}, 
       #{title,jdbcType=VARCHAR}, #{weappiconurl,jdbcType=VARCHAR}, #{pagepath,jdbcType=VARCHAR}, 
       #{rootSourceId,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{appid,jdbcType=VARCHAR}, 
       #{cdnkey,jdbcType=VARCHAR}, #{md5,jdbcType=VARCHAR}, #{aeskey,jdbcType=VARCHAR}, 
-      #{filesize,jdbcType=INTEGER}, #{isroom,jdbcType=BIT}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{desc,jdbcType=LONGVARCHAR})
+      #{filesize,jdbcType=INTEGER}, #{isroom,jdbcType=BIT}, #{status,jdbcType=INTEGER}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{desc,jdbcType=LONGVARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComMsg">
     insert into third_part_we_com_msg
@@ -213,6 +215,9 @@
       <if test="isroom != null">
         isRoom,
       </if>
+      <if test="status != null">
+        `status`,
+      </if>
       <if test="createTime != null">
         create_time,
       </if>
@@ -272,6 +277,9 @@
       <if test="isroom != null">
         #{isroom,jdbcType=BIT},
       </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
       <if test="createTime != null">
         #{createTime,jdbcType=TIMESTAMP},
       </if>
@@ -340,6 +348,9 @@
       <if test="record.isroom != null">
         isRoom = #{record.isroom,jdbcType=BIT},
       </if>
+      <if test="record.status != null">
+        `status` = #{record.status,jdbcType=INTEGER},
+      </if>
       <if test="record.createTime != null">
         create_time = #{record.createTime,jdbcType=TIMESTAMP},
       </if>
@@ -370,6 +381,7 @@
       aeskey = #{record.aeskey,jdbcType=VARCHAR},
       fileSize = #{record.filesize,jdbcType=INTEGER},
       isRoom = #{record.isroom,jdbcType=BIT},
+      `status` = #{record.status,jdbcType=INTEGER},
       create_time = #{record.createTime,jdbcType=TIMESTAMP},
       `desc` = #{record.desc,jdbcType=LONGVARCHAR}
     <if test="_parameter != null">
@@ -395,6 +407,7 @@
       aeskey = #{record.aeskey,jdbcType=VARCHAR},
       fileSize = #{record.filesize,jdbcType=INTEGER},
       isRoom = #{record.isroom,jdbcType=BIT},
+      `status` = #{record.status,jdbcType=INTEGER},
       create_time = #{record.createTime,jdbcType=TIMESTAMP}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -451,6 +464,9 @@
       <if test="isroom != null">
         isRoom = #{isroom,jdbcType=BIT},
       </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=INTEGER},
+      </if>
       <if test="createTime != null">
         create_time = #{createTime,jdbcType=TIMESTAMP},
       </if>
@@ -478,6 +494,7 @@
       aeskey = #{aeskey,jdbcType=VARCHAR},
       fileSize = #{filesize,jdbcType=INTEGER},
       isRoom = #{isroom,jdbcType=BIT},
+      `status` = #{status,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       `desc` = #{desc,jdbcType=LONGVARCHAR}
     where id = #{id,jdbcType=BIGINT}
@@ -500,6 +517,7 @@
       aeskey = #{aeskey,jdbcType=VARCHAR},
       fileSize = #{filesize,jdbcType=INTEGER},
       isRoom = #{isroom,jdbcType=BIT},
+      `status` = #{status,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=BIGINT}
   </update>

+ 23 - 6
api-module/src/main/resources/mapper/wecom/thirdpart/ThirdPartWeComStaffMapper.xml

@@ -9,6 +9,7 @@
     <result column="third_staff_id" jdbcType="BIGINT" property="thirdStaffId" />
     <result column="third_uuid" jdbcType="VARCHAR" property="thirdUuid" />
     <result column="avatar" jdbcType="VARCHAR" property="avatar" />
+    <result column="qr_image" jdbcType="VARCHAR" property="qrImage" />
     <result column="status" jdbcType="INTEGER" property="status" />
     <result column="auto_create_room" jdbcType="INTEGER" property="autoCreateRoom" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
@@ -73,8 +74,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, corp_id, mobile, `name`, third_staff_id, third_uuid, avatar, `status`, auto_create_room, 
-    create_time, update_time
+    id, corp_id, mobile, `name`, third_staff_id, third_uuid, avatar, qr_image, `status`, 
+    auto_create_room, create_time, update_time
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComStaffExample" resultMap="BaseResultMap">
     select
@@ -112,12 +113,14 @@
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComStaff">
     insert into third_part_we_com_staff (id, corp_id, mobile, 
       `name`, third_staff_id, third_uuid, 
-      avatar, `status`, auto_create_room, 
-      create_time, update_time)
+      avatar, qr_image, `status`, 
+      auto_create_room, create_time, update_time
+      )
     values (#{id,jdbcType=BIGINT}, #{corpId,jdbcType=BIGINT}, #{mobile,jdbcType=VARCHAR}, 
       #{name,jdbcType=VARCHAR}, #{thirdStaffId,jdbcType=BIGINT}, #{thirdUuid,jdbcType=VARCHAR}, 
-      #{avatar,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{autoCreateRoom,jdbcType=INTEGER}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
+      #{avatar,jdbcType=VARCHAR}, #{qrImage,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
+      #{autoCreateRoom,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComStaff">
     insert into third_part_we_com_staff
@@ -143,6 +146,9 @@
       <if test="avatar != null">
         avatar,
       </if>
+      <if test="qrImage != null">
+        qr_image,
+      </if>
       <if test="status != null">
         `status`,
       </if>
@@ -178,6 +184,9 @@
       <if test="avatar != null">
         #{avatar,jdbcType=VARCHAR},
       </if>
+      <if test="qrImage != null">
+        #{qrImage,jdbcType=VARCHAR},
+      </if>
       <if test="status != null">
         #{status,jdbcType=INTEGER},
       </if>
@@ -222,6 +231,9 @@
       <if test="record.avatar != null">
         avatar = #{record.avatar,jdbcType=VARCHAR},
       </if>
+      <if test="record.qrImage != null">
+        qr_image = #{record.qrImage,jdbcType=VARCHAR},
+      </if>
       <if test="record.status != null">
         `status` = #{record.status,jdbcType=INTEGER},
       </if>
@@ -248,6 +260,7 @@
       third_staff_id = #{record.thirdStaffId,jdbcType=BIGINT},
       third_uuid = #{record.thirdUuid,jdbcType=VARCHAR},
       avatar = #{record.avatar,jdbcType=VARCHAR},
+      qr_image = #{record.qrImage,jdbcType=VARCHAR},
       `status` = #{record.status,jdbcType=INTEGER},
       auto_create_room = #{record.autoCreateRoom,jdbcType=INTEGER},
       create_time = #{record.createTime,jdbcType=TIMESTAMP},
@@ -277,6 +290,9 @@
       <if test="avatar != null">
         avatar = #{avatar,jdbcType=VARCHAR},
       </if>
+      <if test="qrImage != null">
+        qr_image = #{qrImage,jdbcType=VARCHAR},
+      </if>
       <if test="status != null">
         `status` = #{status,jdbcType=INTEGER},
       </if>
@@ -300,6 +316,7 @@
       third_staff_id = #{thirdStaffId,jdbcType=BIGINT},
       third_uuid = #{thirdUuid,jdbcType=VARCHAR},
       avatar = #{avatar,jdbcType=VARCHAR},
+      qr_image = #{qrImage,jdbcType=VARCHAR},
       `status` = #{status,jdbcType=INTEGER},
       auto_create_room = #{autoCreateRoom,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP},

+ 6 - 0
api-module/src/main/resources/mapper/wecom/thirdpart/ext/ThirdPartWeComMapperExt.xml

@@ -331,4 +331,10 @@
         </foreach>
     </update>
 
+    <update id="updateStaffQrImageByUuid">
+        update third_part_we_com_staff
+        set qr_image = #{qrImage}
+        where third_uuid = #{uuid}
+    </update>
+
 </mapper>

+ 5 - 5
api-module/src/main/resources/mybatis-api-wecomThirdpart-generator-config.xml

@@ -50,11 +50,11 @@
             <property name="enableSubPackages" value="true"/>
         </javaClientGenerator>
 
-        <table tableName="third_part_we_com_corp" domainObjectName="ThirdPartWeComCorp" alias=""/>
-        <table tableName="third_part_we_com_room" domainObjectName="ThirdPartWeComRoom" alias=""/>
-        <table tableName="third_part_we_com_room_user" domainObjectName="ThirdPartWeComRoomUser" alias=""/>
-        <table tableName="third_part_we_com_staff" domainObjectName="ThirdPartWeComStaff" alias=""/>
-        <table tableName="third_part_we_com_staff_user" domainObjectName="ThirdPartWeComStaffUser" alias=""/>
+<!--        <table tableName="third_part_we_com_corp" domainObjectName="ThirdPartWeComCorp" alias=""/>-->
+<!--        <table tableName="third_part_we_com_room" domainObjectName="ThirdPartWeComRoom" alias=""/>-->
+<!--        <table tableName="third_part_we_com_room_user" domainObjectName="ThirdPartWeComRoomUser" alias=""/>-->
+<!--        <table tableName="third_part_we_com_staff" domainObjectName="ThirdPartWeComStaff" alias=""/>-->
+<!--        <table tableName="third_part_we_com_staff_user" domainObjectName="ThirdPartWeComStaffUser" alias=""/>-->
         <table tableName="third_part_we_com_msg" domainObjectName="ThirdPartWeComMsg" alias=""/>
     </context>