gc-user/src/main/java/com/xzx/gc/user/mapper/UserShareInfoMapper.java
@@ -5,10 +5,13 @@ import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface UserShareInfoMapper extends GcMapper<UserShareInfo> { UserShareInfo selectByRegistPhone(@Param("registPhone") String registPhone); List<UserShareInfo> selectByPhone(@Param("phone") String phone); } gc-user/src/main/java/com/xzx/gc/user/service/DistribService.java
@@ -551,6 +551,14 @@ return; } List<UserShareInfo> hasInvite = userShareInfoMapper.selectByPhone(phone); if (CollUtil.isNotEmpty(hasInvite)) { if (hasInvite.size() >= 10) { log.info("超过10个,邀请无效:{}", phone); return; } } BigDecimal returnScore = new BigDecimal(invite); BigDecimal collectScore = StrUtil.isNotBlank(accountInfo.getCollectScore()) ? new BigDecimal(accountInfo.getCollectScore()) : BigDecimal.ZERO; accountInfo.setCollectScore(collectScore.add(returnScore).setScale(0, RoundingMode.DOWN).toString()); gc-user/src/main/resources/mapper/user/UserShareInfoMapper.xml
@@ -5,4 +5,8 @@ <select id="selectByRegistPhone" resultType="com.xzx.gc.entity.UserShareInfo"> select * from xzx_user_share_info where register_mobile_phone=#{registPhone} </select> <select id="selectByPhone" resultType="com.xzx.gc.entity.UserShareInfo"> select * from xzx_user_share_info where mobile_phone=#{phone} </select> </mapper>