| | |
| | |
|
| | | 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);
|