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
2373d0a7
authored
Sep 18, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
fbb06ab5
f6340356
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
81 additions
and
32 deletions
server-common/src/main/java/com/makeit/module/iot/service/IotProductDeviceService.java
server-common/src/main/java/com/makeit/module/iot/vo/fall/DeviceInfoContentFall.java
server-common/src/main/java/com/makeit/module/iot/vo/breathe/DeviceInfoContentSpace.java → server-common/src/main/java/com/makeit/module/iot/vo/space/DeviceInfoContentSpace.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderDayReportDayServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderRealTimeServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/workstation/impl/WorkStationServiceImpl.java
server-service/src/main/java/com/makeit/service/saas/impl/SaasRoleServiceImpl.java
server-service/src/main/java/com/makeit/service/saas/impl/SaasUserServiceImpl.java
server-service/src/main/java/com/makeit/service/wechat/impl/PlatElderCenterWechatServiceImpl.java
server-service/src/main/java/com/makeit/vo/platform/workstation/WorkStationInstitutionBedVO.java
server-service/src/main/resources/mappers/PlatBedMapper.xml
server-service/src/main/resources/mappers/SaasOperationLogMapper.xml
server-web/src/main/resources/application.yml
server-web/src/test/java/com/makeit/iotapi/IotTest.java → server-web/src/test/java/com/makeit/iotapi/IotDeviceInfoContentFall.java
server-common/src/main/java/com/makeit/module/iot/service/IotProductDeviceService.java
View file @
2373d0a7
...
...
@@ -12,7 +12,8 @@ import com.makeit.module.iot.vo.DeviceOperationLogEntity;
import
com.makeit.module.iot.vo.IotPagerResult
;
import
com.makeit.module.iot.vo.ResponseMessage
;
import
com.makeit.module.iot.vo.breathe.DeviceInfoContentBreathe
;
import
com.makeit.module.iot.vo.breathe.DeviceInfoContentSpace
;
import
com.makeit.module.iot.vo.fall.DeviceInfoContentFall
;
import
com.makeit.module.iot.vo.space.DeviceInfoContentSpace
;
import
com.makeit.utils.LongTimestampUtil
;
import
com.makeit.utils.data.convert.JsonUtil
;
import
com.makeit.utils.data.convert.StreamUtil
;
...
...
@@ -23,9 +24,7 @@ import org.springframework.stereotype.Component;
import
java.io.IOException
;
import
java.time.Duration
;
import
java.time.Instant
;
import
java.time.LocalDateTime
;
import
java.time.ZoneId
;
import
java.time.format.DateTimeFormatter
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -146,6 +145,16 @@ public class IotProductDeviceService extends IotCommonService {
return
deviceInfoContentSpaceList
;
}
public
List
<
DeviceInfoContentFall
>
getDeviceLogByTimeRangeFall
(
String
deviceId
,
int
pageSize
,
LocalDateTime
startTime
,
LocalDateTime
endTime
)
{
DateTimeFormatter
dateTimeFormatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
List
<
DeviceOperationLogEntity
>
deviceOperationLogEntityList
=
getDeviceLogByTimeRange
(
deviceId
,
"event"
,
pageSize
,
dateTimeFormatter
.
format
(
startTime
),
dateTimeFormatter
.
format
(
endTime
));
List
<
DeviceInfoContentFall
>
deviceInfoContentSpaceList
=
StreamUtil
.
map
(
deviceOperationLogEntityList
,
e
->
JsonUtil
.
toObj
((
String
)
e
.
getContent
(),
DeviceInfoContentFall
.
class
));
return
deviceInfoContentSpaceList
;
}
/**
* 根据类型查询设备日志
...
...
@@ -196,7 +205,6 @@ public class IotProductDeviceService extends IotCommonService {
}
/**
*
* @param deviceId
* @param typeValue
* @param pageSize
...
...
server-common/src/main/java/com/makeit/module/iot/vo/fall/DeviceInfoContentFall.java
0 → 100644
View file @
2373d0a7
package
com
.
makeit
.
module
.
iot
.
vo
.
fall
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.makeit.module.iot.vo.breathe.DeviceInfoContentBreathe
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
@NoArgsConstructor
@Data
public
class
DeviceInfoContentFall
{
@JsonProperty
(
"headers"
)
private
DeviceInfoContentBreathe
.
Headers
headers
;
@JsonProperty
(
"messageType"
)
private
String
messageType
;
@JsonProperty
(
"deviceId"
)
private
String
deviceId
;
@JsonProperty
(
"properties"
)
private
Properties
properties
;
@JsonProperty
(
"timestamp"
)
private
Long
timestamp
;
@NoArgsConstructor
@Data
public
static
class
Properties
{
@JsonProperty
(
"personState"
)
private
Integer
personState
;
@JsonProperty
(
"person"
)
private
Integer
person
;
@JsonProperty
(
"radarHitch"
)
private
String
radarHitch
;
@JsonProperty
(
"track"
)
private
List
<
Integer
>
track
;
@JsonProperty
(
"mount"
)
private
Integer
mount
;
}
}
server-common/src/main/java/com/makeit/module/iot/vo/
breath
e/DeviceInfoContentSpace.java
→
server-common/src/main/java/com/makeit/module/iot/vo/
spac
e/DeviceInfoContentSpace.java
View file @
2373d0a7
package
com
.
makeit
.
module
.
iot
.
vo
.
breath
e
;
package
com
.
makeit
.
module
.
iot
.
vo
.
spac
e
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.makeit.module.iot.vo.breathe.DeviceInfoContentBreathe
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
...
...
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderDayReportDayServiceImpl.java
View file @
2373d0a7
...
...
@@ -10,7 +10,7 @@ import com.makeit.entity.platform.elder.PlatElderSleepAnalysis;
import
com.makeit.enums.platform.alarm.PlatAlarmConfigEnum
;
import
com.makeit.module.iot.service.IotProductDeviceService
;
import
com.makeit.module.iot.vo.breathe.DeviceInfoContentBreathe
;
import
com.makeit.module.iot.vo.
breath
e.DeviceInfoContentSpace
;
import
com.makeit.module.iot.vo.
spac
e.DeviceInfoContentSpace
;
import
com.makeit.service.platform.alarm.PlatAlarmRecordService
;
import
com.makeit.service.platform.device.PlatDeviceService
;
import
com.makeit.service.platform.elder.*
;
...
...
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderRealTimeServiceImpl.java
View file @
2373d0a7
...
...
@@ -4,7 +4,7 @@ import com.makeit.dto.platform.elder.PlatElderIdDTO;
import
com.makeit.entity.platform.device.PlatDevice
;
import
com.makeit.module.iot.service.IotProductDeviceService
;
import
com.makeit.module.iot.vo.breathe.DeviceInfoContentBreathe
;
import
com.makeit.module.iot.vo.
breath
e.DeviceInfoContentSpace
;
import
com.makeit.module.iot.vo.
spac
e.DeviceInfoContentSpace
;
import
com.makeit.service.platform.device.PlatDeviceService
;
import
com.makeit.service.platform.elder.PlatElderRealTimeService
;
import
com.makeit.service.platform.elder.PlatElderService
;
...
...
server-service/src/main/java/com/makeit/service/platform/workstation/impl/WorkStationServiceImpl.java
View file @
2373d0a7
...
...
@@ -172,12 +172,10 @@ public class WorkStationServiceImpl implements WorkStationService {
e
.
setPathName
(
StreamUtil
.
join
(
l
,
Objects:
:
nonNull
,
PlatSpace:
:
getName
,
"-"
));
});
for
(
WorkStationInstitutionRoomVO
roomVo
:
roomVOList
)
{
WorkStationInstitutionRoomVO
vo
=
new
WorkStationInstitutionRoomVO
();
vo
.
setRoomId
(
roomVo
.
getRoomId
());
for
(
WorkStationInstitutionRoomVO
vo
:
roomVOList
)
{
vo
.
setPathName
(
vo
.
getPathName
()
+
"-"
+
vo
.
getRoomName
());
if
(
bedMap
.
get
(
roomV
o
.
getRoomId
())
!=
null
)
{
List
<
WorkStationInstitutionBedVO
>
roomBedVos
=
bedMap
.
get
(
roomV
o
.
getRoomId
());
if
(
bedMap
.
get
(
v
o
.
getRoomId
())
!=
null
)
{
List
<
WorkStationInstitutionBedVO
>
roomBedVos
=
bedMap
.
get
(
v
o
.
getRoomId
());
//获取告警类型及老人状态
roomBedVos
.
forEach
(
r
->
{
if
(
StringUtil
.
isNotEmpty
(
r
.
getElderId
())
)
{
...
...
server-service/src/main/java/com/makeit/service/saas/impl/SaasRoleServiceImpl.java
View file @
2373d0a7
...
...
@@ -86,17 +86,23 @@ implements SaasRoleService{
}
private
void
check
(
SaasRoleDTOVO
dto
)
{
SaasRole
old
=
getOne
(
new
QueryWrapper
<
SaasRole
>().
lambda
()
List
<
SaasRole
>
oldList
=
list
(
new
QueryWrapper
<
SaasRole
>().
lambda
()
.
eq
(
SaasRole:
:
getName
,
dto
.
getName
()));
for
(
SaasRole
old
:
oldList
)
{
if
(
old
!=
null
&&
!
old
.
getId
().
equals
(
dto
.
getId
()))
{
throw
new
BusinessException
(
CodeMessageEnum
.
SYSTEM_ERROR_NAME_DUPLICATE
);
}
}
oldList
=
list
(
new
QueryWrapper
<
SaasRole
>().
lambda
()
.
eq
(
SaasRole:
:
getCode
,
dto
.
getCode
()));
for
(
SaasRole
old
:
oldList
)
{
if
(
old
!=
null
&&
!
old
.
getId
().
equals
(
dto
.
getId
()))
{
throw
new
BusinessException
(
CodeMessageEnum
.
SYSTEM_ERROR_CODE_DUPLICATE
);
}
}
// old = getOne(new QueryWrapper<SaasRole>().lambda()
// .eq(SaasRole::getName, dto.getName()));
// if (old != null && !old.getId().equals(dto.getId())) {
// throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR_CODE_DUPLICATE);
// }
}
@Transactional
...
...
server-service/src/main/java/com/makeit/service/saas/impl/SaasUserServiceImpl.java
View file @
2373d0a7
...
...
@@ -186,7 +186,7 @@ implements SaasUserService{
private
void
setRoleList
(
SaasUserDTOVO
dto
)
{
saasUserRoleService
.
remove
(
new
QueryWrapper
<
SaasUserRole
>().
lambda
()
.
eq
(
SaasUserRole:
:
getUserId
,
dto
.
getId
()));
if
(
CollectionUtils
.
isNotEmpty
(
dto
.
getRoleList
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
dto
.
getRole
Id
List
()))
{
List
<
SaasUserRole
>
userRoleList
=
StreamUtil
.
map
(
dto
.
getRoleIdList
(),
e
->
{
SaasUserRole
saasUserRole
=
new
SaasUserRole
();
saasUserRole
.
setUserId
(
dto
.
getId
());
...
...
@@ -249,7 +249,6 @@ implements SaasUserService{
@Transactional
@Override
public
void
edit
(
SaasUserDTOVO
dto
)
{
dto
.
setAccount
(
null
);
superCantEdit
(
dto
);
check
(
dto
);
...
...
server-service/src/main/java/com/makeit/service/wechat/impl/PlatElderCenterWechatServiceImpl.java
View file @
2373d0a7
...
...
@@ -156,12 +156,10 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe
//长者对应的报警类型
Map
<
String
,
Map
<
String
,
List
<
String
>>>
elderAlarmTypeMap
=
workStationService
.
mapElderAlarmType
(
alarmRecords
);
for
(
WorkStationInstitutionRoomVO
roomVo
:
roomVOList
)
{
WorkStationInstitutionRoomVO
vo
=
new
WorkStationInstitutionRoomVO
();
vo
.
setRoomId
(
roomVo
.
getRoomId
());
for
(
WorkStationInstitutionRoomVO
vo
:
roomVOList
)
{
vo
.
setPathName
(
vo
.
getPathName
()
+
"-"
+
vo
.
getRoomName
());
if
(
bedMap
.
get
(
roomV
o
.
getRoomId
())
!=
null
)
{
List
<
WorkStationInstitutionBedVO
>
roomBedVos
=
bedMap
.
get
(
roomV
o
.
getRoomId
());
if
(
bedMap
.
get
(
v
o
.
getRoomId
())
!=
null
)
{
List
<
WorkStationInstitutionBedVO
>
roomBedVos
=
bedMap
.
get
(
v
o
.
getRoomId
());
//获取告警类型及老人状态
roomBedVos
.
forEach
(
r
->
{
if
(
StringUtil
.
isNotEmpty
(
r
.
getElderId
())
)
{
...
...
server-service/src/main/java/com/makeit/vo/platform/workstation/WorkStationInstitutionBedVO.java
View file @
2373d0a7
...
...
@@ -27,7 +27,7 @@ public class WorkStationInstitutionBedVO {
private
String
roomId
;
@ApiModelProperty
(
value
=
"状态"
)
private
String
sta
ut
s
;
private
String
sta
tu
s
;
@ApiModelProperty
(
value
=
"长者id"
)
private
String
elderId
;
...
...
server-service/src/main/resources/mappers/PlatBedMapper.xml
View file @
2373d0a7
...
...
@@ -50,12 +50,12 @@
</select>
<select
id=
"selectByRoomIds"
resultType=
"com.makeit.vo.platform.workstation.WorkStationInstitutionBedVO"
>
SELECT pb.`name` as bedName, pb.id as bedId, pb.room_id as roomId , pe.id as elderId, pb.name as elderName, prbd.device_id as deviceId
SELECT pb.`name` as bedName, pb.id as bedId, pb.room_id as roomId , pe.id as elderId, pb.name as elderName, prbd.device_id as deviceId
,pb.status
FROM plat_bed pb
LEFT JOIN plat_elder pe ON pe.bed_id = pb.id
LEFT JOIN plat_room_bed_device prbd ON prbd.bed_id = pb.id
<where>
pb.del_flag = 0
and pe.del_flag = 0 and prbd.del_flag = 0
pb.del_flag = 0
<if
test=
"roomIds != null and roomIds.size() > 0 "
>
AND pb.room_id IN
<foreach
collection=
"roomIds"
item=
"item"
separator=
","
open=
"("
close=
")"
index=
""
>
...
...
server-service/src/main/resources/mappers/SaasOperationLogMapper.xml
View file @
2373d0a7
...
...
@@ -5,11 +5,11 @@
<select
id=
"selectByCondition"
resultType=
"com.makeit.dto.saas.SaasOperationLogDTO"
>
select
ol.id as id,
ol.saas_user_id as
plat
UserId,
ol.saas_user_id as
saas
UserId,
ol.tenant_id as tenantId,
ol.content as content,
ol.create_date as createDate,
pu.username as
plat
UserName,
pu.username as
saas
UserName,
t.name as tenantName
from saas_operation_log ol
left join saas_user pu on ol.saas_user_id = pu.id and pu.del_flag = 0
...
...
server-web/src/main/resources/application.yml
View file @
2373d0a7
...
...
@@ -82,7 +82,7 @@ mybatis-plus:
global-config
:
db-config
:
id-type
:
ASSIGN_ID
update-strategy
:
not_
empty
update-strategy
:
not_
null
insert-strategy
:
not_empty
where-strategy
:
not_empty
...
...
server-web/src/test/java/com/makeit/iotapi/Iot
Test
.java
→
server-web/src/test/java/com/makeit/iotapi/Iot
DeviceInfoContentFall
.java
View file @
2373d0a7
...
...
@@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.test.context.SpringBootTest
;
@SpringBootTest
public
class
Iot
Test
{
public
class
Iot
DeviceInfoContentFall
{
@Autowired
private
IotTokenService
tokenService
;
...
...
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