mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-29 18:51:53 +08:00
trade:退款理由的维护
This commit is contained in:
parent
3c643f814c
commit
666ba351a2
@ -19,6 +19,19 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class TradeConfigBaseVO {
|
public class TradeConfigBaseVO {
|
||||||
|
|
||||||
|
// ========== 售后相关 ==========
|
||||||
|
|
||||||
|
@Schema(description = "售后的退款理由", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "售后的退款理由不能为空")
|
||||||
|
private List<String> afterSaleRefundReasons;
|
||||||
|
|
||||||
|
@Schema(description = "售后的退货理由", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "售后的退货理由不能为空")
|
||||||
|
private List<String> afterSaleReturnReasons;
|
||||||
|
|
||||||
|
// ========== 配送相关 ==========
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否启用全场包邮
|
* 是否启用全场包邮
|
||||||
*/
|
*/
|
||||||
|
@ -9,7 +9,6 @@ import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppTradeAfterSa
|
|||||||
import cn.iocoder.yudao.module.trade.convert.aftersale.TradeAfterSaleConvert;
|
import cn.iocoder.yudao.module.trade.convert.aftersale.TradeAfterSaleConvert;
|
||||||
import cn.iocoder.yudao.module.trade.enums.aftersale.AfterSaleOperateTypeEnum;
|
import cn.iocoder.yudao.module.trade.enums.aftersale.AfterSaleOperateTypeEnum;
|
||||||
import cn.iocoder.yudao.module.trade.enums.aftersale.TradeAfterSaleStatusEnum;
|
import cn.iocoder.yudao.module.trade.enums.aftersale.TradeAfterSaleStatusEnum;
|
||||||
import cn.iocoder.yudao.module.trade.enums.aftersale.TradeAfterSaleWayEnum;
|
|
||||||
import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.annotations.AfterSaleLog;
|
import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.annotations.AfterSaleLog;
|
||||||
import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.util.AfterSaleLogUtils;
|
import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.util.AfterSaleLogUtils;
|
||||||
import cn.iocoder.yudao.module.trade.service.aftersale.TradeAfterSaleService;
|
import cn.iocoder.yudao.module.trade.service.aftersale.TradeAfterSaleService;
|
||||||
@ -21,9 +20,6 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
@ -58,17 +54,6 @@ public class AppTradeAfterSaleController {
|
|||||||
return success(afterSaleService.getApplyingAfterSaleCount(getLoginUserId()));
|
return success(afterSaleService.getApplyingAfterSaleCount(getLoginUserId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO 芋艿:待实现
|
|
||||||
@GetMapping(value = "/get-reason-list")
|
|
||||||
@Operation(summary = "获得售后原因")
|
|
||||||
@Parameter(name = "way", description = "售后类型", required = true, example = "10")
|
|
||||||
public CommonResult<List<String>> getAfterSaleReasonList(@RequestParam("way") Integer way) {
|
|
||||||
if (Objects.equals(TradeAfterSaleWayEnum.REFUND.getWay(), way)) {
|
|
||||||
return success(Arrays.asList("不想要了", "商品质量问题", "商品描述不符"));
|
|
||||||
}
|
|
||||||
return success(Arrays.asList("不想要了", "商品质量问题", "商品描述不符", "商品错发漏发", "商品包装破损"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping(value = "/create")
|
@PostMapping(value = "/create")
|
||||||
@Operation(summary = "申请售后")
|
@Operation(summary = "申请售后")
|
||||||
@AfterSaleLog(id = "#info.data", content = "'申请售后:售后编号['+#info.data+'],订单编号['+#createReqVO.orderItemId+'], '", operateType = AfterSaleOperateTypeEnum.MEMBER_CREATE)
|
@AfterSaleLog(id = "#info.data", content = "'申请售后:售后编号['+#info.data+'],订单编号['+#createReqVO.orderItemId+'], '", operateType = AfterSaleOperateTypeEnum.MEMBER_CREATE)
|
||||||
|
@ -9,6 +9,16 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
public class AppTradeConfigRespVO {
|
public class AppTradeConfigRespVO {
|
||||||
|
|
||||||
|
// ========== 售后相关 ==========
|
||||||
|
|
||||||
|
@Schema(description = "售后的退款理由", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private List<String> afterSaleRefundReasons;
|
||||||
|
|
||||||
|
@Schema(description = "售后的退货理由", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private List<String> afterSaleReturnReasons;
|
||||||
|
|
||||||
|
// ========== 分销相关 ==========
|
||||||
|
|
||||||
@Schema(description = "分销海报地址数组", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "分销海报地址数组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private List<String> brokeragePosterUrls;
|
private List<String> brokeragePosterUrls;
|
||||||
|
|
||||||
|
@ -35,6 +35,19 @@ public class TradeConfigDO extends BaseDO {
|
|||||||
@TableId
|
@TableId
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
// ========== 售后相关 ==========
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 售后的退款理由
|
||||||
|
*/
|
||||||
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
|
private List<String> afterSaleRefundReasons;
|
||||||
|
/**
|
||||||
|
* 售后的退货理由
|
||||||
|
*/
|
||||||
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
|
private List<String> afterSaleReturnReasons;
|
||||||
|
|
||||||
// ========== 配送相关 ==========
|
// ========== 配送相关 ==========
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -125,12 +125,10 @@ public class TradeAfterSaleServiceImpl implements TradeAfterSaleService, AfterSa
|
|||||||
if (orderItem == null) {
|
if (orderItem == null) {
|
||||||
throw exception(ORDER_ITEM_NOT_FOUND);
|
throw exception(ORDER_ITEM_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 已申请售后,不允许再发起售后申请
|
// 已申请售后,不允许再发起售后申请
|
||||||
if (!TradeOrderItemAfterSaleStatusEnum.isNone(orderItem.getAfterSaleStatus())) {
|
if (!TradeOrderItemAfterSaleStatusEnum.isNone(orderItem.getAfterSaleStatus())) {
|
||||||
throw exception(AFTER_SALE_CREATE_FAIL_ORDER_ITEM_APPLIED);
|
throw exception(AFTER_SALE_CREATE_FAIL_ORDER_ITEM_APPLIED);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 申请的退款金额,不能超过商品的价格
|
// 申请的退款金额,不能超过商品的价格
|
||||||
if (createReqVO.getRefundPrice() > orderItem.getPayPrice()) {
|
if (createReqVO.getRefundPrice() > orderItem.getPayPrice()) {
|
||||||
throw exception(AFTER_SALE_CREATE_FAIL_REFUND_PRICE_ERROR);
|
throw exception(AFTER_SALE_CREATE_FAIL_REFUND_PRICE_ERROR);
|
||||||
|
@ -9,7 +9,7 @@ spring:
|
|||||||
exclude:
|
exclude:
|
||||||
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
|
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
|
||||||
- org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration # 排除积木报表带来的 MongoDB 的自动配置
|
- org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration # 排除积木报表带来的 MongoDB 的自动配置
|
||||||
# - org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration # 默认 local 环境,不开启 Quartz 的自动配置
|
- org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration # 默认 local 环境,不开启 Quartz 的自动配置
|
||||||
- de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration # 禁用 Spring Boot Admin 的 Server 的自动配置
|
- de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration # 禁用 Spring Boot Admin 的 Server 的自动配置
|
||||||
- de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration # 禁用 Spring Boot Admin 的 Server UI 的自动配置
|
- de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration # 禁用 Spring Boot Admin 的 Server UI 的自动配置
|
||||||
- de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration # 禁用 Spring Boot Admin 的 Client 的自动配置
|
- de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration # 禁用 Spring Boot Admin 的 Client 的自动配置
|
||||||
|
Loading…
Reference in New Issue
Block a user