Browse Source

debug 查询最新项目

tags/24080901
PoffyZhang 1 year ago
parent
commit
8a702a35a8
5 changed files with 21 additions and 22 deletions
  1. +17
    -18
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/IrsManage.java
  2. +1
    -1
      pmapi/src/main/resources/application-dev.yml
  3. +1
    -1
      pmapi/src/main/resources/application-prod.yml
  4. +1
    -1
      pmapi/src/test/resources/application-dev.yml
  5. +1
    -1
      pmapi/src/test/resources/application-prod.yml

+ 17
- 18
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/IrsManage.java View File

@@ -33,8 +33,8 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor
public class IrsManage {

@Value("${irs.is-piot-tasks}")
private Boolean isPiotTasks;
@Value("${irs.is-search-app}")
private Boolean isSearchApp;

private final IrsApplicationService irsApplicationService;

@@ -44,31 +44,22 @@ public class IrsManage {


public List<IrsApplicationVO> applicationList() {
List<IrsApplication> list = irsApplicationService.list();
if(CollUtil.isEmpty(list)){
return Collections.emptyList();
}
return CollUtils.convert(list,app -> BeanUtil.copyProperties(app,IrsApplicationVO.class));
}

public List<PiotTasksVO> listPiotTasks() {
//不请求IRS
if(!isPiotTasks){
List<NdPiotTasks> list = piotTasksService.list();
if(!isSearchApp) {
List<IrsApplication> list = irsApplicationService.list();
if(CollUtil.isEmpty(list)){
return Collections.emptyList();
}
return CollUtils.convert(list,task -> BeanUtil.copyProperties(task,PiotTasksVO.class));
return CollUtils.convert(list,app -> BeanUtil.copyProperties(app,IrsApplicationVO.class));
}

try {
List<ApiApplySearchResult> apiApplySearchResults = appIrsManage.searchApps(new ApiApplyDTO());
if(CollUtil.isNotEmpty(apiApplySearchResults)){
return apiApplySearchResults.stream().map(apply -> {
PiotTasksVO vo = new PiotTasksVO();
vo.setTaskCode(apply.getAppId());
vo.setTaskName(apply.getName());
vo.setImportantTaskName(apply.getName());
vo.setSubSceneApplicationName(apply.getName());
IrsApplicationVO vo = new IrsApplicationVO();
vo.setApplicationCode(apply.getAppId());
vo.setApplicationName(apply.getName());
return vo;
}).collect(Collectors.toList());
}
@@ -77,4 +68,12 @@ public class IrsManage {
}
return Collections.emptyList();
}

public List<PiotTasksVO> listPiotTasks() {
List<NdPiotTasks> list = piotTasksService.list();
if(CollUtil.isEmpty(list)){
return Collections.emptyList();
}
return CollUtils.convert(list,task -> BeanUtil.copyProperties(task,PiotTasksVO.class));
}
}

+ 1
- 1
pmapi/src/main/resources/application-dev.yml View File

@@ -204,7 +204,7 @@ provincial:

#天印服务器接口信息
irs:
is-piot-tasks: false
is-search-app: false
seal-platform:
project-id: 330001110
project-secret: 70e512d40c8f440484db4acab181570a


+ 1
- 1
pmapi/src/main/resources/application-prod.yml View File

@@ -207,7 +207,7 @@ provincial:

#天印服务器接口信息
irs:
is-piot-tasks: true
is-search-app: true
seal-platform:
project-id: 330001110
project-secret: 70e512d40c8f440484db4acab181570a


+ 1
- 1
pmapi/src/test/resources/application-dev.yml View File

@@ -203,7 +203,7 @@ provincial:

#天印服务器接口信息
irs:
is-piot-tasks: false
is-search-app: false
seal-platform:
project-id: 330001110
project-secret: 70e512d40c8f440484db4acab181570a


+ 1
- 1
pmapi/src/test/resources/application-prod.yml View File

@@ -202,7 +202,7 @@ provincial:

#天印服务器接口信息
irs:
is-piot-tasks: true
is-search-app: true
seal-platform:
project-id: 330001110
project-secret: 70e512d40c8f440484db4acab181570a


Loading…
Cancel
Save