|
|
@ -42,8 +42,7 @@ public class InviteServieImpl extends ServiceImpl<InviteMapper, Invite> implemen
|
|
|
|
PageHelper.startPage(page, limit);
|
|
|
|
PageHelper.startPage(page, limit);
|
|
|
|
//查询所有课程
|
|
|
|
//查询所有课程
|
|
|
|
List<InviteVo> inviteVoList = inviteMapper.queryInvite();
|
|
|
|
List<InviteVo> inviteVoList = inviteMapper.queryInvite();
|
|
|
|
if (inviteVoList.isEmpty())
|
|
|
|
if (inviteVoList.isEmpty()) {
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new ServiceException("400", "课程数据为空");
|
|
|
|
throw new ServiceException("400", "课程数据为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
PageInfo<InviteVo> pageInfo = new PageInfo<InviteVo>(inviteVoList);
|
|
|
|
PageInfo<InviteVo> pageInfo = new PageInfo<InviteVo>(inviteVoList);
|
|
|
@ -58,6 +57,7 @@ public class InviteServieImpl extends ServiceImpl<InviteMapper, Invite> implemen
|
|
|
|
return inviteVoPageVO;
|
|
|
|
return inviteVoPageVO;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* 根据id查询就业
|
|
|
|
* 根据id查询就业
|
|
|
|
* */
|
|
|
|
* */
|
|
|
@ -80,14 +80,12 @@ public class InviteServieImpl extends ServiceImpl<InviteMapper, Invite> implemen
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int addInvite(InviteVo vo) {
|
|
|
|
public int addInvite(InviteVo vo) {
|
|
|
|
/*判断目录名是否为空*/
|
|
|
|
/*判断目录名是否为空*/
|
|
|
|
if (vo.getInviteName().isEmpty())
|
|
|
|
if (vo.getInviteName().isEmpty()) {
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new ServiceException("400", "就业名不能为空");
|
|
|
|
throw new ServiceException("400", "就业名不能为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//查询就业名称是否已经存在
|
|
|
|
//查询就业名称是否已经存在
|
|
|
|
int count = inviteMapper.selectByName(vo.getInviteName());
|
|
|
|
int count = inviteMapper.selectByName(vo.getInviteName());
|
|
|
|
if (count>0)
|
|
|
|
if (count > 0) {
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new ServiceException("403", "就业名已存在");
|
|
|
|
throw new ServiceException("403", "就业名已存在");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//将vo值传给就业
|
|
|
|
//将vo值传给就业
|
|
|
@ -102,31 +100,27 @@ public class InviteServieImpl extends ServiceImpl<InviteMapper, Invite> implemen
|
|
|
|
invite.setInviteUpdatetime(new Date());
|
|
|
|
invite.setInviteUpdatetime(new Date());
|
|
|
|
//添加就业
|
|
|
|
//添加就业
|
|
|
|
int insert = inviteMapper.insert(invite);
|
|
|
|
int insert = inviteMapper.insert(invite);
|
|
|
|
if (insert>0)
|
|
|
|
if (insert > 0) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return insert;
|
|
|
|
return insert;
|
|
|
|
}else
|
|
|
|
} else {
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new ServiceException("400", "添加就业失败");
|
|
|
|
throw new ServiceException("400", "添加就业失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* 根据id删除数据
|
|
|
|
* 根据id删除数据
|
|
|
|
* */
|
|
|
|
* */
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int delInviteById(Integer id) {
|
|
|
|
public int delInviteById(Integer id) {
|
|
|
|
if (id == null)
|
|
|
|
if (id == null) {
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new ServiceException("400", "查询id值为空");
|
|
|
|
throw new ServiceException("400", "查询id值为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//根据id删除
|
|
|
|
//根据id删除
|
|
|
|
int count = inviteMapper.deleteById(id);
|
|
|
|
int count = inviteMapper.deleteById(id);
|
|
|
|
|
|
|
|
|
|
|
|
if (count>0)
|
|
|
|
if (count > 0) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return count;
|
|
|
|
return count;
|
|
|
|
}else
|
|
|
|
} else {
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new ServiceException("400", "删除失败");
|
|
|
|
throw new ServiceException("400", "删除失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -152,29 +146,25 @@ public class InviteServieImpl extends ServiceImpl<InviteMapper, Invite> implemen
|
|
|
|
invite.setInviteUpdatetime(new Date());
|
|
|
|
invite.setInviteUpdatetime(new Date());
|
|
|
|
//添加download
|
|
|
|
//添加download
|
|
|
|
int updated = inviteMapper.updateDownloadById(invite);
|
|
|
|
int updated = inviteMapper.updateDownloadById(invite);
|
|
|
|
if (updated>0)
|
|
|
|
if (updated > 0) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return updated;
|
|
|
|
return updated;
|
|
|
|
}else
|
|
|
|
} else {
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new ServiceException("400", "更新失败");
|
|
|
|
throw new ServiceException("400", "更新失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*添加目录*/
|
|
|
|
/*添加目录*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void addInviteDirectory(Directory directory) {
|
|
|
|
public void addInviteDirectory(Directory directory) {
|
|
|
|
if (directory.getDirName().isEmpty())
|
|
|
|
if (directory.getDirName().isEmpty()) {
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new ServiceException("400", "目录名称不能为空");
|
|
|
|
throw new ServiceException("400", "目录名称不能为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (directory.getDirImg().isEmpty())
|
|
|
|
if (directory.getDirImg().isEmpty()) {
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new ServiceException("400", "请选择一个icon");
|
|
|
|
throw new ServiceException("400", "请选择一个icon");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Integer count = directoryMapper.selectByName(directory.getDirName(), "8");
|
|
|
|
Integer count = directoryMapper.selectByName(directory.getDirName(), "8");
|
|
|
|
if (count!=null)
|
|
|
|
if (count != null) {
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new ServiceException("400", "目录已存在");
|
|
|
|
throw new ServiceException("400", "目录已存在");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -186,6 +176,7 @@ public class InviteServieImpl extends ServiceImpl<InviteMapper, Invite> implemen
|
|
|
|
directory.setId(uuid);
|
|
|
|
directory.setId(uuid);
|
|
|
|
directoryMapper.addInviteDirectory(directory);
|
|
|
|
directoryMapper.addInviteDirectory(directory);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*查询目录*/
|
|
|
|
/*查询目录*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<DirectoryVo> queryInviteDirectory() {
|
|
|
|
public List<DirectoryVo> queryInviteDirectory() {
|
|
|
|