Browse Source

企业微信同步显示修改

seyason 2 years ago
parent
commit
b6b7bddb4a

+ 4 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -1325,6 +1325,7 @@ public class WeiXinCorpController {
             int deptId = deptObjJSONArray.getJSONObject(i).getIntValue("id");
             int deptId = deptObjJSONArray.getJSONObject(i).getIntValue("id");
 
 
             JSONArray userList = getDeptUserSimple(curCorpAccessToken, deptId);
             JSONArray userList = getDeptUserSimple(curCorpAccessToken, deptId);
+            System.out.println("该部门下用户数量:"+userList.size());
             for (int m=0;m<userList.size(); m++) {
             for (int m=0;m<userList.size(); m++) {
                 JSONObject userJson = userList.getJSONObject(m);
                 JSONObject userJson = userList.getJSONObject(m);
                 String curUserid = userJson.getString("userid");
                 String curUserid = userJson.getString("userid");
@@ -1344,6 +1345,9 @@ public class WeiXinCorpController {
                 //检查用户是否已经存在
                 //检查用户是否已经存在
                 if (userMapper.selectCount(new QueryWrapper<User>().eq("corpwx_userid", curUserid).eq("company_id", companyId)) == 0) {
                 if (userMapper.selectCount(new QueryWrapper<User>().eq("corpwx_userid", curUserid).eq("company_id", companyId)) == 0) {
                     userMapper.insert(user);
                     userMapper.insert(user);
+                } else {
+                    User curUser = userMapper.selectOne(new QueryWrapper<User>().eq("corpwx_userid", curUserid).eq("company_id", companyId));
+                    System.out.println("找到用户:"+curUser.getName()+", 部门:"+departmentMapper.selectById(curUser.getDepartmentId()).getDepartmentName());
                 }
                 }
             }
             }
         }
         }

+ 13 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -574,7 +574,7 @@
             </p>
             </p>
         </el-dialog>
         </el-dialog>
         <el-dialog title="同步企业微信通讯录" v-if="showSyncCWDialog" :visible.sync="showSyncCWDialog" customClass="customWidth" width="500px">
         <el-dialog title="同步企业微信通讯录" v-if="showSyncCWDialog" :visible.sync="showSyncCWDialog" customClass="customWidth" width="500px">
-            <p>填写企业微信通讯录Secret 
+            <p>1. 填写企业微信通讯录Secret 
                 <el-popover placement="top" width="1200" trigger="hover">
                 <el-popover placement="top" width="1200" trigger="hover">
                     <div class="imgFlex">
                     <div class="imgFlex">
                         <div><img src="../../assets/image/Step1.jpg" style="width: 380px"/> <p><b>第一步:进入管理后台</b></p> </div>
                         <div><img src="../../assets/image/Step1.jpg" style="width: 380px"/> <p><b>第一步:进入管理后台</b></p> </div>
@@ -587,6 +587,15 @@
             <p>
             <p>
             <el-input v-model="contactSecret" style="width:380px;" :disabled="!editSecret"/><el-button @click="editSecret?saveContactSecret():editSecret=true;" >{{editSecret?'保存':'修改'}}</el-button>
             <el-input v-model="contactSecret" style="width:380px;" :disabled="!editSecret"/><el-button @click="editSecret?saveContactSecret():editSecret=true;" >{{editSecret?'保存':'修改'}}</el-button>
             </p>
             </p>
+            <p v-if="contactServer == null">
+            2. 联系客户配置同步服务器
+
+            </p>
+            <p v-if="contactServer == null" style="text-align:center;">
+            <img
+                style="width: 120px; height: 120px"
+                src="../../assets/image/code.jpg" />
+            </p>
             <p style="display: flex;justify-content: center;padding-bottom:1em;">
             <p style="display: flex;justify-content: center;padding-bottom:1em;">
                 <el-button type="primary" :underline="false" :loading="importingData" :disabled="!canSync" @click="startCorpWxImport">开始同步</el-button>
                 <el-button type="primary" :underline="false" :loading="importingData" :disabled="!canSync" @click="startCorpWxImport">开始同步</el-button>
             </p>
             </p>
@@ -661,6 +670,7 @@ export default {
       canSync: false,
       canSync: false,
       corpid: null,
       corpid: null,
       contactSecret: null,
       contactSecret: null,
+      contactServer: null,
       showSyncCWDialog: false,
       showSyncCWDialog: false,
       permissions: JSON.parse(sessionStorage.getItem("permissions")),
       permissions: JSON.parse(sessionStorage.getItem("permissions")),
       handleSelectionZzjgshow: false,
       handleSelectionZzjgshow: false,
@@ -979,7 +989,8 @@ export default {
         (res) => {
         (res) => {
           if (res.code == "ok") {
           if (res.code == "ok") {
             this.contactSecret = res.data.contactSecret;
             this.contactSecret = res.data.contactSecret;
-            if (this.contactSecret) {
+            this.contactServer = res.data.contactServer;
+            if (this.contactSecret && this.contactServer) {
               this.canSync = true;
               this.canSync = true;
             } else {
             } else {
               this.editSecret = true;
               this.editSecret = true;