瀏覽代碼

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

QuYueTing 5 月之前
父節點
當前提交
d4d15d89c4

+ 18 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -8987,6 +8987,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 List<String> headList = new ArrayList<String>();
                 //headList.add("人员");
                 headList.add(MessageUtils.message("entry.personnel"));
+                //部门
+                headList.add(MessageUtils.message("excel.department"));
                 projectCategoryNameS.forEach(pc->{
                     if ("hours".equals(exportContent) && functionTimeList.size()>0){
                         //headList.add(String.valueOf(pc)+"/工时");
@@ -9032,12 +9034,28 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     double costTime = 0;
                     List<Map<String, Object>> mapList = membList.stream().filter(mb -> mb.get("creatorId").equals(user.getId())).collect(Collectors.toList());
                     List<String> membRowData=new ArrayList<>();
+                    Optional<Department> first = allDepartmentList.stream().filter(d -> d.getDepartmentId().equals(user.getDepartmentId())).findFirst();
                     if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
                         membRowData.add("$userName"+(user.getCorpwxUserid()==null?"":user.getCorpwxUserid())+"$");
+                        if (first.isPresent()){
+                            membRowData.add((String)("$departmentName="+first.get().getCorpwxDeptid()+"$"));
+                        }else {
+                            membRowData.add("");
+                        }
                     }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
                         membRowData.add("$userName"+(user.getName()==null?"":user.getName())+"$");
+                        if (first.isPresent()){
+                            membRowData.add((String)("$departmentName="+first.get().getDdDeptid()+"$"));
+                        }else {
+                            membRowData.add("");
+                        }
                     }else {
                         membRowData.add(user.getName());
+                        if (first.isPresent()){
+                            membRowData.add(first.get().getDepartmentName());
+                        }else {
+                            membRowData.add("");
+                        }
                     }
                     for(Object i:projectCategorys){
                         List<Map<String, Object>> resultList = mapList.stream().filter(mp -> mp.get("category").equals(i)).collect(Collectors.toList());

+ 9 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -8132,6 +8132,15 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             queryWrapper.eq("creator_id", userId).eq("create_date", report.getCreateDate());
             //获取最近填写的那一天的全部日报
             reports = reportMapper.selectList(queryWrapper);
+            //如果没有填报全部项目权限,需要剔除掉非参与的正式项目
+            boolean canFillAllProject = sysFunctionService.hasPriviledge(user.getRoleId(), "可填报全部项目");
+            if (!canFillAllProject) {
+                List<Participation> participationList = participationMapper.selectList(new QueryWrapper<Participation>().eq("user_id", userId));
+                List<Integer> projectIds = participationList.stream().map(Participation::getProjectId).collect(Collectors.toList());
+                List<Project> publicProjects = allProjectList.stream().filter(p->p.getIsPublic() == 1).collect(Collectors.toList());
+                List<Integer> pubPids = publicProjects.stream().map(Project::getId).collect(Collectors.toList());
+                reports = reports.stream().filter(r->projectIds.contains(r.getProjectId()) || pubPids.contains(r.getProjectId())).collect(Collectors.toList());
+            }
             //仅保留进行中的项目的日报
             reports = reports.stream().filter(r->allProjectList.stream().anyMatch(p->p.getId().equals(r.getProjectId()))).collect(Collectors.toList());
         } else {

+ 39 - 0
fhKeeper/formulahousekeeper/timesheet/src/common/js/appidConfiguration.js

@@ -0,0 +1,39 @@
+/**
+ * 各个公司企业微信的配置, 更具域名来解析
+ * @path 完整域名
+ * @appId 企业微信的appId
+ */
+const config = {
+  "worktime.ttkuaiban.com": {
+    // 工时管家
+    path: "https://worktime.ttkuaiban.com",
+    appId: "ww4e237fd6abb635af",
+    agentId: "",
+  },
+  "blue.blovelight.net": {
+    // 蓝光研发
+    path: "http://blue.blovelight.net:2021",
+    appId: "wwb12ec40df8c35139",
+    agentId: "1000075",
+  },
+};
+
+const fixedPath = `/api/corpWXAuth`; // 授权回调页面 (需要拼接)
+const fixedPathAgentId = `/api/corpInsideWXAuth`
+
+export function obtainCorrespondingConfigurationInformation() {
+  const hostname = window.location.hostname; // 获取域名和端口,(不包括http 和 https)
+  const row = config[hostname];
+  const agentId = row.agentId;
+  const appId = row.appId;
+  const tokenUrl = `${row.path}${fixedPath}`;
+  const tokenUrlAgentId = `${row.path}${fixedPathAgentId}`;
+  const authorizationCallback = agentId
+    ? `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${encodeURI(tokenUrlAgentId)}&response_type=code&scope=snsapi_base&state=index&agentid=${agentId}#wechat_redirect`
+    : `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${encodeURI(tokenUrl)}&response_type=code&scope=snsapi_base&state=1#wechat_redirect`;
+  return {
+    appId,
+    tokenUrl,
+    authorizationCallback,
+  };
+}

+ 9 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/Login.vue

@@ -68,6 +68,7 @@
     import * as dd from 'dingtalk-jsapi';
     import "../permissions.js"
     import WxLogin from "../assets/js/wwLogin.js"
+    import { obtainCorrespondingConfigurationInformation } from '../common/js/appidConfiguration.js'
     export default {
         inject:['reloads'],
         data() {
@@ -116,7 +117,7 @@
                 this.bindingqywx = true
             }
         },
-        mounted() {
+        mounted() { 
             // this.wxworkCli()
             var ua = navigator.userAgent.toLowerCase();
             console.log(ua, '打印出来')
@@ -359,9 +360,13 @@
                 }
             },
             tryAutoLogin() {
-                var appId = "ww4e237fd6abb635af";//企业微信第三方的SUIT ID
-                var url = "https://worktime.ttkuaiban.com/api/corpWXAuth";//授权回调页面
-                var weixinUrl="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appId+"&redirect_uri="+encodeURI(url)+"&response_type=code&scope=snsapi_base&state=1#wechat_redirect";
+                let href = window.location.href;
+                // var appId = "ww4e237fd6abb635af";//企业微信第三方的SUIT ID
+                // var url = "https://worktime.ttkuaiban.com/api/corpWXAuth";//授权回调页面
+                // var weixinUrl="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appId+"&redirect_uri="+encodeURI(url)+"&response_type=code&scope=snsapi_base&state=1#wechat_redirect";
+
+                const config = obtainCorrespondingConfigurationInformation()
+                var weixinUrl = config.authorizationCallback;
                 window.location.href = weixinUrl;
             },
             tryDingDingUrlRedirect() {

+ 7 - 13
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -7464,9 +7464,10 @@
                                     if (this.isSubstitude) {
                                         formData.append('targetUids',this.workForm.userId[0]);
                                     }
-                                    for(var s in this.projectList) {
-                                        if(j == this.projectList[s].projectName) {
-                                            formData.append("projectId", this.projectList[s].id);
+                                    for(var s in this.selProjectList) {
+                                        if(j == this.selProjectList[s].projectName) {
+                                            formData.append("projectId", this.selProjectList[s].id);
+                                            break;
                                         }
                                     }
                                     if(this.user.timeType.reportAuditType == 3){
@@ -7561,6 +7562,7 @@
                                     var pItem = this.selProjectList[k];
                                     var pName = pItem.projectName;
                                     var j = pName;
+                                    var pid = pItem.id;
                                     console.log('j==周报中的项目='+j);
                                     if(zhoD[j].time && zhoD[j].time != 'null') {
                                         flgs = true
@@ -7569,11 +7571,7 @@
                                         if (this.isSubstitude) {
                                             formData.append('targetUids',this.workForm.userId[0]);
                                         }
-                                        for(var s in this.projectList) {
-                                            if(j == this.projectList[s].projectName) {
-                                                formData.append("projectId", this.projectList[s].id);
-                                            }
-                                        }
+                                        formData.append("projectId", pid);
                                         if(this.user.timeType.reportAuditType == 3){
                                             let audItem = {}
                                             if(this.user.timeType.auditLevel > 0){
@@ -7657,11 +7655,7 @@
                                         if (this.isSubstitude) {
                                             formData.append('targetUids',this.workForm.userId[0]);
                                         }
-                                        for(var s in this.projectList) {
-                                            if(j == this.projectList[s].projectName) {
-                                                formData.append("projectId", this.projectList[s].id);
-                                            }
-                                        }
+                                        formData.append("projectId", pItem.id);
                                         if(this.user.timeType.reportAuditType == 3){
                                             let audItem = {}
                                             if(this.user.timeType.auditLevel > 0){