Browse Source

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

Min 1 year ago
parent
commit
02c4b97a0d

+ 6 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -2420,16 +2420,19 @@ public class WeiXinCorpController {
                         changeUser.setName(userItem.getName());
                     }
                     if (!userItem.getCorpwxDeptid().equals(oldUser.getCorpwxDeptid())) {
-                        changeUser.setId(oldUser.getId());
                         if (userItem.getCorpwxDeptid() != 1) {
+                            changeUser.setId(oldUser.getId());
                             changeUser.setDepartmentId(allDeptList.stream().filter(d->d.getCorpwxDeptid() != null && d.getCorpwxDeptid().equals(userItem.getCorpwxDeptid())).findFirst().get().getDepartmentId());
                             //设置层级部门
                             changeUser.setDepartmentCascade(convertDepartmentIdToCascade(changeUser.getDepartmentId(), allDeptList));
-                        } else {
+                            changeUser.setCorpwxDeptid(userItem.getCorpwxDeptid());
+                        } else if (oldUser.getCorpwxDeptid() == 1) {
+                            changeUser.setId(oldUser.getId());
+                            //从待分配变成有部门的时候才更新;避免原来有部门的被冲掉,变成无部门
                             changeUser.setDepartmentId(0);
                             changeUser.setDepartmentCascade("0");
+                            changeUser.setCorpwxDeptid(userItem.getCorpwxDeptid());
                         }
-                        changeUser.setCorpwxDeptid(userItem.getCorpwxDeptid());
                     }
                     if (oldUser.getCorpwxRealUserid() == null || !userItem.getCorpwxRealUserid().equals(oldUser.getCorpwxRealUserid())) {
                         changeUser.setId(oldUser.getId());

+ 12 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java

@@ -461,7 +461,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
             }
             System.out.println("参与搜素的人员列表"+userNameList + userNameList.size());
             HttpRespMsg respMsg=new HttpRespMsg();
