Commit 61fe2e4d by huangjy

fix:划拨组织

parent 1325922b
......@@ -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) {
......
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;
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);
}
......@@ -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()));
}
}
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