|
|
|
@@ -5,8 +5,12 @@ import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.common.Result; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.po.*; |
|
|
|
import com.iformall.enums.EnumAppType; |
|
|
|
import com.iformall.enums.EnumPayType; |
|
|
|
import com.iformall.enums.EnumPayWay; |
|
|
|
import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.service.WxAppinfoService; |
|
|
|
import com.iformall.service.WxCouponOrderService; |
|
|
|
import com.iformall.service.WxRefundOrderService; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
@@ -26,6 +30,12 @@ import java.util.Map; |
|
|
|
public class WxRefundOrderController extends BaseController { |
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass()); |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxCouponOrderService wxCouponOrderService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxAppinfoService wxAppinfoService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxRefundOrderService wxRefundOrderService; |
|
|
|
|
|
|
|
@@ -47,9 +57,21 @@ public class WxRefundOrderController extends BaseController { |
|
|
|
logger.error("couponOrderId参数不正确: " + paramMap.toString()); |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
WxCouponOrder wxCouponOrder = wxCouponOrderService.getById(couponOrderId,getTenantInfo().getTenantId()); |
|
|
|
if (wxCouponOrder == null) { |
|
|
|
logger.error("券ID不存在:" + couponOrderId); |
|
|
|
throw new MallinkException(ErrorCode.COUPON_ORDER_IS_NULL); |
|
|
|
} |
|
|
|
|
|
|
|
WxMerchantBUser bUser = getLoginBUser(); |
|
|
|
WxAppinfo appinfo = getAppInfo(bUser.getAppId()); |
|
|
|
|
|
|
|
WxAppinfo appinfo = new WxAppinfo(); |
|
|
|
appinfo.updateTenantInfo(getTenantInfo()); |
|
|
|
//appinfo.setType(EnumAppType.B.getCode()); |
|
|
|
appinfo.setPlat(EnumPayWay.getEnum(wxCouponOrder.getPayVendor()).getPlat().getCode()); |
|
|
|
appinfo.setType(EnumAppType.C.getCode()); |
|
|
|
appinfo = wxAppinfoService.getList(appinfo).get(0); |
|
|
|
// WxAppinfo appinfo = getAppInfo(bUser.getAppId()); |
|
|
|
try { |
|
|
|
ResultData rd = wxRefundOrderService.createRefundOrder(appinfo, couponOrderId, EnumPayType.PAY_B_REFUND, bUser.getId()); |
|
|
|
return rd; |
|
|
|
|