|
@@ -8,12 +8,8 @@ import com.platform.yijia.utils.ResultData;
|
|
|
import com.platform.yijia.utils.redis.RedisCacheUtil;
|
|
|
import com.platform.yijia.utils.weixinapp.WeiXinUserUtil;
|
|
|
import com.platform.yijia.utils.weixinapp.WxPushUtil;
|
|
|
-import me.chanjar.weixin.common.error.WxErrorException;
|
|
|
-import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
|
|
|
-import me.chanjar.weixin.mp.api.WxMpService;
|
|
|
-import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
|
|
|
import me.chanjar.weixin.mp.bean.template.WxMpTemplateData;
|
|
|
-import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
|
|
|
+import net.sf.json.JSONObject;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -23,10 +19,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.math.BigInteger;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
/*
|
|
|
* <Title> IntegralShoppingMallController </Title>
|
|
@@ -141,10 +135,9 @@ public class IntegralShoppingMallController {
|
|
|
customerPointsService.updateCustomerPointsInfo(customerPoints);
|
|
|
}
|
|
|
|
|
|
- //油站名称
|
|
|
String gzhAppId ="";
|
|
|
String gzhAppSecret ="";
|
|
|
- String stationName = "";
|
|
|
+ String stationName = ""; //油站名称
|
|
|
Map<String, String> m = stationService.getStationAppIdAndAppSecret(request.getStationId());
|
|
|
if(m !=null && m.containsKey("stationName") && m.containsKey("gzhAppId") && m.containsKey("gzhAppSecret")){
|
|
|
stationName = m.get("stationName");
|
|
@@ -178,7 +171,7 @@ public class IntegralShoppingMallController {
|
|
|
wxMpTemplate.add(new WxMpTemplateData("keyword4", request.getWaresName()+" x "+ request.getExchangeNum()));
|
|
|
wxMpTemplate.add(new WxMpTemplateData("keyword5", orderSumIntegral));
|
|
|
wxMpTemplate.add(new WxMpTemplateData("remark",
|
|
|
- "截止至" + new SimpleDateFormat(" yyyy年MM月dd日HH时mm分").format(new Date())+",您在"+stationName+"的积分值还剩余 "+surplusPoints+" 分."));
|
|
|
+ "截止至" + new SimpleDateFormat(" yyyy年MM月dd日HH时mm分").format(new Date())+",您在"+stationName+"的积分值还剩余 "+surplusPoints+" 分"));
|
|
|
String templateId = "9EWrreI-P8r4xDgoOcczC4jHt1v0HEjKzkgVRDzoNXA"; //积分兑换成功通知模板
|
|
|
wxPushUtil.push(gzhAppId, gzhAppSecret, templateId, request.getOpenId(), wxMpTemplate);
|
|
|
resultData=ResultData.success(CodeMsg.SUCCESS);
|
|
@@ -188,22 +181,6 @@ public class IntegralShoppingMallController {
|
|
|
return gson.toJson(resultData);
|
|
|
}
|
|
|
|
|
|
- //测试redis缓存
|
|
|
- @RequestMapping(value = "/redisCacheUtil", method = RequestMethod.GET)
|
|
|
- @ResponseBody
|
|
|
- public String redisCacheUtil(@RequestParam String unionId){
|
|
|
- Gson gson =new Gson();
|
|
|
- //返回结果集
|
|
|
- ResultData resultData = null;
|
|
|
- if(unionId !=null){
|
|
|
- redisCacheUtil.setCacheObject("unionId", unionId);
|
|
|
- String cacheObject = redisCacheUtil.getCacheObject("unionId");
|
|
|
- resultData=ResultData.success(cacheObject);
|
|
|
- }else {
|
|
|
- resultData=ResultData.success(CodeMsg.REQUEST_FAIL);
|
|
|
- }
|
|
|
- return gson.toJson(resultData);
|
|
|
- }
|
|
|
|
|
|
//获取用户积分订单列表
|
|
|
@RequestMapping(value = "/getUserIntegralOrderList", method = RequestMethod.GET)
|