Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李丛阳
education
Commits
27065684
Commit
27065684
authored
Dec 18, 2017
by
YangZhaoJun1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Excel导入开课 同时将课程的章节列表复制到开课的章节列表
parent
67e2c9e8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+4
-1
BSlServiceImpl.java
...org/rcisoft/business/bsl/service/impl/BSlServiceImpl.java
+7
-2
No files found.
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
27065684
...
@@ -177,6 +177,10 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -177,6 +177,10 @@ public class BChapterServiceImpl implements BChapterService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Override
@Override
public
int
addBslFormLesson
(
String
bLseeonId
,
String
lessonCode
,
String
slId
)
{
public
int
addBslFormLesson
(
String
bLseeonId
,
String
lessonCode
,
String
slId
)
{
if
(
bLseeonId
==
null
){
BLesson
bLseeon
=
bLessonRepository
.
queryBLessonByCode
(
lessonCode
);
bLseeonId
=
bLseeon
.
getBusinessId
();
}
//获取课程的章节列表
//获取课程的章节列表
List
<
BChapter
>
lessonList
=
bChapterRepository
.
queryChapterByLessonId
(
bLseeonId
);
List
<
BChapter
>
lessonList
=
bChapterRepository
.
queryChapterByLessonId
(
bLseeonId
);
List
<
BChapter
>
chapterList
=
new
ArrayList
<>();
List
<
BChapter
>
chapterList
=
new
ArrayList
<>();
...
@@ -199,7 +203,6 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -199,7 +203,6 @@ public class BChapterServiceImpl implements BChapterService {
chapterList
.
add
(
sl_chapter
);
chapterList
.
add
(
sl_chapter
);
}
}
for
(
int
i
=
0
;
i
<
chapterList
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
chapterList
.
size
();
i
++){
BChapter
sl_chapter
=
new
BChapter
();
if
(!
chapterList
.
get
(
i
).
getPid
().
equals
(
"-1"
)){
if
(!
chapterList
.
get
(
i
).
getPid
().
equals
(
"-1"
)){
//根据父ID获取父节点章节名称
//根据父ID获取父节点章节名称
String
chapterName
=
bChapterRepository
.
selectChapterNameByPid
(
lessonList
.
get
(
i
).
getPid
());
String
chapterName
=
bChapterRepository
.
selectChapterNameByPid
(
lessonList
.
get
(
i
).
getPid
());
...
...
src/main/java/org/rcisoft/business/bsl/service/impl/BSlServiceImpl.java
View file @
27065684
...
@@ -138,6 +138,7 @@ public class BSlServiceImpl implements BSlService {
...
@@ -138,6 +138,7 @@ public class BSlServiceImpl implements BSlService {
ArrayList
<
String
>
gitlab
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
gitlab
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
termCode
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
termCode
=
new
ArrayList
<
String
>();
List
<
BSl
>
repeatSl
=
new
ArrayList
<>();
List
<
BSl
>
repeatSl
=
new
ArrayList
<>();
Map
map
=
new
HashMap
();
String
[]
headers
=
{
"课序号"
,
"课程编号"
,
"教师工号"
,
"学期编号"
};
String
[]
headers
=
{
"课序号"
,
"课程编号"
,
"教师工号"
,
"学期编号"
};
ArrayList
<
String
[]>
values
=
ExcelUtil
.
importExcel
(
hwb
,
headers
);
//获取excel数据
ArrayList
<
String
[]>
values
=
ExcelUtil
.
importExcel
(
hwb
,
headers
);
//获取excel数据
...
@@ -197,18 +198,22 @@ public class BSlServiceImpl implements BSlService {
...
@@ -197,18 +198,22 @@ public class BSlServiceImpl implements BSlService {
continue;
continue;
}
}
Project project = action.createProject(pName,dto);
Project project = action.createProject(pName,dto);
bSl.setGitLabProjectId(project.getId());
*/
bSl.setGitLabProjectId(project.getId());
String pName = global.getGIT_LAB_PROJECT_PREFIX()+value[0];
String pName = global.getGIT_LAB_PROJECT_PREFIX()+value[0];
bSl
.
setGitLabProjectName
(
pName
);
bSl.setGitLabProjectName(pName);
*/
if
(!
bSls
.
contains
(
bSl
))
{
if
(!
bSls
.
contains
(
bSl
))
{
bSls
.
add
(
bSl
);
bSls
.
add
(
bSl
);
}
}
map
.
put
(
bSl
.
getLessonCode
(),
bSl
.
getBusinessId
());
}
}
}
}
String
result
=
""
;
String
result
=
""
;
if
(
bSls
.
size
()>
0
){
if
(
bSls
.
size
()>
0
){
int
line
=
bSlRepository
.
insertList
(
bSls
);
int
line
=
bSlRepository
.
insertList
(
bSls
);
if
(
line
>
0
){
if
(
line
>
0
){
for
(
int
i
=
0
;
i
<
bSls
.
size
();
i
++){
bChapterService
.
addBslFormLesson
(
null
,
bSls
.
get
(
i
).
getLessonCode
(),
String
.
valueOf
(
map
.
get
(
bSls
.
get
(
i
).
getLessonCode
())));
}
result
=
"成功导入"
+
bSls
.
size
()+
"条数据。"
;
result
=
"成功导入"
+
bSls
.
size
()+
"条数据。"
;
}
else
{
}
else
{
throw
new
ServiceException
(
ResultServiceEnums
.
EXCEL_IMPORT_DB_INSERT_ERROR
);
throw
new
ServiceException
(
ResultServiceEnums
.
EXCEL_IMPORT_DB_INSERT_ERROR
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment