孪生体增加镜头焦距,增加报警功能
正在显示
16 个修改的文件
包含
98 行增加
和
4 行删除
... | @@ -3,6 +3,7 @@ package com.skua.modules.business.controller; | ... | @@ -3,6 +3,7 @@ package com.skua.modules.business.controller; |
3 | import com.skua.core.api.vo.Result; | 3 | import com.skua.core.api.vo.Result; |
4 | import com.skua.modules.business.service.IOlympicCenterService; | 4 | import com.skua.modules.business.service.IOlympicCenterService; |
5 | import com.skua.modules.business.service.ISynthesizeService; | 5 | import com.skua.modules.business.service.ISynthesizeService; |
6 | import com.skua.modules.business.vo.AlarmParams; | ||
6 | import com.skua.modules.business.vo.EchartResult; | 7 | import com.skua.modules.business.vo.EchartResult; |
7 | import com.skua.modules.business.vo.InputQueryParams; | 8 | import com.skua.modules.business.vo.InputQueryParams; |
8 | import io.swagger.annotations.Api; | 9 | import io.swagger.annotations.Api; |
... | @@ -226,4 +227,15 @@ public class OlympicCenterController { | ... | @@ -226,4 +227,15 @@ public class OlympicCenterController { |
226 | return result; | 227 | return result; |
227 | } | 228 | } |
228 | 229 | ||
230 | @ApiOperation(value="获取实时报警信息", notes="获取实时报警信息") | ||
231 | @GetMapping(value = "/getAlarmList") | ||
232 | public Result<List<Map<String,Object>>> getAlarmList(AlarmParams alarmParams){ | ||
233 | Result<List<Map<String,Object>>> result = new Result<List<Map<String,Object>>>(); | ||
234 | List<Map<String,Object>> list = new ArrayList<>(); | ||
235 | list = olympicCenterService.getAlarmList(alarmParams); | ||
236 | result.setResult(list); | ||
237 | result.setSuccess(true); | ||
238 | return result; | ||
239 | } | ||
240 | |||
229 | } | 241 | } | ... | ... |
1 | package com.skua.modules.business.service; | 1 | package com.skua.modules.business.service; |
2 | 2 | ||
3 | import com.skua.modules.business.vo.AlarmParams; | ||
3 | import com.skua.modules.business.vo.EchartResult; | 4 | import com.skua.modules.business.vo.EchartResult; |
4 | import com.skua.modules.business.vo.InputQueryParams; | 5 | import com.skua.modules.business.vo.InputQueryParams; |
5 | 6 | ||
... | @@ -44,4 +45,6 @@ public interface IOlympicCenterService { | ... | @@ -44,4 +45,6 @@ public interface IOlympicCenterService { |
44 | Map<String, Object> getPumpOrFlowChart(InputQueryParams inputQueryParams); | 45 | Map<String, Object> getPumpOrFlowChart(InputQueryParams inputQueryParams); |
45 | 46 | ||
46 | List<EchartResult> getHistoryTrendsByDate(InputQueryParams inputQueryParams); | 47 | List<EchartResult> getHistoryTrendsByDate(InputQueryParams inputQueryParams); |
48 | |||
49 | List<Map<String, Object>> getAlarmList(AlarmParams alarmParams); | ||
47 | } | 50 | } | ... | ... |
1 | package com.skua.modules.business.service.impl; | 1 | package com.skua.modules.business.service.impl; |
2 | 2 | ||
3 | import com.skua.core.context.SpringContextUtils; | ||
3 | import com.skua.core.service.IFactoryInfoService; | 4 | import com.skua.core.service.IFactoryInfoService; |
4 | import com.skua.modules.business.entity.WhatStructData; | 5 | import com.skua.modules.business.entity.WhatStructData; |
5 | import com.skua.modules.business.mapper.WhatStructDataMapper; | 6 | import com.skua.modules.business.mapper.WhatStructDataMapper; |
6 | import com.skua.modules.business.service.IOlympicCenterService; | 7 | import com.skua.modules.business.service.IOlympicCenterService; |
8 | import com.skua.modules.business.vo.AlarmParams; | ||
7 | import com.skua.modules.business.vo.EchartResult; | 9 | import com.skua.modules.business.vo.EchartResult; |
8 | import com.skua.modules.business.vo.InputQueryParams; | 10 | import com.skua.modules.business.vo.InputQueryParams; |
9 | import com.skua.modules.business.vo.TextResult; | 11 | import com.skua.modules.business.vo.TextResult; |
10 | import com.skua.modules.monitor.service.IFmPgQueryService; | 12 | import com.skua.modules.monitor.service.IFmPgQueryService; |
11 | import lombok.extern.slf4j.Slf4j; | 13 | import lombok.extern.slf4j.Slf4j; |
12 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
15 | import org.springframework.jdbc.core.JdbcTemplate; | ||
13 | import org.springframework.stereotype.Service; | 16 | import org.springframework.stereotype.Service; |
14 | 17 | ||
15 | import java.text.DateFormat; | 18 | import java.text.DateFormat; |
... | @@ -1732,4 +1735,24 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { | ... | @@ -1732,4 +1735,24 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { |
1732 | return Double.parseDouble(str); | 1735 | return Double.parseDouble(str); |
1733 | } | 1736 | } |
1734 | 1737 | ||
1738 | @Override | ||
1739 | public List<Map<String, Object>> getAlarmList(AlarmParams alarmParams) { | ||
1740 | int minute = 1; | ||
1741 | if(alarmParams.getMinute()!=0){ | ||
1742 | minute = alarmParams.getMinute(); | ||
1743 | } | ||
1744 | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
1745 | Date now = new Date(); | ||
1746 | // System.out.println("当前时间为:" + dateFormat.format(now)); | ||
1747 | Date before = new Date(now.getTime() - minute * 60 * 1000); | ||
1748 | // System.out.println("之前的时间为:" + dateFormat.format(before)); | ||
1749 | List<Map<String, Object>> list = new ArrayList<>(); | ||
1750 | JdbcTemplate alarmDB = (JdbcTemplate) SpringContextUtils.getBean("mysql-alarm"); | ||
1751 | list = alarmDB.queryForList("select alarm_content as alarmContent from alert_record_history " + | ||
1752 | " where handle_status = 0 " + | ||
1753 | " and record_time between '"+dateFormat.format(before)+"' and '"+dateFormat.format(now)+"' " + | ||
1754 | " ORDER BY record_time"); | ||
1755 | return list; | ||
1756 | } | ||
1757 | |||
1735 | } | 1758 | } | ... | ... |
... | @@ -101,6 +101,7 @@ public class FmRoamServiceImpl implements IFmRoamService { | ... | @@ -101,6 +101,7 @@ public class FmRoamServiceImpl implements IFmRoamService { |
101 | fmRoamPointVO.setRemark(fmRoamPoint.getRemark()); | 101 | fmRoamPointVO.setRemark(fmRoamPoint.getRemark()); |
102 | fmRoamPointVO.setPointLocation(pointLocation); | 102 | fmRoamPointVO.setPointLocation(pointLocation); |
103 | fmRoamPointVO.setPointRotate(pointRotate); | 103 | fmRoamPointVO.setPointRotate(pointRotate); |
104 | fmRoamPointVO.setCameraFieldOfView(fmRoamPoint.getCameraFieldOfView()); | ||
104 | return fmRoamPointVO; | 105 | return fmRoamPointVO; |
105 | } | 106 | } |
106 | } | 107 | } | ... | ... |
... | @@ -81,4 +81,7 @@ public class FmTwinEquip { | ... | @@ -81,4 +81,7 @@ public class FmTwinEquip { |
81 | @Excel(name = "删除标识", width = 15) | 81 | @Excel(name = "删除标识", width = 15) |
82 | @ApiModelProperty(value = "删除标识") | 82 | @ApiModelProperty(value = "删除标识") |
83 | private java.lang.String delFlag; | 83 | private java.lang.String delFlag; |
84 | /**镜头焦距*/ | ||
85 | @TableField(exist = false) | ||
86 | private java.lang.String cameraFieldOfView; | ||
84 | } | 87 | } | ... | ... |
... | @@ -24,4 +24,7 @@ public interface FmTwinManageMapper extends BaseMapper<FmTwinManage> { | ... | @@ -24,4 +24,7 @@ public interface FmTwinManageMapper extends BaseMapper<FmTwinManage> { |
24 | 24 | ||
25 | List<FmTwinSqlResult> getListNoBound(@Param("projectId") String projectId, | 25 | List<FmTwinSqlResult> getListNoBound(@Param("projectId") String projectId, |
26 | @Param("twinType") String twinType,@Param("twinName") String twinName); | 26 | @Param("twinType") String twinType,@Param("twinName") String twinName); |
27 | |||
28 | void editByTwinId(@Param("twinId") String twinId,@Param("projectId") String projectId, | ||
29 | @Param("cameraFieldOfView") String cameraFieldOfView); | ||
27 | } | 30 | } | ... | ... |
... | @@ -8,6 +8,7 @@ | ... | @@ -8,6 +8,7 @@ |
8 | m.twin_name, | 8 | m.twin_name, |
9 | m.twin_type, | 9 | m.twin_type, |
10 | m.project_id, | 10 | m.project_id, |
11 | m.camera_field_of_view, | ||
11 | e.equip_name, | 12 | e.equip_name, |
12 | e.equip_id, | 13 | e.equip_id, |
13 | e.equip_type, | 14 | e.equip_type, |
... | @@ -22,7 +23,16 @@ | ... | @@ -22,7 +23,16 @@ |
22 | </select> | 23 | </select> |
23 | 24 | ||
24 | <select id="getOneEquipByTwinId" resultType="com.skua.modules.twin.entity.FmTwinEquip"> | 25 | <select id="getOneEquipByTwinId" resultType="com.skua.modules.twin.entity.FmTwinEquip"> |
25 | select * from fm_twin_equip where twin_id = #{twinId} and project_id = #{projectId} limit 1 | 26 | SELECT |
27 | e.*, | ||
28 | m.camera_field_of_view | ||
29 | FROM | ||
30 | fm_twin_equip e | ||
31 | LEFT JOIN fm_twin_manage m ON m.twin_id = e.twin_id | ||
32 | WHERE | ||
33 | e.twin_id = #{twinId} | ||
34 | AND e.project_id = #{projectId} | ||
35 | LIMIT 1 | ||
26 | </select> | 36 | </select> |
27 | 37 | ||
28 | </mapper> | 38 | </mapper> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -87,4 +87,9 @@ | ... | @@ -87,4 +87,9 @@ |
87 | select * from fm_twin_manage where twin_id = #{twinId} and project_id = #{projectId} limit 1 | 87 | select * from fm_twin_manage where twin_id = #{twinId} and project_id = #{projectId} limit 1 |
88 | </select> | 88 | </select> |
89 | 89 | ||
90 | <update id="editByTwinId"> | ||
91 | update fm_twin_manage set camera_field_of_view = #{cameraFieldOfView} | ||
92 | where twin_id = #{twinId} and project_id = #{projectId} | ||
93 | </update> | ||
94 | |||
90 | </mapper> | 95 | </mapper> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -144,6 +144,7 @@ public class FmTwinServiceImpl implements IFmTwinService { | ... | @@ -144,6 +144,7 @@ public class FmTwinServiceImpl implements IFmTwinService { |
144 | twinEquipResultVO.setTwinName(twinEquipSqlResult.getTwinName()); | 144 | twinEquipResultVO.setTwinName(twinEquipSqlResult.getTwinName()); |
145 | twinEquipResultVO.setTwinType(twinEquipSqlResult.getTwinType()); | 145 | twinEquipResultVO.setTwinType(twinEquipSqlResult.getTwinType()); |
146 | twinEquipResultVO.setProjectId(twinEquipSqlResult.getProjectId()); | 146 | twinEquipResultVO.setProjectId(twinEquipSqlResult.getProjectId()); |
147 | twinEquipResultVO.setCameraFieldOfView(twinEquipSqlResult.getCameraFieldOfView()); | ||
147 | EquipEntity twinEquipEntity = new EquipEntity(); | 148 | EquipEntity twinEquipEntity = new EquipEntity(); |
148 | twinEquipEntity.setEquipId(twinEquipSqlResult.getEquipId()); | 149 | twinEquipEntity.setEquipId(twinEquipSqlResult.getEquipId()); |
149 | twinEquipEntity.setEquipName(twinEquipSqlResult.getEquipName()); | 150 | twinEquipEntity.setEquipName(twinEquipSqlResult.getEquipName()); |
... | @@ -180,6 +181,9 @@ public class FmTwinServiceImpl implements IFmTwinService { | ... | @@ -180,6 +181,9 @@ public class FmTwinServiceImpl implements IFmTwinService { |
180 | }else{ | 181 | }else{ |
181 | count = fmTwinEquipMapper.insert(fmTwinEquip); | 182 | count = fmTwinEquipMapper.insert(fmTwinEquip); |
182 | } | 183 | } |
184 | if(fmTwinEquip.getCameraFieldOfView()!=null){ | ||
185 | fmTwinManageMapper.editByTwinId(fmTwinEquip.getTwinId(),fmTwinEquip.getProjectId(),fmTwinEquip.getCameraFieldOfView()); | ||
186 | } | ||
183 | if(count == 1){ | 187 | if(count == 1){ |
184 | return true; | 188 | return true; |
185 | }else{ | 189 | }else{ | ... | ... |
... | @@ -24,6 +24,7 @@ public class FmTwinEquipSqlResult { | ... | @@ -24,6 +24,7 @@ public class FmTwinEquipSqlResult { |
24 | private String equipType; | 24 | private String equipType; |
25 | /**设备音频*/ | 25 | /**设备音频*/ |
26 | private String equipVoice; | 26 | private String equipVoice; |
27 | 27 | /**镜头焦距*/ | |
28 | private String cameraFieldOfView; | ||
28 | 29 | ||
29 | } | 30 | } | ... | ... |
... | @@ -96,6 +96,11 @@ spring: | ... | @@ -96,6 +96,11 @@ spring: |
96 | username: jk_test | 96 | username: jk_test |
97 | password: Jk_test1211rw | 97 | password: Jk_test1211rw |
98 | driver-class-name: com.mysql.jdbc.Driver | 98 | driver-class-name: com.mysql.jdbc.Driver |
99 | mysql-alarm: | ||
100 | url: jdbc:mysql://47.104.99.86:3306/intelligent-devices?characterEncoding=UTF-8&useUnicode=true&useSSL=false | ||
101 | username: id_rw | ||
102 | password: s2eCvUEPO2Vk3U1w | ||
103 | driver-class-name: com.mysql.jdbc.Driver | ||
99 | # 多数据源配置 | 104 | # 多数据源配置 |
100 | pg-db: | 105 | pg-db: |
101 | url: jdbc:postgresql://47.104.99.86:10086/postgres?useUnicode=true&characterEncoding=UTF8 | 106 | url: jdbc:postgresql://47.104.99.86:10086/postgres?useUnicode=true&characterEncoding=UTF8 | ... | ... |
... | @@ -96,6 +96,11 @@ spring: | ... | @@ -96,6 +96,11 @@ spring: |
96 | username: jk_test | 96 | username: jk_test |
97 | password: Jk_test1211rw | 97 | password: Jk_test1211rw |
98 | driver-class-name: com.mysql.jdbc.Driver | 98 | driver-class-name: com.mysql.jdbc.Driver |
99 | mysql-alarm: | ||
100 | url: jdbc:mysql://47.104.99.86:3306/intelligent-devices?characterEncoding=UTF-8&useUnicode=true&useSSL=false | ||
101 | username: id_rw | ||
102 | password: s2eCvUEPO2Vk3U1w | ||
103 | driver-class-name: com.mysql.jdbc.Driver | ||
99 | # 多数据源配置 | 104 | # 多数据源配置 |
100 | pg-db: | 105 | pg-db: |
101 | url: jdbc:postgresql://47.104.99.86:10086/postgres?useUnicode=true&characterEncoding=UTF8 | 106 | url: jdbc:postgresql://47.104.99.86:10086/postgres?useUnicode=true&characterEncoding=UTF8 | ... | ... |
... | @@ -96,6 +96,11 @@ spring: | ... | @@ -96,6 +96,11 @@ spring: |
96 | username: root | 96 | username: root |
97 | password: jkauto@123wh | 97 | password: jkauto@123wh |
98 | driver-class-name: com.mysql.jdbc.Driver | 98 | driver-class-name: com.mysql.jdbc.Driver |
99 | mysql-alarm: | ||
100 | url: jdbc:mysql://192.168.21.6:13306/zhsw_modules?characterEncoding=UTF-8&useUnicode=true&useSSL=false | ||
101 | username: root | ||
102 | password: jkauto@123wh | ||
103 | driver-class-name: com.mysql.jdbc.Driver | ||
99 | # 多数据源配置 | 104 | # 多数据源配置 |
100 | pg-db: | 105 | pg-db: |
101 | url: jdbc:postgresql://192.168.21.5:10086/postgres?useUnicode=true&characterEncoding=UTF8 | 106 | url: jdbc:postgresql://192.168.21.5:10086/postgres?useUnicode=true&characterEncoding=UTF8 | ... | ... |
... | @@ -96,6 +96,11 @@ spring: | ... | @@ -96,6 +96,11 @@ spring: |
96 | username: root | 96 | username: root |
97 | password: jkauto@123yw | 97 | password: jkauto@123yw |
98 | driver-class-name: com.mysql.jdbc.Driver | 98 | driver-class-name: com.mysql.jdbc.Driver |
99 | mysql-alarm: | ||
100 | url: jdbc:mysql://10.0.210.112:13306/zhsw_modules?characterEncoding=UTF-8&useUnicode=true&useSSL=false | ||
101 | username: root | ||
102 | password: jkauto@123yw | ||
103 | driver-class-name: com.mysql.jdbc.Driver | ||
99 | # 多数据源配置 | 104 | # 多数据源配置 |
100 | pg-db: | 105 | pg-db: |
101 | url: jdbc:postgresql://10.0.210.111:10086/postgres?useUnicode=true&characterEncoding=UTF8 | 106 | url: jdbc:postgresql://10.0.210.111:10086/postgres?useUnicode=true&characterEncoding=UTF8 | ... | ... |
1 | spring: | 1 | spring: |
2 | profiles: | 2 | profiles: |
3 | active: dev | 3 | active: prod |
4 | # 信息安全 | 4 | # 信息安全 |
5 | security: | 5 | security: |
6 | csrf: | 6 | csrf: |
... | @@ -11,6 +11,6 @@ swagger: | ... | @@ -11,6 +11,6 @@ swagger: |
11 | production: false | 11 | production: false |
12 | basic: | 12 | basic: |
13 | #是否开启swagger登陆鉴权配置,true开启,false停止 | 13 | #是否开启swagger登陆鉴权配置,true开启,false停止 |
14 | enable: false | 14 | enable: true |
15 | username: admin | 15 | username: admin |
16 | password: 1qaz@WS | 16 | password: 1qaz@WS | ... | ... |
-
请 注册 或 登录 后发表评论