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
26762860
authored
Sep 22, 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
e76fb33b
5f2cda52
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
63 additions
and
37 deletions
db/space.sql
server-common/src/main/java/com/makeit/module/iot/vo/space/DeviceInfoContentSpace.java
server-common/src/main/resources/locale/business_messages.properties
server-module/src/main/java/com/makeit/module/controller/space/PlatRegionSettingController.java
server-module/src/main/java/com/makeit/module/controller/wechat/space/PlatRegionSettingWechatController.java
server-service/src/main/java/com/makeit/dto/platform/device/PlatDeviceDTO.java
server-service/src/main/java/com/makeit/service/platform/dataScreen/impl/DataScreenServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/space/PlatRegionSettingService.java
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRegionSettingServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/workstation/impl/WorkStationServiceImpl.java
server-service/src/main/java/com/makeit/service/wechat/impl/PlatElderCenterWechatServiceImpl.java
db/space.sql
View file @
26762860
...
@@ -86,8 +86,8 @@ CREATE TABLE `plat_region_setting`
...
@@ -86,8 +86,8 @@ CREATE TABLE `plat_region_setting`
`install_type`
char
(
1
)
DEFAULT
NULL
COMMENT
'安装方式 0-顶装 1-侧装'
,
`install_type`
char
(
1
)
DEFAULT
NULL
COMMENT
'安装方式 0-顶装 1-侧装'
,
`toward`
char
(
1
)
DEFAULT
NULL
COMMENT
'设备朝向 0-上 1-下 2-左 3-右'
,
`toward`
char
(
1
)
DEFAULT
NULL
COMMENT
'设备朝向 0-上 1-下 2-左 3-右'
,
`region_name`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'区域名称'
,
`region_name`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'区域名称'
,
`region_range`
varchar
(
128
)
DEFAULT
NULL
COMMENT
'区域定位'
,
`region_range`
varchar
(
500
)
DEFAULT
NULL
COMMENT
'区域定位'
,
`room_range`
varchar
(
128
)
DEFAULT
NULL
COMMENT
'房间门定位'
,
`room_range`
varchar
(
500
)
DEFAULT
NULL
COMMENT
'房间门定位'
,
`equipment_range`
varchar
(
128
)
DEFAULT
NULL
COMMENT
'设备定位'
,
`equipment_range`
varchar
(
128
)
DEFAULT
NULL
COMMENT
'设备定位'
,
`device_id`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'设备Id'
,
`device_id`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'设备Id'
,
`create_by`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'创建者'
,
`create_by`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'创建者'
,
...
...
server-common/src/main/java/com/makeit/module/iot/vo/space/DeviceInfoContentSpace.java
View file @
26762860
...
@@ -2,6 +2,7 @@ package com.makeit.module.iot.vo.space;
...
@@ -2,6 +2,7 @@ package com.makeit.module.iot.vo.space;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.makeit.module.iot.vo.breathe.DeviceInfoContentBreathe
;
import
com.makeit.module.iot.vo.breathe.DeviceInfoContentBreathe
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
...
@@ -26,10 +27,13 @@ public class DeviceInfoContentSpace {
...
@@ -26,10 +27,13 @@ public class DeviceInfoContentSpace {
@JsonProperty
(
"mode"
)
@JsonProperty
(
"mode"
)
private
Integer
mode
;
private
Integer
mode
;
@JsonProperty
(
"distance"
)
@JsonProperty
(
"distance"
)
@ApiModelProperty
(
"人体目标距离雷达位置 范围:0-1000,单位cm"
)
private
Integer
distance
;
private
Integer
distance
;
@JsonProperty
(
"personState"
)
@JsonProperty
(
"personState"
)
@ApiModelProperty
(
"0表示无人 ,1表示有人"
)
private
Integer
personState
;
private
Integer
personState
;
@JsonProperty
(
"angle"
)
@JsonProperty
(
"angle"
)
@ApiModelProperty
(
"人体目标偏离雷达法线角度范围:±60,单位°"
)
private
Integer
angle
;
private
Integer
angle
;
@JsonProperty
(
"mount"
)
@JsonProperty
(
"mount"
)
private
Integer
mount
;
private
Integer
mount
;
...
...
server-common/src/main/resources/locale/business_messages.properties
View file @
26762860
...
@@ -96,7 +96,7 @@ PLATFORM.ERROR.SPACE.NAME.DUPLICATE=同一层级,空间名称不能重复
...
@@ -96,7 +96,7 @@ PLATFORM.ERROR.SPACE.NAME.DUPLICATE=同一层级,空间名称不能重复
PLATFORM.ERROR.SPACE.NOT.DEL
=
该空间下存在下级或者房间,不可删除
PLATFORM.ERROR.SPACE.NOT.DEL
=
该空间下存在下级或者房间,不可删除
PLATFORM.ERROR.SPACE.NOT.AUTH.PARENT
=
上级空间不能是自己的下级空间
PLATFORM.ERROR.SPACE.NOT.AUTH.PARENT
=
上级空间不能是自己的下级空间
PLATFORM.ERROR.SPACE.USER.NOT.ADD
=
当前用户没有所属组织,请先分配组织
PLATFORM.ERROR.SPACE.USER.NOT.ADD
=
当前用户没有所属组织,请先分配组织
PLATFORM.ERROR.ROOM.EXIT.BAD
=
房间中存在床位,不可删除
PLATFORM.ERROR.ROOM.EXIT.BAD
=
房间中存在
已入住的
床位,不可删除
PLATFORM.ERROR.ROOM.NAME.EXIT
=
该房间名称已存在
PLATFORM.ERROR.ROOM.NAME.EXIT
=
该房间名称已存在
PLATFORM.ERROR.ROOM.BAD.NUMBER.NOT.AUTH
=
床位数量不能改小
PLATFORM.ERROR.ROOM.BAD.NUMBER.NOT.AUTH
=
床位数量不能改小
PLATFORM.ERROR.BAD.NAME.EXIT
=
床位名称已存在
PLATFORM.ERROR.BAD.NAME.EXIT
=
床位名称已存在
...
...
server-module/src/main/java/com/makeit/module/controller/space/PlatRegionSettingController.java
View file @
26762860
...
@@ -6,6 +6,7 @@ import com.makeit.dto.platform.space.PlatRegionSettingDTO;
...
@@ -6,6 +6,7 @@ import com.makeit.dto.platform.space.PlatRegionSettingDTO;
import
com.makeit.dto.platform.space.PlatRegionSettingListDTO
;
import
com.makeit.dto.platform.space.PlatRegionSettingListDTO
;
import
com.makeit.dto.platform.space.PlatRegionSettingLocateDTO
;
import
com.makeit.dto.platform.space.PlatRegionSettingLocateDTO
;
import
com.makeit.dto.platform.space.PlatRegionSettingQueryDTO
;
import
com.makeit.dto.platform.space.PlatRegionSettingQueryDTO
;
import
com.makeit.module.iot.vo.space.DeviceInfoContentSpace
;
import
com.makeit.service.platform.space.PlatRegionSettingService
;
import
com.makeit.service.platform.space.PlatRegionSettingService
;
import
com.makeit.vo.platform.elder.realtime.PlatElderCoordinateVO
;
import
com.makeit.vo.platform.elder.realtime.PlatElderCoordinateVO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -54,15 +55,15 @@ public class PlatRegionSettingController {
...
@@ -54,15 +55,15 @@ public class PlatRegionSettingController {
@ApiOperation
(
"定位(时间范围内定位)"
)
@ApiOperation
(
"定位(时间范围内定位)"
)
@PostMapping
(
"locate"
)
@PostMapping
(
"locate"
)
public
ApiResponseEntity
<
List
<
PlatElderCoordinateVO
>>
locate
(
@RequestBody
PlatRegionSettingLocateDTO
dto
)
{
public
ApiResponseEntity
<
List
<
DeviceInfoContentSpace
.
Properties
>>
locate
(
@RequestBody
PlatRegionSettingLocateDTO
dto
)
{
List
<
PlatElderCoordinateVO
>
list
=
platRegionSettingService
.
locate
(
dto
);
List
<
DeviceInfoContentSpace
.
Properties
>
list
=
platRegionSettingService
.
locate
(
dto
);
return
ApiResponseUtils
.
success
(
list
);
return
ApiResponseUtils
.
success
(
list
);
}
}
@ApiOperation
(
"实时定位"
)
@ApiOperation
(
"实时定位"
)
@PostMapping
(
"nowDataLocate"
)
@PostMapping
(
"nowDataLocate"
)
public
ApiResponseEntity
<
PlatElderCoordinateVO
>
nowDataLocate
(
@RequestBody
PlatRegionSettingLocateDTO
dto
)
{
public
ApiResponseEntity
<
DeviceInfoContentSpace
.
Properties
>
nowDataLocate
(
@RequestBody
PlatRegionSettingLocateDTO
dto
)
{
PlatElderCoordinateVO
vo
=
platRegionSettingService
.
nowDataLocate
(
dto
);
DeviceInfoContentSpace
.
Properties
vo
=
platRegionSettingService
.
nowDataLocate
(
dto
);
return
ApiResponseUtils
.
success
(
vo
);
return
ApiResponseUtils
.
success
(
vo
);
}
}
...
...
server-module/src/main/java/com/makeit/module/controller/wechat/space/PlatRegionSettingWechatController.java
View file @
26762860
...
@@ -6,6 +6,7 @@ import com.makeit.dto.platform.space.PlatRegionSettingDTO;
...
@@ -6,6 +6,7 @@ import com.makeit.dto.platform.space.PlatRegionSettingDTO;
import
com.makeit.dto.platform.space.PlatRegionSettingListDTO
;
import
com.makeit.dto.platform.space.PlatRegionSettingListDTO
;
import
com.makeit.dto.platform.space.PlatRegionSettingLocateDTO
;
import
com.makeit.dto.platform.space.PlatRegionSettingLocateDTO
;
import
com.makeit.dto.platform.space.PlatRegionSettingQueryDTO
;
import
com.makeit.dto.platform.space.PlatRegionSettingQueryDTO
;
import
com.makeit.module.iot.vo.space.DeviceInfoContentSpace
;
import
com.makeit.service.platform.space.PlatRegionSettingService
;
import
com.makeit.service.platform.space.PlatRegionSettingService
;
import
com.makeit.vo.platform.elder.realtime.PlatElderCoordinateVO
;
import
com.makeit.vo.platform.elder.realtime.PlatElderCoordinateVO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -55,15 +56,15 @@ public class PlatRegionSettingWechatController {
...
@@ -55,15 +56,15 @@ public class PlatRegionSettingWechatController {
@ApiOperation
(
"定位(时间范围内定位)"
)
@ApiOperation
(
"定位(时间范围内定位)"
)
@PostMapping
(
"locate"
)
@PostMapping
(
"locate"
)
public
ApiResponseEntity
<
List
<
PlatElderCoordinateVO
>>
locate
(
@RequestBody
PlatRegionSettingLocateDTO
dto
)
{
public
ApiResponseEntity
<
List
<
DeviceInfoContentSpace
.
Properties
>>
locate
(
@RequestBody
PlatRegionSettingLocateDTO
dto
)
{
List
<
PlatElderCoordinateVO
>
list
=
platRegionSettingService
.
locate
(
dto
);
List
<
DeviceInfoContentSpace
.
Properties
>
list
=
platRegionSettingService
.
locate
(
dto
);
return
ApiResponseUtils
.
success
(
list
);
return
ApiResponseUtils
.
success
(
list
);
}
}
@ApiOperation
(
"实时定位"
)
@ApiOperation
(
"实时定位"
)
@PostMapping
(
"nowDataLocate"
)
@PostMapping
(
"nowDataLocate"
)
public
ApiResponseEntity
<
PlatElderCoordinateVO
>
nowDataLocate
(
@RequestBody
PlatRegionSettingLocateDTO
dto
)
{
public
ApiResponseEntity
<
DeviceInfoContentSpace
.
Properties
>
nowDataLocate
(
@RequestBody
PlatRegionSettingLocateDTO
dto
)
{
PlatElderCoordinateVO
vo
=
platRegionSettingService
.
nowDataLocate
(
dto
);
DeviceInfoContentSpace
.
Properties
vo
=
platRegionSettingService
.
nowDataLocate
(
dto
);
return
ApiResponseUtils
.
success
(
vo
);
return
ApiResponseUtils
.
success
(
vo
);
}
}
}
}
server-service/src/main/java/com/makeit/dto/platform/device/PlatDeviceDTO.java
View file @
26762860
...
@@ -37,4 +37,7 @@ public class PlatDeviceDTO {
...
@@ -37,4 +37,7 @@ public class PlatDeviceDTO {
@ApiModelProperty
(
value
=
"床位Id"
)
@ApiModelProperty
(
value
=
"床位Id"
)
private
String
bedId
;
private
String
bedId
;
@ApiModelProperty
(
value
=
"设备类型 0-呼吸心率雷达 1-空间人体雷达 2-跌倒检测雷达"
)
private
String
category
;
}
}
server-service/src/main/java/com/makeit/service/platform/dataScreen/impl/DataScreenServiceImpl.java
View file @
26762860
...
@@ -42,6 +42,7 @@ import org.springframework.stereotype.Service;
...
@@ -42,6 +42,7 @@ import org.springframework.stereotype.Service;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.text.DateFormat
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -329,7 +330,7 @@ public class DataScreenServiceImpl implements DataScreenService {
...
@@ -329,7 +330,7 @@ public class DataScreenServiceImpl implements DataScreenService {
}
}
}
}
}
}
Map
<
String
,
List
<
PlatElder
>>
elderMap
=
elders
.
stream
().
collect
(
Collectors
.
groupingBy
(
PlatElder:
:
getSpaceId
));
Map
<
String
,
List
<
PlatElder
>>
elderMap
=
elders
.
stream
().
filter
(
t
->
StringUtil
.
isNotEmpty
(
t
.
getSpaceId
())).
collect
(
Collectors
.
groupingBy
(
PlatElder:
:
getSpaceId
));
Map
<
String
,
PlatElder
>
platElderMap
=
elders
.
stream
().
collect
(
Collectors
.
toMap
(
PlatElder:
:
getId
,
Function
.
identity
()));
Map
<
String
,
PlatElder
>
platElderMap
=
elders
.
stream
().
collect
(
Collectors
.
toMap
(
PlatElder:
:
getId
,
Function
.
identity
()));
//今日告警
//今日告警
List
<
PlatAlarmRecord
>
alarmRecords
=
platAlarmRecordService
.
list
(
new
QueryWrapper
<
PlatAlarmRecord
>().
lambda
()
List
<
PlatAlarmRecord
>
alarmRecords
=
platAlarmRecordService
.
list
(
new
QueryWrapper
<
PlatAlarmRecord
>().
lambda
()
...
@@ -427,8 +428,10 @@ public class DataScreenServiceImpl implements DataScreenService {
...
@@ -427,8 +428,10 @@ public class DataScreenServiceImpl implements DataScreenService {
Map
<
String
,
String
>
elderNameMap
=
platElders
.
stream
().
collect
(
Collectors
.
toMap
(
PlatElder:
:
getId
,
PlatElder:
:
getName
));
Map
<
String
,
String
>
elderNameMap
=
platElders
.
stream
().
collect
(
Collectors
.
toMap
(
PlatElder:
:
getId
,
PlatElder:
:
getName
));
Map
<
String
,
PlatElderListVO
>
elderBedPathMap
=
mapElderBedPath
(
platElders
);
Map
<
String
,
PlatElderListVO
>
elderBedPathMap
=
mapElderBedPath
(
platElders
);
List
<
PlatAlarmStatisticsListVo
>
list
=
new
ArrayList
<>();
List
<
PlatAlarmStatisticsListVo
>
list
=
new
ArrayList
<>();
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
// DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
DateFormat
dft
=
new
SimpleDateFormat
(
"HH:mm:ss"
);
// DateFormat dft = new SimpleDateFormat("HH:mm:ss");
DateTimeFormatter
df
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
DateTimeFormatter
dft
=
DateTimeFormatter
.
ofPattern
(
"HH:mm:ss"
);
for
(
PlatAlarmRecord
record
:
alarmRecords
){
for
(
PlatAlarmRecord
record
:
alarmRecords
){
List
<
String
>
elderIds
=
Arrays
.
asList
(
record
.
getElderIds
().
split
(
","
));
List
<
String
>
elderIds
=
Arrays
.
asList
(
record
.
getElderIds
().
split
(
","
));
...
@@ -459,8 +462,8 @@ public class DataScreenServiceImpl implements DataScreenService {
...
@@ -459,8 +462,8 @@ public class DataScreenServiceImpl implements DataScreenService {
listVo
.
setPath
(
pathName
);
listVo
.
setPath
(
pathName
);
listVo
.
setElderName
(
elderName
);
listVo
.
setElderName
(
elderName
);
listVo
.
setType
(
record
.
getAlarmType
());
listVo
.
setType
(
record
.
getAlarmType
());
listVo
.
setAlarmDate
(
df
.
format
(
record
.
getAlarmDate
()
));
listVo
.
setAlarmDate
(
record
.
getAlarmDate
().
format
(
df
));
listVo
.
setAlarmTime
(
dft
.
format
(
record
.
getAlarmDate
()
));
listVo
.
setAlarmTime
(
record
.
getAlarmDate
().
format
(
dft
));
list
.
add
(
listVo
);
list
.
add
(
listVo
);
}
}
...
...
server-service/src/main/java/com/makeit/service/platform/space/PlatRegionSettingService.java
View file @
26762860
...
@@ -5,6 +5,7 @@ import com.makeit.dto.platform.space.PlatRegionSettingDTO;
...
@@ -5,6 +5,7 @@ import com.makeit.dto.platform.space.PlatRegionSettingDTO;
import
com.makeit.dto.platform.space.PlatRegionSettingLocateDTO
;
import
com.makeit.dto.platform.space.PlatRegionSettingLocateDTO
;
import
com.makeit.dto.platform.space.PlatRegionSettingQueryDTO
;
import
com.makeit.dto.platform.space.PlatRegionSettingQueryDTO
;
import
com.makeit.entity.platform.space.PlatRegionSetting
;
import
com.makeit.entity.platform.space.PlatRegionSetting
;
import
com.makeit.module.iot.vo.space.DeviceInfoContentSpace
;
import
com.makeit.vo.platform.elder.realtime.PlatElderCoordinateVO
;
import
com.makeit.vo.platform.elder.realtime.PlatElderCoordinateVO
;
import
java.util.List
;
import
java.util.List
;
...
@@ -45,7 +46,7 @@ public interface PlatRegionSettingService extends IService<PlatRegionSetting> {
...
@@ -45,7 +46,7 @@ public interface PlatRegionSettingService extends IService<PlatRegionSetting> {
void
batchEdit
(
List
<
PlatRegionSettingDTO
>
dtos
);
void
batchEdit
(
List
<
PlatRegionSettingDTO
>
dtos
);
List
<
PlatElderCoordinateVO
>
locate
(
PlatRegionSettingLocateDTO
dto
);
List
<
DeviceInfoContentSpace
.
Properties
>
locate
(
PlatRegionSettingLocateDTO
dto
);
PlatElderCoordinateVO
nowDataLocate
(
PlatRegionSettingLocateDTO
dto
);
DeviceInfoContentSpace
.
Properties
nowDataLocate
(
PlatRegionSettingLocateDTO
dto
);
}
}
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRegionSettingServiceImpl.java
View file @
26762860
...
@@ -162,33 +162,26 @@ public class PlatRegionSettingServiceImpl extends ServiceImpl<PlatRegionSettingM
...
@@ -162,33 +162,26 @@ public class PlatRegionSettingServiceImpl extends ServiceImpl<PlatRegionSettingM
}
}
@Override
@Override
public
List
<
PlatElderCoordinateVO
>
locate
(
PlatRegionSettingLocateDTO
dto
)
{
public
List
<
DeviceInfoContentSpace
.
Properties
>
locate
(
PlatRegionSettingLocateDTO
dto
)
{
List
<
PlatElderCoordinateVO
>
vos
=
new
ArrayList
<>();
List
<
DeviceInfoContentSpace
.
Properties
>
vos
=
new
ArrayList
<>();
List
<
DeviceOperationLogEntity
>
list
=
iotProductDeviceService
.
getDeviceLogByTimeRange
(
dto
.
getDeviceId
(),
"reportProperty"
,
100
,
dto
.
getStartTime
(),
dto
.
getEndTime
());
List
<
DeviceOperationLogEntity
>
list
=
iotProductDeviceService
.
getDeviceLogByTimeRange
(
dto
.
getDeviceId
(),
"reportProperty"
,
100
,
dto
.
getStartTime
(),
dto
.
getEndTime
());
for
(
DeviceOperationLogEntity
log
:
list
){
for
(
DeviceOperationLogEntity
log
:
list
){
DeviceInfoContentSpace
space
=
JsonUtil
.
toObj
((
String
)
log
.
getContent
(),
DeviceInfoContentSpace
.
class
);
DeviceInfoContentSpace
space
=
JsonUtil
.
toObj
((
String
)
log
.
getContent
(),
DeviceInfoContentSpace
.
class
);
if
(
space
.
getProperties
()!=
null
){
if
(
space
.
getProperties
()!=
null
&&
space
.
getProperties
().
getPersonState
()
==
1
){
PlatElderCoordinateVO
vo
=
new
PlatElderCoordinateVO
();
vos
.
add
(
space
.
getProperties
());
vo
.
setX
(
new
BigDecimal
(
space
.
getProperties
().
getDistance
()).
multiply
(
new
BigDecimal
(
Math
.
cos
(
space
.
getProperties
().
getAngle
())
+
""
)).
setScale
(
2
,
RoundingMode
.
HALF_UP
));
vo
.
setY
(
new
BigDecimal
(
space
.
getProperties
().
getDistance
()).
multiply
(
new
BigDecimal
(
Math
.
sin
(
space
.
getProperties
().
getAngle
())
+
""
)).
setScale
(
2
,
RoundingMode
.
HALF_UP
));
vos
.
add
(
vo
);
}
}
}
}
return
vos
;
return
vos
;
}
}
@Override
@Override
public
PlatElderCoordinateVO
nowDataLocate
(
PlatRegionSettingLocateDTO
dto
)
{
public
DeviceInfoContentSpace
.
Properties
nowDataLocate
(
PlatRegionSettingLocateDTO
dto
)
{
PlatElderCoordinateVO
vo
=
new
PlatElderCoordinateVO
();
DeviceInfoContentSpace
space
=
iotProductDeviceService
.
getLastDeviceLogSpace
(
dto
.
getDeviceId
(),
10
);
DeviceInfoContentSpace
space
=
iotProductDeviceService
.
getLastDeviceLogSpace
(
dto
.
getDeviceId
(),
10
);
if
(
space
==
null
){
if
(
space
==
null
){
return
null
;
return
null
;
}
}
if
(
space
.
getProperties
()!=
null
){
vo
.
setX
(
new
BigDecimal
(
space
.
getProperties
().
getDistance
()).
multiply
(
new
BigDecimal
(
Math
.
cos
(
space
.
getProperties
().
getAngle
())
+
""
)).
setScale
(
2
,
RoundingMode
.
HALF_UP
));
return
space
.
getProperties
();
vo
.
setY
(
new
BigDecimal
(
space
.
getProperties
().
getDistance
()).
multiply
(
new
BigDecimal
(
Math
.
sin
(
space
.
getProperties
().
getAngle
())
+
""
)).
setScale
(
2
,
RoundingMode
.
HALF_UP
));
}
return
vo
;
}
}
}
}
server-service/src/main/java/com/makeit/service/platform/workstation/impl/WorkStationServiceImpl.java
View file @
26762860
...
@@ -36,6 +36,8 @@ import jodd.util.StringUtil;
...
@@ -36,6 +36,8 @@ import jodd.util.StringUtil;
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
java.time.LocalDateTime
;
import
java.time.LocalTime
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -65,6 +67,12 @@ public class WorkStationServiceImpl implements WorkStationService {
...
@@ -65,6 +67,12 @@ public class WorkStationServiceImpl implements WorkStationService {
@Override
@Override
public
WorkStationInstitutionStatisticsVO
institutionStatistics
(
WorkStationQueryDTO
dto
)
{
public
WorkStationInstitutionStatisticsVO
institutionStatistics
(
WorkStationQueryDTO
dto
)
{
WorkStationInstitutionStatisticsVO
vo
=
new
WorkStationInstitutionStatisticsVO
();
WorkStationInstitutionStatisticsVO
vo
=
new
WorkStationInstitutionStatisticsVO
();
if
(
dto
.
getStartTime
()
==
null
){
dto
.
setStartTime
(
LocalDateTime
.
of
(
LocalDateTime
.
now
().
toLocalDate
(),
LocalTime
.
MIN
));
}
if
(
dto
.
getEndTime
()
==
null
){
dto
.
setEndTime
(
LocalDateTime
.
of
(
LocalDateTime
.
now
().
toLocalDate
(),
LocalTime
.
MAX
));
}
if
(
dto
.
getOrgIds
().
isEmpty
())
{
if
(
dto
.
getOrgIds
().
isEmpty
())
{
//获取该账号的权限组织
//获取该账号的权限组织
List
<
PlatOrg
>
orgs
=
belongToScopeList
(
PlatOrgEnum
.
OrgTypeEnum
.
INSTITUTION
.
getValue
());
List
<
PlatOrg
>
orgs
=
belongToScopeList
(
PlatOrgEnum
.
OrgTypeEnum
.
INSTITUTION
.
getValue
());
...
@@ -171,7 +179,10 @@ public class WorkStationServiceImpl implements WorkStationService {
...
@@ -171,7 +179,10 @@ public class WorkStationServiceImpl implements WorkStationService {
elderIds
.
forEach
(
e
->
{
elderIds
.
forEach
(
e
->
{
elderIdList
.
addAll
(
Arrays
.
asList
(
e
.
split
(
","
)));
elderIdList
.
addAll
(
Arrays
.
asList
(
e
.
split
(
","
)));
});
});
if
(
StringUtil
.
isNotEmpty
(
dto
.
getAlarmType
())){
dto
.
setElderIds
(
elderIdList
);
dto
.
setElderIds
(
elderIdList
);
}
//长者对应的报警类型
//长者对应的报警类型
Map
<
String
,
Map
<
String
,
String
>>
elderAlarmTypeMap
=
mapElderAlarmType
(
alarmRecords
);
Map
<
String
,
Map
<
String
,
String
>>
elderAlarmTypeMap
=
mapElderAlarmType
(
alarmRecords
);
Page
<
WorkStationInstitutionRoomVO
>
pages
=
platRoomService
.
workStationPage
(
Page
<
WorkStationInstitutionRoomVO
>
pages
=
platRoomService
.
workStationPage
(
...
@@ -265,6 +276,12 @@ public class WorkStationServiceImpl implements WorkStationService {
...
@@ -265,6 +276,12 @@ public class WorkStationServiceImpl implements WorkStationService {
@Override
@Override
public
WorkStationHomeStatisticsVO
homeStatistics
(
WorkStationQueryDTO
dto
)
{
public
WorkStationHomeStatisticsVO
homeStatistics
(
WorkStationQueryDTO
dto
)
{
if
(
dto
.
getStartTime
()
==
null
){
dto
.
setStartTime
(
LocalDateTime
.
of
(
LocalDateTime
.
now
().
toLocalDate
(),
LocalTime
.
MIN
));
}
if
(
dto
.
getEndTime
()
==
null
){
dto
.
setEndTime
(
LocalDateTime
.
of
(
LocalDateTime
.
now
().
toLocalDate
(),
LocalTime
.
MAX
));
}
WorkStationHomeStatisticsVO
vo
=
new
WorkStationHomeStatisticsVO
();
WorkStationHomeStatisticsVO
vo
=
new
WorkStationHomeStatisticsVO
();
if
(
dto
.
getOrgIds
().
isEmpty
())
{
if
(
dto
.
getOrgIds
().
isEmpty
())
{
//获取该账号的权限组织
//获取该账号的权限组织
...
@@ -350,7 +367,10 @@ public class WorkStationServiceImpl implements WorkStationService {
...
@@ -350,7 +367,10 @@ public class WorkStationServiceImpl implements WorkStationService {
elderIds
.
forEach
(
e
->
{
elderIds
.
forEach
(
e
->
{
elderIdList
.
addAll
(
Arrays
.
asList
(
e
.
split
(
","
)));
elderIdList
.
addAll
(
Arrays
.
asList
(
e
.
split
(
","
)));
});
});
if
(
StringUtil
.
isNotEmpty
(
dto
.
getAlarmType
())){
dto
.
setElderIds
(
elderIdList
);
dto
.
setElderIds
(
elderIdList
);
}
//长者对应的报警类型
//长者对应的报警类型
Map
<
String
,
Map
<
String
,
String
>>
elderAlarmTypeMap
=
mapElderAlarmType
(
alarmRecords
);
Map
<
String
,
Map
<
String
,
String
>>
elderAlarmTypeMap
=
mapElderAlarmType
(
alarmRecords
);
...
...
server-service/src/main/java/com/makeit/service/wechat/impl/PlatElderCenterWechatServiceImpl.java
View file @
26762860
...
@@ -70,7 +70,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe
...
@@ -70,7 +70,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe
homeVo
.
setElderNumber
(
0
);
homeVo
.
setElderNumber
(
0
);
return
homeVo
;
return
homeVo
;
}
}
List
<
String
>
elderIds
=
elders
.
stream
().
map
(
PlatElder:
:
getId
).
collect
(
Collectors
.
toList
());
//
List<String> elderIds = elders.stream().map(PlatElder::getId).collect(Collectors.toList());
//获取父级的所有子级空间
//获取父级的所有子级空间
List
<
PlatSpace
>
spaces
=
platSpaceService
.
listChild
(
Arrays
.
asList
(
dto
.
getSpaceId
()));
List
<
PlatSpace
>
spaces
=
platSpaceService
.
listChild
(
Arrays
.
asList
(
dto
.
getSpaceId
()));
List
<
String
>
spaceIds
=
spaces
.
stream
().
map
(
PlatSpace:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
String
>
spaceIds
=
spaces
.
stream
().
map
(
PlatSpace:
:
getId
).
collect
(
Collectors
.
toList
());
...
@@ -84,7 +84,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe
...
@@ -84,7 +84,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe
WorkStationQueryDTO
queryDTO
=
new
WorkStationQueryDTO
();
WorkStationQueryDTO
queryDTO
=
new
WorkStationQueryDTO
();
queryDTO
.
setSpaceIds
(
spaceIds
);
queryDTO
.
setSpaceIds
(
spaceIds
);
queryDTO
.
setElderIds
(
elderIds
);
//
queryDTO.setElderIds(elderIds);
List
<
WorkStationHomeBedVO
>
list
=
platBedService
.
selectByCondition
(
queryDTO
);
List
<
WorkStationHomeBedVO
>
list
=
platBedService
.
selectByCondition
(
queryDTO
);
JoinUtil
.
joinSplit
(
list
,
platSpaceService
,
WorkStationHomeBedVO:
:
getSpacePath
,
PlatSpace:
:
getId
,
(
e
,
l
)
->
{
JoinUtil
.
joinSplit
(
list
,
platSpaceService
,
WorkStationHomeBedVO:
:
getSpacePath
,
PlatSpace:
:
getId
,
(
e
,
l
)
->
{
...
@@ -124,7 +124,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe
...
@@ -124,7 +124,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe
);
);
List
<
String
>
elderIds
=
elders
.
stream
().
map
(
PlatElder:
:
getId
).
collect
(
Collectors
.
toList
());
//
List<String> elderIds = elders.stream().map(PlatElder::getId).collect(Collectors.toList());
//获取父级的所有子级空间
//获取父级的所有子级空间
List
<
PlatSpace
>
spaces
=
platSpaceService
.
listChild
(
Arrays
.
asList
(
dto
.
getSpaceId
()));
List
<
PlatSpace
>
spaces
=
platSpaceService
.
listChild
(
Arrays
.
asList
(
dto
.
getSpaceId
()));
List
<
String
>
spaceIds
=
spaces
.
stream
().
map
(
PlatSpace:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
String
>
spaceIds
=
spaces
.
stream
().
map
(
PlatSpace:
:
getId
).
collect
(
Collectors
.
toList
());
...
@@ -136,7 +136,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe
...
@@ -136,7 +136,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe
);
);
WorkStationQueryDTO
queryDTO
=
new
WorkStationQueryDTO
();
WorkStationQueryDTO
queryDTO
=
new
WorkStationQueryDTO
();
queryDTO
.
setSpaceIds
(
spaceIds
);
queryDTO
.
setSpaceIds
(
spaceIds
);
queryDTO
.
setElderIds
(
elderIds
);
//
queryDTO.setElderIds(elderIds);
List
<
WorkStationInstitutionRoomVO
>
roomVOList
=
platRoomService
.
workStationList
(
queryDTO
);
List
<
WorkStationInstitutionRoomVO
>
roomVOList
=
platRoomService
.
workStationList
(
queryDTO
);
if
(
roomVOList
.
isEmpty
())
{
if
(
roomVOList
.
isEmpty
())
{
institutionRoomVO
.
setList
(
new
ArrayList
<>());
institutionRoomVO
.
setList
(
new
ArrayList
<>());
...
...
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