Commit 05c8e84e authored by 梁光意's avatar 梁光意

修改配置

parent b33da8f3
......@@ -59,6 +59,7 @@ public final class RestTemplateUtils {
Map<String, String> headMap = Maps.newHashMap();
headMap.put(SlmConstants.TOKEN_PREFIX, token);
ResponseEntity<String> response = get(url, headMap, String.class, uriVariables);
log.info("请求结果是=============:{}",response.getBody());
if(HttpStatus.OK.value() == response.getStatusCodeValue()){
if(resultType.equals(String.class)) {
return (TResult)response.getBody();
......
......@@ -53,10 +53,8 @@ public class VariableServiceImpl implements VariableService {
p.put("isCustomer",null);
p.put("current",variableDTO.getCurrent()+"");
p.put("size",variableDTO.getSize()+"");
Map<String,String> heads = Maps.newHashMap();
heads.put("X-Token",token);
R<Map<String, Object>> result = RestTemplateUtils.get(uri, heads, new TypeToken<R<Map<String, Object>>>() {
R<Map<String, Object>> result = RestTemplateUtils.get(uri, new TypeToken<R<Map<String, Object>>>() {
}.getType(), p);
Map<String, Object> detach = result.detach();
if (CollectionUtils.isNotEmpty(detach)) {
......@@ -104,9 +102,7 @@ public class VariableServiceImpl implements VariableService {
p.put("warranty_status", null);
p.put("page_num", queryPageDTO.getCurrent() + "");
p.put("page_size", queryPageDTO.getSize() + "");
Map<String, String> heads = Maps.newHashMap();
heads.put("X-Token", token);
R<Map<String, Object>> result = RestTemplateUtils.get(uri, heads, new TypeToken<R<Map<String, Object>>>() {
R<Map<String, Object>> result = RestTemplateUtils.get(uri, new TypeToken<R<Map<String, Object>>>() {
}.getType(), p);
Map<String, Object> detach = result.detach();
if (CollectionUtils.isNotEmpty(detach)) {
......@@ -140,11 +136,9 @@ public class VariableServiceImpl implements VariableService {
if(StringUtils.isBlank(variableDTO.getFormat())) {
throw new SysException(" 请填入时间格式");
}
Map<String, String> heads = Maps.newHashMap();
heads.put("X-Token", user.getToken());
Map<String, String> uriVariables =SlmConstants.gson.fromJson(SlmConstants.gson.toJson(variableDTO),new TypeToken<Map<String,String>>(){}.getType());
uriVariables.put("appId",user.getAppId());
R<Map<String, List<Map<String, Object>>>> result = RestTemplateUtils.get(uri, heads, new TypeToken<R<Map<String, List<Map<String, Object>>>>>() {}.getType(), uriVariables);
R<Map<String, List<Map<String, Object>>>> result = RestTemplateUtils.get(uri, new TypeToken<R<Map<String, List<Map<String, Object>>>>>() {}.getType(), uriVariables);
return result.detach();
}
......@@ -187,12 +181,10 @@ public class VariableServiceImpl implements VariableService {
throw new SysException("统计维度为时间,请填入时间格式");
}
}
Map<String, String> heads = Maps.newHashMap();
heads.put("X-Token", user.getToken());
Map<String, String> uriVariables =SlmConstants.gson.fromJson(SlmConstants.gson.toJson(variableDTO),new TypeToken<Map<String,String>>(){}.getType());
uriVariables.put("appId",user.getAppId());
R<List<Map<String, Object>>> result = RestTemplateUtils.get(uri, heads, new TypeToken<R<List<Map<String, Object>>>>() {}.getType(), uriVariables);
R<List<Map<String, Object>>> result = RestTemplateUtils.get(uri, new TypeToken<R<List<Map<String, Object>>>>() {}.getType(), uriVariables);
return result.detach();
}
......@@ -260,11 +252,9 @@ public class VariableServiceImpl implements VariableService {
}
private R<Map<String,String>> setDeptAndRole(CurrentUser user,String uri){
Map<String,String> heads = Maps.newHashMap();
heads.put("X-Token",user.getToken());
Map<String,String> uriVariables =Maps.newHashMap();
uriVariables.put("appId",user.getAppId());
return RestTemplateUtils.get(uri, heads, new TypeToken<R<Map<String,String>>>() {}.getType(), uriVariables);
return RestTemplateUtils.get(uri,new TypeToken<R<Map<String,String>>>() {}.getType(), uriVariables);
}
......
......@@ -4,7 +4,7 @@ spring:
password: Test123!
url: jdbc:mysql://${MYSQL_HOST:116.63.67.122}:${MYSQL_PORT:3306}/${MYSQL_DB:slm_bi}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true
dc_client:
host: http://139.9.194.252:2400/dc # http://192.168.0.3:2400/dc # http://apidev.sycdev.com/dc
host: http://apidev.sycdev.com/dc
interfaces:
positionListUrl: /{appId}/positions?positionName={positionName}
deptListUrl: /{appId}/departments?deptName={deptName}
......@@ -12,6 +12,4 @@ dc_client:
variableList: /{appId}/variables/slm/tag/list?token={token}&from={from}&varType={varType}&type={type}&equipmentId={equipmentId}&customerId={customerId}&name={name}&desc={desc}&unit={unit}&keyword={keyword}&isCustomer={isCustomer}&current={current}&size={size}
deviceList: /{appId}/variables/device?token={token}&equipment_info_id={equipment_info_id}&q_name={q_name}&search_code={search_code}&warranty_status={warranty_status}&page_num={page_num}&page_size={page_size}
deptsRoles: /{appId}/users/depts-roles
businessFiledData: /{appId}/business/filed
variableHistoryDataList: /{appId}/variables/history?deviceId={deviceId}&endTime={endTime}&startTime={startTime}&statisticsType={statisticsType}&variableCode={variableCode}&variableId={variableId}&x={x}&format={format}
variableRealTimeDataList: /{appId}/variables/real-time?deviceId={deviceId}&endTime={endTime}&startTime={startTime}&variableCode={variableCode}&variableId={variableId}&format={format}
\ No newline at end of file
businessFiledData: /{appId}/business/filed
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment