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
44fd317b
authored
Nov 02, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:修复bug
parent
571a7f76
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
7 deletions
saas-module/src/main/java/com/makeit/controller/device/SaasDeviceController.java
server-service/src/main/java/com/makeit/dto/platform/device/PlatDeviceEditDTO.java
server-service/src/main/java/com/makeit/dto/platform/elder/add/PlatElderBatchEditDTOVO.java
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
saas-module/src/main/java/com/makeit/controller/device/SaasDeviceController.java
View file @
44fd317b
...
@@ -5,6 +5,7 @@ import com.makeit.common.page.PageReqDTO;
...
@@ -5,6 +5,7 @@ import com.makeit.common.page.PageReqDTO;
import
com.makeit.common.page.PageVO
;
import
com.makeit.common.page.PageVO
;
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.device.PlatDeviceAttrDTO
;
import
com.makeit.dto.platform.device.PlatDeviceDetailDTO
;
import
com.makeit.dto.platform.device.PlatDeviceDetailDTO
;
import
com.makeit.dto.saas.device.PlatDeviceEditSaasDTO
;
import
com.makeit.dto.saas.device.PlatDeviceEditSaasDTO
;
import
com.makeit.dto.wechat.device.PlatDeviceAttrWechatDTO
;
import
com.makeit.dto.wechat.device.PlatDeviceAttrWechatDTO
;
...
@@ -72,4 +73,11 @@ public class SaasDeviceController {
...
@@ -72,4 +73,11 @@ public class SaasDeviceController {
return
ApiResponseUtils
.
success
();
return
ApiResponseUtils
.
success
();
}
}
@ApiOperation
(
value
=
"批量编辑设备属性"
,
notes
=
"批量编辑属性,仅相同产品类型的设备可批量编辑属性,点击展示该产品类型的可编辑属性(呼吸心率设备不可编辑设备属性,空间可编辑雷达安装方式和雷达功能模式,跌倒可编辑雷达安装高度"
)
@PostMapping
(
"batchEditProperties"
)
public
ApiResponseEntity
<
List
<
String
>>
batchEditProperties
(
@RequestBody
PlatDeviceAttrDTO
dto
)
{
platDeviceService
.
batchEditProperties
(
dto
);
return
ApiResponseUtils
.
success
();
}
}
}
server-service/src/main/java/com/makeit/dto/platform/device/PlatDeviceEditDTO.java
View file @
44fd317b
...
@@ -27,8 +27,9 @@ public class PlatDeviceEditDTO extends BaseTenantDTO {
...
@@ -27,8 +27,9 @@ public class PlatDeviceEditDTO extends BaseTenantDTO {
@ApiModelProperty
(
value
=
"设备名称"
)
@ApiModelProperty
(
value
=
"设备名称"
)
private
String
name
;
private
String
name
;
@ApiModelProperty
(
value
=
"说明"
)
@ApiModelProperty
(
value
=
"设备属性json"
)
private
String
description
;
private
String
attribute
;
}
}
server-service/src/main/java/com/makeit/dto/platform/elder/add/PlatElderBatchEditDTOVO.java
View file @
44fd317b
...
@@ -17,9 +17,8 @@ import java.util.List;
...
@@ -17,9 +17,8 @@ import java.util.List;
* @since 2023-08-29
* @since 2023-08-29
*/
*/
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"Elder批量变价对象"
,
description
=
"长者批量编辑DTO"
)
@ApiModel
(
value
=
"Elder批量变价对象"
,
description
=
"长者批量编辑DTO"
)
public
class
PlatElderBatchEditDTOVO
extends
BaseTenantDTO
{
public
class
PlatElderBatchEditDTOVO
{
@ApiModelProperty
(
value
=
"ID 添加不需要传此参数"
)
@ApiModelProperty
(
value
=
"ID 添加不需要传此参数"
)
private
List
<
String
>
idList
;
private
List
<
String
>
idList
;
...
...
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
View file @
44fd317b
...
@@ -201,9 +201,25 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -201,9 +201,25 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
BeanUtils
.
copyProperties
(
dto
,
db
,
BaseBusEntity
.
Fields
.
tenantId
);
BeanUtils
.
copyProperties
(
dto
,
db
,
BaseBusEntity
.
Fields
.
tenantId
);
updateById
(
db
);
updateById
(
db
);
deviceCacheUtil
.
put
(
db
);
deviceCacheUtil
.
put
(
db
);
if
(
StringUtils
.
isNotEmpty
(
dto
.
getAttribute
()))
{
PlatDeviceOther
other
=
platDeviceOtherService
.
getOne
(
new
QueryWrapper
<
PlatDeviceOther
>().
lambda
()
.
eq
(
PlatDeviceOther:
:
getDeviceId
,
db
.
getId
()));
if
(
other
!=
null
)
{
other
.
setAttribute
(
dto
.
getAttribute
());
platDeviceOtherService
.
updateById
(
other
);
}
// 写入设备
PlatDeviceAttrWechatDTO
platDeviceAttrWechatDTO
=
JSON
.
parseObject
(
dto
.
getAttribute
(),
PlatDeviceAttrWechatDTO
.
class
);
platDeviceAttrWechatDTO
.
setDeviceId
(
db
.
getOriDeviceId
());
editDeviceProperties
(
platDeviceAttrWechatDTO
);
}
//iotProductDeviceService.syncUpdateDeviceInfo(db.getOriDeviceId(),dto.getName(),db.getProductId());
//iotProductDeviceService.syncUpdateDeviceInfo(db.getOriDeviceId(),dto.getName(),db.getProductId());
}
}
...
@@ -453,8 +469,6 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -453,8 +469,6 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
if
(
CollectionUtils
.
isEmpty
(
dto
.
getDeviceIdList
()))
{
if
(
CollectionUtils
.
isEmpty
(
dto
.
getDeviceIdList
()))
{
return
;
return
;
}
}
PlatDeviceOther
other
=
platDeviceOtherService
.
getOne
(
new
QueryWrapper
<
PlatDeviceOther
>().
lambda
()
.
eq
(
PlatDeviceOther:
:
getOriDeviceId
,
dto
.
getDeviceIdList
()));
Map
<
String
,
Object
>
map
=
getAttrMap
(
dto
);
Map
<
String
,
Object
>
map
=
getAttrMap
(
dto
);
List
<
String
>
resultList
=
Lists
.
newArrayList
();
List
<
String
>
resultList
=
Lists
.
newArrayList
();
for
(
String
deviceId
:
dto
.
getDeviceIdList
())
{
for
(
String
deviceId
:
dto
.
getDeviceIdList
())
{
...
...
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