Commit 0e215e5d by huangjy

fix:划拨组织批量

parent 5ad46f03
...@@ -68,7 +68,7 @@ public class PlatDeviceController { ...@@ -68,7 +68,7 @@ public class PlatDeviceController {
@ApiOperation("划拨组织") @ApiOperation("划拨组织")
@PostMapping("bindOrg") @PostMapping("bindOrg")
public ApiResponseEntity<PlatDeviceViewVO> bindOrg(@Validated @RequestBody PlatDeviceBindOrgDTO platDeviceBindOrgDTO) { public ApiResponseEntity<PlatDeviceViewVO> bindOrg(@RequestBody PlatDeviceBindOrgDTO platDeviceBindOrgDTO) {
platDeviceService.bindOrg(platDeviceBindOrgDTO); platDeviceService.bindOrg(platDeviceBindOrgDTO);
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
......
...@@ -19,9 +19,7 @@ import java.util.List; ...@@ -19,9 +19,7 @@ import java.util.List;
@ApiModel(value = "设备划拨组织对象", description = "设备划拨组织") @ApiModel(value = "设备划拨组织对象", description = "设备划拨组织")
public class PlatDeviceBindOrgDTO { public class PlatDeviceBindOrgDTO {
@ApiModelProperty(value = "设备id集合") @ApiModelProperty(value = "设备id集合")
@NotBlank(message = "设备id不能为空")
private List<String> idList; private List<String> idList;
@ApiModelProperty(value = "组织id") @ApiModelProperty(value = "组织id")
@NotBlank(message = "组织id不能为空") @NotBlank(message = "组织id不能为空")
......
...@@ -719,6 +719,6 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -719,6 +719,6 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
public void bindOrg(PlatDeviceBindOrgDTO dto) { public void bindOrg(PlatDeviceBindOrgDTO dto) {
update(new UpdateWrapper<PlatDevice>().lambda() update(new UpdateWrapper<PlatDevice>().lambda()
.set(PlatDevice::getOrgId,dto.getOrgId()) .set(PlatDevice::getOrgId,dto.getOrgId())
.in(BaseEntity::getId,dto.getIdList())); .in(CollectionUtils.isNotEmpty(dto.getIdList()),BaseEntity::getId,dto.getIdList()));
} }
} }
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