Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
slm-bi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林锐标
slm-bi
Commits
05c8e84e
Commit
05c8e84e
authored
Apr 25, 2021
by
梁光意
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改配置
parent
b33da8f3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
20 deletions
+9
-20
RestTemplateUtils.java
.../java/com/syc/slm/common/core/util/RestTemplateUtils.java
+1
-0
VariableServiceImpl.java
...a/com/syc/slm/slmbi/service/impl/VariableServiceImpl.java
+5
-15
application-dev.yml
src/main/resources/application-dev.yml
+3
-5
No files found.
src/main/java/com/syc/slm/common/core/util/RestTemplateUtils.java
View file @
05c8e84e
...
...
@@ -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
();
...
...
src/main/java/com/syc/slm/slmbi/service/impl/VariableServiceImpl.java
View file @
05c8e84e
...
...
@@ -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
);
}
...
...
src/main/resources/application-dev.yml
View file @
05c8e84e
...
...
@@ -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}¤t={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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment