TranEnDeFacade.java 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. package com.diagbot.facade;
  2. import com.diagbot.client.TranServiceClient;
  3. import com.diagbot.client.bean.HosCodeVO;
  4. import com.diagbot.dto.RespDTO;
  5. import com.diagbot.util.CryptUtil;
  6. import com.diagbot.util.ListUtil;
  7. import com.diagbot.util.RespDTOUtil;
  8. import com.diagbot.vo.DiseaseIcdVO;
  9. import com.diagbot.vo.LisConfigVO;
  10. import com.diagbot.vo.PacsConfigVO;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.stereotype.Component;
  13. import org.springframework.web.bind.annotation.RequestBody;
  14. import java.util.LinkedHashMap;
  15. import java.util.List;
  16. import java.util.Map;
  17. /**
  18. * @Description:tran层对接时无法自动加解密的接口处理
  19. * @Author:zhaops
  20. * @time: 2020/1/6 10:19
  21. */
  22. @Component
  23. public class TranEnDeFacade {
  24. @Autowired
  25. private TranServiceClient tranServiceClient;
  26. /**
  27. * 根据医院编码和套餐名称获取化验公表映射关系(返回map原文)
  28. *
  29. * @param lisConfigVO
  30. * @return
  31. */
  32. public Map<String, Map<String, List<String>>> getLisConfigByMealNameAndHosCode(@RequestBody LisConfigVO lisConfigVO) {
  33. RespDTO<Map<String, Map<String, List<String>>>> respDTO = tranServiceClient.getLisConfigByMealNameAndHosCode(lisConfigVO);
  34. Map<String, Map<String, List<String>>> retMap = new LinkedHashMap<>();
  35. if (RespDTOUtil.respIsOK(respDTO)) {
  36. Map<String, Map<String, List<String>>> map = respDTO.data;
  37. retMap = map;
  38. }
  39. return retMap;
  40. }
  41. /**
  42. * 根据医院编码和套餐名称获取化验公表映射关系(返回map加密)
  43. *
  44. * @param lisConfigVO
  45. * @return
  46. */
  47. public Map<String, Map<String, List<String>>> getLisConfigByMealNameAndHosCode_en(@RequestBody LisConfigVO lisConfigVO) {
  48. RespDTO<Map<String, Map<String, List<String>>>> respDTO = tranServiceClient.getLisConfigByMealNameAndHosCode(lisConfigVO);
  49. Map<String, Map<String, List<String>>> retMap = new LinkedHashMap<>();
  50. if (RespDTOUtil.respIsOK(respDTO)) {
  51. Map<String, Map<String, List<String>>> map = respDTO.data;
  52. for (Map.Entry<String, Map<String, List<String>>> entry : map.entrySet()) {
  53. Map<String, List<String>> retSubMap = new LinkedHashMap<>();
  54. for (Map.Entry<String, List<String>> subEntry : entry.getValue().entrySet()) {
  55. if (ListUtil.isNotEmpty(subEntry.getValue())) {
  56. CryptUtil.encryptList(subEntry.getValue());
  57. }
  58. retSubMap.put(CryptUtil.encrypt_char(subEntry.getKey()), subEntry.getValue());
  59. }
  60. retMap.put(CryptUtil.encrypt_char(entry.getKey()), retSubMap);
  61. }
  62. }
  63. return retMap;
  64. }
  65. /**
  66. * 根据医院编码获取辅检公表映射关系(返回map原文)
  67. *
  68. * @param hosCodeVO
  69. * @return
  70. */
  71. public Map<String, List<String>> getPacsConfigByMealNameAndHosCode(@RequestBody HosCodeVO hosCodeVO) {
  72. RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getPacsConfigByMealNameAndHosCode(hosCodeVO);
  73. Map<String, List<String>> retMap = new LinkedHashMap<>();
  74. if (RespDTOUtil.respIsOK(respDTO)) {
  75. Map<String, List<String>> map = respDTO.data;
  76. retMap = map;
  77. }
  78. return retMap;
  79. }
  80. /**
  81. * 根据医院编码获取辅检公表映射关系(返回map加密)
  82. *
  83. * @param hosCodeVO
  84. * @return
  85. */
  86. public Map<String, List<String>> getPacsConfigByMealNameAndHosCode_en(@RequestBody HosCodeVO hosCodeVO) {
  87. RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getPacsConfigByMealNameAndHosCode(hosCodeVO);
  88. Map<String, List<String>> retMap = new LinkedHashMap<>();
  89. if (RespDTOUtil.respIsOK(respDTO)) {
  90. Map<String, List<String>> map = respDTO.data;
  91. for (Map.Entry<String, List<String>> entry : map.entrySet()) {
  92. if (ListUtil.isNotEmpty(entry.getValue())) {
  93. CryptUtil.encryptList(entry.getValue());
  94. }
  95. retMap.put(CryptUtil.encrypt_char(entry.getKey()), entry.getValue());
  96. }
  97. }
  98. return retMap;
  99. }
  100. /**
  101. * 获取辅检映射关系(返回map原文)
  102. *
  103. * @param pacsConfigVO
  104. * @return
  105. */
  106. public Map<String, List<String>> getPacsConfig(@RequestBody PacsConfigVO pacsConfigVO) {
  107. RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getPacsConfig(pacsConfigVO);
  108. Map<String, List<String>> retMap = new LinkedHashMap<>();
  109. if (RespDTOUtil.respIsOK(respDTO)) {
  110. Map<String, List<String>> map = respDTO.data;
  111. retMap = map;
  112. }
  113. return retMap;
  114. }
  115. /**
  116. * 获取辅检映射关系(返回map加密)
  117. *
  118. * @param pacsConfigVO
  119. * @return
  120. */
  121. public Map<String, List<String>> getPacsConfig_en(@RequestBody PacsConfigVO pacsConfigVO) {
  122. RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getPacsConfig(pacsConfigVO);
  123. Map<String, List<String>> retMap = new LinkedHashMap<>();
  124. if (RespDTOUtil.respIsOK(respDTO)) {
  125. Map<String, List<String>> map = respDTO.data;
  126. for (Map.Entry<String, List<String>> entry : map.entrySet()) {
  127. if (ListUtil.isNotEmpty(entry.getValue())) {
  128. CryptUtil.encryptList(entry.getValue());
  129. }
  130. retMap.put(CryptUtil.encrypt_char(entry.getKey()), entry.getValue());
  131. }
  132. }
  133. return retMap;
  134. }
  135. /**
  136. * 根据医院编码获取提示信息标题映射关系(返回map原文)
  137. *
  138. * @param hosCodeVO
  139. * @return
  140. */
  141. public Map<String, String> getTitleMappingHosCode(@RequestBody HosCodeVO hosCodeVO) {
  142. RespDTO<Map<String, String>> respDTO = tranServiceClient.getTitleMappingHosCode(hosCodeVO);
  143. Map<String, String> retMap = new LinkedHashMap<>();
  144. if (RespDTOUtil.respIsOK(respDTO)) {
  145. Map<String, String> map = respDTO.data;
  146. retMap = map;
  147. }
  148. return retMap;
  149. }
  150. /**
  151. * 根据医院编码获取提示信息标题映射关系(返回map加密)
  152. *
  153. * @param hosCodeVO
  154. * @return
  155. */
  156. public Map<String, String> getTitleMappingHosCode_en(@RequestBody HosCodeVO hosCodeVO) {
  157. RespDTO<Map<String, String>> respDTO = tranServiceClient.getTitleMappingHosCode(hosCodeVO);
  158. Map<String, String> retMap = new LinkedHashMap<>();
  159. if (RespDTOUtil.respIsOK(respDTO)) {
  160. Map<String, String> map = respDTO.data;
  161. for (Map.Entry<String, String> entry : map.entrySet()) {
  162. retMap.put(CryptUtil.encrypt_char(entry.getKey()), CryptUtil.encrypt_char(entry.getValue()));
  163. }
  164. }
  165. return retMap;
  166. }
  167. /**
  168. * 根据医院编码查询诊断icd映射(返回map原文)
  169. *
  170. * @param hosCodeVO
  171. * @return
  172. */
  173. public Map<String, String> getDiseaseIcdByHosCode(@RequestBody HosCodeVO hosCodeVO) {
  174. RespDTO<Map<String, String>> respDTO = tranServiceClient.getDiseaseIcdByHosCode(hosCodeVO);
  175. Map<String, String> retMap = new LinkedHashMap<>();
  176. if (RespDTOUtil.respIsOK(respDTO)) {
  177. Map<String, String> map = respDTO.data;
  178. retMap = map;
  179. }
  180. return retMap;
  181. }
  182. /**
  183. * 根据医院编码查询诊断icd映射(返回map加密)
  184. *
  185. * @param hosCodeVO
  186. * @return
  187. */
  188. public Map<String, String> getDiseaseIcdByHosCode_en(@RequestBody HosCodeVO hosCodeVO) {
  189. RespDTO<Map<String, String>> respDTO = tranServiceClient.getDiseaseIcdByHosCode(hosCodeVO);
  190. Map<String, String> retMap = new LinkedHashMap<>();
  191. if (RespDTOUtil.respIsOK(respDTO)) {
  192. Map<String, String> map = respDTO.data;
  193. for (Map.Entry<String, String> entry : map.entrySet()) {
  194. retMap.put(CryptUtil.encrypt_char(entry.getKey()), CryptUtil.encrypt_char(entry.getValue()));
  195. }
  196. }
  197. return retMap;
  198. }
  199. /**
  200. * 获取诊断名称映射map(返回map原文)
  201. *
  202. * @param diseaseIcdVO
  203. * @return
  204. */
  205. public Map<String, String> getDiseaseIcdMap(DiseaseIcdVO diseaseIcdVO) {
  206. RespDTO<Map<String, String>> respDTO = tranServiceClient.getDiseaseIcdMap(diseaseIcdVO);
  207. Map<String, String> retMap = new LinkedHashMap<>();
  208. if (RespDTOUtil.respIsOK(respDTO)) {
  209. Map<String, String> map = respDTO.data;
  210. retMap = map;
  211. }
  212. return retMap;
  213. }
  214. /**
  215. * 获取诊断名称映射map(返回map加密)
  216. *
  217. * @param diseaseIcdVO
  218. * @return
  219. */
  220. public Map<String, String> getDiseaseIcdMap_en(DiseaseIcdVO diseaseIcdVO) {
  221. RespDTO<Map<String, String>> respDTO = tranServiceClient.getDiseaseIcdMap(diseaseIcdVO);
  222. Map<String, String> retMap = new LinkedHashMap<>();
  223. if (RespDTOUtil.respIsOK(respDTO)) {
  224. Map<String, String> map = respDTO.data;
  225. for (Map.Entry<String, String> entry : map.entrySet()) {
  226. retMap.put(CryptUtil.encrypt_char(entry.getKey()), CryptUtil.encrypt_char(entry.getValue()));
  227. }
  228. }
  229. return retMap;
  230. }
  231. /**
  232. * 根据医院编码获取化验公表映射关系,公表项做key(返回map原文)
  233. *
  234. * @param lisConfigVO
  235. * @return
  236. */
  237. public Map<String, List<String>> getLisConfigByUniqueNameAndHosCode(@RequestBody LisConfigVO lisConfigVO) {
  238. RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getLisConfigByUniqueNameAndHosCode(lisConfigVO);
  239. Map<String, List<String>> retMap = new LinkedHashMap<>();
  240. if (RespDTOUtil.respIsOK(respDTO)) {
  241. Map<String, List<String>> map = respDTO.data;
  242. retMap = map;
  243. }
  244. return retMap;
  245. }
  246. /**
  247. * 根据医院编码获取化验公表映射关系,公表项做key(返回map加密)
  248. *
  249. * @param lisConfigVO
  250. * @return
  251. */
  252. public Map<String, List<String>> getLisConfigByUniqueNameAndHosCode_en(@RequestBody LisConfigVO lisConfigVO) {
  253. RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getLisConfigByUniqueNameAndHosCode(lisConfigVO);
  254. Map<String, List<String>> retMap = new LinkedHashMap<>();
  255. if (RespDTOUtil.respIsOK(respDTO)) {
  256. Map<String, List<String>> map = respDTO.data;
  257. for (Map.Entry<String, List<String>> entry : map.entrySet()) {
  258. if (ListUtil.isNotEmpty(entry.getValue())) {
  259. CryptUtil.encryptList(entry.getValue());
  260. }
  261. retMap.put(CryptUtil.encrypt_char(entry.getKey()), entry.getValue());
  262. }
  263. }
  264. return retMap;
  265. }
  266. /**
  267. * 根据医院编码查询辅检公表映射,公表项做key(返回map原文)
  268. *
  269. * @param hosCodeVO
  270. * @return
  271. */
  272. public Map<String, List<String>> getPacsConfigByUniqueNameAndHosCode(@RequestBody HosCodeVO hosCodeVO) {
  273. RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getPacsConfigByUniqueNameAndHosCode(hosCodeVO);
  274. Map<String, List<String>> retMap = new LinkedHashMap<>();
  275. if (RespDTOUtil.respIsOK(respDTO)) {
  276. Map<String, List<String>> map = respDTO.data;
  277. retMap = map;
  278. }
  279. return retMap;
  280. }
  281. /**
  282. * 根据医院编码查询辅检公表映射,公表项做key(返回map加密)
  283. *
  284. * @param hosCodeVO
  285. * @return
  286. */
  287. public Map<String, List<String>> getPacsConfigByUniqueNameAndHosCode_en(@RequestBody HosCodeVO hosCodeVO) {
  288. RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getPacsConfigByUniqueNameAndHosCode(hosCodeVO);
  289. Map<String, List<String>> retMap = new LinkedHashMap<>();
  290. if (RespDTOUtil.respIsOK(respDTO)) {
  291. Map<String, List<String>> map = respDTO.data;
  292. for (Map.Entry<String, List<String>> entry : map.entrySet()) {
  293. if (ListUtil.isNotEmpty(entry.getValue())) {
  294. CryptUtil.encryptList(entry.getValue());
  295. }
  296. retMap.put(CryptUtil.encrypt_char(entry.getKey()), entry.getValue());
  297. }
  298. }
  299. return retMap;
  300. }
  301. }