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
56dd3eaa
Commit
56dd3eaa
authored
Sep 01, 2021
by
YANGYANG
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
历史预警修改
parent
8d4ec981
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
160 additions
and
30 deletions
+160
-30
common/common_utils/src/main/java/com/founder/commonutils/ZdryApiEntity/Warn.java
+9
-0
service/zdry/src/main/java/com/founder/zdry/controller/UsersController.java
+18
-0
service/zdry/src/main/java/com/founder/zdry/mapper/WarnMapper.java
+20
-0
service/zdry/src/main/java/com/founder/zdry/mapper/xml/WarnMapper.xml
+5
-0
service/zdry/src/main/java/com/founder/zdry/service/ZdryApiService.java
+17
-0
service/zdry/src/main/java/com/founder/zdry/service/impl/ZdryApiServiceImpl.java
+66
-0
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/controller/ZdryApiController.java
+0
-12
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/service/ZdryApiService.java
+0
-2
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/service/impl/ZdryApiServiceImpl.java
+25
-16
No files found.
common/common_utils/src/main/java/com/founder/commonutils/ZdryApiEntity/Warn.java
View file @
56dd3eaa
...
...
@@ -35,6 +35,9 @@ public class Warn implements Serializable {
@ApiModelProperty
(
value
=
"设备imei"
)
private
String
imei
;
@ApiModelProperty
(
value
=
"用户姓名"
)
private
String
xm
;
@ApiModelProperty
(
value
=
"发生时间"
)
private
String
timeBegin
;
...
...
@@ -56,6 +59,12 @@ public class Warn implements Serializable {
@ApiModelProperty
(
value
=
"纬度"
)
private
String
y
;
@ApiModelProperty
(
value
=
"信息登记单位公安机关机构代码"
)
private
String
xxdjdwGajgjgdm
;
@ApiModelProperty
(
value
=
"信息登记单位公安机关机构名称"
)
private
String
xxdjdwGajgjgmc
;
@ApiModelProperty
(
value
=
"登记时间"
)
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Date
djsj
;
...
...
service/zdry/src/main/java/com/founder/zdry/controller/UsersController.java
View file @
56dd3eaa
...
...
@@ -12,6 +12,7 @@ import com.founder.commonutils.zdryEntity.Users;
import
com.founder.commonutils.zdryEntity.UsersAndDevice
;
import
com.founder.zdry.fegin.ServerZdryApi
;
import
com.founder.zdry.service.UsersService
;
import
com.founder.zdry.service.ZdryApiService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -41,6 +42,8 @@ public class UsersController {
private
UsersService
usersService
;
@Autowired
private
ServerZdryApi
serverZdryApi
;
@Autowired
private
ZdryApiService
zdryApiService
;
@ApiOperation
(
value
=
"分页用户列表"
)
@GetMapping
(
"userPageList/{page}/{limit}"
)
...
...
@@ -336,5 +339,20 @@ public class UsersController {
Integer
total
=
usersService
.
userStepListCount
(
map
);
return
MapRestResult
.
build
(
ResultCode
.
SUCCESS
,
"成功获取用户步数列表信息"
,
total
,
list
);
}
@ApiOperation
(
value
=
"根据imei获取预警历史消息"
)
@PostMapping
(
value
=
{
"/getWarnByImei/{page}/{limit}"
,
"/getWarnByImei"
})
public
MapRestResult
getWarnByImei
(
@ApiParam
(
name
=
"page"
,
value
=
"当前页码"
)
@PathVariable
(
required
=
false
)
Long
page
,
@ApiParam
(
name
=
"limit"
,
value
=
"每页记录数"
)
@PathVariable
(
required
=
false
)
Long
limit
,
@RequestParam
(
required
=
false
)
String
imei
,
HttpServletRequest
httpServletRequest
)
{
DlUsers
user
=(
DlUsers
)
httpServletRequest
.
getSession
().
getAttribute
(
CommonCodeConstant
.
LOGIN_USER_KEY
);
return
zdryApiService
.
getWarnByImei
(
imei
,
page
,
limit
,
user
);
}
}
service/zdry/src/main/java/com/founder/zdry/mapper/WarnMapper.java
0 → 100644
View file @
56dd3eaa
package
com
.
founder
.
zdry
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.founder.commonutils.ZdryApiEntity.Warn
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.stereotype.Component
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author yangyang
* @since 2021-07-29
*/
@Mapper
@Component
public
interface
WarnMapper
extends
BaseMapper
<
Warn
>
{
}
service/zdry/src/main/java/com/founder/zdry/mapper/xml/WarnMapper.xml
0 → 100644
View file @
56dd3eaa
<?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.zdry.mapper.WarnMapper"
>
</mapper>
service/zdry/src/main/java/com/founder/zdry/service/ZdryApiService.java
0 → 100644
View file @
56dd3eaa
package
com
.
founder
.
zdry
.
service
;
import
com.founder.commonutils.ZdryApiEntity.Device
;
import
com.founder.commonutils.publicEntity.MapRestResult
;
import
com.founder.commonutils.zdryEntity.DlUsers
;
/**
* <p>
* 接口 服务类
* </p>
*
* @author yangyang
* @since 2021-05-31
*/
public
interface
ZdryApiService
{
MapRestResult
getWarnByImei
(
String
imei
,
Long
page
,
Long
limit
,
DlUsers
user
);
}
service/zdry/src/main/java/com/founder/zdry/service/impl/ZdryApiServiceImpl.java
0 → 100644
View file @
56dd3eaa
package
com
.
founder
.
zdry
.
service
.
impl
;
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.publicEntity.MapRestResult
;
import
com.founder.commonutils.publicEntity.ResultCode
;
import
com.founder.commonutils.zdryEntity.DlUsers
;
import
com.founder.zdry.mapper.WarnMapper
;
import
com.founder.zdry.service.ZdryApiService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
/*
*
* <p>
* 爱牵挂接口 服务实现类
* </p>
*
* @author yangyang
* @since 2021-05-31
*/
@Service
public
class
ZdryApiServiceImpl
implements
ZdryApiService
{
@Autowired
private
WarnMapper
warnMapper
;
@Override
public
MapRestResult
getWarnByImei
(
String
imei
,
Long
page
,
Long
limit
,
DlUsers
user
)
{
String
code
=
""
;
if
(
null
!=
user
){
// 市局 分局 派出所
if
(
user
.
getUnitCode
().
endsWith
(
"00000000"
)){
code
=
user
.
getUnitCode
().
substring
(
0
,
4
);
}
else
if
(
user
.
getUnitCode
().
endsWith
(
"000000"
)){
code
=
user
.
getUnitCode
().
substring
(
0
,
6
);
}
else
if
(
user
.
getUnitCode
().
endsWith
(
"0000"
)){
code
=
user
.
getUnitCode
().
substring
(
0
,
8
);
}
}
// page和limit
if
(
null
!=
imei
){
Page
<
Warn
>
pageParam
=
new
Page
<
Warn
>(
page
-
1
,
limit
);
QueryWrapper
<
Warn
>
wrapper
=
new
QueryWrapper
<>();
if
(
StringUtils
.
isNotBlank
(
imei
)){
wrapper
.
eq
(
"imei"
,
imei
);
}
wrapper
.
like
(
"xxdjdw_gajgjgdm"
,
code
);
wrapper
.
orderByDesc
(
"time_begin"
);
warnMapper
.
selectPage
(
pageParam
,
wrapper
);
List
<
Warn
>
records
=
pageParam
.
getRecords
();
long
total
=
pageParam
.
getTotal
();
return
MapRestResult
.
build
(
ResultCode
.
SUCCESS
,
"成功获取历史预警列表信息"
,
total
,
records
);
}
else
{
QueryWrapper
<
Warn
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
orderByDesc
(
"time_begin"
);
wrapper
.
like
(
"xxdjdw_gajgjgdm"
,
code
);
warnMapper
.
selectList
(
wrapper
);
return
MapRestResult
.
build
(
ResultCode
.
SUCCESS
,
"成功获取历史预警列表信息"
,
warnMapper
.
selectList
(
wrapper
).
size
(),
warnMapper
.
selectList
(
wrapper
));
}
}
}
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/controller/ZdryApiController.java
View file @
56dd3eaa
...
...
@@ -131,17 +131,5 @@ 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/service/ZdryApiService.java
View file @
56dd3eaa
...
...
@@ -32,6 +32,4 @@ 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 @
56dd3eaa
...
...
@@ -541,17 +541,40 @@ public class ZdryApiServiceImpl implements ZdryApiService {
map
.
put
(
"纬度"
,
locationMessage
.
getY
());
map
.
put
(
"开始时间"
,
locationMessage
.
getTimeBegin
());
// 将预警的imei信息插入到gk_warn
// 查询imei对应用户姓名
QueryWrapper
<
Users
>
wrapper3
=
new
QueryWrapper
<>();
wrapper3
.
eq
(
"sb_imei"
,
data
.
getSbImei
());
Users
user
=
usersMapper
.
selectOne
(
wrapper3
);
// 将预警的imei信息插入到gk_warn 先根据imei和timebegin查询预警是否存在 存在则不插入
QueryWrapper
<
Warn
>
wrapper4
=
new
QueryWrapper
<>();
wrapper4
.
eq
(
"imei"
,
data
.
getSbImei
());
wrapper4
.
eq
(
"time_begin"
,
locationMessage
.
getTimeBegin
());
if
(
warnMapper
.
selectList
(
wrapper4
).
size
()==
0
){
Warn
warn
=
new
Warn
();
warn
.
setXm
(
user
.
getXm
());
warn
.
setImei
(
data
.
getSbImei
());
warn
.
setRwmc
(
fenceTask
.
getName
());
warn
.
setRwlx
(
fenceTask
.
getTaskType
());
String
rwlx
=
""
;
if
(
1
==
fenceTask
.
getGklx
()){
rwlx
=
"进入区域"
;
}
else
if
(
2
==
fenceTask
.
getGklx
()){
rwlx
=
"离开区域"
;
}
else
if
(
3
==
fenceTask
.
getGklx
()){
rwlx
=
"异常预警"
;
}
warn
.
setRwlx
(
rwlx
);
warn
.
setTime
(
fenceTask
.
getTimeBegin
()+
"-"
+
fenceTask
.
getTimeEnd
());
warn
.
setTimeBegin
(
locationMessage
.
getTimeBegin
());
warn
.
setLocation
(
locationMessage
.
getAddress
());
warn
.
setX
(
locationMessage
.
getX
());
warn
.
setY
(
locationMessage
.
getY
());
warn
.
setXxdjdwGajgjgdm
(
fenceTask
.
getXxdjdwGajgjgdm
());
warn
.
setXxdjdwGajgjgmc
(
fenceTask
.
getXxdjdwGajgjgmc
());
warnMapper
.
insert
(
warn
);
}
listResult
.
add
(
map
);
}
else
{
// 查询对应任务
...
...
@@ -712,20 +735,6 @@ 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