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
a59c1762
Commit
a59c1762
authored
May 17, 2021
by
linruibiao
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
50493a01
095314b2
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
6 deletions
+14
-6
VariableController.java
...java/com/syc/slm/slmbi/controller/VariableController.java
+4
-3
VariableStatusRealTimeDataDTO.java
.../com/syc/slm/slmbi/dto/VariableStatusRealTimeDataDTO.java
+3
-0
VariableService.java
src/main/java/com/syc/slm/slmbi/service/VariableService.java
+1
-1
VariableServiceImpl.java
...a/com/syc/slm/slmbi/service/impl/VariableServiceImpl.java
+5
-1
application.yml
src/main/resources/application.yml
+1
-1
No files found.
src/main/java/com/syc/slm/slmbi/controller/VariableController.java
View file @
a59c1762
...
@@ -152,17 +152,18 @@ public class VariableController extends BaseRestController{
...
@@ -152,17 +152,18 @@ public class VariableController extends BaseRestController{
}
}
@GetMapping
(
"/{deviceId}/{variableCode}/status"
)
@GetMapping
(
"/{deviceId}/{variable
Id}/{variable
Code}/status"
)
@ApiOperation
(
"状态点实时数据"
)
@ApiOperation
(
"状态点实时数据"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
"deviceId"
,
value
=
"设备id"
,
required
=
true
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
"deviceId"
,
value
=
"设备id"
,
required
=
true
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
"variableId"
,
value
=
"变量点id"
,
required
=
true
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
"variableCode"
,
value
=
"变量点code"
,
required
=
true
,
dataTypeClass
=
String
.
class
)
@ApiImplicitParam
(
name
=
"variableCode"
,
value
=
"变量点code"
,
required
=
true
,
dataTypeClass
=
String
.
class
)
})
})
public
R
<
Map
<
String
,
Object
>>
status
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
@PathVariable
String
deviceId
,
@PathVariable
String
variableCode
)
{
public
R
<
Map
<
String
,
Object
>>
status
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
@PathVariable
String
deviceId
,
@PathVariable
String
variable
Id
,
@PathVariable
String
variable
Code
)
{
return
call
(()
->
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
variableService
.
status
(
dcClientHost
+
variableStatus
,
deviceId
,
variableCode
,
currentUser
);
return
variableService
.
status
(
dcClientHost
+
variableStatus
,
deviceId
,
variableId
,
variableCode
,
currentUser
);
});
});
}
}
...
...
src/main/java/com/syc/slm/slmbi/dto/VariableStatusRealTimeDataDTO.java
View file @
a59c1762
...
@@ -15,6 +15,9 @@ public class VariableStatusRealTimeDataDTO {
...
@@ -15,6 +15,9 @@ public class VariableStatusRealTimeDataDTO {
@ApiModelProperty
(
value
=
"所属设备"
)
@ApiModelProperty
(
value
=
"所属设备"
)
private
String
deviceId
;
private
String
deviceId
;
@ApiModelProperty
(
value
=
"变量ID"
)
private
String
variableId
;
@ApiModelProperty
(
value
=
"变量code,也就是变量name"
)
@ApiModelProperty
(
value
=
"变量code,也就是变量name"
)
private
String
variableCode
;
private
String
variableCode
;
}
}
src/main/java/com/syc/slm/slmbi/service/VariableService.java
View file @
a59c1762
...
@@ -74,7 +74,7 @@ public interface VariableService {
...
@@ -74,7 +74,7 @@ public interface VariableService {
* @param variableCode
* @param variableCode
* @return
* @return
*/
*/
Map
<
String
,
Object
>
status
(
String
uri
,
String
deviceId
,
String
variableCode
,
CurrentUser
user
);
Map
<
String
,
Object
>
status
(
String
uri
,
String
deviceId
,
String
variable
Id
,
String
variable
Code
,
CurrentUser
user
);
/**
/**
* 状态点历史数据
* 状态点历史数据
...
...
src/main/java/com/syc/slm/slmbi/service/impl/VariableServiceImpl.java
View file @
a59c1762
...
@@ -278,7 +278,7 @@ public class VariableServiceImpl implements VariableService {
...
@@ -278,7 +278,7 @@ public class VariableServiceImpl implements VariableService {
}
}
@Override
@Override
public
Map
<
String
,
Object
>
status
(
String
uri
,
String
deviceId
,
String
variableCode
,
CurrentUser
user
)
{
public
Map
<
String
,
Object
>
status
(
String
uri
,
String
deviceId
,
String
variableId
,
String
variableCode
,
CurrentUser
user
)
{
if
(
StringUtils
.
isBlank
(
variableCode
)){
if
(
StringUtils
.
isBlank
(
variableCode
)){
throw
new
SysException
(
"变量code不能为空"
);
throw
new
SysException
(
"变量code不能为空"
);
}
}
...
@@ -289,6 +289,7 @@ public class VariableServiceImpl implements VariableService {
...
@@ -289,6 +289,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
());
uriVariables
.
put
(
"deviceId"
,
deviceId
);
uriVariables
.
put
(
"deviceId"
,
deviceId
);
uriVariables
.
put
(
"variableId"
,
variableId
);
uriVariables
.
put
(
"variableCode"
,
variableCode
);
uriVariables
.
put
(
"variableCode"
,
variableCode
);
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
();
...
@@ -344,6 +345,9 @@ public class VariableServiceImpl implements VariableService {
...
@@ -344,6 +345,9 @@ public class VariableServiceImpl implements VariableService {
if
(
statusRealTimeDataList
.
stream
().
anyMatch
(
x
->
StringUtils
.
isBlank
(
x
.
getDeviceId
()))){
if
(
statusRealTimeDataList
.
stream
().
anyMatch
(
x
->
StringUtils
.
isBlank
(
x
.
getDeviceId
()))){
throw
new
SysException
(
"设备ID不能为空"
);
throw
new
SysException
(
"设备ID不能为空"
);
}
}
if
(
statusRealTimeDataList
.
stream
().
anyMatch
(
x
->
StringUtils
.
isBlank
(
x
.
getVariableId
()))){
throw
new
SysException
(
"变量Id不能为空"
);
}
if
(
statusRealTimeDataList
.
stream
().
anyMatch
(
x
->
StringUtils
.
isBlank
(
x
.
getVariableCode
()))){
if
(
statusRealTimeDataList
.
stream
().
anyMatch
(
x
->
StringUtils
.
isBlank
(
x
.
getVariableCode
()))){
throw
new
SysException
(
"变量Code不能为空"
);
throw
new
SysException
(
"变量Code不能为空"
);
}
}
...
...
src/main/resources/application.yml
View file @
a59c1762
...
@@ -66,7 +66,7 @@ dc_client:
...
@@ -66,7 +66,7 @@ dc_client:
realTimeVariableDataList
:
/{appId}/variables/real-time/data
realTimeVariableDataList
:
/{appId}/variables/real-time/data
filedValue
:
/{appId}/business/{tableName}/{filed}/filed-value?current={current}&size={size}&name={name}
#/{appId}/business/{tableName}/{filed}/filed-value?current={current}&size={size}&name={name}
filedValue
:
/{appId}/business/{tableName}/{filed}/filed-value?current={current}&size={size}&name={name}
#/{appId}/business/{tableName}/{filed}/filed-value?current={current}&size={size}&name={name}
send
:
/{appId}/variables/monitor/device/commands
send
:
/{appId}/variables/monitor/device/commands
variableStatus
:
/{appId}/variables/{deviceId}/{variableCode}/status
variableStatus
:
/{appId}/variables/{deviceId}/{variable
Id}/{variable
Code}/status
variableHistoryStatus
:
/{appId}/variables/{deviceId}/{variableCode}/history-status?startTime={startTime}&endTime={endTime}
variableHistoryStatus
:
/{appId}/variables/{deviceId}/{variableCode}/history-status?startTime={startTime}&endTime={endTime}
# historyCurve : /{appId}/variables/history-curve?deviceId={deviceId}&endTime={endTime}&startTime={startTime}&variableCode={variableCode}&variableId={variableId}&format={format}
# historyCurve : /{appId}/variables/history-curve?deviceId={deviceId}&endTime={endTime}&startTime={startTime}&variableCode={variableCode}&variableId={variableId}&format={format}
# historyCurve : /{appId}/variables/history-curve
# historyCurve : /{appId}/variables/history-curve
...
...
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