Skip to content

Commit

Permalink
Merge pull request #64 from victorLV214/dev/SYLiu
Browse files Browse the repository at this point in the history
2024/11/26 Fix bug.
  • Loading branch information
AB-IN-lsy authored Nov 28, 2024
2 parents 13e9fc7 + 05f8a2c commit 9641c3c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
4 changes: 2 additions & 2 deletions backend/ruoyi-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>16</source>
<target>16</target>
<source>9</source>
<target>9</target>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ public SysDashboard getDashboardData() {

// 根据项目状态分类
List<SysProject> plannedProjects = projects.stream()
.filter(p -> "规划中".equals(p.getStatus()))
.filter(p -> "Planning".equals(p.getStatus()))
.collect(Collectors.toList());

List<SysProject> ongoingProjects = projects.stream()
.filter(p -> "进行中".equals(p.getStatus()))
.filter(p -> "In Progress".equals(p.getStatus()))
.collect(Collectors.toList());

List<SysProject> completedProjects = projects.stream()
.filter(p -> "已完成".equals(p.getStatus()))
.filter(p -> "Completed".equals(p.getStatus()))
.collect(Collectors.toList());

sysDashboard.setPlannedProjects(plannedProjects);
Expand All @@ -68,11 +68,11 @@ public SysDashboard getDashboardData() {
if (tasks != null && !tasks.isEmpty()) {
// 根据任务状态分类
List<SysTask> ongoingTasks = tasks.stream()
.filter(t -> "进行中".equals(t.getStatus()))
.filter(t -> "In Progress".equals(t.getStatus()))
.collect(Collectors.toList());

List<SysTask> completedTasks = tasks.stream()
.filter(t -> "已完成".equals(t.getStatus()))
.filter(t -> "Completed".equals(t.getStatus()))
.collect(Collectors.toList());

sysDashboard.setOngoingTasks(ongoingTasks);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;

import com.ruoyi.common.utils.SecurityUtils;
Expand Down Expand Up @@ -63,11 +64,14 @@ public TableDataInfo listMyProject(SysProject sysProject) {
startPage();
List<Long> projectIds = sysProjectMemberService
.selectSysProjectMemberByUserId(SecurityUtils.getUserId())
.stream().map(SysProjectMember::getProjectId).toList();
.stream()
.map(SysProjectMember::getProjectId)
.collect(Collectors.toList());;

List<SysProject> myProjectList = projectIds.stream()
List<SysProject> myProjectList = projectIds
.stream()
.map(projectId -> sysProjectService.selectSysProjectByProjectId(projectId))
.toList();
.collect(Collectors.toList());;

return getDataTable(myProjectList);
}
Expand All @@ -93,10 +97,13 @@ public void exportMy(HttpServletResponse response, @RequestBody SysProject sysPr
public void export(HttpServletResponse response, @RequestBody SysProject sysProject) {
List<Long> projectIds = sysProjectMemberService
.selectSysProjectMemberByUserId(SecurityUtils.getUserId())
.stream().map(SysProjectMember::getProjectId).toList();
List<SysProject> myProjectList = projectIds.stream()
.stream()
.map(SysProjectMember::getProjectId)
.collect(Collectors.toList());;
List<SysProject> myProjectList = projectIds
.stream()
.map(projectId -> sysProjectService.selectSysProjectByProjectId(projectId))
.toList();
.collect(Collectors.toList());;

ExcelUtil<SysProject> util = new ExcelUtil<SysProject>(SysProject.class);
util.exportExcel(response, myProjectList, "用户参与项目数据");
Expand Down

0 comments on commit 9641c3c

Please sign in to comment.