update
This commit is contained in:
+33
-18
@@ -87,6 +87,8 @@ public class CustomerStatServiceImpl implements CustomerStatService {
|
||||
// 删除之前这个用户的统计数据,每天都是最新的
|
||||
this.removeCustomerStat(eid, uid);
|
||||
|
||||
long hosueCount = 0;
|
||||
Double housePrice = 0.0;
|
||||
int level = this.getFinanciaCustomerLevel(eid, uid, financiaFilterConfig, financialCustomersList);
|
||||
if (level > 0) {
|
||||
CustomerStat stat = new CustomerStat();
|
||||
@@ -94,26 +96,34 @@ public class CustomerStatServiceImpl implements CustomerStatService {
|
||||
stat.setUid(uid);
|
||||
stat.setCity(user.getCity());
|
||||
stat.setRegion(user.getRegion());
|
||||
stat.setHouseCount(houseInfoService.queryCountByEidAndUid(eid, uid));
|
||||
stat.setHousePrice(houseInfoService.querySumMoneyByEidAndUid(eid, uid));
|
||||
hosueCount = houseInfoService.queryCountByEidAndUid(eid, uid);
|
||||
stat.setHouseCount(hosueCount);
|
||||
housePrice = houseInfoService.querySumMoneyByEidAndUid(eid, uid);
|
||||
stat.setHousePrice(housePrice);
|
||||
stat.setCreateDate(new Date());
|
||||
stat.setType(1);
|
||||
stat.setLevel(level);
|
||||
mongoTemplate.save(stat);
|
||||
}
|
||||
|
||||
level = getLoanCustomerLevel(eid, uid, loanFilterConfig, loanCustomersConfigList);
|
||||
if (level > 0) {
|
||||
int levelLoan = getLoanCustomerLevel(eid, uid, loanFilterConfig, loanCustomersConfigList);
|
||||
if (levelLoan > 0) {
|
||||
CustomerStat stat = new CustomerStat();
|
||||
stat.setEid(eid);
|
||||
stat.setUid(uid);
|
||||
stat.setCity(user.getCity());
|
||||
stat.setRegion(user.getRegion());
|
||||
stat.setHouseCount(houseInfoService.queryCountByEidAndUid(eid, uid));
|
||||
stat.setHousePrice(houseInfoService.querySumMoneyByEidAndUid(eid, uid));
|
||||
// 理财级别有的情况下就用上面已经查询好的数据,避免重复查询
|
||||
if (level > 0) {
|
||||
stat.setHouseCount(hosueCount);
|
||||
stat.setHousePrice(housePrice);
|
||||
} else {
|
||||
stat.setHouseCount(houseInfoService.queryCountByEidAndUid(eid, uid));
|
||||
stat.setHousePrice(houseInfoService.querySumMoneyByEidAndUid(eid, uid));
|
||||
}
|
||||
stat.setCreateDate(new Date());
|
||||
stat.setType(2);
|
||||
stat.setLevel(level);
|
||||
stat.setLevel(levelLoan);
|
||||
mongoTemplate.save(stat);
|
||||
}
|
||||
}
|
||||
@@ -276,38 +286,35 @@ public class CustomerStatServiceImpl implements CustomerStatService {
|
||||
start = timeMap.get("start");
|
||||
end = timeMap.get("end");
|
||||
}
|
||||
// 判断用户理财广告点击率
|
||||
if (config.getAdClickRate() > 0) {
|
||||
double adClickRate = getFinancialAdClickRate(eid, uid, start, end);
|
||||
if (adClickRate <= config.getAdClickRate()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// 判断房产分析PV
|
||||
if (config.getHouseAnalyPv() > 0) {
|
||||
if (visitLogService.queryPvCountByUser(eid, uid, Arrays.asList("/fsh/result"), start, end) <= config.getHouseAnalyPv()) {
|
||||
long count = visitLogService.queryPvCountByUser(eid, uid, Arrays.asList("/fsh/result"), start, end);
|
||||
if (count <= config.getHouseAnalyPv()) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
// 判断出租管理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;
|
||||
}
|
||||
}
|
||||
|
||||
// 判断房产数量
|
||||
if (config.getHouseCountRank() > 0) {
|
||||
if (houseInfoService.queryCountByEidAndUid(eid, uid) <= config.getHouseCountRank()) {
|
||||
long count = houseInfoService.queryCountByEidAndUid(eid, uid);
|
||||
if (count <= config.getHouseCountRank()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -330,6 +337,14 @@ public class CustomerStatServiceImpl implements CustomerStatService {
|
||||
}
|
||||
}
|
||||
|
||||
// 判断用户理财广告点击率
|
||||
if (config.getAdClickRate() > 0) {
|
||||
double adClickRate = getFinancialAdClickRate(eid, uid, start, end);
|
||||
if (adClickRate <= config.getAdClickRate()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user