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
c8524501
authored
Sep 21, 2023
by
朱淼
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
代码调整
parent
af5ff95a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
24 deletions
server-common/src/main/java/com/makeit/module/iot/vo/space/DeviceInfoContentSpace.java
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/service/platform/space/PlatRegionSettingService.java
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRegionSettingServiceImpl.java
server-common/src/main/java/com/makeit/module/iot/vo/space/DeviceInfoContentSpace.java
View file @
c8524501
...
...
@@ -2,6 +2,7 @@ package com.makeit.module.iot.vo.space;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.makeit.module.iot.vo.breathe.DeviceInfoContentBreathe
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
...
...
@@ -26,10 +27,13 @@ public class DeviceInfoContentSpace {
@JsonProperty
(
"mode"
)
private
Integer
mode
;
@JsonProperty
(
"distance"
)
@ApiModelProperty
(
"人体目标距离雷达位置 范围:0-1000,单位cm"
)
private
Integer
distance
;
@JsonProperty
(
"personState"
)
@ApiModelProperty
(
"0表示无人 ,1表示有人"
)
private
Integer
personState
;
@JsonProperty
(
"angle"
)
@ApiModelProperty
(
"人体目标偏离雷达法线角度范围:±60,单位°"
)
private
Integer
angle
;
@JsonProperty
(
"mount"
)
private
Integer
mount
;
...
...
server-module/src/main/java/com/makeit/module/controller/space/PlatRegionSettingController.java
View file @
c8524501
...
...
@@ -6,6 +6,7 @@ import com.makeit.dto.platform.space.PlatRegionSettingDTO;
import
com.makeit.dto.platform.space.PlatRegionSettingListDTO
;
import
com.makeit.dto.platform.space.PlatRegionSettingLocateDTO
;
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.vo.platform.elder.realtime.PlatElderCoordinateVO
;
import
io.swagger.annotations.Api
;
...
...
@@ -54,15 +55,15 @@ public class PlatRegionSettingController {
@ApiOperation
(
"定位(时间范围内定位)"
)
@PostMapping
(
"locate"
)
public
ApiResponseEntity
<
List
<
PlatElderCoordinateVO
>>
locate
(
@RequestBody
PlatRegionSettingLocateDTO
dto
)
{
List
<
PlatElderCoordinateVO
>
list
=
platRegionSettingService
.
locate
(
dto
);
public
ApiResponseEntity
<
List
<
DeviceInfoContentSpace
.
Properties
>>
locate
(
@RequestBody
PlatRegionSettingLocateDTO
dto
)
{
List
<
DeviceInfoContentSpace
.
Properties
>
list
=
platRegionSettingService
.
locate
(
dto
);
return
ApiResponseUtils
.
success
(
list
);
}
@ApiOperation
(
"实时定位"
)
@PostMapping
(
"nowDataLocate"
)
public
ApiResponseEntity
<
PlatElderCoordinateVO
>
nowDataLocate
(
@RequestBody
PlatRegionSettingLocateDTO
dto
)
{
PlatElderCoordinateVO
vo
=
platRegionSettingService
.
nowDataLocate
(
dto
);
public
ApiResponseEntity
<
DeviceInfoContentSpace
.
Properties
>
nowDataLocate
(
@RequestBody
PlatRegionSettingLocateDTO
dto
)
{
DeviceInfoContentSpace
.
Properties
vo
=
platRegionSettingService
.
nowDataLocate
(
dto
);
return
ApiResponseUtils
.
success
(
vo
);
}
...
...
server-module/src/main/java/com/makeit/module/controller/wechat/space/PlatRegionSettingWechatController.java
View file @
c8524501
...
...
@@ -6,6 +6,7 @@ import com.makeit.dto.platform.space.PlatRegionSettingDTO;
import
com.makeit.dto.platform.space.PlatRegionSettingListDTO
;
import
com.makeit.dto.platform.space.PlatRegionSettingLocateDTO
;
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.vo.platform.elder.realtime.PlatElderCoordinateVO
;
import
io.swagger.annotations.Api
;
...
...
@@ -55,15 +56,15 @@ public class PlatRegionSettingWechatController {
@ApiOperation
(
"定位(时间范围内定位)"
)
@PostMapping
(
"locate"
)
public
ApiResponseEntity
<
List
<
PlatElderCoordinateVO
>>
locate
(
@RequestBody
PlatRegionSettingLocateDTO
dto
)
{
List
<
PlatElderCoordinateVO
>
list
=
platRegionSettingService
.
locate
(
dto
);
public
ApiResponseEntity
<
List
<
DeviceInfoContentSpace
.
Properties
>>
locate
(
@RequestBody
PlatRegionSettingLocateDTO
dto
)
{
List
<
DeviceInfoContentSpace
.
Properties
>
list
=
platRegionSettingService
.
locate
(
dto
);
return
ApiResponseUtils
.
success
(
list
);
}
@ApiOperation
(
"实时定位"
)
@PostMapping
(
"nowDataLocate"
)
public
ApiResponseEntity
<
PlatElderCoordinateVO
>
nowDataLocate
(
@RequestBody
PlatRegionSettingLocateDTO
dto
)
{
PlatElderCoordinateVO
vo
=
platRegionSettingService
.
nowDataLocate
(
dto
);
public
ApiResponseEntity
<
DeviceInfoContentSpace
.
Properties
>
nowDataLocate
(
@RequestBody
PlatRegionSettingLocateDTO
dto
)
{
DeviceInfoContentSpace
.
Properties
vo
=
platRegionSettingService
.
nowDataLocate
(
dto
);
return
ApiResponseUtils
.
success
(
vo
);
}
}
server-service/src/main/java/com/makeit/service/platform/space/PlatRegionSettingService.java
View file @
c8524501
...
...
@@ -5,6 +5,7 @@ import com.makeit.dto.platform.space.PlatRegionSettingDTO;
import
com.makeit.dto.platform.space.PlatRegionSettingLocateDTO
;
import
com.makeit.dto.platform.space.PlatRegionSettingQueryDTO
;
import
com.makeit.entity.platform.space.PlatRegionSetting
;
import
com.makeit.module.iot.vo.space.DeviceInfoContentSpace
;
import
com.makeit.vo.platform.elder.realtime.PlatElderCoordinateVO
;
import
java.util.List
;
...
...
@@ -45,7 +46,7 @@ public interface PlatRegionSettingService extends IService<PlatRegionSetting> {
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 @
c8524501
...
...
@@ -162,33 +162,26 @@ public class PlatRegionSettingServiceImpl extends ServiceImpl<PlatRegionSettingM
}
@Override
public
List
<
PlatElderCoordinateVO
>
locate
(
PlatRegionSettingLocateDTO
dto
)
{
List
<
PlatElderCoordinateVO
>
vos
=
new
ArrayList
<>();
public
List
<
DeviceInfoContentSpace
.
Properties
>
locate
(
PlatRegionSettingLocateDTO
dto
)
{
List
<
DeviceInfoContentSpace
.
Properties
>
vos
=
new
ArrayList
<>();
List
<
DeviceOperationLogEntity
>
list
=
iotProductDeviceService
.
getDeviceLogByTimeRange
(
dto
.
getDeviceId
(),
"reportProperty"
,
100
,
dto
.
getStartTime
(),
dto
.
getEndTime
());
for
(
DeviceOperationLogEntity
log
:
list
){
DeviceInfoContentSpace
space
=
JsonUtil
.
toObj
((
String
)
log
.
getContent
(),
DeviceInfoContentSpace
.
class
);
if
(
space
.
getProperties
()!=
null
){
PlatElderCoordinateVO
vo
=
new
PlatElderCoordinateVO
();
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
);
vos
.
add
(
space
.
getProperties
());
}
}
return
vos
;
}
@Override
public
PlatElderCoordinateVO
nowDataLocate
(
PlatRegionSettingLocateDTO
dto
)
{
PlatElderCoordinateVO
vo
=
new
PlatElderCoordinateVO
();
public
DeviceInfoContentSpace
.
Properties
nowDataLocate
(
PlatRegionSettingLocateDTO
dto
)
{
DeviceInfoContentSpace
space
=
iotProductDeviceService
.
getLastDeviceLogSpace
(
dto
.
getDeviceId
(),
10
);
if
(
space
==
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
));
vo
.
setY
(
new
BigDecimal
(
space
.
getProperties
().
getDistance
()).
multiply
(
new
BigDecimal
(
Math
.
sin
(
space
.
getProperties
().
getAngle
())
+
""
)).
setScale
(
2
,
RoundingMode
.
HALF_UP
));
}
return
vo
;
return
space
.
getProperties
();
}
}
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