Commit d43e1c08 by roamer

Merge branch 'refs/heads/feature/box/三方券订单退款退券' into qa

parents 741f2125 da6f7ab5
...@@ -267,6 +267,16 @@ public class OrderController { ...@@ -267,6 +267,16 @@ public class OrderController {
return ResponseUtil.success(); return ResponseUtil.success();
} }
/**
* 退款预校验
*/
@ApiAnnotation(logMessage = "退款预校验")
@PostMapping("/preValidRefund")
public BaseResponse<Void> preValidRefund(@Validated @LogParams @RequestBody PreValidRefundReq reqVo) {
refundService.preValidRefund(reqVo.getPartnerId(), reqVo.getOrderCode(), reqVo.getRefundMode());
return ResponseUtil.success();
}
/** /**
* 获取订单排队号 * 获取订单排队号
......
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title: GetProductVo
* @Package cn.freemud.entities.vo
* @Description:
* @author: liming.guo
* @date: 2018/5/16 17:35
* @version V1.0
* @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
package cn.freemud.entities.vo;
import com.freemud.application.sdk.api.ordercenter.enums.RefundModeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 退款预校验参数
*
* @author haibo.jiang 2019/11/20
* @author shichang.wang 2021/4/15
*/
@ApiModel("退款预校验参数")
@Data
public class PreValidRefundReq {
@NotBlank(message = "商户号为空")
private String partnerId;
@NotBlank(message = "订单号为空")
private String orderCode;
/**
* 微商城退款方式
*
* @see RefundModeEnum#getIndex()
*/
@ApiModelProperty(value = "微商城退款方式", notes = RefundModeEnum.API_DOC)
private Byte refundMode;
}
...@@ -96,7 +96,7 @@ public class RefundService { ...@@ -96,7 +96,7 @@ public class RefundService {
private final OrderCouponHandle orderCouponHandle; private final OrderCouponHandle orderCouponHandle;
private final ThirdCouponOrderHandle thirdCouponOrderHandle; private final ThirdCouponOrderHandle thirdCouponOrderHandle;
private OrderInfoReqs preValidRefund(String partnerId, String orderCode, Byte refundMode) { public OrderInfoReqs preValidRefund(String partnerId, String orderCode, Byte refundMode) {
// 查询订单信息 // 查询订单信息
QueryByCodeResponse orderResp = orderSdkService.getOrderInfo(partnerId, orderCode); QueryByCodeResponse orderResp = orderSdkService.getOrderInfo(partnerId, orderCode);
if (null == orderResp || null == orderResp.getResult()) throw new ServiceException("订单信息不存在"); if (null == orderResp || null == orderResp.getResult()) throw new ServiceException("订单信息不存在");
...@@ -457,7 +457,7 @@ public class RefundService { ...@@ -457,7 +457,7 @@ public class RefundService {
boolean couponUsed = couponQueryHandle.isCouponUsed(partnerId, couponCodes); boolean couponUsed = couponQueryHandle.isCouponUsed(partnerId, couponCodes);
if (couponUsed) { if (couponUsed) {
throw new ServiceException("识别到您已使用过该券包中的部分或全部券,故不支持退款。"); throw new ServiceException("已使用券包中的部分或全部券,故不支持退款。");
} }
// 冻结券 // 冻结券
boolean freeze = orderCouponHandle.freezeCodes(partnerId, orderInfo.getUserId(), couponCodes, "买券订单退款"); boolean freeze = orderCouponHandle.freezeCodes(partnerId, orderInfo.getUserId(), couponCodes, "买券订单退款");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment