yujian
2019-08-21 352c7227fc3c3be1a4465bb57cefd5462240aea9
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralTaskRecordServiceImpl.java
@@ -71,9 +71,14 @@
         if (list != null && list.size() > 0) {
            Date today =new Date();
            for (IntegralTaskRecord record: list) {
               if (DateUtil.daysBetween2(record.getCreateTime(),today) == 0) {
                  continue;
               }
               if (DateUtil.daysBetween2(record.getCreateTime(),today) != 1) {
                  break; // 天数未连续
               }
               today = record.getCreateTime();
               num ++ ;
            }
         }
@@ -121,6 +126,45 @@
   
   
   @Override
   public List<IntegralTaskRecord> listNotReceivedExcludeId(int count, long uid, Set<Long> idList) {
      if (idList != null && idList.size() == 0) {
         idList = null;
      }
      return integralTaskRecordMapper.listNotReceivedExcludeId(count, uid, idList);
   }
   @Override
   @Transactional
   public Integer receiveGoldCoinALL(Long uid) throws IntegralTaskRecordException   {
      UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
      if (userInfoExtra == null)
         throw new IntegralTaskRecordException(1, "用户信息不全");
      int totalGoldCoin = integralTaskRecordMapper.countTotalGoldCoin(uid);
      if (totalGoldCoin > 0) {
         integralTaskRecordMapper.updateReceived(uid);
      }
      Integer goldCoin = userInfoExtra.getGoldCoin();
      if (goldCoin == null)
         goldCoin = 0;
      UserInfoExtra extra = new UserInfoExtra();
      extra.setId(userInfoExtra.getId());
      extra.setGoldCoin(goldCoin + totalGoldCoin);
      try {
         userInfoExtraService.saveUserInfoExtra(extra);
      } catch (UserInfoExtraException e) {
         throw new IntegralTaskRecordException(1, "用户信息不全");
      }
      return extra.getGoldCoin();
   }
   @Override
   @Transactional
   public Integer receiveGoldCoin(Long uid, Set<Long> idList) throws IntegralTaskRecordException   {
      if(idList == null || idList.size() == 0) {