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
0feb3e1e
Commit
0feb3e1e
authored
May 11, 2021
by
梁光意
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改获取实时和历史变量数据
parent
7aca0545
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
16 deletions
+66
-16
VariableHistoryDataDTO.java
...in/java/com/syc/slm/slmbi/dto/VariableHistoryDataDTO.java
+7
-5
VariableRealTimeDTO.java
src/main/java/com/syc/slm/slmbi/dto/VariableRealTimeDTO.java
+5
-4
VariableSearchDTO.java
src/main/java/com/syc/slm/slmbi/dto/VariableSearchDTO.java
+28
-0
VariableServiceImpl.java
...a/com/syc/slm/slmbi/service/impl/VariableServiceImpl.java
+26
-7
No files found.
src/main/java/com/syc/slm/slmbi/dto/VariableHistoryDataDTO.java
View file @
0feb3e1e
...
...
@@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.
Map
;
import
java.util.
List
;
/**
...
...
@@ -16,8 +16,8 @@ import java.util.Map;
@ApiModel
(
"变量DTO"
)
@Data
public
class
VariableHistoryDataDTO
{
@ApiModelProperty
(
value
=
"所属设备"
,
required
=
true
)
private
String
deviceId
;
//
@ApiModelProperty(value = "所属设备", required = true)
//
private String deviceId;
@ApiModelProperty
(
value
=
"(x轴为变量时,统计类型必填)统计类型,代表(合计值(sum),平均值(avg),最大值(max),最小值(min) 中位数(middle),原值 original)"
,
required
=
true
)
private
String
statisticsType
;
// @ApiModelProperty(value = "变量id", required = true)
...
...
@@ -34,6 +34,8 @@ public class VariableHistoryDataDTO {
@ApiModelProperty
(
value
=
"统计维度如果是时间,请填时间格式如(yyyy-MM-dd HH:mm:ss),非时间为空"
,
required
=
true
)
private
String
format
;
@ApiModelProperty
(
value
=
"key 为变量id value 为变量名称"
,
required
=
true
)
private
Map
<
String
,
String
>
variables
;
// @ApiModelProperty(value = "key 为变量id value 为变量名称", required = true)
// private Map<String,String> variables;
@ApiModelProperty
(
value
=
"变量信息"
,
required
=
true
)
private
List
<
VariableSearchDTO
>
variableSearchList
;
}
src/main/java/com/syc/slm/slmbi/dto/VariableRealTimeDTO.java
View file @
0feb3e1e
...
...
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -15,8 +16,8 @@ import java.util.Map;
@ApiModel
(
"变量DTO"
)
@Data
public
class
VariableRealTimeDTO
{
@ApiModelProperty
(
value
=
"所属设备"
,
required
=
true
)
private
String
deviceId
;
//
@ApiModelProperty(value = "所属设备", required = true)
//
private String deviceId;
// @ApiModelProperty(value = "变量id", required = true)
// private String variableId;
// @ApiModelProperty(value = "变量Code", required = true)
...
...
@@ -28,8 +29,8 @@ public class VariableRealTimeDTO {
@ApiModelProperty
(
value
=
"(如果x轴为变量直接填yyyy-MM-dd HH:mm:ss)请填时间格式如(yyyy-MM-dd HH:mm:ss)"
,
required
=
true
)
private
String
format
;
@ApiModelProperty
(
value
=
"
key 为变量id value 为变量名称
"
,
required
=
true
)
private
Map
<
String
,
String
>
variables
;
@ApiModelProperty
(
value
=
"
变量信息
"
,
required
=
true
)
private
List
<
VariableSearchDTO
>
variableSearchList
;
@ApiModelProperty
(
value
=
"统计维度,如果是时间填time,如果是变量填variableCode"
,
required
=
true
)
private
String
x
;
}
src/main/java/com/syc/slm/slmbi/dto/VariableSearchDTO.java
0 → 100644
View file @
0feb3e1e
package
com
.
syc
.
slm
.
slmbi
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* slm-bi
* 变量
*
* @author : lin
* @date : 2021-03-25 19:05
**/
@Data
@ApiModel
(
value
=
"变量DTO"
)
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
VariableSearchDTO
extends
QueryPageDTO
{
@ApiModelProperty
(
value
=
"所属设备"
)
private
String
deviceId
;
@ApiModelProperty
(
value
=
"变量id"
)
private
String
variableId
;
@ApiModelProperty
(
value
=
"变量名称"
)
private
String
variableName
;
}
src/main/java/com/syc/slm/slmbi/service/impl/VariableServiceImpl.java
View file @
0feb3e1e
...
...
@@ -123,14 +123,20 @@ public class VariableServiceImpl implements VariableService {
if
(
StringUtils
.
isBlank
(
uri
)){
throw
new
SysException
(
"请传入uri"
);
}
if
(
StringUtils
.
isBlank
(
variableDTO
.
getDeviceId
())){
throw
new
SysException
(
"请传入设备id"
);
}
if
(
CollectionUtils
.
isEmpty
(
variableDTO
.
getVariable
s
())){
//
if(StringUtils.isBlank(variableDTO.getDeviceId())){
//
throw new SysException("请传入设备id");
//
}
if
(
CollectionUtils
.
isEmpty
(
variableDTO
.
getVariable
SearchList
())){
throw
new
SysException
(
"请传入变量"
);
}
else
{
if
(
variableDTO
.
getVariables
().
values
().
stream
().
anyMatch
(
StringUtils:
:
isBlank
))
{
throw
new
SysException
(
"变量名字不能为空"
);
if
(
variableDTO
.
getVariableSearchList
().
stream
().
anyMatch
(
x
->
StringUtils
.
isBlank
(
x
.
getDeviceId
()))){
throw
new
SysException
(
"设备ID不能为空"
);
}
if
(
variableDTO
.
getVariableSearchList
().
stream
().
anyMatch
(
x
->
StringUtils
.
isBlank
(
x
.
getVariableId
()))){
throw
new
SysException
(
"变量ID不能为空"
);
}
if
(
variableDTO
.
getVariableSearchList
().
stream
().
anyMatch
(
x
->
StringUtils
.
isBlank
(
x
.
getVariableName
()))){
throw
new
SysException
(
"变量名称不能为空"
);
}
}
if
(
StringUtils
.
isBlank
(
variableDTO
.
getEndTime
())){
...
...
@@ -155,7 +161,7 @@ public class VariableServiceImpl implements VariableService {
if
(
StringUtils
.
isBlank
(
uri
)){
throw
new
SysException
(
"请传入uri"
);
}
if
(
StringUtils
.
isBlank
(
variableDTO
.
getDeviceId
())){
/*
if(StringUtils.isBlank(variableDTO.getDeviceId())){
throw new SysException("请传入设备id");
}
if(CollectionUtils.isEmpty(variableDTO.getVariables())){
...
...
@@ -164,6 +170,19 @@ public class VariableServiceImpl implements VariableService {
if(variableDTO.getVariables().values().stream().anyMatch(StringUtils::isBlank)) {
throw new SysException("变量名字不能为空");
}
}*/
if
(
CollectionUtils
.
isEmpty
(
variableDTO
.
getVariableSearchList
())){
throw
new
SysException
(
"请传入变量"
);
}
else
{
if
(
variableDTO
.
getVariableSearchList
().
stream
().
anyMatch
(
x
->
StringUtils
.
isBlank
(
x
.
getDeviceId
()))){
throw
new
SysException
(
"设备ID不能为空"
);
}
if
(
variableDTO
.
getVariableSearchList
().
stream
().
anyMatch
(
x
->
StringUtils
.
isBlank
(
x
.
getVariableId
()))){
throw
new
SysException
(
"变量ID不能为空"
);
}
if
(
variableDTO
.
getVariableSearchList
().
stream
().
anyMatch
(
x
->
StringUtils
.
isBlank
(
x
.
getVariableName
()))){
throw
new
SysException
(
"变量名称不能为空"
);
}
}
if
(
StringUtils
.
isBlank
(
variableDTO
.
getEndTime
())){
...
...
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