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
374db704
Commit
374db704
authored
Nov 19, 2019
by
zhangqingle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改流文件下载
parent
b6d3eb29
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
96 additions
and
36 deletions
+96
-36
BChapterController.java
...soft/business/bchapter/controller/BChapterController.java
+36
-6
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+4
-4
AddLessonDTO.java
...n/java/org/rcisoft/business/blesson/dto/AddLessonDTO.java
+0
-3
BLesson.java
...ain/java/org/rcisoft/business/blesson/entity/BLesson.java
+0
-3
BLessonPerson.java
...va/org/rcisoft/business/blesson/entity/BLessonPerson.java
+3
-1
BLessonPersonServiceImpl.java
...siness/blesson/service/impl/BLessonPersonServiceImpl.java
+3
-2
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+8
-7
BPersonValueRepository.java
...oft/business/bpersonvalue/dao/BPersonValueRepository.java
+5
-3
BPersonValueServiceImpl.java
...ss/bpersonvalue/service/impl/BPersonValueServiceImpl.java
+1
-1
BRStudentChapterServiceImpl.java
...dentchapter/service/impl/BRStudentChapterServiceImpl.java
+23
-1
ResultServiceEnums.java
...main/java/org/rcisoft/core/result/ResultServiceEnums.java
+1
-0
OfficeToPdf.java
src/main/java/org/rcisoft/core/util/OfficeToPdf.java
+2
-1
SysUserMapper.java
src/main/java/org/rcisoft/sys/user/dao/SysUserMapper.java
+1
-1
MyInfoDTO.java
src/main/java/org/rcisoft/sys/user/dto/MyInfoDTO.java
+3
-0
SysUser.java
src/main/java/org/rcisoft/sys/user/entity/SysUser.java
+1
-0
BLessonPersonMapper.xml
...es/mapper/business/blesson/mapper/BLessonPersonMapper.xml
+4
-3
UserMapper.xml
src/main/resources/mapper/sys/user/mapper/UserMapper.xml
+1
-0
No files found.
src/main/java/org/rcisoft/business/bchapter/controller/BChapterController.java
View file @
374db704
...
@@ -30,9 +30,15 @@ import org.rcisoft.core.util.UploadUtil;
...
@@ -30,9 +30,15 @@ import org.rcisoft.core.util.UploadUtil;
import
org.rcisoft.sys.role.dao.SysRoleRepository
;
import
org.rcisoft.sys.role.dao.SysRoleRepository
;
import
org.rcisoft.sys.user.bean.CurUser
;
import
org.rcisoft.sys.user.bean.CurUser
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.io.FileSystemResource
;
import
org.springframework.core.io.InputStreamResource
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
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.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartHttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
...
@@ -138,17 +144,41 @@ public class BChapterController extends PaginationController<BChapter> {
...
@@ -138,17 +144,41 @@ public class BChapterController extends PaginationController<BChapter> {
newFileUrl
);
newFileUrl
);
}
}
@ApiOperation
(
value
=
"208 下载文件
返回服务器地址"
,
notes
=
"下载文件 返回服务器地址
"
)
@ApiOperation
(
value
=
"208 下载文件
流的形式返回"
,
notes
=
"下载文件 流的形式返回
"
)
@GetMapping
(
"/getDownLoadUrl"
)
@GetMapping
(
"/getDownLoadUrl"
)
public
Result
getDownLoadUrl
(
CurUser
curUser
,
@Valid
BFile
file
,
BindingResult
br
)
throws
IOException
{
public
void
getDownLoadUrl
(
BFile
file
,
HttpServletRequest
req
,
MultipartHttpServletRequest
multiReq
)
throws
IOException
{
String
newFileUrl
=
bChapterService
.
getDownLoadUrl
(
file
);
String
newFileUrl
=
bChapterService
.
getDownLoadUrl
(
file
);
return
Result
.
builder
(
new
PersistModel
(
1
),
FileOutputStream
fos
=
new
FileOutputStream
(
new
File
(
"F://test//src//file//upload.jpg"
));
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
FileInputStream
fs
=(
FileInputStream
)
multiReq
.
getFile
(
"file"
).
getInputStream
();
MessageConstant
.
MESSAGE_ALERT_ERROR
,
byte
[]
buffer
=
new
byte
[
1024
];
newFileUrl
);
int
len
=
0
;
while
((
len
=
fs
.
read
(
buffer
))!=-
1
){
fos
.
write
(
buffer
,
0
,
len
);
}
fos
.
close
();
fs
.
close
();
}
@RequestMapping
(
value
=
"/downloadFile"
,
method
=
RequestMethod
.
GET
)
public
ResponseEntity
<
InputStreamResource
>
downloadFile
(
BFile
bfile
)
throws
IOException
{
String
filePath
=
bChapterService
.
getDownLoadUrl
(
bfile
);
FileSystemResource
file
=
new
FileSystemResource
(
filePath
);
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
add
(
"Cache-Control"
,
"no-cache, no-store, must-revalidate"
);
headers
.
add
(
"Content-Disposition"
,
String
.
format
(
"attachment; filename=\"%s\""
,
file
.
getFilename
()));
headers
.
add
(
"Pragma"
,
"no-cache"
);
headers
.
add
(
"Expires"
,
"0"
);
return
ResponseEntity
.
ok
()
.
headers
(
headers
)
.
contentLength
(
file
.
contentLength
())
.
contentType
(
MediaType
.
parseMediaType
(
"application/octet-stream"
))
.
body
(
new
InputStreamResource
(
file
.
getInputStream
()));
}
}
//
//
// @ApiOperation(value = "更改章节状态", notes = "根据章节ID更改章节状态")
// @ApiOperation(value = "更改章节状态", notes = "根据章节ID更改章节状态")
// @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar"),
// @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar"),
...
...
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
374db704
...
@@ -454,6 +454,7 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -454,6 +454,7 @@ public class BChapterServiceImpl implements BChapterService {
if
(
Double
.
parseDouble
(
newLearnProgress
)
>=
1
){
if
(
Double
.
parseDouble
(
newLearnProgress
)
>=
1
){
newLearnProgress
=
"1"
;
newLearnProgress
=
"1"
;
lessonPerson
.
setIsFinish
(
"2"
);
lessonPerson
.
setIsFinish
(
"2"
);
//TODO 判断 曾经是否学完过 奖励积分
}
}
lessonPerson
.
setLearnProgress
(
Float
.
parseFloat
(
newLearnProgress
)*
100
+
"%"
);
lessonPerson
.
setLearnProgress
(
Float
.
parseFloat
(
newLearnProgress
)*
100
+
"%"
);
bLessonPersonRepository
.
updateByPrimaryKeySelective
(
lessonPerson
);
bLessonPersonRepository
.
updateByPrimaryKeySelective
(
lessonPerson
);
...
@@ -538,14 +539,13 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -538,14 +539,13 @@ public class BChapterServiceImpl implements BChapterService {
@Override
@Override
public
String
getDownLoadUrl
(
BFile
bFile
)
{
public
String
getDownLoadUrl
(
BFile
bFile
)
{
if
(
StringUtils
.
isEmpty
(
bFile
.
getVideoUrl
())){
if
(
StringUtils
.
isEmpty
(
bFile
.
getVideoUrl
())
||
StringUtils
.
isEmpty
(
bFile
.
getLessonId
())
){
return
null
;
return
null
;
// throw new ServiceException(ResultServiceEnums.PARAM_NOT_NULL);
// throw new ServiceException(ResultServiceEnums.PARAM_NOT_NULL);
}
}
String
name
=
bFile
.
getVideoUrl
().
substring
(
bFile
.
getVideoUrl
().
lastIndexOf
(
"/"
)
+
1
);
String
name
=
bFile
.
getVideoUrl
().
substring
(
bFile
.
getVideoUrl
().
lastIndexOf
(
"/"
)
+
1
);
String
filePath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
global
.
getUSER_DOWNLOAD
()
+
File
.
separator
+
bFile
.
getCorpId
()
+
File
.
separator
+
bFile
.
getUserId
();
String
filePath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
global
.
getCOURSE_LOCATION
()
+
File
.
separator
+
bFile
.
getLessonId
();
// String returnBasePath = global.getRETURN_UPLOAD_SERVER_LOCATION() + global.getUSER_DOWNLOAD() + File.separator + bFile.getCorpId() + File.separator + bFile.getUserId();
String
returnBasePath
=
global
.
getRETURN_UPLOAD_SERVER_LOCATION
()
+
global
.
getCOURSE_LOCATION
()
+
File
.
separator
+
bFile
.
getLessonId
();
String
returnBasePath
=
global
.
getRETURN_UPLOAD_SERVER_NOTIP_LOCATION
()
+
global
.
getUSER_DOWNLOAD
()
+
File
.
separator
+
bFile
.
getCorpId
()
+
File
.
separator
+
bFile
.
getUserId
();
File
file
=
new
File
(
filePath
);
File
file
=
new
File
(
filePath
);
File
fileOld
=
new
File
(
filePath
+
File
.
separator
+
name
);
File
fileOld
=
new
File
(
filePath
+
File
.
separator
+
name
);
if
(
fileOld
.
exists
())
{
if
(
fileOld
.
exists
())
{
...
...
src/main/java/org/rcisoft/business/blesson/dto/AddLessonDTO.java
View file @
374db704
...
@@ -44,16 +44,13 @@ public class AddLessonDTO {
...
@@ -44,16 +44,13 @@ public class AddLessonDTO {
private
String
lessonType
;
private
String
lessonType
;
@ApiModelProperty
(
value
=
"消耗积分"
)
@ApiModelProperty
(
value
=
"消耗积分"
)
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
private
Integer
valueConsume
;
private
Integer
valueConsume
;
@ApiModelProperty
(
value
=
"获得积分"
)
@ApiModelProperty
(
value
=
"获得积分"
)
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
private
Integer
valueGain
;
private
Integer
valueGain
;
@ApiModelProperty
(
value
=
"更新积分日期"
)
@ApiModelProperty
(
value
=
"更新积分日期"
)
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
private
Date
valueUpdateDate
;
private
Date
valueUpdateDate
;
// @ApiModelProperty(value = "积分")
// @ApiModelProperty(value = "积分")
...
...
src/main/java/org/rcisoft/business/blesson/entity/BLesson.java
View file @
374db704
...
@@ -111,15 +111,12 @@ public class BLesson extends IdEntity<BLesson> {
...
@@ -111,15 +111,12 @@ public class BLesson extends IdEntity<BLesson> {
private
String
hotNumber
;
private
String
hotNumber
;
@ApiModelProperty
(
value
=
"消耗积分"
)
@ApiModelProperty
(
value
=
"消耗积分"
)
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
private
Integer
valueConsume
;
private
Integer
valueConsume
;
@ApiModelProperty
(
value
=
"获得积分"
)
@ApiModelProperty
(
value
=
"获得积分"
)
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
private
Integer
valueGain
;
private
Integer
valueGain
;
@ApiModelProperty
(
value
=
"更新积分日期"
)
@ApiModelProperty
(
value
=
"更新积分日期"
)
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
private
Date
valueUpdateDate
;
private
Date
valueUpdateDate
;
// @ApiModelProperty(value = "积分")
// @ApiModelProperty(value = "积分")
...
...
src/main/java/org/rcisoft/business/blesson/entity/BLessonPerson.java
View file @
374db704
...
@@ -57,10 +57,12 @@ public class BLessonPerson extends IdEntity<BLessonPerson> {
...
@@ -57,10 +57,12 @@ public class BLessonPerson extends IdEntity<BLessonPerson> {
@Length
(
min
=
1
,
max
=
1
,
message
=
"长度最小为1,最大为1"
)
@Length
(
min
=
1
,
max
=
1
,
message
=
"长度最小为1,最大为1"
)
private
String
chapterId
;
private
String
chapterId
;
@ApiModelProperty
(
value
=
"是否为指派(0自选(选修) 1指派(必修))"
)
@ApiModelProperty
(
value
=
"是否为指派(0自选(选修) 1指派(必修))"
)
@Length
(
min
=
1
,
max
=
1
,
message
=
"长度最小为1,最大为1"
)
@Length
(
min
=
1
,
max
=
1
,
message
=
"长度最小为1,最大为1"
)
private
String
isAppoint
;
private
String
isAppoint
;
@ApiModelProperty
(
value
=
"曾经学完过(0未学完 1已学完)"
)
private
String
everFinished
;
//-----------培训---------------
//-----------培训---------------
@ApiModelProperty
(
value
=
"培训是否报名(0 未报名 1已报名))"
)
@ApiModelProperty
(
value
=
"培训是否报名(0 未报名 1已报名))"
)
@Length
(
min
=
1
,
max
=
1
,
message
=
"长度最小为1,最大为1"
)
@Length
(
min
=
1
,
max
=
1
,
message
=
"长度最小为1,最大为1"
)
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonPersonServiceImpl.java
View file @
374db704
...
@@ -268,8 +268,9 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
...
@@ -268,8 +268,9 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
//增加用户积分详情
//增加用户积分详情
if
(
bLesson
.
getValueConsume
()
!=
null
&&
bLesson
.
getValueConsume
()
!=
0
){
if
(
bLesson
.
getValueConsume
()
!=
null
&&
bLesson
.
getValueConsume
()
!=
0
){
BPersonValue
bPersonValue
=
new
BPersonValue
(
curUser
.
getUserId
(),
"学习课程"
,
bLesson
.
getValueConsume
(),
"1"
);
BPersonValue
bPersonValue
=
new
BPersonValue
(
curUser
.
getUserId
(),
"学习课程"
,
bLesson
.
getValueConsume
(),
"1"
);
bLessonServiceImpl
.
addValueEvent
(
curUser
,
bPersonValue
,
bLesson
);
bLessonServiceImpl
.
addValueEvent
(
curUser
,
bPersonValue
,
userInfo
.
getLockNum
()
);
}
}
bLessonRepository
.
personNumberReCount
(
addMyLearnLessonDTO
.
getLessonId
(),
"0"
);
return
new
PersistModel
(
line
);
return
new
PersistModel
(
line
);
}
}
bLessonPerson
=
new
BLessonPerson
();
bLessonPerson
=
new
BLessonPerson
();
...
@@ -285,7 +286,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
...
@@ -285,7 +286,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
//积分变化后 s_user表中value字段重新统计
//积分变化后 s_user表中value字段重新统计
if
(
bLesson
.
getValueConsume
()
!=
null
&&
bLesson
.
getValueConsume
()
!=
0
){
if
(
bLesson
.
getValueConsume
()
!=
null
&&
bLesson
.
getValueConsume
()
!=
0
){
BPersonValue
bPersonValue
=
new
BPersonValue
(
curUser
.
getUserId
(),
"学习课程"
,
bLesson
.
getValueConsume
(),
"1"
);
BPersonValue
bPersonValue
=
new
BPersonValue
(
curUser
.
getUserId
(),
"学习课程"
,
bLesson
.
getValueConsume
(),
"1"
);
bLessonServiceImpl
.
addValueEvent
(
curUser
,
bPersonValue
,
bLesson
);
bLessonServiceImpl
.
addValueEvent
(
curUser
,
bPersonValue
,
userInfo
.
getLockNum
()
);
}
}
//重新统计在学人数
//重新统计在学人数
bLessonRepository
.
personNumberReCount
(
addMyLearnLessonDTO
.
getLessonId
(),
"0"
);
bLessonRepository
.
personNumberReCount
(
addMyLearnLessonDTO
.
getLessonId
(),
"0"
);
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
374db704
...
@@ -556,7 +556,7 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -556,7 +556,7 @@ public class BLessonServiceImpl implements BLessonService {
}
}
bPersonValueRepository
.
add
(
bPersonValue
);
bPersonValueRepository
.
add
(
bPersonValue
);
//积分变化后 s_user表中value字段重新统计
//积分变化后 s_user表中value字段重新统计
bPersonValueRepository
.
updateUserValue
(
bLesson
.
getLecturerId
(),
curUser
.
getCorpId
());
bPersonValueRepository
.
updateUserValue
(
bLesson
.
getLecturerId
(),
curUser
.
getCorpId
()
,
null
);
}
}
//int line = bLessonRepository.deleteByPrimaryKey(id);
//int line = bLessonRepository.deleteByPrimaryKey(id);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
...
@@ -1127,8 +1127,9 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -1127,8 +1127,9 @@ public class BLessonServiceImpl implements BLessonService {
//增加用户积分详情
//增加用户积分详情
if
(
bLesson
.
getValueConsume
()
!=
null
&&
bLesson
.
getValueConsume
()
!=
0
){
if
(
bLesson
.
getValueConsume
()
!=
null
&&
bLesson
.
getValueConsume
()
!=
0
){
BPersonValue
bPersonValue
=
new
BPersonValue
(
curUser
.
getUserId
(),
"报名培训"
,
bLesson
.
getValueConsume
(),
"1"
);
BPersonValue
bPersonValue
=
new
BPersonValue
(
curUser
.
getUserId
(),
"报名培训"
,
bLesson
.
getValueConsume
(),
"1"
);
addValueEvent
(
curUser
,
bPersonValue
,
bLesson
);
addValueEvent
(
curUser
,
bPersonValue
,
userInfo
.
getLockNum
()
);
}
}
bLessonRepository
.
personNumberReCount
(
bLesson
.
getBusinessId
(),
"1"
);
return
line
;
return
line
;
}
}
List
<
BLessonPerson
>
bLessonPersons
=
new
ArrayList
<>();
List
<
BLessonPerson
>
bLessonPersons
=
new
ArrayList
<>();
...
@@ -1157,8 +1158,9 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -1157,8 +1158,9 @@ public class BLessonServiceImpl implements BLessonService {
//增加用户积分详情
//增加用户积分详情
if
(
bLesson
.
getValueConsume
()
!=
null
&&
bLesson
.
getValueConsume
()
!=
0
){
if
(
bLesson
.
getValueConsume
()
!=
null
&&
bLesson
.
getValueConsume
()
!=
0
){
BPersonValue
bPersonValue
=
new
BPersonValue
(
curUser
.
getUserId
(),
"报名培训"
,
bLesson
.
getValueConsume
(),
"1"
);
BPersonValue
bPersonValue
=
new
BPersonValue
(
curUser
.
getUserId
(),
"报名培训"
,
bLesson
.
getValueConsume
(),
"1"
);
addValueEvent
(
curUser
,
bPersonValue
,
bLesson
);
addValueEvent
(
curUser
,
bPersonValue
,
userInfo
.
getLockNum
()
);
}
}
bLessonRepository
.
personNumberReCount
(
bLesson
.
getBusinessId
(),
"1"
);
return
line
;
return
line
;
}
}
...
@@ -1511,13 +1513,12 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -1511,13 +1513,12 @@ public class BLessonServiceImpl implements BLessonService {
}
}
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
,
rollbackFor
=
Exception
.
class
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
,
rollbackFor
=
Exception
.
class
)
public
void
addValueEvent
(
CurUser
curUser
,
BPersonValue
bPersonValue
,
BLesson
bLesson
){
public
void
addValueEvent
(
CurUser
curUser
,
BPersonValue
bPersonValue
,
Integer
lockNum
){
if
(
curUser
!=
null
&&
bPersonValue
!=
null
&&
b
Lesson
!=
null
){
if
(
curUser
!=
null
&&
bPersonValue
!=
null
&&
b
PersonValue
.
getValue
()
!=
null
&&
bPersonValue
.
getValue
()
!=
0
){
UserUtil
.
setCurrentPersistOperation
(
bPersonValue
);
UserUtil
.
setCurrentPersistOperation
(
bPersonValue
);
bPersonValueRepository
.
add
(
bPersonValue
);
bPersonValueRepository
.
add
(
bPersonValue
);
//积分变化后 s_user表中value字段重新统计
//积分变化后 s_user表中value字段重新统计
bPersonValueRepository
.
updateUserValue
(
curUser
.
getUserId
(),
curUser
.
getCorpId
());
bPersonValueRepository
.
updateUserValue
(
curUser
.
getUserId
(),
curUser
.
getCorpId
(),
lockNum
);
bLessonRepository
.
personNumberReCount
(
bLesson
.
getBusinessId
(),
"1"
);
}
}
}
}
...
...
src/main/java/org/rcisoft/business/bpersonvalue/dao/BPersonValueRepository.java
View file @
374db704
...
@@ -46,12 +46,14 @@ public interface BPersonValueRepository extends BaseMapper<BPersonValue> {
...
@@ -46,12 +46,14 @@ public interface BPersonValueRepository extends BaseMapper<BPersonValue> {
* @param personId
* @param personId
* @return
* @return
*/
*/
@Update
(
"
update s_user set \n"
+
@Update
(
"
<script>
update s_user set \n"
+
"`value`=((select sum(`value`) from b_person_value where del_flag != 1 and flag = 1 and type = 0 and person_id = #{personId} )-\n"
+
"`value`=((select sum(`value`) from b_person_value where del_flag != 1 and flag = 1 and type = 0 and person_id = #{personId} )-\n"
+
"(select sum(`value`) from b_person_value where del_flag != 1 and flag = 1 and type = 1 and person_id = #{personId} ))\n"
+
"(select sum(`value`) from b_person_value where del_flag != 1 and flag = 1 and type = 1 and person_id = #{personId} ))\n"
+
", lock_num = lock_num+1 "
+
", lock_num = lock_num+1 "
+
"where business_id = #{personId} and corp_id = #{corpId}"
)
"where business_id = #{personId} and corp_id = #{corpId}"
+
int
updateUserValue
(
@Param
(
"personId"
)
String
personId
,
@Param
(
"corpId"
)
String
corpId
);
"<if test=\" Integer !=null \"> and lock_num = lockNum </if> "
+
"</script>"
)
int
updateUserValue
(
@Param
(
"personId"
)
String
personId
,
@Param
(
"corpId"
)
String
corpId
,
@Param
(
"lockNum"
)
Integer
lockNum
);
/**
/**
* 判断当前积分是否大于扣除积分
* 判断当前积分是否大于扣除积分
...
...
src/main/java/org/rcisoft/business/bpersonvalue/service/impl/BPersonValueServiceImpl.java
View file @
374db704
...
@@ -67,7 +67,7 @@ public class BPersonValueServiceImpl implements BPersonValueService {
...
@@ -67,7 +67,7 @@ public class BPersonValueServiceImpl implements BPersonValueService {
}
}
int
line
=
bPersonValueRepository
.
add
(
bPersonValue
);
int
line
=
bPersonValueRepository
.
add
(
bPersonValue
);
//积分变化后 s_user表中value字段重新统计
//积分变化后 s_user表中value字段重新统计
bPersonValueRepository
.
updateUserValue
(
personValueDto
.
getPersonId
(),
corpId
);
bPersonValueRepository
.
updateUserValue
(
personValueDto
.
getPersonId
(),
corpId
,
null
);
return
line
;
return
line
;
}
}
}
}
src/main/java/org/rcisoft/business/brstudentchapter/service/impl/BRStudentChapterServiceImpl.java
View file @
374db704
...
@@ -9,9 +9,12 @@ import org.rcisoft.business.bchapter.dto.QueryChapterListResDTO;
...
@@ -9,9 +9,12 @@ import org.rcisoft.business.bchapter.dto.QueryChapterListResDTO;
import
org.rcisoft.business.bchapter.entity.BChapter
;
import
org.rcisoft.business.bchapter.entity.BChapter
;
import
org.rcisoft.business.bchapter.service.BChapterService
;
import
org.rcisoft.business.bchapter.service.BChapterService
;
import
org.rcisoft.business.blesson.dao.BLessonPersonRepository
;
import
org.rcisoft.business.blesson.dao.BLessonPersonRepository
;
import
org.rcisoft.business.blesson.dao.BLessonRepository
;
import
org.rcisoft.business.blesson.dto.AddMyLearnLessonDTO
;
import
org.rcisoft.business.blesson.dto.AddMyLearnLessonDTO
;
import
org.rcisoft.business.blesson.entity.BLesson
;
import
org.rcisoft.business.blesson.entity.BLesson
;
import
org.rcisoft.business.blesson.entity.BLessonPerson
;
import
org.rcisoft.business.blesson.entity.BLessonPerson
;
import
org.rcisoft.business.blesson.service.impl.BLessonServiceImpl
;
import
org.rcisoft.business.bpersonvalue.entity.BPersonValue
;
import
org.rcisoft.business.brstudentchapter.dto.BRStudentChapterDto
;
import
org.rcisoft.business.brstudentchapter.dto.BRStudentChapterDto
;
import
org.rcisoft.core.util.IdGen
;
import
org.rcisoft.core.util.IdGen
;
import
org.rcisoft.core.util.UserUtil
;
import
org.rcisoft.core.util.UserUtil
;
...
@@ -56,6 +59,10 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
...
@@ -56,6 +59,10 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
private
BChapterService
bChapterServiceImpl
;
private
BChapterService
bChapterServiceImpl
;
@Autowired
@Autowired
BRStudentChapterRepository
brStudentChapterRepository
;
BRStudentChapterRepository
brStudentChapterRepository
;
@Autowired
BLessonServiceImpl
bLessonServiceImpl
;
@Autowired
BLessonRepository
bLessonRepository
;
/**
/**
*
*
...
@@ -126,7 +133,14 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
...
@@ -126,7 +133,14 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
// 判斷是否已經開始觀看此課程
// 判斷是否已經開始觀看此課程
if
(
null
!=
bLessonPersonList
&&
bLessonPersonList
.
size
()
>
0
){
if
(
null
!=
bLessonPersonList
&&
bLessonPersonList
.
size
()
>
0
){
BLessonPerson
bLessonPerson
=
this
.
dealBLessonPerson
(
bLessonPersonList
.
get
(
0
),
brStudentChapterDto
,
totalProgress
);
BLessonPerson
bLessonPerson
=
this
.
dealBLessonPerson
(
bLessonPersonList
.
get
(
0
),
brStudentChapterDto
,
totalProgress
);
//TODO 判断是否为已学完 曾经是否学完过 奖励积分
BLesson
bLesson
=
bLessonRepository
.
selectByPrimaryKey
(
brStudentChapterDto
.
getLessonId
());
if
(
bLesson
!=
null
&&
"2"
.
equals
(
bLessonPerson
.
getIsFinish
())
&&
!
"1"
.
equals
(
bLessonPerson
.
getEverFinished
())){
//查询课程信息
BPersonValue
bPersonValue
=
new
BPersonValue
(
curUser
.
getUserId
(),
"报名培训"
,
bLesson
.
getValueGain
(),
"0"
);
bLessonServiceImpl
.
addValueEvent
(
curUser
,
bPersonValue
,
null
);
}
bLessonPerson
.
setEverFinished
(
"1"
);
bLessonPersonRepository
.
updateByPrimaryKeySelective
(
bLessonPerson
);
bLessonPersonRepository
.
updateByPrimaryKeySelective
(
bLessonPerson
);
}
else
{
}
else
{
BLessonPerson
bLessonPerson
=
new
BLessonPerson
();
BLessonPerson
bLessonPerson
=
new
BLessonPerson
();
...
@@ -134,6 +148,14 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
...
@@ -134,6 +148,14 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
bLessonPerson
=
this
.
dealBLessonPerson
(
bLessonPersonList
.
get
(
0
),
brStudentChapterDto
,
totalProgress
);
bLessonPerson
=
this
.
dealBLessonPerson
(
bLessonPersonList
.
get
(
0
),
brStudentChapterDto
,
totalProgress
);
bLessonPerson
.
setPersonId
(
brStudentChapterDto
.
getStudentId
());
bLessonPerson
.
setPersonId
(
brStudentChapterDto
.
getStudentId
());
bLessonPerson
.
setLessonId
(
brStudentChapterDto
.
getLessonId
());
bLessonPerson
.
setLessonId
(
brStudentChapterDto
.
getLessonId
());
//TODO 判断是否为已学完 曾经是否学完过 奖励积分
BLesson
bLesson
=
bLessonRepository
.
selectByPrimaryKey
(
brStudentChapterDto
.
getLessonId
());
if
(
bLesson
!=
null
&&
"2"
.
equals
(
bLessonPerson
.
getIsFinish
())
&&
!
"1"
.
equals
(
bLessonPerson
.
getEverFinished
())){
//查询课程信息
BPersonValue
bPersonValue
=
new
BPersonValue
(
curUser
.
getUserId
(),
"报名培训"
,
bLesson
.
getValueGain
(),
"0"
);
bLessonServiceImpl
.
addValueEvent
(
curUser
,
bPersonValue
,
null
);
}
bLessonPerson
.
setEverFinished
(
"1"
);
// 保存课程学习进度
// 保存课程学习进度
line
=
bLessonPersonRepository
.
insertSelective
(
bLessonPerson
)
;
line
=
bLessonPersonRepository
.
insertSelective
(
bLessonPerson
)
;
}
}
...
...
src/main/java/org/rcisoft/core/result/ResultServiceEnums.java
View file @
374db704
...
@@ -243,6 +243,7 @@ public enum ResultServiceEnums {
...
@@ -243,6 +243,7 @@ public enum ResultServiceEnums {
NUM_IS_ERROR
(
143
,
"积分输入格式错误"
),
NUM_IS_ERROR
(
143
,
"积分输入格式错误"
),
NOT_USE_ADMIN_ROLE
(
144
,
"该用户是管理员,不能分配其他角色"
),
NOT_USE_ADMIN_ROLE
(
144
,
"该用户是管理员,不能分配其他角色"
),
VALUE_NOT_ENOUGH
(
145
,
"积分输入格式错误"
),
VALUE_NOT_ENOUGH
(
145
,
"积分输入格式错误"
),
CHANGE_HAVE_MEDIA
(
146
,
"该资源可能包含视频、音频,不能转换,请自行转换"
),
;
;
private
Integer
code
;
private
Integer
code
;
...
...
src/main/java/org/rcisoft/core/util/OfficeToPdf.java
View file @
374db704
...
@@ -135,7 +135,8 @@ public class OfficeToPdf {
...
@@ -135,7 +135,8 @@ public class OfficeToPdf {
if
(
connection
!=
null
)
{
if
(
connection
!=
null
)
{
connection
.
disconnect
();
connection
.
disconnect
();
}
else
{
}
else
{
throw
new
ServiceException
(
ResultServiceEnums
.
CHANGE_FILE_ERROR
);
// throw new ServiceException(ResultServiceEnums.CHANGE_FILE_ERROR);
throw
new
ServiceException
(
ResultServiceEnums
.
CHANGE_HAVE_MEDIA
);
}
}
}
}
return
1
;
return
1
;
...
...
src/main/java/org/rcisoft/sys/user/dao/SysUserMapper.java
View file @
374db704
...
@@ -225,7 +225,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
...
@@ -225,7 +225,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
"</script>"
)
"</script>"
)
MyInfoDTO
queryMyInfo
(
CurUser
curUser
);
MyInfoDTO
queryMyInfo
(
CurUser
curUser
);
@Select
(
"<script>select business_id id,`name` name ,head_pic headPic, `value` value from s_user where business_id = #{id}"
+
@Select
(
"<script>select business_id id,`name` name ,head_pic headPic, `value` value
, lock_num lockNum
from s_user where business_id = #{id}"
+
"</script>"
)
"</script>"
)
MyInfoDTO
getNameById
(
String
id
);
MyInfoDTO
getNameById
(
String
id
);
...
...
src/main/java/org/rcisoft/sys/user/dto/MyInfoDTO.java
View file @
374db704
...
@@ -27,4 +27,7 @@ public class MyInfoDTO {
...
@@ -27,4 +27,7 @@ public class MyInfoDTO {
@ApiModelProperty
(
value
=
"未完成考试数"
)
@ApiModelProperty
(
value
=
"未完成考试数"
)
private
String
notFinishedExam
;
private
String
notFinishedExam
;
@ApiModelProperty
(
value
=
"用于防止积分为负数"
)
private
Integer
lockNum
;
}
}
src/main/java/org/rcisoft/sys/user/entity/SysUser.java
View file @
374db704
...
@@ -51,6 +51,7 @@ public class SysUser extends IdEntity<SysUser> {
...
@@ -51,6 +51,7 @@ public class SysUser extends IdEntity<SysUser> {
private
String
gitLabId
;
//gitLab账号id
private
String
gitLabId
;
//gitLab账号id
private
String
gitLabUsername
;
//gitLab账号
private
String
gitLabUsername
;
//gitLab账号
private
String
gitLabImpressionToken
;
//gitLab账号模拟令牌
private
String
gitLabImpressionToken
;
//gitLab账号模拟令牌
private
Integer
lockNum
;
@Transient
@Transient
private
String
depart
;
private
String
depart
;
@Transient
@Transient
...
...
src/main/resources/mapper/business/blesson/mapper/BLessonPersonMapper.xml
View file @
374db704
...
@@ -40,9 +40,10 @@
...
@@ -40,9 +40,10 @@
<result
column=
"is_apply"
jdbcType=
"VARCHAR"
property=
"isApply"
/>
<result
column=
"is_apply"
jdbcType=
"VARCHAR"
property=
"isApply"
/>
<result
column=
"train_is_sign"
jdbcType=
"VARCHAR"
property=
"trainIsSign"
/>
<result
column=
"train_is_sign"
jdbcType=
"VARCHAR"
property=
"trainIsSign"
/>
<result
column=
"apply_date"
jdbcType=
"VARCHAR"
property=
"applyDate"
/>
<result
column=
"apply_date"
jdbcType=
"TIMESTAMP"
property=
"applyDate"
/>
<result
column=
"finish_date"
jdbcType=
"VARCHAR"
property=
"finishDate"
/>
<result
column=
"finish_date"
jdbcType=
"TIMESTAMP"
property=
"finishDate"
/>
<result
column=
"sign_date"
jdbcType=
"VARCHAR"
property=
"signDate"
/>
<result
column=
"sign_date"
jdbcType=
"TIMESTAMP"
property=
"signDate"
/>
<result
column=
"ever_finished"
jdbcType=
"VARCHAR"
property=
"everFinished"
/>
</resultMap>
</resultMap>
</mapper>
</mapper>
\ No newline at end of file
src/main/resources/mapper/sys/user/mapper/UserMapper.xml
View file @
374db704
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
<result
column=
"FLAG"
property=
"flag"
jdbcType=
"VARCHAR"
/>
<result
column=
"FLAG"
property=
"flag"
jdbcType=
"VARCHAR"
/>
<result
column=
"update_date"
property=
"updateDate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_date"
property=
"updateDate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_date"
property=
"createDate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_date"
property=
"createDate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"lock_num"
property=
"lockNum"
jdbcType=
"INTEGER"
/>
<!-- <result column="role_name" property="roleName" jdbcType="VARCHAR" />-->
<!-- <result column="role_name" property="roleName" jdbcType="VARCHAR" />-->
<collection
property=
"roleList"
ofType=
"org.rcisoft.sys.user.entity.SysUser"
<collection
property=
"roleList"
ofType=
"org.rcisoft.sys.user.entity.SysUser"
javaType=
"java.util.ArrayList"
select=
"org.rcisoft.sys.user.dao.SysUserMapper.queryRoleByUserId"
javaType=
"java.util.ArrayList"
select=
"org.rcisoft.sys.user.dao.SysUserMapper.queryRoleByUserId"
...
...
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