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
50bcb034
authored
Sep 14, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
1229420a
7b75c310
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
4 deletions
saas-module/src/main/java/com/makeit/controller/saas/SaasDeviceController.java
server-module/src/main/java/com/makeit/module/controller/device/PlatDeviceController.java
server-service/src/main/java/com/makeit/dto/saas/device/PlatDeviceEditSaasDTO.java
server-service/src/main/java/com/makeit/entity/platform/device/PlatDevice.java
server-service/src/main/java/com/makeit/service/platform/device/PlatDeviceService.java
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
saas-module/src/main/java/com/makeit/controller/saas/SaasDeviceController.java
View file @
50bcb034
...
@@ -6,7 +6,7 @@ import com.makeit.common.page.PageVO;
...
@@ -6,7 +6,7 @@ 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.PlatDeviceDetailDTO
;
import
com.makeit.dto.platform.device.PlatDeviceDetailDTO
;
import
com.makeit.dto.
platform.device.PlatDeviceEdit
DTO
;
import
com.makeit.dto.
saas.device.PlatDeviceEditSaas
DTO
;
import
com.makeit.entity.platform.device.PlatDevice
;
import
com.makeit.entity.platform.device.PlatDevice
;
import
com.makeit.global.aspect.tenant.TenantIdIgnore
;
import
com.makeit.global.aspect.tenant.TenantIdIgnore
;
import
com.makeit.service.platform.device.PlatDeviceService
;
import
com.makeit.service.platform.device.PlatDeviceService
;
...
@@ -42,8 +42,8 @@ public class SaasDeviceController {
...
@@ -42,8 +42,8 @@ public class SaasDeviceController {
@ApiOperation
(
"设备编辑"
)
@ApiOperation
(
"设备编辑"
)
@PostMapping
(
"edit"
)
@PostMapping
(
"edit"
)
@TenantIdIgnore
@TenantIdIgnore
public
ApiResponseEntity
<
Void
>
edit
(
@RequestBody
PlatDeviceEditDTO
dto
)
{
public
ApiResponseEntity
<
Void
>
edit
(
@RequestBody
PlatDeviceEdit
Saas
DTO
dto
)
{
platDeviceService
.
e
dit
(
dto
);
platDeviceService
.
saasE
dit
(
dto
);
return
ApiResponseUtils
.
success
();
return
ApiResponseUtils
.
success
();
}
}
...
...
server-module/src/main/java/com/makeit/module/controller/device/PlatDeviceController.java
View file @
50bcb034
...
@@ -61,7 +61,7 @@ public class PlatDeviceController {
...
@@ -61,7 +61,7 @@ public class PlatDeviceController {
@Autowired
@Autowired
private
IotSyncTask
iotSyncTask
;
private
IotSyncTask
iotSyncTask
;
@ApiOperation
(
"
详情
"
)
@ApiOperation
(
"
手动同步
"
)
@PostMapping
(
"iotSyncTask"
)
@PostMapping
(
"iotSyncTask"
)
@AuthIgnore
@AuthIgnore
@TenantIdIgnore
@TenantIdIgnore
...
...
server-service/src/main/java/com/makeit/dto/saas/device/PlatDeviceEditSaasDTO.java
0 → 100644
View file @
50bcb034
package
com
.
makeit
.
dto
.
saas
.
device
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.makeit.common.dto.BaseTenantDTO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.Size
;
import
java.time.LocalDateTime
;
/**
* <p>
* 设备
* </p>
*
* @author eugene young
* @since 2023-09-05
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"PlatDevice对象"
,
description
=
"设备"
)
public
class
PlatDeviceEditSaasDTO
extends
BaseTenantDTO
{
@NotBlank
(
message
=
"设备名称不能为空"
)
@Size
(
max
=
50
,
message
=
"设备名称最长为50个字符"
)
@ApiModelProperty
(
value
=
"设备名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"设备安装方式"
)
private
String
installation
;
@ApiModelProperty
(
value
=
"开关指示灯"
)
private
String
indicatorLight
;
@ApiModelProperty
(
value
=
"设备属性json"
)
private
String
attribute
;
@ApiModelProperty
(
value
=
"说明"
)
private
String
description
;
@ApiModelProperty
(
value
=
"有效期-开始"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
LocalDateTime
startDate
;
@ApiModelProperty
(
value
=
"有效期-结束"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
LocalDateTime
endDate
;
}
server-service/src/main/java/com/makeit/entity/platform/device/PlatDevice.java
View file @
50bcb034
package
com
.
makeit
.
entity
.
platform
.
device
;
package
com
.
makeit
.
entity
.
platform
.
device
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.makeit.common.entity.BaseBusEntity
;
import
com.makeit.common.entity.BaseBusEntity
;
import
com.makeit.module.iot.enums.DeviceState
;
import
com.makeit.module.iot.enums.DeviceState
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
...
@@ -72,7 +73,10 @@ public class PlatDevice extends BaseBusEntity {
...
@@ -72,7 +73,10 @@ public class PlatDevice extends BaseBusEntity {
@ApiModelProperty
(
value
=
"设备类型 0-呼吸心率雷达 1-空间人体雷达 2-跌倒检测雷达"
)
@ApiModelProperty
(
value
=
"设备类型 0-呼吸心率雷达 1-空间人体雷达 2-跌倒检测雷达"
)
private
String
category
;
private
String
category
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
LocalDateTime
startDate
;
private
LocalDateTime
startDate
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
LocalDateTime
endDate
;
private
LocalDateTime
endDate
;
...
...
server-service/src/main/java/com/makeit/service/platform/device/PlatDeviceService.java
View file @
50bcb034
...
@@ -6,6 +6,7 @@ import com.makeit.common.page.PageVO;
...
@@ -6,6 +6,7 @@ import com.makeit.common.page.PageVO;
import
com.makeit.dto.platform.device.PlatDeviceDetailDTO
;
import
com.makeit.dto.platform.device.PlatDeviceDetailDTO
;
import
com.makeit.dto.platform.device.PlatDeviceEditDTO
;
import
com.makeit.dto.platform.device.PlatDeviceEditDTO
;
import
com.makeit.dto.platform.device.PlatDeviceQueryDTO
;
import
com.makeit.dto.platform.device.PlatDeviceQueryDTO
;
import
com.makeit.dto.saas.device.PlatDeviceEditSaasDTO
;
import
com.makeit.dto.wechat.device.PlatDeviceEditWechatDTO
;
import
com.makeit.dto.wechat.device.PlatDeviceEditWechatDTO
;
import
com.makeit.dto.wechat.device.PlatDeviceSetupDTO
;
import
com.makeit.dto.wechat.device.PlatDeviceSetupDTO
;
import
com.makeit.entity.platform.device.PlatDevice
;
import
com.makeit.entity.platform.device.PlatDevice
;
...
@@ -49,4 +50,6 @@ public interface PlatDeviceService extends IService<PlatDevice> {
...
@@ -49,4 +50,6 @@ public interface PlatDeviceService extends IService<PlatDevice> {
* @return
* @return
*/
*/
PlatDeviceDetailDTO
getDetailDTO
(
String
deviceId
);
PlatDeviceDetailDTO
getDetailDTO
(
String
deviceId
);
void
saasEdit
(
PlatDeviceEditSaasDTO
dto
);
}
}
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
View file @
50bcb034
...
@@ -11,6 +11,7 @@ import com.makeit.common.page.PageVO;
...
@@ -11,6 +11,7 @@ import com.makeit.common.page.PageVO;
import
com.makeit.dto.platform.device.PlatDeviceDetailDTO
;
import
com.makeit.dto.platform.device.PlatDeviceDetailDTO
;
import
com.makeit.dto.platform.device.PlatDeviceEditDTO
;
import
com.makeit.dto.platform.device.PlatDeviceEditDTO
;
import
com.makeit.dto.platform.device.PlatDeviceQueryDTO
;
import
com.makeit.dto.platform.device.PlatDeviceQueryDTO
;
import
com.makeit.dto.saas.device.PlatDeviceEditSaasDTO
;
import
com.makeit.dto.wechat.device.PlatDeviceEditWechatDTO
;
import
com.makeit.dto.wechat.device.PlatDeviceEditWechatDTO
;
import
com.makeit.dto.wechat.device.PlatDeviceSetupDTO
;
import
com.makeit.dto.wechat.device.PlatDeviceSetupDTO
;
import
com.makeit.entity.platform.auth.PlatOrg
;
import
com.makeit.entity.platform.auth.PlatOrg
;
...
@@ -190,6 +191,31 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -190,6 +191,31 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
return
PageUtil
.
toPageVO
(
devicePage
);
return
PageUtil
.
toPageVO
(
devicePage
);
}
}
@Override
public
void
saasEdit
(
PlatDeviceEditSaasDTO
dto
)
{
PlatDevice
db
=
getById
(
dto
.
getId
());
String
id
=
db
.
getId
();
PlatDeviceOther
other
=
platDeviceOtherService
.
getOne
(
new
QueryWrapper
<
PlatDeviceOther
>().
lambda
()
.
eq
(
PlatDeviceOther:
:
getDeviceId
,
db
.
getId
()));
if
(
other
==
null
)
{
other
=
new
PlatDeviceOther
();
}
BeanUtils
.
copyProperties
(
dto
,
db
);
db
.
setId
(
id
);
BeanUtils
.
copyProperties
(
dto
,
other
);
other
.
setDeviceId
(
id
);
updateById
(
db
);
deviceCacheUtil
.
put
(
db
);
platDeviceOtherService
.
saveOrUpdate
(
other
);
}
/**
/**
* 设备信息
* 设备信息
*
*
...
...
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