Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c2139b0b
authored
Sep 13, 2023
by
朱淼
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'dev' of
http://git.xmmakeit.com/huangjiay/iot-platform-server
into dev
parents
098afb54
c9e35017
Show whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
215 additions
and
80 deletions
saas-module/src/main/java/com/makeit/controller/analysis/SaasDiseaseEvaluateReportController.java
saas-module/src/main/java/com/makeit/controller/analysis/SaasDiseaseModelController.java
saas-module/src/main/java/com/makeit/controller/analysis/SaasElderReportConfigController.java
saas-module/src/main/java/com/makeit/controller/analysis/SaasModelManageController.java
saas-module/src/main/java/com/makeit/controller/analysis/SaasReportManageController.java
saas-module/src/main/java/com/makeit/controller/analysis/SaasSleepAnalysisModelController.java
saas-module/src/main/java/com/makeit/controller/analysis/SaasSleepEvaluateReportController.java
saas-module/src/main/java/com/makeit/controller/analysis/SaasSleepEvaluateStandardReportController.java
server-api/server-api.iml
server-common/src/main/java/com/makeit/common/vo/ExcelErrorVo.java
server-common/src/main/java/com/makeit/module/iot/service/IotProductDeviceService.java
server-common/src/main/java/com/makeit/module/iot/vo/DeviceInfo.java
server-module/src/main/java/com/makeit/module/controller/space/PlatBedController.java
server-module/src/main/java/com/makeit/module/controller/wechat/alarm/ChildrenAlarmRecordController.java → server-module/src/main/java/com/makeit/module/controller/wechat/alarm/PlatAlarmRecordChildrenController.java
server-module/src/main/java/com/makeit/module/controller/wechat/alarm/WechatPlatAlarmRecordController.java → server-module/src/main/java/com/makeit/module/controller/wechat/alarm/PlatAlarmRecordWechatController.java
server-service/src/main/java/com/makeit/dto/platform/auth/PlatUserImportDTO.java
server-service/src/main/java/com/makeit/entity/platform/auth/PlatOrg.java
server-service/src/main/java/com/makeit/enums/platform/device/PlatDeviceEnum.java
server-service/src/main/java/com/makeit/service/platform/alarm/PlatAlarmRecordService.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/BehaviorAlarm.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/BreathAlarm.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/FallAlarm.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/HeartAlarm.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/IAlarm.java
server-service/src/main/java/com/makeit/service/platform/alarm/impl/PlatAlarmRecordServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatOrgServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatUserServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRoomBedDeviceServiceImpl.java
server-service/src/main/java/com/makeit/utils/AlarmConfigCacheUtil.java
server-web/src/main/java/com/makeit/mqtt/PushCallback.java
server-web/src/test/java/com/makeit/iotapi/IotTest.java
saas-module/src/main/java/com/makeit/controller/analysis/SaasDiseaseEvaluateReportController.java
View file @
c2139b0b
...
@@ -10,6 +10,7 @@ import com.makeit.entity.saas.analysis.SaasSleepEvaluateReport;
...
@@ -10,6 +10,7 @@ import com.makeit.entity.saas.analysis.SaasSleepEvaluateReport;
import
com.makeit.global.annotation.Action
;
import
com.makeit.global.annotation.Action
;
import
com.makeit.service.saas.SaasDiseaseEvaluateReportService
;
import
com.makeit.service.saas.SaasDiseaseEvaluateReportService
;
import
com.makeit.service.saas.SaasSleepEvaluateReportService
;
import
com.makeit.service.saas.SaasSleepEvaluateReportService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
...
@@ -28,6 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -28,6 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
*/
@RestController
@RestController
@RequestMapping
(
"/saas/diseaseEvaluateReport"
)
@RequestMapping
(
"/saas/diseaseEvaluateReport"
)
@Api
(
tags
=
"saas端-报告管理"
)
public
class
SaasDiseaseEvaluateReportController
{
public
class
SaasDiseaseEvaluateReportController
{
...
...
saas-module/src/main/java/com/makeit/controller/analysis/SaasDiseaseModelController.java
View file @
c2139b0b
...
@@ -8,6 +8,7 @@ import com.makeit.dto.saas.analysis.SaasDiseaseModelDTO;
...
@@ -8,6 +8,7 @@ import com.makeit.dto.saas.analysis.SaasDiseaseModelDTO;
import
com.makeit.entity.saas.analysis.SaasDiseaseModel
;
import
com.makeit.entity.saas.analysis.SaasDiseaseModel
;
import
com.makeit.global.annotation.Action
;
import
com.makeit.global.annotation.Action
;
import
com.makeit.service.saas.SaasDiseaseModelService
;
import
com.makeit.service.saas.SaasDiseaseModelService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
...
@@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
*/
@RestController
@RestController
@RequestMapping
(
"/saas/diseaseModel"
)
@RequestMapping
(
"/saas/diseaseModel"
)
@Api
(
tags
=
"saas端-模型管理"
)
public
class
SaasDiseaseModelController
{
public
class
SaasDiseaseModelController
{
...
...
saas-module/src/main/java/com/makeit/controller/analysis/SaasElderReportConfigController.java
View file @
c2139b0b
...
@@ -8,6 +8,7 @@ import com.makeit.dto.saas.analysis.SaasElderReportConfigDTO;
...
@@ -8,6 +8,7 @@ import com.makeit.dto.saas.analysis.SaasElderReportConfigDTO;
import
com.makeit.entity.saas.analysis.SaasElderReportConfig
;
import
com.makeit.entity.saas.analysis.SaasElderReportConfig
;
import
com.makeit.global.annotation.Action
;
import
com.makeit.global.annotation.Action
;
import
com.makeit.service.saas.SaasElderReportConfigService
;
import
com.makeit.service.saas.SaasElderReportConfigService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
...
@@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
*/
@RestController
@RestController
@RequestMapping
(
"/saas/elderReportConfig"
)
@RequestMapping
(
"/saas/elderReportConfig"
)
@Api
(
tags
=
"saas端-报告管理"
)
public
class
SaasElderReportConfigController
{
public
class
SaasElderReportConfigController
{
@Autowired
@Autowired
private
SaasElderReportConfigService
saasElderReportConfigService
;
private
SaasElderReportConfigService
saasElderReportConfigService
;
...
...
saas-module/src/main/java/com/makeit/controller/analysis/SaasModelManageController.java
View file @
c2139b0b
...
@@ -9,6 +9,7 @@ import com.makeit.entity.saas.analysis.SaasModelManage;
...
@@ -9,6 +9,7 @@ import com.makeit.entity.saas.analysis.SaasModelManage;
import
com.makeit.global.annotation.Action
;
import
com.makeit.global.annotation.Action
;
import
com.makeit.module.admin.vo.plat.PlatTenantVO
;
import
com.makeit.module.admin.vo.plat.PlatTenantVO
;
import
com.makeit.service.saas.SaasModelManageService
;
import
com.makeit.service.saas.SaasModelManageService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
@@ -28,13 +29,14 @@ import java.util.List;
...
@@ -28,13 +29,14 @@ import java.util.List;
*/
*/
@RestController
@RestController
@RequestMapping
(
"/saas/modelManage"
)
@RequestMapping
(
"/saas/modelManage"
)
@Api
(
tags
=
"saas端-报告管理"
)
public
class
SaasModelManageController
{
public
class
SaasModelManageController
{
@Autowired
@Autowired
private
SaasModelManageService
saasModelManageService
;
private
SaasModelManageService
saasModelManageService
;
@Action
(
module
=
"
租户管理-租户
"
,
name
=
"分页列表"
,
code
=
"saas:modelManage:page"
)
@Action
(
module
=
"
数据分析-模型管理
"
,
name
=
"分页列表"
,
code
=
"saas:modelManage:page"
)
@ApiOperation
(
"分页列表"
)
@ApiOperation
(
"分页列表"
)
@PostMapping
(
"list"
)
@PostMapping
(
"list"
)
public
ApiResponseEntity
<
List
<
SaasModelManage
>>
list
(){
public
ApiResponseEntity
<
List
<
SaasModelManage
>>
list
(){
...
...
saas-module/src/main/java/com/makeit/controller/analysis/SaasReportManageController.java
View file @
c2139b0b
...
@@ -8,6 +8,7 @@ import com.makeit.entity.saas.analysis.SaasReportManage;
...
@@ -8,6 +8,7 @@ import com.makeit.entity.saas.analysis.SaasReportManage;
import
com.makeit.global.annotation.Action
;
import
com.makeit.global.annotation.Action
;
import
com.makeit.service.saas.SaasModelManageService
;
import
com.makeit.service.saas.SaasModelManageService
;
import
com.makeit.service.saas.SaasReportManageService
;
import
com.makeit.service.saas.SaasReportManageService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
@@ -26,13 +27,14 @@ import java.util.List;
...
@@ -26,13 +27,14 @@ import java.util.List;
*/
*/
@RestController
@RestController
@RequestMapping
(
"/saas/reportManage"
)
@RequestMapping
(
"/saas/reportManage"
)
@Api
(
tags
=
"saas端-报告管理"
)
public
class
SaasReportManageController
{
public
class
SaasReportManageController
{
@Autowired
@Autowired
private
SaasReportManageService
saasReportManageService
;
private
SaasReportManageService
saasReportManageService
;
@Action
(
module
=
"
租户管理-租户
"
,
name
=
"分页列表"
,
code
=
"saas:reportManage:page"
)
@Action
(
module
=
"
数据分析-报告管理
"
,
name
=
"分页列表"
,
code
=
"saas:reportManage:page"
)
@ApiOperation
(
"分页列表"
)
@ApiOperation
(
"分页列表"
)
@PostMapping
(
"list"
)
@PostMapping
(
"list"
)
public
ApiResponseEntity
<
List
<
SaasReportManage
>>
list
(){
public
ApiResponseEntity
<
List
<
SaasReportManage
>>
list
(){
...
...
saas-module/src/main/java/com/makeit/controller/analysis/SaasSleepAnalysisModelController.java
View file @
c2139b0b
...
@@ -9,6 +9,7 @@ import com.makeit.entity.saas.analysis.SaasSleepAnalysisModel;
...
@@ -9,6 +9,7 @@ import com.makeit.entity.saas.analysis.SaasSleepAnalysisModel;
import
com.makeit.global.annotation.Action
;
import
com.makeit.global.annotation.Action
;
import
com.makeit.module.admin.dto.plat.PlatTenantDTOVO
;
import
com.makeit.module.admin.dto.plat.PlatTenantDTOVO
;
import
com.makeit.service.saas.SaasSleepAnalysisModelService
;
import
com.makeit.service.saas.SaasSleepAnalysisModelService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
...
@@ -27,6 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -27,6 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
*/
@RestController
@RestController
@RequestMapping
(
"/saas/sleepAnalysisModel"
)
@RequestMapping
(
"/saas/sleepAnalysisModel"
)
@Api
(
tags
=
"saas端-模型管理"
)
public
class
SaasSleepAnalysisModelController
{
public
class
SaasSleepAnalysisModelController
{
@Autowired
@Autowired
...
...
saas-module/src/main/java/com/makeit/controller/analysis/SaasSleepEvaluateReportController.java
View file @
c2139b0b
...
@@ -8,6 +8,7 @@ import com.makeit.dto.saas.analysis.SaasSleepEvaluateReportDTO;
...
@@ -8,6 +8,7 @@ import com.makeit.dto.saas.analysis.SaasSleepEvaluateReportDTO;
import
com.makeit.entity.saas.analysis.SaasSleepEvaluateReport
;
import
com.makeit.entity.saas.analysis.SaasSleepEvaluateReport
;
import
com.makeit.global.annotation.Action
;
import
com.makeit.global.annotation.Action
;
import
com.makeit.service.saas.SaasSleepEvaluateReportService
;
import
com.makeit.service.saas.SaasSleepEvaluateReportService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
...
@@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
*/
@RestController
@RestController
@RequestMapping
(
"/saas/sleepEvaluateReport"
)
@RequestMapping
(
"/saas/sleepEvaluateReport"
)
@Api
(
tags
=
"saas端-报告管理"
)
public
class
SaasSleepEvaluateReportController
{
public
class
SaasSleepEvaluateReportController
{
...
...
saas-module/src/main/java/com/makeit/controller/analysis/SaasSleepEvaluateStandardReportController.java
View file @
c2139b0b
...
@@ -8,6 +8,7 @@ import com.makeit.dto.saas.analysis.SaasSleepEvaluateStandardReportDTO;
...
@@ -8,6 +8,7 @@ import com.makeit.dto.saas.analysis.SaasSleepEvaluateStandardReportDTO;
import
com.makeit.entity.saas.analysis.SaasSleepEvaluateStandardReport
;
import
com.makeit.entity.saas.analysis.SaasSleepEvaluateStandardReport
;
import
com.makeit.global.annotation.Action
;
import
com.makeit.global.annotation.Action
;
import
com.makeit.service.saas.SaasSleepEvaluateStandardReportService
;
import
com.makeit.service.saas.SaasSleepEvaluateStandardReportService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
...
@@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
*/
@RestController
@RestController
@RequestMapping
(
"/saas/sleepEvaluateStandardReport"
)
@RequestMapping
(
"/saas/sleepEvaluateStandardReport"
)
@Api
(
tags
=
"saas端-报告管理"
)
public
class
SaasSleepEvaluateStandardReportController
{
public
class
SaasSleepEvaluateStandardReportController
{
...
...
server-api/server-api.iml
View file @
c2139b0b
...
@@ -157,7 +157,6 @@
...
@@ -157,7 +157,6 @@
<orderEntry
type=
"library"
name=
"Maven: org.springframework.integration:spring-integration-core:5.5.5"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.integration:spring-integration-core:5.5.5"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-messaging:5.3.12"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-messaging:5.3.12"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.retry:spring-retry:1.3.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.retry:spring-retry:1.3.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.annotation:javax.annotation-api:1.3.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.integration:spring-integration-mqtt:5.5.5"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.integration:spring-integration-mqtt:5.5.5"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.aliyun:dysmsapi20170525:2.0.9"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.aliyun:dysmsapi20170525:2.0.9"
level=
"project"
/>
...
@@ -184,6 +183,7 @@
...
@@ -184,6 +183,7 @@
<orderEntry
type=
"library"
name=
"Maven: org.apache.poi:poi-ooxml:5.2.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.poi:poi-ooxml:5.2.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.poi:poi-ooxml-lite:5.2.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.poi:poi-ooxml-lite:5.2.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.xmlbeans:xmlbeans:5.0.3"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.xmlbeans:xmlbeans:5.0.3"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: xml-apis:xml-apis:1.4.01"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.commons:commons-compress:1.21"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.commons:commons-compress:1.21"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.github.virtuald:curvesapi:1.07"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.github.virtuald:curvesapi:1.07"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: cn.hutool:hutool-all:5.3.5"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: cn.hutool:hutool-all:5.3.5"
level=
"project"
/>
...
@@ -205,7 +205,6 @@
...
@@ -205,7 +205,6 @@
<orderEntry
type=
"library"
name=
"Maven: org.apache.xmlgraphics:batik-bridge:1.14"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.xmlgraphics:batik-bridge:1.14"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.xmlgraphics:batik-script:1.14"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.xmlgraphics:batik-script:1.14"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.xmlgraphics:batik-dom:1.14"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.xmlgraphics:batik-dom:1.14"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: xml-apis:xml-apis:1.4.01"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.xmlgraphics:batik-gvt:1.14"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.xmlgraphics:batik-gvt:1.14"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.xmlgraphics:batik-shared-resources:1.14"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.xmlgraphics:batik-shared-resources:1.14"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.xmlgraphics:batik-svggen:1.14"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.xmlgraphics:batik-svggen:1.14"
level=
"project"
/>
...
...
server-common/src/main/java/com/makeit/common/vo/ExcelErrorVo.java
View file @
c2139b0b
...
@@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.List
;
import
java.util.
Objects
;
import
java.util.
Map
;
@Data
@Data
@ApiModel
(
"excel导入错误信息VO"
)
@ApiModel
(
"excel导入错误信息VO"
)
...
@@ -52,9 +52,17 @@ public class ExcelErrorVo implements Serializable {
...
@@ -52,9 +52,17 @@ public class ExcelErrorVo implements Serializable {
}
}
}
}
public
static
void
notExists
(
Object
object
,
List
<
ExcelErrorVo
>
errorVoList
,
int
i
,
String
title
){
public
static
void
notExists
(
String
value
,
List
<
ExcelErrorVo
>
errorVoList
,
int
i
,
String
title
){
if
(
Objects
.
isNull
(
object
)){
if
(
StringUtils
.
isBlank
(
value
)){
errorVoList
.
add
(
new
ExcelErrorVo
(
i
,
title
,
"数据库数据不存在"
));
errorVoList
.
add
(
new
ExcelErrorVo
(
i
,
title
,
"数据库数据不存在"
));
}
}
}
}
public
static
void
exists
(
Map
<
String
,
String
>
emailMap
,
String
value
,
List
<
ExcelErrorVo
>
errorVoList
,
int
i
,
String
title
){
if
(
StringUtils
.
isNotBlank
(
value
)){
errorVoList
.
add
(
new
ExcelErrorVo
(
i
,
title
,
"数据重复"
));
}
else
{
emailMap
.
put
(
value
,
"system"
);
}
}
}
}
server-common/src/main/java/com/makeit/module/iot/service/IotProductDeviceService.java
View file @
c2139b0b
...
@@ -128,6 +128,48 @@ public class IotProductDeviceService extends IotCommonService {
...
@@ -128,6 +128,48 @@ public class IotProductDeviceService extends IotCommonService {
return
getDeviceLog
(
deviceId
,
10
,
typeValue
);
return
getDeviceLog
(
deviceId
,
10
,
typeValue
);
}
}
public
List
<
DeviceOperationLogEntity
>
getDeviceLogByTimeRange
(
String
deviceId
,
int
pageSize
,
String
startTime
,
String
endTime
)
{
IotQueryParam
iotQueryParam
=
buildQueryParam
(
pageSize
);
List
<
Term
>
terms
=
Lists
.
newArrayList
();
Term
term1
=
Term
.
builder
()
.
column
(
"timestamp"
)
.
termType
(
"gte"
)
.
type
(
Term
.
Type
.
or
)
.
value
(
startTime
)
.
terms
(
Lists
.
newArrayList
())
.
options
(
Lists
.
newArrayList
())
.
build
();
Term
term2
=
Term
.
builder
()
.
column
(
"timestamp"
)
.
termType
(
"lte"
)
.
type
(
Term
.
Type
.
and
)
.
value
(
endTime
)
.
terms
(
Lists
.
newArrayList
())
.
options
(
Lists
.
newArrayList
())
.
build
();
terms
.
add
(
term1
);
terms
.
add
(
term2
);
iotQueryParam
.
setTerms
(
terms
);
String
body
=
JsonUtil
.
toJson
(
iotQueryParam
);
String
url
=
iotUrl
+
DEVICE_PREFIX_URL
+
deviceId
+
"/logs"
;
HttpRequest
request
=
buildRequest
(
url
,
body
);
try
{
ResponseMessage
responseMessage
=
sendPost
(
url
,
request
);
if
(
responseMessage
.
getStatus
()
==
200
)
{
IotPagerResult
pagerResult
=
JSON
.
parseObject
(
responseMessage
.
getResult
().
toString
(),
IotPagerResult
.
class
);
List
<
DeviceOperationLogEntity
>
deviceOperationLogEntities
=
JSONArray
.
parseArray
(
pagerResult
.
getData
().
toString
()).
toJavaList
(
DeviceOperationLogEntity
.
class
);
//Map maps = (Map) JSON.parse(datum.getContent().toString());
return
deviceOperationLogEntities
;
}
log
.
error
(
"获取设备接口失败:{}"
,
responseMessage
.
getMessage
());
}
catch
(
IOException
e
)
{
log
.
error
(
"调用:{}接口异常:{}"
,
url
,
e
.
getMessage
());
}
return
Lists
.
newArrayList
();
}
/**
/**
* 获取设备的日志
* 获取设备的日志
*
*
...
@@ -141,7 +183,7 @@ public class IotProductDeviceService extends IotCommonService {
...
@@ -141,7 +183,7 @@ public class IotProductDeviceService extends IotCommonService {
List
<
Term
>
terms
=
Lists
.
newArrayList
();
List
<
Term
>
terms
=
Lists
.
newArrayList
();
Term
term
=
Term
.
builder
()
Term
term
=
Term
.
builder
()
.
column
(
"type"
)
.
column
(
"type"
)
.
termType
(
"
eq
"
)
.
termType
(
"
btw
"
)
.
type
(
Term
.
Type
.
or
)
.
type
(
Term
.
Type
.
or
)
.
value
(
typeValue
)
.
value
(
typeValue
)
.
terms
(
Lists
.
newArrayList
())
.
terms
(
Lists
.
newArrayList
())
...
...
server-common/src/main/java/com/makeit/module/iot/vo/DeviceInfo.java
View file @
c2139b0b
package
com
.
makeit
.
module
.
iot
.
vo
;
package
com
.
makeit
.
module
.
iot
.
vo
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.Data
;
import
lombok.Data
;
/**
/**
...
@@ -17,7 +18,7 @@ public class DeviceInfo {
...
@@ -17,7 +18,7 @@ public class DeviceInfo {
private
HeaderInfo
headers
;
private
HeaderInfo
headers
;
private
String
properties
;
private
JSONObject
properties
;
/**
/**
...
...
server-module/src/main/java/com/makeit/module/controller/space/PlatBedController.java
View file @
c2139b0b
...
@@ -40,7 +40,7 @@ public class PlatBedController {
...
@@ -40,7 +40,7 @@ public class PlatBedController {
return
ApiResponseUtils
.
success
(
data
);
return
ApiResponseUtils
.
success
(
data
);
}
}
@ApiOperation
(
"列表-无权限"
)
@ApiOperation
(
"列表-无权限
(未绑定设备床位)
"
)
@PostMapping
(
"listAuthIgnore"
)
@PostMapping
(
"listAuthIgnore"
)
public
ApiResponseEntity
<
List
<
PlatBed
>>
listAuthIgnore
(
@RequestBody
PlatBedQueryDTO
dto
)
{
public
ApiResponseEntity
<
List
<
PlatBed
>>
listAuthIgnore
(
@RequestBody
PlatBedQueryDTO
dto
)
{
List
<
PlatBed
>
data
=
platBedService
.
list
(
dto
);
List
<
PlatBed
>
data
=
platBedService
.
list
(
dto
);
...
...
server-module/src/main/java/com/makeit/module/controller/wechat/alarm/
ChildrenAlarmRecord
Controller.java
→
server-module/src/main/java/com/makeit/module/controller/wechat/alarm/
PlatAlarmRecordChildren
Controller.java
View file @
c2139b0b
...
@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
@Api
(
tags
=
"子女端小程序-告警记录"
)
@Api
(
tags
=
"子女端小程序-告警记录"
)
@RestController
@RestController
@RequestMapping
(
"/children/alarm-record"
)
@RequestMapping
(
"/children/alarm-record"
)
public
class
ChildrenAlarmRecord
Controller
{
public
class
PlatAlarmRecordChildren
Controller
{
@Autowired
@Autowired
private
PlatAlarmRecordService
platAlarmRecordService
;
private
PlatAlarmRecordService
platAlarmRecordService
;
...
...
server-module/src/main/java/com/makeit/module/controller/wechat/alarm/
WechatPlatAlarmRecord
Controller.java
→
server-module/src/main/java/com/makeit/module/controller/wechat/alarm/
PlatAlarmRecordWechat
Controller.java
View file @
c2139b0b
...
@@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
@Api
(
tags
=
"小程序-告警记录"
)
@Api
(
tags
=
"小程序-告警记录"
)
@RestController
@RestController
@RequestMapping
(
"/wechat/plat/alarm-record"
)
@RequestMapping
(
"/wechat/plat/alarm-record"
)
public
class
WechatPlatAlarmRecord
Controller
{
public
class
PlatAlarmRecordWechat
Controller
{
@Autowired
@Autowired
private
PlatAlarmRecordService
platAlarmRecordService
;
private
PlatAlarmRecordService
platAlarmRecordService
;
...
...
server-service/src/main/java/com/makeit/dto/platform/auth/PlatUserImportDTO.java
View file @
c2139b0b
...
@@ -23,15 +23,15 @@ public class PlatUserImportDTO {
...
@@ -23,15 +23,15 @@ public class PlatUserImportDTO {
private
String
mobile
;
private
String
mobile
;
@ExcelProperty
(
value
=
"邮箱"
)
@ExcelProperty
(
value
=
"邮箱"
)
private
String
email
;
private
String
email
;
@ExcelProperty
(
value
=
"
所属组织*
"
)
@ExcelProperty
(
value
=
"
*所属组织
"
)
private
String
orgName
;
private
String
orgName
;
@ExcelProperty
(
value
=
"
角色*
"
)
@ExcelProperty
(
value
=
"
*角色
"
)
private
String
roleName
;
private
String
roleName
;
@ExcelProperty
(
value
=
"备注"
)
@ExcelProperty
(
value
=
"备注"
)
private
String
remark
;
private
String
remark
;
@ExcelIgnore
@ExcelIgnore
private
String
password
=
"888888"
;
private
String
password
=
"
abc
888888"
;
}
}
server-service/src/main/java/com/makeit/entity/platform/auth/PlatOrg.java
View file @
c2139b0b
...
@@ -63,4 +63,6 @@ public class PlatOrg extends BaseBusEntity {
...
@@ -63,4 +63,6 @@ public class PlatOrg extends BaseBusEntity {
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
PlatOrg
parent
;
private
PlatOrg
parent
;
private
String
remark
;
}
}
\ No newline at end of file
server-service/src/main/java/com/makeit/enums/platform/device/PlatDeviceEnum.java
View file @
c2139b0b
...
@@ -19,7 +19,7 @@ public class PlatDeviceEnum {
...
@@ -19,7 +19,7 @@ public class PlatDeviceEnum {
}
}
public
enum
CategoryEnum
implements
BaseEnum
{
public
enum
CategoryEnum
implements
BaseEnum
{
HEART
(
"device.category.heart"
),
FALL
(
"device.
status.fall"
),
SPACE
(
"device.status
.space"
);
HEART
(
"device.category.heart"
),
FALL
(
"device.
category.fall"
),
SPACE
(
"device.category
.space"
);
private
String
code
;
private
String
code
;
...
...
server-service/src/main/java/com/makeit/service/platform/alarm/PlatAlarmRecordService.java
View file @
c2139b0b
...
@@ -55,4 +55,6 @@ public interface PlatAlarmRecordService extends IService<PlatAlarmRecord> {
...
@@ -55,4 +55,6 @@ public interface PlatAlarmRecordService extends IService<PlatAlarmRecord> {
void
noticeDeviceAlarm
(
PlatAlarmConfig
alarmConfig
,
PlatAlarmRecord
alarmRecord
);
void
noticeDeviceAlarm
(
PlatAlarmConfig
alarmConfig
,
PlatAlarmRecord
alarmRecord
);
PlatAlarmRecord
createPlatAlarmRecord
(
PlatAlarmCheckDTO
platAlarmCheckDTO
);
PlatAlarmRecord
createPlatAlarmRecord
(
PlatAlarmCheckDTO
platAlarmCheckDTO
);
PlatAlarmCheckDTO
getElderListByDeviceId
(
PlatAlarmCheckDTO
platAlarmCheckDTO
);
}
}
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/BehaviorAlarm.java
View file @
c2139b0b
...
@@ -13,6 +13,7 @@ import com.makeit.utils.data.convert.JsonUtil;
...
@@ -13,6 +13,7 @@ import com.makeit.utils.data.convert.JsonUtil;
import
com.makeit.utils.redis.RedisUtil
;
import
com.makeit.utils.redis.RedisUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.Arrays
;
import
java.util.Arrays
;
...
@@ -31,8 +32,12 @@ public class BehaviorAlarm implements IAlarm{
...
@@ -31,8 +32,12 @@ public class BehaviorAlarm implements IAlarm{
return
StringUtils
.
equals
(
alarmType
,
alarmTypeEnum
.
getValue
());
return
StringUtils
.
equals
(
alarmType
,
alarmTypeEnum
.
getValue
());
}
}
/**
* 3.行为异常:若长者当在某个空间停留的时间高于长者最近7天在每个空间区域停留时间的平均值+区间(区间在行为异常告警处配置)
* @param platAlarmCheckDTO
*/
@Override
@Override
public
void
c
reatePlatAlarmRecord
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
public
void
c
heckConfig
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
PlatAlarmConfig
config
=
platAlarmCheckDTO
.
getPlatAlarmConfig
();
PlatAlarmConfig
config
=
platAlarmCheckDTO
.
getPlatAlarmConfig
();
String
ruleConfigStr
=
config
.
getRuleConfig
();
String
ruleConfigStr
=
config
.
getRuleConfig
();
JSONObject
properties
=
platAlarmCheckDTO
.
getProperties
();
JSONObject
properties
=
platAlarmCheckDTO
.
getProperties
();
...
@@ -58,9 +63,7 @@ public class BehaviorAlarm implements IAlarm{
...
@@ -58,9 +63,7 @@ public class BehaviorAlarm implements IAlarm{
return
;
return
;
}
}
if
(
count
>=
duration
)
{
if
(
count
>=
duration
)
{
platAlarmCheckDTO
.
getParam
().
add
(
"房间名"
);
notice
(
platAlarmCheckDTO
);
PlatAlarmRecord
platAlarmRecord
=
platAlarmRecordService
.
createPlatAlarmRecord
(
platAlarmCheckDTO
);
platAlarmRecordService
.
noticeDeviceAlarm
(
platAlarmCheckDTO
.
getPlatAlarmConfig
(),
platAlarmRecord
);
RedisUtil
.
set
(
RedisConst
.
ALARM_DEVICE_ID
+
deviceId
,
startLong
);
RedisUtil
.
set
(
RedisConst
.
ALARM_DEVICE_ID
+
deviceId
,
startLong
);
}
}
}
else
{
}
else
{
...
@@ -68,4 +71,13 @@ public class BehaviorAlarm implements IAlarm{
...
@@ -68,4 +71,13 @@ public class BehaviorAlarm implements IAlarm{
RedisUtil
.
set
(
RedisConst
.
ALARM_DEVICE_ID
+
deviceId
,
null
);
RedisUtil
.
set
(
RedisConst
.
ALARM_DEVICE_ID
+
deviceId
,
null
);
}
}
}
}
@Override
@Async
public
void
notice
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
platAlarmRecordService
.
getElderListByDeviceId
(
platAlarmCheckDTO
);
platAlarmCheckDTO
.
getParam
().
add
(
"房间名"
);
PlatAlarmRecord
platAlarmRecord
=
platAlarmRecordService
.
createPlatAlarmRecord
(
platAlarmCheckDTO
);
platAlarmRecordService
.
noticeDeviceAlarm
(
platAlarmCheckDTO
.
getPlatAlarmConfig
(),
platAlarmRecord
);
}
}
}
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/BreathAlarm.java
View file @
c2139b0b
...
@@ -13,6 +13,7 @@ import com.makeit.utils.data.convert.JsonUtil;
...
@@ -13,6 +13,7 @@ import com.makeit.utils.data.convert.JsonUtil;
import
com.makeit.utils.redis.RedisUtil
;
import
com.makeit.utils.redis.RedisUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -29,8 +30,16 @@ public class BreathAlarm implements IAlarm{
...
@@ -29,8 +30,16 @@ public class BreathAlarm implements IAlarm{
return
StringUtils
.
equals
(
alarmType
,
alarmTypeEnum
.
getValue
());
return
StringUtils
.
equals
(
alarmType
,
alarmTypeEnum
.
getValue
());
}
}
/**
* 2.呼吸异常/心率异常:长者关联的呼吸心率雷达上报的呼吸和心率不在配置的阈值范围内,且满足持续时间进行告警,
* 若该长者在长者管理处有配置阈值,则以长者个人的阈值为准,若无,则以此处配置的通用规则为准
*
* 心率呼吸率低于阈值且满足持续时间,则对应状态为呼吸过缓/心率过缓,高于阈值且满足持续时间,
* 对应状态为呼吸过速/心率过速,呼吸心率为0且满足持续时间为呼吸暂停
* @param platAlarmCheckDTO
*/
@Override
@Override
public
void
c
reatePlatAlarmRecord
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
public
void
c
heckConfig
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
PlatAlarmConfig
config
=
platAlarmCheckDTO
.
getPlatAlarmConfig
();
PlatAlarmConfig
config
=
platAlarmCheckDTO
.
getPlatAlarmConfig
();
String
ruleConfigStr
=
config
.
getRuleConfig
();
String
ruleConfigStr
=
config
.
getRuleConfig
();
JSONObject
properties
=
platAlarmCheckDTO
.
getProperties
();
JSONObject
properties
=
platAlarmCheckDTO
.
getProperties
();
...
@@ -57,9 +66,7 @@ public class BreathAlarm implements IAlarm{
...
@@ -57,9 +66,7 @@ public class BreathAlarm implements IAlarm{
long
count
=
endLong
-
startLong
;
long
count
=
endLong
-
startLong
;
if
(
br
>
end
||
br
<
start
)
{
if
(
br
>
end
||
br
<
start
)
{
if
(
count
>=
duration
)
{
if
(
count
>=
duration
)
{
platAlarmCheckDTO
.
getParam
().
add
(
"呼吸状态111"
);
notice
(
platAlarmCheckDTO
);
PlatAlarmRecord
platAlarmRecord
=
platAlarmRecordService
.
createPlatAlarmRecord
(
platAlarmCheckDTO
);
platAlarmRecordService
.
noticeDeviceAlarm
(
platAlarmCheckDTO
.
getPlatAlarmConfig
(),
platAlarmRecord
);
RedisUtil
.
set
(
RedisConst
.
ALARM_DEVICE_ID
+
deviceId
,
endLong
/
1000
);
RedisUtil
.
set
(
RedisConst
.
ALARM_DEVICE_ID
+
deviceId
,
endLong
/
1000
);
}
}
}
else
{
}
else
{
...
@@ -67,4 +74,13 @@ public class BreathAlarm implements IAlarm{
...
@@ -67,4 +74,13 @@ public class BreathAlarm implements IAlarm{
}
}
return
;
return
;
}
}
@Override
@Async
public
void
notice
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
platAlarmRecordService
.
getElderListByDeviceId
(
platAlarmCheckDTO
);
platAlarmCheckDTO
.
getParam
().
add
(
"呼吸状态111"
);
PlatAlarmRecord
platAlarmRecord
=
platAlarmRecordService
.
createPlatAlarmRecord
(
platAlarmCheckDTO
);
platAlarmRecordService
.
noticeDeviceAlarm
(
platAlarmCheckDTO
.
getPlatAlarmConfig
(),
platAlarmRecord
);
}
}
}
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/FallAlarm.java
View file @
c2139b0b
...
@@ -7,6 +7,7 @@ import com.makeit.enums.platform.alarm.PlatAlarmConfigEnum;
...
@@ -7,6 +7,7 @@ import com.makeit.enums.platform.alarm.PlatAlarmConfigEnum;
import
com.makeit.service.platform.alarm.PlatAlarmRecordService
;
import
com.makeit.service.platform.alarm.PlatAlarmRecordService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
@Component
@Component
...
@@ -21,14 +22,25 @@ public class FallAlarm implements IAlarm{
...
@@ -21,14 +22,25 @@ public class FallAlarm implements IAlarm{
return
StringUtils
.
equals
(
alarmType
,
alarmTypeEnum
.
getValue
());
return
StringUtils
.
equals
(
alarmType
,
alarmTypeEnum
.
getValue
());
}
}
/**
* 1.长者跌倒:长者所在空间的跌倒监测雷达上报跌倒,若一个空间内有多为长者,则同时告警多条
* @param platAlarmCheckDTO
*/
@Override
@Override
public
void
c
reatePlatAlarmRecord
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
public
void
c
heckConfig
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
JSONObject
properties
=
platAlarmCheckDTO
.
getProperties
();
JSONObject
properties
=
platAlarmCheckDTO
.
getProperties
();
String
personState
=
(
String
)
properties
.
get
(
"personState"
);
String
personState
=
(
String
)
properties
.
get
(
"personState"
);
if
(
StringUtils
.
equals
(
personState
,
"1"
))
{
if
(
StringUtils
.
equals
(
personState
,
"1"
))
{
notice
(
platAlarmCheckDTO
);
}
}
@Override
@Async
public
void
notice
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
platAlarmRecordService
.
getElderListByDeviceId
(
platAlarmCheckDTO
);
platAlarmCheckDTO
.
getParam
().
add
(
"房间名111"
);
platAlarmCheckDTO
.
getParam
().
add
(
"房间名111"
);
PlatAlarmRecord
platAlarmRecord
=
platAlarmRecordService
.
createPlatAlarmRecord
(
platAlarmCheckDTO
);
PlatAlarmRecord
platAlarmRecord
=
platAlarmRecordService
.
createPlatAlarmRecord
(
platAlarmCheckDTO
);
platAlarmRecordService
.
noticeDeviceAlarm
(
platAlarmCheckDTO
.
getPlatAlarmConfig
(),
platAlarmRecord
);
platAlarmRecordService
.
noticeDeviceAlarm
(
platAlarmCheckDTO
.
getPlatAlarmConfig
(),
platAlarmRecord
);
}
}
}
}
}
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/HeartAlarm.java
View file @
c2139b0b
...
@@ -13,6 +13,7 @@ import com.makeit.utils.data.convert.JsonUtil;
...
@@ -13,6 +13,7 @@ import com.makeit.utils.data.convert.JsonUtil;
import
com.makeit.utils.redis.RedisUtil
;
import
com.makeit.utils.redis.RedisUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -30,7 +31,7 @@ public class HeartAlarm implements IAlarm {
...
@@ -30,7 +31,7 @@ public class HeartAlarm implements IAlarm {
}
}
@Override
@Override
public
void
c
reatePlatAlarmRecord
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
public
void
c
heckConfig
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
PlatAlarmConfig
config
=
platAlarmCheckDTO
.
getPlatAlarmConfig
();
PlatAlarmConfig
config
=
platAlarmCheckDTO
.
getPlatAlarmConfig
();
String
ruleConfigStr
=
config
.
getRuleConfig
();
String
ruleConfigStr
=
config
.
getRuleConfig
();
JSONObject
properties
=
platAlarmCheckDTO
.
getProperties
();
JSONObject
properties
=
platAlarmCheckDTO
.
getProperties
();
...
@@ -56,13 +57,20 @@ public class HeartAlarm implements IAlarm {
...
@@ -56,13 +57,20 @@ public class HeartAlarm implements IAlarm {
long
count
=
endLong
-
startLong
;
long
count
=
endLong
-
startLong
;
if
(
hr
>
end
||
hr
<
start
)
{
if
(
hr
>
end
||
hr
<
start
)
{
if
(
count
>=
duration
)
{
if
(
count
>=
duration
)
{
platAlarmCheckDTO
.
getParam
().
add
(
"呼吸状态111"
);
notice
(
platAlarmCheckDTO
);
PlatAlarmRecord
platAlarmRecord
=
platAlarmRecordService
.
createPlatAlarmRecord
(
platAlarmCheckDTO
);
platAlarmRecordService
.
noticeDeviceAlarm
(
platAlarmCheckDTO
.
getPlatAlarmConfig
(),
platAlarmRecord
);
RedisUtil
.
set
(
RedisConst
.
ALARM_DEVICE_ID
+
deviceId
,
endLong
/
1000
);
RedisUtil
.
set
(
RedisConst
.
ALARM_DEVICE_ID
+
deviceId
,
endLong
/
1000
);
}
}
}
else
{
}
else
{
RedisUtil
.
set
(
RedisConst
.
ALARM_DEVICE_ID
+
deviceId
,
endLong
/
1000
);
RedisUtil
.
set
(
RedisConst
.
ALARM_DEVICE_ID
+
deviceId
,
endLong
/
1000
);
}
}
}
}
@Override
@Async
public
void
notice
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
platAlarmRecordService
.
getElderListByDeviceId
(
platAlarmCheckDTO
);
platAlarmCheckDTO
.
getParam
().
add
(
"呼吸状态111"
);
PlatAlarmRecord
platAlarmRecord
=
platAlarmRecordService
.
createPlatAlarmRecord
(
platAlarmCheckDTO
);
platAlarmRecordService
.
noticeDeviceAlarm
(
platAlarmCheckDTO
.
getPlatAlarmConfig
(),
platAlarmRecord
);
}
}
}
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/IAlarm.java
View file @
c2139b0b
...
@@ -6,5 +6,7 @@ public interface IAlarm {
...
@@ -6,5 +6,7 @@ public interface IAlarm {
boolean
support
(
String
alarmType
);
boolean
support
(
String
alarmType
);
void
createPlatAlarmRecord
(
PlatAlarmCheckDTO
platAlarmCheckDTO
);
void
checkConfig
(
PlatAlarmCheckDTO
platAlarmCheckDTO
);
void
notice
(
PlatAlarmCheckDTO
platAlarmCheckDTO
);
}
}
server-service/src/main/java/com/makeit/service/platform/alarm/impl/PlatAlarmRecordServiceImpl.java
View file @
c2139b0b
...
@@ -297,7 +297,7 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
...
@@ -297,7 +297,7 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
@Override
@Override
public
PlatAlarmRecord
createPlatAlarmRecord
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
public
PlatAlarmRecord
createPlatAlarmRecord
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
getElderListByDeviceId
(
platAlarmCheckDTO
);
PlatAlarmConfig
config
=
platAlarmCheckDTO
.
getPlatAlarmConfig
();
PlatAlarmConfig
config
=
platAlarmCheckDTO
.
getPlatAlarmConfig
();
PlatDevice
platDevice
=
platAlarmCheckDTO
.
getPlatDevice
();
PlatDevice
platDevice
=
platAlarmCheckDTO
.
getPlatDevice
();
List
<
String
>
param
=
platAlarmCheckDTO
.
getParam
();
List
<
String
>
param
=
platAlarmCheckDTO
.
getParam
();
...
@@ -321,8 +321,8 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
...
@@ -321,8 +321,8 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
}
}
@Override
p
rivate
PlatAlarmCheckDTO
getElderListByDeviceId
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
p
ublic
PlatAlarmCheckDTO
getElderListByDeviceId
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
PlatDevice
platDevice
=
platAlarmCheckDTO
.
getPlatDevice
();
PlatDevice
platDevice
=
platAlarmCheckDTO
.
getPlatDevice
();
LambdaQueryWrapper
<
PlatRoomBedDevice
>
roomBedDeviceLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
PlatRoomBedDevice
>
roomBedDeviceLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
roomBedDeviceLambdaQueryWrapper
.
eq
(
PlatRoomBedDevice:
:
getDeviceId
,
platDevice
.
getId
());
roomBedDeviceLambdaQueryWrapper
.
eq
(
PlatRoomBedDevice:
:
getDeviceId
,
platDevice
.
getId
());
...
...
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatOrgServiceImpl.java
View file @
c2139b0b
...
@@ -276,9 +276,6 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
...
@@ -276,9 +276,6 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
check
(
dto
);
check
(
dto
);
dto
.
setTenantId
(
TenantIdUtil
.
getTenantId
());
dto
.
setTenantId
(
TenantIdUtil
.
getTenantId
());
if
(
StringUtils
.
isBlank
(
dto
.
getParentId
()))
{
if
(
StringUtils
.
isBlank
(
dto
.
getParentId
()))
{
String
tenantId
=
TenantIdUtil
.
getTenantId
();
dto
.
setParentId
(
tenantId
);
dto
.
setPath
(
tenantId
);
}
else
{
}
else
{
PlatOrg
parent
=
getById
(
dto
.
getParentId
());
PlatOrg
parent
=
getById
(
dto
.
getParentId
());
dto
.
setPath
(
parent
.
getPath
()
+
","
+
parent
.
getId
());
dto
.
setPath
(
parent
.
getPath
()
+
","
+
parent
.
getId
());
...
@@ -302,9 +299,6 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
...
@@ -302,9 +299,6 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
public
void
edit
(
PlatOrg
dto
)
{
public
void
edit
(
PlatOrg
dto
)
{
check
(
dto
);
check
(
dto
);
if
(
StringUtils
.
isBlank
(
dto
.
getParentId
())||
StringUtils
.
equals
(
dto
.
getParentId
(),
"1"
))
{
if
(
StringUtils
.
isBlank
(
dto
.
getParentId
())||
StringUtils
.
equals
(
dto
.
getParentId
(),
"1"
))
{
String
tenantId
=
TenantIdUtil
.
getTenantId
();
dto
.
setParentId
(
tenantId
);
dto
.
setPath
(
tenantId
);
}
else
{
}
else
{
PlatOrg
parent
=
getById
(
dto
.
getParentId
());
PlatOrg
parent
=
getById
(
dto
.
getParentId
());
dto
.
setPath
(
parent
.
getPath
()
+
","
+
parent
.
getId
());
dto
.
setPath
(
parent
.
getPath
()
+
","
+
parent
.
getId
());
...
@@ -521,6 +515,7 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
...
@@ -521,6 +515,7 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
queryWrapper
.
eq
(
StringUtils
.
isNotBlank
(
dto
.
getParentId
()),
PlatOrg:
:
getParentId
,
dto
.
getParentId
())
queryWrapper
.
eq
(
StringUtils
.
isNotBlank
(
dto
.
getParentId
()),
PlatOrg:
:
getParentId
,
dto
.
getParentId
())
.
like
(
StringUtils
.
isNotBlank
(
dto
.
getName
()),
PlatOrg:
:
getName
,
dto
.
getName
())
.
like
(
StringUtils
.
isNotBlank
(
dto
.
getName
()),
PlatOrg:
:
getName
,
dto
.
getName
())
.
eq
(
StringUtils
.
isNotBlank
(
dto
.
getType
()),
PlatOrg:
:
getType
,
dto
.
getType
())
.
eq
(
StringUtils
.
isNotBlank
(
dto
.
getType
()),
PlatOrg:
:
getType
,
dto
.
getType
())
.
eq
(
StringUtils
.
isNotBlank
(
dto
.
getStatus
()),
PlatOrg:
:
getStatus
,
dto
.
getStatus
())
.
orderByDesc
(
BaseEntity:
:
getUpdateDate
);
.
orderByDesc
(
BaseEntity:
:
getUpdateDate
);
return
queryWrapper
;
return
queryWrapper
;
}
}
...
...
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatUserServiceImpl.java
View file @
c2139b0b
...
@@ -1045,33 +1045,37 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
...
@@ -1045,33 +1045,37 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
Map
<
String
,
String
>
mobileMap
=
userList
.
stream
().
collect
(
Collectors
.
toMap
(
PlatUser:
:
getMobile
,
BaseEntity:
:
getId
,
(
a
,
b
)
->
a
));
Map
<
String
,
String
>
mobileMap
=
userList
.
stream
().
collect
(
Collectors
.
toMap
(
PlatUser:
:
getMobile
,
BaseEntity:
:
getId
,
(
a
,
b
)
->
a
));
Map
<
String
,
String
>
emailMap
=
userList
.
stream
().
collect
(
Collectors
.
toMap
(
PlatUser:
:
getEmail
,
BaseEntity:
:
getId
,
(
a
,
b
)
->
a
));
Map
<
String
,
String
>
emailMap
=
userList
.
stream
().
collect
(
Collectors
.
toMap
(
PlatUser:
:
getEmail
,
BaseEntity:
:
getId
,
(
a
,
b
)
->
a
));
return
ExcelValidatorUtil
.
validate
(
platUserImportDTOS
,
list
->
{
return
ExcelValidatorUtil
.
validate
Main
(
3
,
platUserImportDTOS
,
list
->
{
List
<
ExcelErrorVo
>
errorVoList
=
new
ArrayList
<>();
List
<
ExcelErrorVo
>
errorVoList
=
new
ArrayList
<>();
int
start
=
3
;
int
start
=
3
;
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
platUserImportDTOS
.
size
();
i
++)
{
PlatUserImportDTO
dto
=
list
.
get
(
i
);
PlatUserImportDTO
dto
=
platUserImportDTOS
.
get
(
i
);
ExcelErrorVo
.
isNotNull
(
dto
.
getUsername
(),
errorVoList
,
start
+
i
,
"姓名*"
);
ExcelErrorVo
.
isNotNull
(
dto
.
getUsername
(),
errorVoList
,
start
+
i
,
"姓名*"
);
ExcelErrorVo
.
isNotNull
(
dto
.
getMobile
(),
errorVoList
,
start
+
i
,
"手机号*"
);
ExcelErrorVo
.
isNotNull
(
dto
.
getMobile
(),
errorVoList
,
start
+
i
,
"手机号*"
);
ExcelErrorVo
.
isNotNull
(
dto
.
getRoleName
(),
errorVoList
,
start
+
i
,
"
角色*
"
);
ExcelErrorVo
.
isNotNull
(
dto
.
getRoleName
(),
errorVoList
,
start
+
i
,
"
*角色
"
);
ExcelErrorVo
.
isNotNull
(
dto
.
get
RoleName
(),
errorVoList
,
start
+
i
,
"所属组织*
"
);
ExcelErrorVo
.
isNotNull
(
dto
.
get
OrgName
(),
errorVoList
,
start
+
i
,
"*所属组织
"
);
ExcelErrorVo
.
notExists
(
orgNameMap
.
get
(
dto
.
getOrgName
()),
errorVoList
,
start
+
i
,
"
所属组织*
"
);
ExcelErrorVo
.
notExists
(
orgNameMap
.
get
(
dto
.
getOrgName
()),
errorVoList
,
start
+
i
,
"
*所属组织
"
);
ExcelErrorVo
.
notExists
(
roleNameMap
.
get
(
dto
.
getRoleName
()),
errorVoList
,
start
+
i
,
"
角色*
"
);
ExcelErrorVo
.
notExists
(
roleNameMap
.
get
(
dto
.
getRoleName
()),
errorVoList
,
start
+
i
,
"
*角色
"
);
ExcelErrorVo
.
notExists
(
mobileMap
.
get
(
dto
.
getMobile
()),
errorVoList
,
start
+
i
,
"手机号*"
);
ExcelErrorVo
.
exists
(
mobileMap
,
mobileMap
.
get
(
dto
.
getMobile
()),
errorVoList
,
start
+
i
,
"手机号*"
);
ExcelErrorVo
.
notExists
(
emailMap
.
get
(
dto
.
getEmail
()),
errorVoList
,
start
+
i
,
"邮箱"
);
ExcelErrorVo
.
exists
(
emailMap
,
emailMap
.
get
(
dto
.
getEmail
()),
errorVoList
,
start
+
i
,
"邮箱"
);
}
}
if
(
errorVoList
.
isEmpty
()){
if
(
errorVoList
.
isEmpty
()){
List
<
PlatUser
>
platUsers
=
new
ArrayList
<>();
List
<
PlatUser
>
platUsers
=
new
ArrayList
<>();
list
.
forEach
(
vo
->{
platUserImportDTOS
.
forEach
(
vo
->{
PlatUser
platUser
=
BeanDtoVoUtils
.
convert
(
vo
,
PlatUser
.
class
);
PlatUser
platUser
=
BeanDtoVoUtils
.
convert
(
vo
,
PlatUser
.
class
);
setPassword
(
platUser
);
vo
.
setPassword
(
PasswordUtils
.
encryptPassword
(
vo
.
getPassword
()));
platUser
.
setStatus
(
CommonEnum
.
YES
.
getValue
());
platUser
.
setTenantId
(
TenantIdUtil
.
getTenantId
());
platUser
.
setAccount
(
platUser
.
getMobile
());
platUser
.
setIsTenant
(
CommonEnum
.
NO
.
getValue
());
platUsers
.
add
(
platUser
);
platUsers
.
add
(
platUser
);
});
});
saveBatch
(
platUsers
);
saveBatch
(
platUsers
);
}
}
return
errorVoList
;
return
errorVoList
;
}
,
null
);
});
}
}
...
...
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRoomBedDeviceServiceImpl.java
View file @
c2139b0b
...
@@ -127,7 +127,7 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
...
@@ -127,7 +127,7 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
List
<
PlatDeviceDTO
>
data
=
new
ArrayList
<>();
List
<
PlatDeviceDTO
>
data
=
new
ArrayList
<>();
if
(!
listEquipmentIds
.
isEmpty
()){
if
(!
listEquipmentIds
.
isEmpty
()){
LambdaQueryWrapper
<
PlatDevice
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
PlatDevice
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
PlatDevice:
:
getCategory
,
PlatDeviceEnum
.
CategoryEnum
.
HEART
);
//
queryWrapper.eq(PlatDevice::getCategory, PlatDeviceEnum.CategoryEnum.HEART);
queryWrapper
.
in
(
PlatDevice:
:
getId
,
listEquipmentIds
);
queryWrapper
.
in
(
PlatDevice:
:
getId
,
listEquipmentIds
);
List
<
PlatDevice
>
listDevices
=
platDeviceService
.
list
(
queryWrapper
);
List
<
PlatDevice
>
listDevices
=
platDeviceService
.
list
(
queryWrapper
);
data
=
BeanDtoVoUtils
.
listVo
(
listDevices
,
PlatDeviceDTO
.
class
);
data
=
BeanDtoVoUtils
.
listVo
(
listDevices
,
PlatDeviceDTO
.
class
);
...
...
server-service/src/main/java/com/makeit/utils/AlarmConfigCacheUtil.java
View file @
c2139b0b
...
@@ -2,7 +2,10 @@ package com.makeit.utils;
...
@@ -2,7 +2,10 @@ package com.makeit.utils;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.makeit.entity.platform.alarm.PlatAlarmConfig
;
import
com.makeit.entity.platform.alarm.PlatAlarmConfig
;
import
com.makeit.entity.platform.device.PlatDevice
;
import
com.makeit.enums.CommonEnum
;
import
com.makeit.enums.CommonEnum
;
import
com.makeit.enums.platform.alarm.PlatAlarmConfigEnum
;
import
com.makeit.enums.platform.device.PlatDeviceEnum
;
import
com.makeit.enums.redis.RedisConst
;
import
com.makeit.enums.redis.RedisConst
;
import
com.makeit.global.aspect.tenant.TenantIdIgnore
;
import
com.makeit.global.aspect.tenant.TenantIdIgnore
;
import
com.makeit.service.platform.alarm.PlatAlarmConfigService
;
import
com.makeit.service.platform.alarm.PlatAlarmConfigService
;
...
@@ -13,6 +16,7 @@ import org.springframework.boot.ApplicationArguments;
...
@@ -13,6 +16,7 @@ import org.springframework.boot.ApplicationArguments;
import
org.springframework.boot.ApplicationRunner
;
import
org.springframework.boot.ApplicationRunner
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
@Component
@Component
...
@@ -64,4 +68,21 @@ public class AlarmConfigCacheUtil implements ApplicationRunner {
...
@@ -64,4 +68,21 @@ public class AlarmConfigCacheUtil implements ApplicationRunner {
getAll
();
getAll
();
}
}
public
List
<
PlatAlarmConfig
>
getDeviceAlarmConfigMap
(
PlatDevice
platDevice
)
{
if
(
StringUtils
.
equals
(
platDevice
.
getCategory
(),
PlatDeviceEnum
.
CategoryEnum
.
HEART
.
getValue
()))
{
List
<
PlatAlarmConfig
>
set
=
new
ArrayList
<>();
set
.
add
(
this
.
get
(
platDevice
.
getOrgId
()
+
PlatAlarmConfigEnum
.
AlarmTypeEnum
.
BREATHE
.
getValue
()));
set
.
add
(
this
.
get
(
platDevice
.
getOrgId
()
+
PlatAlarmConfigEnum
.
AlarmTypeEnum
.
HEART
.
getValue
()));
}
if
(
StringUtils
.
equals
(
platDevice
.
getCategory
(),
PlatDeviceEnum
.
CategoryEnum
.
FALL
.
getValue
()))
{
List
<
PlatAlarmConfig
>
set
=
new
ArrayList
<>();
set
.
add
(
this
.
get
(
platDevice
.
getOrgId
()
+
PlatAlarmConfigEnum
.
AlarmTypeEnum
.
FALL
.
getValue
()));
}
if
(
StringUtils
.
equals
(
platDevice
.
getCategory
(),
PlatDeviceEnum
.
CategoryEnum
.
SPACE
.
getValue
()))
{
List
<
PlatAlarmConfig
>
set
=
new
ArrayList
<>();
set
.
add
(
this
.
get
(
platDevice
.
getOrgId
()
+
PlatAlarmConfigEnum
.
AlarmTypeEnum
.
BEHAVIOR
.
getValue
()));
}
return
new
ArrayList
<>();
}
}
}
server-web/src/main/java/com/makeit/mqtt/PushCallback.java
View file @
c2139b0b
...
@@ -5,14 +5,12 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -5,14 +5,12 @@ import com.alibaba.fastjson.JSONObject;
import
com.makeit.dto.platform.alarm.PlatAlarmCheckDTO
;
import
com.makeit.dto.platform.alarm.PlatAlarmCheckDTO
;
import
com.makeit.entity.platform.alarm.PlatAlarmConfig
;
import
com.makeit.entity.platform.alarm.PlatAlarmConfig
;
import
com.makeit.entity.platform.device.PlatDevice
;
import
com.makeit.entity.platform.device.PlatDevice
;
import
com.makeit.enums.platform.alarm.PlatAlarmConfigEnum
;
import
com.makeit.global.aspect.tenant.TenantIdIgnore
;
import
com.makeit.enums.platform.device.PlatDeviceEnum
;
import
com.makeit.module.iot.vo.DeviceInfo
;
import
com.makeit.module.iot.vo.DeviceInfo
;
import
com.makeit.service.platform.alarm.alarmStrategy.IAlarm
;
import
com.makeit.service.platform.alarm.alarmStrategy.IAlarm
;
import
com.makeit.utils.AlarmConfigCacheUtil
;
import
com.makeit.utils.AlarmConfigCacheUtil
;
import
com.makeit.utils.DeviceCacheUtil
;
import
com.makeit.utils.DeviceCacheUtil
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.eclipse.paho.client.mqttv3.IMqttDeliveryToken
;
import
org.eclipse.paho.client.mqttv3.IMqttDeliveryToken
;
import
org.eclipse.paho.client.mqttv3.MqttCallback
;
import
org.eclipse.paho.client.mqttv3.MqttCallback
;
import
org.eclipse.paho.client.mqttv3.MqttClient
;
import
org.eclipse.paho.client.mqttv3.MqttClient
;
...
@@ -22,7 +20,6 @@ import org.slf4j.LoggerFactory;
...
@@ -22,7 +20,6 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -71,51 +68,43 @@ public class PushCallback implements MqttCallback {
...
@@ -71,51 +68,43 @@ public class PushCallback implements MqttCallback {
logger
.
info
(
"deliveryComplete--------------"
+
token
.
isComplete
());
logger
.
info
(
"deliveryComplete--------------"
+
token
.
isComplete
());
}
}
@TenantIdIgnore
public
void
checkAlarm
(
DeviceInfo
device
)
{
public
void
checkAlarm
(
DeviceInfo
device
)
{
String
deviceId
=
device
.
getDeviceId
();
String
deviceId
=
device
.
getDeviceId
();
String
propertiesStr
=
device
.
getProperties
();
//String propertiesStr = device.getProperties();
if
(
StringUtils
.
isBlank
(
propertiesStr
))
{
// if (StringUtils.isBlank(propertiesStr)) {
return
;
// return;
}
// }
JSONObject
properties
=
JSON
.
parseObject
(
propertiesStr
);
// JSONObject properties = JSON.parseObject(propertiesStr);
JSONObject
properties
=
device
.
getProperties
();
//iot设备id
//iot设备id
PlatDevice
platDevice
=
deviceCacheUtil
.
get
(
deviceId
);
PlatDevice
platDevice
=
deviceCacheUtil
.
get
(
deviceId
);
List
<
PlatAlarmConfig
>
deviceAlarmConfigList
=
getDeviceAlarmConfigMap
(
platDevice
);
List
<
PlatAlarmConfig
>
deviceAlarmConfigList
=
alarmConfigCacheUtil
.
getDeviceAlarmConfigMap
(
platDevice
);
if
(
CollectionUtils
.
isEmpty
(
deviceAlarmConfigList
))
{
if
(
CollectionUtils
.
isEmpty
(
deviceAlarmConfigList
))
{
return
;
return
;
}
}
for
(
PlatAlarmConfig
config
:
deviceAlarmConfigList
)
{
for
(
PlatAlarmConfig
config
:
deviceAlarmConfigList
)
{
String
alarmType
=
config
.
getAlarmType
();
String
alarmType
=
config
.
getAlarmType
();
PlatAlarmCheckDTO
platAlarmCheckDTO
=
new
PlatAlarmCheckDTO
();
PlatAlarmCheckDTO
platAlarmCheckDTO
=
new
PlatAlarmCheckDTO
();
//告警配置
platAlarmCheckDTO
.
setPlatAlarmConfig
(
config
);
platAlarmCheckDTO
.
setPlatAlarmConfig
(
config
);
//设备信息
platAlarmCheckDTO
.
setPlatDevice
(
platDevice
);
platAlarmCheckDTO
.
setPlatDevice
(
platDevice
);
//iot上报数据
platAlarmCheckDTO
.
setProperties
(
properties
);
platAlarmCheckDTO
.
setProperties
(
properties
);
for
(
IAlarm
alarm
:
alarmList
)
{
for
(
IAlarm
alarm
:
alarmList
)
{
if
(
alarm
.
support
(
alarmType
))
{
if
(
alarm
.
support
(
alarmType
))
{
alarm
.
c
reatePlatAlarmRecord
(
platAlarmCheckDTO
);
alarm
.
c
heckConfig
(
platAlarmCheckDTO
);
}
}
}
}
}
}
}
}
public
List
<
PlatAlarmConfig
>
getDeviceAlarmConfigMap
(
PlatDevice
platDevice
)
{
if
(
StringUtils
.
equals
(
platDevice
.
getCategory
(),
PlatDeviceEnum
.
CategoryEnum
.
HEART
.
getValue
()))
{
List
<
PlatAlarmConfig
>
set
=
new
ArrayList
<>();
set
.
add
(
alarmConfigCacheUtil
.
get
(
platDevice
.
getOrgId
()
+
PlatAlarmConfigEnum
.
AlarmTypeEnum
.
BREATHE
.
getValue
()));
set
.
add
(
alarmConfigCacheUtil
.
get
(
platDevice
.
getOrgId
()
+
PlatAlarmConfigEnum
.
AlarmTypeEnum
.
HEART
.
getValue
()));
}
if
(
StringUtils
.
equals
(
platDevice
.
getCategory
(),
PlatDeviceEnum
.
CategoryEnum
.
FALL
.
getValue
()))
{
List
<
PlatAlarmConfig
>
set
=
new
ArrayList
<>();
set
.
add
(
alarmConfigCacheUtil
.
get
(
platDevice
.
getOrgId
()
+
PlatAlarmConfigEnum
.
AlarmTypeEnum
.
FALL
.
getValue
()));
}
if
(
StringUtils
.
equals
(
platDevice
.
getCategory
(),
PlatDeviceEnum
.
CategoryEnum
.
SPACE
.
getValue
()))
{
List
<
PlatAlarmConfig
>
set
=
new
ArrayList
<>();
set
.
add
(
alarmConfigCacheUtil
.
get
(
platDevice
.
getOrgId
()
+
PlatAlarmConfigEnum
.
AlarmTypeEnum
.
BEHAVIOR
.
getValue
()));
}
return
new
ArrayList
<>();
}
}
}
server-web/src/test/java/com/makeit/iotapi/IotTest.java
View file @
c2139b0b
...
@@ -63,6 +63,11 @@ public class IotTest {
...
@@ -63,6 +63,11 @@ public class IotTest {
}
}
@Test
@Test
void
getDeviceLogByTimeRange
()
{
iotProductDeviceService
.
getDeviceLogByTimeRange
(
"1701127702523473920"
,
100
,
"2023-09-12 00:00:00"
,
"2023-09-12 23:59:00"
);
}
@Test
void
getIotOrgInfo
()
{
void
getIotOrgInfo
()
{
iotOrgService
.
getIotOrgInfo
(
"1698964909267415040"
);
iotOrgService
.
getIotOrgInfo
(
"1698964909267415040"
);
}
}
...
...
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