|
|
|
@ -156,6 +156,9 @@ public class OrderController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (childOrder.getGoodsType() == 3) { |
|
|
|
|
if (highOrderService.getGasTheDayOrderNum(order.getMemId()) >= 1) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); |
|
|
|
|
} |
|
|
|
|
// 查询账号余额
|
|
|
|
|
JSONObject accountInfo2JD = TuanYouConfig.queryCompanyAccountInfo2JD(); |
|
|
|
|
JSONArray result = accountInfo2JD.getJSONArray("result"); |
|
|
|
@ -286,6 +289,27 @@ public class OrderController { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, coupon.getCouponName() + ",只支持积分支付"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (childOrder.getGoodsType() == 3) { |
|
|
|
|
if (highOrderService.getGasTheDayOrderNum(order.getMemId()) >= 1) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); |
|
|
|
|
} |
|
|
|
|
// 查询账号余额
|
|
|
|
|
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, "无法进行支付,请联系平台客服"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
highOrderService.goldPayOrder(order.getMemId(), order.getId()); |
|
|
|
@ -369,17 +393,28 @@ public class OrderController { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.ORDER_NO_STAY_PAY, ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* // 商品类型 1:卡卷 2:金币充值
|
|
|
|
|
// 商品类型 1:卡卷 2:金币充值
|
|
|
|
|
for (HighChildOrder childOrder : order.getHighChildOrderList()) { |
|
|
|
|
if (childOrder.getGoodsType() == 2) { |
|
|
|
|
HighCoupon coupon = highCouponService.getCouponById(childOrder.getGoodsId()); |
|
|
|
|
// 支付类型:1.微信支付 2.金币支付
|
|
|
|
|
if (coupon.getPayType() != 2) { |
|
|
|
|
log.error("OrderController --> orderToPay() ERROR", "只支持积分支付"); |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, coupon.getCouponName() + ",只支持积分支付"); |
|
|
|
|
if (childOrder.getGoodsType() == 3) { |
|
|
|
|
if (highOrderService.getGasTheDayOrderNum(order.getMemId()) >= 1) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); |
|
|
|
|
} |
|
|
|
|
// 查询账号余额
|
|
|
|
|
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, "无法进行支付,请联系平台客服"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
highOrderService.hltUnionCardPay(userCard.getId(), order.getId()); |
|
|
|
|
|
|
|
|
@ -445,6 +480,9 @@ public class OrderController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (childOrder.getGoodsType() == 3) { |
|
|
|
|
if (highOrderService.getGasTheDayOrderNum(order.getMemId()) >= 1) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); |
|
|
|
|
} |
|
|
|
|
// 查询账号余额
|
|
|
|
|
JSONObject accountInfo2JD = TuanYouConfig.queryCompanyAccountInfo2JD(); |
|
|
|
|
JSONArray result = accountInfo2JD.getJSONArray("result"); |
|
|
|
|