车辆筛选条件修改

This commit is contained in:
2026-06-17 17:30:04 +08:00
parent f21c57943c
commit b1913abab5
4 changed files with 189 additions and 5 deletions

View File

@@ -85,6 +85,16 @@ public class HotVehicleController extends BaseController {
return hotVehicleService.queryPageListByStatus(bo, pageQuery);
}
/**
* 查询公司车辆信息列表(状态为数组,不过滤已绑定驾驶员)
*/
//@SaCheckPermission("resourceManagement:vehicle:list")
@GetMapping("/listByStatusAll")
@Operation(summary = "查询公司车辆信息列表(状态为数组,不过滤已绑定驾驶员)")
public TableDataInfo<HotVehicleVo> listByStatusAll(HotVehicleStatusBo bo, PageQuery pageQuery) {
return hotVehicleService.queryPageListByStatusAll(bo, pageQuery);
}
/**
* 查询当前企业可绑定的车辆列表
*/

View File

@@ -64,6 +64,15 @@ public interface IHotVehicleService {
*/
TableDataInfo<HotVehicleVo> queryPageListByStatus(HotVehicleStatusBo bo, PageQuery pageQuery);
/**
* 分页查询公司车辆信息列表(不过滤已绑定驾驶员)
*
* @param bo 查询条件 车辆状态为字符串逗号拼接
* @param pageQuery 分页参数
* @return 公司车辆信息分页列表
*/
TableDataInfo<HotVehicleVo> queryPageListByStatusAll(HotVehicleStatusBo bo, PageQuery pageQuery);
/**
* 查询当前企业可绑定的车辆列表
*

View File

@@ -195,7 +195,15 @@ public class HotVehicleServiceImpl implements IHotVehicleService {
*/
@Override
public TableDataInfo<HotVehicleVo> queryPageListByStatus(HotVehicleStatusBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<HotVehicle> lqw = buildQueryWrapperByStatus(bo);
LambdaQueryWrapper<HotVehicle> lqw = buildQueryWrapperByStatus(bo, true);
Page<HotVehicleVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
fillCurrentBindingPersonName(result.getRecords());
return TableDataInfo.build(result);
}
@Override
public TableDataInfo<HotVehicleVo> queryPageListByStatusAll(HotVehicleStatusBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<HotVehicle> lqw = buildQueryWrapperByStatus(bo, false);
Page<HotVehicleVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
fillCurrentBindingPersonName(result.getRecords());
return TableDataInfo.build(result);
@@ -417,7 +425,7 @@ public class HotVehicleServiceImpl implements IHotVehicleService {
return lqw;
}
private LambdaQueryWrapper<HotVehicle> buildQueryWrapperByStatus(HotVehicleStatusBo bo) {
private LambdaQueryWrapper<HotVehicle> buildQueryWrapperByStatus(HotVehicleStatusBo bo, boolean onlyUnboundDriver) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<HotVehicle> lqw = Wrappers.lambdaQuery();
lqw.orderByDesc(HotVehicle::getCreateTime, HotVehicle::getId);
@@ -426,9 +434,11 @@ public class HotVehicleServiceImpl implements IHotVehicleService {
lqw.eq(bo.getIsTrailer() != null, HotVehicle::getIsTrailer, bo.getIsTrailer());
lqw.eq(bo.getVehicleStatus() != null, HotVehicle::getVehicleStatus, bo.getVehicleStatus());
lqw.in(HotVehicle::getOperationStatus, Arrays.asList(bo.getOperationStatus().split(",")));
lqw.and(wrapper -> wrapper.isNull(HotVehicle::getCurrentDriver)
.or()
.eq(HotVehicle::getCurrentDriver, ""));
if (onlyUnboundDriver) {
lqw.and(wrapper -> wrapper.isNull(HotVehicle::getCurrentDriver)
.or()
.eq(HotVehicle::getCurrentDriver, ""));
}
lqw.eq(StringUtils.isNotBlank(bo.getBodyImageUrls()), HotVehicle::getBodyImageUrls, bo.getBodyImageUrls());
lqw.eq(StringUtils.isNotBlank(bo.getOtherAttachmentUrls()), HotVehicle::getOtherAttachmentUrls, bo.getOtherAttachmentUrls());
lqw.eq(StringUtils.isNotBlank(bo.getColor()), HotVehicle::getColor, bo.getColor());