yujian
2020-04-02 0ec22dcf4fd9c4496e6f681e7fab89f56c6e4e8a
fanli/src/main/java/com/yeshi/fanli/service/impl/user/integral/IntegralTaskRecordServiceImpl.java
@@ -26,6 +26,7 @@
import com.yeshi.fanli.entity.integral.IntegralTaskClass;
import com.yeshi.fanli.entity.integral.IntegralTaskClass.UniqueKeyEnum;
import com.yeshi.fanli.entity.integral.IntegralTaskRecord;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.exception.integral.IntegralTaskRecordException;
import com.yeshi.fanli.exception.user.UserInfoExtraException;
import com.yeshi.fanli.log.LogHelper;
@@ -253,7 +254,7 @@
      return totalGoldCoin + (userInfoExtra.getGoldCoin() == null ? 0 : userInfoExtra.getGoldCoin());
   }
   @Transactional(rollbackFor=Exception.class)
   @Transactional(rollbackFor = Exception.class)
   public boolean addDetail(Long uid, IntegralTaskRecord record) throws IntegralTaskRecordException {
      Long uid2 = record.getUid();
      if (uid2 == null || uid.longValue() != uid2.longValue())
@@ -351,7 +352,7 @@
      return integralTaskRecordMapper.countGetCountByTaskIdAndDay(taskId, uid, minTime, maxTime);
   }
   @Transactional(rollbackFor=Exception.class)
   @Transactional(rollbackFor = Exception.class)
   @Override
   public IntegralTaskRecord addRecord(IntegralTaskRecord record) throws IntegralTaskRecordException {
      if (record == null)
@@ -370,15 +371,6 @@
      // 设置有效期
      record.setEndTime(DateUtil.plusDayDate(Constant.GOLD_COIN_VALID_DAYS, date));
      integralTaskRecordMapper.insertSelective(record);
//      long count = integralTaskRecordMapper.getTotalGoldCoinByUid(record.getUid());
//      if (count >= 200) {// 大于200发送消息
//         IntegralTaskMQMsg msg = new IntegralTaskMQMsg(record.getUid(), count, new Date());
//         Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.integralTaskFinish,
//               msg);
//         producer.send(message);
//      }
      return record;
   }
@@ -406,7 +398,7 @@
      if (uid == null || originUid == null)
         return;
      String reward = configService.get("first_order_reward_boss");
      String reward = configService.get(ConfigKeyEnum.firstOrderRewardBoss.getKey());
      if (StringUtil.isNullOrEmpty(reward))
         return;
      firstOrderReward(uid, originUid, Integer.parseInt(reward), "一", beizu);
@@ -418,7 +410,7 @@
      if (uid == null || originUid == null)
         return;
      String reward = configService.get("first_order_reward_boss_super");
      String reward = configService.get(ConfigKeyEnum.firstOrderRewardBossSuper.getKey());
      if (StringUtil.isNullOrEmpty(reward))
         return;
      firstOrderReward(uid, originUid, Integer.parseInt(reward), "二", beizu);
@@ -430,7 +422,7 @@
      if (uid == null)
         return;
      String reward = configService.get("first_share_order_reward");
      String reward = configService.get(ConfigKeyEnum.firstShareOrderReward.getKey());
      if (StringUtil.isNullOrEmpty(reward))
         return;
      firstOrderReward(uid, null, Integer.parseInt(reward), null, beizu);
@@ -442,7 +434,7 @@
      if (uid == null || originUid == null)
         return;
      String reward = configService.get("first_share_order_reward_boss");
      String reward = configService.get(ConfigKeyEnum.firstShareOrderRewardBoss.getKey());
      if (StringUtil.isNullOrEmpty(reward))
         return;
      firstOrderReward(uid, originUid, Integer.parseInt(reward), "一", beizu);
@@ -507,8 +499,11 @@
         msgOther.setSource("首笔分享订单,系统奖励金币 ");
         msgOther.setExplain("首笔分享订单得到的奖金不足0.01元时奖励 ");
      } else {
         msgOther.setSource(level + "级队员首次下单,系统奖励金币 ");
         msgOther.setExplain("仅新邀请队员首下单你得到的奖金不足0.01元时奖励 ");
         if (level.equalsIgnoreCase("一") || level.equalsIgnoreCase("1"))
            msgOther.setSource("直接粉丝首次下单,系统奖励金币 ");
         else
            msgOther.setSource("间接粉丝首次下单,系统奖励金币 ");
         msgOther.setExplain("仅新邀请粉丝首下单你得到的奖金不足0.01元时奖励 ");
      }
      userOtherMsgNotificationService.firstOrderRewardMsg(uid, null, msgOther);
   }