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(); 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); 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 5599ec9b0..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,24 +32,24 @@ 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", + return String.format("%s,由【%s】%s", operationTimeStr, operator.getNickName(), ProductContentModifyOperation.getNameByKey(record.getOperation())); case REVIEW_USER_REQ: - return String.format("%s,由【%s】进行了用户需求评审,评审结果为【%s】", + return String.format("%s,由【%s】进行了用户需求评审,评审结果为【%s】", operationTimeStr, operator.getNickName(), ProductReqReviewStatus.getNameByKey(record.getOperation())); case ACTIVE_PLAN: - return String.format("%s,由【%s】将需求纳入了计划", + return String.format("%s,由【%s】将需求纳入了计划", operationTimeStr, operator.getNickName()); case REVIEW_REQ_SPECS: - return String.format("%s,由【%s】进行了需求规格评审,评审结果为【%s】", + return String.format("%s,由【%s】进行了需求规格评审,评审结果为【%s】", operationTimeStr, operator.getNickName(), ProductReqReviewStatus.getNameByKey(record.getOperation())); diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/enums/ProductReqReviewStatus.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/enums/ProductReqReviewStatus.java index dd125eb72..0258efae8 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/enums/ProductReqReviewStatus.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/domain/enums/ProductReqReviewStatus.java @@ -10,7 +10,7 @@ import lombok.Getter; @Getter public enum ProductReqReviewStatus { PASS("pass", "已通过"), - REJECTED("rejected", "已拒绝"); + REJECTED("rejected", "未通过"); private final String key; private final String name; 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; } 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; 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 9e94a5dbe..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,15 @@ 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; + /** * 关联项目ID */ 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/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); 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 920d874c0..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()); @@ -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<>(); @@ -582,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(); @@ -622,7 +643,7 @@ public class PmsProductRequirementServiceImpl implements IPmsProductRequirementS if (record != null) { break; } - fromReq = selectPmsProductRequirementById(fromReq.getFromId(), true); + fromReq = fromReq.getFromId() != null ? selectPmsProductRequirementById(fromReq.getFromId(), true) : null; } if (record != null) { productReqSpecsDetailVo.setReviewTime(record.getOperatingTime()); 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/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/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/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/PmsProjectIssuesService.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/PmsProjectIssuesService.java index 73024e219..ff8b4e14b 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 @@ -11,6 +11,9 @@ 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.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.*; @@ -25,6 +28,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; @@ -55,6 +59,10 @@ public class PmsProjectIssuesService { @Lazy private IPmsProjectService pmsProjectService; + @Autowired + @Lazy + private IPmsProductRequirementService pmsProductRequirementService; + @Autowired @Lazy private IPmsProjectTestsheetIssuesService pmsProjectTestsheetIssuesService; @@ -97,6 +105,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; @@ -104,6 +113,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/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)); } 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..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 @@ -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 @@ -69,9 +69,9 @@ - where type = 'reviewReqSpecs' + where type = 'reviewReqSpecs' and operation = 'pass' and product_requirement_id=#{reqId} - order by operating_time desc + 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 85324cdaa..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 @@ -204,7 +205,12 @@ and title like concat('%', #{title}, '%') and pms_product_identifier = #{pmsProductIdentifier} - and `status` = #{status} + and `status` in + + #{item} + + + and `type` = #{type} @@ -232,6 +238,12 @@ from pms_product_requirement where identifier = #{identifier} +