diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java index 092d5d5e..d463e784 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java @@ -1 +1 @@ -package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; 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.utils.ResponseMsgUtil; import com.hai.common.utils.WxUtils; import com.hai.config.*; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantStoreModel; import com.hai.model.ResponseData; import com.hai.model.ResultProfitSharing; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; 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.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import javax.net.ssl.SSLContext; import java.io.FileInputStream; import java.math.BigDecimal; 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 HltUnionCardVipService hltUnionCardVipService; @Resource private HighTestService highTestService; @RequestMapping(value = "/getBackendToken", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取访问令牌backendToken") public ResponseData getBackendToken() { try { return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/GetMembershipLevel", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "请求会员体系") public ResponseData GetMembershipLevel(@RequestParam(name = "phone", required = true) String phone , @RequestParam(name = "regionId", required = true) String regionId ) { try { return ResponseMsgUtil.success(hltUnionCardVipService.GetMembershipLevel(phone , regionId)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/submitSms", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "请求短信") public ResponseData submitSms(@RequestParam(name = "phone", required = true) String phone , @RequestParam(name = "sms", required = true) String sms ) { try { return ResponseMsgUtil.success(HuiLianTongUnionCardConfig.submitSms(phone , sms)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/getReadFile",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "存入用户信息") public ResponseData getReadFile() { try { highTestService.getReadFile(); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/getUserDiscount",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "赠送优惠券") public ResponseData getUserDiscount(@RequestParam(name = "id", required = true) Long id) { try { highTestService.getUserDiscount(id); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file +package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; 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.utils.ResponseMsgUtil; import com.hai.common.utils.WxUtils; import com.hai.config.*; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantStoreModel; import com.hai.model.ResponseData; import com.hai.model.ResultProfitSharing; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; 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.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import javax.net.ssl.SSLContext; import java.io.FileInputStream; import java.math.BigDecimal; 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 HltUnionCardVipService hltUnionCardVipService; @Resource private HighTestService highTestService; @RequestMapping(value = "/getBackendToken", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取访问令牌backendToken") public ResponseData getBackendToken() { try { return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/GetMembershipLevel", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "请求会员体系") public ResponseData GetMembershipLevel(@RequestParam(name = "phone", required = true) String phone , @RequestParam(name = "regionId", required = true) String regionId ) { try { return ResponseMsgUtil.success(hltUnionCardVipService.GetMembershipLevel(phone , regionId)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/submitSms", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "请求短信") public ResponseData submitSms(@RequestParam(name = "phone", required = true) String phone , @RequestParam(name = "sms", required = true) String sms ) { try { return ResponseMsgUtil.success(HuiLianTongUnionCardConfig.submitSms(phone , sms)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/getReadFile",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "存入用户信息") public ResponseData getReadFile() { try { highTestService.getReadFile(); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/getUserDiscount",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "赠送优惠券") public ResponseData getUserDiscount(@RequestParam(name = "id", required = true) Long id) { try { highTestService.getUserDiscount(id); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java index d1668bdf..6758bcf4 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java @@ -193,6 +193,15 @@ public class HltUnionCardVipServiceImpl implements HltUnionCardVipService { } + if (isFree) { + HuiLianTongUnionCardConfig.submitSms(phone , "“E信通春节关怀”3张4元话费券、99折加油券已到账,打开“嗨森逛”微信小程序>我的>我的优惠券即可直接使用,到账之日起1月内(30天)有效。"); + } else { + if (equityLevel == 1) { + HuiLianTongUnionCardConfig.submitSms(phone , "“E信通会员专属”3张4元话费券、2张99折加油券已到账,打开“嗨森逛”微信小程序>我的>我的优惠券即可直接使用,到账之日起1月内(30天)有效。"); + } else { + HuiLianTongUnionCardConfig.submitSms(phone , "“工会卡用户专属”2元话费券、2张99折加油券已到账,打开“嗨森逛”微信小程序>我的>我的优惠券即可直接使用,到账之日起1月内(30天)有效。"); + } + } return null; }