From 0417d51f254a466e9ee8118f3f9c499ee8843ca0 Mon Sep 17 00:00:00 2001 From: wanjia <553039491@qq.com> Date: Mon, 9 Dec 2024 16:57:17 +0800 Subject: [PATCH 01/20] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E6=A6=82=E8=A7=88?= =?UTF-8?q?=EF=BC=89:=E8=BF=AD=E4=BB=A3=E5=88=97=E8=A1=A8=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=85=B3=E8=81=94=E6=B5=8B=E8=AF=95=E5=8D=95=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pms/project/domain/vo/PmsProjectSprintDetailVo.java | 3 +++ .../pms/project/mapper/PmsProjectTestsheetMapper.java | 2 ++ .../project/service/impl/PmsProjectSprintServiceImpl.java | 6 ++++++ .../main/resources/mapper/pms/PmsProjectTestsheetMapper.xml | 3 +++ 4 files changed, 14 insertions(+) diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectSprintDetailVo.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectSprintDetailVo.java index af9a74fac..05f692de2 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectSprintDetailVo.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectSprintDetailVo.java @@ -33,6 +33,9 @@ public class PmsProjectSprintDetailVo { @ApiModelProperty(value = "工时规模") private Long timeScale; + @ApiModelProperty(value = "关联测试用例数") + private Integer linkedTestCaseCount; + @ApiModelProperty(value = "状态 0待开始 1进行中 2已关闭") private String status; diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/mapper/PmsProjectTestsheetMapper.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/mapper/PmsProjectTestsheetMapper.java index 60edeb393..6144ef7ca 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/mapper/PmsProjectTestsheetMapper.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/mapper/PmsProjectTestsheetMapper.java @@ -66,4 +66,6 @@ public interface PmsProjectTestsheetMapper List selectPmsProjectTestsheetByIds(@Param("pmsProjectTestSheetIds") String pmsProjectTestSheetIds); int deletePmsProjectTestsheetByProjectId(@Param("projectId") Long projectId); + + Integer selectCountBySprintId(@Param("sprintId") Long sprintId); } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectSprintServiceImpl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectSprintServiceImpl.java index cf2d15cc6..4b3aae5ba 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectSprintServiceImpl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectSprintServiceImpl.java @@ -11,6 +11,8 @@ import com.microservices.pms.common.service.IPmsCommonService; import com.microservices.pms.project.domain.PmsProjectSprint; import com.microservices.pms.project.domain.vo.*; import com.microservices.pms.project.mapper.PmsProjectSprintMapper; +import com.microservices.pms.project.mapper.PmsProjectTestcaseMapper; +import com.microservices.pms.project.mapper.PmsProjectTestsheetMapper; import com.microservices.pms.project.service.IPmsProjectService; import com.microservices.pms.project.service.IPmsProjectSprintService; import com.microservices.pms.project.service.PmsProjectIssuesService; @@ -58,6 +60,9 @@ public class PmsProjectSprintServiceImpl implements IPmsProjectSprintService @Lazy private PmsProjectIssuesService pmsProjectIssuesService; + @Resource + private PmsProjectTestsheetMapper pmsProjectTestsheetMapper; + /** * 查询项目迭代 @@ -138,6 +143,7 @@ public class PmsProjectSprintServiceImpl implements IPmsProjectSprintService BeanUtils.copyProperties(pmsProjectSprint, pmsProjectSprintDetailVo); pmsProjectSprintDetailVo.setSprintAssignee(pmsCommonService.getSimpleSysUserByGitlinkUserId(pmsProjectSprint.getSprintAssigneeId())); pmsProjectSprintDetailVo.setSprintIssuesStatistics(sprintIssuesStatistics.getJSONObject(String.valueOf(pmsProjectSprint.getId()))); + pmsProjectSprintDetailVo.setLinkedTestCaseCount(pmsProjectTestsheetMapper.selectCountBySprintId(pmsProjectSprint.getId())); return pmsProjectSprintDetailVo; } diff --git a/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProjectTestsheetMapper.xml b/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProjectTestsheetMapper.xml index 5eed3b216..ec6dd180c 100644 --- a/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProjectTestsheetMapper.xml +++ b/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProjectTestsheetMapper.xml @@ -50,6 +50,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{pmsProjectTestSheetIds} + insert into pms_project_testsheet From 168f60234d097abcc0e4f504ce685502a6c4184e Mon Sep 17 00:00:00 2001 From: wanjia <553039491@qq.com> Date: Mon, 9 Dec 2024 17:32:38 +0800 Subject: [PATCH 02/20] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E6=A6=82=E8=A7=88?= =?UTF-8?q?=EF=BC=89:=E5=BC=80=E5=90=AF=E4=B8=AD=E7=9A=84=E8=BF=AD?= =?UTF-8?q?=E4=BB=A3=E6=95=B0=E3=80=81=E8=BF=91=E4=B8=80=E5=91=A8=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E8=BF=AD=E4=BB=A3=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pms/project/mapper/PmsProjectSprintMapper.java | 4 ++++ .../project/service/impl/PmsProjectServiceImpl.java | 13 ++++++++++++- .../resources/mapper/pms/PmsProjectSprintMapper.xml | 13 +++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/mapper/PmsProjectSprintMapper.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/mapper/PmsProjectSprintMapper.java index 7e5370db2..9c4210ffb 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/mapper/PmsProjectSprintMapper.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/mapper/PmsProjectSprintMapper.java @@ -73,4 +73,8 @@ public interface PmsProjectSprintMapper int deletePmsProjectSprintByProjectId(@Param("projectId") Long projectId); PmsProjectSprint selectLatestSprintByProjectIdAndNameAndAssigneeId(@Param("pmsProjectId") Long pmsProjectId, @Param("sprintName") String sprintName, @Param("sprintAssigneeId") Long sprintAssigneeId); + + Integer selectOpeningSprintCount(@Param("pmProjectId") Long pmProjectId); + + Integer selectOpeningSprintLastWeekIterationCount(@Param("pmProjectId") Long pmProjectId); } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectServiceImpl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectServiceImpl.java index de1f13385..8ff606055 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectServiceImpl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectServiceImpl.java @@ -436,7 +436,18 @@ public class PmsProjectServiceImpl implements IPmsProjectService // 校验数据权限 selectAndCheckPmsProjectById(pmProjectId); JSONObject result = gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_PROJECT_STATISTICS(pmProjectId)); - return result.getJSONObject(DATA_KEY); + JSONObject dataObj = result.getJSONObject(DATA_KEY); + if (dataObj.containsKey("open_data")) { + // 获取 open_data 对象 + JSONObject openData = dataObj.getJSONObject("open_data"); + Integer openSprintCount = pmsProjectSprintMapper.selectOpeningSprintCount(pmProjectId); + Integer openLastWeekIterationCount = pmsProjectSprintMapper.selectOpeningSprintLastWeekIterationCount(pmProjectId); + // 添加新的键值对 + openData.put("0", openSprintCount); // 新增开启中的迭代 + openData.put("0_lastWeekIteration", openLastWeekIterationCount); //近一周新增 + dataObj.put("open_data", openData); + } + return dataObj; } @Override diff --git a/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProjectSprintMapper.xml b/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProjectSprintMapper.xml index 7aa6a8d1e..58d09ba99 100644 --- a/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProjectSprintMapper.xml +++ b/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProjectSprintMapper.xml @@ -184,4 +184,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by id desc limit 1 + + \ No newline at end of file From 22c5efd140f15d00553dc47fffb8adced11d19d7 Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Tue, 10 Dec 2024 11:05:24 +0800 Subject: [PATCH 03/20] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=9C=80=E6=B1=82=E9=87=8D=E6=9E=84):=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=A7=E5=93=81=E4=B8=AD=E7=9A=84=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E8=A7=84=E6=A0=BC=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 获取需规列表时支持通过多状态查询 Signed-off-by: OTTO <731554297@qq.com> --- .../pms/product/domain/vo/ProductReqSpecsSearchVo.java | 5 ++++- .../service/impl/PmsProductRequirementServiceImpl.java | 3 +++ .../resources/mapper/pms/PmsProductRequirementMapper.xml | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/vo/ProductReqSpecsSearchVo.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/vo/ProductReqSpecsSearchVo.java index d50ab0b22..8b287ed87 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/vo/ProductReqSpecsSearchVo.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/vo/ProductReqSpecsSearchVo.java @@ -36,9 +36,12 @@ public class ProductReqSpecsSearchVo { @ApiModelProperty(value = "关联产品模块ID(传0查询不属于任何模块的需求)") private Long pmsProductModuleId; - @ApiModelProperty(value = "产品需求状态(全部状态请传空)") + @ApiModelProperty(value = "产品需求状态(全部状态请传空)(可通过逗号分割传多个状态)") private String status; + @ApiModelProperty(value = "产品需求状态(数组)", hidden = true) + private String[] statusList; + @ApiModelProperty(value = "产品需求类型") private String type; diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java index c19bd9d74..06dcd9e52 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java @@ -394,6 +394,9 @@ public class PmsProductRequirementServiceImpl implements IPmsProductRequirementS List moduleIdList = pmsProductModuleService.selectChildrenPmsProductModuleIdList(productReqSpecsSearchVo.getPmsProductModuleId()); productReqSpecsSearchVo.setChildrenModuleIdList(moduleIdList); } + if (StringUtils.isNotEmpty(productReqSpecsSearchVo.getStatus())) { + productReqSpecsSearchVo.setStatusList(productReqSpecsSearchVo.getStatus().split(",")); + } startPage(); List userReqList = pmsProductRequirementMapper.selectReqSpecsList(productReqSpecsSearchVo); HashMap hashMap = new HashMap<>(); diff --git a/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductRequirementMapper.xml b/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductRequirementMapper.xml index 7afb4aad4..80876e48c 100644 --- a/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductRequirementMapper.xml +++ b/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductRequirementMapper.xml @@ -204,7 +204,11 @@ and title like concat('%', #{title}, '%') and pms_product_identifier = #{pmsProductIdentifier} - and `status` = #{status} + and `status` in + + #{item} + + and `type` = #{type} From d596005853eb01c07d29cb0aecd044caee863029 Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Tue, 10 Dec 2024 11:41:31 +0800 Subject: [PATCH 04/20] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=9C=80=E6=B1=82=E9=87=8D=E6=9E=84):=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=A7=E5=93=81=E4=B8=AD=E7=9A=84=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E8=A7=84=E6=A0=BC=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 测试用例新增拷贝接口 Signed-off-by: OTTO <731554297@qq.com> --- .../PmsProjectTestcaseController.java | 20 +++++++++++----- .../service/IPmsProjectTestcaseService.java | 4 +++- .../impl/PmsProjectTestcaseServiceImpl.java | 24 ++++++++++++++++++- 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/controller/PmsProjectTestcaseController.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/controller/PmsProjectTestcaseController.java index 7b9bea402..fe9676304 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/controller/PmsProjectTestcaseController.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/controller/PmsProjectTestcaseController.java @@ -11,10 +11,7 @@ import com.microservices.common.security.annotation.Logical; import com.microservices.common.security.annotation.RequiresPermissions; import com.microservices.pms.product.service.IPmsProductModuleService; import com.microservices.pms.project.domain.PmsProjectTestcase; -import com.microservices.pms.project.domain.vo.PmsProjectTestcaseDataVo; -import com.microservices.pms.project.domain.vo.PmsProjectTestcaseInputVo; -import com.microservices.pms.project.domain.vo.PmsProjectTestcaseSearchVo; -import com.microservices.pms.project.domain.vo.PmsProjectTestcaseUpdateVo; +import com.microservices.pms.project.domain.vo.*; import com.microservices.pms.project.service.IPmsProjectTestcaseService; import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; @@ -68,8 +65,8 @@ public class PmsProjectTestcaseController extends BaseController { @RequiresPermissions(value = {"pms:pmsProject:show", "pms:pmsProject:showMe"}, logical = Logical.OR) @GetMapping(value = "/{id}") @ApiOperation(value = "获取测试用例详细信息") - public GenericsAjaxResult getInfo(@PathVariable("id") Long id) { - return genericsSuccess(pmsProjectTestcaseService.selectPmsProjectTestcaseDataVoById(id)); + public GenericsAjaxResult getInfo(@PathVariable("id") Long id) { + return genericsSuccess(pmsProjectTestcaseService.selectPmsProjectTestcaseDetailVoById(id)); } /** @@ -83,6 +80,17 @@ public class PmsProjectTestcaseController extends BaseController { return success(pmsProjectTestcaseService.insertPmsProjectTestcase(pmsProjectTestcaseInputVo.toPmsProjectTestcase())); } + /** + * 复制测试用例 + */ + @RequiresPermissions("pms:pmsProjectTestcase:add") + @Log(title = "测试用例管理", businessType = BusinessType.INSERT) + @PostMapping("{testcaseId}/copy") + @ApiOperation(value = "复制测试用例") + public AjaxResult copy(@PathVariable("testcaseId") Long testcaseId) { + return success(pmsProjectTestcaseService.copyPmsProjectTestcase(testcaseId)); + } + /** * 修改测试用例管理 */ diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/IPmsProjectTestcaseService.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/IPmsProjectTestcaseService.java index 06b701240..052fca224 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/IPmsProjectTestcaseService.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/IPmsProjectTestcaseService.java @@ -78,7 +78,7 @@ public interface IPmsProjectTestcaseService { * @param id 测试用例ID * @return 测试用例详情 */ - PmsProjectTestcaseDataVo selectPmsProjectTestcaseDataVoById(Long id); + PmsProjectTestcaseDetailVo selectPmsProjectTestcaseDetailVoById(Long id); /** * 根据模块ID删除测试用例与模块的关联关系 @@ -116,4 +116,6 @@ public interface IPmsProjectTestcaseService { List selectPmsProjectTestcaseList(PmsProjectTestcase pmsProjectTestcaseSearch); List selectReqSpecsAssociatedTestcaseList(Long reqSpecsId); + + PmsProjectTestcase copyPmsProjectTestcase(Long testcaseId); } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectTestcaseServiceImpl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectTestcaseServiceImpl.java index 8e48da3da..f1ebeb69f 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectTestcaseServiceImpl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectTestcaseServiceImpl.java @@ -22,6 +22,7 @@ import com.microservices.pms.project.domain.*; import com.microservices.pms.project.domain.vo.PmsProjectTestcaseBatchUpdateVo; import com.microservices.pms.project.domain.vo.PmsProjectTestcaseDataVo; import com.microservices.pms.project.domain.vo.PmsProjectTestcaseDetailVo; +import com.microservices.pms.project.domain.vo.PmsProjectTestcaseStepDataVo; import com.microservices.pms.project.mapper.PmsProjectTestcaseMapper; import com.microservices.pms.project.mapper.PmsProjectTestsheetCasesMapper; import com.microservices.pms.project.service.IPmsProjectService; @@ -37,6 +38,7 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.stream.Collectors; import static com.microservices.common.core.utils.PageUtils.startPage; @@ -220,6 +222,26 @@ public class PmsProjectTestcaseServiceImpl implements IPmsProjectTestcaseService return reqSpecsTestcaseDataVoList; } + @Override + public PmsProjectTestcase copyPmsProjectTestcase(Long testcaseId) { + PmsProjectTestcase pmsProjectTestcase = selectPmsProjectTestcaseById(testcaseId); + pmsProjectTestcase.setId(null); + pmsProjectTestcase.setTags(pmsProjectTestcase.getTagIds()); + PmsProjectTestcaseStep pmsProjectTestcaseStepSearch = new PmsProjectTestcaseStep(); + pmsProjectTestcaseStepSearch.setPmsTestcaseId(testcaseId); + List selectPmsProjectTestcaseStepList = pmsProjectTestcaseStepService.selectPmsProjectTestcaseStepList(pmsProjectTestcaseStepSearch); + List pmsProjectTestcaseStepList = selectPmsProjectTestcaseStepList.stream() + .map(x -> { + PmsProjectTestcaseStep pmsProjectTestcaseStep = new PmsProjectTestcaseStep(); + BeanUtils.copyProperties(x, pmsProjectTestcaseStep); + pmsProjectTestcaseStep.setId(null); + return pmsProjectTestcaseStep; + }).collect(Collectors.toList()); + pmsProjectTestcase.setTestcaseStepList(pmsProjectTestcaseStepList); + insertPmsProjectTestcase(pmsProjectTestcase); + return pmsProjectTestcase; + } + /** * 新增测试用例管理 * @@ -364,7 +386,7 @@ public class PmsProjectTestcaseServiceImpl implements IPmsProjectTestcaseService } @Override - public PmsProjectTestcaseDataVo selectPmsProjectTestcaseDataVoById(Long id) { + public PmsProjectTestcaseDetailVo selectPmsProjectTestcaseDetailVoById(Long id) { return toPmsProjectTestcaseDetailVo(selectPmsProjectTestcaseById(id)); } From c7cc7a911177c7a5b4f559199a5320ac30a696f8 Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Tue, 10 Dec 2024 14:22:28 +0800 Subject: [PATCH 05/20] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=9C=80=E6=B1=82=E9=87=8D=E6=9E=84):=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=A7=E5=93=81=E4=B8=AD=E7=9A=84=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E8=A7=84=E6=A0=BC=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复附件无法下载的问题 Signed-off-by: OTTO <731554297@qq.com> --- .../microservices/file/service/impl/SysFileInfoServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microservices-modules/microservices-modules-file/src/main/java/com/microservices/file/service/impl/SysFileInfoServiceImpl.java b/microservices-modules/microservices-modules-file/src/main/java/com/microservices/file/service/impl/SysFileInfoServiceImpl.java index 25404a085..8df0a8ed0 100644 --- a/microservices-modules/microservices-modules-file/src/main/java/com/microservices/file/service/impl/SysFileInfoServiceImpl.java +++ b/microservices-modules/microservices-modules-file/src/main/java/com/microservices/file/service/impl/SysFileInfoServiceImpl.java @@ -263,7 +263,7 @@ public class SysFileInfoServiceImpl implements ISysFileInfoService { @Override public void fileDownloadByIdentifier(String fileIdentifier, HttpServletResponse response, HttpServletRequest request) { SysFileInfo sysFileInfo = selectSysFileInfoByFileIdentifier(fileIdentifier); - if (StringUtils.isEmpty(sysFileInfo.getFilePath()) || !sysFileInfo.getFilePath().contains("/zone-identifier")) { + if (StringUtils.isEmpty(sysFileInfo.getFilePath())) { throw new ServiceException("当前文件无法下载"); } fileDownload(sysFileInfo, response); From 63c5fc1b7f03d26c564e72ff515464d2ccc432b0 Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Tue, 10 Dec 2024 14:36:53 +0800 Subject: [PATCH 06/20] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=9C=80=E6=B1=82=E9=87=8D=E6=9E=84):=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=A7=E5=93=81=E4=B8=AD=E7=9A=84=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E8=A7=84=E6=A0=BC=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复待评审的需规查询不到变更记录的bug Signed-off-by: OTTO <731554297@qq.com> --- .../impl/PmsProductReqOperationRecordServiceImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductReqOperationRecordServiceImpl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductReqOperationRecordServiceImpl.java index 8dc6edb0a..bd8c2758d 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductReqOperationRecordServiceImpl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductReqOperationRecordServiceImpl.java @@ -132,10 +132,14 @@ public class PmsProductReqOperationRecordServiceImpl implements IPmsProductReqOp // 根据需求规格id和fromId查询需求规格相关的所有需求规格相关的变更记录列表 PmsProductReqOperationRecord recordSearch = new PmsProductReqOperationRecord(); List recordList = new ArrayList<>(); - while (reqSpecs.getFromId() != null && !ProductReqStatus.isUserReqStatus(reqSpecs.getStatus())) { + while (reqSpecs != null && !ProductReqStatus.isUserReqStatus(reqSpecs.getStatus())) { recordSearch.setProductRequirementId(reqSpecs.getId()); recordList.addAll(pmsProductReqOperationRecordMapper.selectPmsProductReqOperationRecordList(recordSearch)); - reqSpecs = pmsProductRequirementService.selectPmsProductRequirementById(reqSpecs.getFromId(), false); + if (reqSpecs.getFromId() != null) { + reqSpecs = pmsProductRequirementService.selectPmsProductRequirementById(reqSpecs.getFromId(), false); + } else { + reqSpecs = null; + } } return getRecordDataList(recordList); From 4cca1bf20564369f78c36896a8baab7d644df592 Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Tue, 10 Dec 2024 15:18:11 +0800 Subject: [PATCH 07/20] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=9C=80=E6=B1=82=E9=87=8D=E6=9E=84):=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=A7=E5=93=81=E4=B8=AD=E7=9A=84=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E8=A7=84=E6=A0=BC=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 需规纳入计划时计划状态需设置为进行中 Signed-off-by: OTTO <731554297@qq.com> --- .../product/domain/vo/ProductReqSpecsActivePlanVo.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/vo/ProductReqSpecsActivePlanVo.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/vo/ProductReqSpecsActivePlanVo.java index 255fe82d2..fb924449f 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/vo/ProductReqSpecsActivePlanVo.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/vo/ProductReqSpecsActivePlanVo.java @@ -1,9 +1,12 @@ package com.microservices.pms.product.domain.vo; +import com.microservices.pms.enums.ProjectIssuePriority; +import com.microservices.pms.enums.ProjectIssueStatus; import com.microservices.pms.product.domain.PmsProductReqOperationRecord; import com.microservices.pms.product.domain.PmsProductRequirement; import com.microservices.pms.product.domain.enums.ProductReqOperationType; import com.microservices.pms.project.domain.vo.PmsProjectIssuesInputVo; +import com.microservices.pms.utils.PmsConstants; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -32,9 +35,9 @@ public class ProductReqSpecsActivePlanVo { PmsProjectIssuesInputVo issue = new PmsProjectIssuesInputVo(); issue.setSubject(reqSpecs.getTitle()); issue.setPmProjectId(projectId); - issue.setStatusId(1); - issue.setPmIssueType(1); - issue.setPriorityId(2); + issue.setStatusId(ProjectIssueStatus.RESOLVING.getId()); + issue.setPmIssueType(Integer.valueOf(PmsConstants.PROJECT_ISSUE_TYPE_REQUIREMENT)); + issue.setPriorityId(ProjectIssuePriority.NORMAL.getId()); issue.setDescription(reqSpecs.getContent()); issue.setAttachmentIds(forgeFileIdentifierList); return issue; From 464ce4e2866529eeb19fb1e68af27d1275aeb480 Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Tue, 10 Dec 2024 17:26:30 +0800 Subject: [PATCH 08/20] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=9C=80=E6=B1=82=E9=87=8D=E6=9E=84):=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=9C=80=E8=A7=84=E5=AF=B9=E5=BA=94=E7=9A=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AE=A1=E5=88=92=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 项目计划仅能基于产品需求规格创建 2. 项目计划不允许编辑标题、正文和附件 3. 项目计划状态值仅能为进行中、已完成、已关闭 4. 如果状态发生变更,需同步产品需规的状态变更: - 项目计划修改为进行中将需规调整为已计划 - 项目计划修改为已完成或已关闭将需规调整为已完成 - 限制需求规格变更中,项目计划不能调整为已完成或已关闭状态 Signed-off-by: OTTO <731554297@qq.com> --- .../mapper/PmsProductRequirementMapper.java | 2 + .../IPmsProductRequirementService.java | 3 + .../PmsProductRequirementServiceImpl.java | 18 ++++ .../PmsProjectIssuesController.java | 91 ++++++++----------- .../domain/vo/PmsProjectIssuesInputVo.java | 12 +++ .../service/PmsProjectIssuesService.java | 38 ++++++++ .../pms/PmsProductRequirementMapper.xml | 6 ++ 7 files changed, 116 insertions(+), 54 deletions(-) diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/mapper/PmsProductRequirementMapper.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/mapper/PmsProductRequirementMapper.java index 4e30160ae..d102369a6 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/mapper/PmsProductRequirementMapper.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/mapper/PmsProductRequirementMapper.java @@ -110,4 +110,6 @@ public interface PmsProductRequirementMapper List selectReqSpecsList(ProductReqSpecsSearchVo productReqSpecsSearchVo); Integer selectReqSpecsCountByIdentifier(@Param("identifier") String identifier); + + PmsProductRequirement selectReqSpecsByProjectReqId(@Param("projectReqId") Long projectReqId); } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/IPmsProductRequirementService.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/IPmsProductRequirementService.java index c92053682..4c5d17f7b 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/IPmsProductRequirementService.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/IPmsProductRequirementService.java @@ -3,6 +3,7 @@ package com.microservices.pms.product.service; import com.alibaba.fastjson2.JSONObject; import com.microservices.common.core.web.page.GenericsTableDataInfo; import com.microservices.pms.product.domain.PmsProductRequirement; +import com.microservices.pms.product.domain.enums.ProductReqStatus; import com.microservices.pms.product.domain.vo.*; import java.util.List; @@ -125,4 +126,6 @@ public interface IPmsProductRequirementService List selectReqSpecsTypeList(); JSONObject selectReqSpecsAssociatedPlanData(Long reqSpecsId); + + void updateReqSpecsStatusByProjectReqId(Long projectReqId, ProductReqStatus productReqStatus); } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java index 06dcd9e52..95396163a 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java @@ -585,6 +585,24 @@ public class PmsProductRequirementServiceImpl implements IPmsProductRequirementS ); } + @Override + public void updateReqSpecsStatusByProjectReqId(Long projectReqId, ProductReqStatus productReqStatus) { + PmsProductRequirement pmsProductRequirement = pmsProductRequirementMapper.selectReqSpecsByProjectReqId(projectReqId); + if (pmsProductRequirement == null) { + throw new ServiceException("项目计划关联的需求规格不存在"); + } + if (productReqStatus.getKey().equals(pmsProductRequirement.getStatus())) { + return; + } + if (ProductReqStatus.COMPLETED_REQ_SPECS.getKey().equals(productReqStatus.getKey())) { + if (ProductReqStatus.CHANGING_REQ_SPECS.getKey().equals(pmsProductRequirement.getStatus())) { + throw new ServiceException("需求规格变更中,项目计划不能调整为已完成或已关闭状态"); + } + } + pmsProductRequirement.setStatus(productReqStatus.getKey()); + updateRequirement(pmsProductRequirement, pmsProductRequirement.getPmsProductIdentifier()); + } + private ProductReqSpecsDetailVo toProductReqSpecsDetailVo(PmsProductRequirement pmsProductRequirement) { ProductReqSpecsDataVo productReqSpecsDataVo = toProductReqSpecsDataVo(pmsProductRequirement, null); ProductReqSpecsDetailVo productReqSpecsDetailVo = productReqSpecsDataVo.toProductReqSpecsDetailVo(); diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/controller/PmsProjectIssuesController.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/controller/PmsProjectIssuesController.java index 61ec32a12..c7aac46a6 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/controller/PmsProjectIssuesController.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/controller/PmsProjectIssuesController.java @@ -2,6 +2,7 @@ package com.microservices.pms.project.controller; import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; +import com.microservices.common.core.exception.ServiceException; import com.microservices.common.core.web.controller.BaseController; import com.microservices.common.core.web.domain.AjaxResult; import com.microservices.common.core.web.page.GenericsTableDataInfo; @@ -10,6 +11,7 @@ import com.microservices.common.security.annotation.RequiresPermissions; import com.microservices.pms.project.domain.vo.*; import com.microservices.pms.project.service.IPmsProjectTestsheetIssuesService; import com.microservices.pms.project.service.PmsProjectIssuesService; +import com.microservices.pms.utils.PmsConstants; import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -30,7 +32,7 @@ import javax.servlet.http.HttpServletResponse; @ApiImplicitParams({ @ApiImplicitParam(name = "enterpriseIdentifier", value = "企业标识", paramType = "path", dataType = "String") }) -public class PmsProjectIssuesController extends BaseController { +public class PmsProjectIssuesController extends BaseController { @Autowired private PmsProjectIssuesService pmsProjectIssuesService; @@ -44,8 +46,7 @@ public class PmsProjectIssuesController extends BaseController { @RequiresPermissions(value = {"pms:pmsProject:show", "pms:pmsProject:showMe", "pms:pmsProjectTestsheet:edit"}, logical = Logical.OR) @GetMapping("/list") @ApiOperation(value = "项目工作项列表") - public AjaxResult list(PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo) - { + public AjaxResult list(PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo) { JSONObject result = pmsProjectIssuesService.selectPmsProjectIssuesList(pmsProjectIssuesSearchVo); return success(result); } @@ -56,8 +57,11 @@ public class PmsProjectIssuesController extends BaseController { @RequiresPermissions("pms:pmsProjectIssues:add") @PostMapping("/add") @ApiOperation(value = "新增项目工作项") - public AjaxResult add(@RequestBody PmsProjectIssuesInputVo pmsProjectIssuesInputVo) - { + public AjaxResult add(@RequestBody PmsProjectIssuesInputVo pmsProjectIssuesInputVo) { + if (PmsConstants.PROJECT_ISSUE_TYPE_REQUIREMENT.equals(String.valueOf(pmsProjectIssuesInputVo.getPmIssueType())) + && pmsProjectIssuesInputVo.getRootId() == null) { + throw new ServiceException("项目计划仅能基于产品需求规格创建"); + } JSONObject result = pmsProjectIssuesService.insertPmsProjectIssues(pmsProjectIssuesInputVo); return success(result); } @@ -68,8 +72,7 @@ public class PmsProjectIssuesController extends BaseController { @RequiresPermissions("pms:pmsProjectIssues:edit") @PostMapping("/edit/{id}") @ApiOperation(value = "编辑项目工作项") - public AjaxResult edit(@PathVariable("id") Long id, @RequestBody PmsProjectIssuesInputVo pmsProjectIssuesInputVo) - { + public AjaxResult edit(@PathVariable("id") Long id, @RequestBody PmsProjectIssuesInputVo pmsProjectIssuesInputVo) { JSONObject result = pmsProjectIssuesService.updatePmsProjectIssues(id, pmsProjectIssuesInputVo); return success(result); } @@ -80,10 +83,8 @@ public class PmsProjectIssuesController extends BaseController { @RequiresPermissions("pms:pmsProjectIssues:edit") @PutMapping("/edit/batch") @ApiOperation(value = "批量修改项目工作项") - public AjaxResult batchUpdate(@ApiParam( "项目Id") @RequestParam(name= "pmProjectId") Long pmProjectId, - @RequestBody PmsProjectIssuesBatchUpdateVo pmsProjectIssuesUpdateVo) - { - + public AjaxResult batchUpdate(@ApiParam("项目Id") @RequestParam(name = "pmProjectId") Long pmProjectId, + @RequestBody PmsProjectIssuesBatchUpdateVo pmsProjectIssuesUpdateVo) { JSONObject result = pmsProjectIssuesService.batchUpdatePmsProjectIssues(pmProjectId, pmsProjectIssuesUpdateVo); return success(result); } @@ -93,8 +94,7 @@ public class PmsProjectIssuesController extends BaseController { */ @RequiresPermissions(value = {"pms:pmsProject:show", "pms:pmsProject:showMe"}, logical = Logical.OR) @GetMapping("/{id}") - public AjaxResult query(@PathVariable("id") Long id, @ApiParam( "项目Id")@RequestParam(name = "pmProjectId") Long pmProjectId) - { + public AjaxResult query(@PathVariable("id") Long id, @ApiParam("项目Id") @RequestParam(name = "pmProjectId") Long pmProjectId) { JSONObject result = pmsProjectIssuesService.selectPmsProjectIssueById(id, pmProjectId); return success(result); @@ -105,9 +105,7 @@ public class PmsProjectIssuesController extends BaseController { */ @RequiresPermissions("pms:pmsProjectIssues:remove") @DeleteMapping("/{ids}") - public AjaxResult remove(@ApiParam( "工作项id数组,为-1时删除全部")@PathVariable Long[] ids, @ApiParam( "项目Id")@RequestParam(name = "pmProjectId") Long pmProjectId) - { - + public AjaxResult remove(@ApiParam("工作项id数组,为-1时删除全部") @PathVariable Long[] ids, @ApiParam("项目Id") @RequestParam(name = "pmProjectId") Long pmProjectId) { JSONObject result = pmsProjectIssuesService.deletePmsProjectIssueByIds(ids, pmProjectId); return success(result); } @@ -118,8 +116,7 @@ public class PmsProjectIssuesController extends BaseController { @RequiresPermissions(value = {"pms:pmsProject:show", "pms:pmsProject:showMe"}, logical = Logical.OR) @GetMapping("/issueStatus") @ApiOperation(value = "查询项目工作项状态列表") - public AjaxResult issueStatus() - { + public AjaxResult issueStatus() { JSONObject result = pmsProjectIssuesService.selectPmsProjectIssueStatus(); return success(result); @@ -131,8 +128,7 @@ public class PmsProjectIssuesController extends BaseController { @RequiresPermissions(value = {"pms:pmsProject:show", "pms:pmsProject:showMe"}, logical = Logical.OR) @GetMapping("/issuePriorities") @ApiOperation(value = "查询项目工作项优先级列表") - public AjaxResult issuePriorities() - { + public AjaxResult issuePriorities() { JSONObject result = pmsProjectIssuesService.selectPmsProjectIssuePriorities(); return success(result); @@ -145,8 +141,7 @@ public class PmsProjectIssuesController extends BaseController { @GetMapping("/issueTags") @ApiOperation(value = "查询初始的项目工作项标记列表") public AjaxResult issueTags(@ApiParam(name = "pmProjectId", value = "项目Id") Long pmProjectId, - @ApiParam(name = "repositoryId", value = "仓库") Long repositoryId) - { + @ApiParam(name = "repositoryId", value = "仓库") Long repositoryId) { JSONObject result = pmsProjectIssuesService.selectPmsProjectIssueTags(pmProjectId, repositoryId); return success(result); @@ -158,8 +153,7 @@ public class PmsProjectIssuesController extends BaseController { @RequiresPermissions(value = {"pms:pmsProject:show", "pms:pmsProject:showMe", "pms:pmsProjectIssuesTag:manage"}, logical = Logical.OR) @GetMapping("/enterpriseIssueTags") @ApiOperation(value = "查询企业下项目工作项标记列表") - public AjaxResult getEnterpriseIssueTags(PmsEnterpriseIssueTagsSearchVo pmsEnterpriseIssueTagsSearchVo) - { + public AjaxResult getEnterpriseIssueTags(PmsEnterpriseIssueTagsSearchVo pmsEnterpriseIssueTagsSearchVo) { JSONObject result = pmsProjectIssuesService.selectPmsEnterpriseIssueTags(pmsEnterpriseIssueTagsSearchVo); return success(result); @@ -171,8 +165,7 @@ public class PmsProjectIssuesController extends BaseController { @RequiresPermissions("pms:pmsProjectIssuesTag:manage") @PostMapping("/enterpriseIssueTags") @ApiOperation(value = "创建企业下项目工作项标记") - public AjaxResult createEnterpriseIssueTag(@RequestBody PmsEnterpriseIssueTagInputVo pmsEnterpriseIssueTagInputVo) - { + public AjaxResult createEnterpriseIssueTag(@RequestBody PmsEnterpriseIssueTagInputVo pmsEnterpriseIssueTagInputVo) { JSONObject result = pmsProjectIssuesService.createPmsEnterpriseIssueTag(pmsEnterpriseIssueTagInputVo); return success(result); @@ -184,8 +177,7 @@ public class PmsProjectIssuesController extends BaseController { @RequiresPermissions("pms:pmsProjectIssuesTag:manage") @PutMapping("/enterpriseIssueTags/{tagId}") @ApiOperation(value = "更新企业下项目工作项标记") - public AjaxResult editEnterpriseIssueTag(@PathVariable("tagId") Long tagId, @RequestBody PmsEnterpriseIssueTagUpdateVo pmsEnterpriseIssueTagUpdateVo) - { + public AjaxResult editEnterpriseIssueTag(@PathVariable("tagId") Long tagId, @RequestBody PmsEnterpriseIssueTagUpdateVo pmsEnterpriseIssueTagUpdateVo) { JSONObject result = pmsProjectIssuesService.editPmsEnterpriseIssueTag(tagId, pmsEnterpriseIssueTagUpdateVo); return success(result); @@ -197,8 +189,7 @@ public class PmsProjectIssuesController extends BaseController { @RequiresPermissions("pms:pmsProjectIssuesTag:manage") @DeleteMapping("/enterpriseIssueTags/{tagId}") @ApiOperation(value = "删除企业下项目工作项标记") - public AjaxResult deleteEnterpriseIssueTag(@PathVariable("tagId") Long tagId) - { + public AjaxResult deleteEnterpriseIssueTag(@PathVariable("tagId") Long tagId) { JSONObject result = pmsProjectIssuesService.deletePmsEnterpriseIssueTag(tagId); return success(result); @@ -210,8 +201,7 @@ public class PmsProjectIssuesController extends BaseController { @RequiresPermissions(value = {"pms:pmsProject:show", "pms:pmsProject:showMe"}, logical = Logical.OR) @GetMapping("{repositoryId}/repoBranches") @ApiOperation(value = "查询仓库下分支列表") - public AjaxResult repoBranches(@PathVariable Long repositoryId) - { + public AjaxResult repoBranches(@PathVariable Long repositoryId) { JSONArray result = pmsProjectIssuesService.selectPmsProjectRepoBranches(repositoryId); return success(result); @@ -223,8 +213,7 @@ public class PmsProjectIssuesController extends BaseController { @RequiresPermissions(value = {"pms:pmsProjectIssues:edit", "pms:pmsProjectIssues:add"}, logical = Logical.OR) @PostMapping("/attachments") @ApiOperation(value = "上传工作项中的附件") - public AjaxResult uploadAttachments(@RequestPart("file") MultipartFile file) - { + public AjaxResult uploadAttachments(@RequestPart("file") MultipartFile file) { JSONObject result = pmsProjectIssuesService.uploadAttachment(file); return success(result); } @@ -235,8 +224,7 @@ public class PmsProjectIssuesController extends BaseController { @RequiresPermissions(value = {"pms:pmsProjectIssues:edit", "pms:pmsProjectIssues:add", "pms:pmsProjectIssues:remove"}, logical = Logical.OR) @DeleteMapping("/attachments/{id}") @ApiOperation(value = "删除工作项中的附件") - public AjaxResult deleteAttachments(@PathVariable Long id) - { + public AjaxResult deleteAttachments(@PathVariable Long id) { JSONObject result = pmsProjectIssuesService.deleteAttachment(id); return success(result); @@ -249,8 +237,7 @@ public class PmsProjectIssuesController extends BaseController { @PostMapping("/link/{issueId}") @ApiOperation(value = "添加项目工作项关联") public AjaxResult addIssueLinks(@ApiParam("工作项id") @PathVariable Long issueId, - @RequestBody PmsProjectIssuesLinkVo pmsProjectIssuesLinkVo) - { + @RequestBody PmsProjectIssuesLinkVo pmsProjectIssuesLinkVo) { JSONObject result = pmsProjectIssuesService.addPmsProjectIssueLink(issueId, pmsProjectIssuesLinkVo); return success(result); @@ -263,8 +250,7 @@ public class PmsProjectIssuesController extends BaseController { @GetMapping("/link/{issueId}") @ApiOperation(value = "查看项目工作项关联") public AjaxResult getIssueLinks(@ApiParam("工作项id") @PathVariable Long issueId, - @ApiParam( "项目Id")@RequestParam(name = "pmProjectId") Long pmProjectId) - { + @ApiParam("项目Id") @RequestParam(name = "pmProjectId") Long pmProjectId) { JSONObject result = pmsProjectIssuesService.getPmsProjectIssueLink(issueId, pmProjectId); return success(result); @@ -294,12 +280,12 @@ public class PmsProjectIssuesController extends BaseController { @GetMapping("/optionalParentIssue/{issueId}") @ApiOperation(value = "可选择的父工作项列表") public AjaxResult getOptionalParentIssueList( - @ApiParam("页码") Integer pageNum, - @ApiParam("页数") Integer pageSize, - @ApiParam("工作项id") @PathVariable Long issueId, - @ApiParam("需求1 任务2 缺陷3") @RequestParam(name = "pmIssueType") String pmIssueType, - @ApiParam("项目id") @RequestParam(name = "pmProjectId") String pmProjectId, - @ApiParam("搜索关键词") @RequestParam(name = "keyword", required = false) String keyword + @ApiParam("页码") Integer pageNum, + @ApiParam("页数") Integer pageSize, + @ApiParam("工作项id") @PathVariable Long issueId, + @ApiParam("需求1 任务2 缺陷3") @RequestParam(name = "pmIssueType") String pmIssueType, + @ApiParam("项目id") @RequestParam(name = "pmProjectId") String pmProjectId, + @ApiParam("搜索关键词") @RequestParam(name = "keyword", required = false) String keyword ) { @@ -315,8 +301,7 @@ public class PmsProjectIssuesController extends BaseController { @ApiOperation(value = "删除项目工作项关联") public AjaxResult removeIssueLinks(@ApiParam("当前工作项id") @PathVariable Long issueId, @ApiParam("关联工作项id") @PathVariable String linkIssueId, - @ApiParam( "项目Id")@RequestParam(name = "pmProjectId") Long pmProjectId) - { + @ApiParam("项目Id") @RequestParam(name = "pmProjectId") Long pmProjectId) { JSONObject result = pmsProjectIssuesService.deletePmsProjectIssueLink(issueId, linkIssueId, pmProjectId); return success(result); @@ -328,8 +313,7 @@ public class PmsProjectIssuesController extends BaseController { @PostMapping("/journals/{issueId}") @ApiOperation(value = "新增工作项评论") public AjaxResult addJournals(@ApiParam("工作项id") @PathVariable Long issueId, - @RequestBody PmsProjectIssueJournalInputVo pmsProjectIssueJournalInputVo) - { + @RequestBody PmsProjectIssueJournalInputVo pmsProjectIssueJournalInputVo) { JSONObject result = pmsProjectIssuesService.addPmsProjectIssueJournals(issueId, pmsProjectIssueJournalInputVo); return success(result); } @@ -341,10 +325,9 @@ public class PmsProjectIssuesController extends BaseController { @ApiOperation(value = "删除工作项评论") public AjaxResult removeJournals(@ApiParam("工作项id") @PathVariable Long issueId, @ApiParam("评论id") @PathVariable Long journalId, - @ApiParam( "项目Id")@RequestParam(name = "pmProjectId") Long pmProjectId, - @ApiParam( "工作项关联的仓库id")@RequestParam(name = "pmProjectRepositoryId", required = false) Long pmProjectRepositoryId - ) - { + @ApiParam("项目Id") @RequestParam(name = "pmProjectId") Long pmProjectId, + @ApiParam("工作项关联的仓库id") @RequestParam(name = "pmProjectRepositoryId", required = false) Long pmProjectRepositoryId + ) { JSONObject result = pmsProjectIssuesService.removePmsProjectIssueJournals(issueId, journalId, pmProjectId, pmProjectRepositoryId); return success(result); } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectIssuesInputVo.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectIssuesInputVo.java index 1ccf17954..e77fa6172 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectIssuesInputVo.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectIssuesInputVo.java @@ -1,5 +1,7 @@ package com.microservices.pms.project.domain.vo; +import com.alibaba.fastjson2.JSONObject; +import com.microservices.common.core.utils.StringUtils; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -70,4 +72,14 @@ public class PmsProjectIssuesInputVo { @ApiModelProperty(value = "关联工作项id") private Long linkAbleId; + + public boolean isChangeContent(JSONObject issueJson) { + if (StringUtils.isNotEmpty(subject) && !issueJson.getString("subject").equals(subject)) { + return true; + } + if (StringUtils.isNotEmpty(description) && !issueJson.getString("description").equals(description)) { + return true; + } + return attachmentIds != null; + } } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/PmsProjectIssuesService.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/PmsProjectIssuesService.java index 1927c29f0..203dcce95 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/PmsProjectIssuesService.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/PmsProjectIssuesService.java @@ -9,6 +9,9 @@ import com.microservices.common.security.utils.SecurityUtils; import com.microservices.pms.common.service.IPmsCommonService; import com.microservices.pms.enterprise.domain.PmsEnterprise; import com.microservices.pms.enterprise.service.IPmsEnterpriseService; +import com.microservices.pms.enums.ProjectIssueStatus; +import com.microservices.pms.product.domain.enums.ProductReqStatus; +import com.microservices.pms.product.service.IPmsProductRequirementService; import com.microservices.pms.project.domain.PmsProject; import com.microservices.pms.project.domain.SimpleRepository; import com.microservices.pms.project.domain.vo.*; @@ -23,6 +26,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; @@ -53,6 +57,10 @@ public class PmsProjectIssuesService { @Lazy private IPmsProjectService pmsProjectService; + @Autowired + @Lazy + private IPmsProductRequirementService pmsProductRequirementService; + @Autowired @Lazy private IPmsProjectTestsheetIssuesService pmsProjectTestsheetIssuesService; @@ -95,6 +103,7 @@ public class PmsProjectIssuesService { return gitLinkRequestHelper.doPost(PmsGitLinkRequestUrl.CREATE_ISSUE(), issueInput); } + @Transactional(rollbackFor = Exception.class) public JSONObject updatePmsProjectIssues(Long id, PmsProjectIssuesInputVo pmsProjectIssuesInputVo) { pmsProjectService.selectAndCheckPmsProjectById(pmsProjectIssuesInputVo.getPmProjectId()); JSONObject updatedIssue; @@ -102,6 +111,35 @@ public class PmsProjectIssuesService { updatedIssue = gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_ISSUE(id, pmsProjectIssuesInputVo.getPmProjectId())); } catch (URISyntaxException e) { throw new RuntimeException(e); + } + // 项目计划不允许编辑标题、正文和附件 + if (PmsConstants.PROJECT_ISSUE_TYPE_REQUIREMENT.equals(updatedIssue.getString("pm_issue_type")) + && updatedIssue.getString("root_id") == null) { + if (pmsProjectIssuesInputVo.isChangeContent(updatedIssue)) { + throw new ServiceException("项目计划不允许编辑标题、正文和附件"); + } + if (ProjectIssueStatus.REFUSE.getId().equals(pmsProjectIssuesInputVo.getStatusId()) + || ProjectIssueStatus.NEW.getId().equals(pmsProjectIssuesInputVo.getStatusId())) { + throw new ServiceException("项目计划状态值选择错误"); + } + + // 如果状态发生变更,需同步产品需规的状态变更 + if (pmsProjectIssuesInputVo.getStatusId() != null) { + JSONObject statusJson = updatedIssue.getJSONObject("status"); + if (!statusJson.getString("id").equals(String.valueOf(pmsProjectIssuesInputVo.getStatusId()))) { + // 项目计划修改为进行中将需规调整为已计划 + if (ProjectIssueStatus.RESOLVING.getId().equals(pmsProjectIssuesInputVo.getStatusId())) { + pmsProductRequirementService.updateReqSpecsStatusByProjectReqId(id, ProductReqStatus.PLANNED_REQ_SPECS); + } + // 项目计划修改为已完成或已关闭将需规调整为已完成 + if (ProjectIssueStatus.RESOLVED.getId().equals(pmsProjectIssuesInputVo.getStatusId()) + || ProjectIssueStatus.CLOSE.getId().equals(pmsProjectIssuesInputVo.getStatusId())) { + pmsProductRequirementService.updateReqSpecsStatusByProjectReqId(id, ProductReqStatus.COMPLETED_REQ_SPECS); + } + } + } + + } if (PmsConstants.PROJECT_ISSUE_TYPE_WEEKLY_REPORT.equals(updatedIssue.getString("pm_issue_type")) && updatedIssue.getString("root_id") != null diff --git a/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductRequirementMapper.xml b/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductRequirementMapper.xml index 80876e48c..d911cef96 100644 --- a/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductRequirementMapper.xml +++ b/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductRequirementMapper.xml @@ -237,6 +237,12 @@ from pms_product_requirement where identifier = #{identifier} + From 413c11d98ce1778420585ca9a736914a833733b1 Mon Sep 17 00:00:00 2001 From: wanjia <553039491@qq.com> Date: Wed, 11 Dec 2024 10:07:00 +0800 Subject: [PATCH 09/20] =?UTF-8?q?feat(=E7=BB=84=E7=BB=87=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=8F=B0):=E6=88=91=E7=9A=84=E5=B7=A5=E4=BD=9C=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/controller/PmsDashboardController.java | 4 +--- .../dashboard/domain/vo/MyProjectIssuesSearchVo.java | 3 +++ .../pms/project/service/PmsProjectIssuesService.java | 11 +++++++++++ .../microservices/pms/utils/PmsGitLinkRequestUrl.java | 5 +++++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/controller/PmsDashboardController.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/controller/PmsDashboardController.java index 38debc5d0..6deb18dd6 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/controller/PmsDashboardController.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/controller/PmsDashboardController.java @@ -92,9 +92,7 @@ public class PmsDashboardController extends BaseController { return success(); } pmsProjectIssuesSearchVo.setPmProjectIds(StringUtils.join(projectList.stream().map(PmsProject::getId).toArray(), ",")); - // 不包含周报 - pmsProjectIssuesSearchVo.setPmIssueTypes("1,2,3"); - JSONObject result = pmsProjectIssuesService.selectPmsProjectIssuesList(pmsProjectIssuesSearchVo); + JSONObject result = pmsProjectIssuesService.selectMyPmsProjectIssuesList(pmsProjectIssuesSearchVo); return success(result); } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/domain/vo/MyProjectIssuesSearchVo.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/domain/vo/MyProjectIssuesSearchVo.java index 428ea9960..a512b4c3a 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/domain/vo/MyProjectIssuesSearchVo.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/domain/vo/MyProjectIssuesSearchVo.java @@ -32,4 +32,7 @@ public class MyProjectIssuesSearchVo { @ApiModelProperty(value = "按pmProjectId集合查询,逗号隔开", hidden = true) private String pmsProjectIds; + @ApiModelProperty(value = "工作项类型:计划1 任务2 缺陷3,多个用逗号隔开") + private String pmIssueTypes; + } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/PmsProjectIssuesService.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/PmsProjectIssuesService.java index 1927c29f0..2cfd73b15 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/PmsProjectIssuesService.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/PmsProjectIssuesService.java @@ -493,4 +493,15 @@ public class PmsProjectIssuesService { throw new ServiceException("导出工作项失败"); } } + + public JSONObject selectMyPmsProjectIssuesList(PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo) { + pmsProjectService.selectAndCheckPmsProjectById(pmsProjectIssuesSearchVo.getPmProjectId()); + JSONObject issueSearch = new JSONObject(); + convertObjectToJSONObject(pmsProjectIssuesSearchVo, issueSearch, null); + try { + return setProjectIssueListUserState(gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_MY_ISSUE_LIST(issueSearch))); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } + } } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/utils/PmsGitLinkRequestUrl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/utils/PmsGitLinkRequestUrl.java index 6031771e2..3778ef410 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/utils/PmsGitLinkRequestUrl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/utils/PmsGitLinkRequestUrl.java @@ -366,4 +366,9 @@ public class PmsGitLinkRequestUrl extends GitLinkRequestUrl { public static GitLinkRequestUrl GET_REQ_SPECS_LINK_ISSUES(Long reqSpecsIssueId, Long projectId) { return getGitLinkRequestUrl(String.format("/api/pm/issues/%d/link_issues?pm_project_id=%d", reqSpecsIssueId, projectId)); } + + public static GitLinkRequestUrl GET_MY_ISSUE_LIST(JSONObject params) throws URISyntaxException { + return getGitLinkRequestUrl( + buildUri("/api/pm/dashboards/my_issues", params)); + } } From 8ae43e5dc2eede04f0ce3eab66d2735b3ba06f12 Mon Sep 17 00:00:00 2001 From: wanjia <553039491@qq.com> Date: Wed, 11 Dec 2024 14:45:11 +0800 Subject: [PATCH 10/20] =?UTF-8?q?feat(=E7=BB=84=E7=BB=87=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=8F=B0):=E6=88=91=E7=9A=84=E9=A1=B9=E7=9B=AE=E3=80=81?= =?UTF-8?q?=E6=88=91=E7=9A=84=E4=BB=93=E5=BA=93=E3=80=81=E6=88=91=E7=9A=84?= =?UTF-8?q?=E5=BE=85=E5=8A=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PmsDashboardController.java | 51 ++++++++++++++----- .../domain/vo/MyProjectIssuesSearchVo.java | 8 +-- .../vo/MyTodoProjectIssuesSearchVo.java | 35 +++++++++++++ .../vo/PmsProjectSprintStatisticsVo.java | 17 +++++++ .../mapper/PmsProjectSprintMapper.java | 3 ++ .../project/service/IPmsProjectService.java | 6 +++ .../service/PmsProjectIssuesService.java | 18 +++++-- .../service/impl/PmsProjectServiceImpl.java | 25 +++++++++ .../pms/utils/PmsGitLinkRequestUrl.java | 15 ++++++ .../mapper/pms/PmsProjectSprintMapper.xml | 24 +++++++++ 10 files changed, 183 insertions(+), 19 deletions(-) create mode 100644 microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/domain/vo/MyTodoProjectIssuesSearchVo.java create mode 100644 microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectSprintStatisticsVo.java diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/controller/PmsDashboardController.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/controller/PmsDashboardController.java index 6deb18dd6..7265ac8a0 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/controller/PmsDashboardController.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/controller/PmsDashboardController.java @@ -9,6 +9,7 @@ import com.microservices.common.core.web.page.GenericsTableDataInfo; import com.microservices.common.security.utils.SecurityUtils; import com.microservices.pms.dashboard.domain.vo.MyDashboardVo; 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.PmsProductRequirement; 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.IPmsProjectSprintService; import com.microservices.pms.project.service.PmsProjectIssuesService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.stream.Collectors; @@ -85,14 +80,13 @@ public class PmsDashboardController extends BaseController { @GetMapping("/myProjectIssues") @ApiOperation(value = "我的工作项") public AjaxResult myProjectIssues(MyProjectIssuesSearchVo myProjectIssuesSearchVo) { - PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo = new PmsProjectIssuesSearchVo(); - BeanUtils.copyProperties(myProjectIssuesSearchVo, pmsProjectIssuesSearchVo); + List projectList = pmsProjectService.selectPmsProjectList(new PmsProject()); if(projectList.isEmpty()){ return success(); } - pmsProjectIssuesSearchVo.setPmProjectIds(StringUtils.join(projectList.stream().map(PmsProject::getId).toArray(), ",")); - JSONObject result = pmsProjectIssuesService.selectMyPmsProjectIssuesList(pmsProjectIssuesSearchVo); + myProjectIssuesSearchVo.setPmProjectIds(StringUtils.join(projectList.stream().map(PmsProject::getId).toArray(), ",")); + JSONObject result = pmsProjectIssuesService.selectMyPmsProjectIssuesList(myProjectIssuesSearchVo); return success(result); } @@ -106,6 +100,24 @@ public class PmsDashboardController extends BaseController { 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(), ",")); return pmsProjectSprintService.selectAllPmsProjectSprintList(pmsProjectSprintSearchVo); } + + /** + * 我的待办 + */ + @GetMapping("/todo") + @ApiOperation(value = "我的待办") + public AjaxResult todoProjectIssues(MyTodoProjectIssuesSearchVo todoProjectIssuesSearchVo) { + List 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); + } } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/domain/vo/MyProjectIssuesSearchVo.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/domain/vo/MyProjectIssuesSearchVo.java index a512b4c3a..5aed079cb 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/domain/vo/MyProjectIssuesSearchVo.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/domain/vo/MyProjectIssuesSearchVo.java @@ -8,10 +8,10 @@ import lombok.Data; @ApiModel("我的工作项搜索对象") public class MyProjectIssuesSearchVo { - @ApiModelProperty(value = "疑修类型,all 全部 opened 开启中 closed 已关闭", required = true) + @ApiModelProperty(value = "疑修类型,all 全部 opened 开启中 closed 已关闭") private String category; - @ApiModelProperty(value = "参与类型,all 全部 aboutme 关于我的 authoredme 我创建的 assignedme 我负责的 atme @我的", required = true) + @ApiModelProperty(value = "参与类型,all 全部 aboutme 关于我的 authoredme 我创建的 assignedme 我负责的 atme @我的") private String participantCategory; @ApiModelProperty(value = "工作项名称搜索关键词") @@ -30,9 +30,9 @@ public class MyProjectIssuesSearchVo { private String limit; @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; } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/domain/vo/MyTodoProjectIssuesSearchVo.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/domain/vo/MyTodoProjectIssuesSearchVo.java new file mode 100644 index 000000000..190246cfe --- /dev/null +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/dashboard/domain/vo/MyTodoProjectIssuesSearchVo.java @@ -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; + +} diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectSprintStatisticsVo.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectSprintStatisticsVo.java new file mode 100644 index 000000000..c392b8449 --- /dev/null +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectSprintStatisticsVo.java @@ -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; + +} diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/mapper/PmsProjectSprintMapper.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/mapper/PmsProjectSprintMapper.java index 9c4210ffb..c4ffc5623 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/mapper/PmsProjectSprintMapper.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/mapper/PmsProjectSprintMapper.java @@ -2,6 +2,7 @@ package com.microservices.pms.project.mapper; import com.microservices.pms.project.domain.PmsProjectSprint; 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.Param; @@ -77,4 +78,6 @@ public interface PmsProjectSprintMapper Integer selectOpeningSprintCount(@Param("pmProjectId") Long pmProjectId); Integer selectOpeningSprintLastWeekIterationCount(@Param("pmProjectId") Long pmProjectId); + + PmsProjectSprintStatisticsVo selectPmsProjectSprintStatisticsByProjectId(@Param("pmProjectId") Long pmProjectId); } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/IPmsProjectService.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/IPmsProjectService.java index dbf9703df..ccdd78767 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/IPmsProjectService.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/IPmsProjectService.java @@ -92,4 +92,10 @@ public interface IPmsProjectService * @param productId 产品Id */ void clearPmsProjectAndProductAssociations(Long productId); + + JSONObject getPmsProjectDynamics(Long pmProjectId); + + JSONObject getMyProjectStatistics(Long pmProjectId); + + JSONObject getMyRepositoriesStatistics(Long repositoryId); } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/PmsProjectIssuesService.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/PmsProjectIssuesService.java index 2cfd73b15..73024e219 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/PmsProjectIssuesService.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/PmsProjectIssuesService.java @@ -7,6 +7,8 @@ import com.microservices.common.core.utils.DateUtils; import com.microservices.common.httpClient.util.GitLinkRequestHelper; import com.microservices.common.security.utils.SecurityUtils; 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.service.IPmsEnterpriseService; import com.microservices.pms.project.domain.PmsProject; @@ -494,14 +496,24 @@ public class PmsProjectIssuesService { } } - public JSONObject selectMyPmsProjectIssuesList(PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo) { - pmsProjectService.selectAndCheckPmsProjectById(pmsProjectIssuesSearchVo.getPmProjectId()); + public JSONObject selectMyPmsProjectIssuesList(MyProjectIssuesSearchVo myProjectIssuesSearchVo) { + JSONObject issueSearch = new JSONObject(); - convertObjectToJSONObject(pmsProjectIssuesSearchVo, issueSearch, null); + convertObjectToJSONObject(myProjectIssuesSearchVo, issueSearch, null); try { return setProjectIssueListUserState(gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_MY_ISSUE_LIST(issueSearch))); } catch (URISyntaxException 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); + } + } } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectServiceImpl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectServiceImpl.java index 8ff606055..3715af59b 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectServiceImpl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectServiceImpl.java @@ -148,6 +148,31 @@ public class PmsProjectServiceImpl implements IPmsProjectService 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) { PmsProjectDetailVo pmsProjectDetailVo = new PmsProjectDetailVo(); diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/utils/PmsGitLinkRequestUrl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/utils/PmsGitLinkRequestUrl.java index 3778ef410..14c805ba6 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/utils/PmsGitLinkRequestUrl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/utils/PmsGitLinkRequestUrl.java @@ -371,4 +371,19 @@ public class PmsGitLinkRequestUrl extends GitLinkRequestUrl { return getGitLinkRequestUrl( 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)); + } } diff --git a/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProjectSprintMapper.xml b/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProjectSprintMapper.xml index 58d09ba99..3cd922737 100644 --- a/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProjectSprintMapper.xml +++ b/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProjectSprintMapper.xml @@ -197,4 +197,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and status IN ('0', '1') and start_time >= DATE_SUB(NOW(), INTERVAL 1 WEEK) + \ No newline at end of file From be55a0d4e5de99b493c3c50e28ab993672a03079 Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Wed, 11 Dec 2024 14:45:35 +0800 Subject: [PATCH 11/20] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=9C=80=E6=B1=82=E9=87=8D=E6=9E=84):=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=9C=80=E8=A7=84=E5=AF=B9=E5=BA=94=E7=9A=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AE=A1=E5=88=92=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化Forge异常时错误提示 Signed-off-by: OTTO <731554297@qq.com> --- .../common/httpClient/service/HttpAPIService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/microservices-common/microservices-common-httpClient/src/main/java/com/microservices/common/httpClient/service/HttpAPIService.java b/microservices-common/microservices-common-httpClient/src/main/java/com/microservices/common/httpClient/service/HttpAPIService.java index 607bc6887..53fd61202 100644 --- a/microservices-common/microservices-common-httpClient/src/main/java/com/microservices/common/httpClient/service/HttpAPIService.java +++ b/microservices-common/microservices-common-httpClient/src/main/java/com/microservices/common/httpClient/service/HttpAPIService.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; import com.microservices.common.core.constant.Constants; import com.microservices.common.core.constant.HttpStatus; +import com.microservices.common.core.exception.ServiceException; import com.microservices.common.httpClient.domain.CustomHttpDelete; import com.microservices.system.api.domain.SysFileBytes; import org.apache.commons.collections4.MapUtils; @@ -281,6 +282,9 @@ public class HttpAPIService { long length = httpEntity.getContentLength(); if (length != 0L) { String result = EntityUtils.toString(httpEntity); + if (!JSON.isValid(result)) { + throw new ServiceException("平台接口响应格式异常"); + } Object resultObj = JSON.parse(result); if (resultObj instanceof JSONArray) { JSONObject jsonObject = new JSONObject(); From 7efd45c462dd2ca488d33367d01428cc2f4b0f33 Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Wed, 11 Dec 2024 15:20:05 +0800 Subject: [PATCH 12/20] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=9C=80=E6=B1=82=E9=87=8D=E6=9E=84):=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=A7=E5=93=81=E4=B8=AD=E7=9A=84=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E8=A7=84=E6=A0=BC=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复需规拒绝变更时操作记录异常的问题 Signed-off-by: OTTO <731554297@qq.com> --- .../product/service/impl/PmsProductRequirementServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java index 95396163a..814bbf8ac 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java @@ -359,7 +359,7 @@ public class PmsProductRequirementServiceImpl implements IPmsProductRequirementS // 原需规记录评审意见 PmsProductReqOperationRecord oldReqSpecsRecord = productReqReviewVo.toReqSpecsRecord(SecurityUtils.getUsername()); - oldReqSpecsRecord.setId(fromReqSpecs.getId()); + oldReqSpecsRecord.setProductRequirementId(fromReqSpecs.getId()); pmsProductReqOperationRecordService.insertPmsProductReqOperationRecord(oldReqSpecsRecord); } else { reqSpecs.setStatus(ProductReqStatus.REJECTED_REQ_SPECS.getKey()); From fe8ce596291a8bdd3708ffb1cfd296ac44dcba39 Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Wed, 11 Dec 2024 15:22:38 +0800 Subject: [PATCH 13/20] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=9C=80=E6=B1=82=E9=87=8D=E6=9E=84):=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=A7=E5=93=81=E4=B8=AD=E7=9A=84=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E8=A7=84=E6=A0=BC=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 需规操作记录应该根据创建时间排序 Signed-off-by: OTTO <731554297@qq.com> --- .../mapper/pms/PmsProductReqOperationRecordMapper.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductReqOperationRecordMapper.xml b/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductReqOperationRecordMapper.xml index 991a38563..0b9b5ae6a 100644 --- a/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductReqOperationRecordMapper.xml +++ b/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductReqOperationRecordMapper.xml @@ -57,7 +57,7 @@ and reserved_field_2 = #{reservedField2} and reserved_field_3 = #{reservedField3} and reserved_field_4 = #{reservedField4} - order by operating_time desc + order by create_time desc @@ -71,7 +71,7 @@ where type = 'reviewUserReq' and product_requirement_id=#{reqId} - order by operating_time desc + order by create_time desc limit 1 where type = 'reviewReqSpecs' and product_requirement_id=#{reqId} - order by operating_time desc + order by create_time desc limit 1 From 3f9fd173c679c5f2fc6d3306ee1e65d1122118a8 Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Wed, 11 Dec 2024 15:31:19 +0800 Subject: [PATCH 14/20] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=9C=80=E6=B1=82=E9=87=8D=E6=9E=84):=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=A7=E5=93=81=E4=B8=AD=E7=9A=84=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E8=A7=84=E6=A0=BC=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 用户和需规评审时将评审时间记录到操作内容中(Content),防止用户填写了一个过早的时间导致操作记录列表混乱 Signed-off-by: OTTO <731554297@qq.com> --- .../pms/product/domain/enums/ProductReqOperationType.java | 2 +- .../microservices/pms/product/domain/vo/ProductReqReviewVo.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/enums/ProductReqOperationType.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/enums/ProductReqOperationType.java index f77e5a620..5786e130d 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/enums/ProductReqOperationType.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/enums/ProductReqOperationType.java @@ -32,7 +32,7 @@ public enum ProductReqOperationType { throw new ServiceException("需求操作记录类型错误"); } SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String operationTimeStr = formatter.format(record.getOperatingTime()); + String operationTimeStr = formatter.format(record.getCreateTime()); switch (type) { case CONTENT_MODIFY: return String.format("%s,由【%s】%s", diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/vo/ProductReqReviewVo.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/vo/ProductReqReviewVo.java index 485eeee3a..47ca3856f 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/vo/ProductReqReviewVo.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/vo/ProductReqReviewVo.java @@ -64,6 +64,7 @@ public class ProductReqReviewVo { JSONObject contentJson = new JSONObject(); contentJson.put("reviewUser", reviewUser); contentJson.put("reviewContent", reviewContent); + contentJson.put("reviewTime", reviewTime); record.setContent(contentJson.toJSONString()); return record; } From 87de8b7f90407462af3dfc32c2ed13564b3dce85 Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Wed, 11 Dec 2024 15:37:28 +0800 Subject: [PATCH 15/20] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=9C=80=E6=B1=82=E9=87=8D=E6=9E=84):=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=A7=E5=93=81=E4=B8=AD=E7=9A=84=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E8=A7=84=E6=A0=BC=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 查询用户需求和需规评审人以及评审时间时应查询最新一条已通过评审的记录 Signed-off-by: OTTO <731554297@qq.com> --- .../mapper/pms/PmsProductReqOperationRecordMapper.xml | 4 ++-- .../main/resources/mapper/pms/PmsProductRequirementMapper.xml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductReqOperationRecordMapper.xml b/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductReqOperationRecordMapper.xml index 0b9b5ae6a..2a8a99d3e 100644 --- a/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductReqOperationRecordMapper.xml +++ b/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductReqOperationRecordMapper.xml @@ -69,7 +69,7 @@ - where type = 'reviewReqSpecs' + where type = 'reviewReqSpecs' and operation = 'pass' and product_requirement_id=#{reqId} order by create_time desc limit 1 diff --git a/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductRequirementMapper.xml b/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductRequirementMapper.xml index d911cef96..617cdf7cd 100644 --- a/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductRequirementMapper.xml +++ b/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProductRequirementMapper.xml @@ -99,9 +99,10 @@ record.review_time, record.content as review_content from pms_product_requirement as ppr - left join (select product_requirement_id, MAX(operating_time) as review_time, content + left join (select product_requirement_id, MAX(create_time) as review_time, content from pms_product_req_operation_record where type = 'reviewUserReq' + and operation = 'pass' group by product_requirement_id, content) as record on record.product_requirement_id = ppr.id From 421b0f7e40a55c0a72476d491c0d817cbf624aad Mon Sep 17 00:00:00 2001 From: wanjia <553039491@qq.com> Date: Wed, 11 Dec 2024 15:44:45 +0800 Subject: [PATCH 16/20] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E6=A6=82=E8=A7=88?= =?UTF-8?q?):=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pms/project/controller/PmsProjectController.java | 10 ++++++++++ .../project/service/impl/PmsProjectServiceImpl.java | 8 ++++++++ .../microservices/pms/utils/PmsGitLinkRequestUrl.java | 5 +++++ 3 files changed, 23 insertions(+) diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/controller/PmsProjectController.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/controller/PmsProjectController.java index 786970e3f..5c49d7d94 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/controller/PmsProjectController.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/controller/PmsProjectController.java @@ -165,4 +165,14 @@ public class PmsProjectController extends BaseController return success(pmsProjectService.getPmsProjectPolyline(pmProjectId)); } + /** + * 获取项目概览-动态 + */ + @RequiresPermissions(value = {"pms:pmsProject:show", "pms:pmsProject:showMe"}, logical = Logical.OR) + @GetMapping(value = "/statistics/dynamics") + @ApiOperation(value = "项目概览-动态") + public AjaxResult getDynamics(@ApiParam("项目id") @RequestParam Long pmProjectId) { + return success(pmsProjectService.getPmsProjectDynamics(pmProjectId)); + } + } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectServiceImpl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectServiceImpl.java index 3715af59b..ed1764326 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectServiceImpl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectServiceImpl.java @@ -455,6 +455,14 @@ public class PmsProjectServiceImpl implements IPmsProjectService } } + @Override + public JSONObject getPmsProjectDynamics(Long pmProjectId) { + // 校验数据权限 + selectAndCheckPmsProjectById(pmProjectId); + JSONObject result = gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_OPERATE_JOURNALS(pmProjectId)); + //todo 获取项目其他模块操作记录,和项目动态合并,取top10 + return result.getJSONObject(DATA_KEY); + } @Override public JSONObject getPmsProjectStatistics(Long pmProjectId) { diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/utils/PmsGitLinkRequestUrl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/utils/PmsGitLinkRequestUrl.java index 14c805ba6..d9b37d278 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/utils/PmsGitLinkRequestUrl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/utils/PmsGitLinkRequestUrl.java @@ -386,4 +386,9 @@ public class PmsGitLinkRequestUrl extends GitLinkRequestUrl { return getGitLinkRequestUrl( String.format("/api/pm/dashboards/my_projects?project_id=%d", repositoryId)); } + + public static GitLinkRequestUrl GET_OPERATE_JOURNALS(Long pmProjectId) { + return getGitLinkRequestUrl( + String.format("/api/pm/dashboards/my_operate_journals?pm_project_id=%d&page=1&limit=10", pmProjectId)); + } } From cd688269443fdd3980e663547251faf20987a1ca Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Wed, 11 Dec 2024 16:04:42 +0800 Subject: [PATCH 17/20] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=9C=80=E6=B1=82=E9=87=8D=E6=9E=84):=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=A7=E5=93=81=E4=B8=AD=E7=9A=84=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E8=A7=84=E6=A0=BC=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 需规变更评审通过时应取消项目计划不允许修改的限制条件 Signed-off-by: OTTO <731554297@qq.com> --- .../service/impl/PmsProductRequirementServiceImpl.java | 1 + .../pms/project/domain/vo/PmsProjectIssuesInputVo.java | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java index 814bbf8ac..28f729fe6 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java @@ -335,6 +335,7 @@ public class PmsProductRequirementServiceImpl implements IPmsProductRequirementS issue.setDescription(reqSpecs.getContent()); issue.setAttachmentIds(forgeFileIdentifierList); issue.setPmProjectId(fromReqSpecs.getPmsProjectId()); + issue.setIsProductReqSpecsChange(true); pmsProjectIssuesService.updatePmsProjectIssues(fromReqSpecs.getProjectReqId(), issue); } // 变更中的需求规格通过评审后设置状态为原需规状态 diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectIssuesInputVo.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectIssuesInputVo.java index e77fa6172..4095d75c7 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectIssuesInputVo.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectIssuesInputVo.java @@ -73,7 +73,13 @@ public class PmsProjectIssuesInputVo { @ApiModelProperty(value = "关联工作项id") private Long linkAbleId; + @ApiModelProperty(value = "是否为需规调整", hidden = true) + private Boolean isProductReqSpecsChange = false; + public boolean isChangeContent(JSONObject issueJson) { + if (isProductReqSpecsChange) { + return false; + } if (StringUtils.isNotEmpty(subject) && !issueJson.getString("subject").equals(subject)) { return true; } From ee9fbf2328bc126f198d6ddd4996cdde885c6094 Mon Sep 17 00:00:00 2001 From: wanjia <553039491@qq.com> Date: Wed, 11 Dec 2024 16:10:44 +0800 Subject: [PATCH 18/20] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E6=A6=82=E8=A7=88?= =?UTF-8?q?):=E9=A1=B9=E7=9B=AE=E6=80=BB=E8=A7=88-=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E8=BF=AD=E4=BB=A3=E6=95=B0=E5=92=8C=E8=BF=91?= =?UTF-8?q?=E4=B8=80=E5=91=A8=E6=96=B0=E5=A2=9E=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pms/project/service/impl/PmsProjectServiceImpl.java | 8 ++++++-- .../main/resources/mapper/pms/PmsProjectSprintMapper.xml | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectServiceImpl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectServiceImpl.java index ed1764326..d4a96f4d1 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectServiceImpl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectServiceImpl.java @@ -474,12 +474,16 @@ public class PmsProjectServiceImpl implements IPmsProjectService // 获取 open_data 对象 JSONObject openData = dataObj.getJSONObject("open_data"); Integer openSprintCount = pmsProjectSprintMapper.selectOpeningSprintCount(pmProjectId); - Integer openLastWeekIterationCount = pmsProjectSprintMapper.selectOpeningSprintLastWeekIterationCount(pmProjectId); // 添加新的键值对 openData.put("0", openSprintCount); // 新增开启中的迭代 - openData.put("0_lastWeekIteration", openLastWeekIterationCount); //近一周新增 dataObj.put("open_data", openData); } + if (dataObj.containsKey("last_week_close_data")) { + JSONObject lastWeekCloseData = dataObj.getJSONObject("last_week_close_data"); + Integer openLastWeekIterationCount = pmsProjectSprintMapper.selectOpeningSprintLastWeekIterationCount(pmProjectId); + lastWeekCloseData.put("0", openLastWeekIterationCount); //近一周新增 + dataObj.put("last_week_close_data", lastWeekCloseData); + } return dataObj; } diff --git a/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProjectSprintMapper.xml b/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProjectSprintMapper.xml index 3cd922737..cc528b3bd 100644 --- a/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProjectSprintMapper.xml +++ b/microservices-modules/microservices-modules-pms/src/main/resources/mapper/pms/PmsProjectSprintMapper.xml @@ -187,13 +187,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" From dd05fb00cff9920453c0d83f452261f4147f7300 Mon Sep 17 00:00:00 2001 From: wanjia <553039491@qq.com> Date: Wed, 11 Dec 2024 16:22:20 +0800 Subject: [PATCH 19/20] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E6=A6=82=E8=A7=88?= =?UTF-8?q?):=E8=BF=AD=E4=BB=A3=E5=85=B3=E8=81=94=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=8D=95=E6=95=B0=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pms/project/domain/vo/PmsProjectSprintDetailVo.java | 2 +- .../pms/project/service/impl/PmsProjectSprintServiceImpl.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectSprintDetailVo.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectSprintDetailVo.java index 05f692de2..34b7f2586 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectSprintDetailVo.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectSprintDetailVo.java @@ -34,7 +34,7 @@ public class PmsProjectSprintDetailVo { private Long timeScale; @ApiModelProperty(value = "关联测试用例数") - private Integer linkedTestCaseCount; + private Integer linkedTestsheetCount; @ApiModelProperty(value = "状态 0待开始 1进行中 2已关闭") private String status; diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectSprintServiceImpl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectSprintServiceImpl.java index 4b3aae5ba..30fdf5fdd 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectSprintServiceImpl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectSprintServiceImpl.java @@ -11,7 +11,6 @@ import com.microservices.pms.common.service.IPmsCommonService; import com.microservices.pms.project.domain.PmsProjectSprint; import com.microservices.pms.project.domain.vo.*; import com.microservices.pms.project.mapper.PmsProjectSprintMapper; -import com.microservices.pms.project.mapper.PmsProjectTestcaseMapper; import com.microservices.pms.project.mapper.PmsProjectTestsheetMapper; import com.microservices.pms.project.service.IPmsProjectService; import com.microservices.pms.project.service.IPmsProjectSprintService; @@ -143,7 +142,7 @@ public class PmsProjectSprintServiceImpl implements IPmsProjectSprintService BeanUtils.copyProperties(pmsProjectSprint, pmsProjectSprintDetailVo); pmsProjectSprintDetailVo.setSprintAssignee(pmsCommonService.getSimpleSysUserByGitlinkUserId(pmsProjectSprint.getSprintAssigneeId())); pmsProjectSprintDetailVo.setSprintIssuesStatistics(sprintIssuesStatistics.getJSONObject(String.valueOf(pmsProjectSprint.getId()))); - pmsProjectSprintDetailVo.setLinkedTestCaseCount(pmsProjectTestsheetMapper.selectCountBySprintId(pmsProjectSprint.getId())); + pmsProjectSprintDetailVo.setLinkedTestsheetCount(pmsProjectTestsheetMapper.selectCountBySprintId(pmsProjectSprint.getId())); return pmsProjectSprintDetailVo; } From f93f802671633f0618c27f5d8507cc33ecbacae5 Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Thu, 12 Dec 2024 09:10:58 +0800 Subject: [PATCH 20/20] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=9C=80=E6=B1=82=E9=87=8D=E6=9E=84):=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=A7=E5=93=81=E4=B8=AD=E7=9A=84=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E8=A7=84=E6=A0=BC=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 需求规格纳入计划可选的项目 必须是关联了该产品的项目 关联Issue:https://pm.gitlink.org.cn/Gitlink/projects/228/bug/123983 Signed-off-by: OTTO <731554297@qq.com> --- .../controller/ProductReqSpecsController.java | 11 +++++++++++ .../service/IPmsProductRequirementService.java | 3 +++ .../impl/PmsProductRequirementServiceImpl.java | 16 ++++++++++++++-- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/controller/ProductReqSpecsController.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/controller/ProductReqSpecsController.java index e15776ed1..05887ff69 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/controller/ProductReqSpecsController.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/controller/ProductReqSpecsController.java @@ -9,6 +9,7 @@ import com.microservices.common.log.enums.BusinessType; import com.microservices.common.security.annotation.RequiresPermissions; import com.microservices.pms.product.domain.vo.*; import com.microservices.pms.product.service.IPmsProductRequirementService; +import com.microservices.pms.project.domain.PmsProject; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -123,6 +124,16 @@ public class ProductReqSpecsController extends BaseController { return toAjax(pmsProductRequirementService.activePlan(productReqSpecsActivePlanVo)); } + /** + * 纳入计划时可选择项目列表 + */ + @ApiOperation(value = "纳入计划时可选择项目列表") + @RequiresPermissions("pms:pmsProduct:show") + @GetMapping("/{productIdentifier}/projectList") + public List projectList(@PathVariable("productIdentifier") String productIdentifier) { + return pmsProductRequirementService.selectReqSpecsProjectList(productIdentifier); + } + /** * 查询需求规格状态列表 */ diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/IPmsProductRequirementService.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/IPmsProductRequirementService.java index 4c5d17f7b..d2265cc79 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/IPmsProductRequirementService.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/IPmsProductRequirementService.java @@ -5,6 +5,7 @@ import com.microservices.common.core.web.page.GenericsTableDataInfo; import com.microservices.pms.product.domain.PmsProductRequirement; import com.microservices.pms.product.domain.enums.ProductReqStatus; import com.microservices.pms.product.domain.vo.*; +import com.microservices.pms.project.domain.PmsProject; import java.util.List; @@ -128,4 +129,6 @@ public interface IPmsProductRequirementService JSONObject selectReqSpecsAssociatedPlanData(Long reqSpecsId); void updateReqSpecsStatusByProjectReqId(Long projectReqId, ProductReqStatus productReqStatus); + + List selectReqSpecsProjectList(String productIdentifier); } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java index 28f729fe6..033de6b46 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductRequirementServiceImpl.java @@ -539,7 +539,11 @@ public class PmsProductRequirementServiceImpl implements IPmsProductRequirementS if (!ProductReqStatus.REVIEWED_REQ_SPECS.getKey().equals(reqSpecs.getStatus())) { throw new ServiceException("仅已评审状态的需求规格才能纳入计划"); } - PmsProject project = pmsProjectService.selectAndCheckPmsProjectById(productReqSpecsActivePlanVo.getProjectId()); + List pmsProjectList = selectReqSpecsProjectList(reqSpecs.getPmsProductIdentifier()); + if (pmsProjectList == null + || pmsProjectList.stream().noneMatch(x -> x.getId().equals(productReqSpecsActivePlanVo.getProjectId()))) { + throw new ServiceException("需求规格纳入计划时请选择关联了当前产品的项目"); + } List forgeFileIdentifierList = null; if (StringUtils.isNotEmpty(reqSpecs.getFileIdentifiers())) { // 需求规格文件上传至forge @@ -550,7 +554,7 @@ public class PmsProductRequirementServiceImpl implements IPmsProductRequirementS PmsProjectIssuesInputVo pmsProjectIssuesInputVo = productReqSpecsActivePlanVo.toPmsProjectIssuesInputVo(reqSpecs, forgeFileIdentifierList); JSONObject projectIssue = pmsProjectIssuesService.insertPmsProjectIssues(pmsProjectIssuesInputVo); - reqSpecs.setPmsProjectId(project.getId()); + reqSpecs.setPmsProjectId(productReqSpecsActivePlanVo.getId()); reqSpecs.setProjectReqId(projectIssue.getLong("id")); reqSpecs.setStatus(ProductReqStatus.PLANNED_REQ_SPECS.getKey()); int success = updateRequirement(reqSpecs, reqSpecs.getPmsProductIdentifier()); @@ -604,6 +608,14 @@ public class PmsProductRequirementServiceImpl implements IPmsProductRequirementS updateRequirement(pmsProductRequirement, pmsProductRequirement.getPmsProductIdentifier()); } + @Override + public List selectReqSpecsProjectList(String productIdentifier) { + PmsProduct pmsProduct = pmsProductService.selectPmsProductByIdentifier(productIdentifier); + PmsProject pmsProjectSearch = new PmsProject(); + pmsProjectSearch.setPmsProductId(pmsProduct.getId()); + return pmsProjectService.selectPmsProjectList(pmsProjectSearch); + } + private ProductReqSpecsDetailVo toProductReqSpecsDetailVo(PmsProductRequirement pmsProductRequirement) { ProductReqSpecsDataVo productReqSpecsDataVo = toProductReqSpecsDataVo(pmsProductRequirement, null); ProductReqSpecsDetailVo productReqSpecsDetailVo = productReqSpecsDataVo.toProductReqSpecsDetailVo();