feat(组织工作台):我的项目、我的仓库、我的待办
This commit is contained in:
parent
413c11d98c
commit
8ae43e5dc2
|
|
@ -9,6 +9,7 @@ import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||||
import com.microservices.common.security.utils.SecurityUtils;
|
import com.microservices.common.security.utils.SecurityUtils;
|
||||||
import com.microservices.pms.dashboard.domain.vo.MyDashboardVo;
|
import com.microservices.pms.dashboard.domain.vo.MyDashboardVo;
|
||||||
import com.microservices.pms.dashboard.domain.vo.MyProjectIssuesSearchVo;
|
import com.microservices.pms.dashboard.domain.vo.MyProjectIssuesSearchVo;
|
||||||
|
import com.microservices.pms.dashboard.domain.vo.MyTodoProjectIssuesSearchVo;
|
||||||
import com.microservices.pms.product.domain.PmsProduct;
|
import com.microservices.pms.product.domain.PmsProduct;
|
||||||
import com.microservices.pms.product.domain.PmsProductRequirement;
|
import com.microservices.pms.product.domain.PmsProductRequirement;
|
||||||
import com.microservices.pms.product.domain.vo.PmsProductSearchVo;
|
import com.microservices.pms.product.domain.vo.PmsProductSearchVo;
|
||||||
|
|
@ -19,15 +20,9 @@ import com.microservices.pms.project.domain.vo.*;
|
||||||
import com.microservices.pms.project.service.IPmsProjectService;
|
import com.microservices.pms.project.service.IPmsProjectService;
|
||||||
import com.microservices.pms.project.service.IPmsProjectSprintService;
|
import com.microservices.pms.project.service.IPmsProjectSprintService;
|
||||||
import com.microservices.pms.project.service.PmsProjectIssuesService;
|
import com.microservices.pms.project.service.PmsProjectIssuesService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.*;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
@ -85,14 +80,13 @@ public class PmsDashboardController extends BaseController {
|
||||||
@GetMapping("/myProjectIssues")
|
@GetMapping("/myProjectIssues")
|
||||||
@ApiOperation(value = "我的工作项")
|
@ApiOperation(value = "我的工作项")
|
||||||
public AjaxResult myProjectIssues(MyProjectIssuesSearchVo myProjectIssuesSearchVo) {
|
public AjaxResult myProjectIssues(MyProjectIssuesSearchVo myProjectIssuesSearchVo) {
|
||||||
PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo = new PmsProjectIssuesSearchVo();
|
|
||||||
BeanUtils.copyProperties(myProjectIssuesSearchVo, pmsProjectIssuesSearchVo);
|
|
||||||
List<PmsProject> projectList = pmsProjectService.selectPmsProjectList(new PmsProject());
|
List<PmsProject> projectList = pmsProjectService.selectPmsProjectList(new PmsProject());
|
||||||
if(projectList.isEmpty()){
|
if(projectList.isEmpty()){
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
pmsProjectIssuesSearchVo.setPmProjectIds(StringUtils.join(projectList.stream().map(PmsProject::getId).toArray(), ","));
|
myProjectIssuesSearchVo.setPmProjectIds(StringUtils.join(projectList.stream().map(PmsProject::getId).toArray(), ","));
|
||||||
JSONObject result = pmsProjectIssuesService.selectMyPmsProjectIssuesList(pmsProjectIssuesSearchVo);
|
JSONObject result = pmsProjectIssuesService.selectMyPmsProjectIssuesList(myProjectIssuesSearchVo);
|
||||||
return success(result);
|
return success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -106,6 +100,24 @@ public class PmsDashboardController extends BaseController {
|
||||||
return pmsProjectService.selectPmsProjectList(pmsProjectSearchVo);
|
return pmsProjectService.selectPmsProjectList(pmsProjectSearchVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的项目-项目情况统计
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "我的项目-项目统计")
|
||||||
|
@GetMapping("/myProjects/statistics")
|
||||||
|
public AjaxResult myProjectStatistics(@ApiParam("项目id") @RequestParam Long pmProjectId) {
|
||||||
|
return success(pmsProjectService.getMyProjectStatistics(pmProjectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的仓库-仓库情况统计
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "我的仓库-仓库情况统计")
|
||||||
|
@GetMapping("/myRepositories/statistics")
|
||||||
|
public AjaxResult myRepositoriesStatistics(@ApiParam("仓库id") @RequestParam Long repositoryId) {
|
||||||
|
return success(pmsProjectService.getMyRepositoriesStatistics(repositoryId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 我的迭代
|
* 我的迭代
|
||||||
|
|
@ -126,4 +138,19 @@ public class PmsDashboardController extends BaseController {
|
||||||
pmsProjectSprintSearchVo.setPmsProjectIds(StringUtils.join(projectList.stream().map(PmsProject::getId).toArray(), ","));
|
pmsProjectSprintSearchVo.setPmsProjectIds(StringUtils.join(projectList.stream().map(PmsProject::getId).toArray(), ","));
|
||||||
return pmsProjectSprintService.selectAllPmsProjectSprintList(pmsProjectSprintSearchVo);
|
return pmsProjectSprintService.selectAllPmsProjectSprintList(pmsProjectSprintSearchVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的待办
|
||||||
|
*/
|
||||||
|
@GetMapping("/todo")
|
||||||
|
@ApiOperation(value = "我的待办")
|
||||||
|
public AjaxResult todoProjectIssues(MyTodoProjectIssuesSearchVo todoProjectIssuesSearchVo) {
|
||||||
|
List<PmsProject> projectList = pmsProjectService.selectPmsProjectList(new PmsProject());
|
||||||
|
if(projectList.isEmpty()){
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
todoProjectIssuesSearchVo.setPmProjectIds(StringUtils.join(projectList.stream().map(PmsProject::getId).toArray(), ","));
|
||||||
|
JSONObject result = pmsProjectIssuesService.selectMyTodoPmsProjectIssuesList(todoProjectIssuesSearchVo);
|
||||||
|
return success(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,10 @@ import lombok.Data;
|
||||||
@ApiModel("我的工作项搜索对象")
|
@ApiModel("我的工作项搜索对象")
|
||||||
public class MyProjectIssuesSearchVo {
|
public class MyProjectIssuesSearchVo {
|
||||||
|
|
||||||
@ApiModelProperty(value = "疑修类型,all 全部 opened 开启中 closed 已关闭", required = true)
|
@ApiModelProperty(value = "疑修类型,all 全部 opened 开启中 closed 已关闭")
|
||||||
private String category;
|
private String category;
|
||||||
|
|
||||||
@ApiModelProperty(value = "参与类型,all 全部 aboutme 关于我的 authoredme 我创建的 assignedme 我负责的 atme @我的", required = true)
|
@ApiModelProperty(value = "参与类型,all 全部 aboutme 关于我的 authoredme 我创建的 assignedme 我负责的 atme @我的")
|
||||||
private String participantCategory;
|
private String participantCategory;
|
||||||
|
|
||||||
@ApiModelProperty(value = "工作项名称搜索关键词")
|
@ApiModelProperty(value = "工作项名称搜索关键词")
|
||||||
|
|
@ -30,9 +30,9 @@ public class MyProjectIssuesSearchVo {
|
||||||
private String limit;
|
private String limit;
|
||||||
|
|
||||||
@ApiModelProperty(value = "按pmProjectId集合查询,逗号隔开", hidden = true)
|
@ApiModelProperty(value = "按pmProjectId集合查询,逗号隔开", hidden = true)
|
||||||
private String pmsProjectIds;
|
private String pmProjectIds;
|
||||||
|
|
||||||
@ApiModelProperty(value = "工作项类型:计划1 任务2 缺陷3,多个用逗号隔开")
|
@ApiModelProperty(value = "工作项类型:计划1 任务2 缺陷3,多个用逗号隔开", required = true)
|
||||||
private String pmIssueTypes;
|
private String pmIssueTypes;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.microservices.pms.dashboard.domain.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel("我的待办工作项搜索对象")
|
||||||
|
public class MyTodoProjectIssuesSearchVo {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "日期,格式:yyyy-MM-dd,示例值:2024-12-11")
|
||||||
|
private String date;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工作项名称搜索关键词")
|
||||||
|
private String keyword;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序方式: issues.updated_on 更新时间 issues.created_on 创建时间 issue_priorities.position 优先级")
|
||||||
|
private String sortBy;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序方向:asc 正序 desc 倒序")
|
||||||
|
private String sortDirection;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页码", required = true)
|
||||||
|
private String page;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分页数", required = true)
|
||||||
|
private String limit;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "按pmProjectId集合查询,逗号隔开", hidden = true)
|
||||||
|
private String pmProjectIds;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工作项类型:计划1 任务2 缺陷3,多个用逗号隔开")
|
||||||
|
private String pmIssueTypes;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.microservices.pms.project.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PmsProjectSprintStatisticsVo {
|
||||||
|
|
||||||
|
// 总数
|
||||||
|
private Integer all_sprint_count;
|
||||||
|
// 待开始
|
||||||
|
private Integer todo_sprint_count;
|
||||||
|
// 进行中
|
||||||
|
private Integer doing_sprint_count;
|
||||||
|
// 已关闭
|
||||||
|
private Integer closed_sprint_count;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,7 @@ package com.microservices.pms.project.mapper;
|
||||||
|
|
||||||
import com.microservices.pms.project.domain.PmsProjectSprint;
|
import com.microservices.pms.project.domain.PmsProjectSprint;
|
||||||
import com.microservices.pms.project.domain.vo.PmsProjectSprintSearchVo;
|
import com.microservices.pms.project.domain.vo.PmsProjectSprintSearchVo;
|
||||||
|
import com.microservices.pms.project.domain.vo.PmsProjectSprintStatisticsVo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|
@ -77,4 +78,6 @@ public interface PmsProjectSprintMapper
|
||||||
Integer selectOpeningSprintCount(@Param("pmProjectId") Long pmProjectId);
|
Integer selectOpeningSprintCount(@Param("pmProjectId") Long pmProjectId);
|
||||||
|
|
||||||
Integer selectOpeningSprintLastWeekIterationCount(@Param("pmProjectId") Long pmProjectId);
|
Integer selectOpeningSprintLastWeekIterationCount(@Param("pmProjectId") Long pmProjectId);
|
||||||
|
|
||||||
|
PmsProjectSprintStatisticsVo selectPmsProjectSprintStatisticsByProjectId(@Param("pmProjectId") Long pmProjectId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,4 +92,10 @@ public interface IPmsProjectService
|
||||||
* @param productId 产品Id
|
* @param productId 产品Id
|
||||||
*/
|
*/
|
||||||
void clearPmsProjectAndProductAssociations(Long productId);
|
void clearPmsProjectAndProductAssociations(Long productId);
|
||||||
|
|
||||||
|
JSONObject getPmsProjectDynamics(Long pmProjectId);
|
||||||
|
|
||||||
|
JSONObject getMyProjectStatistics(Long pmProjectId);
|
||||||
|
|
||||||
|
JSONObject getMyRepositoriesStatistics(Long repositoryId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ import com.microservices.common.core.utils.DateUtils;
|
||||||
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
|
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
|
||||||
import com.microservices.common.security.utils.SecurityUtils;
|
import com.microservices.common.security.utils.SecurityUtils;
|
||||||
import com.microservices.pms.common.service.IPmsCommonService;
|
import com.microservices.pms.common.service.IPmsCommonService;
|
||||||
|
import com.microservices.pms.dashboard.domain.vo.MyProjectIssuesSearchVo;
|
||||||
|
import com.microservices.pms.dashboard.domain.vo.MyTodoProjectIssuesSearchVo;
|
||||||
import com.microservices.pms.enterprise.domain.PmsEnterprise;
|
import com.microservices.pms.enterprise.domain.PmsEnterprise;
|
||||||
import com.microservices.pms.enterprise.service.IPmsEnterpriseService;
|
import com.microservices.pms.enterprise.service.IPmsEnterpriseService;
|
||||||
import com.microservices.pms.project.domain.PmsProject;
|
import com.microservices.pms.project.domain.PmsProject;
|
||||||
|
|
@ -494,14 +496,24 @@ public class PmsProjectIssuesService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public JSONObject selectMyPmsProjectIssuesList(PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo) {
|
public JSONObject selectMyPmsProjectIssuesList(MyProjectIssuesSearchVo myProjectIssuesSearchVo) {
|
||||||
pmsProjectService.selectAndCheckPmsProjectById(pmsProjectIssuesSearchVo.getPmProjectId());
|
|
||||||
JSONObject issueSearch = new JSONObject();
|
JSONObject issueSearch = new JSONObject();
|
||||||
convertObjectToJSONObject(pmsProjectIssuesSearchVo, issueSearch, null);
|
convertObjectToJSONObject(myProjectIssuesSearchVo, issueSearch, null);
|
||||||
try {
|
try {
|
||||||
return setProjectIssueListUserState(gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_MY_ISSUE_LIST(issueSearch)));
|
return setProjectIssueListUserState(gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_MY_ISSUE_LIST(issueSearch)));
|
||||||
} catch (URISyntaxException e) {
|
} catch (URISyntaxException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JSONObject selectMyTodoPmsProjectIssuesList(MyTodoProjectIssuesSearchVo todoProjectIssuesSearchVo) {
|
||||||
|
JSONObject issueSearch = new JSONObject();
|
||||||
|
convertObjectToJSONObject(todoProjectIssuesSearchVo, issueSearch, null);
|
||||||
|
try {
|
||||||
|
return setProjectIssueListUserState(gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_MY_TODO_ISSUE_LIST(issueSearch)));
|
||||||
|
} catch (URISyntaxException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -148,6 +148,31 @@ public class PmsProjectServiceImpl implements IPmsProjectService
|
||||||
return toPage(pmsProjectList, pmsProject -> buildPmsProjectDetailVo(pmsProject, finalProjectTotalCount));
|
return toPage(pmsProjectList, pmsProject -> buildPmsProjectDetailVo(pmsProject, finalProjectTotalCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject getMyProjectStatistics(Long pmProjectId) {
|
||||||
|
selectAndCheckPmsProjectById(pmProjectId);
|
||||||
|
JSONObject result = gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_MY_PROJECT_STATISTICS(pmProjectId));
|
||||||
|
JSONObject data = result.getJSONObject(DATA_KEY);
|
||||||
|
if (data != null) {
|
||||||
|
fillSprintStatisticsData(pmProjectId, data);
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject getMyRepositoriesStatistics(Long repositoryId) {
|
||||||
|
|
||||||
|
return gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_MY_REPOSITORY_STATISTICS(repositoryId));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fillSprintStatisticsData(Long pmProjectId, JSONObject data) {
|
||||||
|
PmsProjectSprintStatisticsVo pmsProjectSprintStatisticsVo = pmsProjectSprintMapper.selectPmsProjectSprintStatisticsByProjectId(pmProjectId);
|
||||||
|
data.put("all_sprint_count", pmsProjectSprintStatisticsVo.getAll_sprint_count());
|
||||||
|
data.put("todo_sprint_count", pmsProjectSprintStatisticsVo.getTodo_sprint_count());
|
||||||
|
data.put("doing_sprint_count", pmsProjectSprintStatisticsVo.getDoing_sprint_count());
|
||||||
|
data.put("closed_sprint_count", pmsProjectSprintStatisticsVo.getClosed_sprint_count());
|
||||||
|
}
|
||||||
|
|
||||||
private PmsProjectDetailVo buildPmsProjectDetailVo(PmsProject pmsProject, JSONObject projectTotalCount) {
|
private PmsProjectDetailVo buildPmsProjectDetailVo(PmsProject pmsProject, JSONObject projectTotalCount) {
|
||||||
|
|
||||||
PmsProjectDetailVo pmsProjectDetailVo = new PmsProjectDetailVo();
|
PmsProjectDetailVo pmsProjectDetailVo = new PmsProjectDetailVo();
|
||||||
|
|
|
||||||
|
|
@ -371,4 +371,19 @@ public class PmsGitLinkRequestUrl extends GitLinkRequestUrl {
|
||||||
return getGitLinkRequestUrl(
|
return getGitLinkRequestUrl(
|
||||||
buildUri("/api/pm/dashboards/my_issues", params));
|
buildUri("/api/pm/dashboards/my_issues", params));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static GitLinkRequestUrl GET_MY_TODO_ISSUE_LIST(JSONObject params) throws URISyntaxException {
|
||||||
|
return getGitLinkRequestUrl(
|
||||||
|
buildUri("/api/pm/dashboards/todo", params));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GitLinkRequestUrl GET_MY_PROJECT_STATISTICS(Long pmProjectId){
|
||||||
|
return getGitLinkRequestUrl(
|
||||||
|
String.format("/api/pm/dashboards/my_pm_projects?pm_project_id=%d", pmProjectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GitLinkRequestUrl GET_MY_REPOSITORY_STATISTICS(Long repositoryId) {
|
||||||
|
return getGitLinkRequestUrl(
|
||||||
|
String.format("/api/pm/dashboards/my_projects?project_id=%d", repositoryId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -197,4 +197,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and status IN ('0', '1')
|
and status IN ('0', '1')
|
||||||
and start_time >= DATE_SUB(NOW(), INTERVAL 1 WEEK)
|
and start_time >= DATE_SUB(NOW(), INTERVAL 1 WEEK)
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectPmsProjectSprintStatisticsByProjectId"
|
||||||
|
resultType="com.microservices.pms.project.domain.vo.PmsProjectSprintStatisticsVo">
|
||||||
|
SELECT
|
||||||
|
(
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM pms_project_sprint
|
||||||
|
WHERE pms_project_id = #{pmProjectId}
|
||||||
|
) AS all_sprint_count,
|
||||||
|
(
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM pms_project_sprint
|
||||||
|
WHERE pms_project_id = #{pmProjectId} AND status = 0
|
||||||
|
) AS `todo_sprint_count`,
|
||||||
|
(
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM pms_project_sprint
|
||||||
|
WHERE pms_project_id = #{pmProjectId} AND status = 1
|
||||||
|
) AS `doing_sprint_count`,
|
||||||
|
(
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM pms_project_sprint
|
||||||
|
WHERE pms_project_id = #{pmProjectId} AND status = 2
|
||||||
|
) AS `closed_sprint_count`
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue