78 lines
2.7 KiB
Java
78 lines
2.7 KiB
Java
package com.macro.mall.controller;
|
|
|
|
import com.macro.mall.dto.CommonResult;
|
|
import com.macro.mall.dto.OmsOrderDetail;
|
|
import com.macro.mall.dto.OmsOrderQueryParam;
|
|
import com.macro.mall.model.OmsOrder;
|
|
import com.macro.mall.service.OmsOrderService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 订单管理Controller
|
|
* Created by macro on 2018/10/11.
|
|
*/
|
|
@Controller
|
|
@Api(tags = "OmsOrderController", description = "订单管理")
|
|
@RequestMapping("/order")
|
|
public class OmsOrderController {
|
|
@Autowired
|
|
private OmsOrderService orderService;
|
|
|
|
@ApiOperation("查询订单")
|
|
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
@ResponseBody
|
|
public Object list(OmsOrderQueryParam queryParam,
|
|
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
|
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
|
List<OmsOrder> orderList = orderService.list(queryParam, pageSize, pageNum);
|
|
return new CommonResult().pageSuccess(orderList);
|
|
}
|
|
|
|
@ApiOperation("批量发货")
|
|
@RequestMapping(value = "/update/delivery", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
public Object delivery(@RequestParam("ids") List<Long> ids) {
|
|
int count = orderService.delivery(ids);
|
|
if (count > 0) {
|
|
return new CommonResult().success(count);
|
|
}
|
|
return new CommonResult().failed();
|
|
}
|
|
|
|
@ApiOperation("批量关闭订单")
|
|
@RequestMapping(value = "/update/close", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
public Object close(@RequestParam("ids") List<Long> ids) {
|
|
int count = orderService.close(ids);
|
|
if (count > 0) {
|
|
return new CommonResult().success(count);
|
|
}
|
|
return new CommonResult().failed();
|
|
}
|
|
|
|
@ApiOperation("批量删除订单")
|
|
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
public Object delete(@RequestParam("ids") List<Long> ids) {
|
|
int count = orderService.delete(ids);
|
|
if (count > 0) {
|
|
return new CommonResult().success(count);
|
|
}
|
|
return new CommonResult().failed();
|
|
}
|
|
|
|
@ApiOperation("获取订单详情:订单信息、商品信息、操作记录")
|
|
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
|
@ResponseBody
|
|
public Object detail(@PathVariable Long id) {
|
|
OmsOrderDetail orderDetailResult = orderService.detail(id);
|
|
return new CommonResult().success(orderDetailResult);
|
|
}
|
|
}
|