Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
map-parent
Overview
Overview
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
常超
map-parent
Commits
8d4ec981
Commit
8d4ec981
authored
Jul 29, 2021
by
YANGYANG
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
历史预警信息
parent
d65cc84b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
138 additions
and
0 deletions
+138
-0
common/common_utils/src/main/java/com/founder/commonutils/ZdryApiEntity/Warn.java
+66
-0
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/controller/ZdryApiController.java
+12
-0
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/mapper/WarnMapper.java
+23
-0
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/mapper/xml/WarnMapper.xml
+5
-0
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/service/ZdryApiService.java
+2
-0
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/service/impl/ZdryApiServiceImpl.java
+30
-0
No files found.
common/common_utils/src/main/java/com/founder/commonutils/ZdryApiEntity/Warn.java
0 → 100644
View file @
8d4ec981
package
com
.
founder
.
commonutils
.
ZdryApiEntity
;
import
com.baomidou.mybatisplus.annotation.*
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
*
* </p>
*
* @author yangyang
* @since 2021-07-29
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"warn对象"
,
description
=
"warn对象"
)
@TableName
(
"gk_warn"
)
public
class
Warn
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
" 信息主键编号"
)
@TableId
(
type
=
IdType
.
AUTO
)
private
String
id
;
@ApiModelProperty
(
value
=
"设备imei"
)
private
String
imei
;
@ApiModelProperty
(
value
=
"发生时间"
)
private
String
timeBegin
;
@ApiModelProperty
(
value
=
"时间段"
)
private
String
time
;
@ApiModelProperty
(
value
=
"任务类型"
)
private
String
rwlx
;
@ApiModelProperty
(
value
=
"最新位置"
)
private
String
location
;
@ApiModelProperty
(
value
=
"任务名称"
)
private
String
rwmc
;
@ApiModelProperty
(
value
=
"经度"
)
private
String
x
;
@ApiModelProperty
(
value
=
"纬度"
)
private
String
y
;
@ApiModelProperty
(
value
=
"登记时间"
)
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Date
djsj
;
@ApiModelProperty
(
value
=
"改写时间"
)
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
private
Date
gxsj
;
}
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/controller/ZdryApiController.java
View file @
8d4ec981
...
...
@@ -131,5 +131,17 @@ public class ZdryApiController {
public
MapRestResult
newLocationdataList
(
@RequestBody
String
[]
imeis
)
{
return
zdryApiService
.
newLocationdataList
(
imeis
);
}
@ApiOperation
(
value
=
"根据imei获取预警历史消息"
)
@PostMapping
(
"/getWarnByImei/{page}/{limit}"
)
public
MapRestResult
getWarnByImei
(
@ApiParam
(
name
=
"page"
,
value
=
"当前页码"
,
required
=
true
)
@PathVariable
Long
page
,
@ApiParam
(
name
=
"limit"
,
value
=
"每页记录数"
,
required
=
true
)
@PathVariable
Long
limit
,
@RequestParam
String
imei
)
{
return
zdryApiService
.
getWarnByImei
(
imei
,
page
,
limit
);
}
}
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/mapper/WarnMapper.java
0 → 100644
View file @
8d4ec981
package
com
.
founder
.
zdryapi
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.founder.commonutils.ZdryApiEntity.Warn
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author yangyang
* @since 2021-07-29
*/
@Mapper
@Component
public
interface
WarnMapper
extends
BaseMapper
<
Warn
>
{
}
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/mapper/xml/WarnMapper.xml
0 → 100644
View file @
8d4ec981
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.founder.zdryapi.mapper.WarnMapper"
>
</mapper>
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/service/ZdryApiService.java
View file @
8d4ec981
...
...
@@ -32,4 +32,6 @@ public interface ZdryApiService {
MapRestResult
wearFlag
();
MapRestResult
newLocationdataList
(
String
[]
imeis
);
MapRestResult
getWarnByImei
(
String
imei
,
Long
page
,
Long
limit
);
}
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/service/impl/ZdryApiServiceImpl.java
View file @
8d4ec981
...
...
@@ -3,6 +3,7 @@ package com.founder.zdryapi.service.impl;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.founder.commonutils.ZdryApiEntity.*
;
import
com.founder.commonutils.constant.CommonCodeConstant
;
...
...
@@ -85,6 +86,9 @@ public class ZdryApiServiceImpl implements ZdryApiService {
@Autowired
private
ZdryHeartrateMessageMapper
zdryHeartrateMessageMapper
;
@Autowired
private
WarnMapper
warnMapper
;
public
Device
getDevice
(
String
deviceId
){
Device
device
=
new
Device
();
try
{
...
...
@@ -536,6 +540,18 @@ public class ZdryApiServiceImpl implements ZdryApiService {
map
.
put
(
"经度"
,
locationMessage
.
getX
());
map
.
put
(
"纬度"
,
locationMessage
.
getY
());
map
.
put
(
"开始时间"
,
locationMessage
.
getTimeBegin
());
// 将预警的imei信息插入到gk_warn
Warn
warn
=
new
Warn
();
warn
.
setImei
(
data
.
getSbImei
());
warn
.
setRwmc
(
fenceTask
.
getName
());
warn
.
setRwlx
(
fenceTask
.
getTaskType
());
warn
.
setTime
(
fenceTask
.
getTimeBegin
()+
"-"
+
fenceTask
.
getTimeEnd
());
warn
.
setTimeBegin
(
locationMessage
.
getTimeBegin
());
warn
.
setLocation
(
locationMessage
.
getAddress
());
warn
.
setX
(
locationMessage
.
getX
());
warn
.
setY
(
locationMessage
.
getY
());
warnMapper
.
insert
(
warn
);
listResult
.
add
(
map
);
}
else
{
// 查询对应任务
...
...
@@ -696,6 +712,20 @@ public class ZdryApiServiceImpl implements ZdryApiService {
return
MapRestResult
.
build
(
200
,
"批量获取设备最新位置"
,
resultList
.
size
(),
resultList
);
}
@Override
public
MapRestResult
getWarnByImei
(
String
imei
,
Long
page
,
Long
limit
)
{
Page
<
Warn
>
pageParam
=
new
Page
<
Warn
>(
page
-
1
,
limit
);
QueryWrapper
<
Warn
>
wrapper
=
new
QueryWrapper
<>();
if
(
StringUtils
.
isNotBlank
(
imei
)){
wrapper
.
eq
(
"imei"
,
imei
);
}
wrapper
.
orderByAsc
(
"djsj"
);
warnMapper
.
selectPage
(
pageParam
,
wrapper
);
List
<
Warn
>
records
=
pageParam
.
getRecords
();
long
total
=
pageParam
.
getTotal
();
return
MapRestResult
.
build
(
ResultCode
.
SUCCESS
,
"成功获取任务列表信息"
,
total
,
records
);
}
public
String
getToken
()
{
HttpHeaders
headers
=
new
HttpHeaders
();
MediaType
type
=
MediaType
.
parseMediaType
(
"application/json"
);
...
...
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