Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-miniappserver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 09d13cde
authored
Jul 08, 2022
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新增围栏
1 parent
35dd2efa
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
184 additions
and
0 deletions
src/main/java/cn/com/glsx/app/modules/controller/ElectricFenceController.java
src/main/java/cn/com/glsx/app/modules/model/param/ElectricFenceBO.java
src/main/java/cn/com/glsx/app/modules/service/ElectricFenceService.java
src/test/java/cn/com/glsx/app/modules/MainTest.java
src/main/java/cn/com/glsx/app/modules/controller/ElectricFenceController.java
0 → 100644
View file @
09d13cd
package
cn
.
com
.
glsx
.
app
.
modules
.
controller
;
import
cn.com.glsx.app.modules.model.param.ElectricFenceBO
;
import
cn.com.glsx.app.modules.service.ElectricFenceService
;
import
com.glsx.plat.common.annotation.NoResubmit
;
import
com.glsx.plat.common.annotation.SysLog
;
import
com.glsx.plat.common.enums.OperateType
;
import
com.glsx.plat.core.web.R
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@Slf4j
@RestController
@RequestMapping
(
value
=
"/fence"
)
@Api
(
value
=
"电子围栏"
,
tags
=
{
"电子围栏"
})
public
class
ElectricFenceController
{
private
final
static
String
MODULE
=
"围栏管理"
;
@Autowired
private
ElectricFenceService
electricFenceService
;
/**
* 新增围栏
*
* @param fenceBO
* @return
*/
@NoResubmit
@SysLog
(
module
=
MODULE
,
value
=
"新增围栏"
,
action
=
OperateType
.
ADD
)
@PostMapping
(
value
=
"/add"
)
@ApiOperation
(
value
=
"新增围栏"
)
public
R
add
(
@RequestBody
@Validated
ElectricFenceBO
fenceBO
)
{
electricFenceService
.
add
(
fenceBO
);
return
R
.
ok
();
}
}
src/main/java/cn/com/glsx/app/modules/model/param/ElectricFenceBO.java
0 → 100644
View file @
09d13cd
package
cn
.
com
.
glsx
.
app
.
modules
.
model
.
param
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
/**
* 电子栅栏bo
*
* @author liuyf
*/
@Data
public
class
ElectricFenceBO
{
/**
* 围栏名称
*/
@NotBlank
(
message
=
"围栏名称不能为空"
)
private
String
fenceName
;
/**
* 业务围栏类型 0警情围栏,1试驾围栏
*/
private
Integer
bizFenceType
;
/**
* 围栏形状类型 1.圆形(默认) 2.矩形 3.多边形 4.行政区域
*/
@NotNull
(
message
=
"区域类型不能为空"
)
private
Integer
shapeType
;
/**
* 半径(米)
*/
private
Integer
radius
;
/**
* 经纬度坐标(行政区域形状围栏大数据侧按行政区域编码来控制)
*/
//@NotBlank(message = "经纬度不能为空")
private
String
lnglat
;
/**
* 解析地址
*/
private
String
analysisAddress
;
/**
* 监控类型 1驶入,2驶出,3:驶入驶出报警
*/
private
Integer
triggerType
;
/**
* 时间周期 1:永久 2:指定区间
*/
private
Integer
timeType
;
/**
* 起始日期
*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd"
)
private
Date
startTime
;
/**
* 关闭日期
*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd"
)
private
Date
endTime
;
/**
* 启用状态:0关闭;1开启
*/
private
Integer
enableStatus
;
/**
* 描述(备注)
*/
private
String
remark
;
/**
* 行政区域代码
*/
private
String
areaCode
;
/**
* 行政区域
*/
private
String
areaText
;
/**
* 通知对象的电话号码,多个电话号码用逗号分隔
*/
private
String
telNumbers
;
}
src/main/java/cn/com/glsx/app/modules/service/ElectricFenceService.java
0 → 100644
View file @
09d13cd
package
cn
.
com
.
glsx
.
app
.
modules
.
service
;
import
cn.com.glsx.app.modules.model.param.ElectricFenceBO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
@Slf4j
@Service
public
class
ElectricFenceService
{
public
void
add
(
ElectricFenceBO
fenceBO
)
{
// TODO: 2022/7/8
}
}
src/test/java/cn/com/glsx/app/modules/MainTest.java
0 → 100644
View file @
09d13cd
package
cn
.
com
.
glsx
.
app
.
modules
;
import
com.glsx.plat.common.utils.DateUtils
;
import
org.joda.time.Days
;
import
org.joda.time.Minutes
;
import
org.joda.time.Months
;
import
org.joda.time.Weeks
;
public
class
MainTest
{
public
static
void
main
(
String
[]
args
)
{
org
.
joda
.
time
.
LocalDateTime
beginTime
=
new
org
.
joda
.
time
.
LocalDateTime
(
DateUtils
.
parse
(
"2022-07-08 15:31:01"
));
org
.
joda
.
time
.
LocalDateTime
endTime
=
new
org
.
joda
.
time
.
LocalDateTime
(
DateUtils
.
parse
(
"2022-07-08 15:22:28"
));
int
days
=
Days
.
daysBetween
(
beginTime
,
endTime
).
getDays
();
int
weeks
=
Weeks
.
weeksBetween
(
beginTime
,
endTime
).
getWeeks
();
int
months
=
Months
.
monthsBetween
(
beginTime
,
endTime
).
getMonths
();
int
minutes
=
Minutes
.
minutesBetween
(
beginTime
,
endTime
).
getMinutes
();
System
.
out
.
println
(
days
);
System
.
out
.
println
(
weeks
);
System
.
out
.
println
(
months
);
System
.
out
.
println
(
minutes
);
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment