trade:退款理由的维护

This commit is contained in:
YunaiV 2023-09-29 13:35:40 +08:00
parent 3c643f814c
commit 666ba351a2
6 changed files with 37 additions and 18 deletions

View File

@ -19,6 +19,19 @@ import java.util.List;
*/
@Data
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;
// ========== 配送相关 ==========
/**
* 是否启用全场包邮
*/

View File

@ -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.enums.aftersale.AfterSaleOperateTypeEnum;
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.util.AfterSaleLogUtils;
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 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.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@ -58,17 +54,6 @@ public class AppTradeAfterSaleController {
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")
@Operation(summary = "申请售后")
@AfterSaleLog(id = "#info.data", content = "'申请售后:售后编号['+#info.data+'],订单编号['+#createReqVO.orderItemId+'], '", operateType = AfterSaleOperateTypeEnum.MEMBER_CREATE)

View File

@ -9,6 +9,16 @@ import java.util.List;
@Data
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)
private List<String> brokeragePosterUrls;

View File

@ -35,6 +35,19 @@ public class TradeConfigDO extends BaseDO {
@TableId
private Long id;
// ========== 售后相关 ==========
/**
* 售后的退款理由
*/
@TableField(typeHandler = JacksonTypeHandler.class)
private List<String> afterSaleRefundReasons;
/**
* 售后的退货理由
*/
@TableField(typeHandler = JacksonTypeHandler.class)
private List<String> afterSaleReturnReasons;
// ========== 配送相关 ==========
/**

View File

@ -125,12 +125,10 @@ public class TradeAfterSaleServiceImpl implements TradeAfterSaleService, AfterSa
if (orderItem == null) {
throw exception(ORDER_ITEM_NOT_FOUND);
}
// 已申请售后不允许再发起售后申请
if (!TradeOrderItemAfterSaleStatusEnum.isNone(orderItem.getAfterSaleStatus())) {
throw exception(AFTER_SALE_CREATE_FAIL_ORDER_ITEM_APPLIED);
}
// 申请的退款金额不能超过商品的价格
if (createReqVO.getRefundPrice() > orderItem.getPayPrice()) {
throw exception(AFTER_SALE_CREATE_FAIL_REFUND_PRICE_ERROR);

View File

@ -9,7 +9,7 @@ spring:
exclude:
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
- 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.ui.config.AdminServerUiAutoConfiguration # 禁用 Spring Boot Admin 的 Server UI 的自动配置
- de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration # 禁用 Spring Boot Admin 的 Client 的自动配置