Commit 282808e5 authored by licc's avatar licc

月度肥料接口自测优化3

parent e6edc2de
......@@ -94,21 +94,28 @@ public class AccountManager {
}
@Transactional(rollbackFor = Exception.class)
public void updateAccountPerformanceMonth(List<TeamPerformance> addList, List<TeamPerformance> updateList) {
public Boolean updateAccountPerformanceMonth(List<TeamPerformance> addList, List<TeamPerformance> updateList) {
//1、新增
if (!CollectionUtils.isEmpty(addList)) {
for (TeamPerformance teamPerformance : addList) {
teamPerformanceMapper.add(teamPerformance);
int count = teamPerformanceMapper.add(teamPerformance);
if (count == 0) {
return false;
}
}
}
//2、更新
if (!CollectionUtils.isEmpty(updateList)) {
for (TeamPerformance teamPerformance : updateList) {
teamPerformanceMapper.edit(teamPerformance);
int count = teamPerformanceMapper.edit(teamPerformance);
if (count == 0) {
return false;
}
}
}
return true;
}
/**
......
......@@ -147,7 +147,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
map.put(userId, payMoney);
}
//累加所以订单成交额
//累加订单成交额
totalMoney = totalMoney.add(orderInfo.getPayment());
}
......@@ -205,7 +205,10 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
}
//4、更新账户月度绩效
accountManager.updateAccountPerformanceMonth(addList, updateList);
boolean updateBool = accountManager.updateAccountPerformanceMonth(addList, updateList);
if (!updateBool) {
return R.ok(1, false);
}
//5、获取所有用户,如果会员等级是黄金以上,计算月度收益
List<User> userList = usersMapper.getAllGoldUser();
......
......@@ -160,7 +160,10 @@ public class MonthTaskServiceImpl implements MonthTaskService {
}
//4、更新账户月度绩效
accountManager.updateAccountPerformanceMonth(addList, updateList);
boolean updateBool=accountManager.updateAccountPerformanceMonth(addList, updateList);
if(!updateBool){
return R.ok(1, false);
}
//5、获取所有用户,如果会员等级是黄金以上,计算月度收益
List<User> userList = usersMapper.getAllGoldUser();
......
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