|
@@ -169,9 +169,9 @@ public class WeChatServiceImpl implements WeChatService {
|
|
|
String eventType = requestMap.get("Event");// 事件类型
|
|
|
String eventKey = requestMap.get("EventKey");
|
|
|
|
|
|
- for(String s:requestMap.keySet()){
|
|
|
- logger.info("===事件推送:" + s +"="+ requestMap.get(s));
|
|
|
- }
|
|
|
+// for(String s:requestMap.keySet()){
|
|
|
+// logger.info("===事件推送:" + s +"="+ requestMap.get(s));
|
|
|
+// }
|
|
|
|
|
|
|
|
|
// 事件列表:CLICK(点击自定义菜单)/subscribe(关注)/unsubscribe(取消关注)/SCAN(扫描二维码)/LOCATION(上报地理位置)
|
|
@@ -346,18 +346,28 @@ public class WeChatServiceImpl implements WeChatService {
|
|
|
System.out.println("更改之后的值:"+senceid);
|
|
|
|
|
|
AttenStatistics attenStatistics = new AttenStatistics();
|
|
|
- attenStatistics.setChannelType(1);
|
|
|
- attenStatistics.setChannelId(Integer.valueOf(senceid));
|
|
|
attenStatistics.setAttenStatisticsOpenId(fromUserName);
|
|
|
- attenStatistics.setAttenStatisticsStatus(1);
|
|
|
- Integer flag = attenStatisticsService.save(attenStatistics);
|
|
|
- if(flag > 0){
|
|
|
- System.out.println("添加渠道"+ senceid +"统计成功,openid:"+ fromUserName);
|
|
|
- }else{
|
|
|
- System.out.println("添加渠道"+ senceid +"统计失败,openid:"+ fromUserName);
|
|
|
+ attenStatistics.setChannelId(Integer.valueOf(senceid));
|
|
|
+ attenStatistics.setChannelType(1);
|
|
|
+ List<AttenStatistics> attenStatisticsList = attenStatisticsService.getAttenStatisticsList(attenStatistics);
|
|
|
+ if(attenStatisticsList == null || attenStatisticsList.size() < 1){
|
|
|
+ String eventType = requestMap.get("Event");// 事件类型
|
|
|
+ if(eventType.equals("SCAN")){
|
|
|
+ attenStatistics.setAttenStatisticsStatus(1);
|
|
|
+ }else if(eventType.equals("subscribe")){ //扫码订阅
|
|
|
+ attenStatistics.setAttenStatisticsStatus(2);
|
|
|
+ }else{
|
|
|
+ attenStatistics.setAttenStatisticsStatus(3);
|
|
|
+ }
|
|
|
+ Integer flag = attenStatisticsService.save(attenStatistics);
|
|
|
+ if(flag > 0){
|
|
|
+ System.out.println("添加渠道"+ senceid +"统计数据成功,openid为:"+ fromUserName);
|
|
|
+ }else{
|
|
|
+ System.out.println("添加渠道"+ senceid +"统计数据失败,openid为:"+ fromUserName);
|
|
|
+ }
|
|
|
}
|
|
|
- status.setCountext("");
|
|
|
status.setFlag(false);
|
|
|
+ status.setCountext(ResultInfo.subDefaultResponseText);
|
|
|
return status;
|
|
|
}
|
|
|
|