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
8261dfba
Commit
8261dfba
authored
Jan 23, 2018
by
YangZhaoJun1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取智评分数接口
parent
c917cb3a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
126 additions
and
12 deletions
+126
-12
BChapterRepository.java
...org/rcisoft/business/bchapter/dao/BChapterRepository.java
+1
-1
BCodeController.java
...rg/rcisoft/business/bcode/controller/BCodeController.java
+13
-0
BCodeService.java
...java/org/rcisoft/business/bcode/service/BCodeService.java
+2
-0
BCodeServiceImpl.java
...rcisoft/business/bcode/service/impl/BCodeServiceImpl.java
+56
-5
BFileServiceImpl.java
...rcisoft/business/bfile/service/impl/BFileServiceImpl.java
+1
-1
PptToPdf.java
src/main/java/org/rcisoft/core/util/PptToPdf.java
+50
-5
SysUserMapper.java
src/main/java/org/rcisoft/sys/user/dao/SysUserMapper.java
+3
-0
No files found.
src/main/java/org/rcisoft/business/bchapter/dao/BChapterRepository.java
View file @
8261dfba
...
@@ -266,7 +266,7 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
...
@@ -266,7 +266,7 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
"LEFT JOIN b_r_student_chapter bsc on bc.business_id = bsc.chapter_id\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 b_student bs on bsc.student_id = bs.business_id\n"
+
"LEFT JOIN s_user su on su.login_name = bs.`code` \n"
+
"LEFT JOIN s_user su on su.login_name = bs.`code` \n"
+
"where bc.business_id = #{chapterId}</script>"
)
"where bc.business_id = #{chapterId}
and bsc.score = '-1'
</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BChapter
>
queryBchapterStudentById
(
String
chapterId
);
List
<
BChapter
>
queryBchapterStudentById
(
String
chapterId
);
...
...
src/main/java/org/rcisoft/business/bcode/controller/BCodeController.java
View file @
8261dfba
...
@@ -253,4 +253,17 @@ public class BCodeController extends PaginationController {
...
@@ -253,4 +253,17 @@ public class BCodeController extends PaginationController {
}
}
}
}
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"slId"
,
value
=
"开课Id"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"chapterId"
,
value
=
"章节Id"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"studentCode"
,
value
=
"学号"
,
required
=
true
,
dataType
=
"varchar"
)})
@ApiOperation
(
value
=
"获取智评分数"
,
notes
=
"获取智评分数"
)
@GetMapping
(
value
=
"/getIntelligenceScore"
)
public
Result
getIntelligenceScore
(
String
slId
,
String
chapterId
,
String
studentCode
){
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bCodeServiceImpl
.
getIntelligenceScore
(
slId
,
chapterId
,
studentCode
));
}
}
}
src/main/java/org/rcisoft/business/bcode/service/BCodeService.java
View file @
8261dfba
...
@@ -51,4 +51,6 @@ public interface BCodeService {
...
@@ -51,4 +51,6 @@ public interface BCodeService {
* @return
* @return
*/
*/
CommandResult
stopExam
(
String
userId
);
CommandResult
stopExam
(
String
userId
);
int
getIntelligenceScore
(
String
slId
,
String
chapterId
,
String
studentCode
);
}
}
src/main/java/org/rcisoft/business/bcode/service/impl/BCodeServiceImpl.java
View file @
8261dfba
...
@@ -4,10 +4,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -4,10 +4,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.rcisoft.business.bchapter.dao.BChapterRepository
;
import
org.rcisoft.business.bchapter.dao.BChapterRepository
;
import
org.rcisoft.business.bchapter.entity.BChapter
;
import
org.rcisoft.business.bchapter.entity.BChapter
;
import
org.rcisoft.business.bcode.model.BCodeFile
;
import
org.rcisoft.business.bcode.model.*
;
import
org.rcisoft.business.bcode.model.BCodeLxc
;
import
org.rcisoft.business.bcode.model.CodeType
;
import
org.rcisoft.business.bcode.model.StudentFile
;
import
org.rcisoft.business.bcode.service.BCodeLxcService
;
import
org.rcisoft.business.bcode.service.BCodeLxcService
;
import
org.rcisoft.business.bcode.service.BCodeService
;
import
org.rcisoft.business.bcode.service.BCodeService
;
import
org.rcisoft.business.brslstudent.dao.BRSlStudentRepository
;
import
org.rcisoft.business.brslstudent.dao.BRSlStudentRepository
;
...
@@ -25,6 +22,7 @@ import org.rcisoft.core.service.RcRedisService;
...
@@ -25,6 +22,7 @@ import org.rcisoft.core.service.RcRedisService;
import
org.rcisoft.core.service.SerializationUtils
;
import
org.rcisoft.core.service.SerializationUtils
;
import
org.rcisoft.core.util.IdGen
;
import
org.rcisoft.core.util.IdGen
;
import
org.rcisoft.core.util.ZipCompress
;
import
org.rcisoft.core.util.ZipCompress
;
import
org.rcisoft.sys.user.dao.SysUserMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Propagation
;
...
@@ -54,7 +52,7 @@ public class BCodeServiceImpl implements BCodeService {
...
@@ -54,7 +52,7 @@ public class BCodeServiceImpl implements BCodeService {
private
BRSlStudentRepository
brSlStudentRepository
;
private
BRSlStudentRepository
brSlStudentRepository
;
@Autowired
@Autowired
private
BStudentRepository
bStudentRepository
;
private
SysUserMapper
sysUserMapper
;
@Autowired
@Autowired
private
BSlRepository
bSlRepository
;
private
BSlRepository
bSlRepository
;
...
@@ -336,6 +334,14 @@ public class BCodeServiceImpl implements BCodeService {
...
@@ -336,6 +334,14 @@ public class BCodeServiceImpl implements BCodeService {
}
}
/**
* 导出作业
* @param slId
* @param studentId
* @param type
* @param slCode
* @return
*/
@Override
@Override
public
String
exportFiles
(
String
slId
,
String
studentId
,
String
type
,
String
slCode
)
{
public
String
exportFiles
(
String
slId
,
String
studentId
,
String
type
,
String
slCode
)
{
String
compressPath
=
""
;
String
compressPath
=
""
;
...
@@ -423,6 +429,12 @@ public class BCodeServiceImpl implements BCodeService {
...
@@ -423,6 +429,12 @@ public class BCodeServiceImpl implements BCodeService {
}
}
/**
* 压缩文件
* @param compressPath
* @return
* @throws IOException
*/
private
String
compressFiles
(
String
compressPath
)
throws
IOException
{
private
String
compressFiles
(
String
compressPath
)
throws
IOException
{
String
zipFile
=
""
;
String
zipFile
=
""
;
...
@@ -447,6 +459,12 @@ public class BCodeServiceImpl implements BCodeService {
...
@@ -447,6 +459,12 @@ public class BCodeServiceImpl implements BCodeService {
}
}
/**
* 查看所有学生代码
* @param slId
* @param chapterId
* @return
*/
@Override
@Override
public
List
<
StudentFile
>
queryAllStudentCode
(
String
slId
,
String
chapterId
){
public
List
<
StudentFile
>
queryAllStudentCode
(
String
slId
,
String
chapterId
){
List
<
StudentFile
>
studentFiles
=
new
ArrayList
<>();
List
<
StudentFile
>
studentFiles
=
new
ArrayList
<>();
...
@@ -550,4 +568,37 @@ public class BCodeServiceImpl implements BCodeService {
...
@@ -550,4 +568,37 @@ public class BCodeServiceImpl implements BCodeService {
return
new
CommandResult
(
ResultCode
.
FAIL
,
"未开启实验"
,
null
);
return
new
CommandResult
(
ResultCode
.
FAIL
,
"未开启实验"
,
null
);
}
}
/**
* 获取智评分数
* @param slId
* @param chapterId
* @param studentCode
* @return
*/
@Override
public
int
getIntelligenceScore
(
String
slId
,
String
chapterId
,
String
studentCode
)
{
int
score
=
0
;
try
{
BChapter
bChapter
=
bChapterRepository
.
selectOne
(
new
BChapter
(
chapterId
));
String
sutId
=
sysUserMapper
.
queryUserIdByLoginName
(
studentCode
);
String
codeType
=
global
.
getCOURSE_CODE_LOCATION
();
if
(
bChapter
.
getExperimentType
().
equals
(
"2"
)
||
bChapter
.
getExperimentType
().
equals
(
"4"
))
{
codeType
=
global
.
getCOURSE_PROJECT_LOCATION
();
}
String
filePath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
File
.
separator
+
global
.
getCOURSE_LOCATION
()
+
File
.
separator
+
global
.
getSL_LOCATION
()
+
File
.
separator
+
slId
+
File
.
separator
+
chapterId
+
File
.
separator
+
codeType
+
File
.
separator
+
sutId
+
File
.
separator
;
score
=
IntellEvaluation
.
IntellEvaluation
(
filePath
,
studentCode
,
bChapter
.
getExperimentType
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
score
;
}
}
}
src/main/java/org/rcisoft/business/bfile/service/impl/BFileServiceImpl.java
View file @
8261dfba
...
@@ -258,7 +258,7 @@ public class BFileServiceImpl implements BFileService {
...
@@ -258,7 +258,7 @@ public class BFileServiceImpl implements BFileService {
String
outputFile
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
File
.
separator
String
outputFile
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
File
.
separator
+
newPath
+
uploadFileName
+
".pdf"
;
+
newPath
+
uploadFileName
+
".pdf"
;
PptToPdf
pptToPdf
=
new
PptToPdf
();
PptToPdf
pptToPdf
=
new
PptToPdf
();
pptToPdf
.
pptToPdf
(
inputFile
,
outputFile
);
//
pptToPdf.pptToPdf(inputFile,outputFile);
}
}
bFile
.
setVideoName
(
name
+
"."
+
uploadFileSuffix
);
//文件名
bFile
.
setVideoName
(
name
+
"."
+
uploadFileSuffix
);
//文件名
...
...
src/main/java/org/rcisoft/core/util/PptToPdf.java
View file @
8261dfba
package
org
.
rcisoft
.
core
.
util
;
package
org
.
rcisoft
.
core
.
util
;
import
com.artofsolving.jodconverter.DocumentConverter
;
import
com.artofsolving.jodconverter.openoffice.connection.OpenOfficeConnection
;
import
com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection
;
import
com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter
;
import
org.artofsolving.jodconverter.OfficeDocumentConverter
;
import
org.artofsolving.jodconverter.OfficeDocumentConverter
;
import
org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration
;
import
org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration
;
import
org.artofsolving.jodconverter.office.OfficeManager
;
import
org.artofsolving.jodconverter.office.OfficeManager
;
...
@@ -8,13 +12,15 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -8,13 +12,15 @@ import org.springframework.beans.factory.annotation.Autowired;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileNotFoundException
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.net.ConnectException
;
/**
/**
* Created by Administrator on 2018/1/19.
* Created by Administrator on 2018/1/19.
*/
*/
public
class
PptToPdf
{
public
class
PptToPdf
{
@Autowired
/*
@Autowired
private Global global;
private Global global;
private static OfficeManager officeManager;
private static OfficeManager officeManager;
...
@@ -57,11 +63,50 @@ public class PptToPdf {
...
@@ -57,11 +63,50 @@ public class PptToPdf {
officeManager.stop();
officeManager.stop();
}
}
System.out.println("关闭office转换成功!");
System.out.println("关闭office转换成功!");
}
}
*/
/*
public static void main(String[] args) throws Exception {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
path
=
"C:/Users/Administrator/Desktop/"
;
String
path
=
"C:/Users/Administrator/Desktop/"
;
PptToPdf
opc
=
new
PptToPdf
();
PptToPdf
opc
=
new
PptToPdf
();
opc.pptToPdf(path+"abc.pptx", path+"1.pdf");
opc
.
office2PDF
(
path
+
"abc.pptx"
,
path
+
"1.pdf"
);
}*/
}
public
static
int
office2PDF
(
String
sourceFile
,
String
destFile
)
throws
FileNotFoundException
{
try
{
File
inputFile
=
new
File
(
sourceFile
);
if
(!
inputFile
.
exists
())
{
return
-
1
;
// 找不到源文件, 则返回-1
}
// 如果目标路径不存在, 则新建该路径
File
outputFile
=
new
File
(
destFile
);
if
(!
outputFile
.
getParentFile
().
exists
())
{
outputFile
.
getParentFile
().
mkdirs
();
}
// connect to an OpenOffice.org instance running on port 8100
OpenOfficeConnection
connection
=
new
SocketOpenOfficeConnection
(
"192.168.1.130"
,
10202
);
connection
.
connect
();
// convert
DocumentConverter
converter
=
new
OpenOfficeDocumentConverter
(
connection
);
converter
.
convert
(
inputFile
,
outputFile
);
// close the connection
connection
.
disconnect
();
return
0
;
}
catch
(
ConnectException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
1
;
}
}
}
src/main/java/org/rcisoft/sys/user/dao/SysUserMapper.java
View file @
8261dfba
...
@@ -58,4 +58,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
...
@@ -58,4 +58,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
@Update
(
"update s_user set password = #{password} where login_name = #{userCode} and del_flag = 0 and flag = 1"
)
@Update
(
"update s_user set password = #{password} where login_name = #{userCode} and del_flag = 0 and flag = 1"
)
int
resetPassword
(
@Param
(
"userCode"
)
String
userCode
,
@Param
(
"password"
)
String
password
);
int
resetPassword
(
@Param
(
"userCode"
)
String
userCode
,
@Param
(
"password"
)
String
password
);
@Select
(
"<script>select business_id from s_user where login_name = #{studentCode} and del_flag = 0 and flag = 1</script>"
)
String
queryUserIdByLoginName
(
String
studentCode
);
}
}
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