|
@@ -1,16 +1,21 @@
|
|
|
package com.yonge.cooleshow.portal.controller;
|
|
|
|
|
|
+import com.yonge.cooleshow.mall.common.api.CommonPage;
|
|
|
import com.yonge.cooleshow.mall.common.api.CommonResult;
|
|
|
+import com.yonge.cooleshow.mbg.model.OmsOrderReturnApply;
|
|
|
+import com.yonge.cooleshow.mbg.model.OmsOrderReturnReason;
|
|
|
import com.yonge.cooleshow.portal.domain.OmsOrderReturnApplyParam;
|
|
|
+import com.yonge.cooleshow.portal.dto.OmsOrderReturnApplyResult;
|
|
|
+import com.yonge.cooleshow.portal.dto.OmsReturnApplyQueryParam;
|
|
|
+import com.yonge.cooleshow.portal.service.OmsOrderReturnReasonService;
|
|
|
import com.yonge.cooleshow.portal.service.OmsPortalOrderReturnApplyService;
|
|
|
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.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
-import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 退货申请管理Controller
|
|
@@ -23,6 +28,9 @@ public class OmsPortalOrderReturnApplyController {
|
|
|
@Autowired
|
|
|
private OmsPortalOrderReturnApplyService returnApplyService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private OmsOrderReturnReasonService orderReturnReasonService;
|
|
|
+
|
|
|
@ApiOperation("申请退货")
|
|
|
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
@@ -33,4 +41,42 @@ public class OmsPortalOrderReturnApplyController {
|
|
|
}
|
|
|
return CommonResult.failed();
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation("分页查询退货原因")
|
|
|
+ @RequestMapping(value = "/reason/list", method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public CommonResult<CommonPage<OmsOrderReturnReason>> list(@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
|
|
+ List<OmsOrderReturnReason> reasonList = orderReturnReasonService.list(pageSize, pageNum);
|
|
|
+ return CommonResult.success(CommonPage.restPage(reasonList));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("分页查询退货申请")
|
|
|
+ @RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public CommonResult<CommonPage<OmsOrderReturnApply>> 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 CommonResult.success(CommonPage.restPage(returnApplyList));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("撤销申请")
|
|
|
+ @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
|
|
|
+ @ResponseBody
|
|
|
+ public CommonResult delete(@PathVariable Long id) {
|
|
|
+ int count = returnApplyService.delete(id);
|
|
|
+ if (count > 0) {
|
|
|
+ return CommonResult.success(count);
|
|
|
+ }
|
|
|
+ return CommonResult.failed();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("获取退货申请详情")
|
|
|
+ @RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public CommonResult getItem(@PathVariable Long id) {
|
|
|
+ OmsOrderReturnApplyResult result = returnApplyService.getItem(id);
|
|
|
+ return CommonResult.success(result);
|
|
|
+ }
|
|
|
}
|