|
|
|
@ -21,10 +21,7 @@ import com.hai.config.*; |
|
|
|
|
import com.hai.entity.*; |
|
|
|
|
import com.hai.enum_type.GoodsType; |
|
|
|
|
import com.hai.enum_type.PayType; |
|
|
|
|
import com.hai.model.HighCouponModel; |
|
|
|
|
import com.hai.model.HighUserModel; |
|
|
|
|
import com.hai.model.ResponseData; |
|
|
|
|
import com.hai.model.UserInfoModel; |
|
|
|
|
import com.hai.model.*; |
|
|
|
|
import com.hai.service.*; |
|
|
|
|
import com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder; |
|
|
|
|
import com.wechat.pay.contrib.apache.httpclient.auth.AutoUpdateCertificatesVerifier; |
|
|
|
@ -87,6 +84,9 @@ public class OrderController { |
|
|
|
|
@Resource |
|
|
|
|
private HighCouponService highCouponService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighMerchantStoreService merchantStoreService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighQzOrderService highQzOrderService; |
|
|
|
|
|
|
|
|
@ -159,6 +159,13 @@ public class OrderController { |
|
|
|
|
if (highOrderService.getGasTheDayOrderNum(order.getMemId()) >= 1) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); |
|
|
|
|
} |
|
|
|
|
// 查询加油站
|
|
|
|
|
HighMerchantStoreModel store = merchantStoreService.getMerchantStoreById(childOrder.getGoodsId()); |
|
|
|
|
if (store == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); |
|
|
|
|
} |
|
|
|
|
// 来源类型 1:平台自建 2:团油
|
|
|
|
|
if (store.getSourceType().equals(2)) { |
|
|
|
|
// 查询账号余额
|
|
|
|
|
JSONObject accountInfo2JD = TuanYouConfig.queryCompanyAccountInfo2JD(); |
|
|
|
|
JSONArray result = accountInfo2JD.getJSONArray("result"); |
|
|
|
@ -175,6 +182,7 @@ public class OrderController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
|
map.put("orderNo", order.getOrderNo()); |
|
|
|
@ -300,6 +308,13 @@ public class OrderController { |
|
|
|
|
if (highOrderService.getGasTheDayOrderNum(order.getMemId()) >= 1) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); |
|
|
|
|
} |
|
|
|
|
// 查询加油站
|
|
|
|
|
HighMerchantStoreModel store = merchantStoreService.getMerchantStoreById(childOrder.getGoodsId()); |
|
|
|
|
if (store == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); |
|
|
|
|
} |
|
|
|
|
// 来源类型 1:平台自建 2:团油
|
|
|
|
|
if (store.getSourceType().equals(2)) { |
|
|
|
|
// 查询账号余额
|
|
|
|
|
JSONObject accountInfo2JD = TuanYouConfig.queryCompanyAccountInfo2JD(); |
|
|
|
|
JSONArray result = accountInfo2JD.getJSONArray("result"); |
|
|
|
@ -315,6 +330,7 @@ public class OrderController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -404,6 +420,14 @@ public class OrderController { |
|
|
|
|
if (highOrderService.getGasTheDayOrderNum(order.getMemId()) >= 1) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 查询加油站
|
|
|
|
|
HighMerchantStoreModel store = merchantStoreService.getMerchantStoreById(childOrder.getGoodsId()); |
|
|
|
|
if (store == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); |
|
|
|
|
} |
|
|
|
|
// 来源类型 1:平台自建 2:团油
|
|
|
|
|
if (store.getSourceType().equals(2)) { |
|
|
|
|
// 查询账号余额
|
|
|
|
|
JSONObject accountInfo2JD = TuanYouConfig.queryCompanyAccountInfo2JD(); |
|
|
|
|
JSONArray result = accountInfo2JD.getJSONArray("result"); |
|
|
|
@ -420,6 +444,7 @@ public class OrderController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
highOrderService.oilCardPayOrder(userCard.getId(), order.getId()); |
|
|
|
|
|
|
|
|
@ -508,6 +533,13 @@ public class OrderController { |
|
|
|
|
if (highOrderService.getGasTheDayOrderNum(order.getMemId()) >= 1) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); |
|
|
|
|
} |
|
|
|
|
// 查询加油站
|
|
|
|
|
HighMerchantStoreModel store = merchantStoreService.getMerchantStoreById(childOrder.getGoodsId()); |
|
|
|
|
if (store == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); |
|
|
|
|
} |
|
|
|
|
// 来源类型 1:平台自建 2:团油
|
|
|
|
|
if (store.getSourceType().equals(2)) { |
|
|
|
|
// 查询账号余额
|
|
|
|
|
JSONObject accountInfo2JD = TuanYouConfig.queryCompanyAccountInfo2JD(); |
|
|
|
|
JSONArray result = accountInfo2JD.getJSONArray("result"); |
|
|
|
@ -524,6 +556,7 @@ public class OrderController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
highOrderService.hltUnionCardPay(userCard.getId(), order.getId()); |
|
|
|
|
|
|
|
|
@ -592,6 +625,13 @@ public class OrderController { |
|
|
|
|
if (highOrderService.getGasTheDayOrderNum(order.getMemId()) >= 1) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); |
|
|
|
|
} |
|
|
|
|
// 查询加油站
|
|
|
|
|
HighMerchantStoreModel store = merchantStoreService.getMerchantStoreById(childOrder.getGoodsId()); |
|
|
|
|
if (store == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); |
|
|
|
|
} |
|
|
|
|
// 来源类型 1:平台自建 2:团油
|
|
|
|
|
if (store.getSourceType().equals(2)) { |
|
|
|
|
// 查询账号余额
|
|
|
|
|
JSONObject accountInfo2JD = TuanYouConfig.queryCompanyAccountInfo2JD(); |
|
|
|
|
JSONArray result = accountInfo2JD.getJSONArray("result"); |
|
|
|
@ -608,6 +648,7 @@ public class OrderController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(unionPayConfig.upPreOrder(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, order.getOrderNo(), order.getPayPrice(), "购买商品", CommonSysConst.getSysConfig().getUnionPayNotifyUrl(), request)); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|