Browse Source

不在授权范围内的自动改成停用

seyason 2 years ago
parent
commit
c61a812016

+ 17 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -2230,6 +2230,22 @@ public class WeiXinCorpController {
             //设置人员所属部门
             List<Department> allDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
             List<User> existingUsers = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
+            //检查是否有不在授权范围内的人员
+            List<User> removedUserList = existingUsers.stream().filter(ex -> !allCorpWxUserList.stream().anyMatch(corpwxUser -> corpwxUser.getCorpwxUserid().equals(ex.getCorpwxUserid()))).collect(Collectors.toList());
+            List<User> setInactiveList = new ArrayList<>();
+            removedUserList.forEach(re->{
+                if (re.getIsActive() == 1) {
+                    User u = new User();
+                    u.setId(re.getId());
+                    u.setIsActive(0);
+                    u.setInactiveDate(LocalDate.now());
+                    setInactiveList.add(u);
+                }
+            });
+            //批量设置为停用
+            if (setInactiveList.size() > 0) {
+                userService.updateBatchById(setInactiveList);
+            }
             List<User> newUserList = allCorpWxUserList.stream().filter(newItem -> !existingUsers.stream().anyMatch(existingItem -> newItem.getCorpwxUserid().equals(existingItem.getCorpwxUserid()))).collect(Collectors.toList());
             newUserList.forEach(newItem->{
                 if (newItem.getCorpwxDeptid() != 1) {
@@ -3643,7 +3659,7 @@ public class WeiXinCorpController {
         JSONObject docItem = new JSONObject();
         docItem.put("type", 1);
         docItem.put("title", "使用指南");
-        docItem.put("url", "https://doc.weixin.qq.com/doc/w3_AQAACQauAEA1Ucywi0bQGy7XLaYYE?scode=AMsA1AfkAAgde2tFhrAFIAdQbyAPU");
+        docItem.put("url", "https://www.ttkuaiban.com/download/%E5%B7%A5%E6%97%B6%E7%AE%A1%E5%AE%B6%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E%E4%B9%A6.pdf");
         array.add(docItem);
         JSONObject enterItem = new JSONObject();
         enterItem.put("type", 1);

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -636,6 +636,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                     .setPassword(MD5Util.getPassword("000000"))
                     .setCorpwxUserid(corpwxOpenId)
                     .setColor(ColorUtil.randomColor())
+                    .setIsActive(1) //默认为在职,因为直接返回了该对象,外层调用会去判断是否在职,所以此处要在代码层赋值,不能依赖于数据库的默认值
                     .setCompanyId(companyId);
             Integer employeeCnt = userMapper.selectCount(new QueryWrapper<User>().eq("company_id", companyId).eq("is_active",1));
             Company company = companyMapper.selectOne(new QueryWrapper<Company>().eq("id", companyId));

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue

@@ -53,7 +53,7 @@
                             </div>
                             <div>
                                 <div>
-                                    <el-link type="primary" :underline="false" href="https://doc.weixin.qq.com/doc/w3_AQAACQauAEA1Ucywi0bQGy7XLaYYE?scode=AMsA1AfkAAgBITHypgAQAACQauAEA">点击查看操作手册</el-link>
+                                    <el-link type="primary" :underline="false" href="https://www.ttkuaiban.com/download/%E5%B7%A5%E6%97%B6%E7%AE%A1%E5%AE%B6%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E%E4%B9%A6.pdf">点击查看操作手册</el-link>
                                 </div>
                             </div>
                         </el-dropdown-item>

+ 0 - 11
fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue

@@ -47,21 +47,10 @@
             }
         },
         mounted() {
-            // 手机上看控制台
-            // if(this.user.companyName == '比基尼小镇'){
-            //     let consoleScript = document.createElement("script");
-            //     consoleScript.src = "https://cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js";
-            //     consoleScript.onload = function () {
-            //         new VConsole()
-            //     }
-            //     document.head.appendChild(consoleScript);
-            // }
-
             //有错误信息,优先跳转到登录页面去
             if(window.location.href.indexOf('errorMsg') != '-1') {
                 this.$router.push("/login");
             }
-            
             var ua = navigator.userAgent.toLowerCase();
             if (ua.indexOf("wxwork") > 0) {
                 this.isCorpWX = true;

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/my/children/center.vue

@@ -14,7 +14,7 @@
         <main class="mt-10">
             <div class="bg-fff">
                 <van-cell title="账号" v-if="userInfo.userNameNeedTranslate != '1'" :title-style="'flex: 0.5;'" :value="userInfo.phone"></van-cell>
-                <van-cell title="工号" :title-style="'flex: 0.5;'" :value="userInfo.jobNumber"></van-cell>
+                <van-cell title="工号" v-if="userInfo.jobNumber" :title-style="'flex: 0.5;'" :value="userInfo.jobNumber"></van-cell>
                 <van-cell title="公司" :title-style="'flex: 0.5;'" :value="userInfo.companyName"></van-cell>
                 <!-- <van-cell title="修改密码" isLink to="/my/set"></van-cell> -->
             </div>