分销金额
This commit is contained in:
@@ -71,4 +71,7 @@ public interface ShopUserMapper extends BaseMapper<ShopUser> {
|
||||
* @return 分页结果
|
||||
*/
|
||||
List<InviteUserVO> getInviteUser(Long distributionUserId, Long shopUserId);
|
||||
|
||||
void updateOneOrTwoAmount(Long userId, Long mainShopId, BigDecimal bigDecimal, Integer isOne);
|
||||
|
||||
}
|
||||
|
||||
@@ -14,5 +14,5 @@ import java.math.BigDecimal;
|
||||
*/
|
||||
public interface UserInfoMapper extends BaseMapper<UserInfo> {
|
||||
|
||||
int updateAmount(long userId, BigDecimal amount, Integer isOne);
|
||||
int updateAmount(long userId, BigDecimal amount);
|
||||
}
|
||||
|
||||
@@ -169,4 +169,9 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
|
||||
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOneOrTwoAmount(Long userId, Long mainShopId, BigDecimal bigDecimal, Integer isOne) {
|
||||
mapper.updateOneOrTwoAmount(userId, mainShopId, bigDecimal, isOne);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,8 +101,8 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> i
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDistributionAmount(long userId, BigDecimal amount, Integer isOne) {
|
||||
int b = mapper.updateAmount(userId, amount, isOne);
|
||||
public void updateDistributionAmount(long userId, BigDecimal amount) {
|
||||
int b = mapper.updateAmount(userId, amount);
|
||||
if (b <= 0) {
|
||||
throw new CzgException("更新分销金额失败");
|
||||
}
|
||||
|
||||
@@ -17,6 +17,20 @@
|
||||
where id = #{id}
|
||||
and amount - #{money} >= 0
|
||||
</update>
|
||||
<update id="updateOneOrTwoAmount">
|
||||
update tb_shop_user
|
||||
<set>
|
||||
<if test="isOne != null and isOne == 1">
|
||||
one_income = one_income + #{amount}
|
||||
</if>
|
||||
<if test="isOne != null and isOne == 2">
|
||||
two_income = two_income + #{amount}
|
||||
</if>
|
||||
</set>
|
||||
where user_id = #{userId}
|
||||
and shop_id = #{shopId}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<select id="selectUserSummary" resultType="com.czg.account.dto.shopuser.ShopUserSummaryDTO">
|
||||
|
||||
@@ -8,12 +8,6 @@
|
||||
update tb_user_info
|
||||
<set>
|
||||
distribution_amount = distribution_amount + #{amount}
|
||||
<if test="isOne != null and isOne == 1">
|
||||
, one_income = one_income + #{amount}
|
||||
</if>
|
||||
<if test="isOne != null and isOne == 2">
|
||||
, two_income = two_income + #{amount}
|
||||
</if>
|
||||
</set>
|
||||
where id = #{userId}
|
||||
and distribution_amount + #{amount} >= 0
|
||||
|
||||
Reference in New Issue
Block a user