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
e0aa2e01
Commit
e0aa2e01
authored
May 04, 2018
by
YangZhaoJun1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化开课接口
parent
b3302dbc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
10 deletions
+28
-10
BArrangeServiceImpl.java
...t/business/barrange/service/impl/BArrangeServiceImpl.java
+12
-4
BDirectionRepository.java
...rcisoft/business/bdirection/dao/BDirectionRepository.java
+7
-0
BSlScheduleRepository.java
...isoft/business/bslschedule/dao/BSlScheduleRepository.java
+6
-0
BTermRepository.java
.../java/org/rcisoft/business/bterm/dao/BTermRepository.java
+3
-6
student-class.xls
src/main/resources/excel-template/student-class.xls
+0
-0
No files found.
src/main/java/org/rcisoft/business/barrange/service/impl/BArrangeServiceImpl.java
View file @
e0aa2e01
...
@@ -23,6 +23,7 @@ import org.rcisoft.business.blesson.entity.BLessonDirection;
...
@@ -23,6 +23,7 @@ import org.rcisoft.business.blesson.entity.BLessonDirection;
import
org.rcisoft.business.brooms.dao.BRoomsRepository
;
import
org.rcisoft.business.brooms.dao.BRoomsRepository
;
import
org.rcisoft.business.bsl.dao.BSlRepository
;
import
org.rcisoft.business.bsl.dao.BSlRepository
;
import
org.rcisoft.business.bsl.entity.BSl
;
import
org.rcisoft.business.bsl.entity.BSl
;
import
org.rcisoft.business.bslschedule.dao.BSlScheduleRepository
;
import
org.rcisoft.business.bterm.dao.BTermRepository
;
import
org.rcisoft.business.bterm.dao.BTermRepository
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.exception.ServiceException
;
...
@@ -70,7 +71,7 @@ public class BArrangeServiceImpl implements BArrangeService {
...
@@ -70,7 +71,7 @@ public class BArrangeServiceImpl implements BArrangeService {
private
BDirectionRepository
bDirectionRepository
;
private
BDirectionRepository
bDirectionRepository
;
@Autowired
@Autowired
private
B
ClassRepository
bClass
Repository
;
private
B
SlScheduleRepository
bSlSchedule
Repository
;
@Autowired
@Autowired
private
BRoomsRepository
bRoomsRepository
;
private
BRoomsRepository
bRoomsRepository
;
...
@@ -336,20 +337,24 @@ public class BArrangeServiceImpl implements BArrangeService {
...
@@ -336,20 +337,24 @@ public class BArrangeServiceImpl implements BArrangeService {
throw
new
ServiceException
(
ResultServiceEnums
.
NO_AGENCY_SUBMISSION
);
throw
new
ServiceException
(
ResultServiceEnums
.
NO_AGENCY_SUBMISSION
);
}
}
List
<
BSl
>
sls
=
new
ArrayList
<>();
List
<
BSl
>
sls
=
new
ArrayList
<>();
List
<
BLessonDirection
>
bLessonDirections
=
new
ArrayList
<>();
int
maxSlCode
=
bTermRepository
.
queryMaxSlCodeByTermCode
(
termCode
);
for
(
String
subAgencyId
:
subAgencyIds
){
for
(
String
subAgencyId
:
subAgencyIds
){
//查询要开的课
//查询要开的课
List
<
ScheduleDto
>
schedules
=
bArrangeRepository
.
queryDtoBySubAgencyId
(
subAgencyId
);
List
<
ScheduleDto
>
schedules
=
bArrangeRepository
.
queryDtoBySubAgencyId
(
subAgencyId
);
for
(
ScheduleDto
schedule
:
schedules
){
for
(
ScheduleDto
schedule
:
schedules
){
BSl
sl
=
new
BSl
();
BSl
sl
=
new
BSl
();
//根据lessonCode查询课程信息
BLesson
bLesson
=
bLessonRepository
.
queryBLessonByCode
(
schedule
.
getLessonCode
());
BLesson
bLesson
=
bLessonRepository
.
queryBLessonByCode
(
schedule
.
getLessonCode
());
//学期编号+学期中存放的开课序号最大值+1作为新的开课序号
//学期编号+学期中存放的开课序号最大值+1作为新的开课序号
int
maxSlCode
=
bTermRepository
.
queryMaxSlCodeByTermCode
(
termCode
);
//验证开课序号是否重复
//验证开课序号是否重复
String
slCode
=
""
;
String
slCode
=
""
;
for
(
int
i
=
1
;
i
<
99999
;
i
++){
for
(
int
i
=
1
;
i
<
99999
;
i
++){
slCode
=
termCode
+
String
.
valueOf
(
maxSlCode
+
i
);
slCode
=
termCode
+
String
.
valueOf
(
maxSlCode
+
i
);
if
(
bSlRepository
.
selectOne
(
new
BSl
(
slCode
,
"0"
,
"1"
))==
null
)
if
(
bSlRepository
.
selectOne
(
new
BSl
(
slCode
,
"0"
,
"1"
))==
null
)
maxSlCode
=
maxSlCode
+
i
;
break
;
break
;
}
}
sl
.
setCode
(
slCode
);
//课序号
sl
.
setCode
(
slCode
);
//课序号
...
@@ -362,17 +367,20 @@ public class BArrangeServiceImpl implements BArrangeService {
...
@@ -362,17 +367,20 @@ public class BArrangeServiceImpl implements BArrangeService {
sl
.
setSource
(
"1"
);
sl
.
setSource
(
"1"
);
UserUtil
.
setCurrentPersistOperation
(
sl
);
UserUtil
.
setCurrentPersistOperation
(
sl
);
sls
.
add
(
sl
);
sls
.
add
(
sl
);
bTermRepository
.
MaxSlCodeByTermCode
(
termCode
);
//将该学期的开课序号最大值+1
//修改b_sl_schedule slId
bSlScheduleRepository
.
updateSlIdBySubAgencyId
(
sl
.
getBusinessId
(),
subAgencyId
);
//课程方向
//课程方向
BLessonDirection
bLessonDirection
=
new
BLessonDirection
();
BLessonDirection
bLessonDirection
=
new
BLessonDirection
();
bLessonDirection
.
setBusinessId
(
IdGen
.
uuid
());
bLessonDirection
.
setBusinessId
(
IdGen
.
uuid
());
bLessonDirection
.
setSlId
(
sl
.
getBusinessId
());
bLessonDirection
.
setSlId
(
sl
.
getBusinessId
());
bLessonDirection
.
setDirectionId
(
bLesson
.
getDirectionId
());
bLessonDirection
.
setDirectionId
(
bLesson
.
getDirectionId
());
b
DirectionRepository
.
insertBLessonDirection
(
bLessonDirection
);
b
LessonDirections
.
add
(
bLessonDirection
);
//复制章节及文件目录
//复制章节及文件目录
chapterService
.
addBslFormLesson
(
null
,
sl
.
getLessonCode
(),
sl
.
getBusinessId
());
chapterService
.
addBslFormLesson
(
null
,
sl
.
getLessonCode
(),
sl
.
getBusinessId
());
}
}
bTermRepository
.
MaxSlCodeByTermCode
(
termCode
,
String
.
valueOf
(
maxSlCode
));
//将该学期的开课序号存入
bDirectionRepository
.
insertList
(
bLessonDirections
);
//批量插入课程方向
//批量插入
//批量插入
result
=
bSlRepository
.
insertList
(
sls
);
result
=
bSlRepository
.
insertList
(
sls
);
}
}
...
...
src/main/java/org/rcisoft/business/bdirection/dao/BDirectionRepository.java
View file @
e0aa2e01
...
@@ -46,5 +46,12 @@ public interface BDirectionRepository extends BaseMapper<BDirection> {
...
@@ -46,5 +46,12 @@ public interface BDirectionRepository extends BaseMapper<BDirection> {
@Select
(
"<script>select * from b_direction where name = #{name} and del_flag = 0 and flag = 1 </script>"
)
@Select
(
"<script>select * from b_direction where name = #{name} and del_flag = 0 and flag = 1 </script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
@ResultMap
(
value
=
"BaseResultMap"
)
BDirection
queryDirectionByName
(
String
name
);
BDirection
queryDirectionByName
(
String
name
);
@Insert
(
"<script>INSERT INTO b_lesson_direction"
+
"(business_id,direction_id,sl_id,lession_id)VALUES"
+
"<foreach collection=\"list\" item=\"item\" separator=\",\">"
+
"( #{item.businessId},#{item.directionId},#{item.slId},#{item.lessionId})"
+
"</foreach></script>"
)
int
insertList
(
List
<
BLessonDirection
>
bLessonDirections
);
}
}
src/main/java/org/rcisoft/business/bslschedule/dao/BSlScheduleRepository.java
View file @
e0aa2e01
package
org
.
rcisoft
.
business
.
bslschedule
.
dao
;
package
org
.
rcisoft
.
business
.
bslschedule
.
dao
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Update
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.rcisoft.business.bslschedule.entity.BSlSchedule
;
import
org.rcisoft.business.bslschedule.entity.BSlSchedule
;
import
org.apache.ibatis.annotations.ResultMap
;
import
org.apache.ibatis.annotations.ResultMap
;
import
org.apache.ibatis.annotations.Select
;
import
org.apache.ibatis.annotations.Select
;
import
org.springframework.security.access.method.P
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -38,5 +41,8 @@ public interface BSlScheduleRepository extends BaseMapper<BSlSchedule> {
...
@@ -38,5 +41,8 @@ public interface BSlScheduleRepository extends BaseMapper<BSlSchedule> {
List
<
BSlSchedule
>
queryMoreBSlSchedules
(
String
minTime
,
String
maxTime
,
String
subAgencyId
);
List
<
BSlSchedule
>
queryMoreBSlSchedules
(
String
minTime
,
String
maxTime
,
String
subAgencyId
);
int
insertList
(
List
<
BSlSchedule
>
bSlSchedules
);
int
insertList
(
List
<
BSlSchedule
>
bSlSchedules
);
@Update
(
"update b_sl_schedule set sl_id = #{slId} where sub_agency_id = #{subAgencyId} and del_flag = 0 and glag = 1"
)
int
updateSlIdBySubAgencyId
(
@Param
(
"slId"
)
String
slId
,
@Param
(
"subAgencyId"
)
String
subAgencyId
);
}
}
src/main/java/org/rcisoft/business/bterm/dao/BTermRepository.java
View file @
e0aa2e01
package
org
.
rcisoft
.
business
.
bterm
.
dao
;
package
org
.
rcisoft
.
business
.
bterm
.
dao
;
import
org.apache.ibatis.annotations.Insert
;
import
org.apache.ibatis.annotations.*
;
import
org.apache.ibatis.annotations.Update
;
import
org.rcisoft.business.bterm.entity.BTerm
;
import
org.rcisoft.business.bterm.entity.BTerm
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
org.apache.ibatis.annotations.ResultMap
;
import
org.apache.ibatis.annotations.Select
;
import
java.text.DateFormat
;
import
java.text.DateFormat
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -55,8 +52,8 @@ public interface BTermRepository extends BaseMapper<BTerm> {
...
@@ -55,8 +52,8 @@ public interface BTermRepository extends BaseMapper<BTerm> {
@Select
(
"select max_sl_code from b_term where code = #{termCode}"
)
@Select
(
"select max_sl_code from b_term where code = #{termCode}"
)
int
queryMaxSlCodeByTermCode
(
String
termCode
);
int
queryMaxSlCodeByTermCode
(
String
termCode
);
@Update
(
"update b_term set max_sl_code =
max_sl_code+1
where code = #{termCode} "
)
@Update
(
"update b_term set max_sl_code =
#{maxSlCode}
where code = #{termCode} "
)
int
MaxSlCodeByTermCode
(
String
term
Code
);
int
MaxSlCodeByTermCode
(
@Param
(
"termCode"
)
String
termCode
,
@Param
(
"maxSlCode"
)
String
maxSl
Code
);
/*
/*
...
...
src/main/resources/excel-template/student-class.xls
View file @
e0aa2e01
No preview for this file type
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