|
@@ -5,11 +5,12 @@ import com.diagbot.client.PrecmanServiceClient;
|
|
|
import com.diagbot.dto.BIDTO;
|
|
|
import com.diagbot.dto.BIItemDTO;
|
|
|
import com.diagbot.dto.BIModuleDTO;
|
|
|
-import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.enums.StatisticsTypeEnum;
|
|
|
+import com.diagbot.exception.CommonErrorCode;
|
|
|
+import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.util.EntityUtil;
|
|
|
-import com.diagbot.util.RespDTOUtil;
|
|
|
-import com.google.common.collect.Lists;
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
+import io.github.lvyahui8.spring.aggregate.facade.DataBeanAggregateQueryFacade;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@@ -28,25 +29,35 @@ public class StatisticsFacade {
|
|
|
@Autowired
|
|
|
private PrecmanServiceClient precmanServiceClient;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ DataBeanAggregateQueryFacade dataBeanAggregateQueryFacade;
|
|
|
+
|
|
|
public BIDTO count() {
|
|
|
BIDTO bidto = new BIDTO();
|
|
|
- List<BIItemDTO> biItemDTOList = Lists.newLinkedList();
|
|
|
- //静态知识统计
|
|
|
- RespDTO<List<BIItemDTO>> cdResp = knowledgemanServiceClient.conceptDetailBI();
|
|
|
- if (RespDTOUtil.respIsOK(cdResp)) {
|
|
|
- biItemDTOList.addAll(cdResp.data);
|
|
|
- }
|
|
|
- //预问诊统计
|
|
|
- RespDTO<BIItemDTO> precResp = precmanServiceClient.getCount();
|
|
|
- if (RespDTOUtil.respIsOK(precResp)) {
|
|
|
- biItemDTOList.add(precResp.data);
|
|
|
+ List<BIItemDTO> biItemDTOList = ListUtil.newArrayList();
|
|
|
+ try {
|
|
|
+ biItemDTOList
|
|
|
+ = dataBeanAggregateQueryFacade.get("biAll", null, List.class);
|
|
|
+ } catch (Exception e){
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
|
|
|
}
|
|
|
|
|
|
- //术语统计
|
|
|
- RespDTO<List<BIItemDTO>> conceptResp = knowledgemanServiceClient.queryLibTypeCou();
|
|
|
- if (RespDTOUtil.respIsOK(conceptResp)) {
|
|
|
- biItemDTOList.addAll(conceptResp.data);
|
|
|
- }
|
|
|
+ // //静态知识统计
|
|
|
+ // RespDTO<List<BIItemDTO>> cdResp = knowledgemanServiceClient.conceptDetailBI();
|
|
|
+ // if (RespDTOUtil.respIsOK(cdResp)) {
|
|
|
+ // biItemDTOList.addAll(cdResp.data);
|
|
|
+ // }
|
|
|
+ // //预问诊统计
|
|
|
+ // RespDTO<BIItemDTO> precResp = precmanServiceClient.getCount();
|
|
|
+ // if (RespDTOUtil.respIsOK(precResp)) {
|
|
|
+ // biItemDTOList.add(precResp.data);
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // //术语统计
|
|
|
+ // RespDTO<List<BIItemDTO>> conceptResp = knowledgemanServiceClient.queryLibTypeCou();
|
|
|
+ // if (RespDTOUtil.respIsOK(conceptResp)) {
|
|
|
+ // biItemDTOList.addAll(conceptResp.data);
|
|
|
+ // }
|
|
|
|
|
|
Map<String, List<BIItemDTO>> map = EntityUtil.makeEntityListMap(biItemDTOList, "moduleName");
|
|
|
bidto.setDiagnose(getBIModuleDTO(map, StatisticsTypeEnum.DIAGNOSE.getKey()));
|