|
@@ -329,6 +329,80 @@ public class DrugConfigFacade {
|
|
return retMap;
|
|
return retMap;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取映射关系-公表名
|
|
|
|
+ *
|
|
|
|
+ * @param hospitalId
|
|
|
|
+ * @param hisNames
|
|
|
|
+ * @param uniqueNames
|
|
|
|
+ * @return Map<hisName,Map<uniqueName,id>>
|
|
|
|
+ */
|
|
|
|
+ public Map<String, Map<String,Long>> getConfigMapWithoutForm(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
|
|
|
|
+ Map<String, Map<String, Long>> retMap = new HashMap<>();
|
|
|
|
+ QueryWrapper<DrugConfig> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("hospital_id", hospitalId);
|
|
|
|
+ if (ListUtil.isNotEmpty(hisNames)) {
|
|
|
|
+ queryWrapper.in("his_name", hisNames);
|
|
|
|
+ }
|
|
|
|
+ if (ListUtil.isNotEmpty(uniqueNames)) {
|
|
|
|
+ queryWrapper.in("unique_name", uniqueNames);
|
|
|
|
+ }
|
|
|
|
+ List<DrugConfig> records = drugConfigService.list(queryWrapper);
|
|
|
|
+ if (ListUtil.isEmpty(records)) {
|
|
|
|
+ return retMap;
|
|
|
|
+ }
|
|
|
|
+ Map<String, List<DrugConfig>> hisNameMap
|
|
|
|
+ = EntityUtil.makeEntityListMap(records, "hisName");
|
|
|
|
+ for (Map.Entry<String, List<DrugConfig>> entry : hisNameMap.entrySet()) {
|
|
|
|
+ if (ListUtil.isNotEmpty(entry.getValue())) {
|
|
|
|
+ retMap.put(entry.getKey(),
|
|
|
|
+ EntityUtil.makeMapWithKeyValue(records, "uniqueName", "id"));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return retMap;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取映射关系
|
|
|
|
+ * Map<uniqueName,Map<hisName,id>>
|
|
|
|
+ *
|
|
|
|
+ * @param hospitalId
|
|
|
|
+ * @param hisNames
|
|
|
|
+ * @param uniqueNames
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public Map<String,Map<String,Long>> getUniqueNameConfigMapWithoutForm(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
|
|
|
|
+ Map<String, Map<String, Long>> retMap = new HashMap<>();
|
|
|
|
+ QueryWrapper<DrugConfig> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("hospital_id", hospitalId);
|
|
|
|
+ if (ListUtil.isNotEmpty(hisNames)) {
|
|
|
|
+ queryWrapper.in("his_name", hisNames);
|
|
|
|
+ }
|
|
|
|
+ if (ListUtil.isNotEmpty(uniqueNames)) {
|
|
|
|
+ queryWrapper.in("unique_name", uniqueNames);
|
|
|
|
+ }
|
|
|
|
+ List<DrugConfig> records = drugConfigService.list(queryWrapper);
|
|
|
|
+ if (ListUtil.isEmpty(records)) {
|
|
|
|
+ return retMap;
|
|
|
|
+ }
|
|
|
|
+ records.forEach(i -> {
|
|
|
|
+ if (StringUtil.isBlank(i.getForm())) {
|
|
|
|
+ i.setForm("");
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ Map<String, List<DrugConfig>> uniqueNameMap
|
|
|
|
+ = EntityUtil.makeEntityListMap(records, "uniqueName");
|
|
|
|
+ for (Map.Entry<String, List<DrugConfig>> entry : uniqueNameMap.entrySet()) {
|
|
|
|
+ if (ListUtil.isNotEmpty(entry.getValue())) {
|
|
|
|
+ retMap.put(entry.getKey(),
|
|
|
|
+ EntityUtil.makeMapWithKeyValue(records, "hisName", "id"));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return retMap;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 数据导出
|
|
* 数据导出
|
|
*
|
|
*
|