|
|
|
@@ -92,16 +92,14 @@ public class WxOrderController extends BaseController { |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "分页订单列表接口", notes = "{\"pageNum\":Integer,\"pageSize\":Integer,\"orderStatus\":\"0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)\"}") |
|
|
|
@ApiOperation("分页订单列表接口") |
|
|
|
@GetMapping("list") |
|
|
|
public ResultData list(@RequestBody Map<String, Object> paramMap) { |
|
|
|
Integer pageNum = (Integer) paramMap.get("pageNum"); |
|
|
|
Integer pageSize = (Integer) paramMap.get("pageSize"); |
|
|
|
Integer orderStatus = (Integer) paramMap.get("orderStatus"); |
|
|
|
if (pageNum <= 0) |
|
|
|
pageNum = 1; |
|
|
|
if (pageSize <= 0) |
|
|
|
pageSize = 10; |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), |
|
|
|
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true), |
|
|
|
@ApiImplicitParam(name="orderStatus",value="订单状态0-已下单/待付款;1-已支付;2-已取消",dataType="int", paramType = "query",required=false) |
|
|
|
}) |
|
|
|
public ResultData list(Integer orderStatus, Integer pageNum, Integer pageSize) { |
|
|
|
// c端用户应该只能看到自己的订单 |
|
|
|
WxCUser user = getUser(); |
|
|
|
WxOrder wxOrderQ = new WxOrder(); |
|
|
|
@@ -111,11 +109,20 @@ public class WxOrderController extends BaseController { |
|
|
|
return new ResultData(page); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("根据id查询接口") |
|
|
|
@ApiOperation(value = "根据orderId查询接口", notes = "{\"orderId\":\"string\"}") |
|
|
|
@GetMapping("/findById") |
|
|
|
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) |
|
|
|
public ResultData findById(Long id) { |
|
|
|
return new ResultData(Result.SUCCESS, "查询成功", wxOrderService.getById(id)); |
|
|
|
public ResultData findById(@RequestBody Map<String, String> paramMap) { |
|
|
|
String orderIdStr = paramMap.get("orderId"); |
|
|
|
if (StringUtils.isBlank(orderIdStr)) { |
|
|
|
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); |
|
|
|
} |
|
|
|
Long orderId = 0L; |
|
|
|
try { |
|
|
|
orderId = Long.valueOf(orderIdStr); |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
logger.error("parse orderId failed"); |
|
|
|
} |
|
|
|
return new ResultData(Result.SUCCESS, "查询成功", wxOrderService.getById(orderId)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|