Commit bf14ebe6 by zhiwj

指标修改

parent 65338ca5
......@@ -123,5 +123,5 @@ public interface IndexDescApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.cloud.dto.IndexDescDTO>>
* @throws
*/
ServiceResponse<List<IndexDescDTO>> listAllUnRel();
ServiceResponse<List<IndexDescDTO>> listAllUnRel(String moduleIds);
}
package com.gic.cloud.operation.web.controller;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.authcenter.security.core.util.UserUtils;
......@@ -11,6 +12,7 @@ import com.gic.cloud.service.IndexLogApiService;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.redis.data.util.RedisUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -96,4 +98,13 @@ public class DataExplainController {
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/data-module-list")
public RestResponse moduleList() {
Object cache = RedisUtil.getCache("enterprise:datacloud:moduleList");
if (cache != null) {
return RestResponse.success(JSON.parseArray(cache.toString()));
}
return RestResponse.success();
}
}
\ No newline at end of file
......@@ -132,8 +132,8 @@ public class IndexController {
}
@RequestMapping("/module-list")
public RestResponse moduleList() {
ServiceResponse<List<IndexDescDTO>> serviceResponse = indexDescApiService.listAllUnRel();
public RestResponse moduleList(String moduleIds) {
ServiceResponse<List<IndexDescDTO>> serviceResponse = indexDescApiService.listAllUnRel(moduleIds);
List<IndexDescDTO> list = serviceResponse.getResult();
List<ModuleVO> moduleVOList = new ArrayList<>();
for (IndexDescDTO indexDescDTO : list) {
......
......@@ -10,14 +10,13 @@ import com.gic.cloud.service.*;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.response.EnterpriseServiceResponse;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @author zhiwj
......@@ -103,9 +102,17 @@ public class IndexDescApiServiceImpl implements IndexDescApiService {
}
@Override
public ServiceResponse<List<IndexDescDTO>> listAllUnRel() {
public ServiceResponse<List<IndexDescDTO>> listAllUnRel(String moduleIds) {
List<String> list = new ArrayList<>();
List<String> relModuleIdList = indexModuleRelService.listRelModuleId(LogAndUpdateTipsTypeEnum.INDEX.getCode());
List<Integer> indexDescIdList = Optional.ofNullable(relModuleIdList).orElse(Collections.emptyList())
if (CollectionUtils.isNotEmpty(relModuleIdList)) {
list.addAll(relModuleIdList);
}
if (StringUtils.isNotBlank(moduleIds)) {
List<String> relModuleIdList2 = Stream.of(moduleIds.split(",")).collect(Collectors.toList());
list.addAll(relModuleIdList2);
}
List<Integer> indexDescIdList = Optional.of(list).orElse(Collections.emptyList())
.stream().map(Integer::valueOf).collect(Collectors.toList());
List<TabIndexDesc> indexDescList = this.indexDescService.listAllUnRel(indexDescIdList);
List<IndexDescDTO> indexDescDTOList = EntityUtil.changeEntityListByJSON(IndexDescDTO.class, indexDescList);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment