|
@@ -3,6 +3,7 @@ package com.diagbot.facade;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.diagbot.client.CdssCoreClient;
|
|
|
+import com.diagbot.client.UserServiceClient;
|
|
|
import com.diagbot.dto.KlRuleByIdParDTO;
|
|
|
import com.diagbot.dto.KlRuleInfoDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
@@ -18,6 +19,10 @@ import com.diagbot.vo.KlRuleSatartOrdisaVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
/**
|
|
|
* @Description:
|
|
|
* @Author:zhaops
|
|
@@ -27,11 +32,21 @@ import org.springframework.stereotype.Component;
|
|
|
public class KlRuleFacade extends KlRuleServiceImpl {
|
|
|
@Autowired
|
|
|
CdssCoreClient cdssCoreClient;
|
|
|
+ @Autowired
|
|
|
+ UserServiceClient userServiceClient;
|
|
|
|
|
|
public Page<KlRuleInfoDTO> getKlRuleInfoPage(KlRuleInfoVO klRuleInfoVO) {
|
|
|
RespDTO<Page<KlRuleInfoDTO>> klRuleInfoPages = cdssCoreClient.getKlRuleInfoPages(klRuleInfoVO);
|
|
|
RespDTOUtil.respNGDeal(klRuleInfoPages, "获取分页获取规则维护列表数据失败");
|
|
|
- return klRuleInfoPages.data;
|
|
|
+ Page<KlRuleInfoDTO> records = klRuleInfoPages.data;
|
|
|
+ List<String> userIds = records.getRecords().stream()
|
|
|
+ .map(i -> i.getModifier()).distinct().collect(Collectors.toList());
|
|
|
+ RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(userIds);
|
|
|
+ RespDTOUtil.respNGDealCover(respDTO, "获取用户信息失败");
|
|
|
+ records.getRecords().forEach(i -> {
|
|
|
+ i.setModifierName(respDTO.data.get(i.getModifier()));
|
|
|
+ });
|
|
|
+ return records;
|
|
|
}
|
|
|
|
|
|
public KlRuleByIdParDTO getByIdRuleInfos(KlRuleByIdVO klRuleByIdVO) {
|