mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 12:18:42 +08:00 
			
		
		
		
	trade:退款理由的维护
This commit is contained in:
		@@ -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;
 | 
			
		||||
 | 
			
		||||
    // ========== 配送相关 ==========
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 是否启用全场包邮
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -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)
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 | 
			
		||||
    // ========== 配送相关 ==========
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user