Просмотр исходного кода

[task-1938]【后端】实验室管理看板接口开发

Li Yuan 1 год назад
Родитель
Сommit
1e4bd6e254

+ 13 - 9
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/business/service/impl/StatisticServiceImpl.java

@@ -10,6 +10,8 @@ import com.lc.ibps.business.dto.LabsDashBoardDTO;
 import com.lc.ibps.business.dto.LabsDashBoardGroupDTO;
 import com.lc.ibps.business.service.StatisticService;
 import com.lc.ibps.cloud.entity.APIResult;
+import com.lc.ibps.common.api.IDictionaryService;
+import com.lc.ibps.common.cat.persistence.entity.DictionaryPo;
 import com.lc.ibps.org.api.IPartyPositionService;
 import com.lc.ibps.org.party.persistence.entity.PartyPositionPo;
 import org.slf4j.Logger;
@@ -39,12 +41,15 @@ public class StatisticServiceImpl implements StatisticService {
         if (diDian == null) return null;
         List<String> deptList = getDeptList(diDian);
         if(Collections.isEmpty(deptList)) return null;
+        List<DictionaryPo> dictionaryPoList = getZhiBiao();
+        if(Collections.isEmpty(dictionaryPoList)) return null;
+
         List<LabsDashBoardDTO> result = new ArrayList<>();
-        for (Map.Entry<String,String> entry: getZhiBiao().entrySet()) {
+        for (DictionaryPo entry: dictionaryPoList) {
             LabsDashBoardDTO dto = new LabsDashBoardDTO();
             Map<String,LabsDashBoardGroupDTO> dtoGroup = getIndex(diDian,year,deptList,entry.getKey());
             dto.calcTotally(dtoGroup.values());
-            dto.setName(entry.getValue());
+            dto.setName(entry.getName());
             dto.generateGroups(dtoGroup,deptList,filter);
             result.add(dto);
         }
@@ -52,13 +57,12 @@ public class StatisticServiceImpl implements StatisticService {
         return result;
     }
 
-    private Map<String,String> getZhiBiao(){
-        Map<String,String> map = new HashMap<>();
-        map.put("v_LabsDashBoard_1_zaiGang","在岗人员培训");
-        map.put("v_LabsDashBoard_2_gangQian","岗前培训");
-        map.put("v_LabsDashBoard_3_waiBuZhiLiang","外部质量管理");
-        map.put("v_LabsDashBoard_4_neiBuBiDui","内部比对实验");
-        return map;
+    private List<DictionaryPo> getZhiBiao(){
+
+        IDictionaryService iDictionaryService = AppUtil.getBean(IDictionaryService.class);
+        List<DictionaryPo> glkb = iDictionaryService.findByTypeKey("glkb").getData();
+
+        return glkb;
     }
 
     private Map<String,LabsDashBoardGroupDTO> getIndex(String diDian, String year, List<String> deptList, String viewName) {