From ed24a97bb067d47ca6ce4ca42c2dec183309d0d1 Mon Sep 17 00:00:00 2001 From: = <=> Date: Sun, 8 Aug 2021 16:08:27 +0800 Subject: [PATCH] =?UTF-8?q?'=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/bweb/config/AuthConfig.java | 1 + .../bweb/controller/HighCouponController.java | 89 ++++++++++++- .../src/main/resources/dev/application.yml | 2 +- .../cweb/controller/HighOrderController.java | 17 ++- .../cweb/controller/HighTestController.java | 22 +--- .../java/com/hai/common/utils/HttpsUtils.java | 35 ++++++ .../java/com/hai/config/CommonSysConfig.java | 37 ++++++ .../com/hai/config/HuiLianTongConfig.java | 77 ++++++------ .../com/hai/dao/HighCouponCodeMapperExt.java | 30 ++++- .../hai/model/HighDiscountAgentCodeModel.java | 16 ++- .../hai/service/HighCouponCodeService.java | 8 ++ .../com/hai/service/HighCouponService.java | 7 ++ .../com/hai/service/HighOrderService.java | 2 +- .../impl/HighCouponCodeServiceImpl.java | 5 + .../service/impl/HighCouponServiceImpl.java | 11 ++ .../HighDiscountAgentCodeServiceImpl.java | 15 ++- .../service/impl/HighOrderServiceImpl.java | 118 ++++++++++++------ .../pay/impl/GoodsOrderServiceImpl.java | 75 +++++++---- .../resources/dev/commonConfig.properties | 5 + 19 files changed, 428 insertions(+), 144 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/config/AuthConfig.java b/hai-bweb/src/main/java/com/bweb/config/AuthConfig.java index 54f3b110..3e876b46 100644 --- a/hai-bweb/src/main/java/com/bweb/config/AuthConfig.java +++ b/hai-bweb/src/main/java/com/bweb/config/AuthConfig.java @@ -94,6 +94,7 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/common/*") .excludePathPatterns("/sms/*") .excludePathPatterns("/telApi/*") + .excludePathPatterns("/coupon/getGuizhouSinopec") .excludePathPatterns("/cmsContent/get*") ; } diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java b/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java index b32d9d64..787ad955 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java @@ -2,6 +2,7 @@ package com.bweb.controller; import com.alibaba.excel.EasyExcel; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.bweb.excelListener.ImportCouponListener; import com.bweb.model.ImportCouponModel; @@ -16,6 +17,7 @@ import com.hai.common.security.UserCenter; import com.hai.common.utils.DateUtil; import com.hai.common.utils.MemberValidateUtil; import com.hai.common.utils.ResponseMsgUtil; +import com.hai.config.HuiLianTongConfig; import com.hai.entity.*; import com.hai.enum_type.ApproveType; import com.hai.model.HighCouponHandselModel; @@ -295,10 +297,13 @@ public class HighCouponController { throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_UNABLE_UP_SHELF, ""); } - // 根据卡卷查询 销售码库存 - if (highCouponCodeService.getStockCountByCoupon(coupon.getId()) == 0) { - log.error("HighCouponController -> upShelfApprove() error!","卡卷库存数量错误"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_STOCK_ERROR, ""); + // 中石化 + if (coupon.getCouponSource() != 4) { + // 根据卡卷查询 销售码库存 + if (highCouponCodeService.getStockCountByCoupon(coupon.getId()) == 0) { + log.error("HighCouponController -> upShelfApprove() error!","卡卷库存数量错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_STOCK_ERROR, ""); + } } HighApprove approve = new HighApprove(); @@ -564,4 +569,80 @@ public class HighCouponController { } } + @RequestMapping(value="/getGuizhouSinopec",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取贵州中石化电子卡券") + public ResponseData getGuizhouSinopec(HttpServletRequest request) { + try { + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + if (userInfoModel.getBsCompany() == null) { + log.error("HighCouponController -> insertCoupon() error!","该主角色没有权限"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, ""); + } + // 查询商户 + HighMerchant merchant = highMerchantService.getMerchantById(40L); + if (merchant == null) { + log.error("HighCouponController -> insertCoupon() error!","未找到商户"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, ""); + } + + // 获取token + JSONObject tokenObject = HuiLianTongConfig.getToken(); + if (!tokenObject.getString("result").equals("success")) { + log.error("HighCouponController -> insertCoupon() error!","获取token失败"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取token失败"); + } + + // 查询电子卡券类型 + JSONObject corpCouTypes = HuiLianTongConfig.getCorpCouTypes(tokenObject.getString("data")); + if (!corpCouTypes.getString("result").equals("success")) { + log.error("HighCouponController -> insertCoupon() error!","获取电子卡券列表失败"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取电子卡券列表失败"); + } + + HighCoupon coupon; + JSONArray dataArray = corpCouTypes.getJSONArray("data"); + if (dataArray != null && dataArray.size() > 0) { + for (Object object : dataArray) { + JSONObject dataObject = (JSONObject)object; + HighCoupon highCoupon = highCouponService.getCouponDetail(dataObject.getString("couTypeCode")); + if (highCoupon != null) { + continue; + } + coupon = new HighCoupon(); + coupon.setCompanyId(userInfoModel.getBsCompany().getId()); + coupon.setMerchantId(merchant.getId()); + coupon.setCouponKey(dataObject.getString("couTypeCode")); + coupon.setCouponName(dataObject.getString("couTypeTitle")); + coupon.setCouponPrice(dataObject.getBigDecimal("couFaceValue")); + coupon.setCouponImg(dataObject.getString("couPic")); + coupon.setCouponCarouselImg(dataObject.getString("couPic")); + coupon.setCouponDesc(dataObject.getString("couDesc")); + coupon.setCouponType(2); + coupon.setSalesEndTime(dataObject.getDate("validEndDate")); + coupon.setRecycleDay(99); + coupon.setLimitNumber(99); + coupon.setSalesPrice(dataObject.getBigDecimal("couFaceValue")); + coupon.setDiscountPrice(dataObject.getBigDecimal("couFaceValue")); + coupon.setSalesCount(0); + coupon.setIsPresent(false); + coupon.setCreateTime(new Date()); + coupon.setUpdateTime(new Date()); + coupon.setOperatorId(0L); + coupon.setOperatorName("系统自动生成"); + coupon.setPayType(2); + coupon.setStatus(1); + coupon.setDisplayArea(2); + coupon.setCouponSource(4); + highCouponService.insertCoupon(coupon); + } + } + return ResponseMsgUtil.success("操作成功"); + } catch (Exception e) { + log.error("HighCouponController -> getGuizhouSinopec() error!",e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-bweb/src/main/resources/dev/application.yml b/hai-bweb/src/main/resources/dev/application.yml index 3b6bb9fa..3412b88f 100644 --- a/hai-bweb/src/main/resources/dev/application.yml +++ b/hai-bweb/src/main/resources/dev/application.yml @@ -9,7 +9,7 @@ debug: false #datasource数据源设置 spring: datasource: - url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://139.159.177.244:3306/hsg_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false username: root password: HF123456. type: com.alibaba.druid.pool.DruidDataSource diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index efbe1773..1556ece9 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -140,14 +140,18 @@ public class HighOrderController { } else { childOrder.setGoodsPrice(coupon.getDiscountPrice()); } - if (highCouponCodeService.getStockCountByCoupon(coupon.getId()) <= 0) { - log.error("HighOrderController --> addOrder() error!", "卡卷库存数量不足"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_STOCK_INSUFFICIENT, ""); + // 贵州中石化 + if (coupon.getCouponSource() != 4) { + if (highCouponCodeService.getStockCountByCoupon(coupon.getId()) <= 0) { + log.error("HighOrderController --> addOrder() error!", "卡卷库存数量不足"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_STOCK_INSUFFICIENT, ""); + } } childOrder.setGoodsActualPrice(childOrder.getGoodsPrice()); childOrder.setGoodsName(coupon.getCouponName()); childOrder.setGoodsImg(coupon.getCouponImg()); childOrder.setGoodsSpecName("默认"); + childOrder.setExt1(coupon.getCouponSource().toString()); } if (childOrder.getGoodsType() == 2) { @@ -426,11 +430,4 @@ public class HighOrderController { return ResponseMsgUtil.exception(e); } } -/* - public static void main(String[] args) { - BigDecimal bigDecimal1 = new BigDecimal("1200").divide(new BigDecimal("5.58"), 10, BigDecimal.ROUND_DOWN); - System.out.println(bigDecimal1); - BigDecimal bigDecimal2 = bigDecimal1.multiply(new BigDecimal("5.40")).setScale(2, BigDecimal.ROUND_HALF_UP); - System.out.println(bigDecimal2); - }*/ } 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 7f59efa2..5b307881 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java @@ -173,7 +173,7 @@ public class HighTestController { } @RequestMapping(value = "/test2", method = RequestMethod.GET) @ResponseBody - @ApiOperation(value = "测试") + @ApiOperation(value = "获取汇联通Token") public ResponseData test2() { try { return ResponseMsgUtil.success(HuiLianTongConfig.getToken()); @@ -186,9 +186,9 @@ public class HighTestController { @RequestMapping(value = "/getCorpCouTypes", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "测试") - public ResponseData getCorpCouTypes() { + public ResponseData getCorpCouTypes(@RequestParam(name = "token", required = true) String token) { try { - return ResponseMsgUtil.success(HuiLianTongConfig.getCorpCouTypes()); + return ResponseMsgUtil.success(HuiLianTongConfig.getCorpCouTypes(token)); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); @@ -198,25 +198,13 @@ public class HighTestController { @RequestMapping(value = "/couJointDist", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "测试") - public ResponseData couJointDist() { + public ResponseData couJointDist(@RequestParam(name = "token", required = true) String token) { try { - return ResponseMsgUtil.success(HuiLianTongConfig.couJointDist()); + return ResponseMsgUtil.success(HuiLianTongConfig.couJointDist(token,"20JY000251",2,"17726395120", "oArhO6XxKSvjI9wLP3cTK-iSG8yY")); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); } } - @RequestMapping(value = "/queryOilCardAccount", method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "测试") - public ResponseData queryOilCardAccount() { - try { - return ResponseMsgUtil.success(TuanYouConfig.queryCompanyAccountInfo2JD()); - } catch (Exception e) { - log.error("HighOrderController --> queryOilCardAccount() error!", e); - return ResponseMsgUtil.exception(e); - } - } - } diff --git a/hai-service/src/main/java/com/hai/common/utils/HttpsUtils.java b/hai-service/src/main/java/com/hai/common/utils/HttpsUtils.java index 5fe774e3..6b15ddd1 100644 --- a/hai-service/src/main/java/com/hai/common/utils/HttpsUtils.java +++ b/hai-service/src/main/java/com/hai/common/utils/HttpsUtils.java @@ -343,6 +343,41 @@ public class HttpsUtils { return null; } + public static JSONObject doHuiLianTongPost(String apiUrl) { + CloseableHttpClient httpClient = null; + if (apiUrl.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + String httpStr = null; + CloseableHttpResponse response = null; + try { + HttpPost httpPost = new HttpPost(apiUrl); + httpPost.setConfig(requestConfig); + StringEntity stringEntity = new StringEntity("", "UTF-8");// 解决中文乱码问题 + stringEntity.setContentEncoding("UTF-8"); + stringEntity.setContentType("application/x-www-form-urlencoded"); + httpPost.setEntity(stringEntity); + response = httpClient.execute(httpPost); + HttpEntity entity = response.getEntity(); + httpStr = EntityUtils.toString(entity, "UTF-8"); + return JSON.parseObject(httpStr); + } catch (Exception e) { + log.error(e.getMessage(),e); + } finally { + if (response != null) { + try { + EntityUtils.consume(response.getEntity()); + } catch (IOException e) { + log.error(e.getMessage(),e); + } + } + } + return null; + } + public static JSONObject doWxPost(String apiUrl, Map body, Map header) { CloseableHttpClient httpClient = null; if (apiUrl.startsWith("https")) { 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 b94cb53e..4cf4b468 100644 --- a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java +++ b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java @@ -22,6 +22,11 @@ public class CommonSysConfig { private String qinzhuSecret; private String qianzhuOrderNotify; + private String huiliantongUrl; + private String huiliantongAppNo; + private String huiliantongAppkey; + private String huiliantongAppsecret; + private String wx_cert; private String telApiKey; @@ -30,6 +35,38 @@ public class CommonSysConfig { private String telUrl; private String czOrderNotify; + public String getHuiliantongAppNo() { + return huiliantongAppNo; + } + + public void setHuiliantongAppNo(String huiliantongAppNo) { + this.huiliantongAppNo = huiliantongAppNo; + } + + public String getHuiliantongUrl() { + return huiliantongUrl; + } + + public void setHuiliantongUrl(String huiliantongUrl) { + this.huiliantongUrl = huiliantongUrl; + } + + 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 getQinzhuHtmlUrl() { return qinzhuHtmlUrl; } diff --git a/hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java b/hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java index f97af8e1..bec50dd1 100644 --- a/hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java +++ b/hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java @@ -1,21 +1,20 @@ package com.hai.config; import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.HttpsUtils; import com.hai.common.utils.MD5Util; -import com.hai.common.utils.WxUtils; +import com.hai.dao.HighGasOrderPushMapper; +import com.hai.entity.HighGasOrderPush; import org.apache.commons.collections4.MapUtils; -import org.apache.commons.lang3.StringUtils; +import org.springframework.context.annotation.Configuration; import sun.misc.BASE64Decoder; import sun.misc.BASE64Encoder; +import javax.annotation.Resource; import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec; import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; import java.net.URLEncoder; import java.security.MessageDigest; import java.util.*; @@ -28,7 +27,6 @@ import java.util.*; * @date 2021/7/5 14:18 */ public class HuiLianTongConfig { - /** * 获取token * @return @@ -36,62 +34,67 @@ public class HuiLianTongConfig { */ public static JSONObject getToken() throws Exception { Map map = new HashMap<>(); - map.put("appNo", "guizhouhltcs"); - map.put("appKey", MD5Util.encode("g%2BNnjR54YSUWM2iKg%2Fd82A9x9hg2kYV7".getBytes())); - return HttpsUtils.doPost("https://gzapitest.deepermobile.com.cn:441/api/api/auth/getAccessToken", JSON.toJSONString(map)); + map.put("appNo",CommonSysConst.getSysConfig().getHuiliantongAppNo()); + map.put("appKey", MD5Util.encode(CommonSysConst.getSysConfig().getHuiliantongAppkey().getBytes())); + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getHuiliantongUrl()+"/api/api/auth/getAccessToken", JSON.toJSONString(map)); } - public static JSONObject getCorpCouTypes() throws Exception { + /** + * 获取电子券类型列表 + * @param token + * @return + * @throws Exception + */ + public static JSONObject getCorpCouTypes(String token) { Map param = new HashMap<>(); Map map = new HashMap<>(); - map.put("token", "a::57D9BBA185484EAD82737168B28EDA62"); - map.put("jsonData", get3DESEncryptECB(JSON.toJSONString(param), "FA28E95ACABFA4B2B8E25857437B07F1")); + map.put("token", token); + /* map.put("jsonData", get3DESEncryptECB(JSON.toJSONString(param), CommonSysConst.getSysConfig().getHuiliantongAppsecret())); StringJoiner urlParamStr = new StringJoiner("&"); urlParamStr.add(String.format("jsonData=%s", param)); - urlParamStr.add(String.format("secretKey=%s","FA28E95ACABFA4B2B8E25857437B07F1")); - map.put("sign", md5Capital(urlParamStr.toString())); - return HttpsUtils.doPost("https://gzapitest.deepermobile.com.cn:441/coupon/api/coupon_corp/getCorpCouTypes", JSON.toJSONString(map)); + urlParamStr.add(String.format("secretKey=%s",CommonSysConst.getSysConfig().getHuiliantongAppsecret())); + map.put("sign", md5Capital(urlParamStr.toString()));*/ + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getHuiliantongUrl()+"/coupon/api/coupon_corp/getCorpCouTypes", JSON.toJSONString(map)); } - public static JSONObject couJointDist() throws Exception { + + /** + * 商户派发电子券 + * @param token + * @param couTypeCode 电子卡券类型 + * @param distCouCount 分配数量 + * @param userPhone 用户手机号 + * @param thirdUserId 用户编号 + * @return + * @throws Exception + */ + public static JSONObject couJointDist(String token,String couTypeCode,Integer distCouCount,String userPhone,String thirdUserId) throws Exception { // 券列表 List> objectList = new ArrayList<>(); Map object = new HashMap<>(); - object.put("couTypeCode", "20JY000251"); - object.put("distCouCount", 1); + object.put("couTypeCode", couTypeCode); + object.put("distCouCount", distCouCount); objectList.add(object); - // 参数 Map param = new HashMap<>(); param.put("coupons", objectList); - param.put("phone", "17726395120"); - param.put("thirdUserId", "oArhO6XxKSvjI9wLP3cTK-iSG8yY"); + param.put("phone", userPhone); + param.put("thirdUserId", thirdUserId); param.put("orderNo", "HF"+new Date().getTime()); param.put("distOuCode", "guizhouhltcs"); - String appKey = "g%2BNnjR54YSUWM2iKg%2Fd82A9x9hg2kYV7"; - String appSecret = "FA28E95ACABFA4B2B8E25857437B07F1"; - Map map = new HashMap<>(); - map.put("token", "a::57D9BBA185484EAD82737168B28EDA62"); - map.put("jsonData", get3DESEncryptECB(JSON.toJSONString(param), appKey)); - + map.put("token", token); + map.put("jsonData", get3DESEncryptECB(JSON.toJSONString(param), CommonSysConst.getSysConfig().getHuiliantongAppkey())); StringJoiner joiner = new StringJoiner("&"); joiner.add("jsonData=" + JSON.toJSONString(param)); - joiner.add("secretKey=" + appSecret); + joiner.add("secretKey=" + CommonSysConst.getSysConfig().getHuiliantongAppsecret()); map.put("sign", md5Capital(joiner.toString())); - Map map1 = new HashMap<>(); - String fromStr = "token="+MapUtils.getString(map, "token")+"&sign=" + MapUtils.getString(map, "sign")+"&jsonData=" + URLEncoder.encode(MapUtils.getString(map, "jsonData"),"UTF-8"); - map1.put("from", ""); - return HttpsUtils.doSmsPost("https://gzapitest.deepermobile.com.cn:441/coupon/api/coupon_corp/couJointDist?"+fromStr, map1, new HashMap<>()); + String paramStr = "token="+MapUtils.getString(map, "token")+"&sign=" + MapUtils.getString(map, "sign")+"&jsonData=" + URLEncoder.encode(MapUtils.getString(map, "jsonData"),"UTF-8"); + return HttpsUtils.doHuiLianTongPost(CommonSysConst.getSysConfig().getHuiliantongUrl() + "/coupon/api/coupon_corp/couJointDist?" + paramStr); } - public static void main(String[] args) throws UnsupportedEncodingException { - String decode = URLDecoder.decode("jkE2O4ZKfL6F2IWQyf01oNXbCY%252FM1xZ7OP1%252BJVeXCfpWZgaFjIjZaVTPdJHkxRUlPJikskS6rQs1OMbMiu9ZgKaHftjA%252BJ7f%252BSFzsOPDPpnACegOBBR%252BjN5ZxOH%252FDPe9pOoGA53gBbAIEuqkDlqirxJyNR%252FJHip%252BoAQ2%252FN00pD1pIyvBqGsks%252Bx0w2w7GzYGcacU7iQrVHPhcFdyGFJUhWOaBMhRgNi0lJw9Pjt8xuY5IXwAjgk0EQ%253D%253D", "UTF-8"); - System.out.println(decode); - System.out.println(get3DESDecryptECB(decode, "FA28E95ACABFA4B2B8E25857437B07F1")); - } public static String get3DESEncryptECB(String src,String secretKey) { try { diff --git a/hai-service/src/main/java/com/hai/dao/HighCouponCodeMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighCouponCodeMapperExt.java index 551432a9..3a5af58b 100644 --- a/hai-service/src/main/java/com/hai/dao/HighCouponCodeMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighCouponCodeMapperExt.java @@ -1,8 +1,8 @@ package com.hai.dao; import com.hai.entity.HighCouponCode; -import org.apache.ibatis.annotations.Insert; -import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.*; +import org.apache.ibatis.type.JdbcType; import java.util.List; @@ -57,4 +57,30 @@ public interface HighCouponCodeMapperExt { }) void insertList(@Param(value = "list") List list); + @Select("select * from high_coupon_code where child_order_id = (SELECT b.id child_order_id FROM high_order a,high_child_order b where a.mem_discount_id = #{discountUserRelId} and a.id = b.order_id and b.goods_type = 1 and b.child_orde_status in (2,3,4))") + @Results({ + @Result(column="id", property="id", jdbcType= JdbcType.BIGINT, id=true), + @Result(column="coupon_id", property="couponId", jdbcType=JdbcType.BIGINT), + @Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT), + @Result(column="is_assign_agent", property="isAssignAgent", jdbcType=JdbcType.BIT), + @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT), + @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT), + @Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR), + @Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT), + @Result(column="code_key", property="codeKey", jdbcType=JdbcType.VARCHAR), + @Result(column="sales_code", property="salesCode", jdbcType=JdbcType.VARCHAR), + @Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="use_end_time", property="useEndTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="receive_time", property="receiveTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="consume_time", property="consumeTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT), + @Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + HighCouponCode selectCouponCodeByUserDiscount(@Param("discountUserRelId") Long discountUserRelId); + } diff --git a/hai-service/src/main/java/com/hai/model/HighDiscountAgentCodeModel.java b/hai-service/src/main/java/com/hai/model/HighDiscountAgentCodeModel.java index 7d427497..3c2e0b7a 100644 --- a/hai-service/src/main/java/com/hai/model/HighDiscountAgentCodeModel.java +++ b/hai-service/src/main/java/com/hai/model/HighDiscountAgentCodeModel.java @@ -1,9 +1,6 @@ package com.hai.model; -import com.hai.entity.HighAgent; -import com.hai.entity.HighDiscount; -import com.hai.entity.HighOrder; -import com.hai.entity.HighUser; +import com.hai.entity.*; /** * 优惠券码 @@ -16,12 +13,23 @@ public class HighDiscountAgentCodeModel { // 优惠券 private HighDiscount highDiscount; + // 卡券码 + private HighCouponCode highCouponCode; + // 订单 private HighOrder highOrder; // 用户 private HighUser highUser; + public HighCouponCode getHighCouponCode() { + return highCouponCode; + } + + public void setHighCouponCode(HighCouponCode highCouponCode) { + this.highCouponCode = highCouponCode; + } + public HighAgent getHighAgent() { return highAgent; } diff --git a/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java b/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java index fddb8b48..c4624960 100644 --- a/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java +++ b/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java @@ -1,5 +1,6 @@ package com.hai.service; +import com.hai.entity.HighCoupon; import com.hai.entity.HighCouponCode; import com.hai.model.UserInfoModel; @@ -56,6 +57,13 @@ public interface HighCouponCodeService { **/ HighCouponCode getCouponCodeByOrderId(Long childOrderId); + /** + * 根据用户优惠券查询 + * @param discountUserRelId + * @return + */ + HighCouponCode getCouponCodeByUserDiscount(Long discountUserRelId); + /** * @Author 胡锐 * @Description 根据销售码查询 diff --git a/hai-service/src/main/java/com/hai/service/HighCouponService.java b/hai-service/src/main/java/com/hai/service/HighCouponService.java index 7dc3e38e..7f8860f2 100644 --- a/hai-service/src/main/java/com/hai/service/HighCouponService.java +++ b/hai-service/src/main/java/com/hai/service/HighCouponService.java @@ -91,6 +91,13 @@ public interface HighCouponService { **/ HighCoupon getCouponDetail(Long id); + /** + * 根据卡券key查询 + * @param couponKey + * @return + */ + HighCoupon getCouponDetail(String couponKey); + /** * @Author 胡锐 * @Description 获取卡卷集合 diff --git a/hai-service/src/main/java/com/hai/service/HighOrderService.java b/hai-service/src/main/java/com/hai/service/HighOrderService.java index 681f8029..0c0b199b 100644 --- a/hai-service/src/main/java/com/hai/service/HighOrderService.java +++ b/hai-service/src/main/java/com/hai/service/HighOrderService.java @@ -33,7 +33,7 @@ public interface HighOrderService { * @Description 金币支付订单 * @Date 2021/3/27 11:20 **/ - void goldPayOrder(Long userId, Long orderId); + void goldPayOrder(Long userId, Long orderId) throws Exception; /** * @Author 胡锐 diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java index 72b8a334..f83b806d 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java @@ -195,6 +195,11 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService { return null; } + @Override + public HighCouponCode getCouponCodeByUserDiscount(Long discountUserRelId) { + return null; + } + @Override public HighCouponCode getCouponCodeBySalesCode(String code) { HighCouponCodeExample example = new HighCouponCodeExample(); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java index 0016aa81..dcc80d75 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java @@ -320,6 +320,17 @@ public class HighCouponServiceImpl implements HighCouponService { return model; } + @Override + public HighCoupon getCouponDetail(String couponKey) { + HighCouponExample example = new HighCouponExample(); + example.createCriteria().andCouponKeyEqualTo(couponKey).andStatusNotEqualTo(0); + List list = highCouponMapper.selectByExample(example); + if (list.size() > 0) { + return list.get(0); + } + return null; + } + @Override public List getCouponList(Map map) { HighCouponExample example = new HighCouponExample(); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java index bb278771..bc655b91 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java @@ -1,5 +1,6 @@ package com.hai.service.impl; +import com.hai.dao.HighCouponCodeMapper; import com.hai.dao.HighDiscountAgentCodeMapper; import com.hai.entity.*; import com.hai.service.*; @@ -24,6 +25,9 @@ public class HighDiscountAgentCodeServiceImpl implements HighDiscountAgentCodeSe @Resource private HighDiscountAgentRelService highDiscountAgentRelService; + @Resource + private HighCouponCodeMapper highCouponCodeMapper; + @Resource private HighDiscountService highDiscountService; @@ -71,16 +75,15 @@ public class HighDiscountAgentCodeServiceImpl implements HighDiscountAgentCodeSe List list = highDiscountAgentCodeMapper.selectByExample(example); for (HighDiscountAgentCode code : list) { HighDiscountAgentRel rel = highDiscountAgentRelService.getRelById(code.getDiscountAgentId()); + if (rel != null) { + code.setHighDiscount(highDiscountService.getDiscountById(rel.getDiscountId())); + code.setHighAgent(highAgentService.findByAgentMsgId(rel.getAgentId())); + } HighDiscountUserRel userRel = highDiscountUserRelService.getRelByDiscount(code.getId()); - if (userRel != null) { code.setHighUser(highUserService.findByUserId(userRel.getUserId())); - } - - if (rel != null) { - code.setHighDiscount(highDiscountService.getDiscountById(rel.getDiscountId())); - code.setHighAgent(highAgentService.findByAgentMsgId(rel.getAgentId())); + code.setHighCouponCode(highCouponCodeMapper.selectCouponCodeByUserDiscount(userRel.getId())); } } return list; diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index 6d22740c..859ba8ca 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -1,11 +1,13 @@ package com.hai.service.impl; +import com.alibaba.fastjson.JSONObject; import com.hai.common.QRCodeGenerator; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.utils.DateUtil; import com.hai.common.utils.IDGenerator; +import com.hai.config.HuiLianTongConfig; import com.hai.dao.*; import com.hai.entity.*; import com.hai.model.HighCouponHandselModel; @@ -49,6 +51,9 @@ public class HighOrderServiceImpl implements HighOrderService { @Resource private HighCouponService highCouponService; + @Resource + private HighGasOrderPushMapper highGasOrderPushMapper; + @Resource private HighCouponHandselService highCouponHandselService; @@ -91,18 +96,20 @@ public class HighOrderServiceImpl implements HighOrderService { // 商品类型 1:卡卷 if (childOrder.getGoodsType() == 1) { - // 查询待销售 - List list = highCouponCodeService.getNoSaleCode(childOrder.getGoodsId()); - if (list == null || list.size() == 0) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_STOCK_INSUFFICIENT, ""); + // 查询卡券 + HighCoupon couponDetail = highCouponService.getCouponDetail(childOrder.getGoodsId()); + if (couponDetail.getCouponSource() != 4) { + // 查询待销售 + List list = highCouponCodeService.getNoSaleCode(childOrder.getGoodsId()); + if (list == null || list.size() == 0) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_STOCK_INSUFFICIENT, ""); + } + list.get(0).setChildOrderId(childOrder.getId()); + list.get(0).setStatus(99); // 状态:1.待销售 2.未使用 3.已使用 99.预支付 + highCouponCodeService.updateCouponCode(list.get(0)); + childOrder.setExt1(list.get(0).getExt1()); + highChildOrderMapper.updateByPrimaryKey(childOrder); } - list.get(0).setChildOrderId(childOrder.getId()); - list.get(0).setStatus(99); // 状态:1.待销售 2.未使用 3.已使用 99.预支付 - highCouponCodeService.updateCouponCode(list.get(0)); - - childOrder.setExt1(list.get(0).getExt1()); - highChildOrderMapper.updateByPrimaryKey(childOrder); - if(!childOrder.getGiveawayType()) { // 查看是否需要赠送卡卷 List handselListByCoupon = highCouponHandselService.getHandselListByCoupon(childOrder.getGoodsId()); @@ -146,12 +153,15 @@ public class HighOrderServiceImpl implements HighOrderService { @Override @Transactional(propagation= Propagation.REQUIRES_NEW) - public void goldPayOrder(Long userId, Long orderId) { + public void goldPayOrder(Long userId, Long orderId) throws Exception { HighOrder highOrder = getOrderById(orderId); if(highOrder == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_ORDER, ""); } + // 查询用户 + HighUser highUser = highUserService.findByUserId(highOrder.getMemId()); + // 金币 1:100 Integer goldNum = new BigDecimal(highOrder.getTotalPrice().toString()).multiply(new BigDecimal("100")).intValue(); highUserService.goldHandle(userId, goldNum, 2, 2, highOrder.getId()); @@ -167,37 +177,63 @@ public class HighOrderServiceImpl implements HighOrderService { // 商品类型 商品类型 1:卡卷 2:金币充值 if (highChildOrder.getGoodsType() == 1) { - HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId()); - code.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用 99.预支付 - code.setReceiveTime(new Date()); - highCouponCodeService.updateCouponCode(code); - - HighCoupon coupon = highCouponService.getCouponById(highChildOrder.getGoodsId()); - - // 卡卷关联用户 - HighUserCoupon highUserCoupon = new HighUserCoupon(); - highUserCoupon.setMerchantId(code.getMerchantId()); - highUserCoupon.setCouponId(code.getCouponId()); - highUserCoupon.setUserId(highOrder.getMemId()); - highUserCoupon.setCouponCodeId(code.getId()); - highUserCoupon.setCreateTime(new Date()); - highUserCoupon.setQrCodeImg(code.getExt1()); - - // 计算使用有效期 - Calendar userEndTime = Calendar.getInstance(); - userEndTime.setTime(new Date()); - userEndTime.set(Calendar.HOUR_OF_DAY, 23); - userEndTime.set(Calendar.MINUTE, 59); - userEndTime.set(Calendar.SECOND, 59); - userEndTime.add(Calendar.DATE, coupon.getRecycleDay()); - - if (userEndTime.getTime().compareTo(code.getUseEndTime()) == 1) { - highUserCoupon.setUseEndTime(code.getUseEndTime()); + // 查询卡券 + HighCoupon coupon = highCouponService.getCouponDetail(highChildOrder.getGoodsId()); + // 贵州高速 + if (coupon.getCouponSource() == 4) { + // 获取token + JSONObject tokenObject = HuiLianTongConfig.getToken(); + if (!tokenObject.getString("result").equals("success")) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取token失败"); + } + Map push = new HashMap<>(); + push.put("token", "data"); + push.put("couTypeCode", coupon.getCouponKey()); + push.put("distCouCount", highChildOrder.getSaleCount()); + push.put("userPhone", highUser.getPhone()); + push.put("thirdUserId", highUser.getUnionId()); + + // 推送给高速 + JSONObject returnParam = HuiLianTongConfig.couJointDist(tokenObject.getString("data"), coupon.getCouponKey(), highChildOrder.getSaleCount(), highUser.getPhone(), highUser.getUnionId()); + + // 推送记录 + HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); + highGasOrderPush.setCreateTime(new Date()); + highGasOrderPush.setCode(returnParam.getString("result")); + highGasOrderPush.setRequestContent(JSONObject.toJSONString(push)); + highGasOrderPush.setReturnContent(returnParam.toJSONString()); + highGasOrderPushMapper.insert(highGasOrderPush); } else { - highUserCoupon.setUseEndTime(userEndTime.getTime()); + HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId()); + code.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用 99.预支付 + code.setReceiveTime(new Date()); + highCouponCodeService.updateCouponCode(code); + + // 卡卷关联用户 + HighUserCoupon highUserCoupon = new HighUserCoupon(); + highUserCoupon.setMerchantId(code.getMerchantId()); + highUserCoupon.setCouponId(code.getCouponId()); + highUserCoupon.setUserId(highOrder.getMemId()); + highUserCoupon.setCouponCodeId(code.getId()); + highUserCoupon.setCreateTime(new Date()); + highUserCoupon.setQrCodeImg(code.getExt1()); + + // 计算使用有效期 + Calendar userEndTime = Calendar.getInstance(); + userEndTime.setTime(new Date()); + userEndTime.set(Calendar.HOUR_OF_DAY, 23); + userEndTime.set(Calendar.MINUTE, 59); + userEndTime.set(Calendar.SECOND, 59); + userEndTime.add(Calendar.DATE, coupon.getRecycleDay()); + + if (userEndTime.getTime().compareTo(code.getUseEndTime()) == 1) { + highUserCoupon.setUseEndTime(code.getUseEndTime()); + } else { + highUserCoupon.setUseEndTime(userEndTime.getTime()); + } + highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用 + highUserCouponMapper.insert(highUserCoupon); } - highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用 - highUserCouponMapper.insert(highUserCoupon); } } diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java index def5fdc7..b59f0059 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java @@ -8,6 +8,7 @@ import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.WxUtils; import com.hai.config.CommonSysConst; +import com.hai.config.HuiLianTongConfig; import com.hai.config.TuanYouConfig; import com.hai.dao.HighGasOrderPushMapper; import com.hai.dao.HighUserCouponMapper; @@ -85,6 +86,10 @@ public class GoodsOrderServiceImpl implements PayService { if (order == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_ORDER, ""); } + + // 查询用户 + HighUser highUser = highUserService.findByUserId(order.getMemId()); + if (order.getOrderStatus() == 1) { order.setPaySerialNo(map.get("transaction_id")); // 支付流水号 order.setPayRealPrice(new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100"))); // 实付金额 @@ -103,30 +108,58 @@ public class GoodsOrderServiceImpl implements PayService { highCouponCodeService.updateCouponCode(code); HighCoupon coupon = highCouponService.getCouponById(highChildOrder.getGoodsId()); + // 贵州中石化 + if (coupon.getCouponSource() != 4) { + // 获取token + JSONObject tokenObject = HuiLianTongConfig.getToken(); + if (!tokenObject.getString("result").equals("success")) { + log.error("HighCouponController -> insertCoupon() error!","获取token失败"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取token失败"); + } + + Map push = new HashMap<>(); + push.put("token", "data"); + push.put("couTypeCode", coupon.getCouponKey()); + push.put("distCouCount", highChildOrder.getSaleCount()); + push.put("userPhone", highUser.getPhone()); + push.put("thirdUserId", highUser.getUnionId()); + + // 推送给高速 + JSONObject returnParam = HuiLianTongConfig.couJointDist(tokenObject.getString("data"), coupon.getCouponKey(), highChildOrder.getSaleCount(), highUser.getPhone(), highUser.getUnionId()); + + // 推送记录 + HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); + highGasOrderPush.setCreateTime(new Date()); + highGasOrderPush.setCode(returnParam.getString("result")); + highGasOrderPush.setRequestContent(JSONObject.toJSONString(push)); + highGasOrderPush.setReturnContent(returnParam.toJSONString()); + highGasOrderPushMapper.insert(highGasOrderPush); - // 卡卷关联用户 - HighUserCoupon highUserCoupon = new HighUserCoupon(); - highUserCoupon.setMerchantId(code.getMerchantId()); - highUserCoupon.setCouponId(code.getCouponId()); - highUserCoupon.setUserId(order.getMemId()); - highUserCoupon.setCouponCodeId(code.getId()); - highUserCoupon.setCreateTime(new Date()); - highUserCoupon.setQrCodeImg(code.getExt1()); - - // 计算使用有效期 - Calendar userEndTime = Calendar.getInstance(); - userEndTime.setTime(new Date()); - userEndTime.set(Calendar.HOUR_OF_DAY, 23); - userEndTime.set(Calendar.MINUTE, 59); - userEndTime.set(Calendar.SECOND, 59); - userEndTime.add(Calendar.DATE, coupon.getRecycleDay()); - if (userEndTime.getTime().compareTo(code.getUseEndTime()) == 1) { - highUserCoupon.setUseEndTime(code.getUseEndTime()); } else { - highUserCoupon.setUseEndTime(userEndTime.getTime()); + // 卡卷关联用户 + HighUserCoupon highUserCoupon = new HighUserCoupon(); + highUserCoupon.setMerchantId(code.getMerchantId()); + highUserCoupon.setCouponId(code.getCouponId()); + highUserCoupon.setUserId(order.getMemId()); + highUserCoupon.setCouponCodeId(code.getId()); + highUserCoupon.setCreateTime(new Date()); + highUserCoupon.setQrCodeImg(code.getExt1()); + + // 计算使用有效期 + Calendar userEndTime = Calendar.getInstance(); + userEndTime.setTime(new Date()); + userEndTime.set(Calendar.HOUR_OF_DAY, 23); + userEndTime.set(Calendar.MINUTE, 59); + userEndTime.set(Calendar.SECOND, 59); + userEndTime.add(Calendar.DATE, coupon.getRecycleDay()); + if (userEndTime.getTime().compareTo(code.getUseEndTime()) == 1) { + highUserCoupon.setUseEndTime(code.getUseEndTime()); + } else { + highUserCoupon.setUseEndTime(userEndTime.getTime()); + } + highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用 + highUserCouponMapper.insert(highUserCoupon); } - highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用 - highUserCouponMapper.insert(highUserCoupon); } if (highChildOrder.getGoodsType() == 2) { diff --git a/hai-service/src/main/resources/dev/commonConfig.properties b/hai-service/src/main/resources/dev/commonConfig.properties index 318112d2..66282e2f 100644 --- a/hai-service/src/main/resources/dev/commonConfig.properties +++ b/hai-service/src/main/resources/dev/commonConfig.properties @@ -10,6 +10,11 @@ qinzhuPlatformId=10376 qinzhuSecret=ktxb49sh2jfhgn8g qianzhuOrderNotify=https://hsg.dctpay.com/crest/qianzhu/orderNotify +huiliantongUrl=https://gzapitest.deepermobile.com.cn:441 +huiliantongAppNo=guizhouhltcs +huiliantongAppkey=g%2BNnjR54YSUWM2iKg%2Fd82A9x9hg2kYV7 +huiliantongAppsecret=FA28E95ACABFA4B2B8E25857437B07F1 + wx_cert=/home/project/wx_cert/ TelApiKey=2d01f6b520254b1a80f6b167832cea18