yj
2020-03-14 a4e4101f3e68aaaeea3e280ad89b20818f40f534
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java
@@ -7,24 +7,27 @@
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.user.vip.UserVIPPreInfoMapper;
import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
import com.yeshi.fanli.exception.user.vip.UserVIPInfoException;
import com.yeshi.fanli.exception.user.vip.UserVIPPreInfoException;
import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
@Service
public class UserVIPPreInfoServiceImpl implements UserVIPPreInfoService {
   @Resource
   private UserVIPPreInfoMapper userVIPPreInfoMapper;
   @Override
   public void addUserVIPPreInfo(UserVIPPreInfo info) throws UserVIPInfoException {
   public void addUserVIPPreInfo(UserVIPPreInfo info) throws UserVIPPreInfoException {
      if (info == null || info.getUid() == null || info.getProcess() == null)
         throw new UserVIPInfoException(1, "信息不完整");
         throw new UserVIPPreInfoException(1, "信息不完整");
      UserVIPPreInfo oldInfo = userVIPPreInfoMapper.selectByUidAndProcess(info.getUid(), info.getProcess());
      if (oldInfo != null)
         throw new UserVIPInfoException(2, "进度已存在");
         throw new UserVIPPreInfoException(2, "进度已存在");
      if (info.getCreateTime() == null)
         info.setCreateTime(new Date());
      userVIPPreInfoMapper.insertSelective(info);