分润问题
This commit is contained in:
@@ -220,7 +220,7 @@ public class InviteServiceImpl extends ServiceImpl<InviteDao, Invite> implements
|
|||||||
public Map<String, Object> updateInvite(UserEntity userEntity, String format, Long userId, BigDecimal price) {
|
public Map<String, Object> updateInvite(UserEntity userEntity, String format, Long userId, BigDecimal price) {
|
||||||
Map<String, Object> result = new HashMap<>();
|
Map<String, Object> result = new HashMap<>();
|
||||||
if (userEntity != null && userId != null && price != null) {
|
if (userEntity != null && userId != null && price != null) {
|
||||||
Invite invite1 = inviteDao.selectInviteByUser(userEntity.getUserId(), userId, 1);
|
Invite invite1 = inviteDao.selectInviteByUser(userEntity.getUserId(), userId, 1);// 1级好友
|
||||||
if (invite1 == null) {
|
if (invite1 == null) {
|
||||||
Invite invite = new Invite();
|
Invite invite = new Invite();
|
||||||
invite.setState(0);
|
invite.setState(0);
|
||||||
@@ -235,8 +235,8 @@ public class InviteServiceImpl extends ServiceImpl<InviteDao, Invite> implements
|
|||||||
UserEntity userEntity1 = userService.selectUserById(userId);
|
UserEntity userEntity1 = userService.selectUserById(userId);
|
||||||
BigDecimal oneMoney = BigDecimal.ZERO;
|
BigDecimal oneMoney = BigDecimal.ZERO;
|
||||||
BigDecimal twoMoney = BigDecimal.ZERO;
|
BigDecimal twoMoney = BigDecimal.ZERO;
|
||||||
if (userEntity.getRate() != null && userEntity.getRate().doubleValue() > 0) {
|
if (userEntity.getRate() != null && userEntity.getRate().doubleValue() > 0) {//一级推广
|
||||||
BigDecimal rateMoney = price.multiply(userEntity.getRate()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
BigDecimal rateMoney = userEntity.getRate();
|
||||||
oneMoney = rateMoney;
|
oneMoney = rateMoney;
|
||||||
Double money = rateMoney.doubleValue();
|
Double money = rateMoney.doubleValue();
|
||||||
invite1.setUserType(1);
|
invite1.setUserType(1);
|
||||||
@@ -274,7 +274,7 @@ public class InviteServiceImpl extends ServiceImpl<InviteDao, Invite> implements
|
|||||||
invite2 = inviteDao.selectInviteByUser(two.getUserId(), userId, 2);
|
invite2 = inviteDao.selectInviteByUser(two.getUserId(), userId, 2);
|
||||||
}
|
}
|
||||||
if (two.getTwoRate() != null && two.getTwoRate().doubleValue() > 0) {
|
if (two.getTwoRate() != null && two.getTwoRate().doubleValue() > 0) {
|
||||||
BigDecimal rateMoney = price.multiply(two.getTwoRate()).setScale(2, RoundingMode.HALF_UP);
|
BigDecimal rateMoney = two.getTwoRate();
|
||||||
twoMoney = rateMoney;
|
twoMoney = rateMoney;
|
||||||
Double money = rateMoney.doubleValue();
|
Double money = rateMoney.doubleValue();
|
||||||
invite2.setUserType(2);
|
invite2.setUserType(2);
|
||||||
|
|||||||
Reference in New Issue
Block a user