master
parent
1927fe497d
commit
9b465173d9
@ -0,0 +1,34 @@
|
|||||||
|
package com.macro.mall.controller;
|
||||||
|
|
||||||
|
import com.macro.mall.dto.CommonResult;
|
||||||
|
import com.macro.mall.model.OmsCompanyAddress;
|
||||||
|
import com.macro.mall.service.OmsCompanyAddressService;
|
||||||
|
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.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收货地址管理Controller
|
||||||
|
* Created by macro on 2018/10/18.
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@Api(tags = "OmsCompanyAddressController", description = "收货地址管理")
|
||||||
|
@RequestMapping("/companyAddress")
|
||||||
|
public class OmsCompanyAddressController {
|
||||||
|
@Autowired
|
||||||
|
private OmsCompanyAddressService companyAddressService;
|
||||||
|
|
||||||
|
@ApiOperation("获取所有收货地址")
|
||||||
|
@RequestMapping(value = "/list",method = RequestMethod.GET)
|
||||||
|
@ResponseBody
|
||||||
|
public Object list() {
|
||||||
|
List<OmsCompanyAddress> companyAddressList = companyAddressService.list();
|
||||||
|
return new CommonResult().success(companyAddressList);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,110 @@
|
|||||||
|
package com.macro.mall.controller;
|
||||||
|
|
||||||
|
import com.macro.mall.dto.*;
|
||||||
|
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(@RequestBody List<OmsOrderDeliveryParam> deliveryParamList) {
|
||||||
|
int count = orderService.delivery(deliveryParamList);//请求发送订单数量
|
||||||
|
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,@RequestParam String note) {
|
||||||
|
int count = orderService.close(ids,note);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改收货人信息")
|
||||||
|
@RequestMapping(value = "/update/receiverInfo", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public Object updateReceiverInfo(@RequestBody OmsReceiverInfoParam receiverInfoParam) {
|
||||||
|
int count = orderService.updateReceiverInfo(receiverInfoParam);
|
||||||
|
if (count > 0) {
|
||||||
|
return new CommonResult().success(count);
|
||||||
|
}
|
||||||
|
return new CommonResult().failed();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改订单费用信息")
|
||||||
|
@RequestMapping(value = "/update/moneyInfo", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public Object updateReceiverInfo(@RequestBody OmsMoneyInfoParam moneyInfoParam) {
|
||||||
|
int count = orderService.updateMoneyInfo(moneyInfoParam);
|
||||||
|
if (count > 0) {
|
||||||
|
return new CommonResult().success(count);
|
||||||
|
}
|
||||||
|
return new CommonResult().failed();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("备注订单")
|
||||||
|
@RequestMapping(value = "/update/note", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public Object updateNote(@RequestParam("id") Long id,
|
||||||
|
@RequestParam("note") String note,
|
||||||
|
@RequestParam("status") Integer status) {//状态
|
||||||
|
int count = orderService.updateNote(id,note,status);
|
||||||
|
if (count > 0) {
|
||||||
|
return new CommonResult().success(count);
|
||||||
|
}
|
||||||
|
return new CommonResult().failed();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package com.macro.mall.controller;
|
||||||
|
|
||||||
|
import com.macro.mall.dto.CommonResult;
|
||||||
|
import com.macro.mall.dto.OmsOrderReturnApplyResult;
|
||||||
|
import com.macro.mall.dto.OmsReturnApplyQueryParam;
|
||||||
|
import com.macro.mall.dto.OmsUpdateStatusParam;
|
||||||
|
import com.macro.mall.model.OmsOrderReturnApply;
|
||||||
|
import com.macro.mall.service.OmsOrderReturnApplyService;
|
||||||
|
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
|
||||||
|
@Api(tags = "OmsOrderReturnApplyController", description = "订单退货申请管理")
|
||||||
|
@RequestMapping("/returnApply")
|
||||||
|
public class OmsOrderReturnApplyController {//退货请求
|
||||||
|
@Autowired
|
||||||
|
private OmsOrderReturnApplyService returnApplyService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询退货申请")
|
||||||
|
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||||
|
@ResponseBody
|
||||||
|
public Object list(OmsReturnApplyQueryParam queryParam,
|
||||||
|
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||||
|
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||||
|
List<OmsOrderReturnApply> returnApplyList = returnApplyService.list(queryParam, pageSize, pageNum);
|
||||||
|
return new CommonResult().pageSuccess(returnApplyList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除申请")
|
||||||
|
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public Object delete(@RequestParam("ids") List<Long> ids) {
|
||||||
|
int count = returnApplyService.delete(ids);
|
||||||
|
if (count > 0) {
|
||||||
|
return new CommonResult().success(count);
|
||||||
|
}
|
||||||
|
return new CommonResult().failed();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取退货申请详情")
|
||||||
|
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||||
|
@ResponseBody
|
||||||
|
/*@PathVariable绑定URL占位符参数到控制器参数中*/
|
||||||
|
public Object getItem(@PathVariable Long id) {
|
||||||
|
OmsOrderReturnApplyResult result = returnApplyService.getItem(id);
|
||||||
|
return new CommonResult().success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改申请状态")
|
||||||
|
@RequestMapping(value = "/update/status/{id}", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public Object updateStatus(@PathVariable Long id, @RequestBody OmsUpdateStatusParam statusParam) {
|
||||||
|
int count = returnApplyService.updateStatus(id, statusParam);
|
||||||
|
if (count > 0) {
|
||||||
|
return new CommonResult().success(count);
|
||||||
|
}
|
||||||
|
return new CommonResult().failed();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,85 @@
|
|||||||
|
package com.macro.mall.controller;
|
||||||
|
|
||||||
|
import com.macro.mall.dto.CommonResult;
|
||||||
|
import com.macro.mall.model.OmsOrderReturnReason;
|
||||||
|
import com.macro.mall.service.OmsOrderReturnReasonService;
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@Api(tags = "OmsOrderReturnReasonController", description = "退货原因管理")
|
||||||
|
@RequestMapping("/returnReason")
|
||||||
|
public class OmsOrderReturnReasonController {
|
||||||
|
@Autowired
|
||||||
|
private OmsOrderReturnReasonService orderReturnReasonService;
|
||||||
|
|
||||||
|
@ApiOperation("添加退货原因")
|
||||||
|
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public Object create(@RequestBody OmsOrderReturnReason returnReason) {//添加退货原因
|
||||||
|
int count = orderReturnReasonService.create(returnReason);
|
||||||
|
if(count>0){
|
||||||
|
return new CommonResult().success(count);
|
||||||
|
}
|
||||||
|
return new CommonResult().failed();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改退货原因")
|
||||||
|
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public Object update(@PathVariable Long id, @RequestBody OmsOrderReturnReason returnReason) {
|
||||||
|
int count = orderReturnReasonService.update(id,returnReason);
|
||||||
|
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 = orderReturnReasonService.delete(ids);
|
||||||
|
if(count>0){
|
||||||
|
return new CommonResult().success(count);
|
||||||
|
}
|
||||||
|
return new CommonResult().failed();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("分页查询全部退货原因")
|
||||||
|
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||||
|
@ResponseBody
|
||||||
|
public Object list(@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||||
|
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||||
|
List<OmsOrderReturnReason> reasonList = orderReturnReasonService.list(pageSize,pageNum);
|
||||||
|
return new CommonResult().pageSuccess(reasonList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取单个退货原因详情信息")
|
||||||
|
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||||
|
@ResponseBody
|
||||||
|
public Object getItem(@PathVariable Long id) {
|
||||||
|
OmsOrderReturnReason reason = orderReturnReasonService.getItem(id);
|
||||||
|
return new CommonResult().success(reason);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改退货原因启用状态")
|
||||||
|
@RequestMapping(value = "/update/status", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public Object updateStatus(@RequestParam(value = "status") Integer status,
|
||||||
|
@RequestParam("ids") List<Long> ids) {//修改状态
|
||||||
|
int count = orderReturnReasonService.updateStatus(ids,status);
|
||||||
|
if(count>0){
|
||||||
|
return new CommonResult().success(count);
|
||||||
|
}
|
||||||
|
return new CommonResult().failed();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue