feat(order): 添加订单状态查询功能
- 在 IWmsOrderService接口中新增 queryPageListByStatus 方法 - 在 WmsOrderController 中添加 listByStatus 接口 - 在 WmsOrderServiceImpl 中实现 queryPageListByStatus 方法- 优化查询条件,实现根据订单状态筛选功能
This commit is contained in:
@@ -45,6 +45,14 @@ public class WmsOrderController extends BaseController {
|
||||
return iWmsOrderService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* order_status不是零就查出来
|
||||
* 新接口 不是预订单的
|
||||
*/
|
||||
@GetMapping("/listByStatus")
|
||||
public TableDataInfo<WmsOrderVo> listByStatus(WmsOrderBo bo, PageQuery pageQuery) {
|
||||
return iWmsOrderService.queryPageListByStatus(bo, pageQuery);
|
||||
}
|
||||
/**
|
||||
* 导出订单主列表
|
||||
*/
|
||||
|
||||
@@ -46,4 +46,6 @@ public interface IWmsOrderService {
|
||||
* 校验并批量删除订单主信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
TableDataInfo<WmsOrderVo> queryPageListByStatus(WmsOrderBo bo, PageQuery pageQuery);
|
||||
}
|
||||
|
||||
@@ -48,6 +48,36 @@ public class WmsOrderServiceImpl implements IWmsOrderService {
|
||||
Page<WmsOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
/**
|
||||
* 查询订单主列表ByStatus
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<WmsOrderVo> queryPageListByStatus(WmsOrderBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<WmsOrder> lqw = buildQueryWrapperByStatus(bo);
|
||||
Page<WmsOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
private LambdaQueryWrapper<WmsOrder> buildQueryWrapperByStatus(WmsOrderBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<WmsOrder> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOrderCode()), WmsOrder::getOrderCode, bo.getOrderCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomerName()), WmsOrder::getCustomerName, bo.getCustomerName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSalesManager()), WmsOrder::getSalesManager, bo.getSalesManager());
|
||||
// 修改为order_status不是零就查出来
|
||||
if (bo.getOrderStatus() != null) {
|
||||
if (bo.getOrderStatus() == 0) {
|
||||
// 当orderStatus为0时,查询所有记录(不添加筛选条件)
|
||||
} else {
|
||||
// 当orderStatus不为0且不为null时,按指定状态查询
|
||||
lqw.eq(WmsOrder::getOrderStatus, bo.getOrderStatus());
|
||||
}
|
||||
} else {
|
||||
// 当orderStatus为null时,查询所有非0状态的记录
|
||||
lqw.ne(WmsOrder::getOrderStatus, 0);
|
||||
}
|
||||
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单主列表
|
||||
|
||||
Reference in New Issue
Block a user