+            boolean isCorpWxUser = false;
             if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1&&userNameList.size()>0){
+                isCorpWxUser = true;
                 respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
                 if(respMsg.code.equals("0")){
                     httpRespMsg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
@@ -514,8 +516,14 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                     String executorColorString="";
                     for (int i=0;i<executorNameList.size();i++) {
                         String executorName = executorNameList.get(i);
-                        Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(executorName)).findFirst();
-                        Optional<User> first = allUserList.stream().filter(u ->optional.isPresent()&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid())).findFirst();
+                        Optional<User> first = null;
+                        if (isCorpWxUser) {
+                            Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(executorName)).findFirst();
+                            first = allUserList.stream().filter(u->(optional.isPresent()&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
+                        } else {
+                            first = allUserList.stream().filter(u ->u.getName().equals(executorName)).findFirst();
+                        }
+
                         if (first.isPresent()) {
                             User find = first.get();
                             if(i==executorNameList.size()-1){
@@ -559,14 +567,14 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 if(levelCell!=null){
                     task.setTaskLevel(taskLevelMap.get(levelCell.getStringCellValue()));
                 }
-                if(startDateCell.getDateCellValue()!=null){
+                if(startDateCell != null && startDateCell.getDateCellValue()!=null){
                     Date dateCellValue = startDateCell.getDateCellValue();
                     System.out.println("日期=="+dateCellValue.toString());
                     String formatValue = new SimpleDateFormat("yyyy-MM-dd").format(dateCellValue);
                     LocalDate startDate = LocalDate.parse(formatValue, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
                     task.setStartDate(startDate);
                 }
-                if(endDateCell.getDateCellValue()!=null){
+                if(endDateCell != null && endDateCell.getDateCellValue()!=null){
                     Date dateCellValue = endDateCell.getDateCellValue();
                     System.out.println("日期=="+dateCellValue.toString());
                     String formatValue = new SimpleDateFormat("yyyy-MM-dd").format(dateCellValue);

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java

@@ -516,7 +516,8 @@ public class TimingTask {
                     leaveSheet.setLeaveType(leaveType);
                     leaveSheet.setProcinstId(String.valueOf(map.get("id")));
                     leaveSheet.setGmtFinished(String.valueOf(map.get("gmtFinished")));
-                    Optional<LeaveSheet> first = oldLeaveSheetList.stream().filter(ol -> ol.getStartDate().isEqual(leaveSheet.getStartDate())&&ol.getEndDate().isEqual(leaveSheet.getEndDate())&& ol.getOwnerId().equals(leaveSheet.getOwnerId())&&(ol.getProcinstId()!=null&& ol.getProcinstId().equals(leaveSheet.getProcinstId()))).findFirst();
+                    //看看是否已经存在:同一个人,同一段时间,同样的请假时长则视为同一条记录
+                    Optional<LeaveSheet> first = oldLeaveSheetList.stream().filter(ol -> ol.getStartDate().isEqual(leaveSheet.getStartDate())&&ol.getEndDate().isEqual(leaveSheet.getEndDate())&& ol.getOwnerId().equals(leaveSheet.getOwnerId())&&ol.getTimeHours().equals(leaveSheet.getTimeHours())).findFirst();
                     if(first.isPresent()){
                         leaveSheet.setId(first.get().getId());
                     }

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml

@@ -146,7 +146,7 @@ referer:
     - mldmobworktime.ttkuaiban.com
     - mldworktime.ttkuaiban.com
     - 47.101.180.183
-excludeUrls: /wxcorp/*,/wxcorp/*/*,/dingding/*,/feishu-info/*,/error,/testClient,/corpWXAuth,/corpWXScanningAuth,/corpInsideWXAuth,/wx-corp-info/*,/clean/*,/innerRoles/*,/project/getProjectListByToken,/project/getTimeCostByToken,/report/getReportListByToken,/report/getProcessErrorData,/project/synchronizationProject,/user/updateUserDeptHierarchy
+excludeUrls: /wxcorp/*,/wxcorp/*/*,/dingding/*,/feishu-info/*,/error,/testClient,/corpWXAuth,/corpWXScanningAuth,/corpInsideWXAuth,/wx-corp-info/*,/clean/*,/innerRoles/*,/project/getProjectListByToken,/project/getTimeCostByToken,/report/getReportListByToken,/report/getProcessErrorData,/project/synchronizationProject,/user/updateUserDeptHierarchy,/report/getUserTimeCostByThird,/report/getProjectTimeCostByThird
 
 #企业微信相关参数
 suitId: ww4e237fd6abb635af

+ 18 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/Login.vue

@@ -151,6 +151,9 @@
                         } else {
                             if(user.moduleList.length > 0) {
                                 this.$router.push({ path: user.moduleList[0].path })
+                            } else {
+                                //没有授权任何模块,需要提示用户
+                                alert('无权访问,请联系管理员为您分配权限');
                             }
                         }
                     } else if (href.indexOf('errorMsg=') > 0) {
@@ -183,6 +186,9 @@
                     } else {
                         if(user.moduleList.length > 0) {
                             this.$router.push({ path: user.moduleList[0].path })
+                        } else {
+                            //没有授权任何模块,需要提示用户
+                            alert('无权访问,请联系管理员为您分配权限');
                         }
                     }
                 } else {
@@ -368,6 +374,9 @@
                                         var newHref = location.href.split("?")[0] + '#' + (path.indexOf('/')>-1?path:('/'+path));
                                         location.href = newHref;
                                     }
+                                } else {
+                                    //没有授权任何模块,需要提示用户
+                                    alert('无权访问,请联系管理员为您分配权限');
                                 }
                             } else {
                                 this.$message({
@@ -394,6 +403,9 @@
                                     this.$router.push({ path: jumpurl })
                                 }else if(user.moduleList.length > 0) {
                                     this.$router.push({ path: user.moduleList[0].path })
+                                }else {
+                                    //没有授权任何模块,需要提示用户
+                                    alert('无权访问,请联系管理员为您分配权限');
                                 }
                             } else {
                                 this.$message({
@@ -498,6 +510,9 @@
                             if(user.moduleList.length > 0) {
                                 this.$router.push({ path: user.moduleList[0].path })
                                 sessionStorage.setItem('autoRoute',user.moduleList[0].path)
+                            } else {
+                                //没有授权任何模块,需要提示用户
+                                alert('无权访问,请联系管理员为您分配权限');
                             }
                         }
                     } else {
@@ -527,6 +542,9 @@
                         this.permissionsList(res.data)
                         if(user.moduleList.length > 0) {
                             this.$router.push({ path: user.moduleList[0].path })
+                        } else {
+                            //没有授权任何模块,需要提示用户
+                            alert('无权访问,请联系管理员为您分配权限');
                         }
                     } else {
                         this.$message({

+ 12 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -904,7 +904,18 @@
 
             <!-- 有效工时率表 -->
             <el-table  v-if="ins == 20" key="20" border :data="efficentList" highlight-current-row v-loading="listLoading" :height="+tableHeight - 1" style="width: 100%;" >
-                <el-table-column align="center" prop="department_name" label="所属部门" min-width="150"></el-table-column>
+                <el-table-column align="center" prop="department_name" label="所属部门" min-width="150">
+                  <template slot-scope="scope">
+                    <div>
+                      <span v-if="user.userNameNeedTranslate == '1'">
+                        <ww-open-data type='departmentName' :openid='scope.row.department_name'></ww-open-data>
+                      </span>
+                      <span v-if="user.userNameNeedTranslate != '1'">
+                        {{scope.row.department_name}}
+                      </span>
+                    </div>
+                  </template>
+                </el-table-column>
                 <el-table-column align="center" prop="working_time" label="实报工时(小时)" min-width="150"></el-table-column>
                 <el-table-column align="center" label="应工时(小时)" >
                     <el-table-column align="center" prop="count" label="在职人数" min-width="150"></el-table-column>

+ 36 - 14
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -364,15 +364,15 @@
                     v-model="participantsFilterText">
                     </el-input>
 
-                    <div v-if="user.userNameNeedTranslate == '1' && false">
-                        <el-input placeholder="请输入内容" v-model.trim="wxFilterText" class="input-with-select">
+                    <div v-if="user.userNameNeedTranslate == '1'">
+                        <el-input placeholder="请输输入关键字过滤" v-model.trim="participantsFilterText" class="input-with-select">
                             <el-button slot="append" icon="el-icon-search" @click="echartDepartment()"></el-button>
                         </el-input>
                     </div>
 
                     <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
                         ref="chooseMembTree2" @check-change="onTreeItemChange" :default-checked-keys="alreadyPartArray"
-                        highlight-current  :filter-node-method="filterNode">
+                        highlight-current  :filter-node-method="filterNode" v-loading="filterNodeFlag">
                         <span class="custom-tree-node" slot-scope="{ node, data }">
                             <span v-if="user.userNameNeedTranslate == '1'">
                                 <span v-if="node.data.children">
@@ -1494,13 +1494,22 @@
 
                 hideCompleted: false,
 
-                wxFilterText: ''
+                wxFilterText: '',
+
+                filterNodeFlag: false,
+                filterNodePersonnel: []
             };
             
         },
         watch: {
             participantsFilterText(val) {
-                this.$refs.chooseMembTree2.filter(val);
+                let { userNameNeedTranslate } = JSON.parse(sessionStorage.getItem("user"))
+                if(userNameNeedTranslate != 1) {
+                    this.$refs.chooseMembTree2.filter(val);
+                }
+                if(!val) {
+                    this.$refs.chooseMembTree2.filter(val);
+                }
             }
         },
         methods: {
@@ -1671,8 +1680,13 @@
             },
             // 筛选逻辑
             filterNode(value, data) {
+                let { userNameNeedTranslate } = this.user
                 if (!value) return true;
-                return data.label.indexOf(value) !== -1;
+                if(userNameNeedTranslate != '1') {
+                    return data.label.indexOf(value) !== -1;
+                } else {
+                    return this.filterNodePersonnel.some(item => item.includes(data.label))
+                }
             },
             // 选中改变
             onTreeItemChange() {
@@ -3714,25 +3728,33 @@
             // 企业微信搜索
             echartDepartment() {
                 console.log('我点击了搜索')
-                if(this.wxFilterText != '') {
-                    this.http.post("/department/listAllMemb", {
-                        keyword: this.wxFilterText,
-                        cursor: ''
+                if(this.participantsFilterText != '') {
+                    this.filterNodeFlag = true
+                    this.http.post("/user/getEmployeeList", {
+                        keyword: this.participantsFilterText,
+                        cursor: '',
+                        departmentId: -1,
+                        pageIndex: 1,
+                        pageSize: 1000
                     },
                     res => {
                         if (res.code == "ok") {
-                            var list = res.data.data;
-                            this.setUserToDept(list);
-                            this.deptMembData = list;
-                            this.$forceUpdate()
+                            // var list = res.data.data;
+                            // this.setUserToDept(list);
+                            // this.deptMembData = list;
+                            // this.$forceUpdate()
+                            this.filterNodePersonnel = res.data.records.map(item => item.name)
+                            this.$refs.chooseMembTree2.filter(this.participantsFilterText);
                         } else {
                             this.$message({
                                 message: res.msg,
                                 type: "error"
                             });
                         }
+                        this.filterNodeFlag = false
                     },
                     error => {
+                        this.filterNodeFlag = false
                         this.$message({
                             message: error,
                             type: "error"