diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java index 62740769..beb9ee8c 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java @@ -1 +1 @@ -package com.cweb.controller; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.cweb.config.SysConst; import com.hai.common.Base64Util; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.security.SessionObject; import com.hai.common.security.UserCenter; import com.hai.common.utils.*; import com.hai.config.*; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.enum_type.MerchantStoreSourceType; import com.hai.model.*; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContexts; import org.apache.http.util.EntityUtils; import org.bouncycastle.util.encoders.UrlBase64; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.util.IdGenerator; import org.springframework.web.bind.annotation.*; import sun.nio.cs.StreamEncoder; import javax.annotation.Resource; import javax.net.ssl.SSLContext; import javax.servlet.http.HttpServletRequest; import java.io.*; import java.math.BigDecimal; import java.nio.charset.StandardCharsets; import java.security.KeyStore; import java.util.*; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private HighMerchantService highMerchantService; @Resource private HighMerchantStoreService highMerchantStoreService; @Resource private HighGasOilPriceService highGasOilPriceService; @Resource private HighOrderService highOrderService; @Autowired private UserCenter userCenter; @Resource private HighProfitSharingRecordService highProfitSharingRecordService; @Resource private BaiduVoiceService baiduVoiceService; @Resource private ShellGroupService shellGroupService; @Resource private HighGasService gasService; @Resource private BsMsgService bsMsgService; @RequestMapping(value = "/queryGasInfoByGasId", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据油站 id 拉取最新的油站数据") public ResponseData queryGasInfoByGasId(@RequestParam(name = "gasId", required = true) String gasId, HttpServletRequest request) { try { return ResponseMsgUtil.success(TuanYouConfig.queryGasInfoByGasId(gasId)); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/initTYMerchantStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "初始化加油站") public ResponseData initTYMerchantStore(@RequestParam(name = "merchantId", required = true) Long merchantId) throws Exception { HighMerchantModel merchant = highMerchantService.getMerchantById(merchantId); if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } JSONObject jsonObjectP = TuanYouConfig.queryGasInfoListByPage(1, 1000); JSONObject resultObjectP = jsonObjectP.getObject("result", JSONObject.class); for (int i = 1; i <= resultObjectP.getInteger("totalPageNum").intValue(); i++) { JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(i, 1000); JSONObject resultObject = jsonObject.getObject("result", JSONObject.class); JSONArray jsonArray = resultObject.getJSONArray("gasInfoList"); HighMerchantStore highMerchantStore; HighGasOilPrice highGasOilPrice; for (Object gasObject : jsonArray) { JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(gasObject)); HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("gasId")); if (store != null) { store.setType(1); store.setMerchantId(merchant.getId()); store.setCompanyId(merchant.getCompanyId()); store.setStoreKey(object.getString("gasId")); store.setStoreName(object.getString("gasName")); store.setStoreLogo(object.getString("gasLogoSmall")); store.setRegionId(object.getLong("provinceCode")); store.setRegionName(object.getString("provinceName")); store.setAddress(object.getString("gasAddress")); store.setLongitude(object.getString("gasAddressLongitude")); store.setLatitude(object.getString("gasAddressLatitude")); store.setStatus(object.getInteger("gasStatus")); store.setOperatorId(0L); store.setOperatorName("系统创建"); store.setUpdateTime(new Date()); store.setExt1(object.getString("gasSourceId")); highMerchantStoreService.updateMerchantStoreDetail(store); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); // 查询门店油号 highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getString("oilNo")); if (highGasOilPrice == null) { highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); } else { highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); } highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } else { highMerchantStore = new HighMerchantStore(); highMerchantStore.setType(1); highMerchantStore.setMerchantId(merchant.getId()); highMerchantStore.setCompanyId(merchant.getCompanyId()); highMerchantStore.setStoreKey(object.getString("gasId")); highMerchantStore.setStoreName(object.getString("gasName")); highMerchantStore.setStoreLogo(object.getString("gasLogoSmall")); highMerchantStore.setRegionId(object.getLong("provinceCode")); highMerchantStore.setRegionName(object.getString("provinceName")); highMerchantStore.setAddress(object.getString("gasAddress")); highMerchantStore.setLongitude(object.getString("gasAddressLongitude")); highMerchantStore.setLatitude(object.getString("gasAddressLatitude")); highMerchantStore.setStatus(1); highMerchantStore.setOperatorId(0L); highMerchantStore.setOperatorName("系统创建"); highMerchantStore.setCreateTime(new Date()); highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setExt1(object.getString("gasSourceId")); HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel(); BeanUtils.copyProperties(highMerchantStore, merchantStoreModel); highMerchantStoreService.insertMerchantStore(merchantStoreModel); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } } } return ResponseMsgUtil.success("初始化完成"); } @RequestMapping(value = "/detectTYMerchantStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "检测加油站") public ResponseData detectTYMerchantStore(@RequestParam(name = "merchantId", required = true) Long merchantId) throws Exception { HighMerchantModel merchant = highMerchantService.getMerchantById(merchantId); if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } Map param = new HashMap<>(); param.put("merchantId", merchant.getId()); List stores = highMerchantStoreService.getMerchantStoreList(param); for (HighMerchantStore store : stores) { JSONObject jsonObject = TuanYouConfig.queryGasInfoByGasId(store.getStoreKey()); if (jsonObject != null && jsonObject.getString("code").equals("200")) { JSONObject result = jsonObject.getJSONObject("result"); store.setStatus(result.getInteger("gasStatus")); } else { store.setStatus(0); } highMerchantStoreService.updateMerchantStoreDetail(store); } return ResponseMsgUtil.success("初始化完成"); } @RequestMapping(value = "/queryCompanyAccountInfo2JD", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询团油余额") public ResponseData queryCompanyAccountInfo2JD() { try { return ResponseMsgUtil.success(TuanYouConfig.queryCompanyAccountInfo2JD()); } catch (Exception e) { log.error("HighOrderController --> queryCompanyAccountInfo2JD() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryCompanyPriceDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询团油余额") public ResponseData queryCompanyPriceDetail() { try { return ResponseMsgUtil.success(TuanYouConfig.queryCompanyPriceDetail("LW000115995", "92")); } catch (Exception e) { log.error("HighOrderController --> queryCompanyAccountInfo2JD() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/starbucksOrdersPay", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "星巴克支付") public ResponseData starbucksOrdersPay(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.starbucksOrdersPay(orderNo)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/payKfcOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "肯德基支付") public ResponseData payKfcOrder(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.payKfcOrder(orderNo)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/wxSplitAccount", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "微信分账") public ResponseData wxSplitAccount() { try { HighOrder orderNo = highOrderService.getOrderByOrderNo("HF2021101812025050304"); wxProfitsharing(orderNo.getOrderNo(), orderNo.getPaySerialNo(), orderNo.getPayRealPrice()); return ResponseMsgUtil.success("分账成功"); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryStaging", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "分期查询") public ResponseData queryStaging(@RequestParam(name = "oriOrgTrace", required = true) String oriOrgTrace, HttpServletRequest request) { try { String orgTrace = CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(0, 4) + CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length() - 4, CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length()) + DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(6); return ResponseMsgUtil.success(UnionStagingPayConfig.queryStaging(orgTrace, oriOrgTrace, "", new Date(), request)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } /* @RequestMapping(value = "/orderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "退款") public ResponseData orderToRefund(HttpServletRequest request) { try { OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund("4200001301202202035413938093", new BigDecimal("30.80"), new BigDecimal("16.90")); return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } }*/ @RequestMapping(value = "/sendCNPCTicket", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "订单查询") public ResponseData sendCNPCTicket(@RequestParam(name = "couponKey", required = true) String couponKey, HttpServletRequest request) { try { String orderNo = System.currentTimeMillis()+""; // 预发码 JSONObject preSendCoupon = ChongQingCNPCService.preSendCoupon(couponKey, orderNo, 1, "17726395120"); if (preSendCoupon.getInteger("status").equals(1)) { // 给用户发码 JSONObject response = ChongQingCNPCService.sendCNPCTicket(couponKey, orderNo, 1, "17726395120"); return ResponseMsgUtil.success(response); } return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryCoupon", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "订单查询") public ResponseData queryCoupon(@RequestParam(name = "couponNo", required = true) String couponNo, HttpServletRequest request) { try { return ResponseMsgUtil.success(ChongQingCNPCService.queryCoupon(couponNo)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } public void wxProfitsharing(String transaction_id, String out_order_no, BigDecimal amount) { try { Map param = new LinkedHashMap<>(); param.put("appid", "wx637bd6f7314daa46"); param.put("mch_id", "1289663601"); param.put("sub_mch_id", "1609882817"); // 个体户黎杨珍 param.put("transaction_id", transaction_id); param.put("out_order_no", out_order_no); param.put("nonce_str", WxUtils.makeNonStr()); // 分账金额 BigDecimal porofitSharingAmount = amount; List> receiversList = new ArrayList<>(); Map receiversMap = new LinkedHashMap<>(); receiversMap.put("type", "MERCHANT_ID"); receiversMap.put("account", "1603942866"); receiversMap.put("amount", porofitSharingAmount.multiply(new BigDecimal("100")).intValue()); receiversMap.put("description", "分给商户【惠昕石化】"); receiversList.add(receiversMap); param.put("receivers", JSONObject.toJSONString(receiversList)); String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5", WXPayConstants.SignType.HMACSHA256); param.put("sign", signStr); String resultXmL = this.doRefundRequest(param.get("mch_id"), null, WxUtils.mapToXml(param)); // 请求分账返回的结果 ResultProfitSharing resultProfitSharing = XmlUtil.getObjectFromXML(resultXmL, ResultProfitSharing.class); if (!resultProfitSharing.getResult_code().equals("FAIL")) { HighProfitSharingRecord sharingRecord = new HighProfitSharingRecord(); sharingRecord.setOutOrderNo(resultProfitSharing.getOut_order_no()); sharingRecord.setTransactionId(resultProfitSharing.getTransaction_id()); sharingRecord.setOrderId(resultProfitSharing.getOrder_id()); sharingRecord.setStatus(resultProfitSharing.getResult_code()); sharingRecord.setPrice(amount); sharingRecord.setCreateTime(new Date()); sharingRecord.setContent(resultXmL); highProfitSharingRecordService.insert(sharingRecord); } } catch (Exception e) { log.error("CmsContentController --> getCorporateAdvertising() error!", e); } } public CloseableHttpClient readCertificate(String mchId) throws Exception { /** * 注意PKCS12证书 是从微信商户平台-》账户设置-》 API安全 中下载的 */ KeyStore keyStore = KeyStore.getInstance("PKCS12"); //P12文件目录 证书路径,这里需要你自己修改,linux下还是windows下的根路径 FileInputStream instream = new FileInputStream("/home/project/wx_cert/1289663601_apiclient_cert.p12"); // FileInputStream instream = new FileInputStream("G:\\hurui-project/hai-parent/hai-service/src/main/java/privatekey/1289663601_apiclient_cert.p12"); try { keyStore.load(instream, "1289663601".toCharArray());//这里写密码..默认是你的MCHID } finally { instream.close(); } SSLContext sslcontext = SSLContexts.custom().loadKeyMaterial(keyStore, "1289663601".toCharArray()).build();//这里也是写密码的 SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslcontext, SSLConnectionSocketFactory.getDefaultHostnameVerifier()); // Allow TLSv1 protocol only return HttpClients.custom().setSSLSocketFactory(sslsf).build(); } public String doRefundRequest(String mchId, String url, String data) throws Exception { //小程序退款需要调用双向证书的认证 CloseableHttpClient httpClient = readCertificate(mchId); try { HttpPost httpost = new HttpPost("https://api.mch.weixin.qq.com/secapi/pay/profitsharing"); // 设置响应头信息 httpost.addHeader("Connection", "keep-alive"); httpost.addHeader("Accept", "*/*"); httpost.addHeader("Content-Type", "text/xml"); httpost.addHeader("Host", "api.mch.weixin.qq.com"); httpost.addHeader("X-Requested-With", "XMLHttpRequest"); httpost.addHeader("Cache-Control", "max-age=0"); httpost.addHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) "); httpost.setEntity(new StringEntity(data, "UTF-8")); CloseableHttpResponse response = httpClient.execute(httpost); try { HttpEntity entity = response.getEntity(); String jsonStr = EntityUtils.toString(response.getEntity(), "UTF-8"); EntityUtils.consume(entity); return jsonStr; } finally { response.close(); } } catch (Exception e) { throw new RuntimeException(e); } finally { httpClient.close(); } } @RequestMapping(value = "/websocket", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "websocket") public ResponseData websocket(@RequestParam(name = "orderNo", required = true) String orderNo ) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) { Map pushMsg = new HashMap<>(); pushMsg.put("userId", order.getHighChildOrderList().get(0).getGoodsId()); Map msgContent = new HashMap<>(); msgContent.put("order", highOrderService.getGasOrderDetail(order.getOrderNo())); msgContent.put("voice", baiduVoiceService.text2audio(order.getHighChildOrderList().get(0).getGoodsName() + "加油站,收款:" + order.getTotalPrice())); pushMsg.put("message", JSONObject.toJSONString(msgContent)); HttpsUtils.doPost("http://127.0.0.1:9901/msg/test/websocket", pushMsg, new HashMap<>()); } return ResponseMsgUtil.success("null"); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/gasStationQueryDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "gasStationQueryDetail") public ResponseData gasStationQueryDetail() { try { return ResponseMsgUtil.success(shellGroupService.gasStationQueryDetail("0001")); } catch (Exception e) { log.error("HighOrderController --> gasStationQueryDetail() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/gasPageQueryAllStation", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "gasPageQueryAllStation") public ResponseData gasPageQueryAllStation() { try { gasService.getJiaHaoYouAllStation(); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> gasPageQueryAllStation() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/gasSyncRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "gasSyncRefund") public ResponseData gasSyncRefund() { try { shellGroupService.gasSyncRefund(new Date(1659511289000L), "1659511289357"); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> gasSyncRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getJzStationListPage", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "getJzStationListPage") public ResponseData getJzStationListPage() { try { gasService.getJinZhuAllStation(); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> gasSyncRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/insertV2", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付") public ResponseData insertV2() { try { String orderNo = "HF2022080818504922206"; JSONObject object = QianZhuConfig.insertV2("PLM100024", orderNo, "15585850137"); object.put("orderNo", orderNo); return ResponseMsgUtil.success(object); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } /* @RequestMapping(value = "/QueryV2", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询订单号") public ResponseData QueryV2(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); JSONObject orderObject = QianZhuConfig.QueryV2(orderNo); if (orderObject != null && orderObject.getLong("Code") == 999) { // 订单失败 // 订单状态 1:订单正在处理中 2;订单成功: 3 订单失败 if (orderObject.getJSONObject("Data").getInteger("OrderState") == 3) { // 订单失败 if (order.getOrderStatus() == 2) { highOrderService.thirdOrderToRefund(order.getId()); } else { highOrderService.thirdCancelOrder(order.getId()); } } // 订单状态 1:订单正在处理中 2;订单成功: 3 订单失败 if (orderObject.getJSONObject("Data").getInteger("OrderState") == 2) { for (HighChildOrder childOrder : order.getHighChildOrderList()) { childOrder.setChildOrdeStatus(3); } order.setOrderStatus(3); order.setFinishTime(new Date()); highOrderService.updateOrder(order); } } return ResponseMsgUtil.success(QianZhuConfig.QueryV2(orderNo)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } */ @RequestMapping(value = "/getKfcOrderByOrderNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询肯德基订单") public ResponseData getKfcOrderByOrderNo(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.getKfcOrderByOrderNo(orderNo)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/starbucksOrderByOrderNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询星巴克订单") public ResponseData starbucksOrderByOrderNo(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.starbucksOrderByOrderNo(orderNo)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/thirdOrderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "第三方退款") public ResponseData thirdOrderToRefund(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); highOrderService.thirdOrderToRefund(order.getId()); return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/rechargeOrderByCy", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "城宇话费充值 ") public ResponseData rechargeOrderByCy() { try { JSONObject object = new JSONObject(); object.put("mobile" , "18090580471"); object.put("productId" , 172); object.put("agentOrderId" , "RCG" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5)); return ResponseMsgUtil.success(RechargeConfig.rechargeOrderByCy(object)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryRechargeByCy", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "城宇查询订单") public ResponseData queryRechargeByCy(@RequestParam(name = "orderNo", required = true) String orderNo) { try { JSONObject object = new JSONObject(); object.put("orderNo" , orderNo); return ResponseMsgUtil.success(RechargeConfig.queryRechargeByCy(object)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/postIp", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "请求ip地址") public ResponseData postIp(HttpServletRequest request) { try { request.getHeader("regionId"); if (request.getHeader("regionId") != null && request.getHeader("regionId").length() != 0) { System.out.println("111"); } return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsgcs.dctpay.com/brest/openApi/test")); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file +package com.cweb.controller; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.cweb.config.SysConst; import com.hai.common.Base64Util; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.security.SessionObject; import com.hai.common.security.UserCenter; import com.hai.common.utils.*; import com.hai.config.*; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.enum_type.MerchantStoreSourceType; import com.hai.model.*; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContexts; import org.apache.http.util.EntityUtils; import org.bouncycastle.util.encoders.UrlBase64; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.util.IdGenerator; import org.springframework.web.bind.annotation.*; import sun.nio.cs.StreamEncoder; import javax.annotation.Resource; import javax.net.ssl.SSLContext; import javax.servlet.http.HttpServletRequest; import java.io.*; import java.math.BigDecimal; import java.nio.charset.StandardCharsets; import java.security.KeyStore; import java.util.*; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private PayloService payloService; @Resource private HighGasService gasService; @RequestMapping(value = "/getPayloAllStation", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "paylo油站") public ResponseData getPayloAllStation(HttpServletRequest request) { try { gasService.getPayloAllStation(); return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file diff --git a/hai-order/src/main/java/com/web/controller/OrderPayController.java b/hai-order/src/main/java/com/web/controller/OrderPayController.java index d0e77ca8..e3a4ed45 100644 --- a/hai-order/src/main/java/com/web/controller/OrderPayController.java +++ b/hai-order/src/main/java/com/web/controller/OrderPayController.java @@ -213,6 +213,15 @@ public class OrderPayController { weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo()); profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true)?"Y":"N"; + } else if (store.getSourceType().equals(MerchantStoreSourceType.type5.getNumber())) { + // 查询支付配置 + HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type5,GasChannelPayPlatformType.type1 ); + if (gasChannelConfig == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!"); + } + weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo()); + profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true)?"Y":"N"; + } else { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!"); } diff --git a/hai-cweb/src/main/java/com/cweb/controller/NotifyController.java b/hai-order/src/main/java/com/web/controller/notify/CqNotifyController.java similarity index 81% rename from hai-cweb/src/main/java/com/cweb/controller/NotifyController.java rename to hai-order/src/main/java/com/web/controller/notify/CqNotifyController.java index 1c92442c..04dff182 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/NotifyController.java +++ b/hai-order/src/main/java/com/web/controller/notify/CqNotifyController.java @@ -1,47 +1,31 @@ -package com.cweb.controller; +package com.web.controller.notify; -import cn.binarywang.wx.miniapp.api.WxMaService; -import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; -import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; -import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; import com.alibaba.fastjson.JSONObject; -import com.cweb.config.SysConst; -import com.hai.common.exception.ErrorCode; -import com.hai.common.exception.ErrorHelp; -import com.hai.common.exception.SysCode; -import com.hai.common.security.SessionObject; -import com.hai.common.security.UserCenter; import com.hai.common.utils.*; import com.hai.config.ChongQingCNPCService; import com.hai.config.CommonSysConst; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.enum_type.OrderPushType; -import com.hai.model.HighUserModel; -import com.hai.model.ResponseData; import com.hai.service.HighCouponCodeOtherService; -import com.hai.service.HighUserService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import java.util.*; @Controller -@RequestMapping(value = "/notify") +@RequestMapping(value = "/cqNotify") @Api(value = "通知") -public class NotifyController { +public class CqNotifyController { - private static final Logger log = LoggerFactory.getLogger(NotifyController.class); + private static final Logger log = LoggerFactory.getLogger(CqNotifyController.class); @Resource private HighCouponCodeOtherService couponCodeOtherService; diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java index 3ca8b7d7..9de2bd39 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java @@ -151,12 +151,12 @@ public class HighGasSchedule { } } - @Scheduled(cron = "10 0 0 * * ?") // 每日凌晨00:00:10执行一次 + @Scheduled(cron = "5 0 0 * * ?") // 每日凌晨00:00:5执行一次 public void getJiaHaoYouAllStation() throws Exception { gasService.getJiaHaoYouAllStation(); } - @Scheduled(cron = "10 0 0 * * ?") // 每日凌晨00:00:10执行一次 + @Scheduled(cron = "5 0 0 * * ?") // 每日凌晨00:00:5执行一次 public void getPayloAllStation() throws Exception { gasService.getPayloAllStation(); } diff --git a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java index 97fd5ec7..f6923650 100644 --- a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java +++ b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java @@ -1,5 +1,6 @@ package com.hai.config; +import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.PropertySource; import org.springframework.stereotype.Component; @@ -7,6 +8,7 @@ import org.springframework.stereotype.Component; @Component("commonSysConfig") @ConfigurationProperties @PropertySource("classpath:/commonConfig.properties") +@Data public class CommonSysConfig { // 嗨森逛域名 @@ -38,6 +40,10 @@ public class CommonSysConfig { private String jzPrivateKeyUrl; private String jzPublicKeyUrl; + // paylo系统参数 + private String payloPartnerId; + private String payloShellPlatMerchantKey; + private String qinzhuUrl; private String qinzhuUrlToken; private String qinzhuHtmlUrl; @@ -106,608 +112,7 @@ public class CommonSysConfig { private String unionRsaKey; private String fileUrl; - private String wxAppId; private String wxAppSecret; - public String getWxAppId() { - return wxAppId; - } - - public void setWxAppId(String wxAppId) { - this.wxAppId = wxAppId; - } - - public String getWxAppSecret() { - return wxAppSecret; - } - - public void setWxAppSecret(String wxAppSecret) { - this.wxAppSecret = wxAppSecret; - } - - public String getChongQingCnpcUrl() { - return ChongQingCnpcUrl; - } - - public void setChongQingCnpcUrl(String chongQingCnpcUrl) { - ChongQingCnpcUrl = chongQingCnpcUrl; - } - - public String getChongQingCnpcMerNo() { - return ChongQingCnpcMerNo; - } - - public void setChongQingCnpcMerNo(String chongQingCnpcMerNo) { - ChongQingCnpcMerNo = chongQingCnpcMerNo; - } - - public String getChongQingCnpcMerKey() { - return ChongQingCnpcMerKey; - } - - public void setChongQingCnpcMerKey(String chongQingCnpcMerKey) { - ChongQingCnpcMerKey = chongQingCnpcMerKey; - } - - public String getChongQingCnpcCouponSignKey() { - return ChongQingCnpcCouponSignKey; - } - - public void setChongQingCnpcCouponSignKey(String chongQingCnpcCouponSignKey) { - ChongQingCnpcCouponSignKey = chongQingCnpcCouponSignKey; - } - - public String getJzAppId() { - return jzAppId; - } - - public void setJzAppId(String jzAppId) { - this.jzAppId = jzAppId; - } - - public String getJzPrivateKeyUrl() { - return jzPrivateKeyUrl; - } - - public void setJzPrivateKeyUrl(String jzPrivateKeyUrl) { - this.jzPrivateKeyUrl = jzPrivateKeyUrl; - } - - public String getJzPublicKeyUrl() { - return jzPublicKeyUrl; - } - - public void setJzPublicKeyUrl(String jzPublicKeyUrl) { - this.jzPublicKeyUrl = jzPublicKeyUrl; - } - - public String getHuiliantongDistributorId() { - return huiliantongDistributorId; - } - - public void setHuiliantongDistributorId(String huiliantongDistributorId) { - this.huiliantongDistributorId = huiliantongDistributorId; - } - - public String getHuiliantongSinopecUrl() { - return huiliantongSinopecUrl; - } - - public void setHuiliantongSinopecUrl(String huiliantongSinopecUrl) { - this.huiliantongSinopecUrl = huiliantongSinopecUrl; - } - - public String getShellGroupPartnerId() { - return shellGroupPartnerId; - } - - public void setShellGroupPartnerId(String shellGroupPartnerId) { - this.shellGroupPartnerId = shellGroupPartnerId; - } - - public String getShellGroupUrl() { - return shellGroupUrl; - } - - public void setShellGroupUrl(String shellGroupUrl) { - this.shellGroupUrl = shellGroupUrl; - } - - public String getShellPlatMerchantId() { - return shellPlatMerchantId; - } - - public void setShellPlatMerchantId(String shellPlatMerchantId) { - this.shellPlatMerchantId = shellPlatMerchantId; - } - - public String getShellPlatMerchantKey() { - return shellPlatMerchantKey; - } - - public void setShellPlatMerchantKey(String shellPlatMerchantKey) { - this.shellPlatMerchantKey = shellPlatMerchantKey; - } - - public String getUnionAppId() { - return unionAppId; - } - - public void setUnionAppId(String unionAppId) { - this.unionAppId = unionAppId; - } - - public String getUnionSecret() { - return unionSecret; - } - - public void setUnionSecret(String unionSecret) { - this.unionSecret = unionSecret; - } - - public String getUnionRsaKey() { - return unionRsaKey; - } - - public void setUnionRsaKey(String unionRsaKey) { - this.unionRsaKey = unionRsaKey; - } - - public String getTuanYouUrl() { - return tuanYouUrl; - } - - public void setTuanYouUrl(String tuanYouUrl) { - this.tuanYouUrl = tuanYouUrl; - } - - public String getTuanYouAppKey() { - return tuanYouAppKey; - } - - public void setTuanYouAppKey(String tuanYouAppKey) { - this.tuanYouAppKey = tuanYouAppKey; - } - - public String getTuanYouAppSecret() { - return tuanYouAppSecret; - } - - public void setTuanYouAppSecret(String tuanYouAppSecret) { - this.tuanYouAppSecret = tuanYouAppSecret; - } - - public String getTuanYouDieselAccount() { - return tuanYouDieselAccount; - } - - public void setTuanYouDieselAccount(String tuanYouDieselAccount) { - this.tuanYouDieselAccount = tuanYouDieselAccount; - } - - public String getTuanYouGasolineAccount() { - return tuanYouGasolineAccount; - } - - public void setTuanYouGasolineAccount(String tuanYouGasolineAccount) { - this.tuanYouGasolineAccount = tuanYouGasolineAccount; - } - - - public String getQianzhuH5url() { - return qianzhuH5url; - } - - public void setQianzhuH5url(String qianzhuH5url) { - this.qianzhuH5url = qianzhuH5url; - } - - public String getQinzhuUrl() { - return qinzhuUrl; - } - - public String getQinzhuUrlToken() { - return qinzhuUrlToken; - } - - public void setQinzhuUrlToken(String qinzhuUrlToken) { - this.qinzhuUrlToken = qinzhuUrlToken; - } - - public void setQinzhuUrl(String qinzhuUrl) { - this.qinzhuUrl = qinzhuUrl; - } - - public String getQinzhuHtmlUrl() { - return qinzhuHtmlUrl; - } - - public void setQinzhuHtmlUrl(String qinzhuHtmlUrl) { - this.qinzhuHtmlUrl = qinzhuHtmlUrl; - } - - public String getQinzhuMobileUrl() { - return qinzhuMobileUrl; - } - - public void setQinzhuMobileUrl(String qinzhuMobileUrl) { - this.qinzhuMobileUrl = qinzhuMobileUrl; - } - - public String getQinzhuPlatformId() { - return qinzhuPlatformId; - } - - public void setQinzhuPlatformId(String qinzhuPlatformId) { - this.qinzhuPlatformId = qinzhuPlatformId; - } - - public String getQinzhuSecret() { - return qinzhuSecret; - } - - public void setQinzhuSecret(String qinzhuSecret) { - this.qinzhuSecret = qinzhuSecret; - } - - public String getQianzhuOrderNotify() { - return qianzhuOrderNotify; - } - - public void setQianzhuOrderNotify(String qianzhuOrderNotify) { - this.qianzhuOrderNotify = qianzhuOrderNotify; - } - - public String getHuiliantongUrl() { - return huiliantongUrl; - } - - public void setHuiliantongUrl(String huiliantongUrl) { - this.huiliantongUrl = huiliantongUrl; - } - - public String getHuiliantongAppNo() { - return huiliantongAppNo; - } - - public void setHuiliantongAppNo(String huiliantongAppNo) { - this.huiliantongAppNo = huiliantongAppNo; - } - - public String getHuiliantongAppkey() { - return huiliantongAppkey; - } - - public void setHuiliantongAppkey(String huiliantongAppkey) { - this.huiliantongAppkey = huiliantongAppkey; - } - - public String getHuiliantongAppsecret() { - return huiliantongAppsecret; - } - - public void setHuiliantongAppsecret(String huiliantongAppsecret) { - this.huiliantongAppsecret = huiliantongAppsecret; - } - - public String getHuiLianTongUnionCardUrl() { - return HuiLianTongUnionCardUrl; - } - - public void setHuiLianTongUnionCardUrl(String huiLianTongUnionCardUrl) { - HuiLianTongUnionCardUrl = huiLianTongUnionCardUrl; - } - - public String getHuiLianTongUnionCardAccessCode() { - return HuiLianTongUnionCardAccessCode; - } - - public void setHuiLianTongUnionCardAccessCode(String huiLianTongUnionCardAccessCode) { - HuiLianTongUnionCardAccessCode = huiLianTongUnionCardAccessCode; - } - - public String getHuiLianTongUnionCardSignCode() { - return HuiLianTongUnionCardSignCode; - } - - public void setHuiLianTongUnionCardSignCode(String huiLianTongUnionCardSignCode) { - HuiLianTongUnionCardSignCode = huiLianTongUnionCardSignCode; - } - - public String getUnionPayUrl() { - return unionPayUrl; - } - - public void setUnionPayUrl(String unionPayUrl) { - this.unionPayUrl = unionPayUrl; - } - - public String getUnionPayChannelid() { - return unionPayChannelid; - } - - public void setUnionPayChannelid(String unionPayChannelid) { - this.unionPayChannelid = unionPayChannelid; - } - - public String getUnionPayMerid() { - return unionPayMerid; - } - - public void setUnionPayMerid(String unionPayMerid) { - this.unionPayMerid = unionPayMerid; - } - - public String getUnionPayTermid() { - return unionPayTermid; - } - - public void setUnionPayTermid(String unionPayTermid) { - this.unionPayTermid = unionPayTermid; - } - - public String getUnionPaySignKey() { - return unionPaySignKey; - } - - public void setUnionPaySignKey(String unionPaySignKey) { - this.unionPaySignKey = unionPaySignKey; - } - - public String getUnionPayNotifyUrl() { - return unionPayNotifyUrl; - } - - public void setUnionPayNotifyUrl(String unionPayNotifyUrl) { - this.unionPayNotifyUrl = unionPayNotifyUrl; - } - - public String getUnionPayTelNotifyUrl() { - return unionPayTelNotifyUrl; - } - - public void setUnionPayTelNotifyUrl(String unionPayTelNotifyUrl) { - this.unionPayTelNotifyUrl = unionPayTelNotifyUrl; - } - - public String getUnionStagingPayUrl() { - return unionStagingPayUrl; - } - - public void setUnionStagingPayUrl(String unionStagingPayUrl) { - this.unionStagingPayUrl = unionStagingPayUrl; - } - - public String getUnionStagingPayOrgId() { - return unionStagingPayOrgId; - } - - public void setUnionStagingPayOrgId(String unionStagingPayOrgId) { - this.unionStagingPayOrgId = unionStagingPayOrgId; - } - - public String getUnionStagingPayOrgMerCode() { - return unionStagingPayOrgMerCode; - } - - public void setUnionStagingPayOrgMerCode(String unionStagingPayOrgMerCode) { - this.unionStagingPayOrgMerCode = unionStagingPayOrgMerCode; - } - - public String getUnionStagingPayOrgTermNo() { - return unionStagingPayOrgTermNo; - } - - public void setUnionStagingPayOrgTermNo(String unionStagingPayOrgTermNo) { - this.unionStagingPayOrgTermNo = unionStagingPayOrgTermNo; - } - - public String getUnionStagingPayNotifyUrl() { - return unionStagingPayNotifyUrl; - } - - public void setUnionStagingPayNotifyUrl(String unionStagingPayNotifyUrl) { - this.unionStagingPayNotifyUrl = unionStagingPayNotifyUrl; - } - - public String getWx_cert() { - return wx_cert; - } - - public void setWx_cert(String wx_cert) { - this.wx_cert = wx_cert; - } - - public String getTelApiKey() { - return telApiKey; - } - - public void setTelApiKey(String telApiKey) { - this.telApiKey = telApiKey; - } - - public String getTelApiSecret() { - return telApiSecret; - } - - public void setTelApiSecret(String telApiSecret) { - this.telApiSecret = telApiSecret; - } - - public String getTelMemberId() { - return telMemberId; - } - - public void setTelMemberId(String telMemberId) { - this.telMemberId = telMemberId; - } - - public String getTelUrl() { - return telUrl; - } - - public void setTelUrl(String telUrl) { - this.telUrl = telUrl; - } - - public String getCzOrderNotify() { - return czOrderNotify; - } - - public void setCzOrderNotify(String czOrderNotify) { - this.czOrderNotify = czOrderNotify; - } - - public String getHltMembershipLevelAccessCode() { - return HltMembershipLevelAccessCode; - } - - public void setHltMembershipLevelAccessCode(String hltMembershipLevelAccessCode) { - HltMembershipLevelAccessCode = hltMembershipLevelAccessCode; - } - - public String getHltMembershipLevelSignCode() { - return HltMembershipLevelSignCode; - } - - public void setHltMembershipLevelSignCode(String hltMembershipLevelSignCode) { - HltMembershipLevelSignCode = hltMembershipLevelSignCode; - } - - public String getJjNotifyUrl() { - return JjNotifyUrl; - } - - public void setJjNotifyUrl(String jjNotifyUrl) { - JjNotifyUrl = jjNotifyUrl; - } - - public String getJjAppKey() { - return JjAppKey; - } - - public void setJjAppKey(String jjAppKey) { - JjAppKey = jjAppKey; - } - - public String getJjUrl() { - return JjUrl; - } - - public void setJjUrl(String jjUrl) { - JjUrl = jjUrl; - } - - public String getJjAppSecret() { - return JjAppSecret; - } - - public void setJjAppSecret(String jjAppSecret) { - JjAppSecret = jjAppSecret; - } - - public String getHsgDomainName() { - return hsgDomainName; - } - - public void setHsgDomainName(String hsgDomainName) { - this.hsgDomainName = hsgDomainName; - } - - public String getLyApiKey() { - return lyApiKey; - } - - public void setLyApiKey(String lyApiKey) { - this.lyApiKey = lyApiKey; - } - - public String getLyMemberId() { - return lyMemberId; - } - - public void setLyMemberId(String lyMemberId) { - this.lyMemberId = lyMemberId; - } - - public String getLyPostUrl() { - return LyPostUrl; - } - - public void setLyPostUrl(String lyPostUrl) { - LyPostUrl = lyPostUrl; - } - - public String getLyNotifyUrl() { - return LyNotifyUrl; - } - - public void setLyNotifyUrl(String lyNotifyUrl) { - LyNotifyUrl = lyNotifyUrl; - } - - public String getThirdAppKey() { - return thirdAppKey; - } - - public void setThirdAppKey(String thirdAppKey) { - this.thirdAppKey = thirdAppKey; - } - - public String getThirdAppSecret() { - return thirdAppSecret; - } - - public void setThirdAppSecret(String thirdAppSecret) { - this.thirdAppSecret = thirdAppSecret; - } - - public String getThirdPostUrl() { - return thirdPostUrl; - } - - public void setThirdPostUrl(String thirdPostUrl) { - this.thirdPostUrl = thirdPostUrl; - } - - public String getCyApiKey() { - return CyApiKey; - } - - public void setCyApiKey(String cyApiKey) { - CyApiKey = cyApiKey; - } - - public String getCyAppSecret() { - return CyAppSecret; - } - - public void setCyAppSecret(String cyAppSecret) { - CyAppSecret = cyAppSecret; - } - - public String getCyPostUrl() { - return CyPostUrl; - } - - public void setCyPostUrl(String cyPostUrl) { - CyPostUrl = cyPostUrl; - } - - public String getGasDefaultOilStationImg() { - return gasDefaultOilStationImg; - } - - public void setGasDefaultOilStationImg(String gasDefaultOilStationImg) { - this.gasDefaultOilStationImg = gasDefaultOilStationImg; - } - - public String getFileUrl() { - return fileUrl; - } - - public void setFileUrl(String fileUrl) { - this.fileUrl = fileUrl; - } } diff --git a/hai-service/src/main/java/com/hai/config/PayloService.java b/hai-service/src/main/java/com/hai/config/PayloService.java index c67c1207..09796c10 100644 --- a/hai-service/src/main/java/com/hai/config/PayloService.java +++ b/hai-service/src/main/java/com/hai/config/PayloService.java @@ -26,8 +26,8 @@ import java.util.*; @Component public class PayloService { - private static final String partnerId = "S0302207281600105753"; - private static final String ShellPlatMerchantKey = "wqisfmkzea6mwd7ogbyh3488jv0hqhdj"; + private static final String partnerId = CommonSysConst.getSysConfig().getPayloPartnerId(); + private static final String ShellPlatMerchantKey = CommonSysConst.getSysConfig().getPayloShellPlatMerchantKey(); @Resource private BsTripartiteReqLogService reqLogService; diff --git a/hai-service/src/main/java/com/hai/enum_type/GasChannel.java b/hai-service/src/main/java/com/hai/enum_type/GasChannel.java index 19f5ca7c..d3b3a341 100644 --- a/hai-service/src/main/java/com/hai/enum_type/GasChannel.java +++ b/hai-service/src/main/java/com/hai/enum_type/GasChannel.java @@ -10,6 +10,7 @@ public enum GasChannel { type2(2 , "团油"), type3(3 , "加好油"), type4(4 , "金猪加油"), + type5(5 , "paylo系统"), ; private Integer type; diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderPayBeforeServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderPayBeforeServiceImpl.java index 9b4b6840..5a91c538 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderPayBeforeServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderPayBeforeServiceImpl.java @@ -76,6 +76,13 @@ public class OrderPayBeforeServiceImpl implements OrderPayBeforeService { if (gasChannelConfig == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!"); } + + } else if (store.getSourceType().equals(MerchantStoreSourceType.type5.getNumber())) { + // 查询支付配置 + HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type5,GasChannelPayPlatformType.type1 ); + if (gasChannelConfig == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!"); + } } else { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!"); } diff --git a/hai-service/src/main/java/com/hai/service/HighGasService.java b/hai-service/src/main/java/com/hai/service/HighGasService.java index 5cc098f6..c0c03e0f 100644 --- a/hai-service/src/main/java/com/hai/service/HighGasService.java +++ b/hai-service/src/main/java/com/hai/service/HighGasService.java @@ -10,6 +10,7 @@ import java.math.BigDecimal; public interface HighGasService { /** + * 重庆壳牌 * 获取渠道商【加好油】全量加油站 */ void getJiaHaoYouAllStation() throws Exception; @@ -21,6 +22,7 @@ public interface HighGasService { void getPayloAllStation() throws Exception; /** + * * 获取渠道商【金猪加油】全量加油站 */ void getJinZhuAllStation() throws Exception; diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java index 7d71b985..073a56cd 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java @@ -10,7 +10,6 @@ import com.hai.dao.HighGasDiscountOilPriceMapper; import com.hai.entity.*; import com.hai.enum_type.MerchantStoreSourceType; import com.hai.model.GasPayPriceModel; -import com.hai.model.HighMerchantStoreModel; import com.hai.service.*; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; @@ -156,6 +155,7 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri if (store.getSourceType().equals(MerchantStoreSourceType.type1.getNumber()) || store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber()) || store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber()) + || store.getSourceType().equals(MerchantStoreSourceType.type5.getNumber()) ) { // 嗨森逛平台价 油枪价 * 折扣 diff --git a/hai-service/src/main/resources/dev/commonConfig.properties b/hai-service/src/main/resources/dev/commonConfig.properties index 10618478..4d9b36ce 100644 --- a/hai-service/src/main/resources/dev/commonConfig.properties +++ b/hai-service/src/main/resources/dev/commonConfig.properties @@ -20,6 +20,10 @@ shellGroupPartnerId=S0302207281600105753 shellPlatMerchantId=S0302206141000105717 shellPlatMerchantKey=wqisfmkzea6mwd7ogbyh3488jv0hqhdj +# paylo configuration parameters +payloPartnerId=S0302207281600105753 +payloShellPlatMerchantKey=wqisfmkzea6mwd7ogbyh3488jv0hqhdj + # JinZhu configuration parameters jzAppId=app_huidui_prod_01 jzPrivateKeyUrl=/home/project/hsg/fileKey/JzPrivateKey.key diff --git a/hai-service/src/main/resources/prod-9401/commonConfig.properties b/hai-service/src/main/resources/prod-9401/commonConfig.properties index 39948a84..f94a77ca 100644 --- a/hai-service/src/main/resources/prod-9401/commonConfig.properties +++ b/hai-service/src/main/resources/prod-9401/commonConfig.properties @@ -17,6 +17,10 @@ shellGroupPartnerId=S0302208021401950202 shellPlatMerchantId=S0302206141001919666 shellPlatMerchantKey=pic1yj2l3zby5ywpznrtdz7458ce2soj +# paylo configuration parameters +payloPartnerId=S0302301161601992103 +payloShellPlatMerchantKey=s8w42iq4v5dpkh2rfok1aa131yqo140t + # JinZhu configuration parameters jzAppId=app_huidui_prod_01 jzPrivateKeyUrl=/home/project/hsg/fileKey/JzPrivateKey.key diff --git a/hai-service/src/main/resources/prod/commonConfig.properties b/hai-service/src/main/resources/prod/commonConfig.properties index 2d31b572..ff5ca57e 100644 --- a/hai-service/src/main/resources/prod/commonConfig.properties +++ b/hai-service/src/main/resources/prod/commonConfig.properties @@ -17,6 +17,10 @@ shellGroupPartnerId=S0302208021401950202 shellPlatMerchantId=S0302206141001919666 shellPlatMerchantKey=pic1yj2l3zby5ywpznrtdz7458ce2soj +# paylo configuration parameters +payloPartnerId=S0302301161601992103 +payloShellPlatMerchantKey=s8w42iq4v5dpkh2rfok1aa131yqo140t + # JinZhu configuration parameters jzAppId=app_huidui_prod_01 jzPrivateKeyUrl=/home/project/hsg/fileKey/JzPrivateKey.key