提交代码

dev-discount
胡锐 3 years ago
parent 6548741982
commit b6dd1fc3f8
  1. 49
      hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java

@ -21,10 +21,7 @@ import com.hai.config.*;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.enum_type.GoodsType; import com.hai.enum_type.GoodsType;
import com.hai.enum_type.PayType; import com.hai.enum_type.PayType;
import com.hai.model.HighCouponModel; import com.hai.model.*;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.*; import com.hai.service.*;
import com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder; import com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder;
import com.wechat.pay.contrib.apache.httpclient.auth.AutoUpdateCertificatesVerifier; import com.wechat.pay.contrib.apache.httpclient.auth.AutoUpdateCertificatesVerifier;
@ -87,6 +84,9 @@ public class OrderController {
@Resource @Resource
private HighCouponService highCouponService; private HighCouponService highCouponService;
@Resource
private HighMerchantStoreService merchantStoreService;
@Resource @Resource
private HighQzOrderService highQzOrderService; private HighQzOrderService highQzOrderService;
@ -159,6 +159,13 @@ public class OrderController {
if (highOrderService.getGasTheDayOrderNum(order.getMemId()) >= 1) { if (highOrderService.getGasTheDayOrderNum(order.getMemId()) >= 1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); 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(); JSONObject accountInfo2JD = TuanYouConfig.queryCompanyAccountInfo2JD();
JSONArray result = accountInfo2JD.getJSONArray("result"); JSONArray result = accountInfo2JD.getJSONArray("result");
@ -175,6 +182,7 @@ public class OrderController {
} }
} }
} }
}
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("orderNo", order.getOrderNo()); map.put("orderNo", order.getOrderNo());
@ -300,6 +308,13 @@ public class OrderController {
if (highOrderService.getGasTheDayOrderNum(order.getMemId()) >= 1) { if (highOrderService.getGasTheDayOrderNum(order.getMemId()) >= 1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); 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(); JSONObject accountInfo2JD = TuanYouConfig.queryCompanyAccountInfo2JD();
JSONArray result = accountInfo2JD.getJSONArray("result"); 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) { if (highOrderService.getGasTheDayOrderNum(order.getMemId()) >= 1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); 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(); JSONObject accountInfo2JD = TuanYouConfig.queryCompanyAccountInfo2JD();
JSONArray result = accountInfo2JD.getJSONArray("result"); JSONArray result = accountInfo2JD.getJSONArray("result");
@ -420,6 +444,7 @@ public class OrderController {
} }
} }
} }
}
highOrderService.oilCardPayOrder(userCard.getId(), order.getId()); highOrderService.oilCardPayOrder(userCard.getId(), order.getId());
@ -508,6 +533,13 @@ public class OrderController {
if (highOrderService.getGasTheDayOrderNum(order.getMemId()) >= 1) { if (highOrderService.getGasTheDayOrderNum(order.getMemId()) >= 1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); 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(); JSONObject accountInfo2JD = TuanYouConfig.queryCompanyAccountInfo2JD();
JSONArray result = accountInfo2JD.getJSONArray("result"); JSONArray result = accountInfo2JD.getJSONArray("result");
@ -524,6 +556,7 @@ public class OrderController {
} }
} }
} }
}
highOrderService.hltUnionCardPay(userCard.getId(), order.getId()); highOrderService.hltUnionCardPay(userCard.getId(), order.getId());
@ -592,6 +625,13 @@ public class OrderController {
if (highOrderService.getGasTheDayOrderNum(order.getMemId()) >= 1) { if (highOrderService.getGasTheDayOrderNum(order.getMemId()) >= 1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); 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(); JSONObject accountInfo2JD = TuanYouConfig.queryCompanyAccountInfo2JD();
JSONArray result = accountInfo2JD.getJSONArray("result"); 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)); return ResponseMsgUtil.success(unionPayConfig.upPreOrder(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, order.getOrderNo(), order.getPayPrice(), "购买商品", CommonSysConst.getSysConfig().getUnionPayNotifyUrl(), request));
} catch (Exception e) { } catch (Exception e) {

Loading…
Cancel
Save