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
24845f57
authored
Dec 10, 2023
by
汪志阳
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:修复bug
parent
a36e0f78
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
12 deletions
server-service/src/main/java/com/makeit/dto/platform/alarm/PlatAlarmConfigOffBedDTOVO.java
server-service/src/main/java/com/makeit/dto/platform/auth/PlatUserImportDTO.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/OffBedAlarm.java
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatSpaceServiceImpl.java
server-service/src/main/java/com/makeit/dto/platform/alarm/PlatAlarmConfigOffBedDTOVO.java
View file @
24845f57
...
@@ -23,16 +23,16 @@ import java.time.LocalTime;
...
@@ -23,16 +23,16 @@ import java.time.LocalTime;
public
class
PlatAlarmConfigOffBedDTOVO
{
public
class
PlatAlarmConfigOffBedDTOVO
{
@ApiModelProperty
(
"离床开始时间"
)
@ApiModelProperty
(
"离床开始时间"
)
@DateTimeFormat
(
pattern
=
"HH:mm"
)
@DateTimeFormat
(
pattern
=
"HH:mm
:ss
"
)
@JsonFormat
(
pattern
=
"HH:mm"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"HH:mm
:ss
"
,
timezone
=
"GMT+8"
)
private
LocalTime
offBedStart
;
private
LocalTime
offBedStart
;
@ApiModelProperty
(
"离床时间类型 :1-当日,2-次日"
)
@ApiModelProperty
(
"离床时间类型 :1-当日,2-次日"
)
private
String
startTimeType
;
private
String
startTimeType
;
@ApiModelProperty
(
"离床结束时间"
)
@ApiModelProperty
(
"离床结束时间"
)
@DateTimeFormat
(
pattern
=
"HH:mm"
)
@DateTimeFormat
(
pattern
=
"HH:mm
:ss
"
)
@JsonFormat
(
pattern
=
"HH:mm"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"HH:mm
:ss
"
,
timezone
=
"GMT+8"
)
private
LocalTime
offBedEnd
;
private
LocalTime
offBedEnd
;
@ApiModelProperty
(
"离床时间类型 :1-当日,2-次日"
)
@ApiModelProperty
(
"离床时间类型 :1-当日,2-次日"
)
...
...
server-service/src/main/java/com/makeit/dto/platform/auth/PlatUserImportDTO.java
View file @
24845f57
...
@@ -30,6 +30,7 @@ public class PlatUserImportDTO {
...
@@ -30,6 +30,7 @@ public class PlatUserImportDTO {
* 导入手机号会作为账号使用,所以导入需要特殊处理,手机号没有判重后,账号要再判断下有没有判重
* 导入手机号会作为账号使用,所以导入需要特殊处理,手机号没有判重后,账号要再判断下有没有判重
*/
*/
@ExcelProperty
(
value
=
{
headDesc
,
"账户"
})
@ExcelProperty
(
value
=
{
headDesc
,
"账户"
})
@ExcelIgnore
private
String
account
;
private
String
account
;
...
...
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/OffBedAlarm.java
View file @
24845f57
...
@@ -107,9 +107,10 @@ public class OffBedAlarm implements IAlarm {
...
@@ -107,9 +107,10 @@ public class OffBedAlarm implements IAlarm {
alarmRedisDTO
.
setStart
(
now
);
alarmRedisDTO
.
setStart
(
now
);
alarmRedisDTO
.
setStartLong
(
endLong
);
alarmRedisDTO
.
setStartLong
(
endLong
);
RedisUtil
.
set
(
RedisConst
.
ALARM_DEVICE_OFF_BED_ID
+
deviceId
,
alarmRedisDTO
);
RedisUtil
.
set
(
RedisConst
.
ALARM_DEVICE_OFF_BED_ID
+
deviceId
,
alarmRedisDTO
);
log
.
error
(
"发现长者设备状态无人,设备plat_id:"
+
deviceId
);
log
.
info
(
"发现长者设备状态无人,设备plat_id:"
+
deviceId
);
return
;
return
;
}
}
log
.
info
(
"redis获取offbed数据:{}"
,
JSONUtil
.
toJsonStr
(
alarmRedisDTO
));
Date
now
=
new
Date
();
Date
now
=
new
Date
();
long
endLong
=
now
.
getTime
();
long
endLong
=
now
.
getTime
();
Long
startLong
=
alarmRedisDTO
.
getStartLong
();
Long
startLong
=
alarmRedisDTO
.
getStartLong
();
...
@@ -117,7 +118,7 @@ public class OffBedAlarm implements IAlarm {
...
@@ -117,7 +118,7 @@ public class OffBedAlarm implements IAlarm {
String
messageType
=
platAlarmCheckDTO
.
getMessageType
();
String
messageType
=
platAlarmCheckDTO
.
getMessageType
();
if
(
count
/
1000
>=
duration
)
{
if
(
count
/
1000
>=
duration
)
{
if
(
StringUtils
.
equals
(
alarmRedisDTO
.
getAlarm
(),
CommonEnum
.
YES
.
getValue
()))
{
if
(
StringUtils
.
equals
(
alarmRedisDTO
.
getAlarm
(),
CommonEnum
.
YES
.
getValue
()))
{
log
.
info
(
"离床告警
,已告警过,
设备plat_id:"
+
deviceId
);
log
.
info
(
"离床告警
已告警过,
设备plat_id:"
+
deviceId
);
return
;
return
;
}
}
alarmRedisDTO
.
setStartLong
(
endLong
);
alarmRedisDTO
.
setStartLong
(
endLong
);
...
@@ -129,7 +130,8 @@ public class OffBedAlarm implements IAlarm {
...
@@ -129,7 +130,8 @@ public class OffBedAlarm implements IAlarm {
}
}
if
(
StringUtils
.
equalsAnyIgnoreCase
(
messageType
,
"REPORT_PROPERTY"
,
"OFFLINE"
,
"DISCONNECT"
))
{
if
(
StringUtils
.
equalsAnyIgnoreCase
(
messageType
,
"REPORT_PROPERTY"
,
"OFFLINE"
,
"DISCONNECT"
))
{
RedisUtil
.
delete
(
RedisConst
.
ALARM_DEVICE_OFF_BED_ID
+
deviceId
);
log
.
info
(
"删除redisoffbed预警"
);
// RedisUtil.delete(RedisConst.ALARM_DEVICE_OFF_BED_ID + deviceId);
}
}
}
}
...
...
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatSpaceServiceImpl.java
View file @
24845f57
...
@@ -34,6 +34,7 @@ import com.makeit.utils.user.plat.PlatUserUtil;
...
@@ -34,6 +34,7 @@ import com.makeit.utils.user.plat.PlatUserUtil;
import
com.makeit.utils.user.plat.PlatUserVO
;
import
com.makeit.utils.user.plat.PlatUserVO
;
import
com.makeit.vo.platform.space.PlatSpaceAndRoomVO
;
import
com.makeit.vo.platform.space.PlatSpaceAndRoomVO
;
import
jodd.util.StringUtil
;
import
jodd.util.StringUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -53,6 +54,7 @@ import java.util.stream.Collectors;
...
@@ -53,6 +54,7 @@ import java.util.stream.Collectors;
* @Describe:
* @Describe:
*/
*/
@Service
@Service
@Slf4j
public
class
PlatSpaceServiceImpl
extends
ServiceImpl
<
PlatSpaceMapper
,
PlatSpace
>
implements
PlatSpaceService
{
public
class
PlatSpaceServiceImpl
extends
ServiceImpl
<
PlatSpaceMapper
,
PlatSpace
>
implements
PlatSpaceService
{
@Autowired
@Autowired
...
@@ -156,12 +158,22 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
...
@@ -156,12 +158,22 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
return
;
return
;
}
}
for
(
PlatRoom
platRoom
:
platRoomList
)
{
for
(
PlatRoom
platRoom
:
platRoomList
)
{
String
roomSpacePath
;
if
(
lastSpaceIds
.
get
(
0
).
equals
(
space
.
getId
()))
{
roomSpacePath
=
dto
.
getParentPath
()
+
","
+
String
.
join
(
","
,
lastSpaceIds
);
List
<
String
>
roomSpaceIds
=
recursionRoomId
(
platRoom
.
getSpaceId
(),
new
ArrayList
<>(),
space
.
getId
()
);
}
else
{
if
(
CollUtil
.
isEmpty
(
roomSpaceIds
))
{
r
oomSpacePath
=
dto
.
getParentPath
()
+
","
+
space
.
getId
()
+
","
+
String
.
join
(
","
,
lastSpaceIds
)
;
r
eturn
;
}
}
String
join
=
String
.
join
(
","
,
CollUtil
.
reverse
(
roomSpaceIds
));
log
.
info
(
"房间id:{},对应的空间id:{},parentId:{}"
,
platRoom
.
getId
(),
join
,
dto
.
getParentPath
());
String
roomSpacePath
=
dto
.
getParentPath
()
+
","
+
join
;
log
.
info
(
"roomSpacePath"
+
roomSpacePath
);
// if (lastSpaceIds.get(0).equals(space.getId())) {
// roomSpacePath = dto.getParentPath() + "," + String.join(",", lastSpaceIds);
// } else {
// roomSpacePath = dto.getParentPath() + "," + space.getId() + "," + String.join(",", lastSpaceIds);
// }
platRoom
.
setSpacePath
(
roomSpacePath
);
platRoom
.
setSpacePath
(
roomSpacePath
);
platRoomService
.
updateById
(
platRoom
);
platRoomService
.
updateById
(
platRoom
);
}
}
...
@@ -197,6 +209,17 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
...
@@ -197,6 +209,17 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
return
result
;
return
result
;
}
}
private
List
<
String
>
recursionRoomId
(
String
roomSpaceId
,
List
<
String
>
result
,
String
updateSpaceId
)
{
result
.
add
(
roomSpaceId
);
if
(
roomSpaceId
.
equals
(
updateSpaceId
))
{
return
result
;
}
else
{
PlatSpace
platSpaces
=
this
.
getById
(
roomSpaceId
);
recursionRoomId
(
platSpaces
.
getParentId
(),
result
,
updateSpaceId
);
}
return
result
;
}
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
del
(
String
id
)
{
public
void
del
(
String
id
)
{
...
...
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