|
|
|
@ -14,12 +14,14 @@ import com.emr.webservice.MedicalRecordShowBackContent.MR_FILE_CALLBACK_RECORD;
|
|
|
|
|
import com.emr.webservice.MedicalRecordShowBackContent.MR_FILE_INDEX_CALLBACK;
|
|
|
|
|
import org.apache.axis.client.Call;
|
|
|
|
|
import org.apache.axis.client.Service;
|
|
|
|
|
import org.apache.axis.encoding.XMLType;
|
|
|
|
|
import org.apache.cxf.endpoint.Client;
|
|
|
|
|
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
|
|
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
|
|
import org.apache.shiro.session.Session;
|
|
|
|
|
import org.apache.shiro.subject.Subject;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.ui.Model;
|
|
|
|
@ -29,10 +31,13 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import javax.xml.namespace.QName;
|
|
|
|
|
import javax.xml.rpc.ParameterMode;
|
|
|
|
|
import javax.xml.rpc.ServiceException;
|
|
|
|
|
import java.io.FileInputStream;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.io.OutputStream;
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
|
|
import java.rmi.RemoteException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -56,6 +61,12 @@ public class lastVerifyController {
|
|
|
|
|
@Autowired(required = false)
|
|
|
|
|
private Archive_Master_FollowingService archive_master_followingService;
|
|
|
|
|
|
|
|
|
|
@Value("${EMRQualityControl}")
|
|
|
|
|
private String EMRQualityControl;
|
|
|
|
|
|
|
|
|
|
@Value("${EMRQualityControlParamName}")
|
|
|
|
|
private String EMRQualityControlParamName;
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/lastVerifys")
|
|
|
|
|
public String faults(Model model) {
|
|
|
|
|
return "lastVerifyDir/lastVerifyList";
|
|
|
|
@ -397,16 +408,60 @@ public class lastVerifyController {
|
|
|
|
|
MR_FILE_CALLBACK_RECORD = XMLUtil.convertToXml(inputParam1);
|
|
|
|
|
MR_FILE_INDEX_CALLBACK = XMLUtil.convertToXml(inputParam2);
|
|
|
|
|
|
|
|
|
|
String endpoint = "http://10.6.1.152:8037/SignWebService.asmx?WSDL";
|
|
|
|
|
String method = "MedicalRecordRepair";
|
|
|
|
|
StringBuffer sb = new StringBuffer("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n");
|
|
|
|
|
sb.append(MR_FILE_CALLBACK_RECORD);
|
|
|
|
|
sb.append("\n");
|
|
|
|
|
sb.append(MR_FILE_INDEX_CALLBACK);
|
|
|
|
|
sb.append("\n");
|
|
|
|
|
sb.append("</root>");
|
|
|
|
|
|
|
|
|
|
String result="";
|
|
|
|
|
try {
|
|
|
|
|
String endpoint = EMRQualityControl;
|
|
|
|
|
String[] subStrs = endpoint.split("=");
|
|
|
|
|
String url = "";
|
|
|
|
|
String subStr ="";
|
|
|
|
|
url = subStrs[0];
|
|
|
|
|
if(subStrs.length>1){
|
|
|
|
|
subStr = getURLEncoderString(subStrs[1]);
|
|
|
|
|
}
|
|
|
|
|
endpoint = url+"="+subStr;
|
|
|
|
|
Service service = new Service();
|
|
|
|
|
Call call = null;
|
|
|
|
|
try {
|
|
|
|
|
call = (Call) service.createCall();
|
|
|
|
|
} catch (ServiceException e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
call.setTargetEndpointAddress(endpoint);
|
|
|
|
|
call.setOperationName(new QName("http://bjgoodwillcis.com", "XMLMessageServer"));
|
|
|
|
|
call.addParameter(EMRQualityControlParamName, XMLType.XSD_STRING, ParameterMode.IN);//接口的参数
|
|
|
|
|
call.setReturnType(XMLType.XSD_STRING);//设置返回类型
|
|
|
|
|
try {
|
|
|
|
|
result = (String) call.invoke(new Object[]{sb.toString()});
|
|
|
|
|
//System.err.println(result);
|
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
result = e.getMessage();
|
|
|
|
|
System.err.println(result);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
System.err.println(e.toString());
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
|
|
|
|
|
Client client = factory.createClient(endpoint);
|
|
|
|
|
Object[] res = null;
|
|
|
|
|
res = client.invoke(method,MR_FILE_CALLBACK_RECORD,MR_FILE_INDEX_CALLBACK);
|
|
|
|
|
//String xml = (String) res[0];
|
|
|
|
|
//System.err.println("@@@@@@@@@@@@@@@@@" + xml);
|
|
|
|
|
return (String) res[0];
|
|
|
|
|
public static String getURLEncoderString(String str) {
|
|
|
|
|
String result = "";
|
|
|
|
|
if (null == str) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
result = java.net.URLEncoder.encode(str, "UTF-8");
|
|
|
|
|
} catch (UnsupportedEncodingException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|