|
|
|
@ -33,6 +33,7 @@ import org.springblade.core.boot.ctrl.BladeController;
|
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.constant.BladeConstant; |
|
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
@ -80,25 +81,15 @@ public class ObjectController extends BladeController {
|
|
|
|
|
return R.data(detail); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// @GetMapping("/list")
|
|
|
|
|
// @ApiOperationSupport(order = 2)
|
|
|
|
|
// @ApiOperation(value = "巡检对象列表", notes = "巡检对象列表")
|
|
|
|
|
// public R<IPage<ObjectEntity>> list(ObjectListQueryVO object, Query query, BladeUser bladeUser) {
|
|
|
|
|
// LambdaQueryWrapper<ObjectEntity> queryWrapper = Condition.getQueryWrapper(new ObjectEntity(),object);
|
|
|
|
|
// queryWrapper.orderByDesc(ObjectEntity::getUpdateTime);
|
|
|
|
|
// IPage<ObjectEntity> pages = objectService.page(Condition.getPage(query), (!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.eq(ObjectEntity::getTenantId, bladeUser.getTenantId()) : queryWrapper);
|
|
|
|
|
// return R.data(pages);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
@GetMapping("/list") |
|
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
@ApiOperation(value = "巡检对象列表", notes = "巡检对象列表") |
|
|
|
|
@Operate(label="查询巡检对象分页列表",type = BusinessType.QUERY,ignore = false) |
|
|
|
|
public R<IPage<ObjectEntity>> list(ObjectListQueryVO object, Query query, BladeUser bladeUser) { |
|
|
|
|
public R<IPage<ObjectEntity>> list(ObjectListQueryVO object, Query query) { |
|
|
|
|
IPage<ObjectEntity> pages = Condition.getPage(query); |
|
|
|
|
ObjectEntity entity = new ObjectEntity(); |
|
|
|
|
if(!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)){ |
|
|
|
|
entity.setTenantId(bladeUser.getTenantId()); |
|
|
|
|
if(!AuthUtil.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)){ |
|
|
|
|
entity.setTenantId(AuthUtil.getTenantId()); |
|
|
|
|
} |
|
|
|
|
entity.setCode(object.getCode()); |
|
|
|
|
entity.setName(object.getName()); |
|
|
|
@ -113,10 +104,10 @@ public class ObjectController extends BladeController {
|
|
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
@ApiOperation(value = "其他巡检对象列表-分页", notes = "其他巡检对象列表,分页") |
|
|
|
|
@Operate(label="查询其他巡检对象分页列表",type = BusinessType.QUERY,ignore = false) |
|
|
|
|
public R<IPage<OtherObjectEntity>> otherListPage(OtherObjectListQueryVO object, Query query, BladeUser bladeUser) { |
|
|
|
|
public R<IPage<OtherObjectEntity>> otherListPage(OtherObjectListQueryVO object, Query query) { |
|
|
|
|
LambdaQueryWrapper<OtherObjectEntity> queryWrapper = Condition.getQueryWrapper(new OtherObjectEntity(),object); |
|
|
|
|
queryWrapper.orderByDesc(OtherObjectEntity::getRealId); |
|
|
|
|
IPage<OtherObjectEntity> pages = otherObjectService.page(Condition.getPage(query), (!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.eq(OtherObjectEntity::getTenantId, bladeUser.getTenantId()) : queryWrapper); |
|
|
|
|
IPage<OtherObjectEntity> pages = otherObjectService.page(Condition.getPage(query), (!AuthUtil.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.eq(OtherObjectEntity::getTenantId, AuthUtil.getTenantId()) : queryWrapper); |
|
|
|
|
return R.data(pages); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -124,10 +115,10 @@ public class ObjectController extends BladeController {
|
|
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
@ApiOperation(value = "其他巡检对象列表", notes = "其他巡检对象列表,不分页") |
|
|
|
|
@Operate(label="查询其他巡检对象列表",type = BusinessType.QUERY,ignore = false) |
|
|
|
|
public R<List<OtherObjectEntity>> otherList(OtherObjectListQueryVO object, BladeUser bladeUser) { |
|
|
|
|
public R<List<OtherObjectEntity>> otherList(OtherObjectListQueryVO object) { |
|
|
|
|
LambdaQueryWrapper<OtherObjectEntity> queryWrapper = Condition.getQueryWrapper(new OtherObjectEntity(),object); |
|
|
|
|
queryWrapper.orderByDesc(OtherObjectEntity::getRealId); |
|
|
|
|
List<OtherObjectEntity> list = otherObjectService.list((!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.eq(OtherObjectEntity::getTenantId, bladeUser.getTenantId()) : queryWrapper); |
|
|
|
|
List<OtherObjectEntity> list = otherObjectService.list((!AuthUtil.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.eq(OtherObjectEntity::getTenantId, AuthUtil.getTenantId()) : queryWrapper); |
|
|
|
|
return R.data(list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -135,14 +126,14 @@ public class ObjectController extends BladeController {
|
|
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
@ApiOperation(value = "获获取未绑定的其他来源对象", notes = "获获取未绑定的其他来源对象,分页") |
|
|
|
|
@Operate(label="查询未绑定的其他来源对象",type = BusinessType.QUERY,ignore = false) |
|
|
|
|
public R<IPage<OtherObjectEntity>> otherUnbindList(OtherObjectListQueryVO obj, Query query, BladeUser bladeUser) { |
|
|
|
|
public R<IPage<OtherObjectEntity>> otherUnbindList(OtherObjectListQueryVO obj, Query query) { |
|
|
|
|
IPage<OtherObjectEntity> pages = Condition.getPage(query); |
|
|
|
|
OtherObjectEntity object = new OtherObjectEntity(); |
|
|
|
|
object.setName(obj.getName()); |
|
|
|
|
object.setCode(obj.getCode()); |
|
|
|
|
object.setType(obj.getType()); |
|
|
|
|
object.setRealId(obj.getRealId()); |
|
|
|
|
object.setTenantId(bladeUser.getTenantId()); |
|
|
|
|
object.setTenantId(AuthUtil.getTenantId()); |
|
|
|
|
pages.setRecords(otherObjectService.getUnbindListPage(pages,object)); |
|
|
|
|
return R.data(pages); |
|
|
|
|
} |
|
|
|
|