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
87a6fc7e
authored
Sep 19, 2023
by
朱淼
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
代码调整
parent
8058aa77
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
239 additions
and
18 deletions
db/space.sql
server-module/src/main/java/com/makeit/module/controller/space/PlatBedController.java
server-module/src/main/java/com/makeit/module/controller/space/PlatRegionSettingController.java
server-module/src/main/java/com/makeit/module/controller/wechat/space/PlatBedWechatController.java
server-module/src/main/java/com/makeit/module/controller/wechat/space/PlatRegionSettingWechatController.java
server-service/src/main/java/com/makeit/dto/platform/space/PlatRegionSettingDTO.java
server-service/src/main/java/com/makeit/dto/platform/space/PlatRegionSettingListDTO.java
server-service/src/main/java/com/makeit/dto/platform/space/PlatRegionSettingLocateDTO.java
server-service/src/main/java/com/makeit/entity/platform/space/PlatRegionSetting.java
server-service/src/main/java/com/makeit/mapper/platform/space/PlatBedMapper.java
server-service/src/main/java/com/makeit/service/platform/space/PlatBedService.java
server-service/src/main/java/com/makeit/service/platform/space/PlatRegionSettingService.java
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatBedServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRegionSettingServiceImpl.java
server-service/src/main/java/com/makeit/vo/platform/space/PlatBedVo.java
server-service/src/main/resources/mappers/PlatBedMapper.xml
db/space.sql
View file @
87a6fc7e
...
@@ -96,5 +96,6 @@ CREATE TABLE `plat_region_setting`
...
@@ -96,5 +96,6 @@ CREATE TABLE `plat_region_setting`
`update_date`
datetime
DEFAULT
NULL
COMMENT
'更新时间'
,
`update_date`
datetime
DEFAULT
NULL
COMMENT
'更新时间'
,
`del_flag`
int
(
1
)
DEFAULT
'0'
COMMENT
'删除标记'
,
`del_flag`
int
(
1
)
DEFAULT
'0'
COMMENT
'删除标记'
,
`tenant_id`
varchar
(
64
)
COLLATE
utf8mb4_general_ci
DEFAULT
NULL
COMMENT
' 租户id '
,
`tenant_id`
varchar
(
64
)
COLLATE
utf8mb4_general_ci
DEFAULT
NULL
COMMENT
' 租户id '
,
`background`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'背景色'
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'区域设置'
;
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'区域设置'
;
server-module/src/main/java/com/makeit/module/controller/space/PlatBedController.java
View file @
87a6fc7e
...
@@ -9,6 +9,7 @@ import com.makeit.dto.platform.space.PlatBedEditDTO;
...
@@ -9,6 +9,7 @@ import com.makeit.dto.platform.space.PlatBedEditDTO;
import
com.makeit.dto.platform.space.PlatBedQueryDTO
;
import
com.makeit.dto.platform.space.PlatBedQueryDTO
;
import
com.makeit.entity.platform.space.PlatBed
;
import
com.makeit.entity.platform.space.PlatBed
;
import
com.makeit.service.platform.space.PlatBedService
;
import
com.makeit.service.platform.space.PlatBedService
;
import
com.makeit.vo.platform.space.PlatBedVo
;
import
io.swagger.annotations.Api
;
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
;
...
@@ -35,8 +36,8 @@ public class PlatBedController {
...
@@ -35,8 +36,8 @@ public class PlatBedController {
@ApiOperation
(
"列表"
)
@ApiOperation
(
"列表"
)
@PostMapping
(
"page"
)
@PostMapping
(
"page"
)
public
ApiResponseEntity
<
PageVO
<
PlatBed
>>
page
(
@RequestBody
PageReqDTO
<
PlatBedQueryDTO
>
page
)
{
public
ApiResponseEntity
<
PageVO
<
PlatBed
Vo
>>
page
(
@RequestBody
PageReqDTO
<
PlatBedQueryDTO
>
page
)
{
PageVO
<
PlatBed
>
data
=
platBedService
.
page
(
page
);
PageVO
<
PlatBed
Vo
>
data
=
platBedService
.
page
(
page
);
return
ApiResponseUtils
.
success
(
data
);
return
ApiResponseUtils
.
success
(
data
);
}
}
...
...
server-module/src/main/java/com/makeit/module/controller/space/PlatRegionSettingController.java
View file @
87a6fc7e
...
@@ -3,8 +3,11 @@ package com.makeit.module.controller.space;
...
@@ -3,8 +3,11 @@ package com.makeit.module.controller.space;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.dto.platform.space.PlatRegionSettingDTO
;
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.dto.platform.space.PlatRegionSettingQueryDTO
;
import
com.makeit.service.platform.space.PlatRegionSettingService
;
import
com.makeit.service.platform.space.PlatRegionSettingService
;
import
com.makeit.vo.platform.elder.realtime.PlatElderCoordinateVO
;
import
io.swagger.annotations.Api
;
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
;
...
@@ -42,4 +45,18 @@ public class PlatRegionSettingController {
...
@@ -42,4 +45,18 @@ public class PlatRegionSettingController {
return
ApiResponseUtils
.
success
();
return
ApiResponseUtils
.
success
();
}
}
@ApiOperation
(
"批量编辑"
)
@PostMapping
(
"batchEdit"
)
public
ApiResponseEntity
<?>
batchEdit
(
@RequestBody
PlatRegionSettingListDTO
dto
)
{
platRegionSettingService
.
batchEdit
(
dto
.
getList
());
return
ApiResponseUtils
.
success
();
}
@ApiOperation
(
"定位"
)
@PostMapping
(
"locate"
)
public
ApiResponseEntity
<
List
<
PlatElderCoordinateVO
>>
locate
(
@RequestBody
PlatRegionSettingLocateDTO
dto
)
{
List
<
PlatElderCoordinateVO
>
list
=
platRegionSettingService
.
locate
(
dto
);
return
ApiResponseUtils
.
success
(
list
);
}
}
}
server-module/src/main/java/com/makeit/module/controller/wechat/space/PlatBedWechatController.java
View file @
87a6fc7e
...
@@ -9,6 +9,7 @@ import com.makeit.dto.platform.space.PlatBedEditDTO;
...
@@ -9,6 +9,7 @@ import com.makeit.dto.platform.space.PlatBedEditDTO;
import
com.makeit.dto.platform.space.PlatBedQueryDTO
;
import
com.makeit.dto.platform.space.PlatBedQueryDTO
;
import
com.makeit.entity.platform.space.PlatBed
;
import
com.makeit.entity.platform.space.PlatBed
;
import
com.makeit.service.platform.space.PlatBedService
;
import
com.makeit.service.platform.space.PlatBedService
;
import
com.makeit.vo.platform.space.PlatBedVo
;
import
io.swagger.annotations.Api
;
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
;
...
@@ -36,8 +37,8 @@ public class PlatBedWechatController {
...
@@ -36,8 +37,8 @@ public class PlatBedWechatController {
@ApiOperation
(
"列表"
)
@ApiOperation
(
"列表"
)
@PostMapping
(
"page"
)
@PostMapping
(
"page"
)
public
ApiResponseEntity
<
PageVO
<
PlatBed
>>
page
(
@RequestBody
PageReqDTO
<
PlatBedQueryDTO
>
page
)
{
public
ApiResponseEntity
<
PageVO
<
PlatBed
Vo
>>
page
(
@RequestBody
PageReqDTO
<
PlatBedQueryDTO
>
page
)
{
PageVO
<
PlatBed
>
data
=
platBedService
.
page
(
page
);
PageVO
<
PlatBed
Vo
>
data
=
platBedService
.
page
(
page
);
return
ApiResponseUtils
.
success
(
data
);
return
ApiResponseUtils
.
success
(
data
);
}
}
...
...
server-module/src/main/java/com/makeit/module/controller/wechat/space/PlatRegionSettingWechatController.java
View file @
87a6fc7e
...
@@ -3,8 +3,11 @@ package com.makeit.module.controller.wechat.space;
...
@@ -3,8 +3,11 @@ package com.makeit.module.controller.wechat.space;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.dto.platform.space.PlatRegionSettingDTO
;
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.dto.platform.space.PlatRegionSettingQueryDTO
;
import
com.makeit.service.platform.space.PlatRegionSettingService
;
import
com.makeit.service.platform.space.PlatRegionSettingService
;
import
com.makeit.vo.platform.elder.realtime.PlatElderCoordinateVO
;
import
io.swagger.annotations.Api
;
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
;
...
@@ -42,4 +45,18 @@ public class PlatRegionSettingWechatController {
...
@@ -42,4 +45,18 @@ public class PlatRegionSettingWechatController {
platRegionSettingService
.
edit
(
dto
);
platRegionSettingService
.
edit
(
dto
);
return
ApiResponseUtils
.
success
();
return
ApiResponseUtils
.
success
();
}
}
@ApiOperation
(
"批量编辑"
)
@PostMapping
(
"batchEdit"
)
public
ApiResponseEntity
<?>
batchEdit
(
@RequestBody
PlatRegionSettingListDTO
dto
)
{
platRegionSettingService
.
batchEdit
(
dto
.
getList
());
return
ApiResponseUtils
.
success
();
}
@ApiOperation
(
"定位"
)
@PostMapping
(
"locate"
)
public
ApiResponseEntity
<
List
<
PlatElderCoordinateVO
>>
locate
(
@RequestBody
PlatRegionSettingLocateDTO
dto
)
{
List
<
PlatElderCoordinateVO
>
list
=
platRegionSettingService
.
locate
(
dto
);
return
ApiResponseUtils
.
success
(
list
);
}
}
}
server-service/src/main/java/com/makeit/dto/platform/space/PlatRegionSettingDTO.java
View file @
87a6fc7e
...
@@ -29,6 +29,9 @@ public class PlatRegionSettingDTO extends BaseIdDTO {
...
@@ -29,6 +29,9 @@ public class PlatRegionSettingDTO extends BaseIdDTO {
@ApiModelProperty
(
"房间门定位"
)
@ApiModelProperty
(
"房间门定位"
)
private
String
roomRange
;
private
String
roomRange
;
@ApiModelProperty
(
"背景色"
)
private
String
background
;
@ApiModelProperty
(
"设备ID"
)
@ApiModelProperty
(
"设备ID"
)
private
String
deviceId
;
private
String
deviceId
;
...
...
server-service/src/main/java/com/makeit/dto/platform/space/PlatRegionSettingListDTO.java
0 → 100644
View file @
87a6fc7e
package
com
.
makeit
.
dto
.
platform
.
space
;
import
com.makeit.common.dto.BaseIdDTO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @Author:lzy
* @Date:2023/9/8 14:51
* @Describe:
*/
@Data
@ApiModel
(
"PlatRegionSettingListDTO"
)
public
class
PlatRegionSettingListDTO
{
private
List
<
PlatRegionSettingDTO
>
list
;
}
server-service/src/main/java/com/makeit/dto/platform/space/PlatRegionSettingLocateDTO.java
0 → 100644
View file @
87a6fc7e
package
com
.
makeit
.
dto
.
platform
.
space
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.makeit.common.dto.BaseIdDTO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
/**
* @Author:lzy
* @Date:2023/9/8 14:51
* @Describe:
*/
@Data
@ApiModel
(
"PlatRegionSettingLocateDTO"
)
public
class
PlatRegionSettingLocateDTO
{
@ApiModelProperty
(
"原始设备ID"
)
private
String
deviceId
;
@ApiModelProperty
(
"开始时间(yyyy-MM-dd HH:mm:ss)"
)
private
String
startTime
;
@ApiModelProperty
(
"结束时间(yyyy-MM-dd HH:mm:ss)"
)
private
String
endTime
;
}
server-service/src/main/java/com/makeit/entity/platform/space/PlatRegionSetting.java
View file @
87a6fc7e
...
@@ -42,4 +42,7 @@ public class PlatRegionSetting extends BaseBusEntity {
...
@@ -42,4 +42,7 @@ public class PlatRegionSetting extends BaseBusEntity {
@ApiModelProperty
(
"房间ID"
)
@ApiModelProperty
(
"房间ID"
)
private
String
roomId
;
private
String
roomId
;
@ApiModelProperty
(
"背景色"
)
private
String
background
;
}
}
server-service/src/main/java/com/makeit/mapper/platform/space/PlatBedMapper.java
View file @
87a6fc7e
package
com
.
makeit
.
mapper
.
platform
.
space
;
package
com
.
makeit
.
mapper
.
platform
.
space
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.makeit.dto.platform.space.PlatBedPanoramaDTO
;
import
com.makeit.dto.platform.space.PlatBedPanoramaDTO
;
import
com.makeit.dto.platform.space.PlatBedQueryDTO
;
import
com.makeit.dto.platform.workstation.WorkStationQueryDTO
;
import
com.makeit.dto.platform.workstation.WorkStationQueryDTO
;
import
com.makeit.dto.saas.SaasOperationLogDTO
;
import
com.makeit.entity.platform.space.PlatBed
;
import
com.makeit.entity.platform.space.PlatBed
;
import
com.makeit.vo.platform.space.PlatBedPanoramaVO
;
import
com.makeit.vo.platform.space.PlatBedPanoramaVO
;
import
com.makeit.vo.platform.space.PlatBedVo
;
import
com.makeit.vo.platform.workstation.WorkStationHomeBedVO
;
import
com.makeit.vo.platform.workstation.WorkStationHomeBedVO
;
import
com.makeit.vo.platform.workstation.WorkStationInstitutionBedVO
;
import
com.makeit.vo.platform.workstation.WorkStationInstitutionBedVO
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -26,4 +30,6 @@ public interface PlatBedMapper extends BaseMapper<PlatBed> {
...
@@ -26,4 +30,6 @@ public interface PlatBedMapper extends BaseMapper<PlatBed> {
List
<
WorkStationInstitutionBedVO
>
selectByRoomIds
(
@Param
(
"roomIds"
)
List
<
String
>
roomIds
);
List
<
WorkStationInstitutionBedVO
>
selectByRoomIds
(
@Param
(
"roomIds"
)
List
<
String
>
roomIds
);
List
<
WorkStationHomeBedVO
>
selectByCondition
(
@Param
(
"dto"
)
WorkStationQueryDTO
dto
);
List
<
WorkStationHomeBedVO
>
selectByCondition
(
@Param
(
"dto"
)
WorkStationQueryDTO
dto
);
Page
<
PlatBedVo
>
getPage
(
Page
<
PlatBedQueryDTO
>
page
,
@Param
(
"params"
)
PlatBedQueryDTO
data
);
}
}
server-service/src/main/java/com/makeit/service/platform/space/PlatBedService.java
View file @
87a6fc7e
...
@@ -9,6 +9,7 @@ import com.makeit.dto.platform.workstation.WorkStationQueryDTO;
...
@@ -9,6 +9,7 @@ import com.makeit.dto.platform.workstation.WorkStationQueryDTO;
import
com.makeit.entity.platform.space.PlatBed
;
import
com.makeit.entity.platform.space.PlatBed
;
import
com.makeit.entity.platform.space.PlatRoom
;
import
com.makeit.entity.platform.space.PlatRoom
;
import
com.makeit.vo.platform.space.PlatBedPanoramaVO
;
import
com.makeit.vo.platform.space.PlatBedPanoramaVO
;
import
com.makeit.vo.platform.space.PlatBedVo
;
import
com.makeit.vo.platform.workstation.WorkStationHomeBedVO
;
import
com.makeit.vo.platform.workstation.WorkStationHomeBedVO
;
import
com.makeit.vo.platform.workstation.WorkStationInstitutionBedVO
;
import
com.makeit.vo.platform.workstation.WorkStationInstitutionBedVO
;
...
@@ -32,7 +33,7 @@ public interface PlatBedService extends IService<PlatBed> {
...
@@ -32,7 +33,7 @@ public interface PlatBedService extends IService<PlatBed> {
* @param pageReqDTO
* @param pageReqDTO
* @return
* @return
*/
*/
PageVO
<
PlatBed
>
page
(
PageReqDTO
<
PlatBedQueryDTO
>
pageReqDTO
);
PageVO
<
PlatBed
Vo
>
page
(
PageReqDTO
<
PlatBedQueryDTO
>
pageReqDTO
);
/**
/**
*
*
...
...
server-service/src/main/java/com/makeit/service/platform/space/PlatRegionSettingService.java
View file @
87a6fc7e
...
@@ -2,8 +2,10 @@ package com.makeit.service.platform.space;
...
@@ -2,8 +2,10 @@ package com.makeit.service.platform.space;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.makeit.dto.platform.space.PlatRegionSettingDTO
;
import
com.makeit.dto.platform.space.PlatRegionSettingDTO
;
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.vo.platform.elder.realtime.PlatElderCoordinateVO
;
import
java.util.List
;
import
java.util.List
;
...
@@ -40,4 +42,8 @@ public interface PlatRegionSettingService extends IService<PlatRegionSetting> {
...
@@ -40,4 +42,8 @@ public interface PlatRegionSettingService extends IService<PlatRegionSetting> {
* @param dto
* @param dto
*/
*/
void
edit
(
PlatRegionSettingDTO
dto
);
void
edit
(
PlatRegionSettingDTO
dto
);
void
batchEdit
(
List
<
PlatRegionSettingDTO
>
dtos
);
List
<
PlatElderCoordinateVO
>
locate
(
PlatRegionSettingLocateDTO
dto
);
}
}
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatBedServiceImpl.java
View file @
87a6fc7e
...
@@ -21,6 +21,7 @@ import com.makeit.service.platform.space.PlatRoomBedDeviceService;
...
@@ -21,6 +21,7 @@ import com.makeit.service.platform.space.PlatRoomBedDeviceService;
import
com.makeit.service.platform.space.PlatRoomService
;
import
com.makeit.service.platform.space.PlatRoomService
;
import
com.makeit.utils.data.convert.PageUtil
;
import
com.makeit.utils.data.convert.PageUtil
;
import
com.makeit.vo.platform.space.PlatBedPanoramaVO
;
import
com.makeit.vo.platform.space.PlatBedPanoramaVO
;
import
com.makeit.vo.platform.space.PlatBedVo
;
import
com.makeit.vo.platform.workstation.WorkStationHomeBedVO
;
import
com.makeit.vo.platform.workstation.WorkStationHomeBedVO
;
import
com.makeit.vo.platform.workstation.WorkStationInstitutionBedVO
;
import
com.makeit.vo.platform.workstation.WorkStationInstitutionBedVO
;
import
jodd.util.StringUtil
;
import
jodd.util.StringUtil
;
...
@@ -81,15 +82,12 @@ public class PlatBedServiceImpl extends ServiceImpl<PlatBedMapper, PlatBed> impl
...
@@ -81,15 +82,12 @@ public class PlatBedServiceImpl extends ServiceImpl<PlatBedMapper, PlatBed> impl
}
}
@Override
@Override
public
PageVO
<
PlatBed
>
page
(
PageReqDTO
<
PlatBedQueryDTO
>
pageReqDTO
)
{
public
PageVO
<
PlatBedVo
>
page
(
PageReqDTO
<
PlatBedQueryDTO
>
pageReqDTO
)
{
Page
<
PlatBedVo
>
pages
=
baseMapper
.
getPage
(
new
Page
<>(
pageReqDTO
.
getPage
(),
pageReqDTO
.
getLimit
()),
pageReqDTO
.
getData
());
return
PageUtil
.
toPageVO
(
pages
);
PlatBedQueryDTO
dto
=
pageReqDTO
.
getData
();
Page
<
PlatBed
>
p
=
PageUtil
.
toMpPage
(
pageReqDTO
);
LambdaQueryWrapper
<
PlatBed
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
like
(
StringUtil
.
isNotEmpty
(
dto
.
getName
()),
PlatBed:
:
getName
,
dto
.
getName
());
queryWrapper
.
eq
(
StringUtil
.
isNotEmpty
(
dto
.
getRoomId
()),
PlatBed:
:
getRoomId
,
dto
.
getRoomId
());
Page
<
PlatBed
>
pages
=
page
(
p
,
queryWrapper
);
return
PageUtil
.
toPageVO
(
pages
.
getRecords
(),
pages
);
}
}
@Override
@Override
...
...
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRegionSettingServiceImpl.java
View file @
87a6fc7e
...
@@ -4,24 +4,34 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -4,24 +4,34 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.makeit.dto.platform.space.PlatRegionSettingDTO
;
import
com.makeit.dto.platform.space.PlatRegionSettingDTO
;
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.device.PlatDevice
;
import
com.makeit.entity.platform.device.PlatDevice
;
import
com.makeit.entity.platform.device.PlatDeviceOther
;
import
com.makeit.entity.platform.device.PlatDeviceOther
;
import
com.makeit.entity.platform.space.PlatRegionSetting
;
import
com.makeit.entity.platform.space.PlatRegionSetting
;
import
com.makeit.enums.platform.device.PlatDeviceEnum
;
import
com.makeit.enums.platform.device.PlatDeviceEnum
;
import
com.makeit.mapper.platform.space.PlatRegionSettingMapper
;
import
com.makeit.mapper.platform.space.PlatRegionSettingMapper
;
import
com.makeit.module.iot.service.IotProductDeviceService
;
import
com.makeit.module.iot.vo.DeviceOperationLogEntity
;
import
com.makeit.module.iot.vo.breathe.DeviceInfoContentBreathe
;
import
com.makeit.module.iot.vo.space.DeviceInfoContentSpace
;
import
com.makeit.service.platform.device.PlatDeviceOtherService
;
import
com.makeit.service.platform.device.PlatDeviceOtherService
;
import
com.makeit.service.platform.device.PlatDeviceService
;
import
com.makeit.service.platform.device.PlatDeviceService
;
import
com.makeit.service.platform.space.PlatRegionSettingService
;
import
com.makeit.service.platform.space.PlatRegionSettingService
;
import
com.makeit.utils.data.convert.BeanDtoVoUtils
;
import
com.makeit.utils.data.convert.BeanDtoVoUtils
;
import
com.makeit.utils.data.convert.JsonUtil
;
import
com.makeit.vo.platform.elder.realtime.PlatElderCoordinateVO
;
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
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -36,6 +46,8 @@ public class PlatRegionSettingServiceImpl extends ServiceImpl<PlatRegionSettingM
...
@@ -36,6 +46,8 @@ public class PlatRegionSettingServiceImpl extends ServiceImpl<PlatRegionSettingM
private
PlatDeviceService
platDeviceService
;
private
PlatDeviceService
platDeviceService
;
@Autowired
@Autowired
private
PlatDeviceOtherService
platDeviceOtherService
;
private
PlatDeviceOtherService
platDeviceOtherService
;
@Autowired
private
IotProductDeviceService
iotProductDeviceService
;
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
@@ -119,6 +131,50 @@ public class PlatRegionSettingServiceImpl extends ServiceImpl<PlatRegionSettingM
...
@@ -119,6 +131,50 @@ public class PlatRegionSettingServiceImpl extends ServiceImpl<PlatRegionSettingM
platRegionSetting
.
setRegionRange
(
dto
.
getRegionRange
());
platRegionSetting
.
setRegionRange
(
dto
.
getRegionRange
());
platRegionSetting
.
setDeviceId
(
dto
.
getDeviceId
());
platRegionSetting
.
setDeviceId
(
dto
.
getDeviceId
());
platRegionSetting
.
setRoomId
(
dto
.
getRoomId
());
platRegionSetting
.
setRoomId
(
dto
.
getRoomId
());
platRegionSetting
.
setBackground
(
dto
.
getBackground
());
updateById
(
platRegionSetting
);
updateById
(
platRegionSetting
);
}
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
batchEdit
(
List
<
PlatRegionSettingDTO
>
dtos
)
{
List
<
String
>
ids
=
dtos
.
stream
().
map
(
PlatRegionSettingDTO:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
PlatRegionSetting
>
platRegionSettings
=
list
(
new
QueryWrapper
<
PlatRegionSetting
>().
lambda
()
.
in
(
PlatRegionSetting:
:
getId
,
ids
));
Map
<
String
,
PlatRegionSetting
>
map
=
platRegionSettings
.
stream
().
collect
(
Collectors
.
toMap
(
PlatRegionSetting:
:
getId
,
Function
.
identity
()));
List
<
PlatRegionSetting
>
updateData
=
new
ArrayList
<>();
for
(
PlatRegionSettingDTO
dto
:
dtos
){
if
(
map
.
containsKey
(
dto
.
getId
())){
PlatRegionSetting
platRegionSetting
=
map
.
get
(
dto
.
getId
());
platRegionSetting
.
setInstallType
(
dto
.
getInstallType
());
platRegionSetting
.
setToward
(
dto
.
getToward
());
platRegionSetting
.
setRegionName
(
dto
.
getRegionName
());
platRegionSetting
.
setRegionRange
(
dto
.
getRegionRange
());
platRegionSetting
.
setDeviceId
(
dto
.
getDeviceId
());
platRegionSetting
.
setRoomId
(
dto
.
getRoomId
());
platRegionSetting
.
setBackground
(
dto
.
getBackground
());
updateData
.
add
(
platRegionSetting
);
}
}
updateBatchById
(
updateData
);
}
@Override
public
List
<
PlatElderCoordinateVO
>
locate
(
PlatRegionSettingLocateDTO
dto
)
{
List
<
PlatElderCoordinateVO
>
vos
=
new
ArrayList
<>();
List
<
DeviceOperationLogEntity
>
list
=
iotProductDeviceService
.
getDeviceLogByTimeRange
(
dto
.
getDeviceId
(),
"reportProperty"
,
10
,
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
);
}
}
return
vos
;
}
}
}
server-service/src/main/java/com/makeit/vo/platform/space/PlatBedVo.java
0 → 100644
View file @
87a6fc7e
package
com
.
makeit
.
vo
.
platform
.
space
;
import
com.makeit.common.entity.BaseBusEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* Controller
*
* @author zm
* @version 2023/9/19
*/
@Data
public
class
PlatBedVo
extends
BaseBusEntity
{
@ApiModelProperty
(
value
=
"名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"房间ID"
)
private
String
roomId
;
@ApiModelProperty
(
value
=
"空间Id"
)
private
String
spaceId
;
@ApiModelProperty
(
value
=
"是否空闲 1 是 0 否"
)
private
String
status
;
@ApiModelProperty
(
value
=
"序号"
)
private
int
sort
;
@ApiModelProperty
(
value
=
"绑定设备"
)
private
String
deviceName
;
}
server-service/src/main/resources/mappers/PlatBedMapper.xml
View file @
87a6fc7e
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
SELECT pb.id,pb.`status`,pb.name bedName ,pm.`name` roomName,pm.space_path,pe.name as elderName,pe.id as elderId
SELECT pb.id,pb.`status`,pb.name bedName ,pm.`name` roomName,pm.space_path,pe.name as elderName,pe.id as elderId
FROM `plat_bed` pb
FROM `plat_bed` pb
LEFT JOIN plat_room pm on pb.room_id = pm.id
LEFT JOIN plat_room pm on pb.room_id = pm.id
LEFT JOIN plat_elder pe on pe.bed_id = pb.id
LEFT JOIN plat_elder pe on pe.bed_id = pb.id
and pe.del_flag = 0
<where>
<where>
pb.del_flag = 0
pb.del_flag = 0
AND pm.id = #{dto.id}
AND pm.id = #{dto.id}
...
@@ -52,8 +52,8 @@
...
@@ -52,8 +52,8 @@
<select
id=
"selectByRoomIds"
resultType=
"com.makeit.vo.platform.workstation.WorkStationInstitutionBedVO"
>
<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,pb.status
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
FROM plat_bed pb
LEFT JOIN plat_elder pe ON pe.bed_id = pb.id
LEFT JOIN plat_elder pe ON pe.bed_id = pb.id
and pe.del_flag = 0
LEFT JOIN plat_room_bed_device prbd ON prbd.bed_id = pb.id
LEFT JOIN plat_room_bed_device prbd ON prbd.bed_id = pb.id
and prbd.del_flag = 0
<where>
<where>
pb.del_flag = 0
pb.del_flag = 0
<if
test=
"roomIds != null and roomIds.size() > 0 "
>
<if
test=
"roomIds != null and roomIds.size() > 0 "
>
...
@@ -71,9 +71,9 @@
...
@@ -71,9 +71,9 @@
LEFT JOIN plat_room pm ON pm.id = pb.room_id
LEFT JOIN plat_room pm ON pm.id = pb.room_id
LEFT JOIN plat_space ps ON ps.id = pm.space_id
LEFT JOIN plat_space ps ON ps.id = pm.space_id
LEFT JOIN plat_elder pe ON pe.bed_id = pb.id
LEFT JOIN plat_elder pe ON pe.bed_id = pb.id
LEFT JOIN plat_room_bed_device prbd ON prbd.bed_id = pb.id
LEFT JOIN plat_room_bed_device prbd ON prbd.bed_id = pb.id
and prbd.del_flag = 0
<where>
<where>
pb.del_flag = 0 and p
e.del_flag = 0 and p
b.status = 0
pb.del_flag = 0 and pb.status = 0
<if
test=
"dto.elderName != null and dto.elderName != ''"
>
<if
test=
"dto.elderName != null and dto.elderName != ''"
>
AND pe.naem LIKE CONCAT('%',#{dto.elderName},'%')
AND pe.naem LIKE CONCAT('%',#{dto.elderName},'%')
</if>
</if>
...
@@ -93,5 +93,34 @@
...
@@ -93,5 +93,34 @@
order by pb.room_id
order by pb.room_id
</select>
</select>
<select
id=
"getPage"
resultType=
"com.makeit.vo.platform.space.PlatBedVo"
>
select
pb.id as id,
pb.name as name,
pb.tenant_id as tenantId,
pb.room_id as roomId,
pb.space_id as spaceId,
pb.status as status,
pb.create_by as createBy,
pb.create_date as createDate,
pb.update_by as updateBy,
pb.update_date as updateDate,
pb.sort as sort,
d.name as deviceName
from plat_bed pb
left join plat_room_bed_device prbd on prbd.bed_id = pb.id and prbd.del_flag = 0
left join plat_device d on d.id = prbd.device_id and d.del_flag = 0
<where>
and pb.del_flag = 0
<if
test=
"params.name != null and params.name != ''"
>
and pb.name like CONCAT('%',#{params.name},'%')
</if>
<if
test=
"params.roomId != null and params.roomId != ''"
>
and pb.room_id = #{params.roomId}
</if>
</where>
</select>
</mapper>
</mapper>
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