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
82414d64
Commit
82414d64
authored
Apr 26, 2021
by
linruibiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口编写
parent
fd40ee3b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
13 deletions
+16
-13
RestTemplateUtils.java
.../java/com/syc/slm/common/core/util/RestTemplateUtils.java
+0
-0
VariableController.java
...java/com/syc/slm/slmbi/controller/VariableController.java
+9
-9
BusinessConfigServiceImpl.java
...syc/slm/slmbi/service/impl/BusinessConfigServiceImpl.java
+7
-4
No files found.
src/main/java/com/syc/slm/common/core/util/RestTemplateUtils.java
View file @
82414d64
This diff is collapsed.
Click to expand it.
src/main/java/com/syc/slm/slmbi/controller/VariableController.java
View file @
82414d64
...
@@ -61,15 +61,15 @@ public class VariableController extends BaseRestController{
...
@@ -61,15 +61,15 @@ public class VariableController extends BaseRestController{
Map
<
String
,
String
>
heads
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
heads
=
Maps
.
newHashMap
();
heads
.
put
(
"token"
,
"345aa488a820448dbb069ea4295d2b15"
);
heads
.
put
(
"token"
,
"345aa488a820448dbb069ea4295d2b15"
);
R
<
List
<
PanelTreeNodeVo
>>
newR
=
new
R
<>();
R
<
List
<
PanelTreeNodeVo
>>
newR
=
new
R
<>();
//
ResponseEntity
<
Map
>
rest
=
RestTemplateUtils
.
get
(
//
ResponseEntity<Map> rest = RestTemplateUtils.get(
"http://localhost:2400/dc/{appId}/equipment/info/name/pull?token={token}&equipment_info_id={equipment_info_id}&customer_id={customer_id}&q_name={q_name}&search_code={search_code}&search_model={search_model}&warranty_status={warranty_status}&page_num={page_num}&page_size={page_size}"
,
//
"http://localhost:2400/dc/{appId}/equipment/info/name/pull?token={token}&equipment_info_id={equipment_info_id}&customer_id={customer_id}&q_name={q_name}&search_code={search_code}&search_model={search_model}&warranty_status={warranty_status}&page_num={page_num}&page_size={page_size}",
heads
,
//
heads,
Map
.
class
,
//
Map.class,
maps
);
//
maps);
if
(
rest
!=
null
){
//
if (rest != null){
return
rest
.
getBody
();
//
return rest.getBody();
}
//
}
return
null
;
return
null
;
}
}
...
...
src/main/java/com/syc/slm/slmbi/service/impl/BusinessConfigServiceImpl.java
View file @
82414d64
...
@@ -106,11 +106,10 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
...
@@ -106,11 +106,10 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
}
}
});
});
});
});
Map
<
String
,
String
>
heads
=
Maps
.
newHashMap
();
heads
.
put
(
"X-Token"
,
user
.
getToken
());
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
R
<
List
<
Map
<
String
,
Object
>>>
result
=
RestTemplateUtils
.
post
(
uri
,
heads
,
dto
,
new
TypeToken
<
R
<
List
<
Map
<
String
,
Object
>>>>()
{}.
getType
(),
uriVariables
);
R
<
List
<
Map
<
String
,
Object
>>>
result
=
RestTemplateUtils
.
post
(
uri
,
null
,
dto
,
new
TypeToken
<
R
<
List
<
Map
<
String
,
Object
>>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
return
result
.
detach
();
}
}
...
@@ -131,7 +130,11 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
...
@@ -131,7 +130,11 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
uriVariables
.
put
(
"size"
,
size
);
uriVariables
.
put
(
"size"
,
size
);
uriVariables
.
put
(
"name"
,
name
);
uriVariables
.
put
(
"name"
,
name
);
IPage
<
String
>
page
=
new
Page
<>(
current
,
size
);
IPage
<
String
>
page
=
new
Page
<>(
current
,
size
);
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{}.
getType
(),
uriVariables
);
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
get
(
uri
,()->{
Map
<
String
,
String
>
header
=
Maps
.
newHashMap
();
header
.
put
(
"X-Token"
,
currentUser
.
getToken
());
return
header
;
},
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{}.
getType
(),
uriVariables
);
Map
<
String
,
Object
>
resultMaps
=
result
.
detach
();
Map
<
String
,
Object
>
resultMaps
=
result
.
detach
();
if
(
CollectionUtils
.
isNotEmpty
(
resultMaps
)){
if
(
CollectionUtils
.
isNotEmpty
(
resultMaps
)){
page
.
setTotal
(
new
BigDecimal
(
resultMaps
.
get
(
"total"
)+
""
).
longValue
());
page
.
setTotal
(
new
BigDecimal
(
resultMaps
.
get
(
"total"
)+
""
).
longValue
());
...
...
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