yujian
2019-08-21 54b0dd1b6f8230799b0b4490f8b39afdd53a4e4c
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralTaskRecordServiceImpl.java
@@ -131,6 +131,36 @@
   
   @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) {
         throw new IntegralTaskRecordException(1, "id为空");