|
|
@ -1,6 +1,7 @@ |
|
|
|
package com.cweb.controller.pay; |
|
|
|
package com.cweb.controller.pay; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.cweb.config.SysConst; |
|
|
|
import com.cweb.config.SysConst; |
|
|
|
import com.hai.common.exception.ErrorCode; |
|
|
|
import com.hai.common.exception.ErrorCode; |
|
|
@ -17,6 +18,7 @@ import com.hai.common.utils.HttpsUtils; |
|
|
|
import com.hai.common.utils.MathUtils; |
|
|
|
import com.hai.common.utils.MathUtils; |
|
|
|
import com.hai.common.utils.ResponseMsgUtil; |
|
|
|
import com.hai.common.utils.ResponseMsgUtil; |
|
|
|
import com.hai.config.QianZhuConfig; |
|
|
|
import com.hai.config.QianZhuConfig; |
|
|
|
|
|
|
|
import com.hai.config.TuanYouConfig; |
|
|
|
import com.hai.entity.HighChildOrder; |
|
|
|
import com.hai.entity.HighChildOrder; |
|
|
|
import com.hai.entity.HighCoupon; |
|
|
|
import com.hai.entity.HighCoupon; |
|
|
|
import com.hai.entity.HighOrder; |
|
|
|
import com.hai.entity.HighOrder; |
|
|
@ -128,7 +130,7 @@ public class OrderController { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.ORDER_NO_STAY_PAY, ""); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.ORDER_NO_STAY_PAY, ""); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 商品类型 1:卡卷 2:金币充值
|
|
|
|
// 商品类型 1:卡卷 2:金币充值 3:加油站
|
|
|
|
for (HighChildOrder childOrder : order.getHighChildOrderList()) { |
|
|
|
for (HighChildOrder childOrder : order.getHighChildOrderList()) { |
|
|
|
if (childOrder.getGiveawayType() == false && childOrder.getGoodsType() == 1) { |
|
|
|
if (childOrder.getGiveawayType() == false && childOrder.getGoodsType() == 1) { |
|
|
|
HighCoupon coupon = highCouponService.getCouponById(childOrder.getGoodsId()); |
|
|
|
HighCoupon coupon = highCouponService.getCouponById(childOrder.getGoodsId()); |
|
|
@ -138,6 +140,23 @@ public class OrderController { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, coupon.getCouponName() + ",只支持微信支付"); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, coupon.getCouponName() + ",只支持微信支付"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (childOrder.getGoodsType() == 3) { |
|
|
|
|
|
|
|
// 查询账号余额
|
|
|
|
|
|
|
|
JSONObject accountInfo2JD = TuanYouConfig.queryCompanyAccountInfo2JD(); |
|
|
|
|
|
|
|
JSONArray result = accountInfo2JD.getJSONArray("result"); |
|
|
|
|
|
|
|
for (Object accountObject : result) { |
|
|
|
|
|
|
|
JSONObject account = (JSONObject)accountObject; |
|
|
|
|
|
|
|
// 1:汽油:2:柴油;3:天然气
|
|
|
|
|
|
|
|
if (account.getInteger("energyType") == childOrder.getGasOilType()) { |
|
|
|
|
|
|
|
// 支付金额 大于 团油账号余额
|
|
|
|
|
|
|
|
if(order.getPayPrice().compareTo(account.getBigDecimal("accountBalance")) == 1){ |
|
|
|
|
|
|
|
log.error("OrderController --> orderToPay() ERROR", "无法进行支付,请联系平台客服"); |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法进行支付,请联系平台客服"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|