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
56b5ba0b
Commit
56b5ba0b
authored
Jan 25, 2018
by
YangZhaoJun1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
试题
parent
ca45fd15
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
59 additions
and
40 deletions
+59
-40
BChapterController.java
...soft/business/bchapter/controller/BChapterController.java
+11
-0
BChapterRepository.java
...org/rcisoft/business/bchapter/dao/BChapterRepository.java
+8
-0
BChapterService.java
...rg/rcisoft/business/bchapter/service/BChapterService.java
+2
-0
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+5
-0
BFileServiceImpl.java
...rcisoft/business/bfile/service/impl/BFileServiceImpl.java
+7
-4
BStudentServiceImpl.java
...t/business/bstudent/service/impl/BStudentServiceImpl.java
+0
-11
BTeacherServiceImpl.java
...t/business/bteacher/service/impl/BTeacherServiceImpl.java
+1
-11
TPaperChapterController.java
...ess/tpaperchapter/controller/TPaperChapterController.java
+2
-2
TQuestionController.java
...ft/business/tquestion/controller/TQuestionController.java
+2
-2
TQuestionOptionsRepository.java
...ft/business/tquestion/dao/TQuestionOptionsRepository.java
+2
-3
TQuestion.java
...java/org/rcisoft/business/tquestion/entity/TQuestion.java
+1
-3
TQuestionServiceImpl.java
...business/tquestion/service/impl/TQuestionServiceImpl.java
+7
-1
ResultServiceEnums.java
...main/java/org/rcisoft/core/result/ResultServiceEnums.java
+3
-1
FileUtil.java
src/main/java/org/rcisoft/core/util/FileUtil.java
+1
-1
OfficeToPdf.java
src/main/java/org/rcisoft/core/util/OfficeToPdf.java
+7
-1
No files found.
src/main/java/org/rcisoft/business/bchapter/controller/BChapterController.java
View file @
56b5ba0b
...
@@ -355,4 +355,15 @@ public class BChapterController extends PaginationController<BChapter> {
...
@@ -355,4 +355,15 @@ public class BChapterController extends PaginationController<BChapter> {
MessageConstant
.
MESSAGE_ALERT_ERROR
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bChapterService
.
scoreReport
(
slId
));
bChapterService
.
scoreReport
(
slId
));
}
}
@ApiOperation
(
value
=
"创建题目时从属下拉框查询"
,
notes
=
"只查询该课程的节"
)
@ApiImplicitParam
(
name
=
"slId"
,
value
=
"开课id"
,
required
=
false
,
dataType
=
"varchar"
)
@GetMapping
(
value
=
"/chapterListBySlId"
)
public
Result
chapterListBySlId
(
String
slId
)
{
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bChapterService
.
chapterListBySlId
(
slId
));
}
}
}
src/main/java/org/rcisoft/business/bchapter/dao/BChapterRepository.java
View file @
56b5ba0b
...
@@ -298,5 +298,13 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
...
@@ -298,5 +298,13 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
"order by sort asc</script>"
)
"order by sort asc</script>"
)
@ResultMap
(
value
=
"ScoreReportResultMap"
)
@ResultMap
(
value
=
"ScoreReportResultMap"
)
List
<
ScoreReportDto
>
queryBChaptersBySlId
(
String
slId
);
List
<
ScoreReportDto
>
queryBChaptersBySlId
(
String
slId
);
@Select
(
"<script>select bc.*,su.business_id as userId,su.`name` as studentName,su.login_name as stuId from b_chapter bc \n"
+
"LEFT JOIN b_r_student_chapter bsc on bc.business_id = bsc.chapter_id\n"
+
"LEFT JOIN b_student bs on bsc.student_id = bs.business_id\n"
+
"LEFT JOIN s_user su on su.login_name = bs.`code` \n"
+
"where bc.business_id = #{chapterId} and bsc.score = '-1'</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BChapter
>
chapterListBySlId
(
String
slId
);
}
}
src/main/java/org/rcisoft/business/bchapter/service/BChapterService.java
View file @
56b5ba0b
...
@@ -114,4 +114,6 @@ public interface BChapterService{
...
@@ -114,4 +114,6 @@ public interface BChapterService{
int
Mark
(
String
chapterId
,
String
slId
,
String
studentCode
,
String
score
);
int
Mark
(
String
chapterId
,
String
slId
,
String
studentCode
,
String
score
);
List
<
ScoreReportDto
>
scoreReport
(
String
slId
);
List
<
ScoreReportDto
>
scoreReport
(
String
slId
);
List
<
BChapter
>
chapterListBySlId
(
String
slId
);
}
}
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
56b5ba0b
...
@@ -505,5 +505,10 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -505,5 +505,10 @@ public class BChapterServiceImpl implements BChapterService {
return
bChapterRepository
.
queryBChaptersBySlId
(
slId
);
return
bChapterRepository
.
queryBChaptersBySlId
(
slId
);
}
}
@Override
public
List
<
BChapter
>
chapterListBySlId
(
String
slId
)
{
return
bChapterRepository
.
chapterListBySlId
(
slId
);
}
}
}
src/main/java/org/rcisoft/business/bfile/service/impl/BFileServiceImpl.java
View file @
56b5ba0b
...
@@ -7,7 +7,9 @@ import org.rcisoft.business.bfile.service.BFileService;
...
@@ -7,7 +7,9 @@ import org.rcisoft.business.bfile.service.BFileService;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.constant.DelStatus
;
import
org.rcisoft.core.constant.DelStatus
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.result.ResultServiceEnums
;
import
org.rcisoft.core.util.FileUtil
;
import
org.rcisoft.core.util.FileUtil
;
import
org.rcisoft.core.util.IdGen
;
import
org.rcisoft.core.util.IdGen
;
import
org.rcisoft.core.util.OfficeToPdf
;
import
org.rcisoft.core.util.OfficeToPdf
;
...
@@ -33,6 +35,8 @@ public class BFileServiceImpl implements BFileService {
...
@@ -33,6 +35,8 @@ public class BFileServiceImpl implements BFileService {
@Autowired
@Autowired
private
BFileRepository
bFileRepository
;
private
BFileRepository
bFileRepository
;
@Autowired
@Autowired
private
OfficeToPdf
officeToPdf
;
@Autowired
private
Global
global
;
private
Global
global
;
@Override
@Override
...
@@ -115,7 +119,7 @@ public class BFileServiceImpl implements BFileService {
...
@@ -115,7 +119,7 @@ public class BFileServiceImpl implements BFileService {
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
throw
new
RuntimeException
(
e
);
throw
new
ServiceException
(
ResultServiceEnums
.
UPLOAD_ERROR
);
}
}
}
}
}
}
...
@@ -254,13 +258,12 @@ public class BFileServiceImpl implements BFileService {
...
@@ -254,13 +258,12 @@ public class BFileServiceImpl implements BFileService {
+
path
+
bFile
.
getChapterId
()
+
File
.
separator
+
path
+
bFile
.
getChapterId
()
+
File
.
separator
+
pathName
+
File
.
separator
;
+
pathName
+
File
.
separator
;
if
(
uploadFileSuffix
.
equals
(
"ppt"
)
||
uploadFileSuffix
.
equals
(
"pptx
"
)){
//ppt转pdf
if
(
uploadFileSuffix
.
equals
(
"ppt"
)
&&
bFile
.
getType
().
equals
(
"2
"
)){
//ppt转pdf
String
inputFile
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
File
.
separator
String
inputFile
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
File
.
separator
+
newPath
+
filename
;
+
newPath
+
filename
;
String
outputFile
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
File
.
separator
String
outputFile
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
File
.
separator
+
newPath
+
uploadFileName
+
".pdf"
;
+
newPath
+
uploadFileName
+
".pdf"
;
OfficeToPdf
pptToPdf
=
new
OfficeToPdf
();
officeToPdf
.
office2PDF
(
inputFile
,
outputFile
);
//pptToPdf.pptToPdf(inputFile,outputFile);
}
}
bFile
.
setVideoName
(
name
+
"."
+
uploadFileSuffix
);
//文件名
bFile
.
setVideoName
(
name
+
"."
+
uploadFileSuffix
);
//文件名
...
...
src/main/java/org/rcisoft/business/bstudent/service/impl/BStudentServiceImpl.java
View file @
56b5ba0b
...
@@ -87,17 +87,6 @@ public class BStudentServiceImpl implements BStudentService {
...
@@ -87,17 +87,6 @@ public class BStudentServiceImpl implements BStudentService {
throw
new
ServiceException
(
ResultServiceEnums
.
EMAIL_EXISTS
);
throw
new
ServiceException
(
ResultServiceEnums
.
EMAIL_EXISTS
);
//1. 添加用户
//1. 添加用户
//1.1 创建git lab账户
/*GitUser gitUser = new GitUser();
gitUser.setUsername(global.getGIT_LAB_STU_PREFIX()+model.getCode());
gitUser.setName(user.getName());
gitUser.setPassword(model.getCode());
gitUser.setEmail(user.getEmail());
AccountDTO accountDTO = action.createGitLabAccount(gitUser);
//1.2 将git lab账户信息保存进user里
user.setGitLabId(accountDTO.getId());
user.setGitLabUsername(accountDTO.getUsername());
user.setGitLabImpressionToken(accountDTO.getImpersonationToken());*/
UserUtil
.
setCurrentPersistOperation
(
user
);
UserUtil
.
setCurrentPersistOperation
(
user
);
user
.
setHeadPic
(
global
.
getDEFAULT_STUDENT_LOCATION
());
user
.
setHeadPic
(
global
.
getDEFAULT_STUDENT_LOCATION
());
userService
.
persistUser
(
user
);
userService
.
persistUser
(
user
);
...
...
src/main/java/org/rcisoft/business/bteacher/service/impl/BTeacherServiceImpl.java
View file @
56b5ba0b
...
@@ -232,17 +232,7 @@ public class BTeacherServiceImpl implements BTeacherService {
...
@@ -232,17 +232,7 @@ public class BTeacherServiceImpl implements BTeacherService {
throw
new
ServiceException
(
ResultServiceEnums
.
EMAIL_EXISTS
);
throw
new
ServiceException
(
ResultServiceEnums
.
EMAIL_EXISTS
);
//1添加用户
//1添加用户
user
.
setHeadPic
(
global
.
getDEFAULT_TEACHER_LOCATION
());
user
.
setHeadPic
(
global
.
getDEFAULT_TEACHER_LOCATION
());
//1.1 创建git lab账户
UserUtil
.
setCurrentPersistOperation
(
user
);
/*GitUser gitUser = new GitUser();
gitUser.setName(user.getName());
gitUser.setUsername(global.getGIT_LAB_TEA_PREFIX()+user.getLoginName());
gitUser.setPassword(user.getLoginName());
gitUser.setEmail(user.getEmail());
AccountDTO accountDTO = action.createGitLabAccount(gitUser);
//1.2 将git lab账户信息保存进user里
user.setGitLabId(accountDTO.getId());
user.setGitLabUsername(accountDTO.getUsername());
user.setGitLabImpressionToken(accountDTO.getImpersonationToken());*/
userService
.
persistUser
(
user
);
userService
.
persistUser
(
user
);
//2添加用户权限
//2添加用户权限
...
...
src/main/java/org/rcisoft/business/tpaperchapter/controller/TPaperChapterController.java
View file @
56b5ba0b
...
@@ -29,7 +29,7 @@ import java.util.List;
...
@@ -29,7 +29,7 @@ import java.util.List;
* Created by yangzhaojun on 2018-1-15 19:49:07.
* Created by yangzhaojun on 2018-1-15 19:49:07.
*/
*/
@RestController
@RestController
@RequestMapping
(
"/t
/paper/c
hapter"
)
@RequestMapping
(
"/t
PaperC
hapter"
)
public
class
TPaperChapterController
extends
PaginationController
<
TPaperChapter
>
{
public
class
TPaperChapterController
extends
PaginationController
<
TPaperChapter
>
{
@Autowired
@Autowired
...
@@ -39,7 +39,7 @@ public class TPaperChapterController extends PaginationController<TPaperChapter>
...
@@ -39,7 +39,7 @@ public class TPaperChapterController extends PaginationController<TPaperChapter>
@ApiOperation
(
value
=
"添加"
,
notes
=
"添加"
)
@ApiOperation
(
value
=
"添加"
,
notes
=
"添加"
)
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PostMapping
@PostMapping
public
Result
add
(
@Valid
TPaperChapter
tPaperChapter
,
BindingResult
bindingResult
)
{
public
Result
add
(
TPaperChapter
tPaperChapter
)
{
tPaperChapter
.
setToken
(
getToken
());
tPaperChapter
.
setToken
(
getToken
());
PersistModel
data
=
tPaperChapterServiceImpl
.
save
(
tPaperChapter
);
PersistModel
data
=
tPaperChapterServiceImpl
.
save
(
tPaperChapter
);
return
Result
.
builder
(
data
,
return
Result
.
builder
(
data
,
...
...
src/main/java/org/rcisoft/business/tquestion/controller/TQuestionController.java
View file @
56b5ba0b
...
@@ -128,9 +128,9 @@ public class TQuestionController extends PaginationController<TQuestion> {
...
@@ -128,9 +128,9 @@ public class TQuestionController extends PaginationController<TQuestion> {
@ApiOperation
(
value
=
"根据条件查询(不分页)"
,
notes
=
"根据URL中的参数查询全部"
)
@ApiOperation
(
value
=
"根据条件查询(不分页)"
,
notes
=
"根据URL中的参数查询全部"
)
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
)
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
)
@GetMapping
(
value
=
"/queryTQestions"
)
@GetMapping
(
value
=
"/queryTQ
u
estions"
)
@PreAuthorize
(
"hasRole('ROLE_1002')"
)
@PreAuthorize
(
"hasRole('ROLE_1002')"
)
public
Result
queryTQestion
(
TQuestion
tQuestion
)
{
public
Result
queryTQ
u
estion
(
TQuestion
tQuestion
)
{
//tQuestion.setCreateBy(UserUtil.getUserInfoProp(getToken(),UserUtil.USER_ID));
//tQuestion.setCreateBy(UserUtil.getUserInfoProp(getToken(),UserUtil.USER_ID));
return
Result
.
builder
(
new
PersistModel
(
1
),
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
...
...
src/main/java/org/rcisoft/business/tquestion/dao/TQuestionOptionsRepository.java
View file @
56b5ba0b
...
@@ -20,10 +20,9 @@ public interface TQuestionOptionsRepository extends BaseMapper<TQuestionOptions>
...
@@ -20,10 +20,9 @@ public interface TQuestionOptionsRepository extends BaseMapper<TQuestionOptions>
*
*
*/
*/
@Select
(
"<script>select * from t_question_options where 1=1 "
@Select
(
"<script>select * from t_question_options where 1=1 "
+
"<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if>' "
+
"<if test=\"qid !=null and qid != '' \">and qid = #{qid} </if>' "
+
"<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if>' "
+
"</script>"
)
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
TQuestionOptions
>
queryTQuestionOptions
s
(
TQuestionOptions
tQuestionOptions
);
List
<
TQuestionOptions
>
queryTQuestionOptions
(
String
qid
);
}
}
src/main/java/org/rcisoft/business/tquestion/entity/TQuestion.java
View file @
56b5ba0b
...
@@ -23,6 +23,7 @@ public class TQuestion extends IdEntity<TQuestion> {
...
@@ -23,6 +23,7 @@ public class TQuestion extends IdEntity<TQuestion> {
private
static
final
long
serialVersionUID
=
4926963786636914161L
;
private
static
final
long
serialVersionUID
=
4926963786636914161L
;
private
String
slId
;
private
String
slId
;
private
String
chapId
;
private
String
chapId
;
...
@@ -41,9 +42,6 @@ public class TQuestion extends IdEntity<TQuestion> {
...
@@ -41,9 +42,6 @@ public class TQuestion extends IdEntity<TQuestion> {
private String desc;*/
private String desc;*/
@Transient
List
<
Map
<
String
,
Object
>>
questionOptions
;
@Transient
@Transient
List
<
TQuestionOptions
>
options
;
List
<
TQuestionOptions
>
options
;
...
...
src/main/java/org/rcisoft/business/tquestion/service/impl/TQuestionServiceImpl.java
View file @
56b5ba0b
...
@@ -125,7 +125,13 @@ public class TQuestionServiceImpl implements TQuestionService {
...
@@ -125,7 +125,13 @@ public class TQuestionServiceImpl implements TQuestionService {
@Override
@Override
public
TQuestion
queryTQestionById
(
String
businessId
)
{
public
TQuestion
queryTQestionById
(
String
businessId
)
{
return
tQuestionRepository
.
selectOne
(
new
TQuestion
(
businessId
));
TQuestion
tQuestion
=
tQuestionRepository
.
selectOne
(
new
TQuestion
(
businessId
));
if
(!
tQuestion
.
getQtype
().
equals
(
"2"
)){
//选择题 获取选项
List
<
TQuestionOptions
>
options
=
tQuestionOptionsRepository
.
queryTQuestionOptions
(
tQuestion
.
getBusinessId
());
tQuestion
.
setOptions
(
options
);
}
return
tQuestion
;
}
}
...
...
src/main/java/org/rcisoft/core/result/ResultServiceEnums.java
View file @
56b5ba0b
...
@@ -134,7 +134,9 @@ public enum ResultServiceEnums {
...
@@ -134,7 +134,9 @@ public enum ResultServiceEnums {
COMPILING_CODE
(
74
,
"运行失败,请重试"
),
COMPILING_CODE
(
74
,
"运行失败,请重试"
),
STUDENT_CODE_NOT_EXISTS
(
74
,
"未查询到该学生的代码文件"
)
STUDENT_CODE_NOT_EXISTS
(
74
,
"未查询到该学生的代码文件"
),
UPLOAD_ERROR
(
75
,
"上传失败"
)
;
;
private
Integer
code
;
private
Integer
code
;
...
...
src/main/java/org/rcisoft/core/util/FileUtil.java
View file @
56b5ba0b
...
@@ -24,7 +24,7 @@ public class FileUtil {
...
@@ -24,7 +24,7 @@ public class FileUtil {
}
else
if
(
fileSuffix
.
equals
(
"xlsx"
)){
}
else
if
(
fileSuffix
.
equals
(
"xlsx"
)){
return
"xls"
;
return
"xls"
;
}
else
{
}
else
{
return
""
;
return
fileSuffix
;
}
}
}
}
...
...
src/main/java/org/rcisoft/core/util/OfficeToPdf.java
View file @
56b5ba0b
...
@@ -9,6 +9,8 @@ import com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConne
...
@@ -9,6 +9,8 @@ import com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConne
import
com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter
;
import
com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.result.ResultServiceEnums
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -115,7 +117,11 @@ public class OfficeToPdf {
...
@@ -115,7 +117,11 @@ public class OfficeToPdf {
e
.
printStackTrace
();
e
.
printStackTrace
();
return
0
;
return
0
;
}
finally
{
}
finally
{
connection
.
disconnect
();
if
(
connection
!=
null
)
{
connection
.
disconnect
();
}
else
{
throw
new
ServiceException
(
ResultServiceEnums
.
UPLOAD_ERROR
);
}
}
}
return
1
;
return
1
;
}
}
...
...
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