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
6db1821a
Commit
6db1821a
authored
Jan 29, 2018
by
YangZhaoJun1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
组卷相关
parent
3eedb71f
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
131 additions
and
51 deletions
+131
-51
BChapterController.java
...soft/business/bchapter/controller/BChapterController.java
+5
-9
BChapterRepository.java
...org/rcisoft/business/bchapter/dao/BChapterRepository.java
+6
-5
BChapter.java
...n/java/org/rcisoft/business/bchapter/entity/BChapter.java
+15
-1
BChapterService.java
...rg/rcisoft/business/bchapter/service/BChapterService.java
+2
-2
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+5
-9
IntellEvaluation.java
...va/org/rcisoft/business/bcode/model/IntellEvaluation.java
+1
-1
BLessonRepository.java
...a/org/rcisoft/business/blesson/dao/BLessonRepository.java
+4
-4
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+2
-2
BSlRepository.java
...main/java/org/rcisoft/business/bsl/dao/BSlRepository.java
+7
-0
TPaperChapterRepository.java
...t/business/tpaperchapter/dao/TPaperChapterRepository.java
+3
-0
TPaperChapterServiceImpl.java
.../tpaperchapter/service/impl/TPaperChapterServiceImpl.java
+32
-14
TQuestionController.java
...ft/business/tquestion/controller/TQuestionController.java
+1
-2
TQuestionOptionsRepository.java
...ft/business/tquestion/dao/TQuestionOptionsRepository.java
+4
-0
TQuestionServiceImpl.java
...business/tquestion/service/impl/TQuestionServiceImpl.java
+16
-2
BChapterMapper.xml
...ources/mapper/business/bchapter/mapper/BChapterMapper.xml
+18
-0
TPaperChapterMapper.xml
...per/business/tpaperchapter/mapper/TPaperChapterMapper.xml
+10
-0
No files found.
src/main/java/org/rcisoft/business/bchapter/controller/BChapterController.java
View file @
6db1821a
...
@@ -7,13 +7,11 @@ import io.swagger.annotations.ApiImplicitParams;
...
@@ -7,13 +7,11 @@ import io.swagger.annotations.ApiImplicitParams;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.map.HashedMap
;
import
org.apache.commons.collections.map.HashedMap
;
import
org.rcisoft.business.bchapter.dao.BChapterRepository
;
import
org.rcisoft.business.bchapter.dto.QueryScoreListDTO
;
import
org.rcisoft.business.bchapter.dto.QueryScoreListDTO
;
import
org.rcisoft.business.bchapter.dto.ScoreInfoDTO
;
import
org.rcisoft.business.bchapter.dto.ScoreInfoDTO
;
import
org.rcisoft.business.bchapter.entity.BChapter
;
import
org.rcisoft.business.bchapter.entity.BChapter
;
import
org.rcisoft.business.bchapter.enums.IsCompleteEnum
;
import
org.rcisoft.business.bchapter.enums.IsCompleteEnum
;
import
org.rcisoft.business.bchapter.service.BChapterService
;
import
org.rcisoft.business.bchapter.service.BChapterService
;
import
org.rcisoft.business.bsl.dao.BSlRepository
;
import
org.rcisoft.business.bsl.service.BSlService
;
import
org.rcisoft.business.bsl.service.BSlService
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.common.controller.PaginationController
;
import
org.rcisoft.common.controller.PaginationController
;
...
@@ -33,7 +31,6 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -33,7 +31,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.context.request.async.WebAsyncTask
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
...
@@ -227,7 +224,7 @@ public class BChapterController extends PaginationController<BChapter> {
...
@@ -227,7 +224,7 @@ public class BChapterController extends PaginationController<BChapter> {
@ApiImplicitParam
(
name
=
"studentCode"
,
value
=
"学生学号"
,
required
=
true
,
dataType
=
"varchar"
)})
@ApiImplicitParam
(
name
=
"studentCode"
,
value
=
"学生学号"
,
required
=
true
,
dataType
=
"varchar"
)})
@PreAuthorize
(
"hasRole('ROLE_1003')"
)
@PreAuthorize
(
"hasRole('ROLE_1003')"
)
@PostMapping
(
value
=
"/complete"
)
@PostMapping
(
value
=
"/complete"
)
public
Result
complete
(
ScoreInfoDTO
scoreInfoDTO
)
{
public
Result
complete
(
ScoreInfoDTO
scoreInfoDTO
)
throws
Exception
{
scoreInfoDTO
.
setIsComplete
(
IsCompleteEnum
.
COMPLETE
.
getCode
());
scoreInfoDTO
.
setIsComplete
(
IsCompleteEnum
.
COMPLETE
.
getCode
());
scoreInfoDTO
.
setStudentId
(
UserUtil
.
getUserInfoProp
(
getToken
(),
UserUtil
.
USER_ID
));
scoreInfoDTO
.
setStudentId
(
UserUtil
.
getUserInfoProp
(
getToken
(),
UserUtil
.
USER_ID
));
bChapterService
.
updateIsComplete
(
scoreInfoDTO
,
getToken
());
bChapterService
.
updateIsComplete
(
scoreInfoDTO
,
getToken
());
...
@@ -374,14 +371,13 @@ public class BChapterController extends PaginationController<BChapter> {
...
@@ -374,14 +371,13 @@ public class BChapterController extends PaginationController<BChapter> {
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"type"
,
value
=
"完成的类型 ppt是1 pdf是2 video是3"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"type"
,
value
=
"完成的类型 ppt是1 pdf是2 video是3"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"chapterId"
,
value
=
"章节id"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"chapterId"
,
value
=
"章节id"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"studentCode"
,
value
=
"学号"
,
required
=
true
,
dataType
=
"varchar"
)})
@ApiImplicitParam
(
name
=
"studentCode"
,
value
=
"学号"
,
required
=
true
,
dataType
=
"varchar"
)})
@PreAuthorize
(
"hasRole('ROLE_100
1
')"
)
@PreAuthorize
(
"hasRole('ROLE_100
3
')"
)
@PostMapping
(
value
=
"/updateToFinish"
)
@PostMapping
(
value
=
"/updateToFinish"
)
public
Result
u
(
String
type
,
String
chapterId
,
String
code
)
{
public
Result
u
(
String
type
,
String
chapterId
,
String
studentCode
)
{
String
stuId
=
bChapterService
.
queryStuIdByCode
(
code
);
int
data
=
bChapterService
.
updateToFinish
(
type
,
studentCode
,
chapterId
);
int
data
=
bChapterService
.
updateToFinish
(
type
,
stuId
,
chapterId
);
return
Result
.
builder
(
new
PersistModel
(
data
),
return
Result
.
builder
(
new
PersistModel
(
data
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
c
ode
);
studentC
ode
);
}
}
}
}
src/main/java/org/rcisoft/business/bchapter/dao/BChapterRepository.java
View file @
6db1821a
...
@@ -48,11 +48,12 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
...
@@ -48,11 +48,12 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
" bf.file_url AS fileUrl,\n"
+
" bf.file_url AS fileUrl,\n"
+
" bf.ppt_url AS pptUrl,\n"
+
" bf.ppt_url AS pptUrl,\n"
+
" bf.pdf_url AS pdfUrl,\n"
+
" bf.pdf_url AS pdfUrl,\n"
+
" pc.business_id AS paperUrl,"
+
" (SELECT count(*) FROM b_r_student_chapter brs WHERE brs.chapter_id = bc.business_id AND brs.score = - 1) AS studentNum \n"
+
" (SELECT count(*) FROM b_r_student_chapter brs WHERE brs.chapter_id = bc.business_id AND brs.score = - 1) AS studentNum \n"
+
" FROM\n"
+
" FROM\n"
+
" b_chapter bc\n"
+
" b_chapter bc\n"
+
" LEFT JOIN b_file bf ON bf.chapter_id = bc.business_id "
+
" LEFT JOIN b_file bf ON bf.chapter_id = bc.business_id "
+
"
\n
"
+
"
LEFT JOIN t_paper_chapter pc on pc.chap_id = bc.business_id
"
+
" WHERE\n"
+
" WHERE\n"
+
" bc.del_flag = 0\n"
+
" bc.del_flag = 0\n"
+
" AND bc.pid = #{pid}\n"
+
" AND bc.pid = #{pid}\n"
+
...
@@ -309,10 +310,10 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
...
@@ -309,10 +310,10 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
@Update
(
"<script>update b_r_student_chapter\n"
+
@Update
(
"<script>update b_r_student_chapter\n"
+
"<if test=\"type !=null and type != '' and type
== 1 \"> set ppt_finish = 1
</if>"
+
"<if test=\"type !=null and type != '' and type
.equals('1') \"> set ppt_finish = '1'
</if>"
+
"<if test=\"type !=null and type != '' and type
== 2 \"> set pdf_finish = 1
</if>"
+
"<if test=\"type !=null and type != '' and type
.equals('2') \"> set pdf_finish = '1'
</if>"
+
"<if test=\"type !=null and type != '' and type
== 3 \"> set video_finish = 1
</if>"
+
"<if test=\"type !=null and type != '' and type
.equals('3') \"> set video_finish = '1'
</if>"
+
"where student_id = #{stuId} and chapter_id = #{chapterId} </script>"
)
"where student_id = #{stuId} and chapter_id = #{chapterId} </script>"
)
int
updateToFinish
(
@Param
(
"stuId"
)
String
stuId
,
@Param
(
"type"
)
String
type
,
@Param
(
"chapterId"
)
String
chapterId
);
int
updateToFinish
(
@Param
(
"stuId"
)
String
stuId
,
@Param
(
"type"
)
String
type
,
@Param
(
"chapterId"
)
String
chapterId
);
}
}
src/main/java/org/rcisoft/business/bchapter/entity/BChapter.java
View file @
6db1821a
...
@@ -31,7 +31,6 @@ public class BChapter extends IdEntity<BChapter> {
...
@@ -31,7 +31,6 @@ public class BChapter extends IdEntity<BChapter> {
//@NotEmpty(message = "开课id必填")
//@NotEmpty(message = "开课id必填")
private
String
slId
;
private
String
slId
;
/*章节名称*/
/*章节名称*/
@NotEmpty
(
message
=
"章节名称必填"
)
@Length
(
min
=
1
,
max
=
50
,
message
=
"长度最小为1,最大为50"
)
@Length
(
min
=
1
,
max
=
50
,
message
=
"长度最小为1,最大为50"
)
private
String
chapterName
;
private
String
chapterName
;
/*等级*/
/*等级*/
...
@@ -111,6 +110,21 @@ public class BChapter extends IdEntity<BChapter> {
...
@@ -111,6 +110,21 @@ public class BChapter extends IdEntity<BChapter> {
@Transient
@Transient
private
String
type
;
private
String
type
;
@Transient
private
String
pptFinish
;
@Transient
private
String
pdfFinish
;
@Transient
private
String
videoFinish
;
@Transient
private
String
paperFinish
;
@Transient
private
String
paperUrl
;
public
BChapter
(
String
businessId
)
{
public
BChapter
(
String
businessId
)
{
this
.
businessId
=
businessId
;
this
.
businessId
=
businessId
;
...
...
src/main/java/org/rcisoft/business/bchapter/service/BChapterService.java
View file @
6db1821a
...
@@ -90,7 +90,7 @@ public interface BChapterService{
...
@@ -90,7 +90,7 @@ public interface BChapterService{
* 更新已经完成状态
* 更新已经完成状态
* @param scoreInfoDTO
* @param scoreInfoDTO
*/
*/
void
updateIsComplete
(
ScoreInfoDTO
scoreInfoDTO
,
String
token
);
void
updateIsComplete
(
ScoreInfoDTO
scoreInfoDTO
,
String
token
)
throws
Exception
;
int
addBslFormLesson
(
String
bLseeonId
,
String
lessonCode
,
String
businessId
);
int
addBslFormLesson
(
String
bLseeonId
,
String
lessonCode
,
String
businessId
);
...
@@ -116,5 +116,5 @@ public interface BChapterService{
...
@@ -116,5 +116,5 @@ public interface BChapterService{
String
queryStuIdByCode
(
String
code
);
String
queryStuIdByCode
(
String
code
);
int
updateToFinish
(
String
type
,
String
stu
Id
,
String
chapterId
);
int
updateToFinish
(
String
type
,
String
stu
dentCode
,
String
chapterId
);
}
}
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
6db1821a
...
@@ -193,11 +193,9 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -193,11 +193,9 @@ public class BChapterServiceImpl implements BChapterService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Override
@Override
public
void
updateIsComplete
(
ScoreInfoDTO
scoreInfoDTO
,
String
token
)
{
public
void
updateIsComplete
(
ScoreInfoDTO
scoreInfoDTO
,
String
token
)
throws
Exception
{
try
{
String
stuid
=
bStudentRepository
.
queryStudentByUserId
(
scoreInfoDTO
.
getStudentId
());
String
stuid
=
bStudentRepository
.
queryStudentByUserId
(
scoreInfoDTO
.
getStudentId
());
scoreInfoDTO
.
setStudentId
(
stuid
);
if
(
bChapterRepository
.
selectIdByStudentIdAndChapterId
(
scoreInfoDTO
.
getChapterId
(),
stuid
)!=
null
)
if
(
bChapterRepository
.
selectIdByStudentIdAndChapterId
(
scoreInfoDTO
.
getChapterId
(),
scoreInfoDTO
.
getStudentId
())!=
null
)
return
;
return
;
scoreInfoDTO
.
setCommonBusinessId
();
scoreInfoDTO
.
setCommonBusinessId
();
UserUtil
.
setCurrentMergeOperation
(
scoreInfoDTO
);
UserUtil
.
setCurrentMergeOperation
(
scoreInfoDTO
);
...
@@ -220,16 +218,13 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -220,16 +218,13 @@ public class BChapterServiceImpl implements BChapterService {
scoreInfoDTO
.
setScore
(
score
);
scoreInfoDTO
.
setScore
(
score
);
}
}
scoreInfoDTO
.
setStudentId
(
stuid
);
int
result
=
bChapterRepository
.
updateIsComplete
(
scoreInfoDTO
);
int
result
=
bChapterRepository
.
updateIsComplete
(
scoreInfoDTO
);
if
(
bChapter
.
getExperimentType
().
equals
(
"2"
)||
bChapter
.
getExperimentType
().
equals
(
"4"
)){
if
(
bChapter
.
getExperimentType
().
equals
(
"2"
)||
bChapter
.
getExperimentType
().
equals
(
"4"
)){
}
}
if
(
result
<
1
)
if
(
result
<
1
)
throw
new
ServiceException
(
ResultServiceEnums
.
UPDATE_ERROR
);
throw
new
ServiceException
(
ResultServiceEnums
.
UPDATE_ERROR
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
...
@@ -512,7 +507,8 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -512,7 +507,8 @@ public class BChapterServiceImpl implements BChapterService {
}
}
@Override
@Override
public
int
updateToFinish
(
String
type
,
String
stuId
,
String
chapterId
)
{
public
int
updateToFinish
(
String
type
,
String
studentCode
,
String
chapterId
)
{
String
stuId
=
bChapterRepository
.
queryStuIdByCode
(
studentCode
);
return
bChapterRepository
.
updateToFinish
(
stuId
,
type
,
chapterId
);
return
bChapterRepository
.
updateToFinish
(
stuId
,
type
,
chapterId
);
}
}
...
...
src/main/java/org/rcisoft/business/bcode/model/IntellEvaluation.java
View file @
6db1821a
...
@@ -33,7 +33,7 @@ public class IntellEvaluation {
...
@@ -33,7 +33,7 @@ public class IntellEvaluation {
//java单文件
//java单文件
File
file
=
new
File
(
filePath
+
studentCode
+
".java"
);
File
file
=
new
File
(
filePath
+
studentCode
+
".java"
);
if
(!
file
.
exists
()){
if
(!
file
.
exists
()){
throw
new
ServiceException
(
ResultServiceEnums
.
PASSWORD_ERROR
);
throw
new
ServiceException
(
ResultServiceEnums
.
STUDENT_CODE_NOT_EXISTS
);
}
}
content
=
FileUtils
.
readFileToString
(
file
);
content
=
FileUtils
.
readFileToString
(
file
);
score
=
getJavaSingleScore
(
content
);
score
=
getJavaSingleScore
(
content
);
...
...
src/main/java/org/rcisoft/business/blesson/dao/BLessonRepository.java
View file @
6db1821a
...
@@ -30,11 +30,11 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
...
@@ -30,11 +30,11 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
"left join b_lesson_direction bld on bld.lession_id = b.business_id "
+
"left join b_lesson_direction bld on bld.lession_id = b.business_id "
+
"left join b_direction bd on bd.business_id = bld.direction_id "
+
"left join b_direction bd on bd.business_id = bld.direction_id "
+
"where b.del_flag != 1 and b.flag = 1 "
+
"where b.del_flag != 1 and b.flag = 1 "
+
"<if test=\"
name!=null and name != ''\">and b.`lesson_name` like #{name}
</if>"
+
"<if test=\"
lessonName!=null and lessonName != ''\">and b.`lesson_name` like LIKE CONCAT('%',#{lessonName},'%')
</if>"
+
"<if test=\"directionId!=null and directionId != ''\">and bld.direction
I
d = #{directionId}</if>"
+
"<if test=\"directionId!=null and directionId != ''\">and bld.direction
_i
d = #{directionId}</if>"
+
"<if test=\"code!=null and code != ''\">and b.`code` like
#{code}
</if></script>"
)
"<if test=\"code!=null and code != ''\">and b.`code` like
LIKE CONCAT('%',#{code},'%')
</if></script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BLesson
>
queryBLessons
(
Map
<
String
,
Object
>
param
);
List
<
BLesson
>
queryBLessons
(
BLesson
param
);
@Select
(
"<script>select bl.*,bld.direction_id as directionId from b_lesson bl "
+
@Select
(
"<script>select bl.*,bld.direction_id as directionId from b_lesson bl "
+
"left join b_lesson_direction bld on bl.business_id = bld.lession_id "
+
"left join b_lesson_direction bld on bl.business_id = bld.lession_id "
+
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
6db1821a
...
@@ -64,12 +64,12 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -64,12 +64,12 @@ public class BLessonServiceImpl implements BLessonService {
@Override
@Override
public
List
<
BLesson
>
queryBLessonsByPagination
(
PageUtil
pageUtil
,
BLesson
model
)
{
public
List
<
BLesson
>
queryBLessonsByPagination
(
PageUtil
pageUtil
,
BLesson
model
)
{
return
bLessonRepository
.
queryBLessons
(
queryParamHandler
(
model
)
);
return
bLessonRepository
.
queryBLessons
(
model
);
}
}
@Override
@Override
public
List
<
BLesson
>
queryBLessons
(
BLesson
model
)
{
public
List
<
BLesson
>
queryBLessons
(
BLesson
model
)
{
return
bLessonRepository
.
queryBLessons
(
queryParamHandler
(
model
)
);
return
bLessonRepository
.
queryBLessons
(
model
);
}
}
...
...
src/main/java/org/rcisoft/business/bsl/dao/BSlRepository.java
View file @
6db1821a
...
@@ -252,6 +252,13 @@ public interface BSlRepository extends BaseMapper<BSl> {
...
@@ -252,6 +252,13 @@ public interface BSlRepository extends BaseMapper<BSl> {
@ResultMap
(
value
=
"BaseResultMap"
)
@ResultMap
(
value
=
"BaseResultMap"
)
BSl
queryBSlById
(
String
slId
);
BSl
queryBSlById
(
String
slId
);
@Select
(
"select count(brs.student_code) AS studentNum "
+
"from b_sl sl "
+
"LEFT JOIN b_r_sl_student brs on sl.`code` = brs.sl_code "
+
"where sl.business_id = #{slId}"
)
int
queryStudentNumById
(
String
slId
);
//List<BStudent> querySlStudentByPagination(String slId);
//List<BStudent> querySlStudentByPagination(String slId);
}
}
src/main/java/org/rcisoft/business/tpaperchapter/dao/TPaperChapterRepository.java
View file @
6db1821a
...
@@ -8,6 +8,7 @@ import org.springframework.stereotype.Repository;
...
@@ -8,6 +8,7 @@ import org.springframework.stereotype.Repository;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* Created with yangzhaojun on 2018-1-15 19:49:07.
* Created with yangzhaojun on 2018-1-15 19:49:07.
...
@@ -25,5 +26,7 @@ public interface TPaperChapterRepository extends BaseMapper<TPaperChapter> {
...
@@ -25,5 +26,7 @@ public interface TPaperChapterRepository extends BaseMapper<TPaperChapter> {
+
"</script>"
)
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
TPaperChapter
>
queryTPaperChapters
(
TPaperChapter
tPaperChapter
);
List
<
TPaperChapter
>
queryTPaperChapters
(
TPaperChapter
tPaperChapter
);
void
logicPaperProcedure
(
Map
<
String
,
Object
>
map
);
}
}
src/main/java/org/rcisoft/business/tpaperchapter/service/impl/TPaperChapterServiceImpl.java
View file @
6db1821a
package
org
.
rcisoft
.
business
.
tpaperchapter
.
service
.
impl
;
package
org
.
rcisoft
.
business
.
tpaperchapter
.
service
.
impl
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
org.apache.commons.collections.map.HashedMap
;
import
org.rcisoft.business.bsl.dao.BSlRepository
;
import
org.rcisoft.business.tpaper.dao.TPaperDetailRepository
;
import
org.rcisoft.business.tpaper.dao.TPaperDetailRepository
;
import
org.rcisoft.business.tpaper.dao.TPaperRepository
;
import
org.rcisoft.business.tpaper.dao.TPaperRepository
;
import
org.rcisoft.business.tpaper.dao.TPaperSectionRepository
;
import
org.rcisoft.business.tpaper.dao.TPaperSectionRepository
;
...
@@ -55,6 +57,9 @@ public class TPaperChapterServiceImpl implements TPaperChapterService {
...
@@ -55,6 +57,9 @@ public class TPaperChapterServiceImpl implements TPaperChapterService {
@Autowired
@Autowired
private
TPaperDetailRepository
tPaperDetailRepository
;
private
TPaperDetailRepository
tPaperDetailRepository
;
@Autowired
private
BSlRepository
bSlRepository
;
/**
/**
* 保存 tPaperChapter
* 保存 tPaperChapter
...
@@ -67,42 +72,47 @@ public class TPaperChapterServiceImpl implements TPaperChapterService {
...
@@ -67,42 +72,47 @@ public class TPaperChapterServiceImpl implements TPaperChapterService {
//增加操作
//增加操作
UserUtil
.
setCurrentPersistOperation
(
tPaperChapter
);
UserUtil
.
setCurrentPersistOperation
(
tPaperChapter
);
int
line
=
tPaperChapterRepository
.
insertSelective
(
tPaperChapter
);
int
line
=
tPaperChapterRepository
.
insertSelective
(
tPaperChapter
);
List
<
TPaperChapterSection
>
tPaperChapterSections
=
new
ArrayList
<>();
Gson
gson
=
new
Gson
();
Map
<
String
,
Object
>
pcompose
=
new
HashMap
<
String
,
Object
>();
pcompose
=
gson
.
fromJson
(
tPaperChapter
.
getPcompose
(),
pcompose
.
getClass
());
for
(
int
i
=
0
;
i
<
pcompose
.
size
();
i
++){
String
key
=
String
.
valueOf
(
i
+
1
);
//记录题型及数量
TPaperChapterSection
tPaperChapterSection
=
new
TPaperChapterSection
();
tPaperChapterSection
.
setPcId
(
tPaperChapter
.
getBusinessId
());
tPaperChapterSection
.
setQType
(
key
);
tPaperChapterSection
.
setQNum
(
Double
.
valueOf
(
String
.
valueOf
(
pcompose
.
get
(
key
))).
intValue
());
tPaperChapterSections
.
add
(
tPaperChapterSection
);
}
tPaperChapterSectionRepository
.
insertList
(
tPaperChapterSections
);
if
(
tPaperChapter
.
getPoption
().
equals
(
"2"
)){
if
(
tPaperChapter
.
getPoption
().
equals
(
"2"
)){
//自主选题
//自主选题
//1.添加试卷表信息
//1.添加试卷表信息
TPaper
tPaper
=
new
TPaper
();
TPaper
tPaper
=
new
TPaper
();
tPaper
.
setChapId
(
tPaperChapter
.
getChapId
());
tPaper
.
setChapId
(
tPaperChapter
.
getChapId
());
tPaper
.
setPcId
(
tPaperChapter
.
getBusinessId
());
tPaper
.
setPcId
(
tPaperChapter
.
getBusinessId
());
tPaper
.
setStatus
(
"1"
);
//
tPaper.setStatus("1");
tPaperRepository
.
insertSelective
(
tPaper
);
tPaperRepository
.
insertSelective
(
tPaper
);
//2.添加大题表信息 记录题型及数量
//2.添加大题表信息 记录题型及数量
List
<
TPaperSection
>
tPaperSections
=
new
ArrayList
<>();
List
<
TPaperSection
>
tPaperSections
=
new
ArrayList
<>();
List
<
TPaperChapterSection
>
tPaperChapterSections
=
new
ArrayList
<>();
//得到试卷ID
//得到试卷ID
TPaper
pid
=
tPaperRepository
.
selectOne
(
tPaper
);
TPaper
pid
=
tPaperRepository
.
selectOne
(
tPaper
);
//数据转为map
//数据转为map
Gson
gson
=
new
Gson
();
for
(
int
i
=
0
;
i
<
pcompose
.
size
();
i
++){
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
=
gson
.
fromJson
(
tPaperChapter
.
getPcompose
(),
map
.
getClass
());
for
(
int
i
=
0
;
i
<
map
.
size
();
i
++){
String
key
=
String
.
valueOf
(
i
+
1
);
String
key
=
String
.
valueOf
(
i
+
1
);
TPaperSection
tPaperSection
=
new
TPaperSection
();
TPaperSection
tPaperSection
=
new
TPaperSection
();
tPaperSection
.
setPId
(
String
.
valueOf
(
pid
.
getBusinessId
()));
tPaperSection
.
setPId
(
String
.
valueOf
(
pid
.
getBusinessId
()));
tPaperSection
.
setQType
(
key
);
tPaperSection
.
setQType
(
key
);
tPaperSection
.
setSorder
(
i
+
1
);
tPaperSection
.
setSorder
(
i
+
1
);
tPaperSections
.
add
(
tPaperSection
);
tPaperSections
.
add
(
tPaperSection
);
//记录题型及数量
TPaperChapterSection
tPaperChapterSection
=
new
TPaperChapterSection
();
tPaperChapterSection
.
setPcId
(
tPaperChapter
.
getBusinessId
());
tPaperChapterSection
.
setQType
(
key
);
tPaperChapterSection
.
setQNum
(
Double
.
valueOf
(
String
.
valueOf
(
map
.
get
(
key
))).
intValue
());
tPaperChapterSections
.
add
(
tPaperChapterSection
);
}
}
//插入数据库
//插入数据库
tPaperSectionRepository
.
insertList
(
tPaperSections
);
tPaperSectionRepository
.
insertList
(
tPaperSections
);
tPaperChapterSectionRepository
.
insertList
(
tPaperChapterSections
);
//3.添加小题表信息
//3.添加小题表信息
List
<
TPaperDetail
>
tPaperDetails
=
new
ArrayList
<>();
List
<
TPaperDetail
>
tPaperDetails
=
new
ArrayList
<>();
...
@@ -142,6 +152,14 @@ public class TPaperChapterServiceImpl implements TPaperChapterService {
...
@@ -142,6 +152,14 @@ public class TPaperChapterServiceImpl implements TPaperChapterService {
}
else
{
}
else
{
//随机生成
//随机生成
int
plan_count
=
bSlRepository
.
queryStudentNumById
(
tPaperChapter
.
getSlId
());
Map
<
String
,
Object
>
map
=
new
HashedMap
();
map
.
put
(
"planId"
,
tPaperChapter
.
getBusinessId
());
map
.
put
(
"plan_type"
,
Integer
.
parseInt
(
tPaperChapter
.
getPscope
()));
map
.
put
(
"slId"
,
tPaperChapter
.
getSlId
());
map
.
put
(
"chid"
,
tPaperChapter
.
getChapId
());
map
.
put
(
"plan_count"
,
plan_count
);
tPaperChapterRepository
.
logicPaperProcedure
(
map
);
}
}
return
new
PersistModel
(
line
);
return
new
PersistModel
(
line
);
}
}
...
...
src/main/java/org/rcisoft/business/tquestion/controller/TQuestionController.java
View file @
6db1821a
...
@@ -156,11 +156,10 @@ public class TQuestionController extends PaginationController<TQuestion> {
...
@@ -156,11 +156,10 @@ public class TQuestionController extends PaginationController<TQuestion> {
@GetMapping
(
value
=
"/queryQuestionsByChap_IdAndQtype"
)
@GetMapping
(
value
=
"/queryQuestionsByChap_IdAndQtype"
)
public
Result
queryBChapters
(
String
chapterId
)
{
public
Result
queryBChapters
(
String
chapterId
)
{
Map
<
String
,
Object
>
map
=
new
HashedMap
();
Map
<
String
,
Object
>
map
=
new
HashedMap
();
String
num
=
""
;
map
.
put
(
"ChoiceList"
,
tQuestionServiceImpl
.
queryQuestionsByChap_IdAndQtype
(
chapterId
,
"1"
));
map
.
put
(
"ChoiceList"
,
tQuestionServiceImpl
.
queryQuestionsByChap_IdAndQtype
(
chapterId
,
"1"
));
map
.
put
(
"MultiSelectList"
,
tQuestionServiceImpl
.
queryQuestionsByChap_IdAndQtype
(
chapterId
,
"2"
));
map
.
put
(
"MultiSelectList"
,
tQuestionServiceImpl
.
queryQuestionsByChap_IdAndQtype
(
chapterId
,
"2"
));
map
.
put
(
"JudgmentList"
,
tQuestionServiceImpl
.
queryQuestionsByChap_IdAndQtype
(
chapterId
,
"3"
));
map
.
put
(
"JudgmentList"
,
tQuestionServiceImpl
.
queryQuestionsByChap_IdAndQtype
(
chapterId
,
"3"
));
num
=
"NumOfChoice : "
+
tQuestionServiceImpl
.
queryNumByType
(
"1"
)+
String
num
=
"NumOfChoice : "
+
tQuestionServiceImpl
.
queryNumByType
(
"1"
)+
"NumOfMultiSelect : "
+
tQuestionServiceImpl
.
queryNumByType
(
"2"
)+
"NumOfMultiSelect : "
+
tQuestionServiceImpl
.
queryNumByType
(
"2"
)+
"NumOfJudgment : "
+
tQuestionServiceImpl
.
queryNumByType
(
"3"
);
"NumOfJudgment : "
+
tQuestionServiceImpl
.
queryNumByType
(
"3"
);
map
.
put
(
"Num"
,
num
);
map
.
put
(
"Num"
,
num
);
...
...
src/main/java/org/rcisoft/business/tquestion/dao/TQuestionOptionsRepository.java
View file @
6db1821a
package
org
.
rcisoft
.
business
.
tquestion
.
dao
;
package
org
.
rcisoft
.
business
.
tquestion
.
dao
;
import
org.apache.ibatis.annotations.Delete
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
org.rcisoft.business.tquestion.entity.TQuestionOptions
;
import
org.rcisoft.business.tquestion.entity.TQuestionOptions
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.rcisoft.core.base.BaseMapper
;
...
@@ -26,5 +27,8 @@ public interface TQuestionOptionsRepository extends BaseMapper<TQuestionOptions>
...
@@ -26,5 +27,8 @@ public interface TQuestionOptionsRepository extends BaseMapper<TQuestionOptions>
+
"</script>"
)
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
TQuestionOptions
>
queryTQuestionOptions
(
@Param
(
"qid"
)
String
qid
);
List
<
TQuestionOptions
>
queryTQuestionOptions
(
@Param
(
"qid"
)
String
qid
);
@Delete
(
"delete from t_question_options where qid = #{qid}"
)
int
deleteByQId
(
String
qid
);
}
}
src/main/java/org/rcisoft/business/tquestion/service/impl/TQuestionServiceImpl.java
View file @
6db1821a
...
@@ -99,8 +99,22 @@ public class TQuestionServiceImpl implements TQuestionService {
...
@@ -99,8 +99,22 @@ public class TQuestionServiceImpl implements TQuestionService {
public
PersistModel
merge
(
TQuestion
tQuestion
){
public
PersistModel
merge
(
TQuestion
tQuestion
){
UserUtil
.
setCurrentMergeOperation
(
tQuestion
);
UserUtil
.
setCurrentMergeOperation
(
tQuestion
);
int
line
=
tQuestionRepository
.
updateByPrimaryKeySelective
(
tQuestion
);
int
line
=
tQuestionRepository
.
updateByPrimaryKeySelective
(
tQuestion
);
/*log.info(UserUtil.getUserInfoProp(tQuestion.getToken(),UserUtil.USER_USERNAME)+"修改了ID为"+
//修改选项信息
tQuestion.getBusinessId()+"的信息");*/
List
<
TQuestionOptions
>
options
=
new
ArrayList
<>();
if
(!
tQuestion
.
getQtype
().
equals
(
"3"
)){
tQuestionOptionsRepository
.
deleteByQId
(
tQuestion
.
getBusinessId
());
int
i
=
0
;
for
(
String
option
:
tQuestion
.
getQuestionOptions
().
split
(
","
)){
TQuestionOptions
TOptions
=
new
TQuestionOptions
();
TOptions
.
setCommonBusinessId
();
TOptions
.
setQid
(
tQuestion
.
getBusinessId
());
TOptions
.
setAlias
(
String
.
valueOf
(
i
));
TOptions
.
setRepresent
(
option
);
options
.
add
(
TOptions
);
i
++;
}
tQuestionRepository
.
insertOptionsList
(
options
);
}
return
new
PersistModel
(
line
);
return
new
PersistModel
(
line
);
}
}
...
...
src/main/resources/mapper/business/bchapter/mapper/BChapterMapper.xml
View file @
6db1821a
...
@@ -49,14 +49,32 @@
...
@@ -49,14 +49,32 @@
bf.file_url AS fileUrl,
bf.file_url AS fileUrl,
bf.ppt_url AS pptUrl,
bf.ppt_url AS pptUrl,
bf.pdf_url AS pdfUrl,
bf.pdf_url AS pdfUrl,
pc.business_id AS paperUrl,
IFNULL((select is_complete from b_r_student_chapter brs
IFNULL((select is_complete from b_r_student_chapter brs
LEFT JOIN b_student bs on brs.student_id = bs.business_id
LEFT JOIN b_student bs on brs.student_id = bs.business_id
LEFT JOIN s_user su on bs.`code` = su.login_name
LEFT JOIN s_user su on bs.`code` = su.login_name
WHERE brs.chapter_id = bc.business_id AND su.business_id = #{studentId}),0) as isComplete,
WHERE brs.chapter_id = bc.business_id AND su.business_id = #{studentId}),0) as isComplete,
IFNULL((select ppt_finish from b_r_student_chapter brs
LEFT JOIN b_student bs on brs.student_id = bs.business_id
LEFT JOIN s_user su on bs.`code` = su.login_name
WHERE brs.chapter_id = bc.business_id AND su.business_id = #{studentId}),0) as pptFinish,
IFNULL((select pdf_finish from b_r_student_chapter brs
LEFT JOIN b_student bs on brs.student_id = bs.business_id
LEFT JOIN s_user su on bs.`code` = su.login_name
WHERE brs.chapter_id = bc.business_id AND su.business_id = #{studentId}),0) as pdfFinish,
IFNULL((select video_finish from b_r_student_chapter brs
LEFT JOIN b_student bs on brs.student_id = bs.business_id
LEFT JOIN s_user su on bs.`code` = su.login_name
WHERE brs.chapter_id = bc.business_id AND su.business_id = #{studentId}),0) as videoFinish,
IFNULL((select paper_finish from b_r_student_chapter brs
LEFT JOIN b_student bs on brs.student_id = bs.business_id
LEFT JOIN s_user su on bs.`code` = su.login_name
WHERE brs.chapter_id = bc.business_id AND su.business_id = #{studentId}),0) as paperFinish,
(SELECT count(*) FROM b_r_student_chapter brs WHERE brs.chapter_id = bc.business_id AND brs.score = - 1) AS studentNum
(SELECT count(*) FROM b_r_student_chapter brs WHERE brs.chapter_id = bc.business_id AND brs.score = - 1) AS studentNum
FROM
FROM
b_chapter bc
b_chapter bc
LEFT JOIN b_file bf ON bf.chapter_id = bc.business_id
LEFT JOIN b_file bf ON bf.chapter_id = bc.business_id
LEFT JOIN t_paper_chapter pc on pc.chap_id = bc.business_id
WHERE
WHERE
bc.del_flag = 0
bc.del_flag = 0
AND bc.pid = #{paId}
AND bc.pid = #{paId}
...
...
src/main/resources/mapper/business/tpaperchapter/mapper/TPaperChapterMapper.xml
View file @
6db1821a
...
@@ -19,5 +19,15 @@
...
@@ -19,5 +19,15 @@
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
</resultMap>
</resultMap>
<select
id=
"logicPaperProcedure"
statementType=
"CALLABLE"
>
call logic_paper_procedure(#{planId,jdbcType=VARCHAR,mode=IN},
#{plan_count,jdbcType=INTEGER,mode=IN},
#{plan_type,jdbcType=INTEGER,mode=IN},
#{slId,jdbcType=VARCHAR,mode=IN},
#{chid,jdbcType=VARCHAR,mode=IN}
);
</select>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
</mapper>
</mapper>
\ No newline at end of file
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