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
eebd96b3
Commit
eebd96b3
authored
Jun 01, 2021
by
linruibiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口编写
parent
8a8dd74b
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
146 additions
and
179 deletions
+146
-179
DataCenterConfig.java
src/main/java/com/syc/slm/slmbi/config/DataCenterConfig.java
+44
-11
BaseRestController.java
...java/com/syc/slm/slmbi/controller/BaseRestController.java
+2
-50
BusinessConfigController.java
...om/syc/slm/slmbi/controller/BusinessConfigController.java
+3
-3
DeptController.java
...ain/java/com/syc/slm/slmbi/controller/DeptController.java
+3
-2
InstrumentPanelTreeController.java
...c/slm/slmbi/controller/InstrumentPanelTreeController.java
+3
-3
PositionController.java
...java/com/syc/slm/slmbi/controller/PositionController.java
+1
-2
TokenController.java
...in/java/com/syc/slm/slmbi/controller/TokenController.java
+2
-3
UserController.java
...ain/java/com/syc/slm/slmbi/controller/UserController.java
+5
-3
VariableController.java
...java/com/syc/slm/slmbi/controller/VariableController.java
+9
-13
BusinessConfigService.java
...java/com/syc/slm/slmbi/service/BusinessConfigService.java
+3
-6
DeptService.java
src/main/java/com/syc/slm/slmbi/service/DeptService.java
+1
-2
InstrumentPanelTreeService.java
...com/syc/slm/slmbi/service/InstrumentPanelTreeService.java
+3
-4
PositionService.java
src/main/java/com/syc/slm/slmbi/service/PositionService.java
+1
-1
UserService.java
src/main/java/com/syc/slm/slmbi/service/UserService.java
+1
-2
VariableService.java
src/main/java/com/syc/slm/slmbi/service/VariableService.java
+12
-20
BusinessConfigServiceImpl.java
...syc/slm/slmbi/service/impl/BusinessConfigServiceImpl.java
+7
-4
CompanyServiceImpl.java
...va/com/syc/slm/slmbi/service/impl/CompanyServiceImpl.java
+1
-4
DeptServiceImpl.java
.../java/com/syc/slm/slmbi/service/impl/DeptServiceImpl.java
+3
-3
InstrumentPanelTreeServiceImpl.java
...lm/slmbi/service/impl/InstrumentPanelTreeServiceImpl.java
+11
-9
PermissionServiceImpl.java
...com/syc/slm/slmbi/service/impl/PermissionServiceImpl.java
+1
-5
PositionServiceImpl.java
...a/com/syc/slm/slmbi/service/impl/PositionServiceImpl.java
+4
-6
UserServiceImpl.java
.../java/com/syc/slm/slmbi/service/impl/UserServiceImpl.java
+3
-5
VariableServiceImpl.java
...a/com/syc/slm/slmbi/service/impl/VariableServiceImpl.java
+23
-18
No files found.
src/main/java/com/syc/slm/slmbi/config/DataCenterConfig.java
View file @
eebd96b3
package
com
.
syc
.
slm
.
slmbi
.
config
;
package
com
.
syc
.
slm
.
slmbi
.
config
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.Configuration
;
/**
/**
* @author: guangyi-liang
* @author: guangyi-liang
* @date: 2021/5/7
* @date: 2021/5/7
*/
*/
@Configuration
public
final
class
DataCenterConfig
{
@Getter
@Setter
public
class
DataCenterConfig
{
@Value
(
"${dc_client.host}"
)
@Value
(
"${dc_client.host}"
)
p
rivate
String
h
ost
;
p
ublic
static
String
dcClientH
ost
;
@Value
(
"${dc_client.interfaces.permissionCodeUrl}"
)
@Value
(
"${dc_client.interfaces.permissionCodeUrl}"
)
p
rivate
String
permissionCodeUrl
;
p
ublic
static
String
permissionCodeUrl
;
@Value
(
"${dc_client.interfaces.companyAppId}"
)
@Value
(
"${dc_client.interfaces.companyAppId}"
)
private
String
companyAppId
;
public
static
String
companyAppId
;
@Value
(
"${dc_client.interfaces.positionListUrl}"
)
public
static
String
positionListUrl
;
@Value
(
"${dc_client.interfaces.deptListUrl}"
)
public
static
String
deptListUrl
;
@Value
(
"${dc_client.interfaces.userTree}"
)
public
static
String
userTree
;
@Value
(
"${dc_client.interfaces.variableList}"
)
public
static
String
variableList
;
@Value
(
"${dc_client.interfaces.deviceList}"
)
public
static
String
deviceList
;
@Value
(
"${dc_client.interfaces.deptsRoles}"
)
public
static
String
deptsRoles
;
@Value
(
"${dc_client.interfaces.businessFiledData}"
)
public
static
String
businessFiledData
;
@Value
(
"${dc_client.interfaces.businessDataFieldStatistics}"
)
public
static
String
businessDataFieldStatistics
;
@Value
(
"${dc_client.interfaces.variableCodeHistoryList}"
)
public
static
String
variableHistoryDataList
;
@Value
(
"${dc_client.interfaces.variableAllDataList}"
)
public
static
String
variableRealTimeDataList
;
@Value
(
"${dc_client.interfaces.filedValue}"
)
public
static
String
filedValue
;
@Value
(
"${dc_client.interfaces.send}"
)
public
static
String
send
;
@Value
(
"${dc_client.interfaces.variableStatus}"
)
public
static
String
variableStatus
;
@Value
(
"${dc_client.interfaces.variableHistoryStatus}"
)
public
static
String
variableHistoryStatus
;
@Value
(
"${dc_client.interfaces.realTimeVariableDataList}"
)
public
static
String
realTimeVariableDataList
;
@Value
(
"${dc_client.interfaces.variableStatusRealTimeDataList}"
)
public
static
String
variableStatusRealTimeDataList
;
}
}
src/main/java/com/syc/slm/slmbi/controller/BaseRestController.java
View file @
eebd96b3
...
@@ -6,12 +6,12 @@ import com.syc.slm.common.core.constant.SlmConstants;
...
@@ -6,12 +6,12 @@ import com.syc.slm.common.core.constant.SlmConstants;
import
com.syc.slm.common.core.util.NetResponseUtils
;
import
com.syc.slm.common.core.util.NetResponseUtils
;
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.config.DataCenterConfig
;
import
com.syc.slm.slmbi.entity.CurrentUser
;
import
com.syc.slm.slmbi.entity.CurrentUser
;
import
com.syc.slm.slmbi.exception.SysException
;
import
com.syc.slm.slmbi.exception.SysException
;
import
com.syc.slm.slmbi.function.Action0
;
import
com.syc.slm.slmbi.function.Action0
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.context.request.NativeWebRequest
;
import
org.springframework.web.context.request.NativeWebRequest
;
import
org.springframework.web.context.request.RequestAttributes
;
import
org.springframework.web.context.request.RequestAttributes
;
...
@@ -33,54 +33,6 @@ import java.util.function.Supplier;
...
@@ -33,54 +33,6 @@ import java.util.function.Supplier;
@Slf4j
@Slf4j
public
class
BaseRestController
{
public
class
BaseRestController
{
@Value
(
"${dc_client.host}"
)
protected
String
dcClientHost
;
@Value
(
"${dc_client.interfaces.positionListUrl}"
)
protected
String
positionListUrl
;
@Value
(
"${dc_client.interfaces.deptListUrl}"
)
protected
String
deptListUrl
;
@Value
(
"${dc_client.interfaces.userTree}"
)
protected
String
userTree
;
@Value
(
"${dc_client.interfaces.variableList}"
)
protected
String
variableList
;
@Value
(
"${dc_client.interfaces.deviceList}"
)
protected
String
deviceList
;
@Value
(
"${dc_client.interfaces.deptsRoles}"
)
protected
String
deptsRoles
;
@Value
(
"${dc_client.interfaces.businessFiledData}"
)
protected
String
businessFiledData
;
@Value
(
"${dc_client.interfaces.businessDataFieldStatistics}"
)
protected
String
businessDataFieldStatistics
;
@Value
(
"${dc_client.interfaces.variableCodeHistoryList}"
)
protected
String
variableHistoryDataList
;
@Value
(
"${dc_client.interfaces.variableAllDataList}"
)
protected
String
variableRealTimeDataList
;
@Value
(
"${dc_client.interfaces.filedValue}"
)
protected
String
filedValue
;
@Value
(
"${dc_client.interfaces.send}"
)
protected
String
send
;
@Value
(
"${dc_client.interfaces.variableStatus}"
)
protected
String
variableStatus
;
@Value
(
"${dc_client.interfaces.variableHistoryStatus}"
)
protected
String
variableHistoryStatus
;
@Value
(
"${dc_client.interfaces.realTimeVariableDataList}"
)
protected
String
realTimeVariableDataList
;
// @Value("${dc_client.interfaces.historyCurve}")
// protected String historyCurve;
@Value
(
"${dc_client.interfaces.variableStatusRealTimeDataList}"
)
protected
String
variableStatusRealTimeDataList
;
@ModelAttribute
@ModelAttribute
public
void
onInit
(
HttpServletRequest
request
)
{
public
void
onInit
(
HttpServletRequest
request
)
{
String
uri
=
request
.
getRequestURI
();
String
uri
=
request
.
getRequestURI
();
...
@@ -107,7 +59,7 @@ public class BaseRestController {
...
@@ -107,7 +59,7 @@ public class BaseRestController {
Map
<
String
,
String
>
map
=
(
Map
<
String
,
String
>)
webRequest
.
getAttribute
(
HandlerMapping
.
URI_TEMPLATE_VARIABLES_ATTRIBUTE
,
RequestAttributes
.
SCOPE_REQUEST
);
Map
<
String
,
String
>
map
=
(
Map
<
String
,
String
>)
webRequest
.
getAttribute
(
HandlerMapping
.
URI_TEMPLATE_VARIABLES_ATTRIBUTE
,
RequestAttributes
.
SCOPE_REQUEST
);
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
=
DataCenterConfig
.
dcClientHost
+
"/{appId}/users/user-info"
;
R
<
CurrentUser
>
result
=
RestTemplateUtils
.
get
(
getUrl
,
new
TypeToken
<
R
<
CurrentUser
>>()
{
R
<
CurrentUser
>
result
=
RestTemplateUtils
.
get
(
getUrl
,
new
TypeToken
<
R
<
CurrentUser
>>()
{
}.
getType
(),
uriVariables
);
}.
getType
(),
uriVariables
);
request
.
setAttribute
(
token
,
SlmConstants
.
gson
.
toJson
(
result
.
detach
()));
request
.
setAttribute
(
token
,
SlmConstants
.
gson
.
toJson
(
result
.
detach
()));
...
...
src/main/java/com/syc/slm/slmbi/controller/BusinessConfigController.java
View file @
eebd96b3
...
@@ -56,7 +56,7 @@ public class BusinessConfigController extends BaseRestController{
...
@@ -56,7 +56,7 @@ public class BusinessConfigController extends BaseRestController{
public
R
<
Map
<
String
,
List
<
Object
>>>
getBusinessData
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
@RequestBody
BusinessDTO
dto
)
{
public
R
<
Map
<
String
,
List
<
Object
>>>
getBusinessData
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
@RequestBody
BusinessDTO
dto
)
{
return
call
(()->{
return
call
(()->{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
businessConfigService
.
getBusinessData
(
dto
,
dcClientHost
+
businessFiledData
,
currentUser
);
return
businessConfigService
.
getBusinessData
(
dto
,
currentUser
);
});
});
}
}
...
@@ -68,7 +68,7 @@ public class BusinessConfigController extends BaseRestController{
...
@@ -68,7 +68,7 @@ public class BusinessConfigController extends BaseRestController{
@RequestBody
BusinessStatisticsDTO
dto
)
{
@RequestBody
BusinessStatisticsDTO
dto
)
{
return
call
(()
->
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
businessConfigService
.
listBusinessFieldStatistics
(
d
cClientHost
+
businessDataFieldStatistics
,
d
to
,
currentUser
);
return
businessConfigService
.
listBusinessFieldStatistics
(
dto
,
currentUser
);
});
});
}
}
...
@@ -79,7 +79,7 @@ public class BusinessConfigController extends BaseRestController{
...
@@ -79,7 +79,7 @@ public class BusinessConfigController extends BaseRestController{
@PathVariable
String
appId
,
@PathVariable
String
tableName
,
@PathVariable
String
filed
,
@RequestParam
(
value
=
"current"
,
defaultValue
=
"1"
)
Integer
current
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"100"
)
Integer
size
,
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
)
{
@PathVariable
String
appId
,
@PathVariable
String
tableName
,
@PathVariable
String
filed
,
@RequestParam
(
value
=
"current"
,
defaultValue
=
"1"
)
Integer
current
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"100"
)
Integer
size
,
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
)
{
return
call
(()
->
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
businessConfigService
.
filedValue
(
currentUser
,
tableName
,
filed
,
current
,
size
,
name
,
dcClientHost
+
filedValue
);
return
businessConfigService
.
filedValue
(
currentUser
,
tableName
,
filed
,
current
,
size
,
name
);
});
});
}
}
}
}
src/main/java/com/syc/slm/slmbi/controller/DeptController.java
View file @
eebd96b3
...
@@ -4,6 +4,7 @@ import com.google.common.collect.Maps;
...
@@ -4,6 +4,7 @@ import com.google.common.collect.Maps;
import
com.google.gson.reflect.TypeToken
;
import
com.google.gson.reflect.TypeToken
;
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.config.DataCenterConfig
;
import
com.syc.slm.slmbi.entity.CurrentUser
;
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
;
...
@@ -41,7 +42,7 @@ public class DeptController extends BaseRestController{
...
@@ -41,7 +42,7 @@ public class DeptController extends BaseRestController{
@RequestParam
(
value
=
"deptName"
,
required
=
false
)
String
deptName
)
{
@RequestParam
(
value
=
"deptName"
,
required
=
false
)
String
deptName
)
{
return
call
(()
->
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
deptService
.
selectPositionList
(
dcClientHost
+
deptListUrl
,
currentUser
.
getToken
(),
appId
,
deptName
);
return
deptService
.
selectPositionList
(
currentUser
.
getToken
(),
appId
,
deptName
);
});
});
}
}
...
@@ -51,7 +52,7 @@ public class DeptController extends BaseRestController{
...
@@ -51,7 +52,7 @@ public class DeptController extends BaseRestController{
return
call
(()
->
{
return
call
(()
->
{
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"appId"
,
appId
);
uriVariables
.
put
(
"appId"
,
appId
);
String
uri
=
dcClientHost
+
"/{appId}/base"
;
String
uri
=
DataCenterConfig
.
dcClientHost
+
"/{appId}/base"
;
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
List
<
DeptVo
>>>()
{}.
getType
(),
uriVariables
);
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
List
<
DeptVo
>>>()
{}.
getType
(),
uriVariables
);
return
null
;
return
null
;
});
});
...
...
src/main/java/com/syc/slm/slmbi/controller/InstrumentPanelTreeController.java
View file @
eebd96b3
...
@@ -38,7 +38,7 @@ public class InstrumentPanelTreeController extends BaseRestController {
...
@@ -38,7 +38,7 @@ public class InstrumentPanelTreeController extends BaseRestController {
public
R
<
List
<
PanelTreeNodeVo
>>
loadTrees
(
HttpServletRequest
request
,
@PathVariable
String
appId
)
{
public
R
<
List
<
PanelTreeNodeVo
>>
loadTrees
(
HttpServletRequest
request
,
@PathVariable
String
appId
)
{
return
call
(()
->
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
treeService
.
loadTrees
(
appId
,
dcClientHost
+
deptsRoles
,
currentUser
);
return
treeService
.
loadTrees
(
appId
,
currentUser
);
});
});
}
}
...
@@ -53,7 +53,7 @@ public class InstrumentPanelTreeController extends BaseRestController {
...
@@ -53,7 +53,7 @@ public class InstrumentPanelTreeController extends BaseRestController {
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
)
{
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
)
{
return
call
(()
->
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
treeService
.
loadTrees
(
appId
,
name
,
dcClientHost
+
deptsRoles
,
currentUser
);
return
treeService
.
loadTrees
(
appId
,
name
,
currentUser
);
});
});
}
}
...
@@ -70,7 +70,7 @@ public class InstrumentPanelTreeController extends BaseRestController {
...
@@ -70,7 +70,7 @@ public class InstrumentPanelTreeController extends BaseRestController {
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
)
{
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
)
{
return
call
(()
->
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
treeService
.
children
(
nodeId
,
name
,
dcClientHost
+
deptsRoles
,
currentUser
);
return
treeService
.
children
(
nodeId
,
name
,
currentUser
);
});
});
}
}
...
...
src/main/java/com/syc/slm/slmbi/controller/PositionController.java
View file @
eebd96b3
...
@@ -8,7 +8,6 @@ import io.swagger.annotations.Api;
...
@@ -8,7 +8,6 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
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.*
;
...
@@ -38,7 +37,7 @@ public class PositionController extends BaseRestController{
...
@@ -38,7 +37,7 @@ public class PositionController extends BaseRestController{
@RequestParam
(
value
=
"positionName"
,
required
=
false
)
String
positionName
)
{
@RequestParam
(
value
=
"positionName"
,
required
=
false
)
String
positionName
)
{
return
call
(()
->
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
positionWorkService
.
selectPositionList
(
dcClientHost
+
positionListUrl
,
currentUser
.
getToken
(),
appId
,
positionName
);
return
positionWorkService
.
selectPositionList
(
currentUser
.
getToken
(),
appId
,
positionName
);
});
});
}
}
}
}
src/main/java/com/syc/slm/slmbi/controller/TokenController.java
View file @
eebd96b3
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import
com.google.common.collect.Maps
;
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.config.DataCenterConfig
;
import
com.syc.slm.slmbi.exception.SysException
;
import
com.syc.slm.slmbi.exception.SysException
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
...
@@ -14,8 +15,6 @@ import org.springframework.web.bind.annotation.PostMapping;
...
@@ -14,8 +15,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
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
java.lang.reflect.Type
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -38,7 +37,7 @@ public class TokenController extends BaseRestController{
...
@@ -38,7 +37,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
+
"/user/token?account="
+
account
+
"&password="
+
password
+
"&origin="
+
origin
;
String
uri
=
DataCenterConfig
.
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 @
eebd96b3
...
@@ -6,13 +6,15 @@ import com.syc.slm.slmbi.service.PermissionService;
...
@@ -6,13 +6,15 @@ import com.syc.slm.slmbi.service.PermissionService;
import
com.syc.slm.slmbi.service.UserService
;
import
com.syc.slm.slmbi.service.UserService
;
import
com.syc.slm.slmbi.vo.PermissionCodeVo
;
import
com.syc.slm.slmbi.vo.PermissionCodeVo
;
import
com.syc.slm.slmbi.vo.UserTreeVo
;
import
com.syc.slm.slmbi.vo.UserTreeVo
;
import
com.syc.slm.slmbi.vo.UserVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
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.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
import
java.util.List
;
...
@@ -41,7 +43,7 @@ public class UserController extends BaseRestController{
...
@@ -41,7 +43,7 @@ public class UserController extends BaseRestController{
public
R
<
List
<
UserTreeVo
>>
selectUserList
(
HttpServletRequest
request
,
@PathVariable
String
appId
)
{
public
R
<
List
<
UserTreeVo
>>
selectUserList
(
HttpServletRequest
request
,
@PathVariable
String
appId
)
{
return
call
(()
->
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
userService
.
selectUserList
(
appId
,
dcClientHost
+
userTree
,
currentUser
.
getToken
(),
null
);
return
userService
.
selectUserList
(
appId
,
currentUser
.
getToken
(),
null
);
});
});
}
}
...
...
src/main/java/com/syc/slm/slmbi/controller/VariableController.java
View file @
eebd96b3
...
@@ -82,7 +82,7 @@ public class VariableController extends BaseRestController{
...
@@ -82,7 +82,7 @@ public class VariableController extends BaseRestController{
public
R
<
IPage
<
VariableVo
>>
getVariableList
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
VariableDTO
variableDTO
)
{
public
R
<
IPage
<
VariableVo
>>
getVariableList
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
VariableDTO
variableDTO
)
{
return
call
(()
->
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
variableService
.
getVariableList
(
variableDTO
,
appId
,
currentUser
.
getToken
()
,
dcClientHost
+
variableList
);
return
variableService
.
getVariableList
(
variableDTO
,
appId
,
currentUser
.
getToken
());
});
});
}
}
...
@@ -93,9 +93,7 @@ public class VariableController extends BaseRestController{
...
@@ -93,9 +93,7 @@ public class VariableController extends BaseRestController{
@RequestBody
VariableAllDataDTO
variableDTO
)
{
@RequestBody
VariableAllDataDTO
variableDTO
)
{
return
call
(()
->
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
variableService
.
listVariableAllDataListByTimeInterval
(
dcClientHost
+
variableRealTimeDataList
,
return
variableService
.
listVariableAllDataListByTimeInterval
(
variableDTO
,
currentUser
);
variableDTO
,
currentUser
);
});
});
}
}
...
@@ -112,7 +110,7 @@ public class VariableController extends BaseRestController{
...
@@ -112,7 +110,7 @@ public class VariableController extends BaseRestController{
public
R
<
IPage
<
VariableDeviceVo
>>
getVariableDeviceList
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
QueryPageDTO
query
)
{
public
R
<
IPage
<
VariableDeviceVo
>>
getVariableDeviceList
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
QueryPageDTO
query
)
{
return
call
(()
->
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
variableService
.
getVariableDeviceList
(
currentUser
.
getToken
(),
appId
,
dcClientHost
+
deviceList
,
query
);
return
variableService
.
getVariableDeviceList
(
currentUser
.
getToken
(),
appId
,
query
);
});
});
}
}
...
@@ -123,9 +121,7 @@ public class VariableController extends BaseRestController{
...
@@ -123,9 +121,7 @@ public class VariableController extends BaseRestController{
@RequestBody
VariableHistoryDataDTO
variableDTO
)
{
@RequestBody
VariableHistoryDataDTO
variableDTO
)
{
return
call
(()
->
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
variableService
.
listVariableHistoryDataListByCode
(
dcClientHost
+
variableHistoryDataList
,
return
variableService
.
listVariableHistoryDataListByCode
(
variableDTO
,
currentUser
);
variableDTO
,
currentUser
);
});
});
}
}
...
@@ -147,7 +143,7 @@ public class VariableController extends BaseRestController{
...
@@ -147,7 +143,7 @@ public class VariableController extends BaseRestController{
public
R
<
Object
>
send
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
@RequestBody
VariableSendDTO
sendDTO
)
{
public
R
<
Object
>
send
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
@RequestBody
VariableSendDTO
sendDTO
)
{
return
call
(()
->
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
variableService
.
send
(
sendDTO
,
currentUser
,
dcClientHost
+
send
);
variableService
.
send
(
sendDTO
,
currentUser
);
});
});
}
}
...
@@ -162,7 +158,7 @@ public class VariableController extends BaseRestController{
...
@@ -162,7 +158,7 @@ public class VariableController extends BaseRestController{
public
R
<
Map
<
String
,
Object
>>
status
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
@PathVariable
String
deviceId
,
@PathVariable
String
variableId
,
@PathVariable
String
variableCode
)
{
public
R
<
Map
<
String
,
Object
>>
status
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
@PathVariable
String
deviceId
,
@PathVariable
String
variableId
,
@PathVariable
String
variableCode
)
{
return
call
(()
->
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
variableService
.
status
(
dcClientHost
+
variableStatus
,
deviceId
,
variableId
,
variableCode
,
currentUser
);
return
variableService
.
status
(
deviceId
,
variableId
,
variableCode
,
currentUser
);
});
});
}
}
...
@@ -179,7 +175,7 @@ public class VariableController extends BaseRestController{
...
@@ -179,7 +175,7 @@ public class VariableController extends BaseRestController{
public
R
<
Map
<
String
,
Object
>>
historyStatus
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
@PathVariable
String
deviceId
,
@PathVariable
String
variableCode
,
@RequestParam
String
startTime
,
@RequestParam
String
endTime
)
{
public
R
<
Map
<
String
,
Object
>>
historyStatus
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
@PathVariable
String
deviceId
,
@PathVariable
String
variableCode
,
@RequestParam
String
startTime
,
@RequestParam
String
endTime
)
{
return
call
(()
->
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
variableService
.
historyStatus
(
d
cClientHost
+
variableHistoryStatus
,
d
eviceId
,
variableCode
,
startTime
,
endTime
,
currentUser
);
return
variableService
.
historyStatus
(
deviceId
,
variableCode
,
startTime
,
endTime
,
currentUser
);
});
});
}
}
...
@@ -190,7 +186,7 @@ public class VariableController extends BaseRestController{
...
@@ -190,7 +186,7 @@ public class VariableController extends BaseRestController{
@RequestBody
RealTimeVariableDataDTO
variableDTO
)
{
@RequestBody
RealTimeVariableDataDTO
variableDTO
)
{
return
call
(()
->
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
variableService
.
listRealTimeVariableData
(
dcClientHost
+
realTimeVariableDataList
,
variableDTO
,
currentUser
);
return
variableService
.
listRealTimeVariableData
(
variableDTO
,
currentUser
);
});
});
}
}
...
@@ -200,7 +196,7 @@ public class VariableController extends BaseRestController{
...
@@ -200,7 +196,7 @@ public class VariableController extends BaseRestController{
@RequestBody
List
<
VariableStatusRealTimeDataDTO
>
statusRealTimeDataList
)
{
@RequestBody
List
<
VariableStatusRealTimeDataDTO
>
statusRealTimeDataList
)
{
return
call
(()
->
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
variableService
.
listVariableStatusRealTimeData
(
dcClientHost
+
variableStatusRealTimeDataList
,
statusRealTimeDataList
,
currentUser
);
return
variableService
.
listVariableStatusRealTimeData
(
statusRealTimeDataList
,
currentUser
);
});
});
}
}
}
}
src/main/java/com/syc/slm/slmbi/service/BusinessConfigService.java
View file @
eebd96b3
...
@@ -34,20 +34,18 @@ public interface BusinessConfigService extends IService<BusinessConfig> {
...
@@ -34,20 +34,18 @@ public interface BusinessConfigService extends IService<BusinessConfig> {
/**
/**
* 字段数据
* 字段数据
* @param dto
* @param dto
* @param uri
* @param user
* @param user
* @return
* @return
*/
*/
Map
<
String
,
List
<
Object
>>
getBusinessData
(
BusinessDTO
dto
,
String
uri
,
CurrentUser
user
);
Map
<
String
,
List
<
Object
>>
getBusinessData
(
BusinessDTO
dto
,
CurrentUser
user
);
/**
/**
* 查询业务字段的统计数据
* 查询业务字段的统计数据
* @param uri url
* @param dto 参数
* @param dto 参数
* @param user 当前用
* @param user 当前用
* @return 统计数据
* @return 统计数据
*/
*/
Map
<
String
,
Object
>
listBusinessFieldStatistics
(
String
uri
,
BusinessStatisticsDTO
dto
,
CurrentUser
user
);
Map
<
String
,
Object
>
listBusinessFieldStatistics
(
BusinessStatisticsDTO
dto
,
CurrentUser
user
);
/**
/**
* 根据字段以及表名查询对应的字段
* 根据字段以及表名查询对应的字段
...
@@ -57,9 +55,8 @@ public interface BusinessConfigService extends IService<BusinessConfig> {
...
@@ -57,9 +55,8 @@ public interface BusinessConfigService extends IService<BusinessConfig> {
* @param current
* @param current
* @param size
* @param size
* @param name
* @param name
* @param uri
* @return
* @return
*/
*/
IPage
<
String
>
filedValue
(
CurrentUser
currentUser
,
String
tableName
,
String
filed
,
Integer
current
,
Integer
size
,
String
name
,
String
uri
);
IPage
<
String
>
filedValue
(
CurrentUser
currentUser
,
String
tableName
,
String
filed
,
Integer
current
,
Integer
size
,
String
name
);
}
}
src/main/java/com/syc/slm/slmbi/service/DeptService.java
View file @
eebd96b3
...
@@ -13,12 +13,11 @@ import java.util.List;
...
@@ -13,12 +13,11 @@ import java.util.List;
public
interface
DeptService
{
public
interface
DeptService
{
/**
/**
* 获取部门列表
* 获取部门列表
* @param uri
* @param token
* @param token
* @param appId
* @param appId
* @param deptName
* @param deptName
* @return
* @return
*/
*/
List
<
DeptVo
>
selectPositionList
(
String
uri
,
String
token
,
String
appId
,
String
deptName
);
List
<
DeptVo
>
selectPositionList
(
String
token
,
String
appId
,
String
deptName
);
}
}
src/main/java/com/syc/slm/slmbi/service/InstrumentPanelTreeService.java
View file @
eebd96b3
...
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.syc.slm.slmbi.dto.InstrumentPanelAssemblyDTO
;
import
com.syc.slm.slmbi.dto.InstrumentPanelAssemblyDTO
;
import
com.syc.slm.slmbi.entity.CurrentUser
;
import
com.syc.slm.slmbi.entity.CurrentUser
;
import
com.syc.slm.slmbi.entity.InstrumentPanelTree
;
import
com.syc.slm.slmbi.entity.InstrumentPanelTree
;
import
com.syc.slm.slmbi.vo.InstrumentPanelConfigVo
;
import
com.syc.slm.slmbi.vo.PanelTreeNodeVo
;
import
com.syc.slm.slmbi.vo.PanelTreeNodeVo
;
import
java.util.List
;
import
java.util.List
;
...
@@ -67,14 +66,14 @@ public interface InstrumentPanelTreeService extends IService<InstrumentPanelTree
...
@@ -67,14 +66,14 @@ public interface InstrumentPanelTreeService extends IService<InstrumentPanelTree
* @param name
* @param name
* @return
* @return
*/
*/
List
<
PanelTreeNodeVo
>
loadTrees
(
String
appId
,
String
name
,
String
uri
,
CurrentUser
user
);
List
<
PanelTreeNodeVo
>
loadTrees
(
String
appId
,
String
name
,
CurrentUser
user
);
/**
/**
* 加载树
* 加载树
* @param appId
* @param appId
* @return
* @return
*/
*/
List
<
PanelTreeNodeVo
>
loadTrees
(
String
appId
,
String
uri
,
CurrentUser
user
);
List
<
PanelTreeNodeVo
>
loadTrees
(
String
appId
,
CurrentUser
user
);
/**
/**
* 加载树节点下一节点
* 加载树节点下一节点
...
@@ -82,7 +81,7 @@ public interface InstrumentPanelTreeService extends IService<InstrumentPanelTree
...
@@ -82,7 +81,7 @@ public interface InstrumentPanelTreeService extends IService<InstrumentPanelTree
* @param name
* @param name
* @return
* @return
*/
*/
List
<
PanelTreeNodeVo
>
children
(
String
groupId
,
String
name
,
String
uri
,
CurrentUser
user
);
List
<
PanelTreeNodeVo
>
children
(
String
groupId
,
String
name
,
CurrentUser
user
);
/**
/**
* 根据仪表板分组id更新 fullId fullName
* 根据仪表板分组id更新 fullId fullName
...
...
src/main/java/com/syc/slm/slmbi/service/PositionService.java
View file @
eebd96b3
...
@@ -18,5 +18,5 @@ public interface PositionService {
...
@@ -18,5 +18,5 @@ public interface PositionService {
* @param name
* @param name
* @return
* @return
*/
*/
List
<
PositionVo
>
selectPositionList
(
String
uri
,
String
token
,
String
appId
,
String
name
);
List
<
PositionVo
>
selectPositionList
(
String
token
,
String
appId
,
String
name
);
}
}
src/main/java/com/syc/slm/slmbi/service/UserService.java
View file @
eebd96b3
...
@@ -15,10 +15,9 @@ public interface UserService {
...
@@ -15,10 +15,9 @@ public interface UserService {
/**
/**
* 获取用户
* 获取用户
* @param appId
* @param appId
* @param uri
* @param token
* @param token
* @param userName
* @param userName
* @return
* @return
*/
*/
List
<
UserTreeVo
>
selectUserList
(
String
appId
,
String
uri
,
String
token
,
String
userName
);
List
<
UserTreeVo
>
selectUserList
(
String
appId
,
String
token
,
String
userName
);
}
}
src/main/java/com/syc/slm/slmbi/service/VariableService.java
View file @
eebd96b3
...
@@ -3,8 +3,9 @@ package com.syc.slm.slmbi.service;
...
@@ -3,8 +3,9 @@ package com.syc.slm.slmbi.service;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.syc.slm.slmbi.dto.*
;
import
com.syc.slm.slmbi.dto.*
;
import
com.syc.slm.slmbi.entity.CurrentUser
;
import
com.syc.slm.slmbi.entity.CurrentUser
;
import
com.syc.slm.slmbi.vo.*
;
import
com.syc.slm.slmbi.vo.VariableDeviceVo
;
import
lombok.NonNull
;
import
com.syc.slm.slmbi.vo.VariableSourceVo
;
import
com.syc.slm.slmbi.vo.VariableVo
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -22,7 +23,7 @@ public interface VariableService {
...
@@ -22,7 +23,7 @@ public interface VariableService {
* @param variableDTO
* @param variableDTO
* @return
* @return
*/
*/
IPage
<
VariableVo
>
getVariableList
(
VariableDTO
variableDTO
,
String
appId
,
String
token
,
String
uri
);
IPage
<
VariableVo
>
getVariableList
(
VariableDTO
variableDTO
,
String
appId
,
String
token
);
/**
/**
* 获取变量来源
* 获取变量来源
...
@@ -34,51 +35,44 @@ public interface VariableService {
...
@@ -34,51 +35,44 @@ public interface VariableService {
* 获取变量所属设备
* 获取变量所属设备
* @param token
* @param token
* @param appId
* @param appId
* @param uri
* @param queryPageDTO
* @param queryPageDTO
* @return
* @return
*/
*/
IPage
<
VariableDeviceVo
>
getVariableDeviceList
(
String
token
,
String
appId
,
String
uri
,
QueryPageDTO
queryPageDTO
);
IPage
<
VariableDeviceVo
>
getVariableDeviceList
(
String
token
,
String
appId
,
QueryPageDTO
queryPageDTO
);
/**
/**
* 获取实时数据
* 获取实时数据
* @param uri
* @param variableDTO
* @param variableDTO
* @param user
* @param user
* @return
* @return
*/
*/
Map
<
String
,
List
<
Object
>>
listVariableAllDataListByTimeInterval
(
@NonNull
String
uri
,
VariableAllDataDTO
variableDTO
,
CurrentUser
user
);
Map
<
String
,
List
<
Object
>>
listVariableAllDataListByTimeInterval
(
VariableAllDataDTO
variableDTO
,
CurrentUser
user
);
/**
/**
* 获取历史数据
* 获取历史数据
* @param uri
* @param variableDTO
* @param variableDTO
* @param currentUser
* @param currentUser
* @return
* @return
*/
*/
Map
<
String
,
Object
>
listVariableHistoryDataListByCode
(
@NonNull
String
uri
,
Map
<
String
,
Object
>
listVariableHistoryDataListByCode
(
VariableHistoryDataDTO
variableDTO
,
CurrentUser
currentUser
);
VariableHistoryDataDTO
variableDTO
,
CurrentUser
currentUser
);
/**
/**
* 下发
* 下发
* @param sendDTO
* @param sendDTO
* @param currentUser
* @param currentUser
* @param uri
*/
*/
void
send
(
VariableSendDTO
sendDTO
,
CurrentUser
currentUser
,
String
uri
);
void
send
(
VariableSendDTO
sendDTO
,
CurrentUser
currentUser
);
/**
/**
* 状态点实时数据
* 状态点实时数据
* @param uri
* @param deviceId
* @param deviceId
* @param variableCode
* @param variableCode
* @return
* @return
*/
*/
Map
<
String
,
Object
>
status
(
String
uri
,
String
deviceId
,
String
variableId
,
String
variableCode
,
CurrentUser
user
);
Map
<
String
,
Object
>
status
(
String
deviceId
,
String
variableId
,
String
variableCode
,
CurrentUser
user
);
/**
/**
* 状态点历史数据
* 状态点历史数据
* @param uri
* @param deviceId
* @param deviceId
* @param variableCode
* @param variableCode
* @param startTime
* @param startTime
...
@@ -86,7 +80,7 @@ public interface VariableService {
...
@@ -86,7 +80,7 @@ public interface VariableService {
* @param currentUser
* @param currentUser
* @return
* @return
*/
*/
Map
<
String
,
Object
>
historyStatus
(
String
uri
,
String
deviceId
,
String
variableCode
,
String
startTime
,
String
endTime
,
CurrentUser
currentUser
);
Map
<
String
,
Object
>
historyStatus
(
String
deviceId
,
String
variableCode
,
String
startTime
,
String
endTime
,
CurrentUser
currentUser
);
/**
/**
* 获取历史双曲线
* 获取历史双曲线
...
@@ -98,20 +92,18 @@ public interface VariableService {
...
@@ -98,20 +92,18 @@ public interface VariableService {
/**
/**
* 查询实时数据
* 查询实时数据
* @param uri 请求url
* @param variableDTO 请求参数
* @param variableDTO 请求参数
* @param user 当前用户
* @param user 当前用户
* @return 返回值
* @return 返回值
*/
*/
Map
<
String
,
List
<
Object
>>
listRealTimeVariableData
(
@NonNull
String
uri
,
RealTimeVariableDataDTO
variableDTO
,
CurrentUser
user
);
Map
<
String
,
List
<
Object
>>
listRealTimeVariableData
(
RealTimeVariableDataDTO
variableDTO
,
CurrentUser
user
);
/**
/**
* 批量查询实时状态数据
* 批量查询实时状态数据
* @param uri 请求uri
* @param statusRealTimeDataList 请求条件
* @param statusRealTimeDataList 请求条件
* @param user 当前用户
* @param user 当前用户
* @return key为设备ID,value中key为变量名称,vlaue是数据
* @return key为设备ID,value中key为变量名称,vlaue是数据
*/
*/
Map
<
String
,
Map
<
String
,
Object
>>
listVariableStatusRealTimeData
(
@NonNull
String
uri
,
List
<
VariableStatusRealTimeDataDTO
>
statusRealTimeDataList
,
CurrentUser
user
);
Map
<
String
,
Map
<
String
,
Object
>>
listVariableStatusRealTimeData
(
List
<
VariableStatusRealTimeDataDTO
>
statusRealTimeDataList
,
CurrentUser
user
);
}
}
src/main/java/com/syc/slm/slmbi/service/impl/BusinessConfigServiceImpl.java
View file @
eebd96b3
...
@@ -13,6 +13,7 @@ import com.google.gson.reflect.TypeToken;
...
@@ -13,6 +13,7 @@ import com.google.gson.reflect.TypeToken;
import
com.syc.slm.common.core.constant.SlmConstants
;
import
com.syc.slm.common.core.constant.SlmConstants
;
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.config.DataCenterConfig
;
import
com.syc.slm.slmbi.dao.BusinessConfigMapper
;
import
com.syc.slm.slmbi.dao.BusinessConfigMapper
;
import
com.syc.slm.slmbi.dto.BusinessConditionDTO
;
import
com.syc.slm.slmbi.dto.BusinessConditionDTO
;
import
com.syc.slm.slmbi.dto.BusinessDTO
;
import
com.syc.slm.slmbi.dto.BusinessDTO
;
...
@@ -30,7 +31,6 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -30,7 +31,6 @@ import org.springframework.transaction.annotation.Transactional;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.net.URLDecoder
;
import
java.net.URLDecoder
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -86,7 +86,7 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
...
@@ -86,7 +86,7 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
@Override
@Override
@Transactional
(
readOnly
=
true
)
@Transactional
(
readOnly
=
true
)
public
Map
<
String
,
List
<
Object
>>
getBusinessData
(
BusinessDTO
dto
,
String
uri
,
CurrentUser
user
)
{
public
Map
<
String
,
List
<
Object
>>
getBusinessData
(
BusinessDTO
dto
,
CurrentUser
user
)
{
if
(
StringUtils
.
isBlank
(
dto
.
getTable
())){
if
(
StringUtils
.
isBlank
(
dto
.
getTable
())){
throw
new
SysException
(
"请传入对应的表名"
);
throw
new
SysException
(
"请传入对应的表名"
);
}
}
...
@@ -125,12 +125,13 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
...
@@ -125,12 +125,13 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
dto
.
setWhere
(
this
.
filterWhereNoLimit
(
dto
.
getWhere
()));
dto
.
setWhere
(
this
.
filterWhereNoLimit
(
dto
.
getWhere
()));
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
String
uri
=
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
businessFiledData
;
R
<
Map
<
String
,
List
<
Object
>>>
result
=
RestTemplateUtils
.
post
(
uri
,
null
,
dto
,
new
TypeToken
<
R
<
Map
<
String
,
List
<
Object
>>>>()
{}.
getType
(),
uriVariables
);
R
<
Map
<
String
,
List
<
Object
>>>
result
=
RestTemplateUtils
.
post
(
uri
,
null
,
dto
,
new
TypeToken
<
R
<
Map
<
String
,
List
<
Object
>>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
return
result
.
detach
();
}
}
@Override
@Override
public
Map
<
String
,
Object
>
listBusinessFieldStatistics
(
String
uri
,
BusinessStatisticsDTO
dto
,
CurrentUser
user
)
{
public
Map
<
String
,
Object
>
listBusinessFieldStatistics
(
BusinessStatisticsDTO
dto
,
CurrentUser
user
)
{
if
(
StringUtils
.
isBlank
(
dto
.
getTable
())){
if
(
StringUtils
.
isBlank
(
dto
.
getTable
())){
throw
new
SysException
(
"请传入对应的表名"
);
throw
new
SysException
(
"请传入对应的表名"
);
}
}
...
@@ -165,13 +166,14 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
...
@@ -165,13 +166,14 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
dto
.
setWhere
(
this
.
filterWhereNoLimit
(
dto
.
getWhere
()));
dto
.
setWhere
(
this
.
filterWhereNoLimit
(
dto
.
getWhere
()));
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
String
uri
=
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
businessDataFieldStatistics
;
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
post
(
uri
,
null
,
dto
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{}.
getType
(),
uriVariables
);
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
post
(
uri
,
null
,
dto
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
return
result
.
detach
();
}
}
@Override
@Override
@Transactional
(
readOnly
=
true
)
@Transactional
(
readOnly
=
true
)
public
IPage
<
String
>
filedValue
(
CurrentUser
currentUser
,
String
tableName
,
String
filed
,
Integer
current
,
Integer
size
,
String
name
,
String
uri
)
{
public
IPage
<
String
>
filedValue
(
CurrentUser
currentUser
,
String
tableName
,
String
filed
,
Integer
current
,
Integer
size
,
String
name
)
{
if
(
StringUtils
.
isBlank
(
tableName
)){
if
(
StringUtils
.
isBlank
(
tableName
)){
throw
new
SysException
(
"表名必填"
);
throw
new
SysException
(
"表名必填"
);
}
}
...
@@ -186,6 +188,7 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
...
@@ -186,6 +188,7 @@ 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
);
String
uri
=
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
filedValue
;
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{}.
getType
(),
uriVariables
);
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
get
(
uri
,
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
)){
...
...
src/main/java/com/syc/slm/slmbi/service/impl/CompanyServiceImpl.java
View file @
eebd96b3
...
@@ -29,9 +29,6 @@ import java.util.UUID;
...
@@ -29,9 +29,6 @@ import java.util.UUID;
@Service
@Service
public
class
CompanyServiceImpl
implements
CompanyService
{
public
class
CompanyServiceImpl
implements
CompanyService
{
@Autowired
private
DataCenterConfig
centerConfig
;
@Autowired
@Autowired
private
InstrumentPanelGroupInitMapper
groupInitMapper
;
private
InstrumentPanelGroupInitMapper
groupInitMapper
;
...
@@ -65,7 +62,7 @@ public class CompanyServiceImpl implements CompanyService {
...
@@ -65,7 +62,7 @@ public class CompanyServiceImpl implements CompanyService {
private
Set
<
String
>
findAllAppId
(
String
appId
){
private
Set
<
String
>
findAllAppId
(
String
appId
){
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"appId"
,
appId
);
map
.
put
(
"appId"
,
appId
);
R
<
Set
<
String
>>
result
=
RestTemplateUtils
.
get
(
centerConfig
.
getHost
()+
centerConfig
.
getCompanyAppId
()
,
new
TypeToken
<
R
<
Set
<
String
>>>()
{}.
getType
(),
map
);
R
<
Set
<
String
>>
result
=
RestTemplateUtils
.
get
(
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
companyAppId
,
new
TypeToken
<
R
<
Set
<
String
>>>()
{}.
getType
(),
map
);
return
result
.
detach
();
return
result
.
detach
();
}
}
...
...
src/main/java/com/syc/slm/slmbi/service/impl/DeptServiceImpl.java
View file @
eebd96b3
...
@@ -2,9 +2,9 @@ package com.syc.slm.slmbi.service.impl;
...
@@ -2,9 +2,9 @@ package com.syc.slm.slmbi.service.impl;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.google.gson.reflect.TypeToken
;
import
com.google.gson.reflect.TypeToken
;
import
com.syc.slm.common.core.constant.SlmConstants
;
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.config.DataCenterConfig
;
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
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -26,13 +26,13 @@ public class DeptServiceImpl implements DeptService {
...
@@ -26,13 +26,13 @@ public class DeptServiceImpl implements DeptService {
@Override
@Override
public
List
<
DeptVo
>
selectPositionList
(
String
uri
,
String
token
,
String
appId
,
String
deptName
)
{
public
List
<
DeptVo
>
selectPositionList
(
String
token
,
String
appId
,
String
deptName
)
{
log
.
info
(
"部门查询uri:---------------->"
+
uri
);
log
.
info
(
"部门查询token:---------------->"
+
token
);
log
.
info
(
"部门查询token:---------------->"
+
token
);
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"deptName"
,
deptName
);
uriVariables
.
put
(
"deptName"
,
deptName
);
uriVariables
.
put
(
"appId"
,
appId
);
uriVariables
.
put
(
"appId"
,
appId
);
String
uri
=
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
deptListUrl
;
R
<
List
<
DeptVo
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
List
<
DeptVo
>>>()
{}.
getType
(),
uriVariables
);
R
<
List
<
DeptVo
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
List
<
DeptVo
>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
return
result
.
detach
();
}
}
...
...
src/main/java/com/syc/slm/slmbi/service/impl/InstrumentPanelTreeServiceImpl.java
View file @
eebd96b3
...
@@ -13,6 +13,7 @@ import com.google.gson.reflect.TypeToken;
...
@@ -13,6 +13,7 @@ import com.google.gson.reflect.TypeToken;
import
com.syc.slm.common.core.constant.SlmConstants
;
import
com.syc.slm.common.core.constant.SlmConstants
;
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.config.DataCenterConfig
;
import
com.syc.slm.slmbi.dao.InstrumentPanelTreeMapper
;
import
com.syc.slm.slmbi.dao.InstrumentPanelTreeMapper
;
import
com.syc.slm.slmbi.dto.InstrumentPanelAssemblyDTO
;
import
com.syc.slm.slmbi.dto.InstrumentPanelAssemblyDTO
;
import
com.syc.slm.slmbi.entity.BaseEntity
;
import
com.syc.slm.slmbi.entity.BaseEntity
;
...
@@ -133,12 +134,12 @@ public class InstrumentPanelTreeServiceImpl extends ServiceImpl<InstrumentPanelT
...
@@ -133,12 +134,12 @@ public class InstrumentPanelTreeServiceImpl extends ServiceImpl<InstrumentPanelT
}
}
@Override
@Override
public
List
<
PanelTreeNodeVo
>
loadTrees
(
String
appId
,
String
name
,
String
uri
,
CurrentUser
user
)
{
public
List
<
PanelTreeNodeVo
>
loadTrees
(
String
appId
,
String
name
,
CurrentUser
user
)
{
if
(
StringUtils
.
isBlank
(
name
)){
if
(
StringUtils
.
isBlank
(
name
)){
return
loadTrees
(
appId
,
u
ri
,
u
ser
);
return
loadTrees
(
appId
,
user
);
}
}
List
<
PanelTreeNodeVo
>
lists
=
Lists
.
newArrayList
();
List
<
PanelTreeNodeVo
>
lists
=
Lists
.
newArrayList
();
R
<
Map
<
String
,
String
>>
result
=
setDeptAndRole
(
user
,
uri
);
R
<
Map
<
String
,
String
>>
result
=
setDeptAndRole
(
user
);
Map
<
String
,
String
>
detach
=
result
.
detach
();
Map
<
String
,
String
>
detach
=
result
.
detach
();
String
userId
=
user
.
getUid
();
String
userId
=
user
.
getUid
();
String
officeIds
=
detach
.
get
(
"deptIds"
);
String
officeIds
=
detach
.
get
(
"deptIds"
);
...
@@ -195,9 +196,9 @@ public class InstrumentPanelTreeServiceImpl extends ServiceImpl<InstrumentPanelT
...
@@ -195,9 +196,9 @@ public class InstrumentPanelTreeServiceImpl extends ServiceImpl<InstrumentPanelT
@Override
@Override
public
List
<
PanelTreeNodeVo
>
loadTrees
(
String
appId
,
String
uri
,
CurrentUser
user
)
{
public
List
<
PanelTreeNodeVo
>
loadTrees
(
String
appId
,
CurrentUser
user
)
{
List
<
PanelTreeNodeVo
>
lists
=
Lists
.
newArrayList
();
List
<
PanelTreeNodeVo
>
lists
=
Lists
.
newArrayList
();
R
<
Map
<
String
,
String
>>
result
=
setDeptAndRole
(
user
,
uri
);
R
<
Map
<
String
,
String
>>
result
=
setDeptAndRole
(
user
);
Map
<
String
,
String
>
detach
=
result
.
detach
();
Map
<
String
,
String
>
detach
=
result
.
detach
();
String
userId
=
user
.
getUid
();
String
userId
=
user
.
getUid
();
String
officeIds
=
detach
.
get
(
"deptIds"
);
String
officeIds
=
detach
.
get
(
"deptIds"
);
...
@@ -248,7 +249,7 @@ public class InstrumentPanelTreeServiceImpl extends ServiceImpl<InstrumentPanelT
...
@@ -248,7 +249,7 @@ public class InstrumentPanelTreeServiceImpl extends ServiceImpl<InstrumentPanelT
break
;
break
;
}
}
num
++;
num
++;
List
<
PanelTreeNodeVo
>
childrenNodes
=
this
.
children
(
groupId
,
null
,
u
ri
,
u
ser
);
List
<
PanelTreeNodeVo
>
childrenNodes
=
this
.
children
(
groupId
,
null
,
user
);
if
(
CollectionUtils
.
isEmpty
(
childrenNodes
)){
if
(
CollectionUtils
.
isEmpty
(
childrenNodes
)){
flag
=
false
;
flag
=
false
;
}
}
...
@@ -277,9 +278,9 @@ public class InstrumentPanelTreeServiceImpl extends ServiceImpl<InstrumentPanelT
...
@@ -277,9 +278,9 @@ public class InstrumentPanelTreeServiceImpl extends ServiceImpl<InstrumentPanelT
@Override
@Override
@Transactional
(
readOnly
=
true
)
@Transactional
(
readOnly
=
true
)
public
List
<
PanelTreeNodeVo
>
children
(
String
groupId
,
String
name
,
String
uri
,
CurrentUser
user
)
{
public
List
<
PanelTreeNodeVo
>
children
(
String
groupId
,
String
name
,
CurrentUser
user
)
{
List
<
PanelTreeNodeVo
>
lists
=
Lists
.
newArrayList
();
List
<
PanelTreeNodeVo
>
lists
=
Lists
.
newArrayList
();
R
<
Map
<
String
,
String
>>
result
=
setDeptAndRole
(
user
,
uri
);
R
<
Map
<
String
,
String
>>
result
=
setDeptAndRole
(
user
);
Map
<
String
,
String
>
detach
=
result
.
detach
();
Map
<
String
,
String
>
detach
=
result
.
detach
();
String
userId
=
user
.
getUid
();
String
userId
=
user
.
getUid
();
String
officeIds
=
detach
.
get
(
"deptIds"
);
String
officeIds
=
detach
.
get
(
"deptIds"
);
...
@@ -420,9 +421,10 @@ public class InstrumentPanelTreeServiceImpl extends ServiceImpl<InstrumentPanelT
...
@@ -420,9 +421,10 @@ public class InstrumentPanelTreeServiceImpl extends ServiceImpl<InstrumentPanelT
}
}
private
R
<
Map
<
String
,
String
>>
setDeptAndRole
(
CurrentUser
user
,
String
uri
){
private
R
<
Map
<
String
,
String
>>
setDeptAndRole
(
CurrentUser
user
){
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
String
uri
=
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
deptsRoles
;
return
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
Map
<
String
,
String
>>>()
{}.
getType
(),
uriVariables
);
return
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
Map
<
String
,
String
>>>()
{}.
getType
(),
uriVariables
);
}
}
...
...
src/main/java/com/syc/slm/slmbi/service/impl/PermissionServiceImpl.java
View file @
eebd96b3
...
@@ -2,13 +2,11 @@ package com.syc.slm.slmbi.service.impl;
...
@@ -2,13 +2,11 @@ package com.syc.slm.slmbi.service.impl;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.google.gson.reflect.TypeToken
;
import
com.google.gson.reflect.TypeToken
;
import
com.syc.slm.common.core.constant.SlmConstants
;
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.config.DataCenterConfig
;
import
com.syc.slm.slmbi.config.DataCenterConfig
;
import
com.syc.slm.slmbi.service.PermissionService
;
import
com.syc.slm.slmbi.service.PermissionService
;
import
com.syc.slm.slmbi.vo.PermissionCodeVo
;
import
com.syc.slm.slmbi.vo.PermissionCodeVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.List
;
...
@@ -21,14 +19,12 @@ import java.util.Map;
...
@@ -21,14 +19,12 @@ import java.util.Map;
@Service
@Service
public
class
PermissionServiceImpl
implements
PermissionService
{
public
class
PermissionServiceImpl
implements
PermissionService
{
@Autowired
private
DataCenterConfig
centerConfig
;
@Override
@Override
public
List
<
PermissionCodeVo
>
findAllPermissionCode
(
String
appId
,
String
token
)
{
public
List
<
PermissionCodeVo
>
findAllPermissionCode
(
String
appId
,
String
token
)
{
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"appId"
,
appId
);
uriVariables
.
put
(
"appId"
,
appId
);
R
<
List
<
PermissionCodeVo
>>
result
=
RestTemplateUtils
.
get
(
centerConfig
.
getHost
()+
centerConfig
.
getPermissionCodeUrl
()
,
new
TypeToken
<
R
<
List
<
PermissionCodeVo
>>>()
{}.
getType
(),
uriVariables
);
R
<
List
<
PermissionCodeVo
>>
result
=
RestTemplateUtils
.
get
(
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
permissionCodeUrl
,
new
TypeToken
<
R
<
List
<
PermissionCodeVo
>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
return
result
.
detach
();
}
}
}
}
src/main/java/com/syc/slm/slmbi/service/impl/PositionServiceImpl.java
View file @
eebd96b3
package
com
.
syc
.
slm
.
slmbi
.
service
.
impl
;
package
com
.
syc
.
slm
.
slmbi
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.google.gson.reflect.TypeToken
;
import
com.google.gson.reflect.TypeToken
;
import
com.syc.slm.common.core.constant.SlmConstants
;
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.
vo.PositionVo
;
import
com.syc.slm.slmbi.
config.DataCenterConfig
;
import
com.syc.slm.slmbi.service.PositionService
;
import
com.syc.slm.slmbi.service.PositionService
;
import
org.springframework.http.ResponseEntity
;
import
com.syc.slm.slmbi.vo.PositionVo
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.List
;
...
@@ -26,11 +23,12 @@ import java.util.Map;
...
@@ -26,11 +23,12 @@ import java.util.Map;
public
class
PositionServiceImpl
implements
PositionService
{
public
class
PositionServiceImpl
implements
PositionService
{
@Override
@Override
public
List
<
PositionVo
>
selectPositionList
(
String
uri
,
String
token
,
String
appId
,
String
name
)
{
public
List
<
PositionVo
>
selectPositionList
(
String
token
,
String
appId
,
String
name
)
{
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"positionName"
,
name
);
uriVariables
.
put
(
"positionName"
,
name
);
uriVariables
.
put
(
"appId"
,
appId
);
uriVariables
.
put
(
"appId"
,
appId
);
String
uri
=
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
positionListUrl
;
R
<
List
<
PositionVo
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
List
<
PositionVo
>>>()
{}.
getType
(),
uriVariables
);
R
<
List
<
PositionVo
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
List
<
PositionVo
>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
return
result
.
detach
();
}
}
...
...
src/main/java/com/syc/slm/slmbi/service/impl/UserServiceImpl.java
View file @
eebd96b3
package
com
.
syc
.
slm
.
slmbi
.
service
.
impl
;
package
com
.
syc
.
slm
.
slmbi
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.google.gson.reflect.TypeToken
;
import
com.google.gson.reflect.TypeToken
;
import
com.syc.slm.common.core.constant.SlmConstants
;
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.config.DataCenterConfig
;
import
com.syc.slm.slmbi.service.UserService
;
import
com.syc.slm.slmbi.service.UserService
;
import
com.syc.slm.slmbi.vo.DeptVo
;
import
com.syc.slm.slmbi.vo.UserTreeVo
;
import
com.syc.slm.slmbi.vo.UserTreeVo
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.List
;
...
@@ -25,10 +22,11 @@ import java.util.Map;
...
@@ -25,10 +22,11 @@ import java.util.Map;
@Service
@Service
public
class
UserServiceImpl
implements
UserService
{
public
class
UserServiceImpl
implements
UserService
{
@Override
@Override
public
List
<
UserTreeVo
>
selectUserList
(
String
appId
,
String
uri
,
String
token
,
String
userName
)
{
public
List
<
UserTreeVo
>
selectUserList
(
String
appId
,
String
token
,
String
userName
)
{
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"userName"
,
userName
);
uriVariables
.
put
(
"userName"
,
userName
);
uriVariables
.
put
(
"appId"
,
appId
);
uriVariables
.
put
(
"appId"
,
appId
);
String
uri
=
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
userTree
;
R
<
List
<
UserTreeVo
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
List
<
UserTreeVo
>>>()
{}.
getType
(),
uriVariables
);
R
<
List
<
UserTreeVo
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
List
<
UserTreeVo
>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
return
result
.
detach
();
}
}
...
...
src/main/java/com/syc/slm/slmbi/service/impl/VariableServiceImpl.java
View file @
eebd96b3
...
@@ -11,6 +11,7 @@ import com.google.gson.reflect.TypeToken;
...
@@ -11,6 +11,7 @@ import com.google.gson.reflect.TypeToken;
import
com.syc.slm.common.core.constant.SlmConstants
;
import
com.syc.slm.common.core.constant.SlmConstants
;
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.config.DataCenterConfig
;
import
com.syc.slm.slmbi.dto.*
;
import
com.syc.slm.slmbi.dto.*
;
import
com.syc.slm.slmbi.entity.CurrentUser
;
import
com.syc.slm.slmbi.entity.CurrentUser
;
import
com.syc.slm.slmbi.enums.AccessType
;
import
com.syc.slm.slmbi.enums.AccessType
;
...
@@ -20,7 +21,6 @@ import com.syc.slm.slmbi.service.VariableService;
...
@@ -20,7 +21,6 @@ import com.syc.slm.slmbi.service.VariableService;
import
com.syc.slm.slmbi.vo.VariableDeviceVo
;
import
com.syc.slm.slmbi.vo.VariableDeviceVo
;
import
com.syc.slm.slmbi.vo.VariableSourceVo
;
import
com.syc.slm.slmbi.vo.VariableSourceVo
;
import
com.syc.slm.slmbi.vo.VariableVo
;
import
com.syc.slm.slmbi.vo.VariableVo
;
import
lombok.NonNull
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -39,7 +39,7 @@ import java.util.stream.Collectors;
...
@@ -39,7 +39,7 @@ import java.util.stream.Collectors;
@Service
@Service
public
class
VariableServiceImpl
implements
VariableService
{
public
class
VariableServiceImpl
implements
VariableService
{
@Override
@Override
public
IPage
<
VariableVo
>
getVariableList
(
VariableDTO
variableDTO
,
String
appId
,
String
token
,
String
uri
)
{
public
IPage
<
VariableVo
>
getVariableList
(
VariableDTO
variableDTO
,
String
appId
,
String
token
)
{
IPage
<
VariableVo
>
page
=
new
Page
<>(
variableDTO
.
getCurrent
(),
variableDTO
.
getSize
());
IPage
<
VariableVo
>
page
=
new
Page
<>(
variableDTO
.
getCurrent
(),
variableDTO
.
getSize
());
Map
<
String
,
String
>
p
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
p
=
Maps
.
newHashMap
();
p
.
put
(
"appId"
,
appId
);
p
.
put
(
"appId"
,
appId
);
...
@@ -57,6 +57,7 @@ public class VariableServiceImpl implements VariableService {
...
@@ -57,6 +57,7 @@ public class VariableServiceImpl implements VariableService {
p
.
put
(
"current"
,
variableDTO
.
getCurrent
()+
""
);
p
.
put
(
"current"
,
variableDTO
.
getCurrent
()+
""
);
p
.
put
(
"size"
,
variableDTO
.
getSize
()+
""
);
p
.
put
(
"size"
,
variableDTO
.
getSize
()+
""
);
String
uri
=
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
variableList
;
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{
}.
getType
(),
p
);
}.
getType
(),
p
);
Map
<
String
,
Object
>
detach
=
result
.
detach
();
Map
<
String
,
Object
>
detach
=
result
.
detach
();
...
@@ -90,7 +91,7 @@ public class VariableServiceImpl implements VariableService {
...
@@ -90,7 +91,7 @@ public class VariableServiceImpl implements VariableService {
}
}
@Override
@Override
public
IPage
<
VariableDeviceVo
>
getVariableDeviceList
(
String
token
,
String
appId
,
String
uri
,
QueryPageDTO
queryPageDTO
)
{
public
IPage
<
VariableDeviceVo
>
getVariableDeviceList
(
String
token
,
String
appId
,
QueryPageDTO
queryPageDTO
)
{
IPage
<
VariableDeviceVo
>
page
=
new
Page
<>(
queryPageDTO
.
getCurrent
(),
queryPageDTO
.
getSize
());
IPage
<
VariableDeviceVo
>
page
=
new
Page
<>(
queryPageDTO
.
getCurrent
(),
queryPageDTO
.
getSize
());
Map
<
String
,
String
>
p
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
p
=
Maps
.
newHashMap
();
...
@@ -105,6 +106,7 @@ public class VariableServiceImpl implements VariableService {
...
@@ -105,6 +106,7 @@ public class VariableServiceImpl implements VariableService {
p
.
put
(
"warranty_status"
,
null
);
p
.
put
(
"warranty_status"
,
null
);
p
.
put
(
"page_num"
,
queryPageDTO
.
getCurrent
()
+
""
);
p
.
put
(
"page_num"
,
queryPageDTO
.
getCurrent
()
+
""
);
p
.
put
(
"page_size"
,
queryPageDTO
.
getSize
()
+
""
);
p
.
put
(
"page_size"
,
queryPageDTO
.
getSize
()
+
""
);
String
uri
=
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
deviceList
;
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{
}.
getType
(),
p
);
}.
getType
(),
p
);
Map
<
String
,
Object
>
detach
=
result
.
detach
();
Map
<
String
,
Object
>
detach
=
result
.
detach
();
...
@@ -120,11 +122,9 @@ public class VariableServiceImpl implements VariableService {
...
@@ -120,11 +122,9 @@ public class VariableServiceImpl implements VariableService {
}
}
@Override
@Override
public
Map
<
String
,
List
<
Object
>>
listVariableAllDataListByTimeInterval
(
@NonNull
String
uri
,
public
Map
<
String
,
List
<
Object
>>
listVariableAllDataListByTimeInterval
(
VariableAllDataDTO
variableDTO
,
CurrentUser
user
)
{
VariableAllDataDTO
variableDTO
,
CurrentUser
user
)
{
if
(
StringUtils
.
isBlank
(
uri
)){
throw
new
SysException
(
"请传入uri"
);
}
if
(
CollectionUtils
.
isEmpty
(
variableDTO
.
getVariableSearchList
())){
if
(
CollectionUtils
.
isEmpty
(
variableDTO
.
getVariableSearchList
())){
throw
new
SysException
(
"请传入变量"
);
throw
new
SysException
(
"请传入变量"
);
}
else
{
}
else
{
...
@@ -147,16 +147,14 @@ public class VariableServiceImpl implements VariableService {
...
@@ -147,16 +147,14 @@ public class VariableServiceImpl implements VariableService {
// Map<String, String> uriVariables =SlmConstants.gson.fromJson(SlmConstants.gson.toJson(variableDTO),new TypeToken<Map<String,String>>(){}.getType());
// Map<String, String> uriVariables =SlmConstants.gson.fromJson(SlmConstants.gson.toJson(variableDTO),new TypeToken<Map<String,String>>(){}.getType());
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
String
uri
=
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
variableRealTimeDataList
;
R
<
Map
<
String
,
List
<
Object
>>>
result
=
RestTemplateUtils
.
post
(
uri
,
variableDTO
,
new
TypeToken
<
R
<
Map
<
String
,
List
<
Object
>>>>()
{}.
getType
(),
uriVariables
);
R
<
Map
<
String
,
List
<
Object
>>>
result
=
RestTemplateUtils
.
post
(
uri
,
variableDTO
,
new
TypeToken
<
R
<
Map
<
String
,
List
<
Object
>>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
return
result
.
detach
();
}
}
@Override
@Override
public
Map
<
String
,
Object
>
listVariableHistoryDataListByCode
(
@NonNull
String
uri
,
public
Map
<
String
,
Object
>
listVariableHistoryDataListByCode
(
VariableHistoryDataDTO
variableDTO
,
CurrentUser
user
)
{
VariableHistoryDataDTO
variableDTO
,
CurrentUser
user
)
{
if
(
StringUtils
.
isBlank
(
uri
)){
throw
new
SysException
(
"请传入uri"
);
}
if
(
CollectionUtils
.
isEmpty
(
variableDTO
.
getVariableSearchList
())){
if
(
CollectionUtils
.
isEmpty
(
variableDTO
.
getVariableSearchList
())){
throw
new
SysException
(
"请传入变量"
);
throw
new
SysException
(
"请传入变量"
);
}
else
{
}
else
{
...
@@ -196,13 +194,14 @@ public class VariableServiceImpl implements VariableService {
...
@@ -196,13 +194,14 @@ public class VariableServiceImpl implements VariableService {
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
String
uri
=
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
variableHistoryDataList
;
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
post
(
uri
,
variableDTO
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{}.
getType
(),
uriVariables
);
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
post
(
uri
,
variableDTO
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
return
result
.
detach
();
}
}
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
send
(
VariableSendDTO
sendDTO
,
CurrentUser
currentUser
,
String
uri
)
{
public
void
send
(
VariableSendDTO
sendDTO
,
CurrentUser
currentUser
)
{
if
(
sendDTO
.
getControl
()
==
null
){
if
(
sendDTO
.
getControl
()
==
null
){
throw
new
SysException
(
"控件类型必填,控制按钮传1 读写框填2"
);
throw
new
SysException
(
"控件类型必填,控制按钮传1 读写框填2"
);
}
}
...
@@ -231,7 +230,8 @@ public class VariableServiceImpl implements VariableService {
...
@@ -231,7 +230,8 @@ public class VariableServiceImpl implements VariableService {
}
}
}
}
if
(
CollectionUtils
.
isNotEmpty
(
departments
)
||
CollectionUtils
.
isNotEmpty
(
positions
))
{
if
(
CollectionUtils
.
isNotEmpty
(
departments
)
||
CollectionUtils
.
isNotEmpty
(
positions
))
{
R
<
Map
<
String
,
String
>>
result
=
setDeptAndRole
(
currentUser
,
uri
);
R
<
Map
<
String
,
String
>>
result
=
setDeptAndRole
(
currentUser
,
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
deptsRoles
);
Map
<
String
,
String
>
detach
=
result
.
detach
();
Map
<
String
,
String
>
detach
=
result
.
detach
();
String
officeIds
=
detach
.
get
(
"deptIds"
);
String
officeIds
=
detach
.
get
(
"deptIds"
);
String
roleIds
=
detach
.
get
(
"roleIds"
);
String
roleIds
=
detach
.
get
(
"roleIds"
);
...
@@ -274,13 +274,14 @@ public class VariableServiceImpl implements VariableService {
...
@@ -274,13 +274,14 @@ public class VariableServiceImpl implements VariableService {
dto
.
setAppId
(
currentUser
.
getAppId
());
dto
.
setAppId
(
currentUser
.
getAppId
());
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"appId"
,
currentUser
.
getAppId
());
uriVariables
.
put
(
"appId"
,
currentUser
.
getAppId
());
String
uri
=
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
send
;
R
<
Object
>
result
=
RestTemplateUtils
.
post
(
uri
,
null
,
dto
,
new
TypeToken
<
R
<
Object
>>()
{}.
getType
(),
uriVariables
);
R
<
Object
>
result
=
RestTemplateUtils
.
post
(
uri
,
null
,
dto
,
new
TypeToken
<
R
<
Object
>>()
{}.
getType
(),
uriVariables
);
result
.
detach
();
result
.
detach
();
}
}
@Override
@Override
public
Map
<
String
,
Object
>
status
(
String
uri
,
String
deviceId
,
String
variableId
,
String
variableCode
,
CurrentUser
user
)
{
public
Map
<
String
,
Object
>
status
(
String
deviceId
,
String
variableId
,
String
variableCode
,
CurrentUser
user
)
{
if
(
StringUtils
.
isBlank
(
variableCode
)){
if
(
StringUtils
.
isBlank
(
variableCode
)){
throw
new
SysException
(
"变量code不能为空"
);
throw
new
SysException
(
"变量code不能为空"
);
}
}
...
@@ -293,12 +294,13 @@ public class VariableServiceImpl implements VariableService {
...
@@ -293,12 +294,13 @@ public class VariableServiceImpl implements VariableService {
uriVariables
.
put
(
"deviceId"
,
deviceId
);
uriVariables
.
put
(
"deviceId"
,
deviceId
);
uriVariables
.
put
(
"variableId"
,
variableId
);
uriVariables
.
put
(
"variableId"
,
variableId
);
uriVariables
.
put
(
"variableCode"
,
variableCode
);
uriVariables
.
put
(
"variableCode"
,
variableCode
);
String
uri
=
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
variableStatus
;
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{}.
getType
(),
uriVariables
);
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
return
result
.
detach
();
}
}
@Override
@Override
public
Map
<
String
,
Object
>
historyStatus
(
String
uri
,
public
Map
<
String
,
Object
>
historyStatus
(
String
deviceId
,
String
deviceId
,
String
variableCode
,
String
variableCode
,
String
startTime
,
String
startTime
,
...
@@ -326,21 +328,23 @@ public class VariableServiceImpl implements VariableService {
...
@@ -326,21 +328,23 @@ public class VariableServiceImpl implements VariableService {
uriVariables
.
put
(
"variableCode"
,
variableCode
);
uriVariables
.
put
(
"variableCode"
,
variableCode
);
uriVariables
.
put
(
"startTime"
,
startTime
);
uriVariables
.
put
(
"startTime"
,
startTime
);
uriVariables
.
put
(
"endTime"
,
endTime
);
uriVariables
.
put
(
"endTime"
,
endTime
);
String
uri
=
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
variableHistoryStatus
;
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{}.
getType
(),
uriVariables
);
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
return
result
.
detach
();
}
}
@Override
@Override
public
Map
<
String
,
List
<
Object
>>
listRealTimeVariableData
(
@NonNull
String
uri
,
RealTimeVariableDataDTO
variableDTO
,
CurrentUser
user
)
{
public
Map
<
String
,
List
<
Object
>>
listRealTimeVariableData
(
RealTimeVariableDataDTO
variableDTO
,
CurrentUser
user
)
{
this
.
judgeSearchList
(
variableDTO
.
getVariableSearchList
());
this
.
judgeSearchList
(
variableDTO
.
getVariableSearchList
());
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
String
uri
=
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
realTimeVariableDataList
;
R
<
Map
<
String
,
List
<
Object
>>>
result
=
RestTemplateUtils
.
post
(
uri
,
variableDTO
,
new
TypeToken
<
R
<
Map
<
String
,
List
<
Object
>>>>()
{}.
getType
(),
uriVariables
);
R
<
Map
<
String
,
List
<
Object
>>>
result
=
RestTemplateUtils
.
post
(
uri
,
variableDTO
,
new
TypeToken
<
R
<
Map
<
String
,
List
<
Object
>>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
return
result
.
detach
();
}
}
@Override
@Override
public
Map
<
String
,
Map
<
String
,
Object
>>
listVariableStatusRealTimeData
(
@NonNull
String
uri
,
List
<
VariableStatusRealTimeDataDTO
>
statusRealTimeDataList
,
CurrentUser
user
)
{
public
Map
<
String
,
Map
<
String
,
Object
>>
listVariableStatusRealTimeData
(
List
<
VariableStatusRealTimeDataDTO
>
statusRealTimeDataList
,
CurrentUser
user
)
{
if
(
CollectionUtils
.
isEmpty
(
statusRealTimeDataList
)){
if
(
CollectionUtils
.
isEmpty
(
statusRealTimeDataList
)){
throw
new
SysException
(
"请传入变量"
);
throw
new
SysException
(
"请传入变量"
);
}
else
{
}
else
{
...
@@ -356,6 +360,7 @@ public class VariableServiceImpl implements VariableService {
...
@@ -356,6 +360,7 @@ public class VariableServiceImpl implements VariableService {
}
}
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
String
uri
=
DataCenterConfig
.
dcClientHost
+
DataCenterConfig
.
variableStatusRealTimeDataList
;
R
<
Map
<
String
,
Map
<
String
,
Object
>>>
result
=
RestTemplateUtils
.
post
(
uri
,
statusRealTimeDataList
,
new
TypeToken
<
R
<
Map
<
String
,
Map
<
String
,
Object
>>>>()
{}.
getType
(),
uriVariables
);
R
<
Map
<
String
,
Map
<
String
,
Object
>>>
result
=
RestTemplateUtils
.
post
(
uri
,
statusRealTimeDataList
,
new
TypeToken
<
R
<
Map
<
String
,
Map
<
String
,
Object
>>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
return
result
.
detach
();
}
}
...
...
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