浏览代码

Merge remote-tracking branch 'origin/master'

yusm 5 月之前
父节点
当前提交
83933485c5

+ 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 {

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

@@ -359,6 +359,8 @@
                 }
             },
             tryAutoLogin() {
+                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";

+ 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){