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
46454933
Commit
46454933
authored
Dec 27, 2019
by
zhangqingle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改BUG
parent
c33a7dc0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
25 deletions
+37
-25
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+14
-10
BLessonPersonServiceImpl.java
...siness/blesson/service/impl/BLessonPersonServiceImpl.java
+5
-3
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+13
-10
BRStudentChapterServiceImpl.java
...dentchapter/service/impl/BRStudentChapterServiceImpl.java
+4
-2
BLessonMapper.xml
...esources/mapper/business/blesson/mapper/BLessonMapper.xml
+1
-0
No files found.
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
46454933
...
...
@@ -129,13 +129,15 @@ public class BChapterServiceImpl implements BChapterService {
model
.
setLessonId
(
lessonId
);
model
.
setStudentId
(
curUser
.
getUserId
());
List
<
QueryChapterListResDTO
>
queryChapterListResDTOS
=
queryChapterListResDTO
(
model
,
curUser
.
getCorpId
());
for
(
QueryChapterListResDTO
queryChapterListResDTO
:
queryChapterListResDTOS
)
{
for
(
QueryChapterListResDTO
childList
:
queryChapterListResDTO
.
getChildList
())
{
// 遍历学生章节中间表 查询学生观看章节进度
List
<
BRStudentChapter
>
brStudentChapterList
=
brStudentChapterRepository
.
queryByStuIdAndChapter
(
childList
.
getBusinessId
(),
curUser
.
getUserId
());
if
(
null
!=
brStudentChapterList
&&
brStudentChapterList
.
size
()
>
0
)
{
childList
.
setProgress
(
brStudentChapterList
.
get
(
0
).
getProgress
()
*
100
+
"%"
);
childList
.
setCurrentLocation
(
brStudentChapterList
.
get
(
0
).
getCurrentLocation
());
if
(
StringUtils
.
isNotEmpty
(
curUser
.
getUserId
())){
for
(
QueryChapterListResDTO
queryChapterListResDTO
:
queryChapterListResDTOS
)
{
for
(
QueryChapterListResDTO
childList
:
queryChapterListResDTO
.
getChildList
())
{
// 遍历学生章节中间表 查询学生观看章节进度
List
<
BRStudentChapter
>
brStudentChapterList
=
brStudentChapterRepository
.
queryByStuIdAndChapter
(
childList
.
getBusinessId
(),
curUser
.
getUserId
());
if
(
null
!=
brStudentChapterList
&&
brStudentChapterList
.
size
()
>
0
)
{
childList
.
setProgress
(
brStudentChapterList
.
get
(
0
).
getProgress
()
*
100
+
"%"
);
childList
.
setCurrentLocation
(
brStudentChapterList
.
get
(
0
).
getCurrentLocation
());
}
}
}
}
...
...
@@ -174,7 +176,7 @@ public class BChapterServiceImpl implements BChapterService {
List
<
String
>
lecturerIds
=
new
ArrayList
<>();
lecturerIds
.
add
(
bLesson
.
getLecturerId
());
MTUserGetsReqDTO
mtUserGetsReqDTOlecDept
=
new
MTUserGetsReqDTO
();
mtUserGetsReqDTOlecDept
.
setCorpId
(
curUser
.
getCorpId
());
mtUserGetsReqDTOlecDept
.
setCorpId
(
bLesson
.
getCorpId
());
mtUserGetsReqDTOlecDept
.
setIds
(
lecturerIds
);
List
<
MTUserInfoRspDTO
>
mtUserInfoRspDTOLecDeptList
=
mtCotactApiRequestClient
.
userGets
(
mtUserGetsReqDTOlecDept
);
if
(
mtUserInfoRspDTOLecDeptList
!=
null
&&
mtUserInfoRspDTOLecDeptList
.
size
()
>
0
)
{
...
...
@@ -495,8 +497,10 @@ public class BChapterServiceImpl implements BChapterService {
//TODO 判断 曾经是否学完过 奖励积分
if
(
IsFinishEnum
.
FINISHED
.
getCode
().
equals
(
lessonPerson
.
getIsFinish
())
&&
!(
IsFinishEnum
.
LEARNING
.
getCode
().
equals
(
lessonPerson
.
getEverFinished
())))
{
//查询课程信息
BPersonValue
bPersonValue
=
new
BPersonValue
(
lessonPerson
.
getPersonId
(),
"学完!@#课程"
,
bLesson
.
getValueGain
(),
"0"
,
bLesson
.
getBusinessId
());
bLessonServiceImpl
.
addValueEvent
(
lessonPerson
.
getPersonId
(),
bPersonValue
,
null
);
if
(
StringUtils
.
isNotEmpty
(
bLesson
.
getValueGain
())
&&
Long
.
parseLong
(
bLesson
.
getValueGain
())
>
0
){
BPersonValue
bPersonValue
=
new
BPersonValue
(
lessonPerson
.
getPersonId
(),
"学完!@#课程"
,
bLesson
.
getValueGain
(),
"0"
,
bLesson
.
getBusinessId
());
bLessonServiceImpl
.
addValueEvent
(
lessonPerson
.
getPersonId
(),
bPersonValue
,
null
);
}
lessonPerson
.
setEverFinished
(
"1"
);
}
// 规避 复数 和超100% 的情况
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonPersonServiceImpl.java
View file @
46454933
...
...
@@ -313,7 +313,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
if
(
userInfo
==
null
){
throw
new
ServiceException
(
ResultServiceEnums
.
COMPANY_NOT_EXISTS
);
}
if
(
bLesson
.
getValueConsume
()
!=
null
&&
(
StringUtils
.
isEmpty
(
userInfo
.
getValue
())
||
Long
.
valueOf
(
userInfo
.
getValue
())
<
Long
.
valueOf
(
bLesson
.
getValueConsume
()))){
if
(
!(
curUser
.
getUserId
().
equals
(
bLesson
.
getLecturerId
()))
&&
bLesson
.
getValueConsume
()
!=
null
&&
!(
"0"
.
equals
(
bLesson
.
getValueConsume
()))
&&
(
StringUtils
.
isEmpty
(
userInfo
.
getValue
())
||
Long
.
valueOf
(
userInfo
.
getValue
())
<
Long
.
valueOf
(
bLesson
.
getValueConsume
()))){
throw
new
ServiceException
(
ResultServiceEnums
.
VALUE_NOT_ENOUGH
);
}
//查询是否已有已删除
...
...
@@ -391,8 +391,10 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
//TODO 判断 曾经是否学完过 奖励积分
if
(
!(
"2"
.
equals
(
bLessonPerson
.
getTrainIsSign
()))
&&
!(
"1"
.
equals
(
bLessonPerson
.
getEverFinished
()))){
//查询课程信息
BPersonValue
bPersonValue
=
new
BPersonValue
(
bLessonPerson
.
getPersonId
(),
"参加!@#培训"
,
bLesson
.
getValueGain
(),
"0"
,
bLesson
.
getBusinessId
());
bLessonServiceImpl
.
addValueEvent
(
bLessonPerson
.
getPersonId
(),
bPersonValue
,
null
);
if
(
StringUtils
.
isNotEmpty
(
bLesson
.
getValueGain
())
&&
Long
.
parseLong
(
bLesson
.
getValueGain
())
>
0
){
BPersonValue
bPersonValue
=
new
BPersonValue
(
bLessonPerson
.
getPersonId
(),
"参加!@#培训"
,
bLesson
.
getValueGain
(),
"0"
,
bLesson
.
getBusinessId
());
bLessonServiceImpl
.
addValueEvent
(
bLessonPerson
.
getPersonId
(),
bPersonValue
,
null
);
}
bLessonPerson
.
setEverFinished
(
"1"
);
}
bLessonPerson
.
setSignDate
(
new
Date
());
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
46454933
...
...
@@ -146,7 +146,7 @@ public class BLessonServiceImpl implements BLessonService {
List
<
String
>
ids
=
new
ArrayList
<>();
ids
.
add
(
bLesson
.
getLecturerId
());
MTUserGetsReqDTO
mtUserGetsReqDTO
=
new
MTUserGetsReqDTO
();
mtUserGetsReqDTO
.
setCorpId
(
curUser
.
getCorpId
());
mtUserGetsReqDTO
.
setCorpId
(
bLesson
.
getCorpId
());
mtUserGetsReqDTO
.
setIds
(
ids
);
List
<
MTUserInfoRspDTO
>
mtUserInfoRspDTOList
=
cotactApiRequestClient
.
userGets
(
mtUserGetsReqDTO
);
if
(
mtUserInfoRspDTOList
!=
null
&&
mtUserInfoRspDTOList
.
size
()
>
0
)
{
...
...
@@ -608,17 +608,18 @@ public class BLessonServiceImpl implements BLessonService {
UserUtil
.
setCurrentPersistOperation
(
bPersonValue
);
bPersonValue
.
setPersonId
(
bLesson
.
getLecturerId
());
bPersonValue
.
setType
(
"0"
);
if
(
LessonTypeEnum
.
LESSON
.
getCode
().
equals
(
bLesson
.
getLessonType
()))
{
if
(
LessonTypeEnum
.
LESSON
.
getCode
().
equals
(
bLesson
.
getLessonType
())
&&
StringUtils
.
isNotEmpty
(
bReleaseValueList
.
get
(
0
).
getLessonValue
())
&&
Long
.
parseLong
(
bReleaseValueList
.
get
(
0
).
getLessonValue
())
>
0
)
{
bPersonValue
.
setEvent
(
"发布!@#课程"
);
bPersonValue
.
setValue
(
bReleaseValueList
.
get
(
0
).
getLessonValue
());
bPersonValue
.
setLessonId
(
bLesson
.
getBusinessId
());
bPersonValueRepository
.
add
(
bPersonValue
);
}
if
(
LessonTypeEnum
.
TRAIN
.
getCode
().
equals
(
bLesson
.
getLessonType
()))
{
if
(
LessonTypeEnum
.
TRAIN
.
getCode
().
equals
(
bLesson
.
getLessonType
())
&&
StringUtils
.
isNotEmpty
(
bReleaseValueList
.
get
(
0
).
getLessonValue
())
&&
Long
.
parseLong
(
bReleaseValueList
.
get
(
0
).
getTrainValue
())
>
0
)
{
bPersonValue
.
setEvent
(
"发布!@#培训"
);
bPersonValue
.
setValue
(
bReleaseValueList
.
get
(
0
).
getTrainValue
());
bPersonValue
.
setLessonId
(
bLesson
.
getBusinessId
());
bPersonValueRepository
.
add
(
bPersonValue
);
}
bPersonValueRepository
.
add
(
bPersonValue
);
//积分变化后 s_user表中value字段重新统计
bPersonValueRepository
.
updateUserValue
(
bLesson
.
getLecturerId
(),
null
);
}
...
...
@@ -1140,8 +1141,10 @@ public class BLessonServiceImpl implements BLessonService {
//TODO 判断 曾经是否学完过 奖励积分
if
(
"2"
.
equals
(
setTrainIsSignDTO
.
getTrainIsSign
())
&&
!(
"2"
.
equals
(
bLessonPerson
.
getTrainIsSign
()))
&&
!(
"1"
.
equals
(
bLessonPerson
.
getEverFinished
()))
&&
bLesson
!=
null
)
{
//查询课程信息
BPersonValue
bPersonValue
=
new
BPersonValue
(
bLessonPerson
.
getPersonId
(),
"参加!@#培训"
,
bLesson
.
getValueGain
(),
"0"
,
bLesson
.
getBusinessId
());
addValueEvent
(
bLessonPerson
.
getPersonId
(),
bPersonValue
,
null
);
if
(
StringUtils
.
isNotEmpty
(
bLesson
.
getValueGain
())
&&
Long
.
parseLong
(
bLesson
.
getValueGain
())
>
0
){
BPersonValue
bPersonValue
=
new
BPersonValue
(
bLessonPerson
.
getPersonId
(),
"参加!@#培训"
,
bLesson
.
getValueGain
(),
"0"
,
bLesson
.
getBusinessId
());
addValueEvent
(
bLessonPerson
.
getPersonId
(),
bPersonValue
,
null
);
}
bLessonPerson
.
setEverFinished
(
"1"
);
}
bLessonPerson
.
setTrainIsSign
(
setTrainIsSignDTO
.
getTrainIsSign
());
...
...
@@ -1218,7 +1221,7 @@ public class BLessonServiceImpl implements BLessonService {
if
(
userInfo
==
null
)
{
throw
new
ServiceException
(
ResultServiceEnums
.
COMPANY_NOT_EXISTS
);
}
if
(
bLesson
.
getValueConsume
()
!=
null
&&
!(
"0"
.
equals
(
bLesson
.
getValueConsume
()))
&&
Long
.
parseLong
(
userInfo
.
getValue
())
<
Long
.
parseLong
(
bLesson
.
getValueConsume
(
))
&&
!(
curUser
.
getUserId
().
equals
(
bLesson
.
getLecturerId
())))
{
if
(
bLesson
.
getValueConsume
()
!=
null
&&
!(
"0"
.
equals
(
bLesson
.
getValueConsume
()))
&&
(
StringUtils
.
isEmpty
(
userInfo
.
getValue
())
||
(
Long
.
parseLong
(
userInfo
.
getValue
())
<
Long
.
parseLong
(
bLesson
.
getValueConsume
())
))
&&
!(
curUser
.
getUserId
().
equals
(
bLesson
.
getLecturerId
())))
{
throw
new
ServiceException
(
ResultServiceEnums
.
VALUE_NOT_ENOUGH
);
}
int
line
=
bLessonPersonRepository
.
updateByPrimaryKeySelective
(
person
);
...
...
@@ -1249,7 +1252,7 @@ public class BLessonServiceImpl implements BLessonService {
if
(
userInfo
==
null
)
{
throw
new
ServiceException
(
ResultServiceEnums
.
COMPANY_NOT_EXISTS
);
}
if
(
bLesson
.
getValueConsume
()
!=
null
&&
!
"0"
.
equals
(
bLesson
.
getValueConsume
())
&&
Long
.
parseLong
(
userInfo
.
getValue
())
<
Long
.
parseLong
(
bLesson
.
getValueConsume
(
)))
{
if
(
bLesson
.
getValueConsume
()
!=
null
&&
!
(
"0"
.
equals
(
bLesson
.
getValueConsume
()))
&&
(
StringUtils
.
isEmpty
(
userInfo
.
getValue
())
||
(
Long
.
parseLong
(
userInfo
.
getValue
())
<
Long
.
parseLong
(
bLesson
.
getValueConsume
())))
&&
!(
curUser
.
getUserId
().
equals
(
bLesson
.
getLecturerId
()
)))
{
throw
new
ServiceException
(
ResultServiceEnums
.
VALUE_NOT_ENOUGH
);
}
int
line
=
this
.
trainInsert
(
"0"
,
bLesson
,
bLessonPersons
);
...
...
@@ -1323,7 +1326,7 @@ public class BLessonServiceImpl implements BLessonService {
List
<
String
>
ids
=
new
ArrayList
<>();
ids
.
add
(
bLesson
.
getLecturerId
());
MTUserGetsReqDTO
mtUserGetsReqDTO
=
new
MTUserGetsReqDTO
();
mtUserGetsReqDTO
.
setCorpId
(
curUser
.
getCorpId
());
mtUserGetsReqDTO
.
setCorpId
(
bLesson
.
getCorpId
());
mtUserGetsReqDTO
.
setIds
(
ids
);
List
<
MTUserInfoRspDTO
>
mtUserInfoRspDTOList
=
cotactApiRequestClient
.
userGets
(
mtUserGetsReqDTO
);
if
(
mtUserInfoRspDTOList
!=
null
&&
mtUserInfoRspDTOList
.
size
()
>
0
)
{
...
...
@@ -1373,7 +1376,7 @@ public class BLessonServiceImpl implements BLessonService {
List
<
String
>
ids
=
new
ArrayList
<>();
ids
.
add
(
bLesson
.
getLecturerId
());
MTUserGetsReqDTO
mtUserGetsReqDTO
=
new
MTUserGetsReqDTO
();
mtUserGetsReqDTO
.
setCorpId
(
curUser
.
getCorpId
());
mtUserGetsReqDTO
.
setCorpId
(
bLesson
.
getCorpId
());
mtUserGetsReqDTO
.
setIds
(
ids
);
List
<
MTUserInfoRspDTO
>
mtUserInfoRspDTOList
=
cotactApiRequestClient
.
userGets
(
mtUserGetsReqDTO
);
if
(
mtUserInfoRspDTOList
!=
null
&&
mtUserInfoRspDTOList
.
size
()
>
0
)
{
...
...
src/main/java/org/rcisoft/business/brstudentchapter/service/impl/BRStudentChapterServiceImpl.java
View file @
46454933
...
...
@@ -151,8 +151,10 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
BLesson
bLesson
=
bLessonRepository
.
selectByPrimaryKey
(
brStudentChapterDto
.
getLessonId
());
if
(
bLesson
!=
null
&&
IsFinishEnum
.
FINISHED
.
getCode
().
equals
(
bLessonPerson
.
getIsFinish
())
&&
!(
"1"
.
equals
(
bLessonPerson
.
getEverFinished
()))){
//查询课程信息
BPersonValue
bPersonValue
=
new
BPersonValue
(
curUser
.
getUserId
(),
"学完!@#课程"
,
bLesson
.
getValueGain
(),
"0"
,
bLesson
.
getBusinessId
());
bLessonServiceImpl
.
addValueEvent
(
curUser
.
getUserId
(),
bPersonValue
,
null
);
if
(
StringUtils
.
isNotEmpty
(
bLesson
.
getValueGain
())
&&
Long
.
parseLong
(
bLesson
.
getValueGain
())
>
0
){
BPersonValue
bPersonValue
=
new
BPersonValue
(
curUser
.
getUserId
(),
"学完!@#课程"
,
bLesson
.
getValueGain
(),
"0"
,
bLesson
.
getBusinessId
());
bLessonServiceImpl
.
addValueEvent
(
curUser
.
getUserId
(),
bPersonValue
,
null
);
}
bLessonPerson
.
setEverFinished
(
"1"
);
}
bLessonPersonRepository
.
updateByPrimaryKeySelective
(
bLessonPerson
);
...
...
src/main/resources/mapper/business/blesson/mapper/BLessonMapper.xml
View file @
46454933
...
...
@@ -86,6 +86,7 @@
<result
column=
"train_address"
jdbcType=
"VARCHAR"
property=
"trainAddress"
/>
<result
column=
"train_sign_time"
jdbcType=
"VARCHAR"
property=
"trainSignTime"
/>
<result
column=
"qr_code"
jdbcType=
"VARCHAR"
property=
"qrCode"
/>
<result
column=
"corp_id"
jdbcType=
"VARCHAR"
property=
"corpId"
/>
<!---->
<result
column=
"value_consume"
jdbcType=
"VARCHAR"
property=
"valueConsume"
/>
<result
column=
"value_gain"
jdbcType=
"VARCHAR"
property=
"valueGain"
/>
...
...
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