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
91a9f517
Commit
91a9f517
authored
Oct 11, 2019
by
luzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a
parent
a821e8d6
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
84 additions
and
43 deletions
+84
-43
BChapterController.java
...soft/business/bchapter/controller/BChapterController.java
+3
-2
BChapterService.java
...rg/rcisoft/business/bchapter/service/BChapterService.java
+2
-1
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+24
-14
BFileController.java
...rg/rcisoft/business/bfile/controller/BFileController.java
+4
-4
BFileRepository.java
.../java/org/rcisoft/business/bfile/dao/BFileRepository.java
+10
-0
uploadDTO.java
src/main/java/org/rcisoft/business/bfile/dto/uploadDTO.java
+20
-0
BFile.java
src/main/java/org/rcisoft/business/bfile/entity/BFile.java
+1
-14
BFileService.java
...java/org/rcisoft/business/bfile/service/BFileService.java
+2
-1
BFileServiceImpl.java
...rcisoft/business/bfile/service/impl/BFileServiceImpl.java
+1
-1
SysRole.java
src/main/java/org/rcisoft/sys/role/entity/SysRole.java
+1
-1
SysUser.java
src/main/java/org/rcisoft/sys/user/entity/SysUser.java
+3
-0
SysUserServiceImpl.java
...org/rcisoft/sys/user/service/impl/SysUserServiceImpl.java
+12
-1
BFileMapper.xml
...in/resources/mapper/business/bfile/mapper/BFileMapper.xml
+1
-4
No files found.
src/main/java/org/rcisoft/business/bchapter/controller/BChapterController.java
View file @
91a9f517
...
...
@@ -16,6 +16,7 @@ import org.rcisoft.business.bchapter.dto.ScoreInfoDTO;
import
org.rcisoft.business.bchapter.entity.BChapter
;
import
org.rcisoft.business.bchapter.enums.IsCompleteEnum
;
import
org.rcisoft.business.bchapter.service.BChapterService
;
import
org.rcisoft.business.bfile.dto.uploadDTO
;
import
org.rcisoft.business.bfile.entity.BFile
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.common.controller.PaginationController
;
...
...
@@ -72,8 +73,8 @@ public class BChapterController extends PaginationController<BChapter> {
@ApiImplicitParam
(
name
=
"chapterLevel"
,
value
=
"等级,1:章 2:节"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"isTest"
,
value
=
"课件类型(单选) 1视频 2音频 3PPT 4pdf 5资料"
,
required
=
true
,
dataType
=
"varchar"
)})
@PostMapping
(
value
=
"/add"
)
public
Result
add
(
CurUser
curUser
,
@Valid
BChapter
bChapter
,
BindingResult
bindingResult
)
{
PersistModel
data
=
bChapterService
.
persist
(
bChapter
,
curUser
.
getCorpId
());
public
Result
add
(
CurUser
curUser
,
@Valid
BChapter
bChapter
,
BindingResult
bindingResult
,
uploadDTO
dto
)
{
PersistModel
data
=
bChapterService
.
persist
(
bChapter
,
curUser
.
getCorpId
()
,
dto
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
...
...
src/main/java/org/rcisoft/business/bchapter/service/BChapterService.java
View file @
91a9f517
...
...
@@ -4,6 +4,7 @@ package org.rcisoft.business.bchapter.service;
import
org.rcisoft.business.bchapter.dto.*
;
import
org.rcisoft.business.bchapter.entity.BChapter
;
import
org.rcisoft.business.bchapter.vo.StudentChapterScoreVO
;
import
org.rcisoft.business.bfile.dto.uploadDTO
;
import
org.rcisoft.business.bfile.entity.BFile
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.model.PersistModel
;
...
...
@@ -56,7 +57,7 @@ public interface BChapterService{
* @param model
* @return
*/
PersistModel
persist
(
BChapter
model
,
String
corpId
);
PersistModel
persist
(
BChapter
model
,
String
corpId
,
uploadDTO
dto
);
/**
* 修改
...
...
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
91a9f517
...
...
@@ -11,6 +11,7 @@ import org.rcisoft.business.bchapter.enums.HasMarkEnum;
import
org.rcisoft.business.bchapter.enums.StateEnum
;
import
org.rcisoft.business.bchapter.service.BChapterService
;
import
org.rcisoft.business.bchapter.vo.StudentChapterScoreVO
;
import
org.rcisoft.business.bfile.dto.uploadDTO
;
import
org.rcisoft.business.bfile.util.GetVideoTime
;
import
org.rcisoft.business.blesson.dao.BLessonRepository
;
import
org.rcisoft.business.blesson.entity.BLesson
;
...
...
@@ -71,8 +72,8 @@ public class BChapterServiceImpl implements BChapterService {
}
@Override
public
List
<
QueryChapterListResDTO
>
queryBChaptersByPagination
(
PageUtil
pageUtil
,
QueryChapterListDTO
model
,
String
corpId
)
{
return
queryChapterListResDTO
(
model
,
corpId
);
public
List
<
QueryChapterListResDTO
>
queryBChaptersByPagination
(
PageUtil
pageUtil
,
QueryChapterListDTO
model
,
String
corpId
)
{
return
queryChapterListResDTO
(
model
,
corpId
);
}
@Override
...
...
@@ -81,23 +82,24 @@ public class BChapterServiceImpl implements BChapterService {
}
@Override
public
List
<
QueryChapterListResDTO
>
queryBChapters
(
QueryChapterListDTO
model
,
String
corpId
)
{
return
queryChapterListResDTO
(
model
,
corpId
);
public
List
<
QueryChapterListResDTO
>
queryBChapters
(
QueryChapterListDTO
model
,
String
corpId
)
{
return
queryChapterListResDTO
(
model
,
corpId
);
}
@Override
public
Map
queryBChaptersWithProgress
(
QueryChapterListDTO
model
,
String
corpId
)
{
List
<
QueryChapterListResDTO
>
queryChapterListResDTOS
=
queryChapterListResDTO
(
model
,
corpId
);
public
Map
queryBChaptersWithProgress
(
QueryChapterListDTO
model
,
String
corpId
)
{
List
<
QueryChapterListResDTO
>
queryChapterListResDTOS
=
queryChapterListResDTO
(
model
,
corpId
);
queryChapterListResDTOS
.
stream
().
forEach
(
queryChapterListResDTO
->
{
queryChapterListResDTO
.
getChildList
().
stream
().
forEach
(
childList
->
{
List
<
BRStudentChapter
>
brStudentChapterList
=
brStudentChapterRepository
.
queryByStuIdAndChapter
(
childList
.
getBusinessId
(),
model
.
getStudentId
());
if
(
null
!=
brStudentChapterList
&&
brStudentChapterList
.
size
()
>
0
)
{
List
<
BRStudentChapter
>
brStudentChapterList
=
brStudentChapterRepository
.
queryByStuIdAndChapter
(
childList
.
getBusinessId
(),
model
.
getStudentId
());
if
(
null
!=
brStudentChapterList
&&
brStudentChapterList
.
size
()
>
0
)
{
childList
.
setProgress
(
brStudentChapterList
.
get
(
0
).
getProgress
());
}
});
});
Map
map
=
new
HashMap
();
map
.
put
(
"chapterList"
,
queryChapterListResDTOS
);
map
.
put
(
"lessonInfo"
,
bLessonRepository
.
selectByPrimaryKey
(
model
.
getLessonId
()));
map
.
put
(
"chapterList"
,
queryChapterListResDTOS
);
map
.
put
(
"lessonInfo"
,
bLessonRepository
.
selectByPrimaryKey
(
model
.
getLessonId
()));
return
map
;
}
...
...
@@ -107,20 +109,25 @@ public class BChapterServiceImpl implements BChapterService {
* @param model
* @return
*/
public
List
<
QueryChapterListResDTO
>
queryChapterListResDTO
(
QueryChapterListDTO
model
,
String
corpId
)
{
public
List
<
QueryChapterListResDTO
>
queryChapterListResDTO
(
QueryChapterListDTO
model
,
String
corpId
)
{
Map
param
=
new
HashMap
<
String
,
Object
>();
if
(
model
.
getLessonId
()
!=
null
&&
!
""
.
equals
(
model
.
getLessonId
()))
{
param
.
put
(
"lessonId"
,
model
.
getLessonId
());
}
param
.
put
(
"corpId"
,
corpId
);
param
.
put
(
"corpId"
,
corpId
);
return
bChapterRepository
.
queryBChapters
(
param
);
}
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Override
public
PersistModel
persist
(
BChapter
model
,
String
corpId
)
{
public
PersistModel
persist
(
BChapter
model
,
String
corpId
,
uploadDTO
dto
)
{
int
line
=
0
;
BFile
bFile
=
new
BFile
();
bFile
.
setFileName
(
dto
.
getFileName
());
bFile
.
setVideoUrl
(
dto
.
getVideoUrl
());
bFile
.
setType
(
dto
.
getType
());
if
(
model
.
getBusinessId
()
==
null
)
{
UserUtil
.
setCurrentPersistOperation
(
model
);
...
...
@@ -139,8 +146,11 @@ public class BChapterServiceImpl implements BChapterService {
int
sort
=
bChapterRepository
.
selectMaxSort
(
model
.
getPid
(),
model
.
getLessonId
());
model
.
setSort
(
sort
);
model
.
setCorpId
(
corpId
);
bFile
.
setChapterId
(
model
.
getBusinessId
());
bFile
.
setLessonId
(
model
.
getLessonId
());
UserUtil
.
setCurrentPersistOperation
(
bFile
);
line
=
bChapterRepository
.
insertSelective
(
model
);
int
x
=
bFileRepository
.
insertUploadFile
(
bFile
);
bChapterRepository
.
updateClassHourInLesson
(
model
.
getLessonId
());
//更新b_lesson表中 class_hour
}
else
{
UserUtil
.
setCurrentMergeOperation
(
model
);
...
...
src/main/java/org/rcisoft/business/bfile/controller/BFileController.java
View file @
91a9f517
...
...
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.io.IOUtils
;
import
org.rcisoft.business.bfile.dto.uploadDTO
;
import
org.rcisoft.business.bfile.entity.BFile
;
import
org.rcisoft.business.bfile.service.BFileService
;
import
org.rcisoft.common.component.Global
;
...
...
@@ -44,13 +45,12 @@ public class BFileController extends PaginationController<BFile> {
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"type"
,
value
=
"0视频 1音频 2ppt 3pdf 4附件"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"file"
,
value
=
"视频文件"
,
required
=
true
,
dataType
=
"MultipartFile"
)})
@PostMapping
(
value
=
"/upload"
)
public
Result
uploadVideo
(
String
type
,
HttpServletRequest
request
)
{
List
<
MultipartFile
>
list
=
((
MultipartHttpServletRequest
)
request
).
getFiles
(
"file"
);
Map
<
String
,
String
>
map
=
bFileService
.
uploadVideoToServer
(
list
,
type
);
public
Result
uploadVideo
(
String
type
,
MultipartFile
file
)
{
uploadDTO
data
=
bFileService
.
uploadVideoToServer
(
file
,
type
);
return
Result
.
builder
(
new
PersistModel
(
1
),
"上传成功"
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
map
);
data
);
}
// /**
...
...
src/main/java/org/rcisoft/business/bfile/dao/BFileRepository.java
View file @
91a9f517
...
...
@@ -51,5 +51,15 @@ public interface BFileRepository extends BaseMapper<BFile> {
@ResultMap
(
value
=
"BaseResultMap"
)
BFile
queryBVideoByChapterId
(
String
chapterId
);
/**
* 添加文件信息到file表
* @return
*/
@Insert
(
"INSERT INTO `b_file` "
+
"(business_id,lesson_id,chapter_id,file_name,video_url,file_url,type,flag,del_flag,remarks,create_by,update_by,update_date,create_date) "
+
"VALUES (#{businessId}, #{lessonId}, #{chapterId}, #{fileName}, #{videoUrl}, #{fileUrl}, #{type}, #{flag}, #{delFlag}, #{remarks}, #{createBy}, #{updateBy}, #{updateDate}, #{createDate})"
)
int
insertUploadFile
(
BFile
bFile
);
}
src/main/java/org/rcisoft/business/bfile/dto/uploadDTO.java
0 → 100644
View file @
91a9f517
package
org
.
rcisoft
.
business
.
bfile
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.hibernate.validator.constraints.Length
;
@Data
public
class
uploadDTO
{
@ApiModelProperty
(
value
=
"文件名称"
)
@Length
(
min
=
1
,
max
=
256
,
message
=
"长度最小为1,最大为200"
)
private
String
fileName
;
@ApiModelProperty
(
value
=
"文件路径"
)
@Length
(
min
=
1
,
max
=
256
,
message
=
"长度最小为1,最大为200"
)
private
String
videoUrl
;
@ApiModelProperty
(
value
=
"0视频 1音频 2ppt 3pdf 4附件"
)
private
String
type
;
}
src/main/java/org/rcisoft/business/bfile/entity/BFile.java
View file @
91a9f517
...
...
@@ -25,7 +25,7 @@ public class BFile extends IdEntity<BFile> {
/*视频名称*/
@Length
(
min
=
1
,
max
=
256
,
message
=
"长度最小为1,最大为200"
)
@NotBlank
private
String
video
Name
;
private
String
file
Name
;
/*视频地址*/
@Length
(
min
=
1
,
max
=
256
,
message
=
"长度最小为1,最大为200"
)
...
...
@@ -39,23 +39,10 @@ public class BFile extends IdEntity<BFile> {
@NotBlank
private
String
fileUrl
;
@Length
(
min
=
1
,
max
=
256
,
message
=
"长度最小为1,最大为200"
)
@NotBlank
private
String
audioUrl
;
@Length
(
min
=
1
,
max
=
256
,
message
=
"长度最小为1,最大为200"
)
@NotBlank
private
String
pptUrl
;
@Length
(
min
=
1
,
max
=
256
,
message
=
"长度最小为1,最大为200"
)
@NotBlank
private
String
pdfUrl
;
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
@NotBlank
private
String
lessonId
;
//课程ID
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
@NotBlank
private
String
chapterId
;
//节ID
...
...
src/main/java/org/rcisoft/business/bfile/service/BFileService.java
View file @
91a9f517
package
org
.
rcisoft
.
business
.
bfile
.
service
;
import
org.rcisoft.business.bfile.dto.uploadDTO
;
import
org.rcisoft.business.bfile.entity.BFile
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.model.PersistModel
;
...
...
@@ -49,7 +50,7 @@ public interface BFileService {
*/
PersistModel
removeBVideo
(
String
id
);
public
Map
<
String
,
String
>
uploadVideoToServer
(
List
<
MultipartFile
>
list
,
String
type
);
public
uploadDTO
uploadVideoToServer
(
MultipartFile
file
,
String
type
);
public
BFile
queryFileUrlByChapterId
(
String
chapterId
);
...
...
src/main/java/org/rcisoft/business/bfile/service/impl/BFileServiceImpl.java
View file @
91a9f517
This diff is collapsed.
Click to expand it.
src/main/java/org/rcisoft/sys/role/entity/SysRole.java
View file @
91a9f517
...
...
@@ -14,7 +14,7 @@ import javax.validation.constraints.NotBlank;
* Created by gaowenfeng on 2017/8/9.
*/
@Data
@Table
(
name
=
"
s
_role"
)
@Table
(
name
=
"
tm_admin
_role"
)
@NoArgsConstructor
@AllArgsConstructor
public
class
SysRole
extends
IdEntity
<
SysRole
>
{
...
...
src/main/java/org/rcisoft/sys/user/entity/SysUser.java
View file @
91a9f517
...
...
@@ -50,6 +50,9 @@ public class SysUser extends IdEntity<SysUser> {
private
String
gitLabUsername
;
//gitLab账号
private
String
gitLabImpressionToken
;
//gitLab账号模拟令牌
private
String
depart
;
private
String
position
;
/**
* 角色ID
*/
...
...
src/main/java/org/rcisoft/sys/user/service/impl/SysUserServiceImpl.java
View file @
91a9f517
...
...
@@ -3,6 +3,8 @@ package org.rcisoft.sys.user.service.impl;
import
com.alibaba.fastjson.JSON
;
import
org.apache.commons.lang.StringUtils
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.common.util.feignClient.ContactFeignClient
;
import
org.rcisoft.common.util.outClient.MTCotactApiRequestClient
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.result.ResultServiceEnums
;
...
...
@@ -35,12 +37,21 @@ public class SysUserServiceImpl implements SysUserService {
@Autowired
private
SysMenuRepository
sysMenuRepository
;
@Autowired
private
MTCotactApiRequestClient
mtCotactApiRequestClient
;
@Autowired
private
Global
global
;
@Override
public
List
<
SysUser
>
queryUsersByPagination
(
PageUtil
pageUtil
,
QuerySysUserDTO
dto
)
{
return
sysUserMapper
.
queryUsers
(
dto
);
List
<
SysUser
>
users
=
sysUserMapper
.
queryUsers
(
dto
);
List
<
String
>
list
=
new
ArrayList
<>();
for
(
SysUser
user:
users
){
list
.
add
(
user
.
getBusinessId
());
}
return
users
;
}
@Override
...
...
src/main/resources/mapper/business/bfile/mapper/BFileMapper.xml
View file @
91a9f517
...
...
@@ -10,12 +10,9 @@
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"
video_name"
jdbcType=
"VARCHAR"
property=
"video
Name"
/>
<result
column=
"
file_name"
jdbcType=
"VARCHAR"
property=
"file
Name"
/>
<result
column=
"video_url"
jdbcType=
"VARCHAR"
property=
"videoUrl"
/>
<result
column=
"audio_url"
jdbcType=
"VARCHAR"
property=
"audioUrl"
/>
<result
column=
"file_url"
jdbcType=
"VARCHAR"
property=
"fileUrl"
/>
<result
column=
"ppt_url"
jdbcType=
"VARCHAR"
property=
"pptUrl"
/>
<result
column=
"pdf_url"
jdbcType=
"VARCHAR"
property=
"pdfUrl"
/>
<result
column=
"type"
jdbcType=
"VARCHAR"
property=
"type"
/>
<result
column=
"chapter_id"
jdbcType=
"VARCHAR"
property=
"chapterId"
/>
<result
column=
"lesson_id"
jdbcType=
"VARCHAR"
property=
"lessonId"
/>
...
...
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