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
cb64927e
authored
Oct 10, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
99dc32f7
96c93613
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
91 additions
and
7 deletions
db/inti-elder.sql
server-common/src/main/java/com/makeit/module/system/service/impl/SysConfigServiceImpl.java
server-module/src/main/java/com/makeit/module/controller/dataScreen/DataScreenController.java
server-service/src/main/java/com/makeit/dto/platform/dataScreen/PlatDataScreenQueryDTO.java
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatUserServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/dataScreen/DataScreenService.java
server-service/src/main/java/com/makeit/service/platform/dataScreen/impl/DataScreenServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
server-service/src/main/java/com/makeit/vo/platform/auth/PlatPersonDTOVO.java
db/inti-elder.sql
View file @
cb64927e
...
...
@@ -152,7 +152,7 @@ CREATE TABLE `plat_elder_medical_examination_info`
CREATE
TABLE
`plat_elder_children_info`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'id'
,
`elder_id`
varchar
(
6
4
)
NULL
COMMENT
'长者id'
,
`elder_id`
varchar
(
6
00
)
NULL
COMMENT
'长者id'
,
`openid`
varchar
(
64
)
NOT
NULL
COMMENT
'openid'
,
`name`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'姓名'
,
`phone`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'手机号码'
,
...
...
server-common/src/main/java/com/makeit/module/system/service/impl/SysConfigServiceImpl.java
View file @
cb64927e
...
...
@@ -175,6 +175,7 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
Page
<
SysConfig
>
pageList
=
page
(
p
,
listLambdaQueryWrapper
(
sysConfig
));
JoinUtil
.
join
(
pageList
.
getRecords
(),
sysConfigCategoryService
,
SysConfig:
:
getCategoryId
,
SysConfigCategory:
:
getId
,
(
c
,
cc
)
->
{
c
.
setCategoryCode
(
cc
.
getCode
());
c
.
setCategoryName
(
cc
.
getName
());
});
...
...
server-module/src/main/java/com/makeit/module/controller/dataScreen/DataScreenController.java
View file @
cb64927e
...
...
@@ -5,11 +5,13 @@ import com.makeit.common.page.PageVO;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.dto.platform.dataScreen.PlatDataScreenQueryDTO
;
import
com.makeit.dto.platform.device.PlatDeviceQueryDTO
;
import
com.makeit.dto.platform.space.PlatBedQueryDTO
;
import
com.makeit.module.system.entity.ChinaArea
;
import
com.makeit.service.platform.dataScreen.DataScreenService
;
import
com.makeit.utils.area.ChinaAreaVO
;
import
com.makeit.vo.platform.dataScreen.*
;
import
com.makeit.vo.platform.device.PlatDeviceListVO
;
import
com.makeit.vo.platform.space.PlatBedVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -83,4 +85,10 @@ public class DataScreenController {
return
ApiResponseUtils
.
success
(
dataScreenService
.
mapList
(
dto
));
}
@ApiOperation
(
"设备分页列表"
)
@PostMapping
(
"devicePage"
)
public
ApiResponseEntity
<
PageVO
<
PlatDeviceListVO
>>
devicePage
(
@RequestBody
PageReqDTO
<
PlatDataScreenQueryDTO
>
pageReqDTO
)
{
return
ApiResponseUtils
.
success
(
dataScreenService
.
devicePage
(
pageReqDTO
));
}
}
server-service/src/main/java/com/makeit/dto/platform/dataScreen/PlatDataScreenQueryDTO.java
View file @
cb64927e
...
...
@@ -31,4 +31,7 @@ public class PlatDataScreenQueryDTO {
@ApiModelProperty
(
"类型 1-居家 2-机构"
)
private
String
type
;
@ApiModelProperty
(
"设备状态"
)
private
String
deviceStatus
;
}
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatUserServiceImpl.java
View file @
cb64927e
...
...
@@ -909,6 +909,9 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
fillDept
(
Arrays
.
asList
(
userVO
));
getRoleList
(
userVO
);
PlatTenant
platTenant
=
platTenantService
.
getById
(
userVO
.
getTenantId
());
userVO
.
setPlatTenant
(
platTenant
);
return
userVO
;
}
...
...
server-service/src/main/java/com/makeit/service/platform/dataScreen/DataScreenService.java
View file @
cb64927e
...
...
@@ -3,8 +3,10 @@ package com.makeit.service.platform.dataScreen;
import
com.makeit.common.page.PageReqDTO
;
import
com.makeit.common.page.PageVO
;
import
com.makeit.dto.platform.dataScreen.PlatDataScreenQueryDTO
;
import
com.makeit.dto.platform.device.PlatDeviceQueryDTO
;
import
com.makeit.utils.area.ChinaAreaVO
;
import
com.makeit.vo.platform.dataScreen.*
;
import
com.makeit.vo.platform.device.PlatDeviceListVO
;
import
java.util.List
;
...
...
@@ -30,4 +32,6 @@ public interface DataScreenService {
List
<
ChinaAreaVO
>
mapList
(
PlatDataScreenQueryDTO
dto
);
PageVO
<
PlatAlarmStatisticsListVo
>
alarmPage
(
PageReqDTO
<
PlatDataScreenQueryDTO
>
page
);
PageVO
<
PlatDeviceListVO
>
devicePage
(
PageReqDTO
<
PlatDataScreenQueryDTO
>
pageReqDTO
);
}
server-service/src/main/java/com/makeit/service/platform/dataScreen/impl/DataScreenServiceImpl.java
View file @
cb64927e
package
com
.
makeit
.
service
.
platform
.
dataScreen
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.makeit.common.entity.BaseEntity
;
import
com.makeit.common.page.PageReqDTO
;
import
com.makeit.common.page.PageVO
;
import
com.makeit.dto.platform.dataScreen.PlatDataScreenQueryDTO
;
import
com.makeit.dto.platform.device.PlatDeviceQueryDTO
;
import
com.makeit.entity.platform.alarm.PlatAlarmRecord
;
import
com.makeit.entity.platform.auth.PlatOrg
;
import
com.makeit.entity.platform.auth.PlatUser
;
...
...
@@ -32,8 +35,10 @@ import com.makeit.utils.area.ChinaAreaVO;
import
com.makeit.utils.data.convert.BeanDtoVoUtils
;
import
com.makeit.utils.data.convert.PageUtil
;
import
com.makeit.utils.data.convert.StreamUtil
;
import
com.makeit.utils.old.StringUtils
;
import
com.makeit.utils.sql.join.JoinUtil
;
import
com.makeit.vo.platform.dataScreen.*
;
import
com.makeit.vo.platform.device.PlatDeviceListVO
;
import
com.makeit.vo.platform.elder.PlatElderListVO
;
import
jodd.util.StringUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -470,6 +475,52 @@ public class DataScreenServiceImpl implements DataScreenService {
return
PageUtil
.
toPageVO
(
list
,
pages
);
}
@Override
public
PageVO
<
PlatDeviceListVO
>
devicePage
(
PageReqDTO
<
PlatDataScreenQueryDTO
>
pageReqDTO
)
{
PlatDataScreenQueryDTO
dto
=
pageReqDTO
.
getData
();
if
(
dto
.
getOrgIds
().
isEmpty
()){
//获取该账号的权限组织
List
<
PlatOrg
>
orgs
=
belongToScopeList
(
dto
.
getType
());
if
(
orgs
.
isEmpty
()){
return
new
PageVO
<>();
}
List
<
String
>
orgIds
=
orgs
.
stream
().
map
(
PlatOrg:
:
getId
).
collect
(
Collectors
.
toList
());
dto
.
setOrgIds
(
orgIds
);
}
else
{
//根据类型过滤数据
List
<
PlatOrg
>
platOrgs
=
platOrgService
.
list
(
new
QueryWrapper
<
PlatOrg
>().
lambda
()
.
in
(
PlatOrg:
:
getId
,
dto
.
getOrgIds
())
.
eq
(
PlatOrg:
:
getType
,
dto
.
getType
()));
if
(
platOrgs
.
isEmpty
()){
return
new
PageVO
<>();
}
List
<
String
>
orgIdList
=
platOrgs
.
stream
().
map
(
PlatOrg:
:
getId
).
collect
(
Collectors
.
toList
());
dto
.
setOrgIds
(
orgIdList
);
}
Page
<
PlatDevice
>
p
=
PageUtil
.
toMpPage
(
pageReqDTO
);
LambdaQueryWrapper
queryWrapper
=
new
LambdaQueryWrapper
<
PlatDevice
>()
.
eq
(
StringUtils
.
isNotBlank
(
dto
.
getDeviceStatus
()),
PlatDevice:
:
getStatus
,
dto
.
getDeviceStatus
())
.
in
(
PlatDevice:
:
getOrgId
,
dto
.
getOrgIds
())
.
orderByDesc
(
BaseEntity:
:
getUpdateDate
);
Page
<
PlatDevice
>
page
=
platDeviceService
.
page
(
p
,
queryWrapper
);
List
<
PlatDeviceListVO
>
voList
=
BeanDtoVoUtils
.
listVo
(
page
.
getRecords
(),
PlatDeviceListVO
.
class
);
JoinUtil
.
join
(
voList
,
platOrgService
,
PlatDeviceListVO:
:
getOrgId
,
PlatOrg:
:
getId
,
(
d
,
o
)
->
{
d
.
setOrgName
(
o
.
getName
());
});
JoinUtil
.
joinSplit
(
voList
,
platOrgService
,
PlatDeviceListVO:
:
getOrgPath
,
PlatOrg:
:
getId
,
(
d
,
o
)
->
{
d
.
setOrgPathName
(
StreamUtil
.
join
(
o
,
PlatOrg:
:
getName
));
});
return
PageUtil
.
toPageVO
(
voList
,
page
);
}
private
List
<
PlatOrg
>
getAncestorsOrgList
(
List
<
PlatOrg
>
orgs
,
Set
<
String
>
parentOrgIds
)
{
orgs
=
orgs
.
stream
().
filter
(
t
->
parentOrgIds
.
contains
(
t
.
getId
())).
collect
(
Collectors
.
toList
());
Set
<
String
>
ancestorsOrgIdList
=
new
HashSet
<>();
...
...
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
View file @
cb64927e
...
...
@@ -35,6 +35,7 @@ import com.makeit.service.platform.space.PlatRegionSettingService;
import
com.makeit.service.saas.PlatTenantService
;
import
com.makeit.utils.DeviceCacheUtil
;
import
com.makeit.utils.data.convert.BeanDtoVoUtils
;
import
com.makeit.utils.data.convert.JsonUtil
;
import
com.makeit.utils.data.convert.PageUtil
;
import
com.makeit.utils.data.convert.StreamUtil
;
import
com.makeit.utils.old.StringUtils
;
...
...
@@ -210,10 +211,14 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
platDeviceOtherService
.
saveOrUpdate
(
other
);
//更新区域设置设备安装方式
platRegionSettingService
.
update
(
new
UpdateWrapper
<
PlatRegionSetting
>().
lambda
()
.
set
(
PlatRegionSetting:
:
getInstallType
,
other
.
getInstallation
())
.
eq
(
PlatRegionSetting:
:
getDeviceId
,
other
.
getDeviceId
()));
if
(
StringUtils
.
isNotEmpty
(
other
.
getAttribute
())){
PlatDeviceAttrWechatDTO
deviceAttrWechatDTO
=
JsonUtil
.
toObj
(
other
.
getAttribute
(),
PlatDeviceAttrWechatDTO
.
class
);
//更新区域设置设备安装方式
platRegionSettingService
.
update
(
new
UpdateWrapper
<
PlatRegionSetting
>().
lambda
()
.
set
(
PlatRegionSetting:
:
getInstallType
,
deviceAttrWechatDTO
.
getRadarMount
())
.
eq
(
PlatRegionSetting:
:
getDeviceId
,
other
.
getDeviceId
()));
}
}
@Override
...
...
@@ -292,6 +297,11 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
public
void
editDeviceProperties
(
PlatDeviceAttrWechatDTO
dto
)
{
devicePropertiesOperateService
.
deviceWrite
(
dto
.
getDeviceId
(),
dto
.
getRadarMount
(),
dto
.
getRadarMode
(),
dto
.
getRadarHight
());
//更新区域设置设备安装方式
platRegionSettingService
.
update
(
new
UpdateWrapper
<
PlatRegionSetting
>().
lambda
()
.
set
(
PlatRegionSetting:
:
getInstallType
,
dto
.
getRadarMount
())
.
eq
(
PlatRegionSetting:
:
getDeviceId
,
dto
.
getDeviceId
()));
}
@Override
...
...
server-service/src/main/java/com/makeit/vo/platform/auth/PlatPersonDTOVO.java
View file @
cb64927e
...
...
@@ -3,7 +3,8 @@ package com.makeit.vo.platform.auth;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.makeit.common.dto.BaseIdDTO
;
import
com.makeit.common.dto.BaseTenantDTO
;
import
com.makeit.entity.saas.PlatTenant
;
import
com.makeit.module.admin.dto.plat.PlatRoleDTOVO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -17,7 +18,7 @@ import java.util.List;
@ApiModel
(
"租户账号 新增 编辑 详情"
)
@Data
public
class
PlatPersonDTOVO
extends
Base
Id
DTO
{
public
class
PlatPersonDTOVO
extends
Base
Tenant
DTO
{
@NotBlank
(
message
=
"用户名不能为空"
)
@Size
(
max
=
64
,
message
=
"用户名最长为64字符"
)
...
...
@@ -92,6 +93,9 @@ public class PlatPersonDTOVO extends BaseIdDTO {
@ApiModelProperty
(
value
=
"角色名称,逗号拼接"
)
private
String
roleNameJoin
;
@ApiModelProperty
(
value
=
"租户信息"
)
private
PlatTenant
platTenant
;
}
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