|
|
@@ -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)); |
|
|
|
} |
|
|
|
} |