Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jgjy
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
jgjy
Commits
842ff4c0
提交
842ff4c0
authored
8月 01, 2019
作者:
zhouzhigang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
0cbaa774
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
71 行增加
和
0 行删除
+71
-0
FgMajorServiceImpl.java
...zrqx/school/sysuser/service/major/FgMajorServiceImpl.java
+1
-0
FgPublicLessonService.java
...l/sysuser/service/publiclesson/FgPublicLessonService.java
+21
-0
FgPublicLessonServiceImpl.java
...suser/service/publiclesson/FgPublicLessonServiceImpl.java
+49
-0
没有找到文件。
com.zrqx.school.sysuser/src/main/java/com/zrqx/school/sysuser/service/major/FgMajorServiceImpl.java
浏览文件 @
842ff4c0
...
...
@@ -105,6 +105,7 @@ public class FgMajorServiceImpl extends BaseModelServiceImpl<Major,Integer> impl
Major
s
=
new
Major
();
s
.
setName
(
form
.
getName
());
s
.
setRelationId
(
redis
.
getMember
().
getRelationId
());
s
.
setType
(
redis
.
getMember
().
getType
());
Integer
count
=
fgMajorMapper
.
selectCount
(
s
);
if
(
count
>
0
){
log
.
info
(
"FgMajorServiceImpl#isExistName name: "
+
form
.
getName
()
+
"专业名称已存在"
);
...
...
com.zrqx.school.sysuser/src/main/java/com/zrqx/school/sysuser/service/publiclesson/FgPublicLessonService.java
浏览文件 @
842ff4c0
...
...
@@ -92,6 +92,27 @@ public interface FgPublicLessonService extends BaseService<PublicLesson,Integer>
*/
ExportLessonErrVo
importLesson
(
MultipartFile
file
,
Integer
planId
,
String
type
);
/**
* 课程名称校验
* @param form
* @param oldEntity
* @return
* @author zzg
* @date: 2019年8月1日 上午9:28:38
*/
boolean
isExsitName
(
PublicLesson
form
,
PublicLesson
oldEntity
);
/**
* 课程名称校验(导出)
* @param form
* @param oldEntity
* @return
* @author zzg
* @date: 2019年8月1日 上午9:51:41
*/
String
exportCheck
(
String
name
);
}
com.zrqx.school.sysuser/src/main/java/com/zrqx/school/sysuser/service/publiclesson/FgPublicLessonServiceImpl.java
浏览文件 @
842ff4c0
...
...
@@ -188,6 +188,8 @@ public class FgPublicLessonServiceImpl extends BaseModelServiceImpl<PublicLesson
@Override
public
boolean
save
(
FgSavePublicLeesonForm
form
)
{
//课程名称校验
this
.
isExsitName
(
form
,
null
);
form
.
setRelationId
(
redis
.
getMember
().
getRelationId
());
form
.
setType
(
redis
.
getMember
().
getType
());
form
.
setLeesonType
(
PublicLessonClassArrangeRealtionTypeEnum
.
PUBLIC
.
getCode
());
...
...
@@ -242,6 +244,8 @@ public class FgPublicLessonServiceImpl extends BaseModelServiceImpl<PublicLesson
@Override
public
boolean
update
(
FgSavePublicLeesonForm
form
)
{
PublicLesson
entity
=
super
.
notNull
(
form
.
getId
());
//课程名称校验
this
.
isExsitName
(
form
,
entity
);
BeanUtils
.
copyProperties
(
form
,
entity
);
updateByPrimaryKey
(
entity
);
...
...
@@ -373,6 +377,8 @@ public class FgPublicLessonServiceImpl extends BaseModelServiceImpl<PublicLesson
@Override
public
boolean
saveBasic
(
FgSavePublicLeesonForm
form
)
{
//课程名称校验
this
.
isExsitName
(
form
,
null
);
form
.
setRelationId
(
redis
.
getMember
().
getRelationId
());
form
.
setType
(
redis
.
getMember
().
getType
());
form
.
setLeesonType
(
PublicLessonClassArrangeRealtionTypeEnum
.
BASIC
.
getCode
());
...
...
@@ -403,6 +409,8 @@ public class FgPublicLessonServiceImpl extends BaseModelServiceImpl<PublicLesson
@Override
public
boolean
updateBasic
(
FgSavePublicLeesonForm
form
)
{
PublicLesson
entity
=
super
.
notNull
(
form
.
getId
());
//课程名称校验
this
.
isExsitName
(
form
,
entity
);
BeanUtils
.
copyProperties
(
form
,
entity
);
updateByPrimaryKey
(
entity
);
//删除教材和课程安排的关系
...
...
@@ -461,6 +469,13 @@ public class FgPublicLessonServiceImpl extends BaseModelServiceImpl<PublicLesson
list
.
add
(
vo
);
continue
;
}
//课程名称校验
String
msg
=
this
.
exportCheck
(
v
.
getCourseDesign
());
if
(
StringUtils
.
isNotEmpty
(
msg
)){
vo
.
setMsg
(
msg
);
list
.
add
(
vo
);
continue
;
}
newList
.
add
(
v
);
}
//根据教材名称对导入的excel集合进行分组
...
...
@@ -570,6 +585,40 @@ public class FgPublicLessonServiceImpl extends BaseModelServiceImpl<PublicLesson
return
null
;
}
@Override
public
boolean
isExsitName
(
PublicLesson
form
,
PublicLesson
oldEntity
)
{
if
(
StringUtils
.
isBlank
(
form
.
getCourseDesign
()))
{
return
true
;
}
if
(
oldEntity
!=
null
&&
form
.
getCourseDesign
().
equals
(
oldEntity
.
getCourseDesign
()))
{
return
true
;
}
PublicLesson
s
=
new
PublicLesson
();
s
.
setCourseDesign
(
form
.
getCourseDesign
());
s
.
setRelationId
(
redis
.
getMember
().
getRelationId
());
s
.
setType
(
redis
.
getMember
().
getType
());
Integer
count
=
fgPublicLessonMapper
.
selectCount
(
s
);
if
(
count
>
0
){
log
.
info
(
"FgPublicLessonServiceImpl#isExistName name: "
+
form
.
getCourseDesign
()
+
"课程名称已存在"
);
throw
new
BusinessValidateException
(
"课程名称: "
+
form
.
getCourseDesign
()
+
"课程名称已存在"
);
}
return
true
;
}
@Override
public
String
exportCheck
(
String
name
)
{
PublicLesson
s
=
new
PublicLesson
();
s
.
setCourseDesign
(
name
);
s
.
setRelationId
(
redis
.
getMember
().
getRelationId
());
s
.
setType
(
redis
.
getMember
().
getType
());
Integer
count
=
fgPublicLessonMapper
.
selectCount
(
s
);
if
(
count
>
0
){
log
.
info
(
"FgPublicLessonServiceImpl#exportCheck name: "
+
name
+
"课程名称已存在"
);
return
"课程名称: "
+
name
+
"课程名称已存在"
;
}
return
null
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论