admin
2025-02-25 30d8e227e8d823b6c38c3b9c90ac2df03b63befe
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponActivateServiceImpl.java
@@ -1,41 +1,54 @@
package com.yeshi.fanli.service.impl.user;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.user.UserSystemCouponActivateMapper;
import com.yeshi.fanli.entity.bus.user.UserSystemCouponActivate;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.user.UserSystemCouponActivateService;
@Service
public class UserSystemCouponActivateServiceImpl implements UserSystemCouponActivateService{
   @Resource
   private UserSystemCouponActivateMapper userSystemCouponActivateMapper;
   @Resource
   private ConfigService configService;
   @Override
   public UserSystemCouponActivate selectForUpdate(Long id) {
      return userSystemCouponActivateMapper.selectForUpdate(id);
   }
   @Override
   public void updateByPrimaryKeySelective(UserSystemCouponActivate record) {
      userSystemCouponActivateMapper.updateByPrimaryKeySelective(record);
   }
   @Override
   public int getActivateCount(Long id) {
      UserSystemCouponActivate coupon = userSystemCouponActivateMapper.selectByPrimaryKey(id);
      if (coupon != null)
         return coupon.getCount();
      return 0;
   }
}
package com.yeshi.fanli.service.impl.user;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.user.UserSystemCouponActivateMapper;
import com.yeshi.fanli.entity.bus.user.UserSystemCouponActivate;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.user.UserSystemCouponActivateService;
@Service
public class UserSystemCouponActivateServiceImpl implements UserSystemCouponActivateService{
   @Resource
   private UserSystemCouponActivateMapper userSystemCouponActivateMapper;
   @Resource
   private ConfigService configService;
   @Override
   public UserSystemCouponActivate selectForUpdate(Long id) {
      return userSystemCouponActivateMapper.selectForUpdate(id);
   }
   @Override
   public void addActivateRecord(Long id) {
      UserSystemCouponActivate record = new UserSystemCouponActivate();
      record.setId(id);
      record.setCount(0);
      record.setState(UserSystemCouponActivate.STATE_INIT);
      record.setCreateTime(new Date());
      record.setUpdateTime(new Date());
      userSystemCouponActivateMapper.insertSelective(record);
   }
   @Override
   public void updateByPrimaryKeySelective(UserSystemCouponActivate record) {
      userSystemCouponActivateMapper.updateByPrimaryKeySelective(record);
   }
   @Override
   public int getActivateCount(Long id) {
      UserSystemCouponActivate coupon = userSystemCouponActivateMapper.selectByPrimaryKey(id);
      if (coupon != null)
         return coupon.getCount();
      return 0;
   }
}