1.日志使用配置的接口调用工具2.特殊服务新增下拉过长会被遮挡改为无搜索框,页面显示调整
This commit is contained in:
@@ -20,6 +20,10 @@ import java.util.Map.Entry;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.ws.rs.client.WebTarget;
|
||||||
|
import javax.ws.rs.client.Invocation.Builder;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
import javax.ws.rs.core.Response;
|
||||||
|
|
||||||
import org.apache.http.HttpStatus;
|
import org.apache.http.HttpStatus;
|
||||||
import org.apache.http.NameValuePair;
|
import org.apache.http.NameValuePair;
|
||||||
@@ -136,22 +140,36 @@ public class HttpClientUtil {
|
|||||||
public static String getMsg(String destUrl, Map<String, Object> params, HttpServletRequest req) {
|
public static String getMsg(String destUrl, Map<String, Object> params, HttpServletRequest req) {
|
||||||
RequestContext requestContext = new RequestContext(req);
|
RequestContext requestContext = new RequestContext(req);
|
||||||
|
|
||||||
CloseableHttpResponse response = null;
|
// CloseableHttpResponse response = null;
|
||||||
String result = null;
|
String result = null;
|
||||||
|
String url = "";
|
||||||
try {
|
try {
|
||||||
URIBuilder uriBuilder = new URIBuilder(destUrl);
|
URIBuilder uriBuilder = new URIBuilder(destUrl);
|
||||||
for (String param : params.keySet()) {
|
for (String param : params.keySet()) {
|
||||||
uriBuilder.addParameter(param, params.get(param).toString());
|
uriBuilder.addParameter(param, params.get(param).toString());
|
||||||
}
|
}
|
||||||
HttpGet request = new HttpGet(uriBuilder.build());
|
System.err.println(uriBuilder);
|
||||||
request.setConfig(requestConfig);
|
url=uriBuilder.toString();
|
||||||
URI uri = request.getURI();
|
//创建连接
|
||||||
logger.info(uri);
|
WebTarget wt = ClientUtil.getWebTarger(url);
|
||||||
System.err.println(uri);
|
logger.info("getId url:"+url);
|
||||||
response = getHttpClient().execute(request);
|
//获取响应结果
|
||||||
int status = response.getStatusLine().getStatusCode();
|
Builder header = wt.request(MediaType.APPLICATION_JSON).header("Content-Type", MediaType.APPLICATION_JSON);
|
||||||
|
Response response= header.get();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HttpGet request = new HttpGet(uriBuilder.build());
|
||||||
|
// request.setConfig(requestConfig);
|
||||||
|
// URI uri = request.getURI();
|
||||||
|
// logger.info(uri);
|
||||||
|
// System.err.println(uri);
|
||||||
|
// response = getHttpClient().execute(request);
|
||||||
|
// int status = response.getStatusLine().getStatusCode();
|
||||||
|
int status = response.getStatus();
|
||||||
if (status == HttpStatus.SC_OK) {
|
if (status == HttpStatus.SC_OK) {
|
||||||
result = EntityUtils.toString(response.getEntity());
|
result= response.readEntity(String.class);
|
||||||
|
// result = EntityUtils.toString(response.getEntity());
|
||||||
//调用处理数据方法
|
//调用处理数据方法
|
||||||
result = galaxyMessageFormat(result);
|
result = galaxyMessageFormat(result);
|
||||||
logger.debug("获取消息成功,相应内容如下: " + result);
|
logger.debug("获取消息成功,相应内容如下: " + result);
|
||||||
@@ -159,7 +177,7 @@ public class HttpClientUtil {
|
|||||||
} else {
|
} else {
|
||||||
throw new MaatConvertException(status+"");
|
throw new MaatConvertException(status+"");
|
||||||
}
|
}
|
||||||
} catch (SocketTimeoutException e) {
|
} /*catch (SocketTimeoutException e) {
|
||||||
logger.error("获取消息失败 ", e);
|
logger.error("获取消息失败 ", e);
|
||||||
throw new MaatConvertException(requestContext.getMessage("request_service_failed") + ":timeout");
|
throw new MaatConvertException(requestContext.getMessage("request_service_failed") + ":timeout");
|
||||||
} catch (MaatConvertException e) {
|
} catch (MaatConvertException e) {
|
||||||
@@ -167,10 +185,11 @@ public class HttpClientUtil {
|
|||||||
} catch (ConnectTimeoutException e) {
|
} catch (ConnectTimeoutException e) {
|
||||||
logger.error("获取消息失败 ", e);
|
logger.error("获取消息失败 ", e);
|
||||||
throw new MaatConvertException(requestContext.getMessage("request_service_failed") + ":timeout");
|
throw new MaatConvertException(requestContext.getMessage("request_service_failed") + ":timeout");
|
||||||
} catch (Exception e) {
|
}*/ catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
logger.error("获取消息失败 ", e);
|
logger.error("获取消息失败 ", e);
|
||||||
throw new MaatConvertException(requestContext.getMessage("request_service_failed"));
|
throw new MaatConvertException(requestContext.getMessage("request_service_failed"));
|
||||||
} finally {
|
} /*finally {
|
||||||
try {
|
try {
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
response.close();
|
response.close();
|
||||||
@@ -178,7 +197,7 @@ public class HttpClientUtil {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -243,7 +243,7 @@
|
|||||||
<c:if test="${dict.itemCode==1}">
|
<c:if test="${dict.itemCode==1}">
|
||||||
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="app_business_type"/>:</label>
|
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="app_business_type"/>:</label>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<select id="businessType1" name="businessType" class="selectpicker form-control required" data-live-search="true" data-live-search-placeholder="search">
|
<select id="businessType1" name="businessType" class="form-control required" data-live-search="true" data-live-search-placeholder="search">
|
||||||
<option value=""><spring:message code="select"/></option>
|
<option value=""><spring:message code="select"/></option>
|
||||||
<c:forEach items="${fns:getDictList('APP_BUSINESS_TYPE')}" var="dict">
|
<c:forEach items="${fns:getDictList('APP_BUSINESS_TYPE')}" var="dict">
|
||||||
<option value="${dict.itemCode}"
|
<option value="${dict.itemCode}"
|
||||||
@@ -256,7 +256,7 @@
|
|||||||
<c:if test="${dict.itemCode==3}">
|
<c:if test="${dict.itemCode==3}">
|
||||||
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="basic_protocol_business_type"/>:</label>
|
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="basic_protocol_business_type"/>:</label>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<select id="businessType3" name="businessType" class="selectpicker form-control required" data-live-search="true" data-live-search-placeholder="search">
|
<select id="businessType3" name="businessType" class="form-control required" data-live-search="true" data-live-search-placeholder="search">
|
||||||
<option value=""><spring:message code="select"/></option>
|
<option value=""><spring:message code="select"/></option>
|
||||||
<c:forEach items="${fns:getDictList('APP_BUSINESS_TYPE')}" var="dict">
|
<c:forEach items="${fns:getDictList('APP_BUSINESS_TYPE')}" var="dict">
|
||||||
<option value="${dict.itemCode}"
|
<option value="${dict.itemCode}"
|
||||||
@@ -269,7 +269,7 @@
|
|||||||
<c:if test="${dict.itemCode==2}">
|
<c:if test="${dict.itemCode==2}">
|
||||||
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="tunnel_behavior_business_type"/>:</label>
|
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="tunnel_behavior_business_type"/>:</label>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<select id="businessType2" name="businessType" class="selectpicker form-control required" data-live-search="true" data-live-search-placeholder="search">
|
<select id="businessType2" name="businessType" class="form-control required" data-live-search="true" data-live-search-placeholder="search">
|
||||||
<option value=""><spring:message code="select"/></option>
|
<option value=""><spring:message code="select"/></option>
|
||||||
<c:forEach items="${fns:getDictList('TUNNEL_BEHAV_BUSINESS_TYPE')}" var="dict">
|
<c:forEach items="${fns:getDictList('TUNNEL_BEHAV_BUSINESS_TYPE')}" var="dict">
|
||||||
<option value="${dict.itemCode}"
|
<option value="${dict.itemCode}"
|
||||||
|
|||||||
@@ -300,7 +300,7 @@
|
|||||||
</c:forEach>
|
</c:forEach>
|
||||||
</c:if>
|
</c:if>
|
||||||
<c:if test="${specificServiceCfg.cfgType==3}">
|
<c:if test="${specificServiceCfg.cfgType==3}">
|
||||||
<c:forEach items="${fns:getDictList('BASIC_PROTOCOL_BUSINESS_TYPE') }" var="dict">
|
<c:forEach items="${fns:getDictList('APP_BUSINESS_TYPE') }" var="dict">
|
||||||
<c:if test="${specificServiceCfg.businessType==dict.itemCode}">
|
<c:if test="${specificServiceCfg.businessType==dict.itemCode}">
|
||||||
<spring:message code="${dict.itemValue}"/>
|
<spring:message code="${dict.itemValue}"/>
|
||||||
</c:if>
|
</c:if>
|
||||||
|
|||||||
Reference in New Issue
Block a user