|
@@ -163,7 +163,7 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
}
|
|
|
}
|
|
|
// 访问页面类型为供应商主页 且供应商 id 不为空的时候 将页面 pageLabel 改为供应商名称
|
|
|
- if ( null != cmBehaviorRecordPo.getShopId() && 14 == cmBehaviorRecordPo.getPageType()) {
|
|
|
+ if (null != cmBehaviorRecordPo.getShopId() && 14 == cmBehaviorRecordPo.getPageType()) {
|
|
|
// 获取供应商名称
|
|
|
String shopName = recordMapper.getShopName(cmBehaviorRecordPo.getShopId());
|
|
|
if (StringUtils.isNotBlank(shopName)) {
|
|
@@ -250,7 +250,7 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
String trim = value.trim();
|
|
|
if (StringUtils.isNotBlank(trim)) {
|
|
|
log.info("openId============》" + trim);
|
|
|
- cmBehaviorRecordPo.setOpenId(trim);
|
|
|
+ cmBehaviorRecordPo.setOpenId(trim);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -262,7 +262,7 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
String trim = value.trim();
|
|
|
if (StringUtils.isNotBlank(trim)) {
|
|
|
log.info("headUserId============》" + trim);
|
|
|
- cmBehaviorRecordPo.setHeadUserId(trim);
|
|
|
+ cmBehaviorRecordPo.setHeadUserId(trim);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -274,11 +274,21 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
String trim = value.trim();
|
|
|
if (StringUtils.isNotBlank(trim)) {
|
|
|
log.info("productArchiveId============》" + trim);
|
|
|
- cmBehaviorRecordPo.setProductArchiveId(trim);
|
|
|
+ cmBehaviorRecordPo.setProductArchiveId(trim);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (str.startsWith("partnerId") && str.contains("=")) {
|
|
|
+ String[] split1 = str.split("=");
|
|
|
+ if (split1.length > 1) {
|
|
|
+ String value = split1[1];
|
|
|
+ String trim = value.trim();
|
|
|
+ if (StringUtils.isNotBlank(trim)) {
|
|
|
+ log.info("partnerId============》" + trim);
|
|
|
+ cmBehaviorRecordPo.setPartnerId(Integer.valueOf(trim));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
// 处理页面标签为空
|
|
|
if (StringUtils.isBlank(cmBehaviorRecordPo.getPageLabel()) || StringUtils.isEmpty(cmBehaviorRecordPo.getPageLabel())) {
|
|
@@ -304,7 +314,7 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
productId = cmBehaviorRecordPo.getPagePath().substring(cmBehaviorRecordPo.getPagePath().indexOf("id="), cmBehaviorRecordPo.getPagePath().lastIndexOf("&typeId"));
|
|
|
} else {
|
|
|
// /pages/goods/product?id=1017
|
|
|
- productId = cmBehaviorRecordPo.getPagePath().substring(cmBehaviorRecordPo.getPagePath().indexOf("id=")+3);
|
|
|
+ productId = cmBehaviorRecordPo.getPagePath().substring(cmBehaviorRecordPo.getPagePath().indexOf("id=") + 3);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -323,7 +333,7 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
if (labelPath[1].contains(".html")) {
|
|
|
// 暂无该情况
|
|
|
infoId = labelPath[1].substring(0, labelPath[1].lastIndexOf(".html"));
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
infoId = labelPath[1];
|
|
|
}
|
|
|
}
|
|
@@ -332,7 +342,7 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- } else if (12 == cmBehaviorRecordPo.getPageType()){
|
|
|
+ } else if (12 == cmBehaviorRecordPo.getPageType()) {
|
|
|
String baikeId = "";
|
|
|
// 采美百科
|
|
|
if ("0".equals(cmBehaviorRecordPo.getAccessClient())) {
|
|
@@ -341,7 +351,7 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
String[] labelPath = cmBehaviorRecordPo.getPagePath().split("-");
|
|
|
if (labelPath[1].contains(".html")) {
|
|
|
baikeId = labelPath[1].substring(0, labelPath[1].lastIndexOf(".html"));
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
// 暂无该情况
|
|
|
baikeId = labelPath[1];
|
|
|
}
|
|
@@ -377,37 +387,37 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
}
|
|
|
cmBehaviorRecordPo.setRegion(region);
|
|
|
// if (flag) {
|
|
|
- recordMapper.insertRecord(cmBehaviorRecordPo);
|
|
|
+ recordMapper.insertRecord(cmBehaviorRecordPo);
|
|
|
|
|
|
- int recordId = cmBehaviorRecordPo.getRecordID();
|
|
|
- if (cmBehaviorRecordPo.getShopId() != null) {
|
|
|
- if (14 != cmBehaviorRecordPo.getPageType()) {
|
|
|
- if (StringUtils.isNotBlank(cmBehaviorRecordPo.getPageLabel())) {
|
|
|
- List<String> strList = new ArrayList<>();
|
|
|
- // 页面标签在含有多个,包含 , 是可分割,进行分割作为关键词
|
|
|
- if (cmBehaviorRecordPo.getPageLabel().contains(",")) {
|
|
|
- String[] split = cmBehaviorRecordPo.getPageLabel().split(",");
|
|
|
- for (String s : split) {
|
|
|
- strList.add(s);
|
|
|
- }
|
|
|
- } else {
|
|
|
- strList.add(cmBehaviorRecordPo.getPageLabel());
|
|
|
- }
|
|
|
- // 供应商id
|
|
|
- List<Integer> shopIds = recordMapper.shopIds(strList);
|
|
|
- if (shopIds.size() > 0) {
|
|
|
- for (Integer shopId : shopIds) {
|
|
|
- recordMapper.insertShopId(recordId, shopId);
|
|
|
- }
|
|
|
+ int recordId = cmBehaviorRecordPo.getRecordID();
|
|
|
+ if (cmBehaviorRecordPo.getShopId() != null) {
|
|
|
+ if (14 != cmBehaviorRecordPo.getPageType()) {
|
|
|
+ if (StringUtils.isNotBlank(cmBehaviorRecordPo.getPageLabel())) {
|
|
|
+ List<String> strList = new ArrayList<>();
|
|
|
+ // 页面标签在含有多个,包含 , 是可分割,进行分割作为关键词
|
|
|
+ if (cmBehaviorRecordPo.getPageLabel().contains(",")) {
|
|
|
+ String[] split = cmBehaviorRecordPo.getPageLabel().split(",");
|
|
|
+ for (String s : split) {
|
|
|
+ strList.add(s);
|
|
|
}
|
|
|
+ } else {
|
|
|
+ strList.add(cmBehaviorRecordPo.getPageLabel());
|
|
|
}
|
|
|
- } else {
|
|
|
- Integer id = recordMapper.selShopId(cmBehaviorRecordPo.getShopId());
|
|
|
- if (id != null) {
|
|
|
- recordMapper.insertShopId(recordId, cmBehaviorRecordPo.getShopId());
|
|
|
+ // 供应商id
|
|
|
+ List<Integer> shopIds = recordMapper.shopIds(strList);
|
|
|
+ if (shopIds.size() > 0) {
|
|
|
+ for (Integer shopId : shopIds) {
|
|
|
+ recordMapper.insertShopId(recordId, shopId);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ } else {
|
|
|
+ Integer id = recordMapper.selShopId(cmBehaviorRecordPo.getShopId());
|
|
|
+ if (id != null) {
|
|
|
+ recordMapper.insertShopId(recordId, cmBehaviorRecordPo.getShopId());
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
//}
|
|
|
}
|
|
|
}
|
|
@@ -480,7 +490,7 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
skuList.forEach(sku -> {
|
|
|
if (null != sku.getPrice() && 0 != sku.getPrice()) {
|
|
|
// 供应商比例
|
|
|
- double shopPercent = (sku.getCostPrice()/sku.getPrice()*100);
|
|
|
+ double shopPercent = (sku.getCostPrice() / sku.getPrice() * 100);
|
|
|
double rint = Math.rint(shopPercent);
|
|
|
// 分账组织佣金比例
|
|
|
double organizePercent = 0d;
|
|
@@ -553,7 +563,7 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
List<Integer> userIdAttribute = recordMapper.getUserIdAttribute(format, null, touristId);
|
|
|
boolean userBean = userIdAttribute.contains(0);
|
|
|
// 该openId下只有两个身份 游客-机构、游客-供应商
|
|
|
- if(num == 2 && userBean) {
|
|
|
+ if (num == 2 && userBean) {
|
|
|
for (CmBehaviorTouristInfoPo touristInfoPo : touristInfo) {
|
|
|
if (touristId.equals(touristInfoPo.getTouristId())) {
|
|
|
CmBehaviorRecordPo cmBehaviorRecordPo = new CmBehaviorRecordPo();
|
|
@@ -762,7 +772,7 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
if (recordPoList.size() > 0) {
|
|
|
recordPoList.forEach(r -> {
|
|
|
if (StringUtils.isNotBlank(r.getRegisterIp()) && (null == r.getProvinceId() && null == r.getCityId())) {
|
|
|
- log.info("个人机构地址初始化=====》"+r.getClubId());
|
|
|
+ log.info("个人机构地址初始化=====》" + r.getClubId());
|
|
|
try {
|
|
|
Map<String, String> map = recordAddress(r.getRegisterIp());
|
|
|
if (!map.isEmpty()) {
|
|
@@ -815,10 +825,10 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
instance.add(Calendar.DAY_OF_MONTH, -1);
|
|
|
Date time = instance.getTime();
|
|
|
String format = dateFormat.format(time);
|
|
|
- log.info("dateTime========"+format);
|
|
|
+ log.info("dateTime========" + format);
|
|
|
// 统计供应商
|
|
|
List<Integer> shopIds = recordMapper.getShopId();
|
|
|
- shopIds.forEach( s -> {
|
|
|
+ shopIds.forEach(s -> {
|
|
|
log.info("统计供应商数据");
|
|
|
// 检索供应商统计信息
|
|
|
CmBehaviorRecordPo behavior = recordMapper.getBehaviorList(format, 14, s.toString());
|
|
@@ -1004,11 +1014,11 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
} else {
|
|
|
// 第一次加入, 初始出现系数为 1
|
|
|
if (StringUtils.isNotBlank(stateKeyword) && StringUtils.isNotEmpty(stateKeyword)) {
|
|
|
- if (!demandList.contains(stateKeyword)){
|
|
|
+ if (!demandList.contains(stateKeyword)) {
|
|
|
demandList.add(stateKeyword);
|
|
|
map.put(stateKeyword, 1);
|
|
|
clubIdMap.put(stateKeyword, clubId);
|
|
|
- } else{
|
|
|
+ } else {
|
|
|
// 记录过,出现次数在原来基础上 + 1
|
|
|
Integer number = map.get(stateKeyword) + 1;
|
|
|
map.put(stateKeyword, number);
|
|
@@ -1050,7 +1060,7 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
Map<String, Integer> pageTypeMap = new HashMap<>();
|
|
|
// 访问记录
|
|
|
List<CmBehaviorRecordPo> behaviorRecordList = recordMapper.getClubBehavior(clubId, startTime, endTime);
|
|
|
- log.info("behaviorRecordList===="+behaviorRecordList);
|
|
|
+ log.info("behaviorRecordList====" + behaviorRecordList);
|
|
|
if (null != behaviorRecordList && behaviorRecordList.size() > 0) {
|
|
|
for (CmBehaviorRecordPo behaviorRecord : behaviorRecordList) {
|
|
|
if (behaviorRecord.getPageLabel().contains(",")) {
|
|
@@ -1076,7 +1086,7 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
map.put(behaviorRecord.getPageLabel(), Integer.parseInt(behaviorRecord.getNumber()));
|
|
|
clubIdMap.put(behaviorRecord.getPageLabel(), clubId);
|
|
|
pageTypeMap.put(behaviorRecord.getPageLabel(), behaviorRecord.getPageType());
|
|
|
- } else{
|
|
|
+ } else {
|
|
|
// 记录过,出现次数在原来基础上 + 1
|
|
|
Integer number = map.get(behaviorRecord.getPageLabel()) + 1;
|
|
|
map.put(behaviorRecord.getPageLabel(), number);
|
|
@@ -1091,7 +1101,7 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
stateCollect = clubStateKeywordList.stream().filter(st -> st.getClubId().equals(clubId)).map(CmClubLabelPo::getLabel).collect(Collectors.toList());
|
|
|
}
|
|
|
// 保存访问标签
|
|
|
- log.info("demandList==访问标签=="+demandList);
|
|
|
+ log.info("demandList==访问标签==" + demandList);
|
|
|
for (String demand : demandList) {
|
|
|
if (!trendsCollect.contains(demand) && !stateCollect.contains(demand)) {
|
|
|
CmClubLabelPo cmClubLabelPo = new CmClubLabelPo();
|
|
@@ -1169,6 +1179,7 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
}
|
|
|
return region;
|
|
|
}
|
|
|
+
|
|
|
// 获取IP对应地址 ---- 太平洋
|
|
|
public static Map<String, String> recordAddress(String ip) throws IOException {
|
|
|
URL url = null;
|
|
@@ -1178,7 +1189,7 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
String line = "";
|
|
|
String regionPro = "";
|
|
|
String regionCity = "";
|
|
|
- Map<String,String> map = new HashMap<>();
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
String urlStr = "http://whois.pconline.com.cn/ipJson.jsp?ip=" + ip + "&json=true";
|
|
|
try {
|
|
|
url = new URL(urlStr);
|
|
@@ -1244,7 +1255,7 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
|
if (link.contains("zzjtest.gz.aeert.com")) {
|
|
|
return "0";
|
|
|
}
|
|
|
- if (link.contains("material")&&link.contains("caimei365.com")) { //https://material-b.caimei365.com
|
|
|
+ if (link.contains("material") && link.contains("caimei365.com")) { //https://material-b.caimei365.com
|
|
|
return "8";
|
|
|
}
|
|
|
return null;
|