Commit 61fe2e4d by huangjy

fix:划拨组织

parent 1325922b
...@@ -7,6 +7,7 @@ import com.makeit.common.page.PageVO; ...@@ -7,6 +7,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.PlatDeviceAttrDTO; 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.PlatDeviceEditDTO;
import com.makeit.dto.platform.device.PlatDeviceQueryDTO; import com.makeit.dto.platform.device.PlatDeviceQueryDTO;
import com.makeit.dto.wechat.device.PlatDeviceAttrWechatDTO; import com.makeit.dto.wechat.device.PlatDeviceAttrWechatDTO;
...@@ -64,19 +65,13 @@ public class PlatDeviceController { ...@@ -64,19 +65,13 @@ public class PlatDeviceController {
return ApiResponseUtils.success(platDeviceService.view(baseIdDTO.getId())); return ApiResponseUtils.success(platDeviceService.view(baseIdDTO.getId()));
} }
@Autowired @ApiOperation("划拨组织")
private IotSyncTask iotSyncTask; @PostMapping("bindOrg")
public ApiResponseEntity<PlatDeviceViewVO> bindOrg(@Validated @RequestBody PlatDeviceBindOrgDTO platDeviceBindOrgDTO) {
@ApiOperation("手动同步") platDeviceService.bindOrg(platDeviceBindOrgDTO);
@PostMapping("iotSyncTask")
@AuthIgnore
@TenantIdIgnore
public ApiResponseEntity<Void> iotSyncTask(@RequestBody BaseIdDTO baseIdDTO) {
//iotSyncTask.savePlatDevice();
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
@ApiOperation("产品下拉") @ApiOperation("产品下拉")
@PostMapping("productList") @PostMapping("productList")
public ApiResponseEntity<List<PlatDevice>> productList(@RequestBody PlatDeviceQueryDTO dto) { public ApiResponseEntity<List<PlatDevice>> productList(@RequestBody PlatDeviceQueryDTO dto) {
......
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;
}
...@@ -5,10 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -5,10 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.makeit.common.page.PageReqDTO; import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO; import com.makeit.common.page.PageVO;
import com.makeit.dto.platform.dataScreen.PlatDataScreenQueryDTO; import com.makeit.dto.platform.dataScreen.PlatDataScreenQueryDTO;
import com.makeit.dto.platform.device.PlatDeviceAttrDTO; import com.makeit.dto.platform.device.*;
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.saas.device.PlatDeviceEditSaasDTO; import com.makeit.dto.saas.device.PlatDeviceEditSaasDTO;
import com.makeit.dto.wechat.device.*; import com.makeit.dto.wechat.device.*;
import com.makeit.entity.platform.device.PlatDevice; import com.makeit.entity.platform.device.PlatDevice;
...@@ -80,4 +77,6 @@ public interface PlatDeviceService extends IService<PlatDevice> { ...@@ -80,4 +77,6 @@ public interface PlatDeviceService extends IService<PlatDevice> {
PageVO<PlatChildDeviceListVO> pageChild(PageReqDTO<PlatChildDeviceDTO> pageReqDTO); PageVO<PlatChildDeviceListVO> pageChild(PageReqDTO<PlatChildDeviceDTO> pageReqDTO);
void modifyWifiInfo(PlatDeviceSetupDTO dto); void modifyWifiInfo(PlatDeviceSetupDTO dto);
void bindOrg(PlatDeviceBindOrgDTO platDeviceBindOrgDTO);
} }
...@@ -715,4 +715,12 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -715,4 +715,12 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
} }
return false; 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()));
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment