浏览代码

其他方式加入企业微信

Lgx 4 年之前
父节点
当前提交
13bf552180
共有 1 个文件被更改,包括 16 次插入0 次删除
  1. 16 0
      src/main/java/com/liangjiang11/wx/cp/controller/WxaAddContactController.java

+ 16 - 0
src/main/java/com/liangjiang11/wx/cp/controller/WxaAddContactController.java

@@ -134,6 +134,22 @@ public class WxaAddContactController {
                             }
                             this.logger.info("通过手机号查找的外部客户:",foll.getRemarkMobiles()[0]);
                         }else{
+                            ExternalUser externalUser=new ExternalUser();
+                            externalUser.setAvatar(exuser.getExternalContact().getAvatar());
+                            externalUser.setExternal_userid(exuser.getExternalContact().getExternalUserId());
+                            externalUser.setName(exuser.getExternalContact().getName());
+                            externalUser.setGender(String.valueOf(exuser.getExternalContact().getGender()));
+                            externalUser.setType(exuser.getExternalContact().getType());
+                            externalUser.setUserid(foll.getUserId());
+                            externalUser.setCreatetime(date);
+                            externalUser.setCompany_avatar(wxUser.getAvatar());
+                            externalUser.setCompany_gender(wxUser.getGender().getGenderName());
+                            externalUser.setCompany_mobiles(wxUser.getMobile());
+                            externalUser.setCompany_name(wxUser.getName());
+                            externalUser.setTermain_type("企业微信/其他加入方式");
+                            //企业微信未返回年龄,默认0
+                            externalUser.setUser_age(0);
+                            externalUserService.updateExternalUser(externalUser);
                             this.logger.info("不是通过手机号查找的外部客户:",exuser.getExternalContact().getName());
                         }
                     }