4
0

3 کامیت‌ها 600b930eb1 ... a98b86d9dd

نویسنده SHA1 پیام تاریخ
  lixing a98b86d9dd Merge branch 'v4.0.1' into v4.1.0 2 سال پیش
  lixing 533129358e 查询项目增加一个项目状态的默认查询条件 2 سال پیش
  lixing b0c2865f8d 增加日志记录可选报告类型的获取过程 2 سال پیش

+ 2 - 0
src/main/java/com/persagy/apm/report/dependencies/saasweb/model/dto/QueryProjectDTO.java

@@ -21,6 +21,8 @@ public class QueryProjectDTO extends PoemsFeignBaseDTO {
     @ApiModelProperty("集团编码")
     private String groupCode;
 
+    private String state = "1";
+
     public QueryProjectDTO() {
         super.setDefaultValue();
     }

+ 6 - 1
src/main/java/com/persagy/apm/report/dependencies/saasweb/service/impl/SaasWebServiceImpl.java

@@ -814,7 +814,8 @@ public class SaasWebServiceImpl implements ISaasWebService {
 
         Set<String> availableProjectIds = availableProjects.stream().
                 map(SimpleProjectVO::getProjectId).collect(Collectors.toSet());
-
+        log.info("当前业态:{}", buildingTypes);
+        log.info("用户在当前业态下的可选项目:{}", availableProjectIds);
         for (FilterPartitionVO partition : partitions) {
             List<SimpleProjectVO> projects = partition.getProjects();
             if (CollectionUtils.isEmpty(projects)) {
@@ -824,10 +825,14 @@ public class SaasWebServiceImpl implements ISaasWebService {
                     map(SimpleProjectVO::getProjectId).collect(Collectors.toSet());
             // 取用户可选项目和分区下项目的交集,projectIds会被更新为两个集合的交集 projectIds是用户在分区下可选的项目
             projectIds.retainAll(availableProjectIds);
+            log.info("当前分区:{}:{}", partition.getAreaId(), partition.getAreaName());
+            log.info("用户在当前业态当前分区下的可选项目:{}", projectIds);
             // 根据业态和分区过滤项目
             List<PoemsProjectVO> projectsByAreaAndBuildingType = getProjectsByAreaAndBuildingTypes(partition.getAreaId(), buildingTypes);
             Set<String> projectIdsByAreaAndBuildingType = projectsByAreaAndBuildingType.stream().
                     map(PoemsProjectVO::getProjectId).collect(Collectors.toSet());
+
+            log.info("当前分区该业态下的所有项目:{}", projectIdsByAreaAndBuildingType);
             //            projectIdsByAreaAndBuildingType.retainAll(availableProjectIds);
             // 如果用户拥有的项目数和分区下的项目数不一致,则用户没有该分区的权限
             if (CollectionUtils.isEmpty(projectIds) || projectIdsByAreaAndBuildingType.size() != projectIds.size()) {

+ 3 - 0
src/main/java/com/persagy/apm/report/userconfig/reporttype/service/impl/ReportTypeServiceImpl.java

@@ -28,6 +28,7 @@ import com.persagy.apm.report.dependencies.saasweb.model.vo.PartitionVO;
 import com.persagy.apm.report.dependencies.saasweb.model.vo.SimpleProjectVO;
 import com.persagy.apm.report.dependencies.saasweb.service.ISaasWebService;
 import com.persagy.apm.report.common.utils.ApmStrUtils;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.assertj.core.util.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -47,6 +48,7 @@ import java.util.stream.Collectors;
  * @version V1.0 2021-05-19 10:39:15
  */
 @Service
+@Slf4j
 public class ReportTypeServiceImpl extends ServiceImpl<ReportTypeMapper, ReportType>
         implements IReportTypeService {
     @Autowired
@@ -266,6 +268,7 @@ public class ReportTypeServiceImpl extends ServiceImpl<ReportTypeMapper, ReportT
             for (ReportType reportType : allReportTypes) {
                 List<String> availableBelongIds = saasWebService.getAvailableAreaIds(
                         ApmStrUtils.str2List(reportType.getBuildingTypes()));
+                log.info("报告类型:{}, 可用分区id: {}", reportType.getName(), availableBelongIds);
                 if (!CollectionUtils.isEmpty(availableBelongIds)) {
                     listItemVOList.add(packageReportTypeListItemVO(reportType, availableBelongIds));
                 }