AfterSaleOrderController.java 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. package com.ylx.web.controller.massage;
  2. import com.ylx.common.annotation.Log;
  3. import com.ylx.common.core.domain.R;
  4. import com.ylx.common.enums.BusinessType;
  5. import com.ylx.massage.domain.dto.AfterSaleOrderDTO;
  6. import com.ylx.massage.domain.dto.AfterSaleOrderFeeBatchDTO;
  7. import com.ylx.massage.domain.dto.AfterSaleOrderUpdateDTO;
  8. import com.ylx.massage.service.IAfterSaleOrderFeeService;
  9. import com.ylx.massage.service.IAfterSaleOrderService;
  10. import io.swagger.annotations.ApiOperation;
  11. import lombok.extern.slf4j.Slf4j;
  12. import org.springframework.validation.annotation.Validated;
  13. import org.springframework.web.bind.annotation.*;
  14. import javax.annotation.Resource;
  15. @Slf4j
  16. @RestController
  17. @RequestMapping("/after/sale/order")
  18. public class AfterSaleOrderController {
  19. @Resource
  20. private IAfterSaleOrderFeeService afterSaleOrderFeeService;
  21. @Resource
  22. private IAfterSaleOrderService afterSaleOrderService;
  23. @ApiOperation("批量添加售后费用")
  24. @Log(title = "批量添加售后费用", businessType = BusinessType.INSERT)
  25. @PostMapping("/fee/batch")
  26. public R addFee(@Validated @RequestBody AfterSaleOrderFeeBatchDTO batchDTO) {
  27. this.afterSaleOrderFeeService.batchSaveFees(batchDTO);
  28. return R.ok();
  29. }
  30. /**
  31. * 发起售后
  32. * @param dto
  33. * @return R
  34. */
  35. @ApiOperation("发起售后")
  36. @Log(title = "发起售后", businessType = BusinessType.INSERT)
  37. @PostMapping
  38. public R add(@Validated @RequestBody AfterSaleOrderDTO dto) {
  39. this.afterSaleOrderService.add(dto);
  40. return R.ok();
  41. }
  42. @ApiOperation("取消退货/取消申请")
  43. @Log(title = "取消退货/取消申请", businessType = BusinessType.UPDATE)
  44. @PutMapping("/cancel/{orderId}")
  45. public R cancel(@PathVariable Long orderId) {
  46. this.afterSaleOrderService.cancel(orderId);
  47. return R.ok();
  48. }
  49. @ApiOperation("售后信息修改物流单号")
  50. @Log(title = "售后信息修改物流单号", businessType = BusinessType.UPDATE)
  51. @PutMapping
  52. public R updateLogisticsNo(@Validated @RequestBody AfterSaleOrderUpdateDTO dto) {
  53. this.afterSaleOrderService.edit(dto);
  54. return R.ok();
  55. }
  56. @ApiOperation("公众号-修改售后物流单号")
  57. @Log(title = "公众号修改售后物流单号", businessType = BusinessType.UPDATE)
  58. @PutMapping("/wx")
  59. public R wxUpdateLogisticsNo(@Validated @RequestBody AfterSaleOrderUpdateDTO dto) {
  60. this.afterSaleOrderService.editByWechat(dto);
  61. return R.ok();
  62. }
  63. @ApiOperation("商家同意退货申请")
  64. @Log(title = "同意退货", businessType = BusinessType.UPDATE)
  65. @PutMapping("/agree/return/{orderId}")
  66. public R agreeReturn(@PathVariable Long orderId) {
  67. this.afterSaleOrderService.agreeReturn(orderId);
  68. return R.ok();
  69. }
  70. @ApiOperation("商家同意换货申请")
  71. @Log(title = "同意换货", businessType = BusinessType.UPDATE)
  72. @PutMapping("/agree/exchange/{orderId}")
  73. public R agreeExchange(@PathVariable Long orderId) {
  74. this.afterSaleOrderService.agreeExchange(orderId);
  75. return R.ok();
  76. }
  77. @ApiOperation("商家同意退款申请")
  78. @Log(title = "同意退款", businessType = BusinessType.UPDATE)
  79. @PutMapping("/agree/refund/{orderId}")
  80. public R agreeRefund(@PathVariable Long orderId) {
  81. this.afterSaleOrderService.agreeRefund(orderId);
  82. return R.ok();
  83. }
  84. @ApiOperation("商家确认收货")
  85. @Log(title = "确认收货", businessType = BusinessType.UPDATE)
  86. @PutMapping("/confirm/receive/{orderId}")
  87. public R confirmReceive(@PathVariable Long orderId) {
  88. this.afterSaleOrderService.confirmReceive(orderId);
  89. return R.ok();
  90. }
  91. }