记得上下班打卡 | git大法好,push需谨慎

Commit f9a2ab5b authored by 胡佳晨's avatar 胡佳晨

优先券报错 则订单下单失败

优惠券报错则 优惠券逻辑跳过
parent 55634f02
......@@ -260,6 +260,9 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
} else {
if (memberType == 1) {
advanceMap = orderUtils.useCoupon(payOrderParam.getAdvanceCode(), "购买 " + performanceData.getTitle(), BigDecimal.ZERO, payOrderParam.getPerformanceId(), payOrderParam.getTimeId(), payOrderParam.getTicketId());
if (advanceMap == null) {
return ResponseDto.failure("优先券券不可用");
}
Integer typeVoucher = (Integer) advanceMap.get("type");
if (typeVoucher.equals(-1)) {
return ResponseDto.failure("优先券券不可用");
......@@ -453,13 +456,13 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
if (payOrderParam.getVoucherCode() != null) {
HashMap<String, Object> hashMap = orderUtils.useCoupon(payOrderParam.getVoucherCode(), content, orderTickets.getPriceTotal().subtract(priceExpress), payOrderParam.getPerformanceId(), payOrderParam.getTimeId(), payOrderParam.getTicketId());
if (null != hashMap) {
BigDecimal priceVoucher = (BigDecimal) hashMap.get("voucher");
Integer typeVoucher = (Integer) hashMap.get("type");
if (typeVoucher.equals(-1)) {
throw new Exception("券不可用");
}
orderTickets.setPriceVoucher(priceVoucher);
KylinOrderCoupons couponsVoucher = KylinOrderCoupons.getNew();
couponsVoucher.setOrderId(orderTicketId);
couponsVoucher.setCouponCode(payOrderParam.getVoucherCode());
......@@ -467,11 +470,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
couponsVoucher.setCouponPrice(priceVoucher);
couponsVoucher.setCreatedAt(now);
couponsList.add(couponsVoucher);
sqlsDataE.add(new Object[]{
orderTicketId, payOrderParam.getVoucherCode(), typeVoucher, priceVoucher, now, now
});
}
}
if (couponsList.size() > 0) {
dataUtils.setOrderCoupon(orderTicketId, couponsList);
......@@ -644,11 +647,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
httpData.add("showUrl", payOrderParam.getShowUrl() + orderTicketId);
httpData.add("returnUrl", payOrderParam.getReturnUrl() + orderTicketId);
}
if(payOrderParam.getPayType().equals("douyinpay")){
if (payOrderParam.getPayType().equals("douyinpay")) {
httpData.add("showUrl", payOrderParam.getShowUrl() + orderTicketId);
httpData.add("returnUrl", payOrderParam.getReturnUrl() + orderTicketId);
}
if(payOrderParam.getPayType().equals("unionpay")){
if (payOrderParam.getPayType().equals("unionpay")) {
httpData.add("returnUrl", payOrderParam.getReturnUrl() + orderTicketId);
}
log.debug("调用 DRAGON 参数 = " + httpData.toString());
......@@ -770,11 +773,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
httpData.add("showUrl", payAgainParam.getShowUrl() + payAgainParam.getOrderId());
httpData.add("returnUrl", payAgainParam.getReturnUrl() + payAgainParam.getOrderId());
}
if(payAgainParam.getPayType().equals("douyinpay")){
if (payAgainParam.getPayType().equals("douyinpay")) {
httpData.add("showUrl", payAgainParam.getShowUrl() + payAgainParam.getOrderId());
httpData.add("returnUrl", payAgainParam.getReturnUrl() + payAgainParam.getOrderId());
}
if(payAgainParam.getPayType().equals("unionpay")){
if (payAgainParam.getPayType().equals("unionpay")) {
httpData.add("returnUrl", payAgainParam.getReturnUrl() + payAgainParam.getOrderId());
}
String returnData = HttpUtil.post(payUrl, httpData);
......
......@@ -205,6 +205,7 @@ public class GoblinOrderUtils {
}
public GoblinUseResultVo useStoreCoupon(String ucouponId, String content, BigDecimal totalPrice, String spuId, String uid) {
try {
List<GoblinUserCouponVo> voList = redisUtils.getUserCouponVos(uid);
GoblinUseResultVo returnVo = GoblinUseResultVo.getNew();
returnVo.setValue(BigDecimal.ZERO);
......@@ -274,6 +275,10 @@ public class GoblinOrderUtils {
redisUtils.setUserCouponVos(uid, voList);
}
return returnVo;
}catch (Exception e){
log.error("店铺券错误:{}",e);
return null;
}
}
public Boolean backStoreCoupon(List<com.liquidnet.service.goblin.param.BackCouponParam> params) {
......
......@@ -271,9 +271,10 @@ public class OrderUtils {
return hashMap;
} catch (Exception e) {
log.error("用券ERROR:{}", e);
hashMap.put("type", -1);
hashMap.put("voucher", -1);
return hashMap;
// hashMap.put("type", -1);
// hashMap.put("voucher", -1);
// return hashMap;
return null;
}
}
......
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