Commit 1f4f35bd authored by mlchun's avatar mlchun

添加根据状态和接单用户ID的通用查询接口

parent 291f712b
......@@ -144,6 +144,22 @@ public class PensionOrderController {
return new Result<PageData<PensionOrderDTO>>().ok(page);
}
@Login
@GetMapping("getOrderPageByStatus")
@ApiOperation("根据状态返回订单")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = "status", value = "状态", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
})
public Result<PageData<PensionOrderDTO>> getOrderPageByStatus(@ApiIgnore @LoginUser UserEntity user,
@ApiIgnore @RequestParam Map<String, Object> params){
PageData<PensionOrderDTO> page = pensionOrderService.getOrderPageByStatus(params, user.getId(), Integer.parseInt(params.get("status").toString()));
return new Result<PageData<PensionOrderDTO>>().ok(page);
}
@Login
@GetMapping("orderInfo/{id}")
@ApiOperation("预约订单详情")
......
......@@ -42,4 +42,7 @@ public interface PensionOrderService extends CrudService<PensionOrderEntity, Pen
//根据订单Id和订单状态查询
PensionOrderDTO getOrderInfoByIdAndStatus(Long orderId, Integer status);
//查询已完成订单
PageData<PensionOrderDTO> getOrderPageByStatus(Map<String, Object> params, Long userId, Integer status);
}
\ No newline at end of file
......@@ -114,4 +114,11 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
return ConvertUtils.sourceToTarget(orderEntity, PensionOrderDTO.class);
}
@Override
public PageData<PensionOrderDTO> getOrderPageByStatus(Map<String, Object> params, Long userId, Integer status) {
IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
IPage<PensionOrderEntity> pensionOrderEntityIPage = pensionOrderDao.getOrderPageByStatus(page, userId, status);
return getPageData(pensionOrderEntityIPage, PensionOrderDTO.class);
}
}
\ No newline at end of file
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 to comment