Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
New MineTRS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
kiritoausna
New MineTRS
Commits
f15244d2
Commit
f15244d2
authored
Jun 20, 2022
by
kiritoausna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2022-6.20 水质历史数据
parent
818632d2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
22 deletions
+46
-22
SzDataController.java
...a/me/zhengjie/gemho/controller/data/SzDataController.java
+14
-0
SzData.java
...m/src/main/java/me/zhengjie/gemho/entity/data/SzData.java
+5
-2
SzDataService.java
...in/java/me/zhengjie/gemho/service/data/SzDataService.java
+4
-9
SzDataServiceImpl.java
...e/zhengjie/gemho/service/data/impl/SzDataServiceImpl.java
+23
-11
No files found.
eladmin-system/src/main/java/me/zhengjie/gemho/controller/data/SzDataController.java
View file @
f15244d2
...
...
@@ -8,6 +8,7 @@ import me.zhengjie.gemho.service.data.SzDataService;
import
me.zhengjie.gemho.util.PageResult
;
import
me.zhengjie.gemho.util.RealVo
;
import
me.zhengjie.gemho.x_datavo.DataVo
;
import
me.zhengjie.gemho.x_datavo.data.DataQueryCriteria
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
...
...
@@ -52,5 +53,18 @@ public class SzDataController {
return
new
ResponseEntity
<>(
new
RealVo
().
failed
(),
HttpStatus
.
INTERNAL_SERVER_ERROR
);
}
@ApiOperation
(
value
=
"分页查看"
)
@GetMapping
(
"history"
)
public
ResponseEntity
<
Object
>
getall
(
DataQueryCriteria
dataQueryCriteria
,
HttpServletRequest
request
)
{
try
{
HashMap
<
String
,
Object
>
map
=
szDataService
.
pageall
(
dataQueryCriteria
,
request
);
return
new
ResponseEntity
<>(
new
PageResult
().
success
(
map
),
HttpStatus
.
OK
);
}
catch
(
NumberFormatException
e
)
{
e
.
printStackTrace
();
}
return
new
ResponseEntity
<>(
new
PageResult
().
failed
(),
HttpStatus
.
INTERNAL_SERVER_ERROR
);
}
}
eladmin-system/src/main/java/me/zhengjie/gemho/entity/data/SzData.java
View file @
f15244d2
package
me
.
zhengjie
.
gemho
.
entity
.
data
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
...
...
@@ -39,7 +40,8 @@ public class SzData implements Serializable {
*/
@ApiModelProperty
(
value
=
"设备编号(外键)"
)
public
String
sensorid
;
@TableField
(
exist
=
false
)
public
String
sensorname
;
/**
* 测量时间
*/
...
...
@@ -75,7 +77,8 @@ public class SzData implements Serializable {
*/
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
public
Date
createtime
;
@TableField
(
exist
=
false
)
public
String
Danwei
;
/**
* 修改时间
*/
...
...
eladmin-system/src/main/java/me/zhengjie/gemho/service/data/SzDataService.java
View file @
f15244d2
...
...
@@ -3,6 +3,7 @@ package me.zhengjie.gemho.service.data;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
me.zhengjie.gemho.entity.data.SzData
;
import
me.zhengjie.gemho.x_datavo.DataVo
;
import
me.zhengjie.gemho.x_datavo.data.DataQueryCriteria
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.ArrayList
;
...
...
@@ -61,15 +62,9 @@ public interface SzDataService extends IService<SzData> {
/**
* 分页历史记录
*
* @param searchName
* @param searchValue
* @param limit
* @param timeSpace
* @param sort
* @param page
* @param size
* @param datasource
* @param dataQueryCriteria
* @param request
* @return
*/
HashMap
<
String
,
Object
>
pageall
(
String
searchName
,
String
searchValue
,
String
limit
,
String
timeSpace
,
String
sort
,
long
page
,
long
size
,
String
datasource
);
HashMap
<
String
,
Object
>
pageall
(
DataQueryCriteria
dataQueryCriteria
,
HttpServletRequest
request
);
}
eladmin-system/src/main/java/me/zhengjie/gemho/service/data/impl/SzDataServiceImpl.java
View file @
f15244d2
...
...
@@ -12,6 +12,7 @@ import me.zhengjie.gemho.util.TailNoForInfoUtil;
import
me.zhengjie.gemho.x_datavo.DataVo
;
import
me.zhengjie.gemho.x_datavo.NameVo
;
import
me.zhengjie.gemho.x_datavo.Result
;
import
me.zhengjie.gemho.x_datavo.data.DataQueryCriteria
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -19,6 +20,7 @@ import javax.servlet.http.HttpServletRequest;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
/**
* <p>
...
...
@@ -30,15 +32,14 @@ import java.util.HashMap;
*/
@Service
public
class
SzDataServiceImpl
extends
ServiceImpl
<
SzDataMapper
,
SzData
>
implements
SzDataService
{
private
static
String
[]
stringListHashMap
=
{
"周日"
,
"周一"
,
"周二"
,
"周三"
,
"周四"
,
"周五"
,
"周六"
};
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
sdf2
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH"
);
@Autowired
private
SzDataMapper
szDataMapper
;
@Autowired
private
DrybeachequipinforMapper
drybeachequipinforMapper
;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
sdf2
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH"
);
private
static
String
[]
stringListHashMap
=
{
"周日"
,
"周一"
,
"周二"
,
"周三"
,
"周四"
,
"周五"
,
"周六"
};
@Override
public
DataVo
day
(
String
date
,
String
values
,
String
deviceid
,
String
subitem
)
{
...
...
@@ -105,14 +106,25 @@ public class SzDataServiceImpl extends ServiceImpl<SzDataMapper, SzData> impleme
}
@Override
public
HashMap
<
String
,
Object
>
pageall
(
String
searchName
,
String
searchValue
,
String
limit
,
String
timeSpace
,
String
sort
,
long
page
,
long
size
,
String
datasource
)
{
public
HashMap
<
String
,
Object
>
pageall
(
DataQueryCriteria
dataQueryCriteria
,
HttpServletRequest
request
)
{
long
page
=
dataQueryCriteria
.
getPage
();
long
size
=
dataQueryCriteria
.
getSize
();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
QueryWrapper
<
SzData
>
szDataQueryWrapper
=
new
QueryWrapper
<>();
ServiceUtil
.
dbquery
(
szDataQueryWrapper
,
searchName
,
searchValue
,
limit
,
timeSpace
,
sort
,
datasource
);
ServiceUtil
.
dbquery
(
szDataQueryWrapper
,
dataQueryCriteria
,
request
);
Page
<
SzData
>
szDataPage
=
new
Page
<>(
page
+
1
,
size
);
szDataPage
=
szDataMapper
.
selectPage
(
szDataPage
,
szDataQueryWrapper
);
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
hashMap
.
put
(
"list"
,
szDataPage
.
getRecords
());
hashMap
.
put
(
"total"
,
szDataPage
.
getTotal
());
return
hashMap
;
List
<
SzData
>
records
=
szDataPage
.
getRecords
();
//获取设备编码 名称 map
HashMap
<
String
,
String
>
noName
=
ServiceUtil
.
getNoName
(
request
);
HashMap
<
String
,
String
>
noDan
=
ServiceUtil
.
getNoDan
(
request
);
for
(
SzData
record
:
records
)
{
record
.
setSensorname
(
noName
.
get
(
record
.
getSensorid
()));
record
.
setDanwei
(
noDan
.
get
(
record
.
getSensorid
()));
}
map
.
put
(
"list"
,
records
);
map
.
put
(
"total"
,
szDataPage
.
getTotal
());
return
map
;
}
}
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