Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
fmboot
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
a6407388
由
张雷
编写于
2023-06-26 16:21:13 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
孪生体增加镜头焦距,增加报警功能
1 个父辈
de1cbf78
显示空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
98 行增加
和
4 行删除
fm-product/src/main/java/com/skua/modules/business/controller/OlympicCenterController.java
fm-product/src/main/java/com/skua/modules/business/service/IOlympicCenterService.java
fm-product/src/main/java/com/skua/modules/business/service/impl/OlympicCenterServiceImpl.java
fm-product/src/main/java/com/skua/modules/business/vo/AlarmParams.java
fm-product/src/main/java/com/skua/modules/roam/service/impl/FmRoamServiceImpl.java
fm-product/src/main/java/com/skua/modules/twin/entity/FmTwinEquip.java
fm-product/src/main/java/com/skua/modules/twin/mapper/FmTwinManageMapper.java
fm-product/src/main/java/com/skua/modules/twin/mapper/xml/FmTwinEquipMapper.xml
fm-product/src/main/java/com/skua/modules/twin/mapper/xml/FmTwinManageMapper.xml
fm-product/src/main/java/com/skua/modules/twin/service/impl/FmTwinServiceImpl.java
fm-product/src/main/java/com/skua/modules/twin/vo/FmTwinEquipSqlResult.java
fm-system/src/main/resources/application-dev.yml
fm-system/src/main/resources/application-prod.yml
fm-system/src/main/resources/application-what.yml
fm-system/src/main/resources/application-yw.yml
fm-system/src/main/resources/application.yml
fm-product/src/main/java/com/skua/modules/business/controller/OlympicCenterController.java
查看文件 @
a640738
...
...
@@ -3,6 +3,7 @@ package com.skua.modules.business.controller;
import
com.skua.core.api.vo.Result
;
import
com.skua.modules.business.service.IOlympicCenterService
;
import
com.skua.modules.business.service.ISynthesizeService
;
import
com.skua.modules.business.vo.AlarmParams
;
import
com.skua.modules.business.vo.EchartResult
;
import
com.skua.modules.business.vo.InputQueryParams
;
import
io.swagger.annotations.Api
;
...
...
@@ -226,4 +227,15 @@ public class OlympicCenterController {
return
result
;
}
@ApiOperation
(
value
=
"获取实时报警信息"
,
notes
=
"获取实时报警信息"
)
@GetMapping
(
value
=
"/getAlarmList"
)
public
Result
<
List
<
Map
<
String
,
Object
>>>
getAlarmList
(
AlarmParams
alarmParams
){
Result
<
List
<
Map
<
String
,
Object
>>>
result
=
new
Result
<
List
<
Map
<
String
,
Object
>>>();
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
list
=
olympicCenterService
.
getAlarmList
(
alarmParams
);
result
.
setResult
(
list
);
result
.
setSuccess
(
true
);
return
result
;
}
}
...
...
fm-product/src/main/java/com/skua/modules/business/service/IOlympicCenterService.java
查看文件 @
a640738
package
com
.
skua
.
modules
.
business
.
service
;
import
com.skua.modules.business.vo.AlarmParams
;
import
com.skua.modules.business.vo.EchartResult
;
import
com.skua.modules.business.vo.InputQueryParams
;
...
...
@@ -44,4 +45,6 @@ public interface IOlympicCenterService {
Map
<
String
,
Object
>
getPumpOrFlowChart
(
InputQueryParams
inputQueryParams
);
List
<
EchartResult
>
getHistoryTrendsByDate
(
InputQueryParams
inputQueryParams
);
List
<
Map
<
String
,
Object
>>
getAlarmList
(
AlarmParams
alarmParams
);
}
...
...
fm-product/src/main/java/com/skua/modules/business/service/impl/OlympicCenterServiceImpl.java
查看文件 @
a640738
package
com
.
skua
.
modules
.
business
.
service
.
impl
;
import
com.skua.core.context.SpringContextUtils
;
import
com.skua.core.service.IFactoryInfoService
;
import
com.skua.modules.business.entity.WhatStructData
;
import
com.skua.modules.business.mapper.WhatStructDataMapper
;
import
com.skua.modules.business.service.IOlympicCenterService
;
import
com.skua.modules.business.vo.AlarmParams
;
import
com.skua.modules.business.vo.EchartResult
;
import
com.skua.modules.business.vo.InputQueryParams
;
import
com.skua.modules.business.vo.TextResult
;
import
com.skua.modules.monitor.service.IFmPgQueryService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.stereotype.Service
;
import
java.text.DateFormat
;
...
...
@@ -1732,4 +1735,24 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
return
Double
.
parseDouble
(
str
);
}
@Override
public
List
<
Map
<
String
,
Object
>>
getAlarmList
(
AlarmParams
alarmParams
)
{
int
minute
=
1
;
if
(
alarmParams
.
getMinute
()!=
0
){
minute
=
alarmParams
.
getMinute
();
}
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Date
now
=
new
Date
();
// System.out.println("当前时间为:" + dateFormat.format(now));
Date
before
=
new
Date
(
now
.
getTime
()
-
minute
*
60
*
1000
);
// System.out.println("之前的时间为:" + dateFormat.format(before));
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
JdbcTemplate
alarmDB
=
(
JdbcTemplate
)
SpringContextUtils
.
getBean
(
"mysql-alarm"
);
list
=
alarmDB
.
queryForList
(
"select alarm_content as alarmContent from alert_record_history "
+
" where handle_status = 0 "
+
" and record_time between '"
+
dateFormat
.
format
(
before
)+
"' and '"
+
dateFormat
.
format
(
now
)+
"' "
+
" ORDER BY record_time"
);
return
list
;
}
}
...
...
fm-product/src/main/java/com/skua/modules/business/vo/AlarmParams.java
0 → 100644
查看文件 @
a640738
package
com
.
skua
.
modules
.
business
.
vo
;
import
lombok.Data
;
@Data
public
class
AlarmParams
{
private
int
minute
;
}
fm-product/src/main/java/com/skua/modules/roam/service/impl/FmRoamServiceImpl.java
查看文件 @
a640738
...
...
@@ -101,6 +101,7 @@ public class FmRoamServiceImpl implements IFmRoamService {
fmRoamPointVO
.
setRemark
(
fmRoamPoint
.
getRemark
());
fmRoamPointVO
.
setPointLocation
(
pointLocation
);
fmRoamPointVO
.
setPointRotate
(
pointRotate
);
fmRoamPointVO
.
setCameraFieldOfView
(
fmRoamPoint
.
getCameraFieldOfView
());
return
fmRoamPointVO
;
}
}
...
...
fm-product/src/main/java/com/skua/modules/twin/entity/FmTwinEquip.java
查看文件 @
a640738
...
...
@@ -81,4 +81,7 @@ public class FmTwinEquip {
@Excel
(
name
=
"删除标识"
,
width
=
15
)
@ApiModelProperty
(
value
=
"删除标识"
)
private
java
.
lang
.
String
delFlag
;
/**镜头焦距*/
@TableField
(
exist
=
false
)
private
java
.
lang
.
String
cameraFieldOfView
;
}
...
...
fm-product/src/main/java/com/skua/modules/twin/mapper/FmTwinManageMapper.java
查看文件 @
a640738
...
...
@@ -24,4 +24,7 @@ public interface FmTwinManageMapper extends BaseMapper<FmTwinManage> {
List
<
FmTwinSqlResult
>
getListNoBound
(
@Param
(
"projectId"
)
String
projectId
,
@Param
(
"twinType"
)
String
twinType
,
@Param
(
"twinName"
)
String
twinName
);
void
editByTwinId
(
@Param
(
"twinId"
)
String
twinId
,
@Param
(
"projectId"
)
String
projectId
,
@Param
(
"cameraFieldOfView"
)
String
cameraFieldOfView
);
}
...
...
fm-product/src/main/java/com/skua/modules/twin/mapper/xml/FmTwinEquipMapper.xml
查看文件 @
a640738
...
...
@@ -8,6 +8,7 @@
m.twin_name,
m.twin_type,
m.project_id,
m.camera_field_of_view,
e.equip_name,
e.equip_id,
e.equip_type,
...
...
@@ -22,7 +23,16 @@
</select>
<select
id=
"getOneEquipByTwinId"
resultType=
"com.skua.modules.twin.entity.FmTwinEquip"
>
select * from fm_twin_equip where twin_id = #{twinId} and project_id = #{projectId} limit 1
SELECT
e.*,
m.camera_field_of_view
FROM
fm_twin_equip e
LEFT JOIN fm_twin_manage m ON m.twin_id = e.twin_id
WHERE
e.twin_id = #{twinId}
AND e.project_id = #{projectId}
LIMIT 1
</select>
</mapper>
\ No newline at end of file
...
...
fm-product/src/main/java/com/skua/modules/twin/mapper/xml/FmTwinManageMapper.xml
查看文件 @
a640738
...
...
@@ -87,4 +87,9 @@
select * from fm_twin_manage where twin_id = #{twinId} and project_id = #{projectId} limit 1
</select>
<update
id=
"editByTwinId"
>
update fm_twin_manage set camera_field_of_view = #{cameraFieldOfView}
where twin_id = #{twinId} and project_id = #{projectId}
</update>
</mapper>
\ No newline at end of file
...
...
fm-product/src/main/java/com/skua/modules/twin/service/impl/FmTwinServiceImpl.java
查看文件 @
a640738
...
...
@@ -144,6 +144,7 @@ public class FmTwinServiceImpl implements IFmTwinService {
twinEquipResultVO
.
setTwinName
(
twinEquipSqlResult
.
getTwinName
());
twinEquipResultVO
.
setTwinType
(
twinEquipSqlResult
.
getTwinType
());
twinEquipResultVO
.
setProjectId
(
twinEquipSqlResult
.
getProjectId
());
twinEquipResultVO
.
setCameraFieldOfView
(
twinEquipSqlResult
.
getCameraFieldOfView
());
EquipEntity
twinEquipEntity
=
new
EquipEntity
();
twinEquipEntity
.
setEquipId
(
twinEquipSqlResult
.
getEquipId
());
twinEquipEntity
.
setEquipName
(
twinEquipSqlResult
.
getEquipName
());
...
...
@@ -180,6 +181,9 @@ public class FmTwinServiceImpl implements IFmTwinService {
}
else
{
count
=
fmTwinEquipMapper
.
insert
(
fmTwinEquip
);
}
if
(
fmTwinEquip
.
getCameraFieldOfView
()!=
null
){
fmTwinManageMapper
.
editByTwinId
(
fmTwinEquip
.
getTwinId
(),
fmTwinEquip
.
getProjectId
(),
fmTwinEquip
.
getCameraFieldOfView
());
}
if
(
count
==
1
){
return
true
;
}
else
{
...
...
fm-product/src/main/java/com/skua/modules/twin/vo/FmTwinEquipSqlResult.java
查看文件 @
a640738
...
...
@@ -24,6 +24,7 @@ public class FmTwinEquipSqlResult {
private
String
equipType
;
/**设备音频*/
private
String
equipVoice
;
/**镜头焦距*/
private
String
cameraFieldOfView
;
}
...
...
fm-system/src/main/resources/application-dev.yml
查看文件 @
a640738
...
...
@@ -96,6 +96,11 @@ spring:
username
:
jk_test
password
:
Jk_test1211rw
driver-class-name
:
com.mysql.jdbc.Driver
mysql-alarm
:
url
:
jdbc:mysql://47.104.99.86:3306/intelligent-devices?characterEncoding=UTF-8&useUnicode=true&useSSL=false
username
:
id_rw
password
:
s2eCvUEPO2Vk3U1w
driver-class-name
:
com.mysql.jdbc.Driver
# 多数据源配置
pg-db
:
url
:
jdbc:postgresql://47.104.99.86:10086/postgres?useUnicode=true&characterEncoding=UTF8
...
...
fm-system/src/main/resources/application-prod.yml
查看文件 @
a640738
...
...
@@ -96,6 +96,11 @@ spring:
username
:
jk_test
password
:
Jk_test1211rw
driver-class-name
:
com.mysql.jdbc.Driver
mysql-alarm
:
url
:
jdbc:mysql://47.104.99.86:3306/intelligent-devices?characterEncoding=UTF-8&useUnicode=true&useSSL=false
username
:
id_rw
password
:
s2eCvUEPO2Vk3U1w
driver-class-name
:
com.mysql.jdbc.Driver
# 多数据源配置
pg-db
:
url
:
jdbc:postgresql://47.104.99.86:10086/postgres?useUnicode=true&characterEncoding=UTF8
...
...
fm-system/src/main/resources/application-what.yml
查看文件 @
a640738
...
...
@@ -96,6 +96,11 @@ spring:
username
:
root
password
:
jkauto@123wh
driver-class-name
:
com.mysql.jdbc.Driver
mysql-alarm
:
url
:
jdbc:mysql://192.168.21.6:13306/zhsw_modules?characterEncoding=UTF-8&useUnicode=true&useSSL=false
username
:
root
password
:
jkauto@123wh
driver-class-name
:
com.mysql.jdbc.Driver
# 多数据源配置
pg-db
:
url
:
jdbc:postgresql://192.168.21.5:10086/postgres?useUnicode=true&characterEncoding=UTF8
...
...
fm-system/src/main/resources/application-yw.yml
查看文件 @
a640738
...
...
@@ -96,6 +96,11 @@ spring:
username
:
root
password
:
jkauto@123yw
driver-class-name
:
com.mysql.jdbc.Driver
mysql-alarm
:
url
:
jdbc:mysql://10.0.210.112:13306/zhsw_modules?characterEncoding=UTF-8&useUnicode=true&useSSL=false
username
:
root
password
:
jkauto@123yw
driver-class-name
:
com.mysql.jdbc.Driver
# 多数据源配置
pg-db
:
url
:
jdbc:postgresql://10.0.210.111:10086/postgres?useUnicode=true&characterEncoding=UTF8
...
...
fm-system/src/main/resources/application.yml
查看文件 @
a640738
spring
:
profiles
:
active
:
dev
active
:
prod
# 信息安全
security
:
csrf
:
...
...
@@ -11,6 +11,6 @@ swagger:
production
:
false
basic
:
#是否开启swagger登陆鉴权配置,true开启,false停止
enable
:
fals
e
enable
:
tru
e
username
:
admin
password
:
1qaz@WS
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论