| | |
| | | * 根据固定等级规则新增用户积分 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addScoreByParamSetting(Long vipId, Long oprationUserId, Long shopId, Integer firstScore, Long businessId, int type, String remark, BusParameterSettings parameterSetting) { |
| | | public void addScoreByParamSetting(Long vipId, Long oprationUserId, Long shopId, Long businessId, int type, String remark, BusParameterSettings parameterSetting) { |
| | | |
| | | |
| | | SysVipInfo vipInfo = sysVipInfoDao.selectById(vipId); |
| | | |
| | | |
| | | //添加自己的积分 |
| | | if (firstScore > 0) { |
| | | addScore( |
| | | vipInfo.getId(), |
| | | oprationUserId, |
| | | shopId, |
| | | firstScore, |
| | | businessId, |
| | | type, |
| | | remark |
| | | ); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(parameterSetting.getParamValue()) |
| | | && vipInfo.getRecommendId() != null) { |
| | | //推荐注册老带新积分奖励 |
| | | SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); |
| | | Integer secondScore = new Integer(parameterSetting.getParamValue()); |
| | | if (secondScore > 0) { |
| | | addScore( |
| | | referrerVip.getId(), |
| | | oprationUserId, |
| | | shopId, |
| | | secondScore, |
| | | businessId, |
| | | type, |
| | | remark |
| | | ); |
| | | } |
| | | //推荐注册二级带新积分奖励 |
| | | if (StringUtils.isNotBlank(parameterSetting.getParamValue1()) |
| | | && referrerVip.getRecommendId() != null) { |
| | | Integer threeScore = new Integer(parameterSetting.getParamValue()); |
| | | if (threeScore > 0) { |
| | | if (parameterSetting != null) { |
| | | SysVipInfo vipInfo = sysVipInfoDao.selectById(vipId); |
| | | //添加自己的积分 |
| | | if (StringUtils.isNotBlank(parameterSetting.getParamValue())) { |
| | | Integer firstScore = new Integer(parameterSetting.getParamValue()); |
| | | if (firstScore > 0) { |
| | | addScore( |
| | | referrerVip.getRecommendId(), |
| | | vipInfo.getId(), |
| | | oprationUserId, |
| | | shopId, |
| | | threeScore, |
| | | firstScore, |
| | | businessId, |
| | | type, |
| | | remark |
| | | ); |
| | | } |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(parameterSetting.getParamValue1()) |
| | | && vipInfo.getRecommendId() != null) { |
| | | //推荐注册老带新积分奖励 |
| | | SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); |
| | | Integer secondScore = new Integer(parameterSetting.getParamValue1()); |
| | | if (secondScore > 0) { |
| | | addScore( |
| | | referrerVip.getId(), |
| | | oprationUserId, |
| | | shopId, |
| | | secondScore, |
| | | businessId, |
| | | type, |
| | | remark |
| | | ); |
| | | } |
| | | //推荐注册二级带新积分奖励 |
| | | if (StringUtils.isNotBlank(parameterSetting.getParamValue2()) |
| | | && referrerVip.getRecommendId() != null) { |
| | | Integer threeScore = new Integer(parameterSetting.getParamValue2()); |
| | | if (threeScore > 0) { |
| | | addScore( |
| | | referrerVip.getRecommendId(), |
| | | oprationUserId, |
| | | shopId, |
| | | threeScore, |
| | | businessId, |
| | | type, |
| | | remark |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |