Commit 1c07feb6 authored by mlchun's avatar mlchun

1.服务人员订单接口

2.老人/子女订单接口
3.机构订单接口(未完成)
4.Constant静态类新增订单状态
parent e5e1ab0e
package io.hmit.modules.serviceOrder.controller;
import com.sun.xml.internal.bind.v2.TODO;
import io.hmit.annotation.Login;
import io.hmit.annotation.LoginUser;
import io.hmit.common.constant.Constant;
......@@ -178,6 +179,72 @@ public class PensionOrderController {
return new Result();
}
//新订单接口
/**
* 服务人员订单接口
*/
@Login
@GetMapping("staff")
@ApiOperation(value = "根据状态返回订单列表(服务人员)")
@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 = "订单状态: 1待完成 2已完成 3已取消", 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>> staff(@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("organization")
@ApiOperation(value = "根据状态返回订单列表(机构)")
@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 = "订单状态: 0未接单 1已接单未派发 2已完成 3已取消 5已派发", 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>> organization(@ApiIgnore @LoginUser UserEntity user,
@ApiIgnore @RequestParam Map<String, Object> params){
//TODO 登录->查询登录人员所属机构ID->机构ID查询服务ID(List)->服务ID + 状态查询订单(List)
PageData<PensionOrderDTO> page = pensionOrderService.getOrderPageByStatus(params, user.getId(), Integer.parseInt(params.get("status").toString()));
return new Result<PageData<PensionOrderDTO>>().ok(page);
}
/**
* 老人、子女订单接口
*/
@Login
@GetMapping("elderFamily")
@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 = "订单状态: 0未接单 1待完成 3已取消 4待评价 留空全部", paramType = "query", 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>> elderFamily(@ApiIgnore @LoginUser UserEntity user,
@ApiIgnore @RequestParam Map<String, Object> params){
Integer status = null;
if (null != params.get("status")) {
status = Integer.parseInt(params.get("status").toString());
}
PageData<PensionOrderDTO> page = pensionOrderService.getElderAllOrderOrByStatusPage(params, user.getId(), status);
return new Result<PageData<PensionOrderDTO>>().ok(page);
}
//新订单接口
@GetMapping("{id}")
@ApiOperation("信息")
public Result<PensionOrderDTO> get(@PathVariable("id") Long id){
......
......@@ -188,7 +188,7 @@ public interface Constant {
BOOKED(0,"未接单"),
/**
* 已接单
* 已接单/待完成/已接单未派发
*/
ORDER(1,"已接单"),
/**
......@@ -198,7 +198,15 @@ public interface Constant {
/**
* 已取消
*/
CANCEL(3,"已取消");
CANCEL(3,"已取消"),
/**
* 待评价
*/
WAIT_EVALUATE(4,"待评价"),
/**
* 已派发
*/
HAND_OUT(5,"已派发");
private int status;
......
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