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
05798fc2
Commit
05798fc2
authored
Jan 18, 2018
by
李丛阳
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
638cc652
3eec852f
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
142 additions
and
154 deletions
+142
-154
BChapterRepository.java
...org/rcisoft/business/bchapter/dao/BChapterRepository.java
+1
-3
StuScoreDTO.java
...n/java/org/rcisoft/business/bchapter/dto/StuScoreDTO.java
+0
-1
BChapter.java
...n/java/org/rcisoft/business/bchapter/entity/BChapter.java
+9
-0
BChapterService.java
...rg/rcisoft/business/bchapter/service/BChapterService.java
+4
-0
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+4
-0
BCodeController.java
...rg/rcisoft/business/bcode/controller/BCodeController.java
+8
-16
BCodeFile.java
...main/java/org/rcisoft/business/bcode/model/BCodeFile.java
+0
-11
BCodeService.java
...java/org/rcisoft/business/bcode/service/BCodeService.java
+0
-2
BCodeServiceImpl.java
...rcisoft/business/bcode/service/impl/BCodeServiceImpl.java
+41
-69
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+1
-0
BSlController.java
...va/org/rcisoft/business/bsl/controller/BSlController.java
+2
-1
BSlServiceImpl.java
...org/rcisoft/business/bsl/service/impl/BSlServiceImpl.java
+0
-1
BStudentServiceImpl.java
...t/business/bstudent/service/impl/BStudentServiceImpl.java
+0
-1
BTeacher.java
...n/java/org/rcisoft/business/bteacher/entity/BTeacher.java
+0
-2
BTeacherServiceImpl.java
...t/business/bteacher/service/impl/BTeacherServiceImpl.java
+0
-1
TQuestionController.java
...ft/business/tquestion/controller/TQuestionController.java
+18
-4
TQuestionRepository.java
...g/rcisoft/business/tquestion/dao/TQuestionRepository.java
+7
-4
TQuestion.java
...java/org/rcisoft/business/tquestion/entity/TQuestion.java
+2
-2
TQuestionService.java
.../rcisoft/business/tquestion/service/TQuestionService.java
+1
-0
TQuestionServiceImpl.java
...business/tquestion/service/impl/TQuestionServiceImpl.java
+5
-0
logback-spring.xml
src/main/resources/logback-spring.xml
+3
-3
BChapterMapper.xml
...ources/mapper/business/bchapter/mapper/BChapterMapper.xml
+20
-19
TQuestionMapper.xml
...rces/mapper/business/tquestion/mapper/TQuestionMapper.xml
+16
-14
No files found.
src/main/java/org/rcisoft/business/bchapter/dao/BChapterRepository.java
View file @
05798fc2
...
...
@@ -96,8 +96,7 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
*/
@Select
(
"<script>SELECT\n"
+
"\tt2.chapter_id as chapterId,\n"
+
"\tt2.score,\n"
+
"t2.is_complete as complete "
+
"\tt2.score\n"
+
"FROM\n"
+
"\tb_chapter t1\n"
+
"LEFT JOIN b_r_student_chapter t2 ON t1.business_id = t2.chapter_id\n"
+
...
...
@@ -252,7 +251,6 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
" and del_flag = 0 and flag = 1 "
)
String
querySortByPidAndId
(
@Param
(
"pid"
)
String
pid
,
@Param
(
"businessId"
)
String
businessId
);
@Select
(
"<script>select *,#{userId} AS stuId from b_chapter "
+
"where del_flag = 0 and flag = 1 and pid = -1 "
+
"<if test=\"slId!=null and slId != ''\">\n"
+
...
...
src/main/java/org/rcisoft/business/bchapter/dto/StuScoreDTO.java
View file @
05798fc2
...
...
@@ -9,5 +9,4 @@ import lombok.Data;
public
class
StuScoreDTO
{
private
String
chapterId
;
private
String
score
;
private
String
complete
;
}
src/main/java/org/rcisoft/business/bchapter/entity/BChapter.java
View file @
05798fc2
...
...
@@ -109,5 +109,14 @@ public class BChapter extends IdEntity<BChapter> {
private
String
studentName
;
}
src/main/java/org/rcisoft/business/bchapter/service/BChapterService.java
View file @
05798fc2
...
...
@@ -109,4 +109,8 @@ public interface BChapterService{
List
<
BChapter
>
queryBChaptersByStudent
(
BChapter
param
);
int
Mark
(
String
chapterId
,
String
slId
,
String
studentCode
,
String
score
);
}
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
05798fc2
...
...
@@ -468,4 +468,8 @@ public class BChapterServiceImpl implements BChapterService {
return
line
;
}
}
src/main/java/org/rcisoft/business/bcode/controller/BCodeController.java
View file @
05798fc2
...
...
@@ -142,13 +142,18 @@ public class BCodeController extends PaginationController {
@ApiImplicitParam
(
name
=
"newFilePath"
,
value
=
"新文件名(修改文件名时使用该参数)"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"content"
,
value
=
"内容(修改文件内容时使用该参数)"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"slId"
,
value
=
"开课Id"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"chapId"
,
value
=
"章节Id"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"fileType"
,
value
=
"1新增文件夹,2新增文件,3修改文件名,4删除文件,5修改文件内容"
,
required
=
true
,
dataType
=
"varchar"
)})
@ApiImplicitParam
(
name
=
"chapId"
,
value
=
"章节Id"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"fileType"
,
value
=
"1新增文件夹,2新增文件,3修改文件名,4删除文件,5修改文件内容"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"codeType"
,
value
=
"1单文件,2工程"
,
required
=
false
,
dataType
=
"varchar"
)})
@ApiOperation
(
value
=
"单文件或工程各种操作"
,
notes
=
"单文件或工程各种操作"
)
@GetMapping
(
value
=
"/createOrUpdateFiles"
)
public
Result
createOrUpdateFiles
(
String
filePath
,
String
newFilePath
,
String
content
,
String
slId
,
String
chapId
,
String
fileType
)
throws
Exception
{
public
Result
createOrUpdateFiles
(
String
filePath
,
String
newFilePath
,
String
content
,
String
slId
,
String
chapId
,
String
fileType
,
String
codeType
)
throws
Exception
{
String
codePath
=
""
;
if
(
codeType
.
equals
(
"1"
)){
codePath
=
global
.
getCOURSE_CODE_LOCATION
();
}
else
{
codePath
=
global
.
getCOURSE_PROJECT_LOCATION
();
}
String
serverPath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
File
.
separator
+
global
.
getCOURSE_LOCATION
()
+
File
.
separator
+
global
.
getSL_LOCATION
()
+
File
.
separator
...
...
@@ -174,17 +179,4 @@ public class BCodeController extends PaginationController {
MessageConstant
.
MESSAGE_ALERT_ERROR
,
""
);
}
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"slId"
,
value
=
"开课Id"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"chapterId"
,
value
=
"章节Id"
,
required
=
true
,
dataType
=
"varchar"
)})
@ApiOperation
(
value
=
"老师查看所有学生作业"
,
notes
=
"老师查看所有学生作业"
)
@GetMapping
(
value
=
"/queryAllStudentCode"
)
public
Result
queryAllStudentCode
(
String
slId
,
String
chapterId
){
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bCodeServiceImpl
.
queryAllStudentCode
(
slId
,
chapterId
));
}
}
src/main/java/org/rcisoft/business/bcode/model/BCodeFile.java
View file @
05798fc2
...
...
@@ -29,8 +29,6 @@ public class BCodeFile {
private
String
pId
;
private
String
isFirstFile
;
private
String
studentName
;
/**
* 容器属性
*
...
...
@@ -41,13 +39,4 @@ public class BCodeFile {
*/
private
Map
lxcParam
;
public
BCodeFile
(
String
fileType
,
String
content
,
Date
lastModify
,
String
name
,
String
id
,
String
pId
,
String
isFirstFile
)
{
this
.
fileType
=
fileType
;
this
.
content
=
content
;
this
.
lastModify
=
lastModify
;
this
.
name
=
name
;
this
.
id
=
id
;
this
.
pId
=
pId
;
this
.
isFirstFile
=
isFirstFile
;
}
}
src/main/java/org/rcisoft/business/bcode/service/BCodeService.java
View file @
05798fc2
...
...
@@ -32,6 +32,4 @@ public interface BCodeService {
BCodeFile
saveOwnExamFiles
(
String
slId
,
String
chapId
,
String
examType
,
String
content
,
String
userInfoProp
,
String
studentCode
);
String
exportFiles
(
String
slId
,
String
studentId
,
String
type
,
String
slCode
);
List
<
List
<
BCodeFile
>>
queryAllStudentCode
(
String
slId
,
String
chapterId
);
}
src/main/java/org/rcisoft/business/bcode/service/impl/BCodeServiceImpl.java
View file @
05798fc2
...
...
@@ -114,18 +114,18 @@ public class BCodeServiceImpl implements BCodeService {
File
simpleFile
=
new
File
(
file
);
if
(!
simpleFile
.
exists
())
{
simpleFile
.
createNewFile
();
codeFile
=
new
BCodeFile
(
"0"
,
""
,
null
,
simpleFile
.
getName
(),
IdGen
.
uuid
(),
""
,
"1"
);
codeFile
=
new
BCodeFile
(
"0"
,
""
,
null
,
simpleFile
.
getName
(),
IdGen
.
uuid
(),
""
,
"1"
,
null
);
codeFileList
.
add
(
codeFile
);
}
else
{
String
content
=
FileUtils
.
readFileToString
(
simpleFile
);
///List<String> fileName = new ArrayList<>();
//fileName.add(simpleFile.getName());
codeFile
=
new
BCodeFile
(
"0"
,
content
,
new
Date
(
simpleFile
.
lastModified
()),
simpleFile
.
getName
(),
IdGen
.
uuid
(),
"1"
,
""
);
codeFile
=
new
BCodeFile
(
"0"
,
content
,
new
Date
(
simpleFile
.
lastModified
()),
simpleFile
.
getName
(),
IdGen
.
uuid
(),
"1"
,
""
,
null
);
codeFileList
.
add
(
codeFile
);
}
}
catch
(
Exception
e
){
log
.
debug
(
file
+
" is not exist"
);
codeFile
=
new
BCodeFile
(
"0"
,
""
,
null
,
""
,
""
,
""
,
"0"
);
codeFile
=
new
BCodeFile
(
"0"
,
""
,
null
,
""
,
""
,
""
,
"0"
,
null
);
codeFileList
.
add
(
codeFile
);
}
...
...
@@ -159,13 +159,13 @@ public class BCodeServiceImpl implements BCodeService {
BCodeFile
simpleCodeFile
=
null
;
if
(!
simplePath
.
exists
())
{
simplePath
.
mkdirs
();
simpleCodeFile
=
new
BCodeFile
(
"0"
,
""
,
null
,
simplePath
.
getName
(),
IdGen
.
uuid
(),
""
,
"0"
);
simpleCodeFile
=
new
BCodeFile
(
"0"
,
""
,
null
,
simplePath
.
getName
(),
IdGen
.
uuid
(),
""
,
"0"
,
null
);
codeFile
.
add
(
simpleCodeFile
);
}
else
{
boolean
isFile
=
true
;
simpleCodeFile
=
new
BCodeFile
(
"0"
,
""
,
null
,
simplePath
.
getName
(),
IdGen
.
uuid
(),
"0"
,
""
);
//
codeFile.add(simpleCodeFile);
getFileList
(
simplePath
,
codeFile
,
simpleCodeFile
,
isFile
,
""
);
simpleCodeFile
=
new
BCodeFile
(
"0"
,
""
,
null
,
simplePath
.
getName
(),
IdGen
.
uuid
(),
"0"
,
""
,
null
);
codeFile
.
add
(
simpleCodeFile
);
getFileList
(
simplePath
,
codeFile
,
simpleCodeFile
,
isFile
);
}
/*容器是否已启动*/
byte
[]
results
=
rcRedisServiceImpl
.
getBytes
(
global
.
getLxcPrefix
()
+
lxc
.
getUserId
());
...
...
@@ -187,7 +187,7 @@ public class BCodeServiceImpl implements BCodeService {
}
catch
(
Exception
e
){
log
.
debug
(
path
+
" is not exist"
);
BCodeFile
simpleCodeFile
=
new
BCodeFile
(
"0"
,
""
,
null
,
""
,
""
,
"0"
,
""
);
BCodeFile
simpleCodeFile
=
new
BCodeFile
(
"0"
,
""
,
null
,
""
,
""
,
"0"
,
""
,
null
);
}
return
codeFile
;
...
...
@@ -216,7 +216,7 @@ public class BCodeServiceImpl implements BCodeService {
* @param codeFile
* @throws IOException
*/
private
void
getFileList
(
File
files
,
List
<
BCodeFile
>
codeFile
,
BCodeFile
parentFile
,
boolean
isFile
,
String
studentName
)
throws
IOException
{
private
void
getFileList
(
File
files
,
List
<
BCodeFile
>
codeFile
,
BCodeFile
parentFile
,
boolean
isFile
)
throws
IOException
{
BCodeFile
bCodeFile
=
new
BCodeFile
();
bCodeFile
.
setContent
(
""
);
...
...
@@ -225,7 +225,6 @@ public class BCodeServiceImpl implements BCodeService {
bCodeFile
.
setName
(
files
.
getName
());
bCodeFile
.
setId
(
IdGen
.
uuid
());
bCodeFile
.
setPId
(
parentFile
.
getId
());
bCodeFile
.
setStudentName
(
studentName
);
codeFile
.
add
(
bCodeFile
);
if
(
files
.
isFile
()){
if
(
isFile
){
...
...
@@ -239,7 +238,7 @@ public class BCodeServiceImpl implements BCodeService {
bCodeFile
.
setFileType
(
"0"
);
File
[]
ffs
=
files
.
listFiles
();
for
(
File
ff
:
ffs
)
{
getFileList
(
ff
,
codeFile
,
bCodeFile
,
isFile
,
studentName
);
getFileList
(
ff
,
codeFile
,
bCodeFile
,
isFile
);
}
}
...
...
@@ -309,11 +308,11 @@ public class BCodeServiceImpl implements BCodeService {
FileUtils
.
write
(
simpleFile
,
content
,
"UTF-8"
);
//List<String> fileName = new ArrayList<>();
//fileName.add(simpleFile.getName());
codeFile
=
new
BCodeFile
(
"0"
,
content
,
new
Date
(
simpleFile
.
lastModified
()),
simpleFile
.
getName
(),
IdGen
.
uuid
(),
"0"
,
""
);
codeFile
=
new
BCodeFile
(
"0"
,
content
,
new
Date
(
simpleFile
.
lastModified
()),
simpleFile
.
getName
(),
IdGen
.
uuid
(),
"0"
,
""
,
null
);
}
catch
(
Exception
e
){
log
.
debug
(
file
+
"创建失败"
);
codeFile
=
new
BCodeFile
(
"0"
,
""
,
null
,
""
,
""
,
"0"
,
""
);
codeFile
=
new
BCodeFile
(
"0"
,
""
,
null
,
""
,
""
,
"0"
,
""
,
null
);
}
return
codeFile
;
}
...
...
@@ -405,7 +404,35 @@ public class BCodeServiceImpl implements BCodeService {
return
sl
.
getCode
()+
"+"
+
sl
.
getLessonName
()
+
".zip"
;
}
/*private void exportFileToUser(String zipFile, HttpServletResponse response) {
InputStream bis = null;
try {
File file=new File(zipFile);
bis = new FileInputStream(zipFile);
response.reset();
response.setContentType("bin");
response.addHeader("Content-Disposition", "attachment; filename=\"" + file.getName() + "\"");
byte[] b = new byte[100];
int len;
try {
while ((len = bis.read(b)) > 0)
response.getOutputStream().write(b, 0, len);
bis.close();
} catch (IOException e) {
e.printStackTrace();
}
}catch (Exception e){
e.printStackTrace();
}finally {
if (bis != null)
try {
bis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}*/
private
String
compressFiles
(
String
compressPath
)
throws
IOException
{
String
zipFile
=
""
;
...
...
@@ -428,59 +455,4 @@ public class BCodeServiceImpl implements BCodeService {
}
return
zipFile
;
}
@Override
public
List
<
List
<
BCodeFile
>>
queryAllStudentCode
(
String
slId
,
String
chapterId
){
List
<
List
<
BCodeFile
>>
list
=
new
ArrayList
<>();
String
codePath
=
""
;
String
suffixName
=
""
;
BCodeFile
codeFile
=
null
;
List
<
BCodeFile
>
students
=
new
ArrayList
<>();
List
<
BChapter
>
bChapters
=
bChapterRepository
.
queryBchapterStudentById
(
chapterId
);
for
(
BChapter
chapter
:
bChapters
)
{
if
(
chapter
.
getExperimentType
().
equals
(
"1"
))
{
//java单文件
codePath
=
global
.
getCOURSE_CODE_LOCATION
();
suffixName
=
".java"
;
}
else
if
(
chapter
.
getExperimentType
().
equals
(
"2"
))
{
//java工程
codePath
=
global
.
getCOURSE_PROJECT_LOCATION
();
}
else
if
(
chapter
.
getExperimentType
().
equals
(
"3"
))
{
//html单文件
suffixName
=
".html"
;
codePath
=
global
.
getCOURSE_CODE_LOCATION
();
}
else
{
//html工程
codePath
=
global
.
getCOURSE_PROJECT_LOCATION
();
}
String
path
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
File
.
separator
+
global
.
getCOURSE_LOCATION
()
+
File
.
separator
+
global
.
getSL_LOCATION
()
+
File
.
separator
+
slId
+
File
.
separator
+
chapterId
+
File
.
separator
+
codePath
+
File
.
separator
+
chapter
.
getUserId
()
+
File
.
separator
+
chapter
.
getStuId
()
+
suffixName
;
String
studentName
=
chapter
.
getStuId
()+
" "
+
chapter
.
getStudentName
();
try
{
File
file
=
new
File
(
path
);
if
(
file
.
exists
())
{
if
(
file
.
isFile
())
{
//单文件的处理
String
content
=
FileUtils
.
readFileToString
(
file
);
codeFile
=
new
BCodeFile
(
"0"
,
content
,
new
Date
(
file
.
lastModified
()),
file
.
getName
(),
IdGen
.
uuid
(),
"0"
,
""
,
studentName
,
null
);
students
.
add
(
codeFile
);
list
.
add
(
students
);
}
else
if
(
file
.
isDirectory
()){
//工程的处理
List
<
BCodeFile
>
codeFiles
=
new
ArrayList
<>();
BCodeFile
simpleCodeFile
=
null
;
boolean
isFile
=
true
;
simpleCodeFile
=
new
BCodeFile
(
"0"
,
""
,
null
,
file
.
getName
(),
IdGen
.
uuid
(),
"0"
,
""
);
getFileList
(
file
,
codeFiles
,
simpleCodeFile
,
isFile
,
studentName
);
list
.
add
(
codeFiles
);
}
}
}
catch
(
Exception
e
){
}
}
return
list
;
}
}
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
05798fc2
...
...
@@ -173,6 +173,7 @@ public class BLessonServiceImpl implements BLessonService {
}
BLesson
bLesson
=
new
BLesson
();
bLesson
.
setBusinessId
(
id
);
bLesson
.
setDeleted
();
UserUtil
.
setCurrentMergeOperation
(
bLesson
);
int
line
=
bLessonRepository
.
logicalDelete
(
bLesson
);
//int line = bLessonRepository.deleteByPrimaryKey(id);
...
...
src/main/java/org/rcisoft/business/bsl/controller/BSlController.java
View file @
05798fc2
...
...
@@ -175,8 +175,9 @@ public class BSlController extends PaginationController<BSl> {
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
id
);
}
else
}
else
{
throw
new
ServiceException
(
ResultServiceEnums
.
UPLOAD_FILE_ERROR
);
}
}
@ApiOperation
(
value
=
"修改课程简介"
,
notes
=
"修改课程简介"
)
...
...
src/main/java/org/rcisoft/business/bsl/service/impl/BSlServiceImpl.java
View file @
05798fc2
...
...
@@ -282,7 +282,6 @@ public class BSlServiceImpl implements BSlService {
BSl
bsl
=
new
BSl
();
bsl
.
setBusinessId
(
id
);
UserUtil
.
setCurrentMergeOperation
(
bsl
);
bSl
.
setDeleted
();
int
line
=
bSlRepository
.
logicalDelete
(
bSl
);
//int line = bSlRepository.deleteByPrimaryKey(id);
return
new
PersistModel
(
line
);
...
...
src/main/java/org/rcisoft/business/bstudent/service/impl/BStudentServiceImpl.java
View file @
05798fc2
...
...
@@ -254,7 +254,6 @@ public class BStudentServiceImpl implements BStudentService {
}
BStudent
bStudent
=
new
BStudent
();
bStudent
.
setBusinessId
(
id
);
bStudent
.
setDeleted
();
UserUtil
.
setCurrentMergeOperation
(
bStudent
);
BStudent
student
=
bStudentRepository
.
selectOne
(
bStudent
);
sysUserMapper
.
deleteByCode
(
student
.
getCode
());
...
...
src/main/java/org/rcisoft/business/bteacher/entity/BTeacher.java
View file @
05798fc2
...
...
@@ -3,7 +3,6 @@ package org.rcisoft.business.bteacher.entity;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.hibernate.validator.constraints.Length
;
import
org.rcisoft.core.entity.IdEntity
;
import
javax.persistence.Entity
;
...
...
@@ -41,7 +40,6 @@ public class BTeacher extends IdEntity<BTeacher> {
private
String
recommendCourse
;
@Transient
@Length
(
min
=
1
,
max
=
200
,
message
=
"长度最小为1,最大为15"
)
private
String
name
;
@Transient
...
...
src/main/java/org/rcisoft/business/bteacher/service/impl/BTeacherServiceImpl.java
View file @
05798fc2
...
...
@@ -205,7 +205,6 @@ public class BTeacherServiceImpl implements BTeacherService {
bTeacher
.
setBusinessId
(
id
);
BTeacher
teacher
=
bTeacherRepository
.
selectOne
(
bTeacher
);
UserUtil
.
setCurrentMergeOperation
(
bTeacher
);
bTeacher
.
setDeleted
();
sysUserMapper
.
deleteByCode
(
teacher
.
getCode
());
int
line
=
bTeacherRepository
.
logicalDelete
(
bTeacher
);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
...
...
src/main/java/org/rcisoft/business/tquestion/controller/TQuestionController.java
View file @
05798fc2
...
...
@@ -51,9 +51,9 @@ public class TQuestionController extends PaginationController<TQuestion> {
}
@ApiOperation
(
value
=
"删除题目"
,
notes
=
"根据ID删除一个题"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"businessId"
,
required
=
fals
e
,
dataType
=
"varchar"
)})
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"businessId"
,
required
=
tru
e
,
dataType
=
"varchar"
)})
@PostMapping
(
"/remove"
)
@PreAuthorize
(
"hasRole('ROLE_100
1
')"
)
@PreAuthorize
(
"hasRole('ROLE_100
2
')"
)
public
Result
delete
(
@PathVariable
String
id
)
{
return
Result
.
builder
(
new
PersistModel
(
tQuestionServiceImpl
.
remove
(
id
,
getToken
())),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
...
...
@@ -61,10 +61,22 @@ public class TQuestionController extends PaginationController<TQuestion> {
id
);
}
@ApiOperation
(
value
=
"批量删除"
,
notes
=
"根据ID批量删除"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id数组"
,
value
=
"businessId数组"
,
required
=
true
,
dataType
=
"varchar"
)})
@PostMapping
(
"/removeByIds"
)
@PreAuthorize
(
"hasRole('ROLE_1002')"
)
public
Result
deletes
(
@PathVariable
String
idInfoList
)
{
PersistModel
data
=
new
PersistModel
(
tQuestionServiceImpl
.
removeByIds
(
idInfoList
));
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
idInfoList
);
}
@ApiOperation
(
value
=
"修改"
,
notes
=
"修改"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
)})
@PutMapping
(
"/{id:\\d+}"
)
@PreAuthorize
(
"hasRole('ROLE_100
1
')"
)
@PreAuthorize
(
"hasRole('ROLE_100
2
')"
)
public
Result
update
(
@Valid
TQuestion
tQuestion
,
BindingResult
bindingResult
)
{
if
(
bindingResult
.
hasErrors
())
{
throw
new
ServiceException
(
ResultServiceEnums
.
PARAMETER_ERROR
.
getCode
(),
...
...
@@ -80,7 +92,7 @@ public class TQuestionController extends PaginationController<TQuestion> {
@ApiOperation
(
value
=
"唯一查找"
,
notes
=
"根据ID查找一条记录"
)
@GetMapping
(
"/one"
)
@PreAuthorize
(
"hasRole('ROLE_100
1
')"
)
@PreAuthorize
(
"hasRole('ROLE_100
2
')"
)
public
Result
detail
(
@PathVariable
String
id
)
{
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
...
...
@@ -92,6 +104,7 @@ public class TQuestionController extends PaginationController<TQuestion> {
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"qtype"
,
value
=
"题目类型"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"qtitle"
,
value
=
"关键字"
,
required
=
false
,
dataType
=
"varchar"
)})
@GetMapping
(
value
=
"/queryTQuestionByPagination"
)
@PreAuthorize
(
"hasRole('ROLE_1002')"
)
public
GridModel
listByPagination
(
TQuestion
tQuestion
)
{
tQuestion
.
setCreateBy
(
UserUtil
.
getUserInfoProp
(
getToken
(),
UserUtil
.
USER_ID
));
tQuestionServiceImpl
.
findAllByPagination
(
getPaginationUtility
(),
tQuestion
);
...
...
@@ -101,6 +114,7 @@ public class TQuestionController extends PaginationController<TQuestion> {
@ApiOperation
(
value
=
"根据条件查询"
,
notes
=
"根据URL中的参数查询全部"
)
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
)
@GetMapping
(
value
=
"/queryTQestions"
)
@PreAuthorize
(
"hasRole('ROLE_1002')"
)
public
Result
queryTQestion
(
TQuestion
tQuestion
)
{
tQuestion
.
setCreateBy
(
UserUtil
.
getUserInfoProp
(
getToken
(),
UserUtil
.
USER_ID
));
return
Result
.
builder
(
new
PersistModel
(
1
),
...
...
src/main/java/org/rcisoft/business/tquestion/dao/TQuestionRepository.java
View file @
05798fc2
package
org
.
rcisoft
.
business
.
tquestion
.
dao
;
import
org.apache.ibatis.annotations.
Insert
;
import
org.apache.ibatis.annotations.
*
;
import
org.rcisoft.business.tquestion.entity.TQuestionOptions
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.rcisoft.business.tquestion.entity.TQuestion
;
import
org.apache.ibatis.annotations.ResultMap
;
import
org.apache.ibatis.annotations.Select
;
import
org.rcisoft.core.model.PersistModel
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -39,11 +38,15 @@ public interface TQuestionRepository extends BaseMapper<TQuestion> {
@Select
(
"<script>select * "
+
"from t_question tq"
+
"left join t_question_options tqo on tqo.
business_
id = tq.business_id"
+
"left join t_question_options tqo on tqo.
q
id = tq.business_id"
+
"where 1=1"
+
"<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> "
+
"<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> "
+
"<if test=\"business_id != null and business_id != ''\">and business_id = #{business_id}</if></script>"
)
List
<
TQuestion
>
queryTQuestions
(
TQuestion
tQuestion
);
@Update
(
"<script> update t_question set del_flag = 1 and flag = 0 where FIND_IN_SET(business_id,idInfoList)</script>"
)
int
deleteByIds
(
String
idInfoList
);
}
src/main/java/org/rcisoft/business/tquestion/entity/TQuestion.java
View file @
05798fc2
...
...
@@ -20,7 +20,7 @@ import java.util.List;
@Table
(
name
=
"t_question"
)
public
class
TQuestion
extends
IdEntity
<
TQuestion
>
{
private
static
final
long
serialVersionUID
=
-
3700402045439337539L
;
private
String
slId
;
...
...
@@ -39,7 +39,7 @@ public class TQuestion extends IdEntity<TQuestion> {
@Transient
private
String
alias
;
@Transient
private
String
desc
;
...
...
src/main/java/org/rcisoft/business/tquestion/service/TQuestionService.java
View file @
05798fc2
...
...
@@ -50,4 +50,5 @@ public interface TQuestionService {
List
<
TQuestion
>
queryTQuestions
(
TQuestion
tQuestion
);
int
removeByIds
(
String
idInfoList
);
}
src/main/java/org/rcisoft/business/tquestion/service/impl/TQuestionServiceImpl.java
View file @
05798fc2
...
...
@@ -120,4 +120,9 @@ public class TQuestionServiceImpl implements TQuestionService {
return
tQuestionRepository
.
queryTQuestions
(
tQuestion
);
}
@Override
public
int
removeByIds
(
String
idInfoList
)
{
return
tQuestionRepository
.
deleteByIds
(
idInfoList
);
}
}
src/main/resources/logback-spring.xml
View file @
05798fc2
...
...
@@ -5,7 +5,7 @@
<appender
name=
"consoleLog"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<layout
class=
"ch.qos.logback.classic.PatternLayout"
>
<pattern>
%d
ate %-5level %d
- %msg%n
%d - %msg%n
</pattern>
</layout>
</appender>
...
...
@@ -24,7 +24,7 @@
<!--滚动策略-->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!--路径-->
<fileNamePattern>
/
working/test
/info.%d.log
</fileNamePattern>
<fileNamePattern>
/
Users/liuzhichao/logback
/info.%d.log
</fileNamePattern>
</rollingPolicy>
</appender>
...
...
@@ -45,7 +45,7 @@
<!--滚动策略-->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!--路径-->
<fileNamePattern>
/
working/test
/error.%d.log
</fileNamePattern>
<fileNamePattern>
/
Users/liuzhichao/logback
/error.%d.log
</fileNamePattern>
</rollingPolicy>
</appender>
<!--
...
...
src/main/resources/mapper/business/bchapter/mapper/BChapterMapper.xml
View file @
05798fc2
...
...
@@ -34,6 +34,7 @@
<result
column=
"chapter_name"
property=
"chapterName"
></result>
</resultMap>
<resultMap
id=
"SupperStudentChildListResultMap"
type=
"org.rcisoft.business.bchapter.entity.BChapter"
extends=
"BaseResultMap"
>
<association
column=
"{studentId=stuId,paId=business_id}"
property=
"childList"
select=
"queryBChaptersByPidAndUserId"
>
...
...
@@ -42,24 +43,24 @@
<select
id=
"queryBChaptersByPidAndUserId"
parameterType=
"java.util.Map"
resultMap=
"SupperStudentChildListResultMap"
>
SELECT
bc.*,
#{studentId} AS stuId,
bf.video_url AS videoUrl,
bf.file_url AS fileUrl,
bf.ppt_url AS pptUrl,
bf.pdf_url AS pdfUrl,
IFNULL((select is_complete 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 isComplete,
(SELECT count(*) FROM b_r_student_chapter brs WHERE brs.chapter_id = bc.business_id AND brs.score = - 1) AS studentNum
FROM
b_chapter bc
LEFT JOIN b_file bf ON bf.chapter_id = bc.business_id
WHERE
bc.del_flag = 0
AND bc.pid = #{paId}
ORDER BY
bc.sort asc
bc.*,
#{studentId} AS stuId,
bf.video_url AS videoUrl,
bf.file_url AS fileUrl,
bf.ppt_url AS pptUrl,
bf.pdf_url AS pdfUrl,
IFNULL((select is_complete 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 isComplete,
(SELECT count(*) FROM b_r_student_chapter brs WHERE brs.chapter_id = bc.business_id AND brs.score = - 1) AS studentNum
FROM
b_chapter bc
LEFT JOIN b_file bf ON bf.chapter_id = bc.business_id
WHERE
bc.del_flag = 0
AND bc.pid = #{paId}
ORDER BY
bc.sort asc
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/business/tquestion/mapper/TQuestionMapper.xml
View file @
05798fc2
...
...
@@ -2,19 +2,21 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"org.rcisoft.business.tquestion.dao.TQuestionRepository"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.business.tquestion.entity.TQuestion"
>
<id
column=
"business_id"
jdbcType=
"VARCHAR"
property=
"businessId"
/>
<result
column=
"sl_id"
jdbcType=
"VARCHAR"
property=
"slId"
/>
<result
column=
"chap_id"
jdbcType=
"VARCHAR"
property=
"chapId"
/>
<result
column=
"qtype"
jdbcType=
"VARCHAR"
property=
"qtype"
/>
<result
column=
"qtitle"
jdbcType=
"VARCHAR"
property=
"qtitle"
/>
<result
column=
"qdesc"
jdbcType=
"VARCHAR"
property=
"qdesc"
/>
<result
column=
"qanswer"
jdbcType=
"VARCHAR"
property=
"qanswer"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"del_flag"
jdbcType=
"VARCHAR"
property=
"delFlag"
/>
<result
column=
"flag"
jdbcType=
"VARCHAR"
property=
"flag"
/>
<result
column=
"remarks"
jdbcType=
"VARCHAR"
property=
"remarks"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<id
column=
"business_id"
jdbcType=
"VARCHAR"
property=
"businessId"
/>
<result
column=
"sl_id"
jdbcType=
"VARCHAR"
property=
"slId"
/>
<result
column=
"chap_id"
jdbcType=
"VARCHAR"
property=
"chapId"
/>
<result
column=
"qtype"
jdbcType=
"VARCHAR"
property=
"qtype"
/>
<result
column=
"qtitle"
jdbcType=
"VARCHAR"
property=
"qtitle"
/>
<result
column=
"qdesc"
jdbcType=
"VARCHAR"
property=
"qdesc"
/>
<result
column=
"qanswer"
jdbcType=
"VARCHAR"
property=
"qanswer"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"del_flag"
jdbcType=
"VARCHAR"
property=
"delFlag"
/>
<result
column=
"flag"
jdbcType=
"VARCHAR"
property=
"flag"
/>
<result
column=
"remarks"
jdbcType=
"VARCHAR"
property=
"remarks"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
</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