From 06ef175a1e9f72b3863757319b2f6ff76c5a2f05 Mon Sep 17 00:00:00 2001 From: zjh <1084500556@qq.com> Date: 星期二, 03 十二月 2024 09:16:55 +0800 Subject: [PATCH] zjh20241202-3 --- ltkj-admin/src/main/java/com/ltkj/web/controller/pacs/PacsServiceController.java | 123 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 118 insertions(+), 5 deletions(-) diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/pacs/PacsServiceController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/pacs/PacsServiceController.java index 4d8f309..ec53f35 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/pacs/PacsServiceController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/pacs/PacsServiceController.java @@ -13,6 +13,8 @@ import com.ltkj.hosp.sqlDomain.LtkjExamJcbgd; import com.ltkj.hosp.sqlDomain.LtkjExamJcsqd; import com.ltkj.system.service.ISysDeptService; +import com.sun.jna.platform.win32.WinDef; +import com.sun.org.apache.xpath.internal.operations.Bool; import jodd.util.StringUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -24,6 +26,14 @@ import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; + + + + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; /** * @Company: 瑗垮畨璺嘲绉戞妧鏈夐檺鍏徃 @@ -49,23 +59,126 @@ @Autowired private LtkjExamJcbgdService ltkjExamJcbgdService; + // 浣撴寮�妫�鏌ョ敵璇峰崟璋冪敤姝ゆ帴鍙f帹閫佺粰pacs鏈嶅姟 + public boolean OrderAdd(String tjNumber) + { + try { + //浠庝綋妫�鏁版嵁搴撲腑鏌ヨ鍑虹敵璇峰崟鏁版嵁 璋冪敤 pacs webservice 鎺ュ彛 OrderAdd瀹炵幇鐢宠鍗曟帹閫� + HashMap<String, Object> hashMap = new HashMap<>(); + if (true){ + HashMap<String, Object> result = new HashMap<>(); +// result.put("PatientId",0); +// result.put("PatType","PatType"); +// result.put("Operator","Operator"); +// result.put("HisID","HisID"); + + hashMap.put("Root",result); + } + return ComSjyjtPacs(XmlUtil.mapToXmlStr(hashMap)); + }catch (Exception ex) + { + return false; + } + } + + // 浣撴鎾ら攢鐢宠鍗曞悗璋冪敤姝ゆ帴鍙f挙閿�pacs鐢宠鍗� + public boolean OrderDelete(String tjNumber) + { + //鍏ュ弬瀛楁 +// <PatientId> HIS鎴栦綋妫�鐥呬汉ID </PatientId> +// <PatType>鐥呬汉绫诲瀷</PatType > +// <Operator>鎿嶄綔浜哄伐鍙�</Operator> +// <HisID>HIS鎴栦綋妫�鐢宠鍗曞彿</HisID> + try { + //浠庝綋妫�鏁版嵁搴撲腑鏌ヨ鍑虹敵璇峰崟鏁版嵁 璋冪敤 pacs webservice 鎺ュ彛 OrderAdd瀹炵幇鐢宠鍗曟帹閫� + + HashMap<String, Object> hashMap = new HashMap<>(); + if (null == null){ + HashMap<String, Object> result = new HashMap<>(); + result.put("PatientId",0); + result.put("PatType","PatType"); + result.put("Operator","Operator"); + result.put("HisID","HisID"); + + hashMap.put("Root",result); + } + return ComSjyjtPacs(XmlUtil.mapToXmlStr(hashMap)); + }catch (Exception ex) + { + return false; + } + } + // 闄曞仴鍖婚泦鍥㈣皟鐢╬acs鎺ュ彛Webservice + public boolean ComSjyjtPacs(String inputLine) + { + String apiUrl = "http://100.100.100.222:8000/WebInterfaceService.asmx"; // 鏇挎崲涓轰綘鐨凙PI URL + + try { + URL url = new URL(apiUrl); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("GET"); + + int responseCode = connection.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK) { + BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream())); + + StringBuffer response = new StringBuffer(); + + while ((inputLine = in.readLine()) != null) { + response.append(inputLine); + } + + in.close(); + + // 鎵撳嵃缁撴灉 + System.out.println(response.toString()); + } else { +// System.out.println("ComSjyjtPacs闄曞仴鍖婚泦鍥㈣皟鐢╬acs鎺ュ彛Webservice璋冪敤澶辫触锛佲��); + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + + } + + @PostMapping("InvokeRisService") public String InvokeRisService(String dataSourceName, String action, String message) { + + String rusue=null; switch (StringUtil.toLowerCase(action) ) { case "qeryorder": - return queryOrder(dataSourceName); - break; + rusue= queryOrder(dataSourceName); + break; case "updateorderstatus": - updateOrderstatus(dataSourceName); + rusue= updateOrderstatus(dataSourceName); break; case "reportverifyupload": - return reportVerifyUpload(dataSourceName); - break; + rusue= reportVerifyUpload(dataSourceName); + break; } + HashMap<String, Object> hashMap = new HashMap<>(); + // <Code>鎵ц鐘舵�� 鎵ц鐘舵�� 1 鎴愬姛锛� 0澶辫触</Code> + // <Message>缁撴灉娑堟伅</Message> + HashMap<String, Object> result = new HashMap<>(); + if(rusue==null) + { + result.put("Code", 1); + result.put("Message", "鎺ュ彛鎴愬姛"); + } + else { + result.put("Code", 0); + result.put("Message", rusue); + } + hashMap.put("ResultInfor", result); + return XmlUtil.mapToXmlStr(hashMap); } + + private String updateOrderstatus(@RequestBody String json) { // <PatientId> HIS鎴栦綋妫�鐥呬汉ID </PatientId> // <PatType>鐥呬汉绫诲瀷</PatType > -- Gitblit v1.8.0