| | |
| | | import com.ltkj.hosp.sqlDomain.LtkjExamJcbgd; |
| | | import com.ltkj.hosp.sqlDomain.LtkjExamJcsqd; |
| | | import com.ltkj.system.service.ISysDeptService; |
| | | import jodd.util.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.security.PrivateKey; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Autowired |
| | | private LtkjExamJcbgdService ltkjExamJcbgdService; |
| | | |
| | | @PostMapping("QueryOrder") |
| | | public String queryOrder(@RequestBody String json){ |
| | | @PostMapping("InvokeRisService") |
| | | public String InvokeRisService(String dataSourceName, String action, String message) |
| | | { |
| | | switch (StringUtil.toLowerCase(action) ) |
| | | { |
| | | case "qeryorder": |
| | | return queryOrder(dataSourceName); |
| | | break; |
| | | case "updateorderstatus": |
| | | updateOrderstatus(dataSourceName); |
| | | break; |
| | | case "reportverifyupload": |
| | | return reportVerifyUpload(dataSourceName); |
| | | break; |
| | | |
| | | } |
| | | } |
| | | private String updateOrderstatus(@RequestBody String json) { |
| | | // <PatientId> HIS或体检病人ID </PatientId> |
| | | // <PatType>病人类型</PatType > |
| | | // <Operator>操作人工号</Operator> |
| | | // <HisID>HIS或体检申请单号</HisID> |
| | | // <OrderStatus>单据状态</OrderStatus> |
| | | Map<String, Object> map = XmlUtil.xmlToMap(json); |
| | | JSONObject parseObj = JSONUtil.parseObj(map); |
| | | String msgStr = ""; |
| | | //必填HIS或体检病人ID |
| | | String PatientId = parseObj.getStr("PatientId"); |
| | | // 必填 病人类型病人类型O:门诊,I:住院,P:体检 |
| | | String PatType = parseObj.getStr("PatType"); |
| | | // 必填 操作人工号 |
| | | String Operator = parseObj.getStr("Operator"); |
| | | // 必填 HIS或体检申请单号 |
| | | String HisID = parseObj.getStr("HisID"); |
| | | // 必填 单据状态 单据状态 1已登记,0取消登记 |
| | | String OrderStatus = parseObj.getStr("OrderStatus"); |
| | | |
| | | if (PatientId == "") { |
| | | msgStr = msgStr + "HIS或体检病人ID未填写 ; "; |
| | | } |
| | | if (PatType == "") { |
| | | msgStr = msgStr + "病人类型未填写 ; "; |
| | | } |
| | | if (Operator == "") { |
| | | msgStr = msgStr + "操作人工号未填写 ; "; |
| | | } |
| | | if (HisID == "") { |
| | | msgStr = msgStr + "HIS或体检申请单号未填写 ; "; |
| | | } |
| | | if (OrderStatus == "") { |
| | | msgStr = msgStr + "单据状态未填写 ; "; |
| | | } |
| | | |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | // <Code>执行状态 执行状态 1 成功, 0失败</Code> |
| | | // <Message>结果消息</Message> |
| | | HashMap<String, Object> result = new HashMap<>(); |
| | | if(msgStr=="") |
| | | { |
| | | result.put("Code", 1); |
| | | result.put("Message", "接口成功"); |
| | | } |
| | | else { |
| | | result.put("Code", 0); |
| | | result.put("Message", msgStr); |
| | | } |
| | | hashMap.put("ResultInfor", result); |
| | | return XmlUtil.mapToXmlStr(hashMap); |
| | | } |
| | | |
| | | //@PostMapping("QueryOrder") |
| | | private String queryOrder(@RequestBody String json){ |
| | | Map<String, Object> map = XmlUtil.xmlToMap(json); |
| | | JSONObject parseObj = JSONUtil.parseObj(map); |
| | | String hospitalID = parseObj.getStr("HospitalID"); |
| | |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | if (customer == null){ |
| | | HashMap<String, Object> result = new HashMap<>(); |
| | | result.put("Code",500); |
| | | result.put("Code",0); |
| | | result.put("Message","未查询到人员信息"); |
| | | hashMap.put("ResultInfor",result); |
| | | return XmlUtil.mapToXmlStr(hashMap); |
| | |
| | | List<TjOrder> list = tjOrderService.list(new LambdaQueryWrapper<TjOrder>().eq(TjOrder::getUserId, customer.getCusId()).orderByDesc(TjOrder::getCreateTime)); |
| | | if (list.isEmpty()){ |
| | | HashMap<String, Object> result = new HashMap<>(); |
| | | result.put("Code",500); |
| | | result.put("Code",0); |
| | | result.put("Message","未查询到记录信息"); |
| | | hashMap.put("ResultInfor",result); |
| | | return XmlUtil.mapToXmlStr(hashMap); |
| | |
| | | .replaceAll("<","<").replaceAll(">",">"); |
| | | } |
| | | |
| | | @PostMapping("ReportVerifyUpload") |
| | | public String reportVerifyUpload(@RequestBody String json){ |
| | | //@PostMapping("ReportVerifyUpload") |
| | | private String reportVerifyUpload(@RequestBody String json){ |
| | | Map<String, Object> map = XmlUtil.xmlToMap(json); |
| | | HashMap<String, Object> reportInfor = (HashMap<String, Object>) map.get("ReportInfor"); |
| | | // cus_id |