update
This commit is contained in:
+2
@@ -3,12 +3,14 @@ package com.fangjia.job.fsh.document;
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
|
||||
/**
|
||||
* 理财和贷款潜客统计
|
||||
* @author yinjihuan
|
||||
*/
|
||||
@Document(collection="customer_stat")
|
||||
public class CustomerStat {
|
||||
|
||||
@Id
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ public class AdVisitLogServiceImpl extends EntityService<AdVisitLog> implements
|
||||
sql.append("?,");
|
||||
params.add(poi);
|
||||
}
|
||||
sql.delete(0, sql.length() - 1);
|
||||
sql.delete(sql.length() - 1, sql.length());
|
||||
sql.append(")");
|
||||
if (StringUtils.isNotBlank(start) && StringUtils.isNotBlank(end)) {
|
||||
sql.append(" and visit_time between ? and ?");
|
||||
|
||||
+25
-16
@@ -1,5 +1,6 @@
|
||||
package com.fangjia.job.fsh.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -155,7 +156,7 @@ public class CustomerStatServiceImpl implements CustomerStatService {
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 贷款潜在客户分析
|
||||
* @param eid
|
||||
@@ -172,7 +173,7 @@ public class CustomerStatServiceImpl implements CustomerStatService {
|
||||
}
|
||||
|
||||
// 从5星开始分析,满足条件则继续下个用户的分析,不满足则继续4星的分析,以此类推
|
||||
for (int i = 5; i <= 1; i--) {
|
||||
for (int i = 5; i >= 1; i--) {
|
||||
LoanCustomersConfig config = getLoanCustomersConfig(i, loanCustomersConfigList);
|
||||
if (config == null) {
|
||||
continue;
|
||||
@@ -180,57 +181,64 @@ public class CustomerStatServiceImpl implements CustomerStatService {
|
||||
// 配置了最近分析时间才需要根据时间去查询PV
|
||||
String start = "";
|
||||
String end = "";
|
||||
if (loanFilterConfig.getAnalyTime() > 0) {
|
||||
Map<String, String> timeMap = DateUtilCustom.getLatelyDate(loanFilterConfig.getAnalyTime());
|
||||
if (config.getAnalyTime() > 0) {
|
||||
Map<String, String> timeMap = DateUtilCustom.getLatelyDate(config.getAnalyTime());
|
||||
start = timeMap.get("start");
|
||||
end = timeMap.get("end");
|
||||
}
|
||||
|
||||
// 判断贷款评估PV
|
||||
if (config.getLoanEvalPv() > 0) {
|
||||
if (visitLogService.queryPvCountByUser(eid, uid, Arrays.asList("/myLoan/loanStep", "/myLoan/result"), start, end) <= config.getLoanEvalPv()) {
|
||||
long count = visitLogService.queryPvCountByUser(eid, uid, Arrays.asList("/myLoan/loanStep", "/myLoan/result"), start, end);
|
||||
if (count <= config.getLoanEvalPv()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// 判断申请评估PV
|
||||
// 判断贷款申请PV
|
||||
if (config.getLoanApplyPv() > 0) {
|
||||
if (visitLogService.queryPvCountByUser(eid, uid, Arrays.asList("/myLoan/info", "/myLoan/applyResult"), start, end) <= config.getLoanApplyPv()) {
|
||||
long count = visitLogService.queryPvCountByUser(eid, uid, Arrays.asList("/myLoan/info", "/myLoan/applyResult"), start, end);
|
||||
if (count <= config.getLoanApplyPv()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// 判断我要贷款首页PV
|
||||
if (config.getLoanIndexPagePv() > 0) {
|
||||
if (visitLogService.queryPvCountByUser(eid, uid, Arrays.asList("/myLoan/index"), start, end) <= config.getLoanIndexPagePv()) {
|
||||
long count = visitLogService.queryPvCountByUser(eid, uid, Arrays.asList("/myLoan/index"), start, end);
|
||||
if (count <= config.getLoanIndexPagePv()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// 判断我要置换首页PV
|
||||
if (config.getSubIndexPagePv() > 0) {
|
||||
if (visitLogService.queryPvCountByUser(eid, uid, Arrays.asList("/changeHouse/index"), start, end) <= config.getSubIndexPagePv()) {
|
||||
long count = visitLogService.queryPvCountByUser(eid, uid, Arrays.asList("/changeHouse/index"), start, end);
|
||||
if (count <= config.getSubIndexPagePv()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// 判断出租管理PV
|
||||
if (config.getRentManagerPv() > 0) {
|
||||
if (visitLogService.queryPvCountByUser(eid, uid, Arrays.asList("/rent/index"), start, end) <= config.getRentManagerPv()) {
|
||||
long count = visitLogService.queryPvCountByUser(eid, uid, Arrays.asList("/rent/index"), start, end);
|
||||
if (count <= config.getRentManagerPv()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// 判断出售分析PV
|
||||
if (config.getSaleAnalyPv() > 0) {
|
||||
if (visitLogService.queryPvCountByUser(eid, uid, Arrays.asList("/saleAnalysis/analysisDetail"), start, end) <= config.getSaleAnalyPv()) {
|
||||
long count = visitLogService.queryPvCountByUser(eid, uid, Arrays.asList("/saleAnalysis/analysisDetail"), start, end);
|
||||
if (count <= config.getSaleAnalyPv()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// 判断贷款评估次数
|
||||
if (config.getLoanEvalCount() > 0) {
|
||||
if (loanApplyService.queryCountByType(eid, uid, 2, start, end) <= config.getLoanEvalCount()) {
|
||||
long count = loanApplyService.queryCountByType(eid, uid, 2, start, end);
|
||||
if (count <= config.getLoanEvalCount()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -255,7 +263,7 @@ public class CustomerStatServiceImpl implements CustomerStatService {
|
||||
}
|
||||
|
||||
// 从5星开始分析,满足条件则继续下个用户的分析,不满足则继续4星的分析,以此类推
|
||||
for (int i = 5; i <= 1; i--) {
|
||||
for (int i = 5; i >= 1; i--) {
|
||||
FinancialCustomersConfig config = getFinancialCustomersConfig(i, financialCustomersList);
|
||||
if (config == null) {
|
||||
continue;
|
||||
@@ -338,7 +346,8 @@ public class CustomerStatServiceImpl implements CustomerStatService {
|
||||
// 企业下的用户数量
|
||||
long enterpriseUserCount = enterpriseProductUserService.queryUserCount(eid);
|
||||
long level = houseInfoService.queryHouseTotalPriceLevel(eid, uid);
|
||||
return level / enterpriseUserCount * 100.0;
|
||||
double rate = new BigDecimal((double)enterpriseUserCount/level).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() * 100;
|
||||
return rate;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -362,7 +371,7 @@ public class CustomerStatServiceImpl implements CustomerStatService {
|
||||
long adClickCount = adVisitLogService.queryPvCount(eid, uid, Arrays.asList(0, 1, 2, 3), start, end);
|
||||
List<String> uriList = Arrays.asList("/fsh/result", "/saleAnalysis/analysisDetail", "/rent/index");
|
||||
long pvCount = visitLogService.queryPvCountByUser(eid, uid, uriList, start, end);
|
||||
double rate = adClickCount / pvCount * 100.0;
|
||||
double rate = new BigDecimal((double)adClickCount/pvCount).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() * 100;
|
||||
return rate;
|
||||
}
|
||||
|
||||
@@ -378,7 +387,7 @@ public class CustomerStatServiceImpl implements CustomerStatService {
|
||||
long adClickCount = adVisitLogService.queryPvCount(eid, uid, Arrays.asList(4), start, end);
|
||||
List<String> uriList = Arrays.asList("/changeHouse/details");
|
||||
long pvCount = visitLogService.queryPvCountByUser(eid, uid, uriList, start, end);
|
||||
double rate = adClickCount / pvCount * 100.0;
|
||||
double rate = new BigDecimal((double)adClickCount/pvCount).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() * 100;
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ public class VisitLogServiceImpl extends EntityService<VisitLog> implements Visi
|
||||
sql.append("?,");
|
||||
params.add(uri);
|
||||
}
|
||||
sql.delete(0, sql.length() - 1);
|
||||
sql.delete(sql.length() - 1, sql.length());
|
||||
sql.append(")");
|
||||
if (StringUtils.isNotBlank(start) && StringUtils.isNotBlank(end)) {
|
||||
sql.append(" and visit_time between ? and ?");
|
||||
|
||||
Reference in New Issue
Block a user