Commit 33505c8d authored by m1991's avatar m1991

Merge remote-tracking branch 'origin/master'

parents fe5da08c ccf24950
...@@ -135,7 +135,6 @@ ...@@ -135,7 +135,6 @@
<where> <where>
rebate_status=0 rebate_status=0
<if test="successTime != null "> <if test="successTime != null ">
and success_time &lt; #{successTime}
AND( AND(
YEAR(success_time) = YEAR(#{successTime}) YEAR(success_time) = YEAR(#{successTime})
AND MONTH(success_time) = MONTH(#{successTime})) AND MONTH(success_time) = MONTH(#{successTime}))
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
where where
p.user_id=u.user_id p.user_id=u.user_id
and p.`year_month` = #{yearMonth} and p.`year_month` = #{yearMonth}
order by p.`growth_rate` desc,u.create_time desc,p.award_money desc order by p.`growth_rate` desc,p.award_money desc,u.create_time desc
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -70,7 +70,7 @@ public class AccountManager { ...@@ -70,7 +70,7 @@ public class AccountManager {
BigDecimal performanceMonth = accountInfo.getEarningsMonth().add(bigDecimal); BigDecimal performanceMonth = accountInfo.getEarningsMonth().add(bigDecimal);
accountInfo.setEarningsMonth(performanceMonth.setScale(2, RoundingMode.HALF_UP)); accountInfo.setEarningsMonth(performanceMonth.setScale(2, RoundingMode.HALF_UP));
BigDecimal performanceTotal = accountInfo.getEarningsMonth().add(bigDecimal); BigDecimal performanceTotal = accountInfo.getEarningsTotal().add(bigDecimal);
accountInfo.setEarningsTotal(performanceTotal.setScale(2, RoundingMode.HALF_UP)); accountInfo.setEarningsTotal(performanceTotal.setScale(2, RoundingMode.HALF_UP));
//2、修改订单返佣状态:已返佣 1 //2、修改订单返佣状态:已返佣 1
......
...@@ -21,6 +21,7 @@ import org.springframework.util.CollectionUtils; ...@@ -21,6 +21,7 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*; import java.util.*;
...@@ -83,7 +84,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo> ...@@ -83,7 +84,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
if (RebateStatusEnum.NO_REBATE.getCode().equals(orderInfo.getRebateStatus()) && successTime <= time) { if (RebateStatusEnum.NO_REBATE.getCode().equals(orderInfo.getRebateStatus()) && successTime <= time) {
//获取用户信息 //获取用户信息
User user = usersMapper.getByUserId(orderInfo.getUserId()); User user = usersMapper.getByUserId(orderInfo.getUserId());
if (null == user) { if (null == user || user.getUserLevel() == 0) {
continue; continue;
} }
...@@ -94,7 +95,8 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo> ...@@ -94,7 +95,8 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
} }
//获取返佣比例 //获取返佣比例
MemberPercent memberpercent = memberPercentMapper.getByLevelAndType(user.getUserLevel(), MemberPercentEnum.REBATE.getCode()); MemberPercent memberpercent = memberPercentMapper.getByLevelAndType(user.getUserLevel(),
MemberPercentEnum.REBATE.getCode());
if (null == memberpercent) { if (null == memberpercent) {
continue; continue;
} }
...@@ -396,7 +398,9 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo> ...@@ -396,7 +398,9 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
double month = teamPerformance.getMonthTeamPerformance().doubleValue(); double month = teamPerformance.getMonthTeamPerformance().doubleValue();
double percent = memberPercent.getPercent().doubleValue(); double percent = memberPercent.getPercent().doubleValue();
//计算收益 //计算收益
double income = (moneyMonth + lastMonthAward) * 3980 * percent * month / teamTotal; double teamMoney = (moneyMonth + lastMonthAward) * 3980 * percent * month;
DecimalFormat df = new DecimalFormat("######0.00");
double income=Double.parseDouble(df.format(teamMoney/teamTotal));
//获取账户信息 //获取账户信息
AccountInfo accountInfo = accountMapper.getByUserId(user.getUserId()); AccountInfo accountInfo = accountMapper.getByUserId(user.getUserId());
...@@ -404,8 +408,8 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo> ...@@ -404,8 +408,8 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
BigDecimal performanceMonth = accountInfo.getEarningsMonth().add(bigDecimal); BigDecimal performanceMonth = accountInfo.getEarningsMonth().add(bigDecimal);
accountInfo.setEarningsMonth(performanceMonth); accountInfo.setEarningsMonth(performanceMonth);
BigDecimal performanceTotal = accountInfo.getEarningsMonth().add(bigDecimal); BigDecimal performanceTotal = accountInfo.getEarningsTotal().add(bigDecimal);
accountInfo.setEarningsMonth(performanceTotal); accountInfo.setEarningsTotal(performanceTotal);
accountInfoList.add(accountInfo); accountInfoList.add(accountInfo);
...@@ -525,5 +529,6 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo> ...@@ -525,5 +529,6 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
// flag 1: 日定时任务 2:月定时任务 // flag 1: 日定时任务 2:月定时任务
int flag = 1; int flag = 1;
return accountManager.updateOrSavePrize(listVo, updateAccountList, prizes, flag); return accountManager.updateOrSavePrize(listVo, updateAccountList, prizes, flag);
} }
} }
...@@ -320,7 +320,7 @@ public class MonthTaskServiceImpl implements MonthTaskService { ...@@ -320,7 +320,7 @@ public class MonthTaskServiceImpl implements MonthTaskService {
* *
* @param totalMoney 月金额总额 * @param totalMoney 月金额总额
* @param userList 用户列表 * @param userList 用户列表
* @return * @return true or false
*/ */
private boolean monthlyIncome(BigDecimal totalMoney, List<User> userList) { private boolean monthlyIncome(BigDecimal totalMoney, List<User> userList) {
//上月 //上月
...@@ -373,12 +373,12 @@ public class MonthTaskServiceImpl implements MonthTaskService { ...@@ -373,12 +373,12 @@ public class MonthTaskServiceImpl implements MonthTaskService {
//获取账户信息 //获取账户信息
AccountInfo accountInfo = accountMapper.getByUserId(user.getUserId()); AccountInfo accountInfo = accountMapper.getByUserId(user.getUserId());
BigDecimal bigDecimal = new BigDecimal(income); BigDecimal bigDecimal = new BigDecimal(income).setScale(2,RoundingMode.HALF_UP);
BigDecimal performanceMonth = accountInfo.getEarningsMonth().add(bigDecimal); BigDecimal performanceMonth = accountInfo.getEarningsMonth().add(bigDecimal);
accountInfo.setEarningsMonth(performanceMonth.setScale(2, RoundingMode.HALF_UP)); accountInfo.setEarningsMonth(performanceMonth.setScale(2, RoundingMode.HALF_UP));
BigDecimal performanceTotal = accountInfo.getEarningsMonth().add(bigDecimal); BigDecimal performanceTotal = accountInfo.getEarningsTotal().add(bigDecimal);
accountInfo.setEarningsMonth(performanceTotal.setScale(2, RoundingMode.HALF_UP)); accountInfo.setEarningsTotal(performanceTotal.setScale(2, RoundingMode.HALF_UP));
accountInfoList.add(accountInfo); accountInfoList.add(accountInfo);
......
...@@ -274,8 +274,8 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U ...@@ -274,8 +274,8 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
} }
//判断用户是否有邀请码 1:无 //判断用户是否有邀请码 1:无
if (!INVITE_CODE.equals(user.getInviteCode())) { if (!INVITE_CODE.equals(user.getBeInvitedCode())) {
return R.error("尊敬的用户您好,您的邀请码已存在,不能修改!"); return R.error("尊敬的用户您好,您的推荐人邀请码已存在,不能修改!");
} }
//2、根据邀请码,获取邀请人信息 //2、根据邀请码,获取邀请人信息
......
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