Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skreceive
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
34445ef6
由
张雷
编写于
2022-11-28 21:03:22 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
电子围栏接口修改
1 个父辈
b2e107ad
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
94 行增加
和
27 行删除
src/main/java/com/jkdata/controller/ThirdController.java
src/main/java/com/jkdata/entity/SafeArea.java
src/main/java/com/jkdata/entity/SafeAreaNew.java
src/main/java/com/jkdata/service/IThirdService.java
src/main/java/com/jkdata/service/impl/IThirdServiceImpl.java
src/main/resources/application.yml
src/main/java/com/jkdata/controller/ThirdController.java
查看文件 @
34445ef
...
...
@@ -7,6 +7,7 @@ import com.jkdata.entity.SafeArea;
import
com.jkdata.entity.ThirdPosition
;
import
com.jkdata.service.IThirdService
;
import
com.jkdata.tool.Result
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -24,6 +25,7 @@ public class ThirdController {
@Autowired
private
IThirdService
thirdService
;
@ApiOperation
(
value
=
"接收定位数据"
,
notes
=
"接收定位数据"
)
@PostMapping
(
"/receivePosition"
)
public
Result
<
Map
<
String
,
Object
>>
save
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
Result
<
Map
<
String
,
Object
>>
result
=
new
Result
<
Map
<
String
,
Object
>>();
...
...
@@ -80,6 +82,7 @@ public class ThirdController {
* 获取人员实时定位
* @return
*/
@ApiOperation
(
value
=
"获取人员实时定位"
,
notes
=
"获取人员实时定位"
)
@GetMapping
(
"/realTimeLocation"
)
public
Result
<
ThirdPosition
>
getRealTimeLocation
(
String
deviceId
)
{
Result
<
ThirdPosition
>
result
=
new
Result
<
ThirdPosition
>();
...
...
@@ -93,6 +96,7 @@ public class ThirdController {
* 获取静态资源信息
* @return
*/
@ApiOperation
(
value
=
"获取静态资源信息"
,
notes
=
"获取静态资源信息"
)
@GetMapping
(
"/buildingAllInfo"
)
public
Result
<
JSONObject
>
getBuildingAllInfo
()
{
Result
<
JSONObject
>
result
=
new
Result
<
JSONObject
>();
...
...
@@ -108,6 +112,7 @@ public class ThirdController {
* @param deviceId
* @return
*/
@ApiOperation
(
value
=
"获取历史轨迹"
,
notes
=
"获取历史轨迹"
)
@GetMapping
(
"/positionByDeviceId"
)
public
Result
<
List
<
HistoryPoint
>>
getPositionByDeviceId
(
String
deviceId
,
String
startTime
,
String
endTime
)
{
Result
<
List
<
HistoryPoint
>>
result
=
new
Result
<
List
<
HistoryPoint
>>();
...
...
@@ -121,6 +126,7 @@ public class ThirdController {
* 获取告警信息-最新 n 条
* @return
*/
@ApiOperation
(
value
=
"获取告警信息"
,
notes
=
"获取告警信息"
)
@GetMapping
(
"/alarmListByCount"
)
public
Result
<
Object
>
getAlarmListByCount
()
{
Result
<
Object
>
result
=
new
Result
<
Object
>();
...
...
@@ -135,6 +141,7 @@ public class ThirdController {
* 获取最近7天的告警统计数据
* @return
*/
@ApiOperation
(
value
=
"获取最近7天的告警统计数据"
,
notes
=
"获取最近7天的告警统计数据"
)
@GetMapping
(
"/weekAlarmState"
)
public
Result
<
Object
>
getWeekAlarmState
()
{
Result
<
Object
>
result
=
new
Result
<
Object
>();
...
...
@@ -149,10 +156,11 @@ public class ThirdController {
* 获取安全区域
* @return
*/
@ApiOperation
(
value
=
"获取安全区域"
,
notes
=
"获取安全区域"
)
@GetMapping
(
"/safeArea"
)
public
Result
<
List
<
SafeArea
>>
getSafeArea
()
{
Result
<
List
<
SafeArea
>>
result
=
new
Result
<
List
<
SafeArea
>>();
List
<
SafeArea
>
list
=
thirdService
.
getSafeArea
();
List
<
SafeArea
>
list
=
thirdService
.
getSafeArea
New
();
result
.
setSuccess
(
true
);
result
.
setResult
(
list
);
return
result
;
...
...
src/main/java/com/jkdata/entity/SafeArea.java
查看文件 @
34445ef
...
...
@@ -8,33 +8,21 @@ public class SafeArea {
/**主键*/
private
Integer
id
;
/**设备ID*/
private
String
deviceIds
;
/**区域坐标*/
private
String
areas
;
/**区域名称*/
private
String
name
;
/**区域简介*/
private
String
comment
;
/**构筑物描述*/
private
Integer
threshold
;
/**项目编码*/
private
Integer
buildingId
;
/**楼层编码*/
private
Integer
floorId
;
/**报警类型*/
private
String
alarmType
;
/**创建时间*/
private
String
createTime
;
/** */
private
Integer
isSwitch
;
/** */
private
Integer
areaType
;
/** */
private
Integer
typeId
;
/** */
private
String
startTime
;
/** */
private
String
endTime
;
/**区域简介*/
private
String
mTypeDefine
;
/**状态*/
private
String
isShow
;
/**类型*/
private
Integer
mType
;
/**区域颜色*/
private
String
bgColor
;
}
...
...
src/main/java/com/jkdata/entity/SafeAreaNew.java
0 → 100644
查看文件 @
34445ef
package
com
.
jkdata
.
entity
;
import
lombok.Data
;
@Data
public
class
SafeAreaNew
{
/**主键*/
private
Integer
id
;
/**区域坐标*/
private
String
areas
;
/**区域名称*/
private
String
mName
;
/**区域简介*/
private
String
mTypeDefine
;
/**状态*/
private
String
isShow
;
/**类型*/
private
Integer
mType
;
/**楼层编码*/
private
Integer
floorId
;
/**项目编码*/
private
Integer
buildingId
;
/**区域颜色*/
private
String
bgColor
;
/**创建时间*/
private
String
createTime
;
}
src/main/java/com/jkdata/service/IThirdService.java
查看文件 @
34445ef
...
...
@@ -23,4 +23,6 @@ public interface IThirdService {
ThirdPosition
getRealTimeLocation
(
String
deviceId
);
List
<
SafeArea
>
getSafeArea
();
List
<
SafeArea
>
getSafeAreaNew
();
}
...
...
src/main/java/com/jkdata/service/impl/IThirdServiceImpl.java
查看文件 @
34445ef
...
...
@@ -4,6 +4,7 @@ import cn.hutool.http.HttpUtil;
import
com.alibaba.fastjson.JSONObject
;
import
com.jkdata.entity.HistoryPoint
;
import
com.jkdata.entity.SafeArea
;
import
com.jkdata.entity.SafeAreaNew
;
import
com.jkdata.tool.*
;
import
com.jkdata.entity.ThirdPosition
;
import
com.jkdata.mapper.ThirdMapper
;
...
...
@@ -216,5 +217,44 @@ public class IThirdServiceImpl implements IThirdService {
return
list
;
}
@Override
public
List
<
SafeArea
>
getSafeAreaNew
()
{
List
<
SafeArea
>
list
=
new
ArrayList
<>();
String
get
=
getBuildingAllInfo
();
JSONObject
json
=
JSONObject
.
parseObject
(
get
);
Map
jsonToMap
=
JSONObject
.
parseObject
(
json
.
toJSONString
());
JSONObject
dataJson
=
JSONObject
.
parseObject
(
jsonToMap
.
get
(
"data"
).
toString
());
Map
safeMap
=
JSONObject
.
parseObject
(
dataJson
.
toJSONString
());
List
<
SafeAreaNew
>
dataList
=
JSONObject
.
parseArray
(
safeMap
.
get
(
"monitoringArea"
).
toString
(),
SafeAreaNew
.
class
);
for
(
SafeAreaNew
safeAreaNew
:
dataList
)
{
SafeArea
safeArea
=
new
SafeArea
();
String
areas
=
safeAreaNew
.
getAreas
();
//66&363,100&348,108&367,74&381
List
<
String
>
arealist
=
Arrays
.
asList
(
areas
.
split
(
","
));
StringBuffer
data
=
new
StringBuffer
();
for
(
String
area:
arealist
)
{
String
x1
=
area
.
split
(
"&"
)[
0
];
String
y1
=
area
.
split
(
"&"
)[
1
];
Map
<
String
,
Double
>
map
=
new
HashMap
<>();
//初始化
if
(
safeAreaNew
.
getFloorId
()==
26
){
map
=
CoordinateUtil
.
changCoordinate
(
"B2"
,
x1
,
y1
);
}
else
{
map
=
CoordinateUtil
.
changCoordinate
(
"B1"
,
x1
,
y1
);
}
data
.
append
(
String
.
valueOf
(
map
.
get
(
"x"
))+
"&"
+
String
.
valueOf
(
map
.
get
(
"y"
))).
append
(
","
);
}
safeArea
.
setAreas
(
data
.
toString
().
substring
(
0
,
data
.
toString
().
length
()-
1
));
safeArea
.
setBuildingId
(
safeAreaNew
.
getBuildingId
());
safeArea
.
setId
(
safeAreaNew
.
getId
());
safeArea
.
setName
(
safeAreaNew
.
getMName
());
safeArea
.
setMTypeDefine
(
safeAreaNew
.
getMTypeDefine
());
safeArea
.
setBgColor
(
safeAreaNew
.
getBgColor
());
safeArea
.
setFloorId
(
safeAreaNew
.
getFloorId
());
safeArea
.
setIsShow
(
safeAreaNew
.
getIsShow
());
safeArea
.
setMType
(
safeAreaNew
.
getMType
());
list
.
add
(
safeArea
);
}
return
list
;
}
}
...
...
src/main/resources/application.yml
查看文件 @
34445ef
...
...
@@ -7,12 +7,12 @@ spring:
datasource
:
druid
:
driver-class-name
:
com.mysql.jdbc.Driver
#
url: jdbc:mysql://115.28.25.233:6630/zhsw-bkyh?characterEncoding=UTF-8&useUnicode=true&useSSL=false
#
username: jk_test
#
password: Jk_test1211rw
url
:
jdbc:mysql://127.0.0.1:13306/zhsw-bkyh?characterEncoding=UTF-8&useUnicode=true&useSSL=false
username
:
root
password
:
bkyh925.
url
:
jdbc:mysql://115.28.25.233:6630/zhsw-bkyh?characterEncoding=UTF-8&useUnicode=true&useSSL=false
username
:
jk_test
password
:
Jk_test1211rw
#
url: jdbc:mysql://127.0.0.1:13306/zhsw-bkyh?characterEncoding=UTF-8&useUnicode=true&useSSL=false
#
username: root
#
password: bkyh925.
redis
:
port
:
6379
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论