feat(周报功能重构):个人周报统计工作项分页参数添加
This commit is contained in:
parent
6e7ae41dac
commit
83f86f623d
|
@ -2,6 +2,7 @@ package com.microservices.pms.project.controller;
|
|||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.pms.project.domain.vo.PmsPersonalWeeklyReportSearchVo;
|
||||
import com.microservices.pms.project.domain.vo.PmsProjectIssuesInputVo;
|
||||
import com.microservices.pms.project.domain.vo.PmsProjectIssuesSearchVo;
|
||||
import com.microservices.pms.project.service.PmsProjectIssuesService;
|
||||
|
@ -47,9 +48,9 @@ public class PmsProjectWeeklyReportController {
|
|||
*/
|
||||
@GetMapping("/personal")
|
||||
@ApiOperation(value = "周报-个人工作项统计")
|
||||
public AjaxResult getPersonalWeeklyReport(@PathVariable String enterpriseIdentifier)
|
||||
public AjaxResult getPersonalWeeklyReport(@PathVariable String enterpriseIdentifier, PmsPersonalWeeklyReportSearchVo pmsPersonalWeeklyReportSearchVo)
|
||||
{
|
||||
JSONObject result = pmsProjectIssuesService.getPersonalIssuesStatistics(enterpriseIdentifier);
|
||||
JSONObject result = pmsProjectIssuesService.getPersonalIssuesStatistics(enterpriseIdentifier, pmsPersonalWeeklyReportSearchVo);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
package com.microservices.pms.project.domain.vo;
|
||||
|
||||
import com.microservices.common.core.utils.ServletUtils;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("个人周报工作项搜索对象")
|
||||
public class PmsPersonalWeeklyReportSearchVo {
|
||||
|
||||
@ApiModelProperty(value = "工作项名称搜索关键词")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty(value = "状态值,可多个状态逗号隔开")
|
||||
private String statusIds;
|
||||
|
||||
@ApiModelProperty(value = "排序方式: issues.updated_on 更新时间 issues.created_on 创建时间 issue_priorities.position 优先级")
|
||||
private String sortBy;
|
||||
|
||||
@ApiModelProperty(value = "排序方向:asc 正序 desc 倒序")
|
||||
private String sortDirection;
|
||||
|
||||
@ApiModelProperty(value = "本周工作项页码")
|
||||
private String thisWeekPage;
|
||||
|
||||
@ApiModelProperty(value = "分页数")
|
||||
private String thisWeekLimit;
|
||||
|
||||
@ApiModelProperty(value = "本周工作项页码")
|
||||
private String nextWeekPage;
|
||||
|
||||
@ApiModelProperty(value = "分页数")
|
||||
private String nextWeekLimit;
|
||||
|
||||
@ApiModelProperty(value = "当前用户gitlink用户id", hidden = true)
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "企业标识", hidden = true)
|
||||
private String enterpriseIdentifier;
|
||||
|
||||
public void setKeyword(String keyword) {
|
||||
this.keyword = ServletUtils.urlDecode(keyword);
|
||||
}
|
||||
}
|
|
@ -683,9 +683,17 @@ public class PmsProjectIssuesService {
|
|||
}
|
||||
}
|
||||
|
||||
public JSONObject getPersonalIssuesStatistics(String enterpriseIdentifier) {
|
||||
public JSONObject getPersonalIssuesStatistics(String enterpriseIdentifier, PmsPersonalWeeklyReportSearchVo pmsPersonalWeeklyReportSearchVo) {
|
||||
Long gitlinkUserId = SecurityUtils.getGitlinkUserId();
|
||||
return enrichProjectIssueList(gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_WEEKLY_ISSUES_PERSONAL(enterpriseIdentifier, gitlinkUserId)));
|
||||
pmsPersonalWeeklyReportSearchVo.setUserId(gitlinkUserId);
|
||||
pmsPersonalWeeklyReportSearchVo.setEnterpriseIdentifier(enterpriseIdentifier);
|
||||
JSONObject issueSearch = new JSONObject();
|
||||
convertObjectToJSONObject(pmsPersonalWeeklyReportSearchVo, issueSearch, null);
|
||||
try {
|
||||
return enrichProjectIssueList(gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_WEEKLY_ISSUES_PERSONAL(issueSearch)));
|
||||
} catch (URISyntaxException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public JSONObject getProjectTeamIssuesStatistics(String enterpriseIdentifier) {
|
||||
|
|
|
@ -448,9 +448,9 @@ public class PmsGitLinkRequestUrl extends GitLinkRequestUrl {
|
|||
return getGitLinkRequestUrl(String.format("/api/pm/action_runs?owner_id=%s&workflows=%s", owner, workflows), "data");
|
||||
}
|
||||
|
||||
public static GitLinkRequestUrl GET_WEEKLY_ISSUES_PERSONAL(String enterpriseIdentifier, Long gitlinkUserId){
|
||||
public static GitLinkRequestUrl GET_WEEKLY_ISSUES_PERSONAL(JSONObject issueSearch) throws URISyntaxException {
|
||||
return getGitLinkRequestUrl(
|
||||
String.format("/api/pm/weekly_issues/personal.json?enterprise_identifier=%s&user_id=%s", enterpriseIdentifier, gitlinkUserId));
|
||||
buildUri("/api/pm/weekly_issues/personal.json", issueSearch));
|
||||
}
|
||||
|
||||
public static GitLinkRequestUrl GET_WEEKLY_ISSUES_GROUP(String enterpriseIdentifier, String pmProjectIds){
|
||||
|
|
Loading…
Reference in New Issue