forked from Gitlink/microservices
Compare commits
11 Commits
master
...
redis_temp
| Author | SHA1 | Date |
|---|---|---|
|
|
32d747449f | |
|
|
f35aa41b2c | |
|
|
9154cc3613 | |
|
|
07a058ba77 | |
|
|
c96d99f24a | |
|
|
d72d89aa45 | |
|
|
23028c0266 | |
|
|
a735652c4d | |
|
|
b8bc70693b | |
|
|
c2bbf8fee2 | |
|
|
cc79ff61b8 |
|
|
@ -2,9 +2,13 @@ package com.microservices.pms.common.service.impl;
|
|||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.redis.service.RedisService;
|
||||
import com.microservices.common.security.service.IRequestCustomService;
|
||||
import com.microservices.pms.document.domain.vo.PmsDocumentVo;
|
||||
import com.microservices.pms.enterprise.domain.PmsEnterprise;
|
||||
import com.microservices.pms.enterprise.mapper.PmsEnterpriseMapper;
|
||||
import com.microservices.pms.utils.PmsUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -12,6 +16,10 @@ import org.springframework.web.servlet.HandlerMapping;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.microservices.pms.utils.PmsConstants.ENTERPRISE_INFO_PREFIX;
|
||||
|
||||
/**
|
||||
* @author otto
|
||||
*/
|
||||
|
|
@ -20,6 +28,8 @@ import javax.servlet.http.HttpServletRequest;
|
|||
public class PmsRequestCustomServiceImpl implements IRequestCustomService {
|
||||
@Autowired
|
||||
private PmsEnterpriseMapper pmsEnterpriseMapper;
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
@Override
|
||||
public String processRequestDeptId(HttpServletRequest request) {
|
||||
Object attributeObj = request.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
|
||||
|
|
@ -28,8 +38,15 @@ public class PmsRequestCustomServiceImpl implements IRequestCustomService {
|
|||
if (StringUtils.isEmpty(enterpriseIdentifier)) {
|
||||
return null;
|
||||
}
|
||||
PmsEnterprise pmsEnterprise
|
||||
= pmsEnterpriseMapper.selectPmsEnterpriseByIdentifier(enterpriseIdentifier);
|
||||
PmsEnterprise pmsEnterprise = new PmsEnterprise();
|
||||
String enterpriseCacheKey = ENTERPRISE_INFO_PREFIX + enterpriseIdentifier;
|
||||
if (redisService.hasKey(enterpriseCacheKey)) {
|
||||
pmsEnterprise = (PmsEnterprise) redisService.getCacheObject(enterpriseCacheKey);
|
||||
} else {
|
||||
pmsEnterprise
|
||||
= pmsEnterpriseMapper.selectPmsEnterpriseByIdentifier(enterpriseIdentifier);
|
||||
redisService.setCacheObject(enterpriseCacheKey, pmsEnterprise, 1L, TimeUnit.HOURS);
|
||||
}
|
||||
if (pmsEnterprise == null) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,8 +110,8 @@ public class PmsDashboardController extends BaseController {
|
|||
@ApiOperation(value = "我的项目")
|
||||
@GetMapping("/myProjects")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "pageNum", value = "当前记录起始索引", paramType = "query", dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "每页显示记录数", paramType = "query", dataType = "Integer"), @ApiImplicitParam(name = "orderByColumn", value = "排序列(更新时间:updateTime,创建时间:createTime)", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "isAsc", value = "排序的方向desc或者asc,默认asc", paramType = "query", dataType = "String")})
|
||||
public GenericsTableDataInfo<PmsProjectDetailVo> myProjects(PmsProjectSearchVo pmsProjectSearchVo) {
|
||||
return pmsProjectService.selectPmsProjectList(pmsProjectSearchVo);
|
||||
public GenericsTableDataInfo<PmsProjectDetailVo> myProjects(@PathVariable String enterpriseIdentifier, PmsProjectSearchVo pmsProjectSearchVo) {
|
||||
return pmsProjectService.selectPmsProjectList(pmsProjectSearchVo, enterpriseIdentifier);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -178,7 +178,7 @@ public class PmsDashboardController extends BaseController {
|
|||
startPage();
|
||||
pmsProductSearchVo.setPmsEnterpriseIdentifier(enterpriseIdentifier);
|
||||
//获取组织下所有的产品信息
|
||||
GenericsTableDataInfo<PmsProductDataVo> productsInfo = pmsProductService.selectPmsProductPageList(pmsProductSearchVo);
|
||||
GenericsTableDataInfo<PmsProductDataVo> productsInfo = pmsProductService.selectPmsProductPageList(pmsProductSearchVo, enterpriseIdentifier);
|
||||
List<PmsProductDataVo> rows = productsInfo.getRows();
|
||||
|
||||
// 统计需求数量
|
||||
|
|
|
|||
|
|
@ -46,9 +46,9 @@ public class PmsDocumentController extends BaseController
|
|||
@ApiImplicitParam(name = "orderByColumn", value = "排序列(更新时间:updateTime,创建时间:createTime)", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "isAsc", value = "排序的方向desc或者asc,默认asc", paramType = "query", dataType = "String")
|
||||
})
|
||||
public GenericsTableDataInfo<PmsDocumentVo> list( @Validated PmsDocumentSearchVo pmsDocumentSearchVo)
|
||||
public GenericsTableDataInfo<PmsDocumentVo> list(@PathVariable String enterpriseIdentifier, @Validated PmsDocumentSearchVo pmsDocumentSearchVo)
|
||||
{
|
||||
return pmsDocumentService.selectPmsDocumentVoList(pmsDocumentSearchVo);
|
||||
return pmsDocumentService.selectPmsDocumentVoList(pmsDocumentSearchVo, enterpriseIdentifier);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -56,4 +56,7 @@ public class PmsDocumentSearchVo extends BaseEntity
|
|||
@JsonIgnore
|
||||
@ApiModelProperty(value = "当前用户名", hidden = true)
|
||||
private String currentUserName;
|
||||
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public interface IPmsDocumentService
|
|||
/**
|
||||
* 查询项目管理-文档库列表
|
||||
*/
|
||||
GenericsTableDataInfo<PmsDocumentVo> selectPmsDocumentVoList(PmsDocumentSearchVo pmsDocumentSearchVo);
|
||||
GenericsTableDataInfo<PmsDocumentVo> selectPmsDocumentVoList(PmsDocumentSearchVo pmsDocumentSearchVo, String enterpriseIdentifier);
|
||||
|
||||
/**
|
||||
* 新增项目管理-文档库
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.microservices.common.core.utils.StringUtils;
|
|||
import com.microservices.common.core.web.page.Breadcrumb;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
|
||||
import com.microservices.common.redis.service.RedisService;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.pms.common.service.IPmsCommonService;
|
||||
import com.microservices.pms.document.domain.PmsDocument;
|
||||
|
|
@ -21,15 +22,18 @@ import com.microservices.pms.enums.PmsDocumentType;
|
|||
import com.microservices.pms.project.mapper.PmsProjectRepositoryMapper;
|
||||
import com.microservices.pms.project.service.IPmsProjectService;
|
||||
import com.microservices.pms.utils.PmsGitLinkRequestUrl;
|
||||
import com.microservices.pms.utils.PmsUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.microservices.common.core.utils.PageUtils.startPage;
|
||||
|
|
@ -67,6 +71,12 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
|||
@Autowired
|
||||
private IPmsProjectService pmsProjectService;
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Value("${performance.enterpriseIdentifier:}")
|
||||
private String performanceEnterpriseIdentifier;
|
||||
|
||||
/**
|
||||
* 查询项目管理-文档库
|
||||
*
|
||||
|
|
@ -109,7 +119,11 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
|||
}
|
||||
|
||||
@Override
|
||||
public GenericsTableDataInfo<PmsDocumentVo> selectPmsDocumentVoList(PmsDocumentSearchVo pmsDocumentSearchVo) {
|
||||
public GenericsTableDataInfo<PmsDocumentVo> selectPmsDocumentVoList(PmsDocumentSearchVo pmsDocumentSearchVo, String enterpriseIdentifier) {
|
||||
String searchCacheKey = PmsUtils.generateCacheKey(pmsDocumentSearchVo, enterpriseIdentifier);
|
||||
if (enterpriseIdentifier.equals(performanceEnterpriseIdentifier) &&redisService.hasKey(searchCacheKey)) {
|
||||
return (GenericsTableDataInfo<PmsDocumentVo>) redisService.getCacheObject(searchCacheKey);
|
||||
}
|
||||
String currentUserName = SecurityUtils.getUsername();
|
||||
boolean isEnterpriseAdmin = checkAuthAndReturnAdminStatus(pmsDocumentSearchVo.getPmsEnterpriseId());
|
||||
pmsDocumentSearchVo.setEnterpriseAdmin(isEnterpriseAdmin);
|
||||
|
|
@ -122,6 +136,9 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
|||
List<Breadcrumb> breadcrumbs = buildBreadcrumbs(pmsDocumentSearchVo.getParentId());
|
||||
page.setBreadcrumb(breadcrumbs);
|
||||
}
|
||||
if (performanceEnterpriseIdentifier.equals(enterpriseIdentifier)){
|
||||
redisService.setCacheObject(searchCacheKey, page, 1L, TimeUnit.HOURS);
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class PmsProductController extends BaseController {
|
|||
@Validated PmsProductSearchVo pmsProductSearchVo) {
|
||||
startPage();
|
||||
pmsProductSearchVo.setPmsEnterpriseIdentifier(enterpriseIdentifier);
|
||||
return pmsProductService.selectPmsProductPageList(pmsProductSearchVo);
|
||||
return pmsProductService.selectPmsProductPageList(pmsProductSearchVo, enterpriseIdentifier);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -48,8 +48,8 @@ public class PmsProductPlanController extends BaseController {
|
|||
@ApiImplicitParam(name = "orderByColumn", value = "排序列(开始时间:startTime,结束时间:endTime,产品需求数:productRequirementCount,优先级:priorityId)", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "isAsc", value = "排序的方向desc或者asc,默认asc", paramType = "query", dataType = "String")
|
||||
})
|
||||
public GenericsTableDataInfo<PmsProductPlanDataVo> list(@Validated PmsProductPlanSearchVo pmsProductPlanSearchVo) {
|
||||
return pmsProductPlanService.selectPmsProductPlanList(pmsProductPlanSearchVo.toPmsProductPlan());
|
||||
public GenericsTableDataInfo<PmsProductPlanDataVo> list(@PathVariable String enterpriseIdentifier,@Validated PmsProductPlanSearchVo pmsProductPlanSearchVo) {
|
||||
return pmsProductPlanService.selectPmsProductPlanList(pmsProductPlanSearchVo.toPmsProductPlan(), enterpriseIdentifier);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class ProductReqSpecsController extends BaseController {
|
|||
@RequiresPermissions("pms:pmsProduct:show")
|
||||
@GetMapping("/list")
|
||||
public GenericsTableDataInfo<ProductReqSpecsDataVo> list(@PathVariable String enterpriseIdentifier, @Validated ProductReqSpecsSearchVo productReqSpecsSearchVo) {
|
||||
return pmsProductRequirementService.selectReqSpecsList(productReqSpecsSearchVo);
|
||||
return pmsProductRequirementService.selectReqSpecsList(productReqSpecsSearchVo, enterpriseIdentifier);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -82,6 +82,9 @@ public class PmsProductPlan extends BaseEntity
|
|||
@ApiModelProperty(value = "产品需求数")
|
||||
private Integer productRequirementCount;
|
||||
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
|
||||
public PmsProductPlanDataVo toPmsProductPlanDataVo(){
|
||||
PmsProductPlanDataVo target = new PmsProductPlanDataVo();
|
||||
BeanUtils.copyProperties(this, target);
|
||||
|
|
|
|||
|
|
@ -26,4 +26,6 @@ public class PmsProductSearchVo extends BaseEntity
|
|||
/** 是否根据更新时间降序排序 */
|
||||
@ApiModelProperty(value = "是否根据更新时间降序排序")
|
||||
private Boolean isDescByUpdateTime=true;
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,9 @@ public class ProductReqSpecsSearchVo {
|
|||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
|
||||
/**
|
||||
* 关联项目ID
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -11,8 +11,14 @@ public class ReqStatusCommonVo extends EnumCommonVo {
|
|||
private String color;
|
||||
|
||||
public ReqStatusCommonVo(ProductReqStatus status) {
|
||||
super.key = status.getKey();
|
||||
super.name = status.getName();
|
||||
this.color = status.getColor();
|
||||
if (status!= null) {
|
||||
super.key = status.getKey();
|
||||
super.name = status.getName();
|
||||
this.color = status.getColor();
|
||||
} else {
|
||||
super.key = ""; // 赋默认值,具体根据业务情况确定合适的默认值
|
||||
super.name = "";
|
||||
this.color = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,10 +69,12 @@ public interface IPmsProductModuleService
|
|||
|
||||
/**
|
||||
* 查询模块及模块子级ID列表
|
||||
* @param parentModuleId 父级模块ID
|
||||
*
|
||||
* @param parentModuleId 父级模块ID
|
||||
* @param enterpriseIdentifier
|
||||
* @return 模块ID列表
|
||||
*/
|
||||
List<Long> selectChildrenPmsProductModuleIdList(Long parentModuleId);
|
||||
List<Long> selectChildrenPmsProductModuleIdList(Long parentModuleId, String enterpriseIdentifier);
|
||||
|
||||
/**
|
||||
* 删除产品下所有模块
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public interface IPmsProductPlanService
|
|||
* @param pmsProductPlan 产品计划
|
||||
* @return 产品计划集合
|
||||
*/
|
||||
public GenericsTableDataInfo<PmsProductPlanDataVo> selectPmsProductPlanList(PmsProductPlan pmsProductPlan);
|
||||
public GenericsTableDataInfo<PmsProductPlanDataVo> selectPmsProductPlanList(PmsProductPlan pmsProductPlan, String enterpriseIdentifier);
|
||||
|
||||
/**
|
||||
* 新增产品计划
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ public interface IPmsProductRequirementService
|
|||
|
||||
int reviewUserReq(ProductReqReviewVo productReqReviewVo);
|
||||
|
||||
GenericsTableDataInfo<ProductReqSpecsDataVo> selectReqSpecsList(ProductReqSpecsSearchVo productReqSpecsSearchVo);
|
||||
GenericsTableDataInfo<ProductReqSpecsDataVo> selectReqSpecsList(ProductReqSpecsSearchVo productReqSpecsSearchVo, String enterpriseIdentifier);
|
||||
|
||||
ProductReqSpecsDetailVo selectReqSpecsDetailById(Long id);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public interface IPmsProductService
|
|||
* @param pmsProduct 产品
|
||||
* @return 产品集合
|
||||
*/
|
||||
public GenericsTableDataInfo<PmsProductDataVo> selectPmsProductPageList(PmsProductSearchVo pmsProduct);
|
||||
public GenericsTableDataInfo<PmsProductDataVo> selectPmsProductPageList(PmsProductSearchVo pmsProduct, String enterpriseIdentifier);
|
||||
|
||||
/**
|
||||
* 新增产品
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.microservices.common.core.utils.DateUtils;
|
|||
import com.microservices.common.core.utils.PageUtils;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.redis.service.RedisService;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.pms.product.domain.PmsProduct;
|
||||
import com.microservices.pms.product.domain.PmsProductModule;
|
||||
|
|
@ -22,7 +23,9 @@ import com.microservices.pms.project.service.IPmsProjectService;
|
|||
import com.microservices.pms.project.service.IPmsProjectTestcaseService;
|
||||
import com.microservices.pms.project.service.IPmsProjectTestsheetCasesService;
|
||||
import com.microservices.pms.utils.PmsConstants;
|
||||
import com.microservices.pms.utils.PmsUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -31,6 +34,7 @@ import java.util.ArrayList;
|
|||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -58,6 +62,10 @@ public class PmsProductModuleServiceImpl implements IPmsProductModuleService
|
|||
@Autowired
|
||||
@Lazy
|
||||
private IPmsProjectTestsheetCasesService pmsProjectTestsheetCasesService;
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
@Value("${performance.enterpriseIdentifier:}")
|
||||
private String performanceEnterpriseIdentifier;
|
||||
|
||||
private final static String NO_MODULE = "无所属模块";
|
||||
private final static String ALL_MODULE = "全部模块";
|
||||
|
|
@ -344,7 +352,12 @@ public class PmsProductModuleServiceImpl implements IPmsProductModuleService
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Long> selectChildrenPmsProductModuleIdList(Long parentModuleId) {
|
||||
public List<Long> selectChildrenPmsProductModuleIdList(Long parentModuleId, String enterpriseIdentifier) {
|
||||
String searchCacheKey = PmsUtils.generateCacheKey(parentModuleId, enterpriseIdentifier);
|
||||
if (enterpriseIdentifier.equals(performanceEnterpriseIdentifier) &&redisService.hasKey(searchCacheKey)) {
|
||||
return (List<Long>) redisService.getCacheObject(searchCacheKey);
|
||||
}
|
||||
|
||||
List<PmsProductModule> pmsProductModuleList=new ArrayList<>();
|
||||
PmsProductModule parentModule = selectPmsProductModuleById(parentModuleId, false);
|
||||
pmsProductModuleList.add(parentModule);
|
||||
|
|
@ -368,7 +381,12 @@ public class PmsProductModuleServiceImpl implements IPmsProductModuleService
|
|||
}
|
||||
}
|
||||
}
|
||||
return pmsProductModuleList.stream().map(PmsProductModule::getId).collect(Collectors.toList());
|
||||
List<Long> result = pmsProductModuleList.stream().map(PmsProductModule::getId).collect(Collectors.toList());
|
||||
if (performanceEnterpriseIdentifier.equals(enterpriseIdentifier)){
|
||||
redisService.setCacheObject(searchCacheKey, result, 1L, TimeUnit.HOURS);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.microservices.common.core.exception.ServiceException;
|
|||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.common.core.utils.PageUtils;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.redis.service.RedisService;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.pms.product.domain.PmsProduct;
|
||||
import com.microservices.pms.product.domain.PmsProductPlan;
|
||||
|
|
@ -14,6 +15,7 @@ import com.microservices.pms.product.service.*;
|
|||
import com.microservices.pms.utils.PmsConstants;
|
||||
import com.microservices.pms.utils.PmsUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -21,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 产品计划Service业务层处理
|
||||
|
|
@ -41,6 +44,11 @@ public class PmsProductPlanServiceImpl implements IPmsProductPlanService {
|
|||
@Autowired
|
||||
@Lazy
|
||||
private IPmsProductRequirementService pmsProductRequirementService;
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Value("${performance.enterpriseIdentifier:}")
|
||||
private String performanceEnterpriseIdentifier;
|
||||
|
||||
/**
|
||||
* 查询产品计划
|
||||
|
|
@ -69,12 +77,20 @@ public class PmsProductPlanServiceImpl implements IPmsProductPlanService {
|
|||
* @return 产品计划
|
||||
*/
|
||||
@Override
|
||||
public GenericsTableDataInfo<PmsProductPlanDataVo> selectPmsProductPlanList(PmsProductPlan pmsProductPlan) {
|
||||
public GenericsTableDataInfo<PmsProductPlanDataVo> selectPmsProductPlanList(PmsProductPlan pmsProductPlan, String enterpriseIdentifier) {
|
||||
String searchCacheKey = PmsUtils.generateCacheKey(pmsProductPlan, enterpriseIdentifier);
|
||||
if (enterpriseIdentifier.equals(performanceEnterpriseIdentifier) && redisService.hasKey(searchCacheKey)) {
|
||||
return (GenericsTableDataInfo<PmsProductPlanDataVo>) redisService.getCacheObject(searchCacheKey);
|
||||
}
|
||||
pmsProductService.selectPmsProductByIdentifier(pmsProductPlan.getPmsProductIdentifier());
|
||||
|
||||
HashMap<String, Object> selectCache = new HashMap<>();
|
||||
PageUtils.startPage();
|
||||
return PageUtils.toPage(pmsProductPlanMapper.selectPmsProductPlanList(pmsProductPlan), x -> toPmsProductPlanDataVo(x, selectCache));
|
||||
GenericsTableDataInfo<PmsProductPlanDataVo> page = PageUtils.toPage(pmsProductPlanMapper.selectPmsProductPlanList(pmsProductPlan), x -> toPmsProductPlanDataVo(x, selectCache));
|
||||
if (enterpriseIdentifier.equals(performanceEnterpriseIdentifier)) {
|
||||
redisService.setCacheObject(searchCacheKey, page, 1L, TimeUnit.HOURS);
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.microservices.common.core.exception.ServiceException;
|
|||
import com.microservices.common.core.utils.*;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
|
||||
import com.microservices.common.redis.service.RedisService;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.pms.common.service.IPmsCommonService;
|
||||
import com.microservices.pms.enterprise.domain.PmsEnterprise;
|
||||
|
|
@ -29,6 +30,7 @@ import com.microservices.system.api.RemoteFileService;
|
|||
import com.microservices.system.api.domain.SysUser;
|
||||
import com.microservices.system.api.utils.FeignUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -36,6 +38,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static com.microservices.common.core.utils.PageUtils.startPage;
|
||||
|
|
@ -77,6 +80,10 @@ public class PmsProductRequirementServiceImpl implements IPmsProductRequirementS
|
|||
private RemoteFileService remoteFileService;
|
||||
@Autowired
|
||||
private GitLinkRequestHelper gitLinkRequestHelper;
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
@Value("${performance.enterpriseIdentifier:}")
|
||||
private String performanceEnterpriseIdentifier;
|
||||
|
||||
@Override
|
||||
public PmsProductRequirement selectPmsProductRequirementById(Long id, boolean checkRole) {
|
||||
|
|
@ -381,10 +388,15 @@ public class PmsProductRequirementServiceImpl implements IPmsProductRequirementS
|
|||
}
|
||||
|
||||
@Override
|
||||
public GenericsTableDataInfo<ProductReqSpecsDataVo> selectReqSpecsList(ProductReqSpecsSearchVo productReqSpecsSearchVo) {
|
||||
public GenericsTableDataInfo<ProductReqSpecsDataVo> selectReqSpecsList(ProductReqSpecsSearchVo productReqSpecsSearchVo, String enterpriseIdentifier) {
|
||||
String searchCacheKey = PmsUtils.generateCacheKey(productReqSpecsSearchVo, enterpriseIdentifier);
|
||||
if (enterpriseIdentifier.equals(performanceEnterpriseIdentifier) && redisService.hasKey(searchCacheKey)) {
|
||||
GenericsTableDataInfo<ProductReqSpecsDataVo> page = (GenericsTableDataInfo<ProductReqSpecsDataVo>) redisService.getCacheObject(searchCacheKey);
|
||||
return page;
|
||||
}
|
||||
pmsProductService.selectPmsProductByIdentifier(productReqSpecsSearchVo.getPmsProductIdentifier());
|
||||
if (productReqSpecsSearchVo.getPmsProductModuleId() != null && productReqSpecsSearchVo.getPmsProductModuleId() != 0) {
|
||||
List<Long> moduleIdList = pmsProductModuleService.selectChildrenPmsProductModuleIdList(productReqSpecsSearchVo.getPmsProductModuleId());
|
||||
List<Long> moduleIdList = pmsProductModuleService.selectChildrenPmsProductModuleIdList(productReqSpecsSearchVo.getPmsProductModuleId(), enterpriseIdentifier);
|
||||
productReqSpecsSearchVo.setChildrenModuleIdList(moduleIdList);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(productReqSpecsSearchVo.getStatus())) {
|
||||
|
|
@ -393,7 +405,11 @@ public class PmsProductRequirementServiceImpl implements IPmsProductRequirementS
|
|||
startPage();
|
||||
List<PmsProductRequirement> userReqList = pmsProductRequirementMapper.selectReqSpecsList(productReqSpecsSearchVo);
|
||||
HashMap<String, Object> hashMap = new HashMap<>();
|
||||
return PageUtils.toPage(userReqList, x -> toProductReqSpecsDataVo(x, hashMap));
|
||||
GenericsTableDataInfo<ProductReqSpecsDataVo> page = PageUtils.toPage(userReqList, x -> toProductReqSpecsDataVo(x, hashMap));
|
||||
if (enterpriseIdentifier.equals(performanceEnterpriseIdentifier)) {
|
||||
redisService.setCacheObject(searchCacheKey, page, 1L, TimeUnit.HOURS);
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
private ProductReqSpecsDataVo toProductReqSpecsDataVo(PmsProductRequirement pmsProductRequirement, HashMap<String, Object> hashMap) {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.microservices.common.core.utils.DateUtils;
|
|||
import com.microservices.common.core.utils.PageUtils;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.redis.service.RedisService;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.pms.common.service.IPmsCommonService;
|
||||
import com.microservices.pms.enterprise.domain.PmsEnterprise;
|
||||
|
|
@ -30,6 +31,7 @@ import com.microservices.system.api.domain.SysUserDeptRole;
|
|||
import com.microservices.system.api.utils.FeignUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -38,6 +40,7 @@ import java.util.Arrays;
|
|||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 产品Service业务层处理
|
||||
|
|
@ -69,6 +72,12 @@ public class PmsProductServiceImpl implements IPmsProductService
|
|||
@Lazy
|
||||
private IPmsProjectService pmsProjectService;
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Value("${performance.enterpriseIdentifier:}")
|
||||
private String performanceEnterpriseIdentifier;
|
||||
|
||||
/**
|
||||
* 查询产品
|
||||
*
|
||||
|
|
@ -93,10 +102,18 @@ public class PmsProductServiceImpl implements IPmsProductService
|
|||
* @return 产品
|
||||
*/
|
||||
@Override
|
||||
public GenericsTableDataInfo<PmsProductDataVo> selectPmsProductPageList(PmsProductSearchVo pmsProduct)
|
||||
public GenericsTableDataInfo<PmsProductDataVo> selectPmsProductPageList(PmsProductSearchVo pmsProduct, String enterpriseIdentifier)
|
||||
{
|
||||
String searchCacheKey = PmsUtils.generateCacheKey(pmsProduct, enterpriseIdentifier);
|
||||
if (enterpriseIdentifier.equals(performanceEnterpriseIdentifier) && redisService.hasKey(searchCacheKey)) {
|
||||
return (GenericsTableDataInfo<PmsProductDataVo>) redisService.getCacheObject(searchCacheKey);
|
||||
}
|
||||
HashMap<String, Object> selectCache = new HashMap<>();
|
||||
return PageUtils.toPage(pmsProductMapper.selectPmsProductList(pmsProduct), x -> toPmsProductDataVo(x, selectCache));
|
||||
GenericsTableDataInfo<PmsProductDataVo> pageList = PageUtils.toPage(pmsProductMapper.selectPmsProductList(pmsProduct), x -> toPmsProductDataVo(x, selectCache));
|
||||
if (performanceEnterpriseIdentifier.equals(enterpriseIdentifier)){
|
||||
redisService.setCacheObject(searchCacheKey, pageList, 1L, TimeUnit.HOURS);
|
||||
}
|
||||
return pageList;
|
||||
}
|
||||
|
||||
private PmsProductDataVo toPmsProductDataVo(PmsProduct pmsProduct, HashMap<String, Object> hashMap) {
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ public class PmsProductLibraryServiceImpl implements IPmsProductLibraryService {
|
|||
public GenericsTableDataInfo<DocResultVo> selectDocList(DocSearchVo docSearchVo) {
|
||||
PmsEnterprise pmsEnterprise = pmsEnterpriseService.selectPmsEnterpriseByIdentifier(docSearchVo.getEnterpriseIdentifier());
|
||||
GenericsTableDataInfo<DocResultVo> docTableList = new GenericsTableDataInfo<>();
|
||||
GenericsTableDataInfo<PmsDocumentVo> pmsDocList = pmsDocumentService.selectPmsDocumentVoList(docSearchVo.toPmsDocumentSearchVo(pmsEnterprise.getId()));
|
||||
GenericsTableDataInfo<PmsDocumentVo> pmsDocList = pmsDocumentService.selectPmsDocumentVoList(docSearchVo.toPmsDocumentSearchVo(pmsEnterprise.getId()), docSearchVo.getEnterpriseIdentifier());
|
||||
if (pmsDocList.getRows() != null && !pmsDocList.getRows().isEmpty()) {
|
||||
PmsProductLibraryRepositories productRepo =
|
||||
pmsProductLibraryRepositoriesService.getPmsProductLibraryRepositories(true, docSearchVo.getEnterpriseIdentifier(), docSearchVo.getProductRepoName(), null);
|
||||
|
|
|
|||
|
|
@ -43,9 +43,9 @@ public class PmsProjectController extends BaseController
|
|||
@ApiImplicitParam(name = "orderByColumn", value = "排序列(更新时间:updateTime,创建时间:createTime)", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "isAsc", value = "排序的方向desc或者asc,默认asc", paramType = "query", dataType = "String")
|
||||
})
|
||||
public GenericsTableDataInfo<PmsProjectDetailVo> list(PmsProjectSearchVo pmsProjectSearchVo)
|
||||
public GenericsTableDataInfo<PmsProjectDetailVo> list(@PathVariable String enterpriseIdentifier, PmsProjectSearchVo pmsProjectSearchVo)
|
||||
{
|
||||
return pmsProjectService.selectPmsProjectList(pmsProjectSearchVo);
|
||||
return pmsProjectService.selectPmsProjectList(pmsProjectSearchVo, enterpriseIdentifier);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ 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) {
|
||||
JSONObject result = pmsProjectIssuesService.selectPmsProjectIssuesList(pmsProjectIssuesSearchVo);
|
||||
public AjaxResult list(@PathVariable String enterpriseIdentifier, PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo) {
|
||||
JSONObject result = pmsProjectIssuesService.selectPmsProjectIssuesList(pmsProjectIssuesSearchVo, enterpriseIdentifier);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,13 +50,13 @@ public class PmsProjectTestcaseController extends BaseController {
|
|||
@ApiImplicitParam(name = "orderByColumn", value = "排序列(更新时间:updateTime,创建时间:createTime)", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "isAsc", value = "排序的方向desc或者asc,默认asc", paramType = "query", dataType = "String")
|
||||
})
|
||||
public GenericsTableDataInfo<PmsProjectTestcaseDataVo> list(@Validated PmsProjectTestcaseSearchVo pmsProjectTestcaseSearchVo) {
|
||||
public GenericsTableDataInfo<PmsProjectTestcaseDataVo> list(@PathVariable String enterpriseIdentifier, @Validated PmsProjectTestcaseSearchVo pmsProjectTestcaseSearchVo) {
|
||||
PmsProjectTestcase pmsProjectTestcase = pmsProjectTestcaseSearchVo.toPmsProjectTestcase();
|
||||
if (pmsProjectTestcase.getPmsModuleId() != null && pmsProjectTestcase.getPmsModuleId() != 0) {
|
||||
List<Long> moduleIdList = pmsProductModuleService.selectChildrenPmsProductModuleIdList(pmsProjectTestcase.getPmsModuleId());
|
||||
List<Long> moduleIdList = pmsProductModuleService.selectChildrenPmsProductModuleIdList(pmsProjectTestcase.getPmsModuleId(), enterpriseIdentifier);
|
||||
pmsProjectTestcase.setChildrenModuleIdList(moduleIdList);
|
||||
}
|
||||
return pmsProjectTestcaseService.selectPmsProjectTestcasePageList(pmsProjectTestcase);
|
||||
return pmsProjectTestcaseService.selectPmsProjectTestcasePageList(pmsProjectTestcase, enterpriseIdentifier);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -48,9 +48,9 @@ public class PmsProjectTestsheetCasesController extends BaseController
|
|||
@ApiImplicitParam(name = "orderByColumn", value = "排序列(更新时间:updateTime,创建时间:createTime)", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "isAsc", value = "排序的方向desc或者asc,默认asc", paramType = "query", dataType = "String")
|
||||
})
|
||||
public GenericsTableDataInfo<PmsProjectTestsheetCaseVo> list(@Validated PmsProjectTestsheetCaseSearchVo searchVo)
|
||||
public GenericsTableDataInfo<PmsProjectTestsheetCaseVo> list(@PathVariable String enterpriseIdentifier, @Validated PmsProjectTestsheetCaseSearchVo searchVo)
|
||||
{
|
||||
return pmsProjectTestsheetCasesService.selectPmsProjectTestsheetCasesList(searchVo);
|
||||
return pmsProjectTestsheetCasesService.selectPmsProjectTestsheetCasesList(searchVo, enterpriseIdentifier);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class PmsProjectTestsheetIssuesController extends BaseController
|
|||
@ApiOperation(value = "查询测试单执行用例关联缺陷列表")
|
||||
@RequiresPermissions(value = {"pms:pmsProject:show", "pms:pmsProject:showMe"}, logical = Logical.OR)
|
||||
@GetMapping("/list/{projectTestsheetCasesId}")
|
||||
public AjaxResult list(@Validated PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo, @ApiParam("执行测试用例ID") @PathVariable Long projectTestsheetCasesId) {
|
||||
public AjaxResult list(@PathVariable String enterpriseIdentifier, @Validated PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo, @ApiParam("执行测试用例ID") @PathVariable Long projectTestsheetCasesId) {
|
||||
PmsProjectTestsheetIssues selectedIssueQuery= new PmsProjectTestsheetIssues();
|
||||
selectedIssueQuery.setProjectTestsheetCasesId(projectTestsheetCasesId);
|
||||
List<Long> selectedIds = Optional.ofNullable(pmsProjectTestsheetIssuesService.selectPmsProjectTestsheetIssuesList(selectedIssueQuery)).orElse(Collections.emptyList()).stream()
|
||||
|
|
@ -60,7 +60,7 @@ public class PmsProjectTestsheetIssuesController extends BaseController
|
|||
return success(new ArrayList<>());
|
||||
}
|
||||
pmsProjectIssuesSearchVo.setIds(StringUtils.join(selectedIds, ","));
|
||||
JSONObject result = pmsProjectIssuesService.selectPmsProjectIssuesList(pmsProjectIssuesSearchVo);
|
||||
JSONObject result = pmsProjectIssuesService.selectPmsProjectIssuesList(pmsProjectIssuesSearchVo, enterpriseIdentifier);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +94,8 @@ public class PmsProjectTestsheetIssuesController extends BaseController
|
|||
@RequiresPermissions(value = {"pms:pmsProject:show", "pms:pmsProject:showMe"}, logical = Logical.OR)
|
||||
@GetMapping("/unlink/{projectTestsheetCasesId}")
|
||||
@ApiOperation(value = "查询与执行测试用例未关联缺陷")
|
||||
public AjaxResult getIssueUnlinks(@Validated PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo,
|
||||
public AjaxResult getIssueUnlinks(@PathVariable String enterpriseIdentifier,
|
||||
@Validated PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo,
|
||||
@ApiParam("执行测试用例ID") @PathVariable Long projectTestsheetCasesId,
|
||||
@ApiParam("0:获取所有未被任何用例关联过的缺陷(默认),1:获取所有与当前用例未关联缺陷") Integer isAll) {
|
||||
PmsProjectTestsheetIssues selectedIssueQuery= new PmsProjectTestsheetIssues();
|
||||
|
|
@ -105,7 +106,7 @@ public class PmsProjectTestsheetIssuesController extends BaseController
|
|||
selectedIds.addAll(pmsProjectTestsheetIssuesService.selectAllDistinctIssueId());
|
||||
}
|
||||
pmsProjectIssuesSearchVo.setExcludeIds(StringUtils.join(selectedIds, ","));
|
||||
JSONObject result = pmsProjectIssuesService.selectPmsProjectIssuesList(pmsProjectIssuesSearchVo);
|
||||
JSONObject result = pmsProjectIssuesService.selectPmsProjectIssuesList(pmsProjectIssuesSearchVo, enterpriseIdentifier);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,9 +35,9 @@ public class PmsProjectWeeklyReportController {
|
|||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperation(value = "项目周报列表")
|
||||
public AjaxResult list(PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo)
|
||||
public AjaxResult list(@PathVariable String enterpriseIdentifier, PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo)
|
||||
{
|
||||
JSONObject result = pmsProjectIssuesService.selectPmsProjectIssuesList(pmsProjectIssuesSearchVo);
|
||||
JSONObject result = pmsProjectIssuesService.selectPmsProjectIssuesList(pmsProjectIssuesSearchVo, enterpriseIdentifier);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -149,6 +149,9 @@ public class PmsProjectTestcase extends BaseEntity {
|
|||
@ApiModelProperty(value = "产品需求规格id")
|
||||
private Long productReqSpecsId;
|
||||
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
|
||||
public PmsProjectTestcaseDataVo toPmsProjectTestcaseDataVo() {
|
||||
PmsProjectTestcaseDataVo target = new PmsProjectTestcaseDataVo();
|
||||
BeanUtils.copyProperties(this, target);
|
||||
|
|
|
|||
|
|
@ -24,4 +24,8 @@ public class PmsProjectSearchVo extends BaseEntity{
|
|||
@ApiModelProperty(value = "产品id")
|
||||
private Long pmsProductId;
|
||||
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
private String enterpriseIdentifier;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,9 @@ public class PmsProjectTestcaseSearchVo {
|
|||
@ApiModelProperty(value = "产品需求规格id")
|
||||
private Long productReqSpecsId;
|
||||
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
|
||||
public PmsProjectTestcase toPmsProjectTestcase() {
|
||||
PmsProjectTestcase target = new PmsProjectTestcase();
|
||||
BeanUtils.copyProperties(this, target);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public interface IPmsProjectService
|
|||
*/
|
||||
List<PmsProject> selectPmsProjectList(PmsProject pmsProject);
|
||||
|
||||
GenericsTableDataInfo<PmsProjectDetailVo> selectPmsProjectList(PmsProjectSearchVo pmsProjectSearchVo);
|
||||
GenericsTableDataInfo<PmsProjectDetailVo> selectPmsProjectList(PmsProjectSearchVo pmsProjectSearchVo, String enterpriseIdentifier);
|
||||
|
||||
/**
|
||||
* 新增项目
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public interface IPmsProjectTestcaseService {
|
|||
* @param pmsProjectTestcase 测试用例管理
|
||||
* @return 测试用例管理集合
|
||||
*/
|
||||
public GenericsTableDataInfo<PmsProjectTestcaseDataVo> selectPmsProjectTestcasePageList(PmsProjectTestcase pmsProjectTestcase);
|
||||
public GenericsTableDataInfo<PmsProjectTestcaseDataVo> selectPmsProjectTestcasePageList(PmsProjectTestcase pmsProjectTestcase, String enterpriseIdentifier);
|
||||
|
||||
/**
|
||||
* 新增测试用例管理
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public interface IPmsProjectTestsheetCasesService
|
|||
* @param pmsProjectTestsheetCases 测试单执行用例
|
||||
* @return 测试单执行用例集合
|
||||
*/
|
||||
public List<PmsProjectTestsheetCases> selectPmsProjectTestsheetCasesList(PmsProjectTestsheetCases pmsProjectTestsheetCases);
|
||||
public List<PmsProjectTestsheetCases> selectPmsProjectTestsheetCasesList(PmsProjectTestsheetCases pmsProjectTestsheetCases, String enterpriseIdentifier);
|
||||
|
||||
/**
|
||||
* 查询测试单执行用例列表数量
|
||||
|
|
@ -57,7 +57,7 @@ public interface IPmsProjectTestsheetCasesService
|
|||
* @param searchVo 测试单执行用例
|
||||
* @return 测试单执行用例集合
|
||||
*/
|
||||
public GenericsTableDataInfo<PmsProjectTestsheetCaseVo> selectPmsProjectTestsheetCasesList(PmsProjectTestsheetCaseSearchVo searchVo);
|
||||
public GenericsTableDataInfo<PmsProjectTestsheetCaseVo> selectPmsProjectTestsheetCasesList(PmsProjectTestsheetCaseSearchVo searchVo, String enterpriseIdentifier);
|
||||
|
||||
/**
|
||||
* 新增测试单执行用例
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONObject;
|
|||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
|
||||
import com.microservices.common.redis.service.RedisService;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.pms.common.service.IPmsCommonService;
|
||||
import com.microservices.pms.dashboard.domain.vo.MyProjectIssuesSearchVo;
|
||||
|
|
@ -26,6 +27,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -34,6 +36,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.microservices.common.core.utils.DateUtils.YYYY_MM_DD;
|
||||
import static com.microservices.common.core.utils.JSONUtils.convertObjectToJSONObject;
|
||||
|
|
@ -72,14 +75,26 @@ public class PmsProjectIssuesService {
|
|||
|
||||
@Autowired
|
||||
private IPmsCommonService pmsCommonService;
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
@Value("${performance.enterpriseIdentifier:}")
|
||||
private String performanceEnterpriseIdentifier;
|
||||
|
||||
public JSONObject selectPmsProjectIssuesList(PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo, String enterpriseIdentifier) {
|
||||
String searchCacheKey = PmsUtils.generateCacheKey(pmsProjectIssuesSearchVo, enterpriseIdentifier);
|
||||
if (enterpriseIdentifier.equals(performanceEnterpriseIdentifier) &&redisService.hasKey(searchCacheKey)) {
|
||||
return (JSONObject) redisService.getCacheObject(searchCacheKey);
|
||||
}
|
||||
|
||||
public JSONObject selectPmsProjectIssuesList(PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo) {
|
||||
pmsProjectService.selectAndCheckPmsProjectById(pmsProjectIssuesSearchVo.getPmProjectId());
|
||||
JSONObject issueSearch = new JSONObject();
|
||||
convertObjectToJSONObject(pmsProjectIssuesSearchVo, issueSearch, null);
|
||||
try {
|
||||
return setProjectIssueListUserState(gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_ISSUE_LIST(issueSearch)));
|
||||
JSONObject issueListResult = setProjectIssueListUserState(gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_ISSUE_LIST(issueSearch)));
|
||||
if (performanceEnterpriseIdentifier.equals(enterpriseIdentifier)){
|
||||
redisService.setCacheObject(searchCacheKey, issueListResult, 1L, TimeUnit.HOURS);
|
||||
}
|
||||
return issueListResult;
|
||||
} catch (URISyntaxException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.microservices.common.core.utils.StringUtils;
|
|||
import com.microservices.common.core.utils.bean.BeanUtils;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
|
||||
import com.microservices.common.redis.service.RedisService;
|
||||
import com.microservices.pms.common.service.IPmsCommonService;
|
||||
import com.microservices.pms.enterprise.domain.PmsEnterprise;
|
||||
import com.microservices.pms.enterprise.service.IPmsEnterpriseService;
|
||||
|
|
@ -33,6 +34,7 @@ import com.microservices.system.api.domain.SysNotice;
|
|||
import com.microservices.system.api.domain.SysUser;
|
||||
import com.microservices.system.api.utils.FeignUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -44,6 +46,7 @@ import java.util.stream.Collectors;
|
|||
import static com.microservices.common.core.utils.PageUtils.startPage;
|
||||
import static com.microservices.common.core.utils.PageUtils.toPage;
|
||||
import static com.microservices.common.httpClient.constant.GitLinkConstants.DATA_KEY;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 项目Service业务层处理
|
||||
|
|
@ -96,6 +99,10 @@ public class PmsProjectServiceImpl implements IPmsProjectService {
|
|||
private PmsProjectTestsheetMapper pmsProjectTestsheetMapper;
|
||||
@Resource
|
||||
private PmsProjectTestReportMapper pmsProjectTestReportMapper;
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
@Value("${performance.enterpriseIdentifier:}")
|
||||
private String performanceEnterpriseIdentifier;
|
||||
|
||||
/**
|
||||
* 查询项目
|
||||
|
|
@ -131,7 +138,12 @@ public class PmsProjectServiceImpl implements IPmsProjectService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public GenericsTableDataInfo<PmsProjectDetailVo> selectPmsProjectList(PmsProjectSearchVo pmsProjectSearchVo) {
|
||||
public GenericsTableDataInfo<PmsProjectDetailVo> selectPmsProjectList(PmsProjectSearchVo pmsProjectSearchVo, String enterpriseIdentifier) {
|
||||
String searchCacheKey = PmsUtils.generateCacheKey(pmsProjectSearchVo, enterpriseIdentifier);
|
||||
if (enterpriseIdentifier.equals(performanceEnterpriseIdentifier) &&redisService.hasKey(searchCacheKey)) {
|
||||
return (GenericsTableDataInfo<PmsProjectDetailVo>) redisService.getCacheObject(searchCacheKey);
|
||||
}
|
||||
|
||||
startPage();
|
||||
List<PmsProject> pmsProjectList = pmsProjectMapper.selectPmsProjectListBySearchInput(pmsProjectSearchVo);
|
||||
List<String> projectIdList = pmsProjectList.stream()
|
||||
|
|
@ -142,7 +154,12 @@ public class PmsProjectServiceImpl implements IPmsProjectService {
|
|||
projectTotalCount = getProjectIssuesTotalCountByGitLink(projectIdList);
|
||||
}
|
||||
JSONObject finalProjectTotalCount = projectTotalCount;
|
||||
return toPage(pmsProjectList, pmsProject -> buildPmsProjectDetailVo(pmsProject, finalProjectTotalCount));
|
||||
GenericsTableDataInfo<PmsProjectDetailVo> page = toPage(pmsProjectList, pmsProject -> buildPmsProjectDetailVo(pmsProject, finalProjectTotalCount));
|
||||
if (performanceEnterpriseIdentifier.equals(enterpriseIdentifier)){
|
||||
redisService.setCacheObject(searchCacheKey, page, 1L, TimeUnit.HOURS);
|
||||
}
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.microservices.common.core.utils.JSONUtils;
|
|||
import com.microservices.common.core.utils.PageUtils;
|
||||
import com.microservices.common.core.utils.bean.BeanUtils;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.redis.service.RedisService;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.pms.common.service.IPmsCommonService;
|
||||
import com.microservices.pms.enterprise.domain.PmsEnterprise;
|
||||
|
|
@ -33,12 +34,14 @@ import com.microservices.pms.utils.PmsConstants;
|
|||
import com.microservices.pms.utils.PmsUtils;
|
||||
import com.microservices.system.api.domain.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.microservices.common.core.utils.PageUtils.startPage;
|
||||
|
||||
|
|
@ -70,6 +73,11 @@ public class PmsProjectTestcaseServiceImpl implements IPmsProjectTestcaseService
|
|||
private PmsProjectTestsheetCasesMapper pmsProjectTestsheetCasesMapper;
|
||||
@Autowired
|
||||
private IPmsProductRequirementService pmsProductRequirementService;
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Value("${performance.enterpriseIdentifier:}")
|
||||
private String performanceEnterpriseIdentifier;
|
||||
|
||||
/**
|
||||
* 查询测试用例管理
|
||||
|
|
@ -94,12 +102,21 @@ public class PmsProjectTestcaseServiceImpl implements IPmsProjectTestcaseService
|
|||
* @return 测试用例管理
|
||||
*/
|
||||
@Override
|
||||
public GenericsTableDataInfo<PmsProjectTestcaseDataVo> selectPmsProjectTestcasePageList(PmsProjectTestcase pmsProjectTestcase) {
|
||||
public GenericsTableDataInfo<PmsProjectTestcaseDataVo> selectPmsProjectTestcasePageList(PmsProjectTestcase pmsProjectTestcase, String enterpriseIdentifier) {
|
||||
String searchCacheKey = PmsUtils.generateCacheKey(pmsProjectTestcase, enterpriseIdentifier);
|
||||
if (enterpriseIdentifier.equals(performanceEnterpriseIdentifier) && redisService.hasKey(searchCacheKey)) {
|
||||
return (GenericsTableDataInfo<PmsProjectTestcaseDataVo>) redisService.getCacheObject(searchCacheKey);
|
||||
}
|
||||
|
||||
pmsProjectService.selectPmsProjectById(pmsProjectTestcase.getPmsProjectId());
|
||||
startPage();
|
||||
List<PmsProjectTestcase> pmsProjectTestcaseList = pmsProjectTestcaseMapper.selectPmsProjectTestcaseList(pmsProjectTestcase);
|
||||
HashMap<String, Object> hashMap = new HashMap<>();
|
||||
return PageUtils.toPage(pmsProjectTestcaseList, x -> toPmsProjectTestcaseDataVo(x, hashMap));
|
||||
GenericsTableDataInfo<PmsProjectTestcaseDataVo> page = PageUtils.toPage(pmsProjectTestcaseList, x -> toPmsProjectTestcaseDataVo(x, hashMap));
|
||||
if (enterpriseIdentifier.equals(performanceEnterpriseIdentifier)) {
|
||||
redisService.setCacheObject(searchCacheKey, page, 1L, TimeUnit.HOURS);
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
private PmsProjectTestcaseDataVo toPmsProjectTestcaseDataVo(PmsProjectTestcase pmsProjectTestcase, HashMap<String, Object> hashMap) {
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ public class PmsProjectTestsheetCasesServiceImpl implements IPmsProjectTestsheet
|
|||
* @return 测试单执行用例
|
||||
*/
|
||||
@Override
|
||||
public List<PmsProjectTestsheetCases> selectPmsProjectTestsheetCasesList(PmsProjectTestsheetCases pmsProjectTestsheetCases) {
|
||||
public List<PmsProjectTestsheetCases> selectPmsProjectTestsheetCasesList(PmsProjectTestsheetCases pmsProjectTestsheetCases, String enterpriseIdentifier) {
|
||||
pmsProjectTestsheetService.selectPmsProjectTestsheetById(pmsProjectTestsheetCases.getProjectTestsheetId());
|
||||
return pmsProjectTestsheetCasesMapper.selectPmsProjectTestsheetCasesList(pmsProjectTestsheetCases);
|
||||
}
|
||||
|
|
@ -111,7 +111,7 @@ public class PmsProjectTestsheetCasesServiceImpl implements IPmsProjectTestsheet
|
|||
* @return 测试单执行用例
|
||||
*/
|
||||
@Override
|
||||
public GenericsTableDataInfo<PmsProjectTestsheetCaseVo> selectPmsProjectTestsheetCasesList(PmsProjectTestsheetCaseSearchVo searchVo) {
|
||||
public GenericsTableDataInfo<PmsProjectTestsheetCaseVo> selectPmsProjectTestsheetCasesList(PmsProjectTestsheetCaseSearchVo searchVo, String enterpriseIdentifier) {
|
||||
pmsProjectTestsheetService.selectPmsProjectTestsheetById(searchVo.getProjectTestsheetId());
|
||||
PageUtils.startPage();
|
||||
PmsProjectTestcase pmsProjectTestcase = new PmsProjectTestcase();
|
||||
|
|
@ -120,7 +120,7 @@ public class PmsProjectTestsheetCasesServiceImpl implements IPmsProjectTestsheet
|
|||
pmsProjectTestcase.getParams().put("testerId", searchVo.getTesterId());
|
||||
pmsProjectTestcase.getParams().put("testStatus", searchVo.getTestStatus());
|
||||
if (pmsProjectTestcase.getPmsModuleId() != null && pmsProjectTestcase.getPmsModuleId() != 0) {
|
||||
List<Long> moduleIdList = pmsProductModuleService.selectChildrenPmsProductModuleIdList(pmsProjectTestcase.getPmsModuleId());
|
||||
List<Long> moduleIdList = pmsProductModuleService.selectChildrenPmsProductModuleIdList(pmsProjectTestcase.getPmsModuleId(), enterpriseIdentifier);
|
||||
pmsProjectTestcase.setChildrenModuleIdList(moduleIdList);
|
||||
}
|
||||
// 增加时排除已增加到测试单的用例
|
||||
|
|
|
|||
|
|
@ -173,4 +173,6 @@ public class PmsConstants {
|
|||
* 流水线类型:图形化
|
||||
*/
|
||||
public final static Integer PIPELINE_TYPE_GRAPHIC = 2;
|
||||
|
||||
public final static String ENTERPRISE_INFO_PREFIX = "enterpriseInfo:";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.microservices.pms.utils;
|
||||
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
|
|
@ -76,4 +78,26 @@ public class PmsUtils {
|
|||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static String generateCacheKey(Object searchVo, String enterpriseIdentifier) {
|
||||
String currentUserName = SecurityUtils.getUsername();
|
||||
StringBuilder keyBuilder = new StringBuilder("SEARCH:").append(enterpriseIdentifier).append(":").append(currentUserName).append(":").append(searchVo.getClass().getSimpleName());
|
||||
Field[] fields = searchVo.getClass().getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
field.setAccessible(true); // 允许访问私有字段
|
||||
try {
|
||||
Object value = field.get(searchVo);
|
||||
if (value != null) {
|
||||
keyBuilder.append(":").append(field.getName()).append("=").append(value.toString()).append("&");
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
// 移除最后一个 "&"
|
||||
if (keyBuilder.length() > 0) {
|
||||
keyBuilder.setLength(keyBuilder.length() - 1);
|
||||
}
|
||||
return keyBuilder.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -543,8 +543,14 @@ public class SysUserServiceImpl implements ISysUserService {
|
|||
if (gitLinkToken == null) {
|
||||
return null;
|
||||
}
|
||||
//1、通过GitLinkToken在Gitlink数据库的tokens中查找是否存在登录用户,并获取用户id
|
||||
Long gitLinkUserId = forgeUserMapper.selectUserIdByGitLinkToken(gitLinkToken);
|
||||
String userIdByGitlinkTokenKey = "UserIdByGitlinkToken:" + gitLinkToken;
|
||||
Long gitLinkUserId = redisService.getCacheObject(userIdByGitlinkTokenKey);
|
||||
if (gitLinkUserId == null) {
|
||||
//1、通过GitLinkToken在Gitlink数据库的tokens中查找是否存在登录用户,并获取用户id
|
||||
gitLinkUserId = forgeUserMapper.selectUserIdByGitLinkToken(gitLinkToken);
|
||||
redisService.setCacheObject(userIdByGitlinkTokenKey, gitLinkUserId);
|
||||
}
|
||||
|
||||
//2、在本系统中查找该gitLinkUserId是否存在关联用户
|
||||
SysUser sysUser = userMapper.selectUserByGitLinkUserId(gitLinkUserId);
|
||||
//3、若不存在则在Gitlink数据库的users表中获取Gitlink用户信息,并同步在本系统中创建该用户
|
||||
|
|
|
|||
Loading…
Reference in New Issue