123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321 |
- package com.diagbot.facade;
- import com.diagbot.client.TranServiceClient;
- import com.diagbot.client.bean.HosCodeVO;
- import com.diagbot.dto.RespDTO;
- import com.diagbot.util.CryptUtil;
- import com.diagbot.util.ListUtil;
- import com.diagbot.util.RespDTOUtil;
- import com.diagbot.vo.DiseaseIcdVO;
- import com.diagbot.vo.LisConfigVO;
- import com.diagbot.vo.PacsConfigVO;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Component;
- import org.springframework.web.bind.annotation.RequestBody;
- import java.util.LinkedHashMap;
- import java.util.List;
- import java.util.Map;
- /**
- * @Description:tran层对接时无法自动加解密的接口处理
- * @Author:zhaops
- * @time: 2020/1/6 10:19
- */
- @Component
- public class TranEnDeFacade {
- @Autowired
- private TranServiceClient tranServiceClient;
- /**
- * 根据医院编码和套餐名称获取化验公表映射关系(返回map原文)
- *
- * @param lisConfigVO
- * @return
- */
- public Map<String, Map<String, List<String>>> getLisConfigByMealNameAndHosCode(@RequestBody LisConfigVO lisConfigVO) {
- RespDTO<Map<String, Map<String, List<String>>>> respDTO = tranServiceClient.getLisConfigByMealNameAndHosCode(lisConfigVO);
- Map<String, Map<String, List<String>>> retMap = new LinkedHashMap<>();
- if (RespDTOUtil.respIsOK(respDTO)) {
- Map<String, Map<String, List<String>>> map = respDTO.data;
- retMap = map;
- }
- return retMap;
- }
- /**
- * 根据医院编码和套餐名称获取化验公表映射关系(返回map加密)
- *
- * @param lisConfigVO
- * @return
- */
- public Map<String, Map<String, List<String>>> getLisConfigByMealNameAndHosCode_en(@RequestBody LisConfigVO lisConfigVO) {
- RespDTO<Map<String, Map<String, List<String>>>> respDTO = tranServiceClient.getLisConfigByMealNameAndHosCode(lisConfigVO);
- Map<String, Map<String, List<String>>> retMap = new LinkedHashMap<>();
- if (RespDTOUtil.respIsOK(respDTO)) {
- Map<String, Map<String, List<String>>> map = respDTO.data;
- for (Map.Entry<String, Map<String, List<String>>> entry : map.entrySet()) {
- Map<String, List<String>> retSubMap = new LinkedHashMap<>();
- for (Map.Entry<String, List<String>> subEntry : entry.getValue().entrySet()) {
- if (ListUtil.isNotEmpty(subEntry.getValue())) {
- CryptUtil.encryptList(subEntry.getValue());
- }
- retSubMap.put(CryptUtil.encrypt_char(subEntry.getKey()), subEntry.getValue());
- }
- retMap.put(CryptUtil.encrypt_char(entry.getKey()), retSubMap);
- }
- }
- return retMap;
- }
- /**
- * 根据医院编码获取辅检公表映射关系(返回map原文)
- *
- * @param hosCodeVO
- * @return
- */
- public Map<String, List<String>> getPacsConfigByMealNameAndHosCode(@RequestBody HosCodeVO hosCodeVO) {
- RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getPacsConfigByMealNameAndHosCode(hosCodeVO);
- Map<String, List<String>> retMap = new LinkedHashMap<>();
- if (RespDTOUtil.respIsOK(respDTO)) {
- Map<String, List<String>> map = respDTO.data;
- retMap = map;
- }
- return retMap;
- }
- /**
- * 根据医院编码获取辅检公表映射关系(返回map加密)
- *
- * @param hosCodeVO
- * @return
- */
- public Map<String, List<String>> getPacsConfigByMealNameAndHosCode_en(@RequestBody HosCodeVO hosCodeVO) {
- RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getPacsConfigByMealNameAndHosCode(hosCodeVO);
- Map<String, List<String>> retMap = new LinkedHashMap<>();
- if (RespDTOUtil.respIsOK(respDTO)) {
- Map<String, List<String>> map = respDTO.data;
- for (Map.Entry<String, List<String>> entry : map.entrySet()) {
- if (ListUtil.isNotEmpty(entry.getValue())) {
- CryptUtil.encryptList(entry.getValue());
- }
- retMap.put(CryptUtil.encrypt_char(entry.getKey()), entry.getValue());
- }
- }
- return retMap;
- }
- /**
- * 获取辅检映射关系(返回map原文)
- *
- * @param pacsConfigVO
- * @return
- */
- public Map<String, List<String>> getPacsConfig(@RequestBody PacsConfigVO pacsConfigVO) {
- RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getPacsConfig(pacsConfigVO);
- Map<String, List<String>> retMap = new LinkedHashMap<>();
- if (RespDTOUtil.respIsOK(respDTO)) {
- Map<String, List<String>> map = respDTO.data;
- retMap = map;
- }
- return retMap;
- }
- /**
- * 获取辅检映射关系(返回map加密)
- *
- * @param pacsConfigVO
- * @return
- */
- public Map<String, List<String>> getPacsConfig_en(@RequestBody PacsConfigVO pacsConfigVO) {
- RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getPacsConfig(pacsConfigVO);
- Map<String, List<String>> retMap = new LinkedHashMap<>();
- if (RespDTOUtil.respIsOK(respDTO)) {
- Map<String, List<String>> map = respDTO.data;
- for (Map.Entry<String, List<String>> entry : map.entrySet()) {
- if (ListUtil.isNotEmpty(entry.getValue())) {
- CryptUtil.encryptList(entry.getValue());
- }
- retMap.put(CryptUtil.encrypt_char(entry.getKey()), entry.getValue());
- }
- }
- return retMap;
- }
- /**
- * 根据医院编码获取提示信息标题映射关系(返回map原文)
- *
- * @param hosCodeVO
- * @return
- */
- public Map<String, String> getTitleMappingHosCode(@RequestBody HosCodeVO hosCodeVO) {
- RespDTO<Map<String, String>> respDTO = tranServiceClient.getTitleMappingHosCode(hosCodeVO);
- Map<String, String> retMap = new LinkedHashMap<>();
- if (RespDTOUtil.respIsOK(respDTO)) {
- Map<String, String> map = respDTO.data;
- retMap = map;
- }
- return retMap;
- }
- /**
- * 根据医院编码获取提示信息标题映射关系(返回map加密)
- *
- * @param hosCodeVO
- * @return
- */
- public Map<String, String> getTitleMappingHosCode_en(@RequestBody HosCodeVO hosCodeVO) {
- RespDTO<Map<String, String>> respDTO = tranServiceClient.getTitleMappingHosCode(hosCodeVO);
- Map<String, String> retMap = new LinkedHashMap<>();
- if (RespDTOUtil.respIsOK(respDTO)) {
- Map<String, String> map = respDTO.data;
- for (Map.Entry<String, String> entry : map.entrySet()) {
- retMap.put(CryptUtil.encrypt_char(entry.getKey()), CryptUtil.encrypt_char(entry.getValue()));
- }
- }
- return retMap;
- }
- /**
- * 根据医院编码查询诊断icd映射(返回map原文)
- *
- * @param hosCodeVO
- * @return
- */
- public Map<String, String> getDiseaseIcdByHosCode(@RequestBody HosCodeVO hosCodeVO) {
- RespDTO<Map<String, String>> respDTO = tranServiceClient.getDiseaseIcdByHosCode(hosCodeVO);
- Map<String, String> retMap = new LinkedHashMap<>();
- if (RespDTOUtil.respIsOK(respDTO)) {
- Map<String, String> map = respDTO.data;
- retMap = map;
- }
- return retMap;
- }
- /**
- * 根据医院编码查询诊断icd映射(返回map加密)
- *
- * @param hosCodeVO
- * @return
- */
- public Map<String, String> getDiseaseIcdByHosCode_en(@RequestBody HosCodeVO hosCodeVO) {
- RespDTO<Map<String, String>> respDTO = tranServiceClient.getDiseaseIcdByHosCode(hosCodeVO);
- Map<String, String> retMap = new LinkedHashMap<>();
- if (RespDTOUtil.respIsOK(respDTO)) {
- Map<String, String> map = respDTO.data;
- for (Map.Entry<String, String> entry : map.entrySet()) {
- retMap.put(CryptUtil.encrypt_char(entry.getKey()), CryptUtil.encrypt_char(entry.getValue()));
- }
- }
- return retMap;
- }
- /**
- * 获取诊断名称映射map(返回map原文)
- *
- * @param diseaseIcdVO
- * @return
- */
- public Map<String, String> getDiseaseIcdMap(DiseaseIcdVO diseaseIcdVO) {
- RespDTO<Map<String, String>> respDTO = tranServiceClient.getDiseaseIcdMap(diseaseIcdVO);
- Map<String, String> retMap = new LinkedHashMap<>();
- if (RespDTOUtil.respIsOK(respDTO)) {
- Map<String, String> map = respDTO.data;
- retMap = map;
- }
- return retMap;
- }
- /**
- * 获取诊断名称映射map(返回map加密)
- *
- * @param diseaseIcdVO
- * @return
- */
- public Map<String, String> getDiseaseIcdMap_en(DiseaseIcdVO diseaseIcdVO) {
- RespDTO<Map<String, String>> respDTO = tranServiceClient.getDiseaseIcdMap(diseaseIcdVO);
- Map<String, String> retMap = new LinkedHashMap<>();
- if (RespDTOUtil.respIsOK(respDTO)) {
- Map<String, String> map = respDTO.data;
- for (Map.Entry<String, String> entry : map.entrySet()) {
- retMap.put(CryptUtil.encrypt_char(entry.getKey()), CryptUtil.encrypt_char(entry.getValue()));
- }
- }
- return retMap;
- }
- /**
- * 根据医院编码获取化验公表映射关系,公表项做key(返回map原文)
- *
- * @param lisConfigVO
- * @return
- */
- public Map<String, List<String>> getLisConfigByUniqueNameAndHosCode(@RequestBody LisConfigVO lisConfigVO) {
- RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getLisConfigByUniqueNameAndHosCode(lisConfigVO);
- Map<String, List<String>> retMap = new LinkedHashMap<>();
- if (RespDTOUtil.respIsOK(respDTO)) {
- Map<String, List<String>> map = respDTO.data;
- retMap = map;
- }
- return retMap;
- }
- /**
- * 根据医院编码获取化验公表映射关系,公表项做key(返回map加密)
- *
- * @param lisConfigVO
- * @return
- */
- public Map<String, List<String>> getLisConfigByUniqueNameAndHosCode_en(@RequestBody LisConfigVO lisConfigVO) {
- RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getLisConfigByUniqueNameAndHosCode(lisConfigVO);
- Map<String, List<String>> retMap = new LinkedHashMap<>();
- if (RespDTOUtil.respIsOK(respDTO)) {
- Map<String, List<String>> map = respDTO.data;
- for (Map.Entry<String, List<String>> entry : map.entrySet()) {
- if (ListUtil.isNotEmpty(entry.getValue())) {
- CryptUtil.encryptList(entry.getValue());
- }
- retMap.put(CryptUtil.encrypt_char(entry.getKey()), entry.getValue());
- }
- }
- return retMap;
- }
- /**
- * 根据医院编码查询辅检公表映射,公表项做key(返回map原文)
- *
- * @param hosCodeVO
- * @return
- */
- public Map<String, List<String>> getPacsConfigByUniqueNameAndHosCode(@RequestBody HosCodeVO hosCodeVO) {
- RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getPacsConfigByUniqueNameAndHosCode(hosCodeVO);
- Map<String, List<String>> retMap = new LinkedHashMap<>();
- if (RespDTOUtil.respIsOK(respDTO)) {
- Map<String, List<String>> map = respDTO.data;
- retMap = map;
- }
- return retMap;
- }
- /**
- * 根据医院编码查询辅检公表映射,公表项做key(返回map加密)
- *
- * @param hosCodeVO
- * @return
- */
- public Map<String, List<String>> getPacsConfigByUniqueNameAndHosCode_en(@RequestBody HosCodeVO hosCodeVO) {
- RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getPacsConfigByUniqueNameAndHosCode(hosCodeVO);
- Map<String, List<String>> retMap = new LinkedHashMap<>();
- if (RespDTOUtil.respIsOK(respDTO)) {
- Map<String, List<String>> map = respDTO.data;
- for (Map.Entry<String, List<String>> entry : map.entrySet()) {
- if (ListUtil.isNotEmpty(entry.getValue())) {
- CryptUtil.encryptList(entry.getValue());
- }
- retMap.put(CryptUtil.encrypt_char(entry.getKey()), entry.getValue());
- }
- }
- return retMap;
- }
- }
|