Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/operationreservation/service/OperationReservationManagerImpl.java =================================================================== diff -u -r29937 -r35405 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/operationreservation/service/OperationReservationManagerImpl.java (.../OperationReservationManagerImpl.java) (revision 29937) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/operationreservation/service/OperationReservationManagerImpl.java (.../OperationReservationManagerImpl.java) (revision 35405) @@ -1347,4 +1347,21 @@ } return wb; } + + + @Override + public List findTodayOperationReservaton() { + if(invoicePlanDao != null){ + Calendar startTime = Calendar.getInstance(); + Calendar endTime = Calendar.getInstance(); + startTime.set(Calendar.HOUR_OF_DAY, 0); + startTime.set(Calendar.MINUTE, 0); + startTime.set(Calendar.SECOND, 0); + endTime.set(Calendar.HOUR_OF_DAY, 23); + endTime.set(Calendar.MINUTE, 59); + endTime.set(Calendar.SECOND, 59); + return invoicePlanDao.findHrpInvoicePlanByTimes(startTime.getTime(), endTime.getTime()); + } + return null; + } } Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/basedatamanager/supplyroomconfig/SupplyRoomConfig.java =================================================================== diff -u -r35031 -r35405 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/basedatamanager/supplyroomconfig/SupplyRoomConfig.java (.../SupplyRoomConfig.java) (revision 35031) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/basedatamanager/supplyroomconfig/SupplyRoomConfig.java (.../SupplyRoomConfig.java) (revision 35405) @@ -504,6 +504,18 @@ */ private Integer noOperationTime = 5; + /** + * “数据实时看板待处理查询周期”的默认值为7(ZSWY-179) + */ + public static final int DEFAULT_DASHBOARDS_QUERY_CYCLE = 7; + + /** + * “数据实时看板待处理查询周期”,用于设置查询待处理的工作量数据时的日期范围;(ZSWY-179) + * 仅支持填写正整数和0,默认值为7; + * 0时代表的是不限制日期 + */ + private Integer dashboardsQueryCycle = DEFAULT_DASHBOARDS_QUERY_CYCLE; + @Id @GeneratedValue(strategy = GenerationType.AUTO) public Long getId() { @@ -1394,4 +1406,14 @@ public void setNoOperationTime(Integer noOperationTime) { this.noOperationTime = noOperationTime; } + + @Column(columnDefinition = "int default 7 not null ") + public Integer getDashboardsQueryCycle() { + return dashboardsQueryCycle; + } + + public void setDashboardsQueryCycle(Integer dashboardsQueryCycle) { + this.dashboardsQueryCycle = dashboardsQueryCycle; + } + } Index: ssts-web/src/main/webapp/disinfectsystem/config/zd5y/spring/HIS.xml =================================================================== diff -u -r28008 -r35405 --- ssts-web/src/main/webapp/disinfectsystem/config/zd5y/spring/HIS.xml (.../HIS.xml) (revision 28008) +++ ssts-web/src/main/webapp/disinfectsystem/config/zd5y/spring/HIS.xml (.../HIS.xml) (revision 35405) @@ -15,5 +15,7 @@ + + \ No newline at end of file Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/operationreservation/service/OperationReservationManager.java =================================================================== diff -u -r29937 -r35405 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/operationreservation/service/OperationReservationManager.java (.../OperationReservationManager.java) (revision 29937) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/operationreservation/service/OperationReservationManager.java (.../OperationReservationManager.java) (revision 35405) @@ -100,5 +100,11 @@ * 导出手术预约单(SZSDSRMYY-38) */ public void exportOperationReservation(Date startDate, Date endDate, ServletOutputStream outputStream); + + /** + * 查询今日手术排班信息ZSWY-179 + * @return + */ + public List findTodayOperationReservaton(); } Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/operationreservation/action/OperationReservationAction.java =================================================================== diff -u -r25257 -r35405 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/operationreservation/action/OperationReservationAction.java (.../OperationReservationAction.java) (revision 25257) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/operationreservation/action/OperationReservationAction.java (.../OperationReservationAction.java) (revision 35405) @@ -13,6 +13,7 @@ import net.sf.json.JSONArray; import net.sf.json.JSONObject; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.Namespace; @@ -29,6 +30,7 @@ import com.forgon.tools.MathTools; import com.forgon.tools.StrutsParamUtils; import com.forgon.tools.StrutsResponseUtils; +import com.forgon.tools.date.DateTools; import com.forgon.tools.json.JSONUtil; import com.forgon.tools.string.StringTools; import com.forgon.tools.util.ForgonDateUtils; @@ -285,6 +287,35 @@ } /** + * 数据实时看板新增“今日手术预约信息”(ZSWY-179) + */ + public void findTodayOperationReservatonAmount(){ + int scheduledAmount = 0; + int finishedAmount = 0; + JSONObject result = JSONUtil.buildJsonObject(false); + try { + List operationRList = operationReservationManager.findTodayOperationReservaton(); + if(CollectionUtils.isNotEmpty(operationRList)){ + for (HrpInvoicePlan hrpInvoicePlan : operationRList) { + if(StringUtils.equals(HrpInvoicePlan.SCHEDULE_STATUS_FINISH, hrpInvoicePlan.getScheduleStatus())){ + finishedAmount++; + continue; + } + if(StringUtils.equals(HrpInvoicePlan.SCHEDULE_STATUS_SCHEDULED, hrpInvoicePlan.getScheduleStatus())){ + scheduledAmount++; + continue; + } + } + } + result.put("scheduledAmount", scheduledAmount); + result.put("finishedAmount", finishedAmount); + } catch (Exception e) { + result = JSONUtil.buildJsonObject(false, "查询手术排班信息失败:" + e.getMessage()); + } + StrutsResponseUtils.output(result); + } + + /** * 手动同步手术预约单 */ public void saveSyncOperationReservation(){ Index: ssts-zd5y-misc/src/main/java/com/forgon/disinfectsystem/datasynchronization/zd5y/dao/InvoicePlanDaoImpl.java =================================================================== diff -u --- ssts-zd5y-misc/src/main/java/com/forgon/disinfectsystem/datasynchronization/zd5y/dao/InvoicePlanDaoImpl.java (revision 0) +++ ssts-zd5y-misc/src/main/java/com/forgon/disinfectsystem/datasynchronization/zd5y/dao/InvoicePlanDaoImpl.java (revision 35405) @@ -0,0 +1,230 @@ +package com.forgon.disinfectsystem.datasynchronization.zd5y.dao; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; +import org.dom4j.Document; +import org.dom4j.DocumentException; +import org.dom4j.DocumentHelper; +import org.dom4j.Node; +import org.dom4j.XPath; + +import com.forgon.disinfectsystem.inventorymanagement.dao.InvoicePlanDao; +import com.forgon.disinfectsystem.inventorymanagement.model.HrpInvoicePlan; +import com.forgon.disinfectsystem.inventorymanagement.model.HrpTousseItem; +import com.forgon.exception.SystemException; + +/** + * 对接手术排班信息(ZSWY-179) + * + */ +public class InvoicePlanDaoImpl implements InvoicePlanDao { + + Logger logger = Logger.getLogger(InvoicePlanDaoImpl.class); + + @Override + public HrpInvoicePlan[] findInvoicePlanByTimeAndPage(Date startDate, + Date endDate, int pagesize, int pagenumber, + List serialNumbers) { + // TODO Auto-generated method stub + return null; + } + + @Override + public int findInvoicePlanTotalByTime(Date startDate, Date endDate, + List serialNumbers) { + // TODO Auto-generated method stub + return 0; + } + + @Override + public HrpTousseItem[] findTousseItemBySerialNumber(String serialNumber) { + // TODO Auto-generated method stub + return null; + } + + @Override + public HrpInvoicePlan findHrpInvoicePlanBySerialNumber(String serialNumber) { + // TODO Auto-generated method stub + return null; + } + + @Override + public HrpInvoicePlan[] findHrpInvoicePlanByTime(Date startDate, + Date endDate, List serialNumbers) { + // TODO Auto-generated method stub + return null; + } + + @Override + public List findHrpInvoicePlanByTimes(Date startDate, Date endDate) { + List hrpInvoicePlanList = new ArrayList(); + try { + String inputXml = WebServiceClientHelper.buildInputString(startDate, endDate); + logger.info("手术排班信息查询服务接口地址:" + WebServiceClientHelper.OPERATION_SCHEDULE_ADDRESS); + logger.info("手术排班查询接口请求信息:" + inputXml); + //String result = " 0 孕1产0孕39+3周头位未临产 850747 3 2023-02-10 02:25:20 9070360057 许宗旭 0000388187 II 2023-02-10 09:00:00 16759289219070360057 893846 095148 0000388187 7016 0 2 2 邓海妹 张茹 5071 11 第一台 子宫下段剖宫产术 0 7016 2 7016 择期 2023-02-10 02:25:20 肾上腺肿物 185005 3 2023-02-10 06:56:50 9780243783 周益红 0000454866 I 2023-02-13 09:00:00 16759834093780243783 893412 185005 0000454866 7016 0 1 1 岑彩虹 185022 9360 31 第二台 腹腔镜下左肾上腺肿物切除术 0 7016 4 7016 择期 2023-02-10 06:56:49 ]]> "; + String result = WebServiceClientHelper.doPostSoap1_2(WebServiceClientHelper.OPERATION_SCHEDULE_ADDRESS, inputXml); + logger.info("手术排班查询接口返回信息:" + result); + //解析xml获取手术排班信息 + hrpInvoicePlanList = buidHrpInvoicePlanByXML(result); + } catch (Exception e) { + logger.error("手术排班查询失败" + e); + e.printStackTrace(); + } + return hrpInvoicePlanList; + } + + /** + * 解析xml获取手术排班信息 + * @param responce + * @return + * @throws DocumentException + */ + @SuppressWarnings("unchecked") + private List buidHrpInvoicePlanByXML(String responce) throws Exception { + if(StringUtils.isBlank(responce)){ + return null; + } + List hrpInvoicePlanList = new ArrayList(); + int beginIndex = responce.indexOf(""); + int endIndex = responce.indexOf(""); + if(beginIndex == -1 || endIndex == -1){ + return null; + } + responce = responce.substring(beginIndex, endIndex + "".length()); + Document document = DocumentHelper.parseText(responce.trim()); + String responceXpath = "/RESPONSE/RETURNCODE"; + String responceCode = WebServiceClientHelper.processDataByXpath(document, responceXpath); + String errorMegXpath = "/RESPONSE/ERRORMEG"; + String errorMeg = WebServiceClientHelper.processDataByXpath(document, errorMegXpath); + if(StringUtils.equals(responceCode, WebServiceClientHelper.RETURN_CODE_FAIL)){ + throw new SystemException("手术排班查询失败:" + errorMeg); + } + + //ITEM节点 + String itemXpath = "/RESPONSE/LIST/ITEM"; + XPath xpath = document.createXPath(itemXpath); + List itemNodeList = xpath.selectNodes(document, xpath); + if(CollectionUtils.isEmpty(itemNodeList)){ + return null; + } + + for(int i=1;i<=itemNodeList.size();i++){ + HrpInvoicePlan hrpInvoicePlan = new HrpInvoicePlan(); + /*// 申请单号 + String scheduleIdXpath = itemXpath + "[" + i + "]/REQUEST_NO"; + String scheduleId = WebServiceClientHelper.processDataByXpath(document, scheduleIdXpath); + hrpInvoicePlan.setScheduleId(scheduleId); + + // 住院号 + String hospitalNumberXpath = itemXpath + "[" + i + "]/PATIENT_ID"; + String hospitalNumber = WebServiceClientHelper.processDataByXpath(document, hospitalNumberXpath); + hrpInvoicePlan.setHospitalNumber(hospitalNumber); + + // 病人姓名 + String patientNameXpath = itemXpath + "[" + i + "]/PAT_NAME"; + String patientName = WebServiceClientHelper.processDataByXpath(document, patientNameXpath); + hrpInvoicePlan.setPatientName(patientName); + + // 病人所在科室 + String deptNameXpath = itemXpath + "[" + i + "]/DEPT_STAYED"; + String deptName = WebServiceClientHelper.processDataByXpath(document, deptNameXpath); + hrpInvoicePlan.setDeptName(deptName); + + // 手术时间 + String operationTimeXpath = itemXpath + "[" + i + "]/SCHEDULED_DATE_TIME"; + String operationTimeStr = WebServiceClientHelper.processDataByXpath(document, operationTimeXpath); + if(StringUtils.isNotBlank(operationTimeStr)){ + Date operationTime = DateTools.coverStrToDate(operationTimeStr, DateTools.COMMON_DATE_HMS); + hrpInvoicePlan.setOperationTime(operationTime); + } + + // 台次 + String consoleNameXpath = itemXpath + "[" + i + "]/SEQUENCE"; + String consoleName = WebServiceClientHelper.processDataByXpath(document, consoleNameXpath); + hrpInvoicePlan.setConsoleName(consoleName); + + // 手术医生 + String doctorsXpath = itemXpath + "[" + i + "]/SURGEON"; + String doctors = WebServiceClientHelper.processDataByXpath(document, doctorsXpath); + hrpInvoicePlan.setDoctors(doctors); + + // 巡回护士 + String circuitNurseXpath = itemXpath + "[" + i + "]/FIRST_ASSISTANT"; + String circuitNurse = WebServiceClientHelper.processDataByXpath(document, circuitNurseXpath); + hrpInvoicePlan.setCircuitNurse(circuitNurse); + + // 洗手护士 + String washHandNurseXpath = itemXpath + "[" + i + "]/FIRST_OPERATION_NURSE"; + String washHandNurse = WebServiceClientHelper.processDataByXpath(document, washHandNurseXpath); + hrpInvoicePlan.setWashHandNurse(washHandNurse); + + // 手术名称 + String operationNameXpath = itemXpath + "[" + i + "]/OPERATION_NAME"; + String operationName = WebServiceClientHelper.processDataByXpath(document, operationNameXpath); + hrpInvoicePlan.setOperationName(operationName);*/ + + // 申请单状态 + String scheduleStatusXpath = itemXpath + "[" + i + "]/SCHEDULE_STATUS"; + String scheduleStatus = WebServiceClientHelper.processDataByXpath(document, scheduleStatusXpath); + if(StringUtils.equals(scheduleStatus, WebServiceClientHelper.SCHEDULE_STATUS_FINISH)){ + scheduleStatus = HrpInvoicePlan.SCHEDULE_STATUS_FINISH; + }else if(StringUtils.equals(scheduleStatus, WebServiceClientHelper.SCHEDULE_STATUS_SCHEDULED)){ + scheduleStatus = HrpInvoicePlan.SCHEDULE_STATUS_SCHEDULED; + } + hrpInvoicePlan.setScheduleStatus(scheduleStatus); + + hrpInvoicePlanList.add(hrpInvoicePlan); + } + + return hrpInvoicePlanList; + } + + @Override + public List findHrpInvoicePlanByTimeAndDepartCoding( + Date startDate, Date endDate, String departCoding) { + // TODO Auto-generated method stub + return null; + } + + @Override + public HrpInvoicePlan[] findHrpInvoicePlanpListByAppliedSerialNumbers( + List serialNumbers) { + // TODO Auto-generated method stub + return null; + } + + @Override + public List findSyncOperationReservationBySerialNumbers( + List serialNumbers) { + // TODO Auto-generated method stub + return null; + } + + @Override + public List findSyncOperationReservationByTimes( + Date startDate, Date endDate) { + // TODO Auto-generated method stub + return null; + } + + @Override + public List findSyncInvoicePlanByTimeAndRecordState( + Date startDate, Date endDate, String recordState) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void updateSyncInvoicePlanState(String recordState, + String serialNumber) { + // TODO Auto-generated method stub + + } + +} Index: ssts-web/src/main/webapp/WEB-INF/spring/security-standard/applicationContext-acegi-security.xml =================================================================== diff -u -r35029 -r35405 --- ssts-web/src/main/webapp/WEB-INF/spring/security-standard/applicationContext-acegi-security.xml (.../applicationContext-acegi-security.xml) (revision 35029) +++ ssts-web/src/main/webapp/WEB-INF/spring/security-standard/applicationContext-acegi-security.xml (.../applicationContext-acegi-security.xml) (revision 35405) @@ -90,6 +90,7 @@ + Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/basedatamanager/supplyroomconfig/action/SupplyRoomConfigAction.java =================================================================== diff -u -r35077 -r35405 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/basedatamanager/supplyroomconfig/action/SupplyRoomConfigAction.java (.../SupplyRoomConfigAction.java) (revision 35077) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/basedatamanager/supplyroomconfig/action/SupplyRoomConfigAction.java (.../SupplyRoomConfigAction.java) (revision 35405) @@ -1120,6 +1120,11 @@ if(DatabaseUtil.isPoIdValid(noOperationTime)){ supplyRoomConfig.setNoOperationTime(Integer.valueOf(noOperationTime)); } + //“数据实时看板待处理查询周期”(ZSWY-179) + String dashboardsQueryCycle = rq.getParameter("dashboardsQueryCycle"); + if(DatabaseUtil.isPoIdValid(dashboardsQueryCycle)){ + supplyRoomConfig.setDashboardsQueryCycle(Integer.valueOf(dashboardsQueryCycle)); + } } supplyRoomConfigManager.save(supplyRoomConfig); Index: ssts-datasync/src/main/java/com/forgon/disinfectsystem/inventorymanagement/model/HrpInvoicePlan.java =================================================================== diff -u -r29937 -r35405 --- ssts-datasync/src/main/java/com/forgon/disinfectsystem/inventorymanagement/model/HrpInvoicePlan.java (.../HrpInvoicePlan.java) (revision 29937) +++ ssts-datasync/src/main/java/com/forgon/disinfectsystem/inventorymanagement/model/HrpInvoicePlan.java (.../HrpInvoicePlan.java) (revision 35405) @@ -108,7 +108,21 @@ */ private String circuitNurse; + /** + * 申请状态为“已安排” + */ + public static final String SCHEDULE_STATUS_SCHEDULED = "已安排"; + /** + * 申请状态为“已完成” + */ + public static final String SCHEDULE_STATUS_FINISH = "已完成"; + + /** + * 申请单状态(ZSWY-179) + */ + private String scheduleStatus; + public String getOperationName() { return operationName; } @@ -303,4 +317,12 @@ } } + public String getScheduleStatus() { + return scheduleStatus; + } + + public void setScheduleStatus(String scheduleStatus) { + this.scheduleStatus = scheduleStatus; + } + } Index: ssts-zd5y-misc/src/main/java/com/forgon/disinfectsystem/datasynchronization/zd5y/dao/WebServiceClientHelper.java =================================================================== diff -u -r13772 -r35405 --- ssts-zd5y-misc/src/main/java/com/forgon/disinfectsystem/datasynchronization/zd5y/dao/WebServiceClientHelper.java (.../WebServiceClientHelper.java) (revision 13772) +++ ssts-zd5y-misc/src/main/java/com/forgon/disinfectsystem/datasynchronization/zd5y/dao/WebServiceClientHelper.java (.../WebServiceClientHelper.java) (revision 35405) @@ -1,12 +1,28 @@ package com.forgon.disinfectsystem.datasynchronization.zd5y.dao; +import java.nio.charset.Charset; +import java.util.Date; + import org.apache.commons.lang.StringUtils; +import org.apache.http.HttpEntity; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.util.EntityUtils; import org.apache.log4j.Logger; +import org.dom4j.Document; +import org.dom4j.Node; +import org.dom4j.XPath; import org.springframework.web.util.HtmlUtils; import com.forgon.disinfectsystem.common.CssdUtils; +import com.forgon.exception.SystemException; import com.forgon.tools.Constants; +import com.forgon.tools.date.DateTools; import net.sf.json.JSON; import net.sf.json.xml.XMLSerializer; @@ -20,6 +36,36 @@ private static final Integer NUM_LEN = 10;//住院号、诊疗号长度 + /** + * 手术排班接口地址ZSWY-179 + */ + public final static String OPERATION_SCHEDULE_ADDRESS = "http://172.16.60.49:8585/services/SELECT_DC_OPERATION_REQ_SCHEDULE"; + + /** + * 查询接口需要的鉴权码ZSWY-179 + */ + public final static String MDIP_ACCESSTOKEN = "D0FD76C04B2BEDF1EF9EAD259528A2ED"; + + /** + * 交互成功标志 0:成功 1:失败ZSWY-179 + */ + public final static String RETURN_CODE_SUCCESS = "0"; + + /** + * 交互成功标志 0:成功 1:失败ZSWY-179 + */ + public final static String RETURN_CODE_FAIL = "1"; + + /** + * 申请状态为“已安排”ZSWY-179 + */ + public static final String SCHEDULE_STATUS_SCHEDULED = "2"; + + /** + * 申请状态为“已完成”ZSWY-179 + */ + public static final String SCHEDULE_STATUS_FINISH = "4"; + private final Logger logger = Logger.getLogger(this.getClass()); public static String buildHospitalNumContent(String num){ @@ -138,4 +184,97 @@ } return null; } + + /** + * 构建请求信息 + * @param startDate + * @param endDate + * @return + */ + public static String buildInputString(Date startDate, Date endDate) { + + if(startDate == null || endDate == null){ + throw new SystemException("开始结束时间不能为空!"); + } + + StringBuffer inputStringBuffer = new StringBuffer(); + inputStringBuffer.append(""); + + inputStringBuffer.append(""); + inputStringBuffer.append(""); + inputStringBuffer.append("" + MDIP_ACCESSTOKEN + ""); + inputStringBuffer.append(""); + inputStringBuffer.append(""); + + inputStringBuffer.append(""); + inputStringBuffer.append(""); + inputStringBuffer.append(""); + inputStringBuffer.append(""); + inputStringBuffer.append("" + DateTools.getFormatDateStr(startDate, DateTools.COMMON_DATE_HMS) + ""); + inputStringBuffer.append("" + DateTools.getFormatDateStr(endDate, DateTools.COMMON_DATE_HMS) + ""); + inputStringBuffer.append("]]>"); + inputStringBuffer.append(""); + inputStringBuffer.append(""); + inputStringBuffer.append(""); + + inputStringBuffer.append(""); + + return inputStringBuffer.toString(); + } + + /** + * 解析xml字段 + * @param document + * @param nameSpaceURIMap + * @param xpathExp + * @return + */ + public static String processDataByXpath(Document document, String xpathExp) { + if ((StringUtils.isNotBlank(xpathExp)) && (document != null)) { + XPath xpath = document.createXPath(xpathExp); + Node node = xpath.selectSingleNode(document); + if (node != null) { + return node.getStringValue(); + } + } + return ""; + } + + /** + * 使用SOAP1.2发送消息 + * + * @param postUrl + * @param soapXml + * @param soapAction + * @return + * @throws Exception + */ + public static String doPostSoap1_2(String postUrl, String soapXml) throws Exception { + String retStr = ""; + // 创建HttpClientBuilder + HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + // HttpClient + CloseableHttpClient closeableHttpClient = httpClientBuilder.build(); + HttpPost httpPost = new HttpPost(postUrl); + // 设置请求和传输超时时间 + RequestConfig requestConfig = RequestConfig.custom() + .setSocketTimeout(3000000).setConnectionRequestTimeout(3000000) + .setConnectTimeout(3000000).build(); + httpPost.setConfig(requestConfig); + httpPost.setHeader("Content-Type", "application/soap+xml;charset=UTF-8;"); + StringEntity data = new StringEntity(soapXml,Charset.forName("UTF-8")); + httpPost.setEntity(data); + CloseableHttpResponse response = closeableHttpClient.execute(httpPost); + HttpEntity httpEntity = response.getEntity(); + if (httpEntity != null) { + // 打印响应内容 + retStr = EntityUtils.toString(httpEntity, "UTF-8"); + retStr = retStr.replaceAll("<", "<"); + retStr = retStr.replaceAll(">", ">"); + } + // 释放资源 + closeableHttpClient.close(); + return retStr; + } + }