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
26ffd784
Commit
26ffd784
authored
Apr 21, 2021
by
linruibiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口编写
parent
61ac2504
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
68 additions
and
39 deletions
+68
-39
BaseRestController.java
...java/com/syc/slm/slmbi/controller/BaseRestController.java
+9
-20
BusinessConfigController.java
...om/syc/slm/slmbi/controller/BusinessConfigController.java
+7
-2
DeptController.java
...ain/java/com/syc/slm/slmbi/controller/DeptController.java
+7
-2
InstrumentPanelTreeController.java
...c/slm/slmbi/controller/InstrumentPanelTreeController.java
+17
-6
PositionController.java
...java/com/syc/slm/slmbi/controller/PositionController.java
+7
-2
TokenController.java
...in/java/com/syc/slm/slmbi/controller/TokenController.java
+2
-1
UserController.java
...ain/java/com/syc/slm/slmbi/controller/UserController.java
+7
-2
VariableController.java
...java/com/syc/slm/slmbi/controller/VariableController.java
+12
-4
No files found.
src/main/java/com/syc/slm/slmbi/controller/BaseRestController.java
View file @
26ffd784
...
@@ -34,16 +34,6 @@ import java.util.function.Supplier;
...
@@ -34,16 +34,6 @@ import java.util.function.Supplier;
public
class
BaseRestController
{
public
class
BaseRestController
{
/**
* 用户token
*/
protected
String
token
;
/**
* 用户信息
*/
protected
CurrentUser
currentUser
;
@Value
(
"${dc_client.host}"
)
@Value
(
"${dc_client.host}"
)
protected
String
dcClientHost
;
protected
String
dcClientHost
;
@Value
(
"${dc_client.interfaces.positionListUrl}"
)
@Value
(
"${dc_client.interfaces.positionListUrl}"
)
...
@@ -83,7 +73,7 @@ public class BaseRestController {
...
@@ -83,7 +73,7 @@ public class BaseRestController {
}
}
}
}
log
.
info
(
"请求头参数--->>>>"
+
SlmConstants
.
gson
.
toJson
(
headers
));
log
.
info
(
"请求头参数--->>>>"
+
SlmConstants
.
gson
.
toJson
(
headers
));
token
=
request
.
getHeader
(
"X-Token"
);
String
token
=
request
.
getHeader
(
"X-Token"
);
if
(!
uri
.
contains
(
"tokens"
))
{
if
(!
uri
.
contains
(
"tokens"
))
{
if
(
StringUtils
.
isEmpty
(
token
))
{
if
(
StringUtils
.
isEmpty
(
token
))
{
throw
new
SysException
(
"token不能为空"
);
throw
new
SysException
(
"token不能为空"
);
...
@@ -97,15 +87,9 @@ public class BaseRestController {
...
@@ -97,15 +87,9 @@ public class BaseRestController {
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"appId"
,
map
.
get
(
"appId"
)+
""
);
uriVariables
.
put
(
"appId"
,
map
.
get
(
"appId"
)+
""
);
String
getUrl
=
dcClientHost
+
"/{appId}/users/user-info"
;
String
getUrl
=
dcClientHost
+
"/{appId}/users/user-info"
;
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
get
(
getUrl
,
heads
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{}.
getType
(),
uriVariables
);
R
<
CurrentUser
>
result
=
RestTemplateUtils
.
get
(
getUrl
,
heads
,
new
TypeToken
<
R
<
CurrentUser
>>()
{
Map
<
String
,
Object
>
userInfo
=
result
.
detach
();
}.
getType
(),
uriVariables
);
currentUser
=
new
CurrentUser
();
request
.
getSession
().
setAttribute
(
token
,
SlmConstants
.
gson
.
toJson
(
result
.
detach
()));
currentUser
.
setUid
(
userInfo
.
get
(
"uid"
)+
""
);
currentUser
.
setPlatformId
(
userInfo
.
get
(
"platform_id"
)+
""
);
currentUser
.
setName
(
userInfo
.
get
(
"real_name"
)+
""
);
currentUser
.
setAppId
(
userInfo
.
get
(
"app_id"
)+
""
);
currentUser
.
setToken
(
token
);
request
.
getSession
().
setAttribute
(
token
,
SlmConstants
.
gson
.
toJson
(
currentUser
));
}
}
...
@@ -117,4 +101,9 @@ public class BaseRestController {
...
@@ -117,4 +101,9 @@ public class BaseRestController {
<
T
>
R
<
T
>
call
(
Supplier
<
T
>
supplier
)
{
<
T
>
R
<
T
>
call
(
Supplier
<
T
>
supplier
)
{
return
NetResponseUtils
.
call
(
supplier
);
return
NetResponseUtils
.
call
(
supplier
);
}
}
protected
CurrentUser
getCurrentUser
(
HttpServletRequest
request
){
String
token
=
request
.
getHeader
(
"X-Token"
);
return
SlmConstants
.
gson
.
fromJson
(
request
.
getSession
().
getAttribute
(
token
).
toString
(),
CurrentUser
.
class
);
}
}
}
src/main/java/com/syc/slm/slmbi/controller/BusinessConfigController.java
View file @
26ffd784
...
@@ -2,6 +2,7 @@ package com.syc.slm.slmbi.controller;
...
@@ -2,6 +2,7 @@ package com.syc.slm.slmbi.controller;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.slmbi.dto.BusinessDTO
;
import
com.syc.slm.slmbi.dto.BusinessDTO
;
import
com.syc.slm.slmbi.entity.CurrentUser
;
import
com.syc.slm.slmbi.service.BusinessConfigService
;
import
com.syc.slm.slmbi.service.BusinessConfigService
;
import
com.syc.slm.slmbi.vo.BusinessConfigVo
;
import
com.syc.slm.slmbi.vo.BusinessConfigVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -11,6 +12,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -11,6 +12,7 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -49,7 +51,10 @@ public class BusinessConfigController extends BaseRestController{
...
@@ -49,7 +51,10 @@ public class BusinessConfigController extends BaseRestController{
@PostMapping
(
"/filed"
)
@PostMapping
(
"/filed"
)
@ApiOperation
(
"根据配置字段获取字段数据"
)
@ApiOperation
(
"根据配置字段获取字段数据"
)
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)
public
R
<
List
<
Map
<
String
,
Object
>>>
getBusinessData
(
@PathVariable
String
appId
,
@RequestBody
BusinessDTO
dto
)
{
public
R
<
List
<
Map
<
String
,
Object
>>>
getBusinessData
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
@RequestBody
BusinessDTO
dto
)
{
return
call
(()->(
businessConfigService
.
getBusinessData
(
dto
,
businessFiledData
,
currentUser
)));
return
call
(()->{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
businessConfigService
.
getBusinessData
(
dto
,
businessFiledData
,
currentUser
);
});
}
}
}
}
src/main/java/com/syc/slm/slmbi/controller/DeptController.java
View file @
26ffd784
package
com
.
syc
.
slm
.
slmbi
.
controller
;
package
com
.
syc
.
slm
.
slmbi
.
controller
;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.slmbi.entity.CurrentUser
;
import
com.syc.slm.slmbi.service.DeptService
;
import
com.syc.slm.slmbi.service.DeptService
;
import
com.syc.slm.slmbi.vo.DeptVo
;
import
com.syc.slm.slmbi.vo.DeptVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -10,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -10,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -31,8 +33,11 @@ public class DeptController extends BaseRestController{
...
@@ -31,8 +33,11 @@ public class DeptController extends BaseRestController{
@ApiOperation
(
"部门查询"
)
@ApiOperation
(
"部门查询"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"deptName"
,
value
=
"部门名称"
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"deptName"
,
value
=
"部门名称"
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)})
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)})
public
R
<
List
<
DeptVo
>>
selectDeptList
(
@PathVariable
String
appId
,
public
R
<
List
<
DeptVo
>>
selectDeptList
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
@RequestParam
(
value
=
"deptName"
,
required
=
false
)
String
deptName
)
{
@RequestParam
(
value
=
"deptName"
,
required
=
false
)
String
deptName
)
{
return
call
(()->(
deptService
.
selectPositionList
(
dcClientHost
+
deptListUrl
,
token
,
appId
,
deptName
)));
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
deptService
.
selectPositionList
(
dcClientHost
+
deptListUrl
,
currentUser
.
getToken
(),
appId
,
deptName
);
});
}
}
}
}
src/main/java/com/syc/slm/slmbi/controller/InstrumentPanelTreeController.java
View file @
26ffd784
package
com
.
syc
.
slm
.
slmbi
.
controller
;
package
com
.
syc
.
slm
.
slmbi
.
controller
;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.slmbi.entity.CurrentUser
;
import
com.syc.slm.slmbi.service.InstrumentPanelConfigService
;
import
com.syc.slm.slmbi.service.InstrumentPanelConfigService
;
import
com.syc.slm.slmbi.service.InstrumentPanelTreeService
;
import
com.syc.slm.slmbi.service.InstrumentPanelTreeService
;
import
com.syc.slm.slmbi.vo.InstrumentPanelConfigVo
;
import
com.syc.slm.slmbi.vo.InstrumentPanelConfigVo
;
...
@@ -12,6 +13,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -12,6 +13,7 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -33,8 +35,11 @@ public class InstrumentPanelTreeController extends BaseRestController {
...
@@ -33,8 +35,11 @@ public class InstrumentPanelTreeController extends BaseRestController {
@GetMapping
@GetMapping
@ApiOperation
(
"显示已发布仪表板树==》(刚进入页面)"
)
@ApiOperation
(
"显示已发布仪表板树==》(刚进入页面)"
)
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)
public
R
<
List
<
PanelTreeNodeVo
>>
loadTrees
(
@PathVariable
String
appId
)
{
public
R
<
List
<
PanelTreeNodeVo
>>
loadTrees
(
HttpServletRequest
request
,
@PathVariable
String
appId
)
{
return
call
(()
->
(
treeService
.
loadTrees
(
appId
,
dcClientHost
+
deptsRoles
,
currentUser
)));
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
treeService
.
loadTrees
(
appId
,
dcClientHost
+
deptsRoles
,
currentUser
);
});
}
}
@GetMapping
(
"/search"
)
@GetMapping
(
"/search"
)
...
@@ -44,9 +49,12 @@ public class InstrumentPanelTreeController extends BaseRestController {
...
@@ -44,9 +49,12 @@ public class InstrumentPanelTreeController extends BaseRestController {
required
=
true
,
required
=
true
,
dataTypeClass
=
String
.
class
),
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
"name"
,
value
=
"分组名称或者仪表板名称"
,
dataTypeClass
=
String
.
class
)})
@ApiImplicitParam
(
name
=
"name"
,
value
=
"分组名称或者仪表板名称"
,
dataTypeClass
=
String
.
class
)})
public
R
<
List
<
PanelTreeNodeVo
>>
loadTrees
(
@PathVariable
String
appId
,
public
R
<
List
<
PanelTreeNodeVo
>>
loadTrees
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
)
{
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
)
{
return
call
(()
->
(
treeService
.
loadTrees
(
appId
,
name
,
dcClientHost
+
deptsRoles
,
currentUser
)));
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
treeService
.
loadTrees
(
appId
,
name
,
dcClientHost
+
deptsRoles
,
currentUser
);
});
}
}
@GetMapping
(
"/children"
)
@GetMapping
(
"/children"
)
...
@@ -57,10 +65,13 @@ public class InstrumentPanelTreeController extends BaseRestController {
...
@@ -57,10 +65,13 @@ public class InstrumentPanelTreeController extends BaseRestController {
dataTypeClass
=
String
.
class
),
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
"nodeId"
,
value
=
"分组id"
,
required
=
true
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
"nodeId"
,
value
=
"分组id"
,
required
=
true
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
"name"
,
value
=
"分组名称或者仪表板名称"
,
dataTypeClass
=
String
.
class
)})
@ApiImplicitParam
(
name
=
"name"
,
value
=
"分组名称或者仪表板名称"
,
dataTypeClass
=
String
.
class
)})
public
R
<
List
<
PanelTreeNodeVo
>>
children
(
@PathVariable
String
appId
,
public
R
<
List
<
PanelTreeNodeVo
>>
children
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
@RequestParam
(
"nodeId"
)
String
nodeId
,
@RequestParam
(
"nodeId"
)
String
nodeId
,
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
)
{
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
)
{
return
call
(()
->
(
treeService
.
children
(
nodeId
,
name
,
dcClientHost
+
deptsRoles
,
currentUser
)));
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
treeService
.
children
(
nodeId
,
name
,
dcClientHost
+
deptsRoles
,
currentUser
);
});
}
}
@GetMapping
(
"/children-panel"
)
@GetMapping
(
"/children-panel"
)
...
...
src/main/java/com/syc/slm/slmbi/controller/PositionController.java
View file @
26ffd784
package
com
.
syc
.
slm
.
slmbi
.
controller
;
package
com
.
syc
.
slm
.
slmbi
.
controller
;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.slmbi.entity.CurrentUser
;
import
com.syc.slm.slmbi.service.PositionService
;
import
com.syc.slm.slmbi.service.PositionService
;
import
com.syc.slm.slmbi.vo.PositionVo
;
import
com.syc.slm.slmbi.vo.PositionVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -11,6 +12,7 @@ import org.apache.catalina.Host;
...
@@ -11,6 +12,7 @@ import org.apache.catalina.Host;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -32,8 +34,11 @@ public class PositionController extends BaseRestController{
...
@@ -32,8 +34,11 @@ public class PositionController extends BaseRestController{
@ApiOperation
(
"职位查询列表"
)
@ApiOperation
(
"职位查询列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
"positionName"
,
value
=
"职位名称"
,
dataTypeClass
=
String
.
class
)})
@ApiImplicitParam
(
name
=
"positionName"
,
value
=
"职位名称"
,
dataTypeClass
=
String
.
class
)})
public
R
<
List
<
PositionVo
>>
selectPositionList
(
@PathVariable
String
appId
,
public
R
<
List
<
PositionVo
>>
selectPositionList
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
@RequestParam
(
value
=
"positionName"
,
required
=
false
)
String
positionName
)
{
@RequestParam
(
value
=
"positionName"
,
required
=
false
)
String
positionName
)
{
return
call
(()->(
positionWorkService
.
selectPositionList
(
dcClientHost
+
positionListUrl
,
token
,
appId
,
positionName
)));
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
positionWorkService
.
selectPositionList
(
dcClientHost
+
positionListUrl
,
currentUser
.
getToken
(),
appId
,
positionName
);
});
}
}
}
}
src/main/java/com/syc/slm/slmbi/controller/TokenController.java
View file @
26ffd784
...
@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.sound.midi.SysexMessage
;
import
javax.sound.midi.SysexMessage
;
import
java.lang.reflect.Type
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -37,7 +38,7 @@ public class TokenController extends BaseRestController{
...
@@ -37,7 +38,7 @@ public class TokenController extends BaseRestController{
public
R
<
Map
<
String
,
Object
>>
token
(
String
account
,
String
password
,
Integer
origin
){
public
R
<
Map
<
String
,
Object
>>
token
(
String
account
,
String
password
,
Integer
origin
){
return
call
(()->{
return
call
(()->{
Map
<
String
,
Object
>
maps
=
Maps
.
newHashMap
();
Map
<
String
,
Object
>
maps
=
Maps
.
newHashMap
();
String
uri
=
dcClientHost
+
"/
dc/
user/token?account="
+
account
+
"&password="
+
password
+
"&origin="
+
origin
;
String
uri
=
dcClientHost
+
"/user/token?account="
+
account
+
"&password="
+
password
+
"&origin="
+
origin
;
ResponseEntity
<
Map
>
post
=
RestTemplateUtils
.
post
(
uri
,
Map
.
class
);
ResponseEntity
<
Map
>
post
=
RestTemplateUtils
.
post
(
uri
,
Map
.
class
);
if
(
ObjectUtils
.
isNotEmpty
(
post
)){
if
(
ObjectUtils
.
isNotEmpty
(
post
)){
Integer
code
=
(
int
)
post
.
getBody
().
get
(
"code"
);
Integer
code
=
(
int
)
post
.
getBody
().
get
(
"code"
);
...
...
src/main/java/com/syc/slm/slmbi/controller/UserController.java
View file @
26ffd784
package
com
.
syc
.
slm
.
slmbi
.
controller
;
package
com
.
syc
.
slm
.
slmbi
.
controller
;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.slmbi.entity.CurrentUser
;
import
com.syc.slm.slmbi.service.UserService
;
import
com.syc.slm.slmbi.service.UserService
;
import
com.syc.slm.slmbi.vo.UserTreeVo
;
import
com.syc.slm.slmbi.vo.UserTreeVo
;
import
com.syc.slm.slmbi.vo.UserVo
;
import
com.syc.slm.slmbi.vo.UserVo
;
...
@@ -11,6 +12,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -11,6 +12,7 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -31,8 +33,11 @@ public class UserController extends BaseRestController{
...
@@ -31,8 +33,11 @@ public class UserController extends BaseRestController{
@GetMapping
@GetMapping
@ApiOperation
(
"用户查询,左边树调用部门树不要传入部门名称,然后右边用户的搜索在页面匹配就好了,一开始会返回所有部门的用户回去"
)
@ApiOperation
(
"用户查询,左边树调用部门树不要传入部门名称,然后右边用户的搜索在页面匹配就好了,一开始会返回所有部门的用户回去"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)})
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)})
public
R
<
List
<
UserTreeVo
>>
selectUserList
(
@PathVariable
String
appId
)
{
public
R
<
List
<
UserTreeVo
>>
selectUserList
(
HttpServletRequest
request
,
@PathVariable
String
appId
)
{
return
call
(()->(
userService
.
selectUserList
(
appId
,
dcClientHost
+
userTree
,
token
,
null
)));
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
userService
.
selectUserList
(
appId
,
dcClientHost
+
userTree
,
currentUser
.
getToken
(),
null
);
});
}
}
}
}
src/main/java/com/syc/slm/slmbi/controller/VariableController.java
View file @
26ffd784
...
@@ -5,6 +5,7 @@ import com.google.common.collect.Maps;
...
@@ -5,6 +5,7 @@ import com.google.common.collect.Maps;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.common.core.util.RestTemplateUtils
;
import
com.syc.slm.common.core.util.RestTemplateUtils
;
import
com.syc.slm.slmbi.dto.*
;
import
com.syc.slm.slmbi.dto.*
;
import
com.syc.slm.slmbi.entity.CurrentUser
;
import
com.syc.slm.slmbi.service.VariableService
;
import
com.syc.slm.slmbi.service.VariableService
;
import
com.syc.slm.slmbi.vo.*
;
import
com.syc.slm.slmbi.vo.*
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -14,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -14,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -75,8 +77,11 @@ public class VariableController extends BaseRestController{
...
@@ -75,8 +77,11 @@ public class VariableController extends BaseRestController{
@GetMapping
@GetMapping
@ApiOperation
(
"获取变量列表"
)
@ApiOperation
(
"获取变量列表"
)
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)
public
R
<
IPage
<
VariableVo
>>
getVariableList
(
@PathVariable
String
appId
,
VariableDTO
variableDTO
)
{
public
R
<
IPage
<
VariableVo
>>
getVariableList
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
VariableDTO
variableDTO
)
{
return
call
(()->
variableService
.
getVariableList
(
variableDTO
,
appId
,
token
,
dcClientHost
+
variableList
));
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
variableService
.
getVariableList
(
variableDTO
,
appId
,
currentUser
.
getToken
(),
dcClientHost
+
variableList
);
});
}
}
@GetMapping
(
"/real-time"
)
@GetMapping
(
"/real-time"
)
...
@@ -97,8 +102,11 @@ public class VariableController extends BaseRestController{
...
@@ -97,8 +102,11 @@ public class VariableController extends BaseRestController{
@GetMapping
(
"/device"
)
@GetMapping
(
"/device"
)
@ApiOperation
(
"获取变量所属设备列表"
)
@ApiOperation
(
"获取变量所属设备列表"
)
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)
public
R
<
IPage
<
VariableDeviceVo
>>
getVariableDeviceList
(
@PathVariable
String
appId
,
QueryPageDTO
query
)
{
public
R
<
IPage
<
VariableDeviceVo
>>
getVariableDeviceList
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
QueryPageDTO
query
)
{
return
call
(()->(
variableService
.
getVariableDeviceList
(
token
,
appId
,
dcClientHost
+
deviceList
,
query
)));
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
variableService
.
getVariableDeviceList
(
currentUser
.
getToken
(),
appId
,
dcClientHost
+
deviceList
,
query
);
});
}
}
@GetMapping
(
"/history"
)
@GetMapping
(
"/history"
)
...
...
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