Quellcode durchsuchen

Merge remote-tracking branch 'origin/master'

yurk vor 2 Jahren
Ursprung
Commit
4bb4067873

+ 12 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java

@@ -342,12 +342,18 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                         User localUser = new User();
                         localUser.setId(finance.getUserId());
                         localUser.setMonthCost(total);
-                        for (int i=0;i<userTimeList.size(); i++) {
-                            Map<String, Object> map = userTimeList.get(i);
-                            if (map.get("creatorId").equals(finance.getUserId())) {
-                                double time = (Double)map.get("workingTime");
-                                localUser.setCost(total.divide(new BigDecimal(time), 6, BigDecimal.ROUND_HALF_UP));
-                                break;
+                        if (companyId == 936) {
+                            //威派格导入薪资时,按照每月设置的工作天数来计算时薪
+                            BigDecimal db = timeType.getMonthDays().multiply(new BigDecimal(timeType.getAllday()));
+                            localUser.setCost(total.divide(db, 6, BigDecimal.ROUND_HALF_UP));
+                        } else {
+                            for (int i=0;i<userTimeList.size(); i++) {
+                                Map<String, Object> map = userTimeList.get(i);
+                                if (map.get("creatorId").equals(finance.getUserId())) {
+                                    double time = (Double)map.get("workingTime");
+                                    localUser.setCost(total.divide(new BigDecimal(time), 6, BigDecimal.ROUND_HALF_UP));
+                                    break;
+                                }
                             }
                         }
 

+ 30 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -4225,6 +4225,30 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         return msg;
     }
 
+    //递归获取所有上级部门字符串,格式:"上级部门/上级部门/部门"
+    private String getSupDepartment(Department department) {
+        String depHierarchy = department.getDepartmentName();
+        //搜到父部门进行添加
+        if (department.getSuperiorId()!=null) {
+            Department supDep = departmentMapper.selectById(department.getSuperiorId());
+            depHierarchy = supDep.getDepartmentName() +  "/" + depHierarchy;
+            getSupDepartment(supDep);
+        }
+        return depHierarchy;
+    }
+
+    //递归获取企业微信所有上级部门字符串,格式:"上级部门/上级部门/部门"
+    private String getWxDepartment(Department department) {
+        String depHierarchy = "$departmentName="+department.getCorpwxDeptid()+"$";
+        //搜到父部门进行添加
+        if (department.getCorpwxDeptpid()!=null) {
+            Department supDep = departmentMapper.selectById(department.getCorpwxDeptpid());
+            depHierarchy = "$departmentName="+supDep.getCorpwxDeptid()+"$" +  "/" + depHierarchy;
+            getWxDepartment(supDep);
+        }
+        return depHierarchy;
+    }
+
     @Override
     public HttpRespMsg exportData(String keyword,
                                   @RequestParam(required = false, defaultValue = "1") Integer searchField,
@@ -4233,6 +4257,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         String token = request.getHeader("TOKEN");
         User user = userMapper.selectById(token);
         List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", user.getCompanyId()));
+        for (Department department : departmentList) {
+            department.setDepartmentName(getSupDepartment(department));
+        }
         String userId = null;
         List<SysRoleFunction> functionList = sysRoleFunctionMapper.getRoleFunctionNames(user.getRoleId());
         if(!functionList.stream().anyMatch(fun->fun.getFunctionName().equals("查看全部项目"))) {
@@ -4408,7 +4435,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 Optional<Department> first = departmentList.stream().filter(dl -> dl.getDepartmentId().equals(projectVO.getDeptId())).findFirst();
                 if(first.isPresent()){
                     if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                        rowData.add("$departmentName="+first.get().getCorpwxDeptid()+"$");
+                        Integer corpwxDeptid = first.get().getCorpwxDeptid();
+                        Department department = departmentMapper.selectOne(new QueryWrapper<Department>().eq("corpwx_deptid", corpwxDeptid));
+                        rowData.add(getWxDepartment(department));
                     }else {
                         rowData.add(first.get().getDepartmentName());
                     }

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -1420,7 +1420,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 if (updateReportList.size() > 0) {
                     updateBatchById(updateReportList);
                     //更新审核人的审批流程
-                    reportAuditorSettingService.updateBatchById(updateReportAuditorSettingList);
+                    if (updateReportAuditorSettingList.size() > 0) {
+                        reportAuditorSettingService.updateBatchById(updateReportAuditorSettingList);
+                    }
                 }
             } else {
                 //之前的流程逻辑,综合了一层项目审核,或者一层任务分组审核。 可叠加部门审批流

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

@@ -376,6 +376,12 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
             JSONObject reqParam = new JSONObject();
             reqParam.put("auth_corpid", corpInfo.getCorpid());
             reqParam.put("permanent_code", corpInfo.getPermanentCode());
+
+            System.out.println("SuiteAccessToken为:"+getSuiteAccessToken());
+            System.out.println("CompanyId为:"+corpInfo.getCompanyId());
+            System.out.println("Corpid为:"+corpInfo.getCorpid());
+            System.out.println("PermanentCode"+corpInfo.getPermanentCode());
+
             HttpEntity<String> requestEntity = new HttpEntity<String>(reqParam.toJSONString(), headers);
             ResponseEntity<String> responseEntity = this.restTemplate.exchange(url,
                     HttpMethod.POST, requestEntity, String.class);
@@ -903,6 +909,10 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
         for (WxCorpInfo wxCorpInfo : wxCorpInfos) {
             //更新Access_token
             String accessToken = getCorpAccessToken(wxCorpInfo);
+            if (StringUtils.isEmpty(accessToken)){
+                System.out.println(wxCorpInfo.getCorpName()+"accessToken获取失败");
+                continue;
+            }
             url = url.replace("ACCESS_TOKEN", accessToken);
             //查询并更新审核中的审批单
             System.out.println("+++++++++++++++++++开始查询并更新审核中的审批单+++++++++++++++++++");

+ 3 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -34,7 +34,7 @@
                   <el-menu-item index="1-10" v-if="permissions.reportAllTimely || permissions.reportTimely"><p @click="ssl(9)">{{ $t('employeereporttimelinessrate') }}</p></el-menu-item>
                   <el-menu-item index="1-11" v-if="permissions.reportAuditRate"><p @click="ssl(10)">{{ $t('dailyreporttobereviewedstatistics') }}</p></el-menu-item>
                   <el-menu-item index="1-12" v-if="permissions.reportPersonnel || permissions.reportResponsible"><p @click="ssl(11)">{{ $t('statisticsofpersonnelhours') }}</p></el-menu-item>
-                  <el-menu-item index="1-13" v-if="permissions.reportMonthlyPersonnel || permissions.reportResponsiblePersonnel"><p @click="ssl(14)">{{ $t('ren-yuan-yue-du-gong-shi-biao') }}</p></el-menu-item>
+                  <el-menu-item index="1-15" v-if="permissions.reportMonthlyPersonnel || permissions.reportResponsiblePersonnel"><p @click="ssl(14)">{{ $t('ren-yuan-yue-du-gong-shi-biao') }}</p></el-menu-item>
                   <!-- <el-menu-item index="1-12"><p @click="ssl(11)">人员工时统计表</p></el-menu-item> -->
                 </el-submenu>
               </el-menu>
@@ -1045,7 +1045,7 @@ export default {
       if(this.permissions.reportAllGroup || this.permissions.reportGroup) {this.ssl(12);this.defaultActive = '1-13';return} else
       if(this.permissions.reportAuditRate) {this.ssl(10);this.defaultActive = '1-11';return} else 
       if(this.permissions.reportPersonnel || this.permissions.reportResponsible) {this.ssl(11);this.defaultActive = '1-12';return}
-      if(this.permissions.reportMonthlyPersonnel || this.permissions.reportResponsiblePersonnel) {this.ssl(14);this.defaultActive = '1-13';return}
+      if(this.permissions.reportMonthlyPersonnel || this.permissions.reportResponsiblePersonnel) {this.ssl(14);this.defaultActive = '1-15';return}
       {this.allWrong = false}
     },
     rowspan(spanArr,position,spanName){
@@ -1551,6 +1551,7 @@ export default {
       this.listLoading = false
         if(res.code == 'ok'){
           this.monthlyPersonnelList = res.data.result
+          this.total = res.data.total
         }else {
           this.$message({
             message: res.msg,

+ 50 - 40
fhKeeper/formulahousekeeper/timesheet_h5/src/views/login/index.vue

@@ -198,50 +198,60 @@
             } else if (ua.indexOf("micromessenger") > 0) {
                 this.isWX = true;
             }
-            if (localStorage.userInfo != null) {
-                this.$router.push("/index").catch(err => { console.log(err, '错误5')});
+            let href = window.location.href;
+            //优先处理企业微信工作台点击进入,后台已经处理过,有userId传过来了
+            if (this.isCorpWX && href.indexOf("userId") > 0) {
+                //判断企业微信,是否存在授权
+                var loginUserId = href.substring(href.indexOf("userId=")+"userId=".length);
+                if (loginUserId.includes('#/')) {
+                    loginUserId = loginUserId.substring(0, loginUserId.indexOf('#/'));
+                }
+                this.loginByUserId(loginUserId);
             } else {
-                if (this.isCorpWX || this.isWX) {
-                    let href = window.location.href;
-                    //判断企业微信,是否存在授权
-                    if (href.includes("com/?code")) {
-                        this.bindIfNessary();
-                    } else {
-                        if (href.indexOf('hasTriedAutoLogin') == -1) {
-                            this.tryAutoLogin();
-                        } else if (href.indexOf("userId") > 0) {
-                            //后台经过验证后,重定向过来带上了userId
-                            var loginUserId = href.substring(href.indexOf("userId=")+"userId=".length);
-                            if (loginUserId.includes('#/')) {
-                                loginUserId = loginUserId.substring(0, loginUserId.indexOf('#/'));
+                if (localStorage.userInfo != null && !this.isCorpWX) {
+                    this.$router.push("/index").catch(err => { console.log(err, '错误5')});
+                } else {
+                    if (this.isCorpWX || this.isWX) {
+                        //判断企业微信,是否存在授权
+                        if (href.includes("com/?code")) {
+                            this.bindIfNessary();
+                        } else {
+                            if (href.indexOf('hasTriedAutoLogin') == -1) {
+                                this.tryAutoLogin();
+                            } else if (href.indexOf("userId") > 0) {
+                                //后台经过验证后,重定向过来带上了userId
+                                var loginUserId = href.substring(href.indexOf("userId=")+"userId=".length);
+                                if (loginUserId.includes('#/')) {
+                                    loginUserId = loginUserId.substring(0, loginUserId.indexOf('#/'));
+                                }
+                                this.loginByUserId(loginUserId);
                             }
-                            this.loginByUserId(loginUserId);
                         }
+                        
+                    } else {
+                        //检查环境,如果是钉钉有$CORPID$
+                        var key = '?corpid=';
+                        var jumpkey = '&jumpto=';
+                        var url = location.href;
+                        var that = this;
+                        if (url.indexOf(key) > 0) {
+                            var corpId = ''
+                            if(url.indexOf(jumpkey) > 0){
+                                corpId = url.substring(url.indexOf(key)+key.length,url.indexOf(jumpkey));
+                            }else{
+                                corpId = url.substring(url.indexOf(key)+key.length,url.indexOf('#'));
+                            }
+                            this.isDingding = true
+                            dd.ready(function() {
+                                dd.runtime.permission.requestAuthCode({
+                                    corpId: corpId, // 企业id
+                                    onSuccess: function (info) {
+                                        var code = info.code // 通过该免登授权码可以获取用户身份
+                                        that.loginByCode(code, corpId);
+                                    }});
+                            });
+                        } 
                     }
-                    
-                } else {
-                    //检查环境,如果是钉钉有$CORPID$
-                    var key = '?corpid=';
-                    var jumpkey = '&jumpto=';
-                    var url = location.href;
-                    var that = this;
-                    if (url.indexOf(key) > 0) {
-                        var corpId = ''
-                        if(url.indexOf(jumpkey) > 0){
-                            corpId = url.substring(url.indexOf(key)+key.length,url.indexOf(jumpkey));
-                        }else{
-                            corpId = url.substring(url.indexOf(key)+key.length,url.indexOf('#'));
-                        }
-                        this.isDingding = true
-                        dd.ready(function() {
-                            dd.runtime.permission.requestAuthCode({
-                                corpId: corpId, // 企业id
-                                onSuccess: function (info) {
-                                    var code = info.code // 通过该免登授权码可以获取用户身份
-                                    that.loginByCode(code, corpId);
-                                }});
-                        });
-                    } 
                 }
             }
         }