Commit b79d3b12 authored by licc's avatar licc

月度肥料接口自测优化4

parent 1d3c82b8
......@@ -232,7 +232,7 @@ public class AccountManager {
//更新月收益
if (!CollectionUtils.isEmpty(accountInfoList)) {
for (AccountInfo accountInfo : accountInfoList) {
int count = accountMapper.updateById(accountInfo);
int count = accountMapper.edit(accountInfo);
if (count == 0) {
return false;
}
......
......@@ -159,7 +159,13 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
String userId = entity.getKey();
//1)、统计当前用户月度业绩
double userCount = entity.getValue();
tempMap.put(userId, userCount);
if (tempMap.containsKey(entity.getKey())) {
double teamMoney = userCount + tempMap.get(entity.getKey());
tempMap.put(entity.getKey(), teamMoney);
} else {
//key 不存在,加入集合 当前用户团队绩效
tempMap.put(entity.getKey(), userCount);
}
//2)、获取当前用户的上级用户列表
List<User> userList = getByList(userId);
......@@ -171,11 +177,11 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
//3)、统计当前用户的上级用户团队绩效
//key 存在 当前用户团队绩效 + 上级用户团队绩效
if (tempMap.containsKey(userInfo.getUserId())) {
double teamMoney = userCount + map.get(userInfo.getUserId());
map.put(userInfo.getUserId(), teamMoney);
double teamMoney = userCount + tempMap.get(userInfo.getUserId());
tempMap.put(userInfo.getUserId(), teamMoney);
} else {
//key 不存在,加入集合 当前用户团队绩效
map.put(userInfo.getUserId(), userCount);
tempMap.put(userInfo.getUserId(), userCount);
}
}
}
......@@ -196,7 +202,6 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
performance.setMonthTeamPerformance(BigDecimal.valueOf(entity.getValue()));
performance.setUserLevel(user.getUserLevel());
performance.setYearMonth(yearMonth);
teamPerformanceMapper.add(performance);
addList.add(performance);
} else {
teamPerformance.setMonthTeamPerformance(BigDecimal.valueOf(entity.getValue()));
......
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