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
61fe2e4d
authored
Nov 15, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:划拨组织
parent
1325922b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
14 deletions
server-module/src/main/java/com/makeit/module/controller/device/PlatDeviceController.java
server-service/src/main/java/com/makeit/dto/platform/device/PlatDeviceBindOrgDTO.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
server-module/src/main/java/com/makeit/module/controller/device/PlatDeviceController.java
View file @
61fe2e4d
...
...
@@ -7,6 +7,7 @@ import com.makeit.common.page.PageVO;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.dto.platform.device.PlatDeviceAttrDTO
;
import
com.makeit.dto.platform.device.PlatDeviceBindOrgDTO
;
import
com.makeit.dto.platform.device.PlatDeviceEditDTO
;
import
com.makeit.dto.platform.device.PlatDeviceQueryDTO
;
import
com.makeit.dto.wechat.device.PlatDeviceAttrWechatDTO
;
...
...
@@ -64,19 +65,13 @@ public class PlatDeviceController {
return
ApiResponseUtils
.
success
(
platDeviceService
.
view
(
baseIdDTO
.
getId
()));
}
@Autowired
private
IotSyncTask
iotSyncTask
;
@ApiOperation
(
"手动同步"
)
@PostMapping
(
"iotSyncTask"
)
@AuthIgnore
@TenantIdIgnore
public
ApiResponseEntity
<
Void
>
iotSyncTask
(
@RequestBody
BaseIdDTO
baseIdDTO
)
{
//iotSyncTask.savePlatDevice();
@ApiOperation
(
"划拨组织"
)
@PostMapping
(
"bindOrg"
)
public
ApiResponseEntity
<
PlatDeviceViewVO
>
bindOrg
(
@Validated
@RequestBody
PlatDeviceBindOrgDTO
platDeviceBindOrgDTO
)
{
platDeviceService
.
bindOrg
(
platDeviceBindOrgDTO
);
return
ApiResponseUtils
.
success
();
}
@ApiOperation
(
"产品下拉"
)
@PostMapping
(
"productList"
)
public
ApiResponseEntity
<
List
<
PlatDevice
>>
productList
(
@RequestBody
PlatDeviceQueryDTO
dto
)
{
...
...
server-service/src/main/java/com/makeit/dto/platform/device/PlatDeviceBindOrgDTO.java
0 → 100644
View file @
61fe2e4d
package
com
.
makeit
.
dto
.
platform
.
device
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
/**
* <p>
* 设备
* </p>
*
* @author eugene young
* @since 2023-09-05
*/
@Data
@ApiModel
(
value
=
"设备划拨组织对象"
,
description
=
"设备划拨组织"
)
public
class
PlatDeviceBindOrgDTO
{
@ApiModelProperty
(
value
=
"设备id"
)
@NotBlank
(
message
=
"设备id不能为空"
)
private
String
id
;
@ApiModelProperty
(
value
=
"组织id"
)
@NotBlank
(
message
=
"组织id不能为空"
)
private
String
orgId
;
}
server-service/src/main/java/com/makeit/service/platform/device/PlatDeviceService.java
View file @
61fe2e4d
...
...
@@ -5,10 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
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.PlatDeviceAttrDTO
;
import
com.makeit.dto.platform.device.PlatDeviceDetailDTO
;
import
com.makeit.dto.platform.device.PlatDeviceEditDTO
;
import
com.makeit.dto.platform.device.PlatDeviceQueryDTO
;
import
com.makeit.dto.platform.device.*
;
import
com.makeit.dto.saas.device.PlatDeviceEditSaasDTO
;
import
com.makeit.dto.wechat.device.*
;
import
com.makeit.entity.platform.device.PlatDevice
;
...
...
@@ -80,4 +77,6 @@ public interface PlatDeviceService extends IService<PlatDevice> {
PageVO
<
PlatChildDeviceListVO
>
pageChild
(
PageReqDTO
<
PlatChildDeviceDTO
>
pageReqDTO
);
void
modifyWifiInfo
(
PlatDeviceSetupDTO
dto
);
void
bindOrg
(
PlatDeviceBindOrgDTO
platDeviceBindOrgDTO
);
}
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
View file @
61fe2e4d
...
...
@@ -715,4 +715,12 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
}
return
false
;
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
bindOrg
(
PlatDeviceBindOrgDTO
dto
)
{
update
(
new
UpdateWrapper
<
PlatDevice
>().
lambda
()
.
set
(
PlatDevice:
:
getOrgId
,
dto
.
getOrgId
())
.
eq
(
BaseEntity:
:
getId
,
dto
.
getId
()));
}
}
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