Commit 05ea4456 authored by licc's avatar licc

优化月度肥料任务

parent 0b532595
......@@ -212,6 +212,9 @@ public class DayTaskServiceImpl implements DayTaskService {
return R.ok(0, true);
}
//如果用户的团队业绩不存在的,新增本月团队业绩
addTeamPerformance(userList);
boolean bool = monthlyIncome(totalMoney, userList);
if (!bool) {
return R.ok(1, false);
......@@ -238,13 +241,15 @@ public class DayTaskServiceImpl implements DayTaskService {
totalMoney = totalMoney.add(orderInfo.getPayment());
}
double number = Math.floor(totalMoney.doubleValue() / 3980 / 12);
if (number == 0) {
return R.ok(0, true);
}
//1、判断当前月是否是业绩开始的第一个月
List<TeamPerformance> teamPerformances = teamPerformanceMapper.getByBeforeTime(yearMonth);
//2、集合为空 是业绩开始的第一个月
if (CollectionUtils.isEmpty(teamPerformances)) {
if (number != 0) {
//获取月业绩前20用户
List<TeamPerformance> list = teamPerformanceMapper.userTwenty(yearMonth);
if (CollectionUtils.isEmpty(list)) {
......@@ -311,8 +316,6 @@ public class DayTaskServiceImpl implements DayTaskService {
if (!bool) {
return R.ok(1, false);
}
}
log.info("本月最大进步奖日定时任务执行成功");
return R.ok(0, true);
}
......@@ -463,7 +466,9 @@ public class DayTaskServiceImpl implements DayTaskService {
if (null != memberPercent) {
//获取本月团队总金额
TeamPerformance teamPerformance = teamPerformanceMapper.getByUserIdAndTime(user.getUserId(), yearMonth);
if(null ==teamPerformance){
}
//获取该等级团队总金额
Double teamTotal = teamPerformanceMapper.countTeamMoney(user.getUserLevel(), yearMonth);
if (null != teamPerformance && null != teamTotal) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment