Authored by zhouxiang

Merge branch 'master' into dev-20170216

# Conflicts:
#	server/src/main/java/com/yoho/unions/server/service/impl/UnionServiceImpl.java
... ... @@ -40,7 +40,7 @@ public class UnionConstant {
//iSO系统
iOSServiceList.add("dDServiceImpl");
// iOSServiceList.add("dDServiceImpl");
//iOSServiceList.add("gdtServiceImpl");
}
}
... ...
... ... @@ -6,7 +6,6 @@
<groupId>com.yoho</groupId>
<artifactId>parent</artifactId>
<version>1.2.1-SNAPSHOT</version>
</parent>
<groupId>com.yoho.dsf</groupId>
<artifactId>yoho-unions</artifactId>
... ... @@ -46,7 +45,7 @@
</dependencyManagement>
<dependencies>
<!-- CORE核心代码�?-->
<!-- CORE核心代码-->
<dependency>
<groupId>com.yoho.core</groupId>
... ...
package com.yoho.activity.restapi;
import javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.yoho.activity.service.DrawService;
import com.yoho.error.exception.ServiceException;
import com.yoho.service.model.union.request.DrawRequestBO;
import com.yoho.service.model.union.response.DrawInfoResponseBO;
import com.yoho.service.model.user.other.response.DrawResponseBO;
import com.yoho.unions.common.ApiResponse;
@Controller
@RequestMapping("/ActivityRest")
public class ActivityRest {
static Logger log = LoggerFactory.getLogger(ActivityRest.class);
@Resource
DrawService drawService;
/**
* 元宵节抽签活动
* @param req
* @return
* @throws ServiceException
*/
@RequestMapping("/draw")
@ResponseBody public ApiResponse draw(@RequestBody DrawRequestBO req) throws ServiceException {
log.info("enter draw with param is {}", req);
DrawResponseBO resp = drawService.draw(req);
log.info("draw with param is {}. and response is {}", req, resp);
return new ApiResponse.ApiResponseBuilder().data(resp).build();
}
/**
* 根据uid,获取用户抽签情况
* @param req
* @return
* @throws ServiceException
*/
@RequestMapping("/getDrawInfo")
@ResponseBody public ApiResponse getDrawInfo(@RequestBody DrawRequestBO req) throws ServiceException {
log.info("enter getDrawInfo with param is {}", req);
DrawInfoResponseBO resp = drawService.getDrawInfo(req.getUid());
log.info("getDrawInfo with param is {}. and response is {}", req, resp);
return new ApiResponse.ApiResponseBuilder().data(resp).build();
}
}
//package com.yoho.activity.restapi;
//
//import javax.annotation.Resource;
//
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//import com.yoho.activity.service.DrawService;
//import com.yoho.error.exception.ServiceException;
//import com.yoho.service.model.union.request.DrawRequestBO;
//import com.yoho.service.model.union.response.DrawInfoResponseBO;
//import com.yoho.service.model.user.other.response.DrawResponseBO;
//import com.yoho.unions.common.ApiResponse;
//
//@Controller
//@RequestMapping("/ActivityRest")
//public class ActivityRest {
//
// static Logger log = LoggerFactory.getLogger(ActivityRest.class);
//
// @Resource
// DrawService drawService;
//
//
//
// /**
// * 元宵节抽签活动
// * @param req
// * @return
// * @throws ServiceException
// */
// @RequestMapping("/draw")
// @ResponseBody public ApiResponse draw(@RequestBody DrawRequestBO req) throws ServiceException {
// log.info("enter draw with param is {}", req);
// DrawResponseBO resp = drawService.draw(req);
// log.info("draw with param is {}. and response is {}", req, resp);
// return new ApiResponse.ApiResponseBuilder().data(resp).build();
// }
//
// /**
// * 根据uid,获取用户抽签情况
// * @param req
// * @return
// * @throws ServiceException
// */
// @RequestMapping("/getDrawInfo")
// @ResponseBody public ApiResponse getDrawInfo(@RequestBody DrawRequestBO req) throws ServiceException {
// log.info("enter getDrawInfo with param is {}", req);
// DrawInfoResponseBO resp = drawService.getDrawInfo(req.getUid());
// log.info("getDrawInfo with param is {}. and response is {}", req, resp);
// return new ApiResponse.ApiResponseBuilder().data(resp).build();
// }
//}
... ...
... ... @@ -143,13 +143,7 @@ public class ActivateUnionRest {
activeUnion.info("activeUnion request is {}",bo);
return unionService.activateUnion(bo);
}
@RequestMapping("/test")
@ResponseBody
public UnionResponse test() {
return new UnionResponse();
}
public static class RunActivate implements Runnable {
public RunActivate(ActivateUnionRequestBO bo) {
... ...
... ... @@ -340,119 +340,6 @@ public class ClickUnionRest {
if (agent.indexOf("mac os x") >= 0 || agent.indexOf("iphone") >= 0 ||agent.indexOf("ipad")>0) {
setClickUnionRequestBO(agent,bo,url);
// if(agent.contains("os")&&agent.contains("like")){
// String version = agent.substring(agent.indexOf(" os ") + 4, agent.indexOf(" like"));
// bo.setTd("ios_" + version.replaceAll("_", "."));
// bo.setClient_type("ios");
// bo.setAppid("490655927");
// url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
// }
// //youku;5.4;ios;10.2;iphone6,1 ---这种情况比较多
// else if(agent.contains("youku")){
// String version = "";
// if(agent.contains("ios")){
// int first = agent.indexOf("ios;")+4;
// String version1 = agent.substring(first);
// version = version1.substring(version1.indexOf(" ")+1, version1.indexOf(";"));
// bo.setTd("ios_" + version.replaceAll("_", "."));
// bo.setClient_type("ios");
// bo.setAppid("490655927");
// url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
// } //youku;5.4.1;iphone os;8.4.1;iphone6,2
// else if(agent.contains("os")){
// int first = agent.indexOf("os;") + 3;
// String version1 = agent.substring(first);
// version = version1.substring(version1.indexOf(" ") + 1, version1.indexOf(";"));
// bo.setTd("ios_" + version.replaceAll("_", "."));
// bo.setClient_type("ios");
// bo.setAppid("490655927");
// url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
// }
// }
// //momochat/7.5.6 ios/664 (iphone 6; ios 10.2; zh_cn; iphone7,2; s1)
// else if(agent.contains("momochat")){
// String version = "";
// if(agent.contains("ios")){
// int first = agent.indexOf(" ios ")+4;
// String version1 = agent.substring(first);
// version = version1.substring(version1.indexOf(" ")+1, version1.indexOf(";"));
// bo.setTd("ios_" + version.replaceAll("_", "."));
// bo.setClient_type("ios");
// bo.setAppid("490655927");
// url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
// } //momochat/7.5.6 ios/664 (iphone 6s; iphone os 9.2; zh_cn; iphone8,1; s1)
// else if(agent.contains("os")){
// int first = agent.indexOf(" os ")+3;
// String version1 = agent.substring(first);
// version = version1.substring(version1.indexOf(" ")+1, version1.indexOf(";"));
// bo.setTd("ios_" + version.replaceAll("_", "."));
// bo.setClient_type("ios");
// bo.setAppid("490655927");
// url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
// }
// }
// else if(agent.contains("ios/")){
// String version= "";
// if(agent.contains("mozilla")){ // mozilla/5.0,ios/10.0.2,client/5.8.1,device/iphone6.2,theme/red
// version = agent.substring(agent.indexOf("ios/")+4,agent.indexOf("client")-1);
// }else if (agent.contains("iphone")) { //huazhu/ios/iphone9,2/10.2.1/6.5.3
// int last = agent.lastIndexOf("/");
// String version1 = agent.substring(0,last);
// version = version1.substring(version1.lastIndexOf("/") + 1, version1.length());
// bo.setTd("ios_" + version.replaceAll("_", "."));
// bo.setClient_type("ios");
// bo.setAppid("490655927");
// url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
// }else{ //ios/6.6 com.jugg.doctor ipad5,3/8.3/768x1024/2.0 /1---这个应该就是ios_6.6
// version = agent.substring(agent.indexOf("ios/")+4,agent.indexOf(" "));
// bo.setTd("ios_" + version.replaceAll("_", "."));
// bo.setClient_type("ios");
// bo.setAppid("490655927");
// url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
// }
// }
// //365jia news client/cn.ahurls.news/3.5.0_300500.209/ios(7.1|0|iphone)/59c2ed8b88175124c539e0c7a96a18d4eedb3d6c(none|none)/640x1136@2
// else if(agent.contains("/ios")){
// int first = agent.indexOf("/ios(") + 5;
// String version1 = agent.substring(first);
// String version = version1.substring(0,version1.indexOf("|"));
// bo.setTd("ios_" + version.replaceAll("_", "."));
// bo.setClient_type("ios");
// bo.setAppid("490655927");
// url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
// }
// else if (agent.contains("ios")){
// String version = "";
// if(agent.contains("letvshop")){
// //letvshop;1.6.6;iphone 6plus;ios-iphone;9.2;zh_cn
// int lastIndex = agent.lastIndexOf(";");
// String version1 = agent.substring(0,lastIndex);
// version = agent.substring(version1.lastIndexOf(";")+1,lastIndex);
// bo.setTd("ios_" + version.replaceAll("_", "."));
// bo.setClient_type("ios");
// bo.setAppid("490655927");
// url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
// }else if(agent.contains("jxsg")) { //jxsg_ios-1.2.5/0.0.2 (iphone7,2; ios 10.2.1)
// int first = agent.lastIndexOf("ios ") + 4;
// String version1 = agent.substring(first);
// int lastIndex = version1.indexOf(")");
// version = version1.substring(version1.indexOf(" ") + 1, lastIndex);
// bo.setTd("ios_" + version.replaceAll("_", "."));
// bo.setClient_type("ios");
// bo.setAppid("490655927");
// url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
// }else{
// int first = agent.lastIndexOf("ios ") + 4;
// String version1 = agent.substring(first);
// int lastIndex = version1.indexOf(";");
// version = version1.substring(0, lastIndex);
// bo.setTd("ios_" + version.replaceAll("_", "."));
// bo.setClient_type("ios");
// bo.setAppid("490655927");
// url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
// }
// }
} else {
int index = agent.lastIndexOf("android");
if (index > 0) {
... ...
... ... @@ -74,22 +74,6 @@ public class UnionRest {
return response;
}
@RequestMapping(value = "/test")
@ResponseBody public UnionResponseBO test() {
log.info("enter unionsRest.test");
UnionResponseBO response = new UnionResponseBO();
response.setMsg("success");
response.setIsSuccess(true);
return response;
}
@RequestMapping(value ="/addBigData")
@ResponseBody
public UnionResponseBO addBigData(int beginTime,int endTime) {
log.info("enter addBigData,beginTimeis {},endTime is {}",beginTime,endTime);
UnionResponseBO response = dingdangService.addBigData(beginTime,endTime);
return response;
}
public static void main(String[] args) {
String clientId = "80003419";
... ...
//package com.yoho.unions.server.service.impl;
//
//import com.alibaba.fastjson.JSONObject;
//import com.yoho.unions.common.utils.HttpUtils;
//import com.yoho.unions.common.utils.MathUtils;
//import com.yoho.unions.dal.IUserOrdersDAO;
//import com.yoho.unions.server.service.IOrderPushService;
//import com.yoho.unions.vo.OrderInfo;
//import com.yoho.unions.vo.OrdersGood;
//import net.spy.memcached.compat.log.Logger;
//import net.spy.memcached.compat.log.LoggerFactory;
//import org.apache.commons.collections.CollectionUtils;
//import org.apache.commons.lang3.tuple.Pair;
//import org.springframework.beans.factory.annotation.Autowired;
//
//import java.math.BigDecimal;
//import java.net.URLEncoder;
//import java.util.*;
//
///**
// * 多麦走通用的,不单独走定制的
// * 多麦推送订单数据
// * Created by yoho on 2016/12/15.
// */
//public class DuomaiServiceImpl implements IOrderPushService {
//
// @Autowired
// private IUserOrdersDAO userOrdersDAO;
//
// static Logger logger = LoggerFactory.getLogger(DuomaiServiceImpl.class);
//
// @Override
// public void pushOrder(List<OrderInfo> orderInfoList) {
// List<String> successCodes = new ArrayList<>();
// String duomaiContext = getDuomaiContext(orderInfoList);
// OrderInfo orderInfo = orderInfoList.get(0);
// int clientId = orderInfo.getClientId();
// String duomaiPushUrl = null;
// if (clientId == 3017) {
// duomaiPushUrl = "http://www.duomai.com/api/push/yohobuy.php";
// } else if (clientId == 3019) {
// duomaiPushUrl = "http://www.duomai.com/api/push/myohobuy.php";
// } else {
// duomaiPushUrl = "http://www.duomai.com/api/push/yohobuyroi.php";
// }
// Pair<Integer, String> pair = null;
// Map param = new HashMap<>();
// param.put("content", duomaiContext);
// try {
// logger.info("pushOrder: url is {}, param is {}", duomaiPushUrl, param);
// pair = HttpUtils.httpPost(duomaiPushUrl, param);
// } catch (Exception e) {
// logger.error("duomai order post fail,orderCode is {}", orderInfo.getParentOrderCode());
// }
// JSONObject json = JSONObject.parseObject(pair.getRight());
// if (((String) json.get("code")).equals("200")) {
// logger.info("duomai pushOrder success,orderCode is {}", orderInfo.getParentOrderCode());
// successCodes.add(orderInfo.getParentOrderCode());
// } else {
// logger.warn("duomai pushOrder fail,orderCode is {},message is {}", orderInfo.getParentOrderCode(), (String) json.get("msg"));
// }
// //批量更新推送成功的订单状态为1
// userOrdersDAO.batchUpdatePush(successCodes);
// }
//
// private String getDuomaiContext(List<OrderInfo> orderInfoList) {
// String urlContext = null;
// for (OrderInfo orderInfo : orderInfoList) {
// //联盟id
// int client_id = orderInfo.getClientId();
// String hash = "";
// int channel = 0;
// if (client_id == 3017) {
// hash = "96613bf38393aa3d16451218f22344a8";
// channel = 0;
// } else if (client_id == 3019) {
// hash = "d54be2dbc75753eb863ba6139950656b";
// channel = 1;
// } else if (client_id == 3057) {
// hash = "bbf70bcaf5c52947ad26853f7cc1176d";
// channel = 0;
// }
// //多麦在YOHO上的网站主标识
// String euid = orderInfo.getMbrName();
// String orderCode = orderInfo.getOrderCode();
// int orderTime = orderInfo.getOrderTime();
// BigDecimal orderAmount = orderInfo.getOrderAmount();
// String orderStatus = orderInfo.getOrderStatus();
// List<OrdersGood> goods = orderInfo.getOrdersGoods();
// List<String> goodsIdList = new ArrayList<>();
// List<String> goodsNameList = new ArrayList<>();
// List<BigDecimal> goodsPriceList = new ArrayList<>();
// //商品结算金额 price*num-优惠&折扣
// List<BigDecimal> goodsTotalPriceList = new ArrayList<>();
// // 商品分类编号
// List<Integer> small_sort_idList = new ArrayList<>();
// List<Integer> goodsNumList = new ArrayList<>();
//
// for(OrdersGood ordersGood:goods){
// goodsIdList.add(ordersGood.getProductSkn());
// goodsNameList.add(ordersGood.getProductName());
// goodsPriceList.add(ordersGood.getLastPrice());
// goodsNumList.add(ordersGood.getBuyNumber());
// small_sort_idList.add(ordersGood.getSortId());
// goodsTotalPriceList.add(ordersGood.getLastPrice());
// }
//
// LinkedHashMap<String, Object> linkedHashMap = new LinkedHashMap<>();
// linkedHashMap.put("hash", hash);
// linkedHashMap.put("euid", euid);
// linkedHashMap.put("order_sn", orderCode);
// linkedHashMap.put("order_time", orderTime);
// linkedHashMap.put("orders_price", orderAmount);
// linkedHashMap.put("promotion_code", 0);
// //@TODO需要订单传过来,是否新用户
// linkedHashMap.put("is_new_custom", 0);
// linkedHashMap.put("channel", channel);
// linkedHashMap.put("status", orderStatus);
// linkedHashMap.put("goods_id", CollectionUtils.isEmpty(goodsIdList) ? "" : org.apache.commons.lang.StringUtils.join(goodsIdList, "|"));
// linkedHashMap.put("goods_name", CollectionUtils.isEmpty(goodsNameList) ? "" : org.apache.commons.lang.StringUtils.join(goodsNameList, "|"));
// linkedHashMap.put("goods_price", CollectionUtils.isEmpty(goodsPriceList) ? "" : org.apache.commons.lang.StringUtils.join(goodsPriceList, "|"));
// linkedHashMap.put("goods_ta", CollectionUtils.isEmpty(goodsNumList) ? "" : org.apache.commons.lang.StringUtils.join(goodsNumList, "|"));
// linkedHashMap.put("goods_cate", CollectionUtils.isEmpty(small_sort_idList) ? "" : org.apache.commons.lang.StringUtils.join(small_sort_idList, "|"));
// linkedHashMap.put("goods_cate_name", 0);
// linkedHashMap.put("totalPrice", CollectionUtils.isEmpty(goodsTotalPriceList) ? "" : org.apache.commons.lang.StringUtils.join(goodsTotalPriceList, "|"));
// //佣金计算,月底计算一次,7%计算,数据库比例已经老的
// linkedHashMap.put("rate", 0);
// linkedHashMap.put("commission", "");
// linkedHashMap.put("commission_type", 0);
// double coupon = 12d;
// linkedHashMap.put("coupon", MathUtils.roundPrice(coupon));
// Set<String> keys = linkedHashMap.keySet();
// StringBuilder builder = new StringBuilder();
// for (String key : keys) {
// builder.append(key).append("=").append(linkedHashMap.get(key)).append("&");
// }
// try {
// urlContext = URLEncoder.encode(builder.substring(0, builder.length() - 1), "UTF-8");
// } catch (Exception e) {
// logger.warn("send duomai error", e.getMessage());
// }
// }
// return urlContext;
// }
//
//}
... ... @@ -79,18 +79,37 @@ public class GDT2ServiceImpl extends UnionServiceImpl implements IUnionService {
String encryptKey = null;
String signKey = null;
String muid4MD5 = "";
//有货在广点通的账号id
String uid = requestBO.getCommonUse();
if (ClientTypeEnum.IOS.getName().equalsIgnoreCase(requestBO.getClient_type())) {
DynamicStringProperty ios_encrypt_key = DynamicPropertyFactory.getInstance().getStringProperty("ios1_encrypt_key", "");
encryptKey = ios_encrypt_key.get();
DynamicStringProperty ios_sign_key = DynamicPropertyFactory.getInstance().getStringProperty("ios1_sign_key", "");
signKey = ios_sign_key.get();
//由于有两个广点通账号,根据不同的账号取不同的加密密钥和签名密钥
if(StringUtils.isNotEmpty(uid)&&uid.equals("365136")){
DynamicStringProperty ios_encrypt_key = DynamicPropertyFactory.getInstance().getStringProperty("ios1_encrypt_key", "");
encryptKey = ios_encrypt_key.get();
DynamicStringProperty ios_sign_key = DynamicPropertyFactory.getInstance().getStringProperty("ios1_sign_key", "");
signKey = ios_sign_key.get();
}else{
DynamicStringProperty ios2_encrypt_key = DynamicPropertyFactory.getInstance().getStringProperty("ios2_encrypt_key", "");
encryptKey = ios2_encrypt_key.get();
DynamicStringProperty ios2_sign_key = DynamicPropertyFactory.getInstance().getStringProperty("ios2_sign_key", "");
signKey = ios2_sign_key.get();
}
//IDFA 码(需转大写),进行 md5 以后得到的 32位全小写 md5 表现字符串。
muid4MD5 = requestBO.getIdfa().toUpperCase();
} else {
DynamicStringProperty android_encrypt_key = DynamicPropertyFactory.getInstance().getStringProperty("android1_encrypt_key", "");
encryptKey = android_encrypt_key.get();
DynamicStringProperty android_sign_key = DynamicPropertyFactory.getInstance().getStringProperty("android1_sign_key", "");
signKey = android_sign_key.get();
if(StringUtils.isNotEmpty(uid)&&uid.equals("365136")){
DynamicStringProperty android_encrypt_key = DynamicPropertyFactory.getInstance().getStringProperty("android1_encrypt_key", "");
encryptKey = android_encrypt_key.get();
DynamicStringProperty android_sign_key = DynamicPropertyFactory.getInstance().getStringProperty("android1_sign_key", "");
signKey = android_sign_key.get();
}else{
DynamicStringProperty android2_encrypt_key = DynamicPropertyFactory.getInstance().getStringProperty("android2_encrypt_key", "");
encryptKey = android2_encrypt_key.get();
DynamicStringProperty android2_sign_key = DynamicPropertyFactory.getInstance().getStringProperty("android2_sign_key", "");
signKey = android2_sign_key.get();
}
//IMEI 号(需转小写),进行 md5 以后得到的 32位全小写 md5 表现字符串。
muid4MD5 = requestBO.getImei().toLowerCase();
}
... ... @@ -165,8 +184,7 @@ public class GDT2ServiceImpl extends UnionServiceImpl implements IUnionService {
}
// conv_type,,现在只有移动应用激活类型(MOBILEAPP_ACTIVITE);
String convType = "MOBILEAPP_ACTIVITE";
//有货在广点通的账号id
String uid = requestBO.getCommonUse();
url = sb.append(DynamicPropertyFactory.getInstance().getStringProperty("guangdiantong.url", "").get()).append(requestBO.getAppid()).append("/conv?v=").append(retRep).append("&conv_type=").append(convType).append("&app_type=").append(clientTypeConver(requestBO.getClient_type())).append("&advertiser_id=").append(uid).toString();
log.info("guangdiantong url is {}", url);
return url;
... ...
... ... @@ -92,6 +92,9 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
@Resource
IUnionActivityLogsDAO unionActivityLogsDAO;
@Resource
IUnionTypeMatchDAO unionTypeMatchDAO;
@Resource(name="unionServiceImpl")
IUnionService unionService;
... ... @@ -288,14 +291,12 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
}
}
// log.info("activateUnion with get redis first with key={}, value={}", key, value);
activeUnion.info("activateUnion with get redis first with key={}, value={}", key, value);
String td = request.getTd();
if (StringUtils.isNotEmpty(td)) {
if (StringUtils.isEmpty(value)) {
key = UNION_KEY + "_" + request.getClientIp() + "_" + td + "_" + request.getAppkey();
value = yhValueOperations.get(key);
// log.info("activateUnion with get redis first with key={}, value={}", key, value);
activeUnion.info("activateUnion with get redis first with key={}, value={}",key, value);
}
if (StringUtils.isEmpty(value)) {
... ... @@ -304,14 +305,12 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
td=(arr[2] + "_" + arr[3]);
key = UNION_KEY + "_" + request.getClientIp() + "_" + td + "_" + request.getAppkey();
value = yhValueOperations.get(key);
// log.info("activateUnion with get redis second with key={}, value={}", key, value);
activeUnion.info("activateUnion with get redis second with key={}, value={}", key, value);
}
if(arr.length==3){
td = (arr[1]+"_"+arr[2]);
key = UNION_KEY + "_" + request.getClientIp() + "_" + td + "_" + request.getAppkey();
value = yhValueOperations.get(key);
// log.info("activateUnion with get redis third with key={}, value={}", key, value);
activeUnion.info("activateUnion with get redis third with key={}, value={}", key, value);
}
}
... ... @@ -330,7 +329,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
}
// log.info("activateUnion with get redis forth with key={}, value={}", key, value);
activeUnion.info("activateUnion with get redis forth with key={}, value={}", key, value);
}
... ... @@ -426,8 +424,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
return new UnionResponse(203, "have activite in 90 days",result);
}
}
// 调用成功,更新数据库
UnionLogs logs = new UnionLogs();
... ... @@ -447,8 +443,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
unionLogsDAO.insert(logs);
log.info("activateUnion add db success with request is {}, and dbData={}", request, logs);
// 记录日志
JSONObject j = new JSONObject();
j.put("apptype", request.getClient_type());
... ... @@ -497,6 +491,10 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
try {
String union_type = click.getUnion_type();
StringBuffer buffer = new StringBuffer();
UnionTypeMatch unionTypeMatch = unionTypeMatchDAO.selectByPrimaryKey(Long.valueOf(union_type));
if(unionTypeMatch!=null && org.apache.commons.lang.StringUtils.isNotEmpty(String.valueOf(unionTypeMatch.getUnionTypeMatch()))){
union_type = String.valueOf(unionTypeMatch.getUnionTypeMatch());
}
String bean =buffer.append("UnionServiceImpl").append("_").append(union_type).toString();
if(SpringContextUtil.containsBean(bean)){
IUnionService uniteService = SpringContextUtil.getBean(bean, IUnionService.class);
... ... @@ -524,13 +522,7 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
// url += "&imei=" + click.getImei();
// }
activeUnion.info("activateUnion in call url={}", url);
// 调用接口发送短信请求
// AsyncFuture<String> response = service.get("union.activate", url, null, String.class, null);
// String result = response.get();
//改成httpclient方式调用
Pair<Integer, String> pair = HttpUtils.httpGet(url);
activeUnion.info("activateUnion call union success url={}, and result={}", url, pair);
if (pair.getLeft() != 200) {
... ...
... ... @@ -3,13 +3,13 @@ cache.servers.memcached.address=192.168.102.211:11211
####暂时不使用,待到订单上线的时候恢复使用#########
#MQ
rabbit.mq.host=192.168.102.217
rabbit.mq.host=192.168.102.211
rabbit.mq.port=5672
rabbit.mq.username=yoho
rabbit.mq.password=yoho
#rabbit.mq.virtualHost=/yoho
rabbit_host=192.168.102.217:5672
rabbit_host=192.168.102.211:5672
rabbit_user=yoho
rabbit_password =yoho
... ... @@ -56,18 +56,27 @@ draw.writeFile.delay=1
ios_encrypt_key=a9dc833b8a75c21f
#广点通 对接方案1ios加密密钥
ios1_encrypt_key=BAAAAAAAAAAABZJQ
#广点通 对接方案1 账号为1125695加密密钥
ios2_encrypt_key=BAAAAAAAAAAAES0b
#广点通 ios签名密钥
ios_sign_key=bd80e4c0ecd5a150
#广点通对接方案1 iosios签名密钥
ios1_sign_key=1461f1237d22dfc7
#广点通对接方案1 账号为1125695签名密钥
ios2_sign_key=3bf06c662eb092ec
#广点通 android加密密钥
android_encrypt_key=BAAAAAAAAAAAE0FR
#广点通对接方案1 android加密密钥
#广点通对接方案1 android加密密钥,账号是365136
android1_encrypt_key=BAAAAAAAAAAABZJQ
#广点通对接方案1 android加密密钥,账号是1125695
android2_encrypt_key=BAAAAAAAAAAAES0b
#广点通 android签名密钥
android_sign_key=d43ef6ef894e3c56
#广点通 android签名密钥
#广点通 android签名密钥账号是365136
android1_sign_key=1461f1237d22dfc7
#广点通 android签名密钥账号是1125695
android2_sign_key=3bf06c662eb092ec
#广点通 url
guangdiantong.url=http://t.gdt.qq.com/conv/app/
... ...
... ... @@ -19,8 +19,8 @@ datasources:
app:
servers:
- 10.67.2.46:3307
- 10.67.2.46:3306
- 192.168.102.219:3306
- 192.168.102.219:3306
username: yh_test
password: 9nm0icOwt6bMHjMusIfMLw==
daos:
... ...
... ... @@ -55,18 +55,26 @@ activeTime_4=24
ios_encrypt_key=a9dc833b8a75c21f
#广点通对接方案1 ios加密密钥
ios1_encrypt_key=BAAAAAAAAAAABZJQ
#广点通 对接方案1 账号为1125695加密密钥
ios2_encrypt_key=BAAAAAAAAAAAES0b
#广点通 ios签名密钥
ios_sign_key=bd80e4c0ecd5a150
#广点通对接方案1 iosios签名密钥
ios1_sign_key=1461f1237d22dfc7
#广点通对接方案1 账号为1125695签名密钥
ios2_sign_key=3bf06c662eb092ec
#广点通 android加密密钥
android_encrypt_key=BAAAAAAAAAAAE0FR
#广点通对接方案1 android加密密钥
android1_encrypt_key=BAAAAAAAAAAABZJQ
#广点通对接方案1 android加密密钥,账号是1125695
android2_encrypt_key=BAAAAAAAAAAAES0b
#广点通 android签名密钥
android_sign_key=d43ef6ef894e3c56
#广点通 android签名密钥
android1_sign_key=1461f1237d22dfc7
#广点通 android签名密钥账号是1125695
android2_sign_key=3bf06c662eb092ec
#广点通 url
guangdiantong.url=http://t.gdt.qq.com/conv/app/
... ...
... ... @@ -23,6 +23,8 @@
<link rel="dns-prefetch" href="//list.m.yohobuy.com">
<link rel="dns-prefetch" href="//guang.m.yohobuy.com">
<script type="text/javascript">
(function (d, c) {
var e = d.documentElement, a = "orientationchange" in window ? "orientationchange" : "resize", b = function () {
... ... @@ -141,10 +143,16 @@
window.cookie = cookie;
var url = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"gender":"1","channel":"2"}}';
var isWechat = /micromessenger/i.test(navigator.userAgent || '');
if(isWechat){
url = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445';
location.href = url;
}
var u = navigator.userAgent.toLowerCase();
var isiOS = u.indexOf('os') > -1 || u.indexOf('iphone') > -1 || u.indexOf('mac') > -1 || u.indexOf('ipad') > -1;
var isWechat = /micromessenger/i.test(navigator.userAgent || '');
var androidExp = new RegExp('MQQBrowser');//安卓QQ内置浏览器正则
var isAndroidQQ = androidExp.test(navigator.userAgent); //判断是不是QQ内置浏览器
... ...