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
192840e9
Commit
192840e9
authored
Jun 09, 2021
by
YANGYANG
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
任务关联人接口
parent
51604de2
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
283 additions
and
8 deletions
+283
-8
common/common_utils/src/main/java/com/founder/commonutils/ZdryAndZdryApiVo/UsersAndOnlineAndTasksVo.java
+128
-0
common/common_utils/src/main/java/com/founder/commonutils/ZdryAndZdryApiVo/UsersAndOnlineVo.java
+0
-2
common/common_utils/src/main/java/com/founder/commonutils/ZdryApiEntity/FenceTask.java
+4
-0
service/zdry/src/main/java/com/founder/zdry/controller/FenceTaskController.java
+40
-0
service/zdry/src/main/java/com/founder/zdry/mapper/FenceTaskMapper.java
+4
-2
service/zdry/src/main/java/com/founder/zdry/mapper/xml/FenceTaskMapper.xml
+72
-0
service/zdry/src/main/java/com/founder/zdry/mapper/xml/UsersMapper.xml
+1
-0
service/zdry/src/main/java/com/founder/zdry/service/FenceTaskService.java
+8
-0
service/zdry/src/main/java/com/founder/zdry/service/impl/FenceTaskServiceImpl.java
+16
-0
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/controller/ZdryApiController.java
+4
-2
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/service/ZdryApiService.java
+1
-1
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/service/impl/ZdryApiServiceImpl.java
+5
-1
No files found.
common/common_utils/src/main/java/com/founder/commonutils/ZdryAndZdryApiVo/UsersAndOnlineAndTasksVo.java
0 → 100644
View file @
192840e9
package
com
.
founder
.
commonutils
.
ZdryAndZdryApiVo
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.TableField
;
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-06-02
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"UsersAndOnlineAndTasksVo对象"
,
description
=
"UsersAndOnlineAndTasksVo对象"
)
public
class
UsersAndOnlineAndTasksVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"姓名"
)
private
String
xm
;
@ApiModelProperty
(
value
=
"性别 1男 2女 0未知"
)
private
Integer
xb
;
@ApiModelProperty
(
value
=
"家庭住址"
)
private
String
jtZz
;
@ApiModelProperty
(
value
=
"是否有前科 1是 0否"
)
private
Integer
sfyQk
;
@ApiModelProperty
(
value
=
"现住址"
)
private
String
xzz
;
@ApiModelProperty
(
value
=
"病史"
)
private
String
bs
;
@ApiModelProperty
(
value
=
"病情等级 1低 2中 3高 4极高"
)
private
Integer
bqDj
;
@ApiModelProperty
(
value
=
"监护人1姓名"
)
private
String
jhr1Xm
;
@ApiModelProperty
(
value
=
"监护人1关系"
)
private
String
jhr1Gx
;
@ApiModelProperty
(
value
=
"监护人1联系电话"
)
private
String
jhr1Lxdh
;
@ApiModelProperty
(
value
=
"监护人1紧急电话"
)
private
String
jhr1Jjdh
;
@ApiModelProperty
(
value
=
"监护人2姓名"
)
private
String
jhr2Xm
;
@ApiModelProperty
(
value
=
"监护人2关系"
)
private
String
jhr2Gx
;
@ApiModelProperty
(
value
=
"监护人2联系电话"
)
private
String
jhr2Lxdh
;
@ApiModelProperty
(
value
=
"监护人2紧急电话"
)
private
String
jhr2Jjdh
;
@ApiModelProperty
(
value
=
"设备IMEI"
)
private
String
sbImei
;
@ApiModelProperty
(
value
=
"设备型号"
)
private
String
sbXh
;
@ApiModelProperty
(
value
=
"身份证号码"
)
private
String
sfzhm
;
@ApiModelProperty
(
value
=
"是否在线 1在线 0离线"
)
private
String
online
;
@ApiModelProperty
(
value
=
"是否佩戴 1佩戴 0位佩戴"
)
private
String
WearFlag
;
@ApiModelProperty
(
value
=
"最新发生时间"
)
private
String
locationUpdatedAt
;
@ApiModelProperty
(
value
=
"最新位置经度"
)
private
String
lastLocationX
;
@ApiModelProperty
(
value
=
"最新位置纬度"
)
private
String
lastLocationY
;
@ApiModelProperty
(
value
=
"最新位置地址"
)
private
String
lastAddress
;
@ApiModelProperty
(
value
=
"电子围栏名称"
)
@TableField
(
value
=
"name"
)
private
String
name
;
@ApiModelProperty
(
value
=
"开始时间例早上八点:8"
)
@TableField
(
value
=
"time_begin"
)
private
String
timeBegin
;
@ApiModelProperty
(
value
=
"结束时间例下午六点:18"
)
@TableField
(
value
=
"time_end"
)
private
String
timeEnd
;
@ApiModelProperty
(
value
=
"A;B;C;D;A"
)
@TableField
(
value
=
"safe_area"
)
private
String
safeArea
;
@ApiModelProperty
(
value
=
"任务类型"
)
@TableField
(
value
=
"task_type"
)
private
String
taskType
;
@ApiModelProperty
(
value
=
"预警"
)
@TableField
(
value
=
"warn"
)
private
int
warn
;
@ApiModelProperty
(
value
=
"1进入区域 2离开区域 3异常预警"
)
@TableField
(
value
=
"gklx"
)
private
int
gklx
;
}
common/common_utils/src/main/java/com/founder/commonutils/ZdryAndZdryApiVo/UsersAndOnlineVo.java
View file @
192840e9
package
com
.
founder
.
commonutils
.
ZdryAndZdryApiVo
;
import
com.baomidou.mybatisplus.annotation.*
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -8,7 +7,6 @@ import lombok.EqualsAndHashCode;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
...
...
common/common_utils/src/main/java/com/founder/commonutils/ZdryApiEntity/FenceTask.java
View file @
192840e9
...
...
@@ -70,4 +70,8 @@ public class FenceTask implements Serializable {
@ApiModelProperty
(
value
=
"预警"
)
@TableField
(
value
=
"warn"
)
private
int
warn
;
@ApiModelProperty
(
value
=
"1进入区域 2离开区域 3异常预警"
)
@TableField
(
value
=
"gklx"
)
private
int
gklx
;
}
service/zdry/src/main/java/com/founder/zdry/controller/FenceTaskController.java
View file @
192840e9
...
...
@@ -3,6 +3,7 @@ package com.founder.zdry.controller;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.founder.commonutils.ZdryAndZdryApiVo.UsersAndOnlineAndTasksVo
;
import
com.founder.commonutils.ZdryApiEntity.FenceTask
;
import
com.founder.commonutils.publicEntity.MapRestResult
;
import
com.founder.commonutils.publicEntity.ResultCode
;
...
...
@@ -14,7 +15,9 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -64,6 +67,43 @@ public class FenceTaskController {
return
MapRestResult
.
build
(
ResultCode
.
SUCCESS
,
"成功获取任务列表信息"
,
total
,
records
);
}
@ApiOperation
(
value
=
"分页任务关联人列表"
)
@GetMapping
(
"fenceTaskPeopleList/{page}/{limit}"
)
public
MapRestResult
fenceTaskPeopleList
(
@ApiParam
(
name
=
"page"
,
value
=
"当前页码"
,
required
=
true
)
@PathVariable
Long
page
,
@ApiParam
(
name
=
"limit"
,
value
=
"每页记录数"
,
required
=
true
)
@PathVariable
Long
limit
,
@ApiParam
(
name
=
"xm"
,
value
=
"姓名"
)
@RequestParam
(
required
=
false
)
String
xm
,
@ApiParam
(
name
=
"bs"
,
value
=
"病史"
)
@RequestParam
(
required
=
false
)
String
bs
,
@ApiParam
(
name
=
"sbimei"
,
value
=
"设备IMEI"
)
@RequestParam
(
required
=
false
)
String
sbimei
,
@ApiParam
(
name
=
"bqdj"
,
value
=
"病情等级"
)
@RequestParam
(
required
=
false
)
String
bqdj
,
@ApiParam
(
name
=
"sfzhm"
,
value
=
"身份证号码"
)
@RequestParam
(
required
=
false
)
String
sfzhm
){
Map
map
=
new
HashMap
();
map
.
put
(
"page"
,
page
);
map
.
put
(
"limit"
,
limit
);
map
.
put
(
"sbimei"
,
sbimei
);
map
.
put
(
"xm"
,
xm
);
map
.
put
(
"bs"
,
bs
);
map
.
put
(
"bqdj"
,
bqdj
);
map
.
put
(
"sfzhm"
,
sfzhm
);
List
<
UsersAndOnlineAndTasksVo
>
list
=
fenceTaskService
.
fenceTaskPeopleList
(
map
);
Integer
total
=
fenceTaskService
.
fenceTaskPeopleListCount
(
map
);
return
MapRestResult
.
build
(
ResultCode
.
SUCCESS
,
"分页任务关联人列表"
,
total
,
list
);
}
}
service/zdry/src/main/java/com/founder/zdry/mapper/FenceTaskMapper.java
View file @
192840e9
package
com
.
founder
.
zdry
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.founder.commonutils.ZdryAndZdryApiVo.UsersAndOnlineVo
;
import
com.founder.commonutils.ZdryAndZdryApiVo.UsersAndOnline
AndTasks
Vo
;
import
com.founder.commonutils.ZdryApiEntity.FenceTask
;
import
com.founder.commonutils.zdryEntity.Users
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Component
;
...
...
@@ -23,5 +22,8 @@ import java.util.Map;
@Component
public
interface
FenceTaskMapper
extends
BaseMapper
<
FenceTask
>
{
List
<
UsersAndOnlineAndTasksVo
>
fenceTaskPeopleList
(
Map
map
);
Integer
fenceTaskPeopleListCount
(
Map
map
);
}
service/zdry/src/main/java/com/founder/zdry/mapper/xml/FenceTaskMapper.xml
View file @
192840e9
<?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.FenceTaskMapper"
>
<sql
id=
"queryTlWhere"
>
<if
test=
"xm!= null and xm!=''"
>
AND users.xm LIKE '%' || #{xm , jdbcType=VARCHAR } || '%'
</if>
<if
test=
"sbimei!= null and sbimei != ''"
>
AND users.sb_imei= #{ sbimei , jdbcType=INTEGER }
</if>
<if
test=
"bs!= null and bs != ''"
>
AND users.bs LIKE '%' || #{xm , jdbcType=VARCHAR } || '%'
</if>
<if
test=
"sfzhm!= null and sfzhm != ''"
>
AND users.sfzhm LIKE '%' || #{sfzhm , jdbcType=VARCHAR } || '%'
</if>
<if
test=
"bq_dj!= null and bq_dj != ''"
>
AND users.bq_dj= #{ bq_dj , jdbcType=INTEGER }
</if>
<if
test=
"online!= null and online != ''"
>
AND online.online= #{ online , jdbcType=INTEGER }
</if>
<if
test=
"wearFlag!= null and wearFlag != ''"
>
AND online.wear_flag= #{ wearFlag , jdbcType=INTEGER }
</if>
</sql>
<select
id=
"fenceTaskPeopleList"
parameterType=
"java.util.Map"
resultType=
"com.founder.commonutils.ZdryAndZdryApiVo.UsersAndOnlineAndTasksVo"
>
select
users.xm as xm,
users.xb as xb,
users. jt_zz as jtZz,
users.sfy_qk as sfyQk,
users.xzz as xzz,
users.bs as bs,
users.bq_dj as bqDj,
users.jhr1_xm as jhr1Xm,
users.jhr1_gx as jhr1Gx,
users.jhr1_lxdh as jhr1Lxdh,
users.jhr1_jjdh as jhr1Jjdh,
users.jhr2_xm as jhr2Xm,
users. jhr2_gx as jhr2Gx,
users.jhr2_lxdh as jhr2Lxdh,
users. jhr2_jjdh as jhr2Jjdh,
users. sb_imei as sbImei,
users. sb_xh as sbXh,
users.sfzhm as sfzhm,
online.online as online,
online.Wear_flag as WearFlag,
online.location_updated_at as locationUpdatedAt,
online.last_location_x as lastLocationX,
online.last_location_y as lastLocationY,
online.last_address as lastAddress,
task.name as name,
task.time_begin as timeBegin,
task.time_end as timeEnd,
task.safe_area as safeArea,
task.task_type as taskType,
task.warn as warn,
task.gklx as gklx
from gk_users users,gk_online online,gk_fencetask task
where users.sb_imei = online.sb_imei
and users.sb_imei = task.sb_imei
and users.xxsc_pdbz = 0
<include
refid=
"queryTlWhere"
/>
limit #{ page },#{ limit}
</select>
<select
id=
"fenceTaskPeopleListCount"
parameterType=
"java.util.Map"
resultType=
"java.lang.Integer"
>
select
count(*)
from gk_users users,gk_online online,gk_fencetask task
where users.sb_imei = online.sb_imei
and users.sb_imei = task.sb_imei
and users.xxsc_pdbz = 0
<include
refid=
"queryTlWhere"
/>
</select>
</mapper>
service/zdry/src/main/java/com/founder/zdry/mapper/xml/UsersMapper.xml
View file @
192840e9
...
...
@@ -53,6 +53,7 @@
count(*)
from gk_users users,gk_online online
where users.sb_imei = online.sb_imei
and users.xxsc_pdbz = 0
<include
refid=
"queryTlWhere"
/>
</select>
</mapper>
service/zdry/src/main/java/com/founder/zdry/service/FenceTaskService.java
View file @
192840e9
package
com
.
founder
.
zdry
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.founder.commonutils.ZdryAndZdryApiVo.UsersAndOnlineAndTasksVo
;
import
com.founder.commonutils.ZdryApiEntity.FenceTask
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -14,4 +18,8 @@ import com.founder.commonutils.ZdryApiEntity.FenceTask;
*/
public
interface
FenceTaskService
extends
IService
<
FenceTask
>
{
List
<
UsersAndOnlineAndTasksVo
>
fenceTaskPeopleList
(
Map
map
);
Integer
fenceTaskPeopleListCount
(
Map
map
);
}
service/zdry/src/main/java/com/founder/zdry/service/impl/FenceTaskServiceImpl.java
View file @
192840e9
package
com
.
founder
.
zdry
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.founder.commonutils.ZdryAndZdryApiVo.UsersAndOnlineAndTasksVo
;
import
com.founder.commonutils.ZdryApiEntity.FenceTask
;
import
com.founder.zdry.mapper.FenceTaskMapper
;
import
com.founder.zdry.service.FenceTaskService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -18,5 +23,16 @@ import org.springframework.stereotype.Service;
*/
@Service
public
class
FenceTaskServiceImpl
extends
ServiceImpl
<
FenceTaskMapper
,
FenceTask
>
implements
FenceTaskService
{
@Autowired
private
FenceTaskMapper
fenceTaskMapper
;
@Override
public
List
<
UsersAndOnlineAndTasksVo
>
fenceTaskPeopleList
(
Map
map
)
{
return
fenceTaskMapper
.
fenceTaskPeopleList
(
map
);
}
@Override
public
Integer
fenceTaskPeopleListCount
(
Map
map
)
{
return
fenceTaskMapper
.
fenceTaskPeopleListCount
(
map
);
}
}
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/controller/ZdryApiController.java
View file @
192840e9
...
...
@@ -87,10 +87,12 @@ public class ZdryApiController {
@ApiParam
(
name
=
"time_end"
,
value
=
"结束时间例下午六点:18:00"
,
required
=
true
)
@RequestParam
(
value
=
"time_end"
)
String
time_end
,
@ApiParam
(
name
=
"safe_area"
,
value
=
"A;B;C;D;A"
,
required
=
true
)
@RequestParam
(
value
=
"safe_area"
)
String
safe_area
@RequestParam
(
value
=
"safe_area"
)
String
safe_area
,
@ApiParam
(
name
=
"gklx"
,
value
=
"1进入区域 2离开区域 3异常预警"
,
required
=
true
)
@RequestParam
(
value
=
"gklx"
)
int
gklx
)
{
return
zdryApiService
.
deviceFenceTask
(
sbImei
,
name
,
time_begin
,
time_end
,
safe_area
);
return
zdryApiService
.
deviceFenceTask
(
sbImei
,
name
,
time_begin
,
time_end
,
safe_area
,
gklx
);
}
@ApiOperation
(
value
=
"电子围栏预警"
)
...
...
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/service/ZdryApiService.java
View file @
192840e9
...
...
@@ -23,7 +23,7 @@ public interface ZdryApiService {
MapRestResult
onlineAndWeardata
();
MapRestResult
deviceFenceTask
(
String
sbImei
,
String
name
,
String
time_begin
,
String
time_end
,
String
safe_area
);
MapRestResult
deviceFenceTask
(
String
sbImei
,
String
name
,
String
time_begin
,
String
time_end
,
String
safe_area
,
int
gklx
);
public
MapRestResult
FenceWarning
();
}
serviceapi/zdryapi/src/main/java/com/founder/zdryapi/service/impl/ZdryApiServiceImpl.java
View file @
192840e9
...
...
@@ -364,7 +364,7 @@ public class ZdryApiServiceImpl implements ZdryApiService {
}
@Override
public
MapRestResult
deviceFenceTask
(
String
sbImei
,
String
name
,
String
time_begin
,
String
time_end
,
String
safe_area
)
{
public
MapRestResult
deviceFenceTask
(
String
sbImei
,
String
name
,
String
time_begin
,
String
time_end
,
String
safe_area
,
int
gklx
)
{
SimpleDateFormat
sf
=
new
SimpleDateFormat
(
"HH"
);
HttpHeaders
headers
=
new
HttpHeaders
();
MediaType
type
=
MediaType
.
parseMediaType
(
"application/x-www-form-urlencoded"
);
...
...
@@ -401,6 +401,7 @@ public class ZdryApiServiceImpl implements ZdryApiService {
fenceTask
.
setSafeArea
(
safe_area
);
fenceTask
.
setSbImei
(
sbImei
);
fenceTask
.
setTaskType
(
"dzwl"
);
fenceTask
.
setGklx
(
gklx
);
// 执行更新
zdryFenceTaskMapper
.
updateById
(
fenceTask
);
...
...
@@ -412,6 +413,7 @@ public class ZdryApiServiceImpl implements ZdryApiService {
fenceTasks
.
setSafeArea
(
safe_area
);
fenceTasks
.
setSbImei
(
sbImei
);
fenceTasks
.
setTaskType
(
"dzwl"
);
fenceTasks
.
setGklx
(
gklx
);
// 插入数据
int
flag
=
zdryFenceTaskMapper
.
insert
(
fenceTasks
);
...
...
@@ -439,6 +441,7 @@ public class ZdryApiServiceImpl implements ZdryApiService {
fenceTask
.
setSafeArea
(
safe_area
);
fenceTask
.
setSbImei
(
sbImei
);
fenceTask
.
setTaskType
(
"dzwl"
);
fenceTask
.
setGklx
(
gklx
);
// 执行更新
zdryFenceTaskMapper
.
updateById
(
fenceTask
);
...
...
@@ -450,6 +453,7 @@ public class ZdryApiServiceImpl implements ZdryApiService {
fenceTasks
.
setSafeArea
(
safe_area
);
fenceTasks
.
setSbImei
(
sbImei
);
fenceTasks
.
setTaskType
(
"dzwl"
);
fenceTasks
.
setGklx
(
gklx
);
// 插入数据
int
flag
=
zdryFenceTaskMapper
.
insert
(
fenceTasks
);
...
...
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