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
815e2d91
Commit
815e2d91
authored
Oct 16, 2019
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改接口
parent
f753c01b
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
193 additions
and
130 deletions
+193
-130
BLessonController.java
...cisoft/business/blesson/controller/BLessonController.java
+19
-19
BAppointRepository.java
.../org/rcisoft/business/blesson/dao/BAppointRepository.java
+15
-0
BLessonPersonRepository.java
...rcisoft/business/blesson/dao/BLessonPersonRepository.java
+12
-12
BLessonRepository.java
...a/org/rcisoft/business/blesson/dao/BLessonRepository.java
+130
-87
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+17
-12
No files found.
src/main/java/org/rcisoft/business/blesson/controller/BLessonController.java
View file @
815e2d91
...
...
@@ -433,24 +433,24 @@ public class BLessonController extends PaginationController<BLesson> {
bLessonService
.
queryRecommendByLessonId
(
param
));
}
//
@ApiOperation(value="624 指派课程", notes="根据ID指派课程")
//
@PostMapping(value = "/appointLessonToPerson")
//
public Result appointLessonToPerson(CurUser curUser,@Valid AppointLessonDTO appointLessonDTO,BindingResult bindingResult) {
//
PersistModel data = bLessonService.appointLessonToPerson(appointLessonDTO);
//
return Result.builder(data,
//
MessageConstant.MESSAGE_ALERT_SUCCESS,
//
MessageConstant.MESSAGE_ALERT_ERROR,
//
appointLessonDTO);
//
}
//
//
@ApiOperation(value="625 添加我学习的课程", notes="添加我学习的课程")
//
@PostMapping(value = "/addMyLearnLesson")
//
public Result addMyLearnLesson(CurUser curUser,@Valid AddMyLearnLessonDTO addMyLearnLessonDTO,BindingResult bindingResult) {
//
PersistModel data = bLessonPersonService.addMyLearnLesson(addMyLearnLessonDTO);
//
return Result.builder(data,
//
MessageConstant.MESSAGE_ALERT_SUCCESS,
//
MessageConstant.MESSAGE_ALERT_ERROR,
//
addMyLearnLessonDTO);
//
}
@ApiOperation
(
value
=
"624 指派课程"
,
notes
=
"根据ID指派课程"
)
@PostMapping
(
value
=
"/appointLessonToPerson"
)
public
Result
appointLessonToPerson
(
CurUser
curUser
,
@Valid
AppointLessonDTO
appointLessonDTO
,
BindingResult
bindingResult
)
{
PersistModel
data
=
bLessonService
.
appointLessonToPerson
(
appointLessonDTO
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
appointLessonDTO
);
}
@ApiOperation
(
value
=
"625 添加我学习的课程"
,
notes
=
"添加我学习的课程"
)
@PostMapping
(
value
=
"/addMyLearnLesson"
)
public
Result
addMyLearnLesson
(
CurUser
curUser
,
@Valid
AddMyLearnLessonDTO
addMyLearnLessonDTO
,
BindingResult
bindingResult
)
{
PersistModel
data
=
bLessonPersonService
.
addMyLearnLesson
(
addMyLearnLessonDTO
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
addMyLearnLessonDTO
);
}
}
src/main/java/org/rcisoft/business/blesson/dao/BAppointRepository.java
View file @
815e2d91
package
org
.
rcisoft
.
business
.
blesson
.
dao
;
import
org.apache.ibatis.annotations.Insert
;
import
org.apache.ibatis.annotations.Param
;
import
org.rcisoft.business.blesson.dto.AppointLessonDTO
;
import
org.rcisoft.business.blesson.dto.CancelAppointDTO
;
import
org.rcisoft.business.blesson.entity.BAppoint
;
...
...
@@ -42,5 +44,18 @@ public interface BAppointRepository extends BaseMapper<BAppoint> {
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BAppoint
>
selectByLessonId
(
AppointLessonDTO
param
);
@Insert
(
"<script>"
+
" insert into b_appoint("
+
" business_id,create_by,create_date,update_by,update_date, "
+
" del_flag,flag,remarks,lesson_id,appointer_id, "
+
" designated_id) "
+
" values "
+
" (#{param.businessId}, #{param.createBy},#{param.createDate},#{param.updateBy},#{param.updateDate}, "
+
" #{param.delFlag}, #{param.flag},#{param.remarks},#{param.lessonId},#{param.appointerId}, "
+
" #{param.designatedId}) "
+
"</script>"
)
int
insertAppoint
(
@Param
(
"param"
)
BAppoint
param
);
}
src/main/java/org/rcisoft/business/blesson/dao/BLessonPersonRepository.java
View file @
815e2d91
...
...
@@ -8,6 +8,7 @@ import org.rcisoft.business.blesson.entity.BLessonPerson;
import
org.rcisoft.core.base.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.Date
;
import
java.util.List
;
@Repository
...
...
@@ -179,30 +180,29 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
* @return
*/
@Update
(
"<script>"
+
" <foreach collection='param' item='item' index='index' separator=';'> "
+
" update b_lesson_person "
+
" <set> "
+
" <if test=\"
item.updateBy != null and item.updateBy != ''\">update_by=#{ite
m.updateBy},</if>"
+
" <if test=\"
item.updateDate != null and item.updateDate != ''\">update_date=#{ite
m.updateDate},</if>"
+
" appoint_id=#{
ite
m.appointId}, "
+
" is_appoint=#{
item.isAppoint},
"
+
" <if test=\"
param.updateBy != null and param.updateBy != ''\">update_by=#{para
m.updateBy},</if>"
+
" <if test=\"
param.updateDate != null \">update_date=#{para
m.updateDate},</if>"
+
" appoint_id=#{
para
m.appointId}, "
+
" is_appoint=#{
param.isAppoint}
"
+
" </set> "
+
" where business_id
=#{item.businessId}
"
+
" <
/foreach>"
+
" where business_id
in
"
+
" <
foreach item='item' index='index' collection='ids' open='(' separator=',' close=')'> #{item} </foreach>"
+
"</script>"
)
int
updateList
(
@Param
(
"param"
)
List
<
BLessonPerson
>
param
);
int
updateList
(
@Param
(
"param"
)
BLessonPerson
param
,
@Param
(
"ids"
)
List
<
String
>
ids
);
@Insert
(
"<script>"
+
" insert into b_lesson_person("
+
" business_id,create_by,create_date,update_by,update_date, "
+
" del_flag,flag,remarks,person_id,lesson_id "
+
" learn_progress,is_finish,
finish_date,
is_collect,appoint_id, "
+
" del_flag,flag,remarks,person_id,lesson_id
,
"
+
" learn_progress,is_finish,is_collect,appoint_id, "
+
" is_appoint) "
+
" values "
+
" <foreach collection='
list' index='index' item='item' separator=','>
"
+
" <foreach collection='
param' index='index' item='item' separator=','>(
"
+
" #{item.businessId}, #{item.createBy},#{item.createDate},#{item.updateBy},#{item.updateDate}, "
+
" #{item.delFlag}, #{item.flag},#{item.remarks},#{item.personId},#{item.lessonId}, "
+
" #{item.learnProgress}, #{item.isFinish},#{item.
finishDate},#{item.
isCollect},#{item.appointId}, "
+
" #{item.learnProgress}, #{item.isFinish},#{item.isCollect},#{item.appointId}, "
+
" #{item.isAppoint}) "
+
" </foreach>"
+
"</script>"
)
...
...
src/main/java/org/rcisoft/business/blesson/dao/BLessonRepository.java
View file @
815e2d91
This diff is collapsed.
Click to expand it.
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
815e2d91
...
...
@@ -395,7 +395,7 @@ public class BLessonServiceImpl implements BLessonService {
bAppoint
.
setAppointerId
(
appointLessonDTO
.
getUserId
());
bAppoint
.
setDesignatedId
(
appointLessonDTO
.
getAppointPerson
());
UserUtil
.
setCurrentPersistOperation
(
bAppoint
);
bAppointRepository
.
insert
Selective
(
bAppoint
);
bAppointRepository
.
insert
Appoint
(
bAppoint
);
}
else
{
bAppoint
=
bAppoints
.
get
(
0
);
bAppoint
.
setAppointerId
(
appointLessonDTO
.
getUserId
());
...
...
@@ -416,18 +416,23 @@ public class BLessonServiceImpl implements BLessonService {
appointLessonDTO
.
setAppointPersonList
(
userIds
);
//查询已学该课程的学习business_id
List
<
BLessonPerson
>
inLessonPersons
=
bLessonPersonRepository
.
selectPersonIdByLessonId
(
appointLessonDTO
);
if
(
inLessonPersons
!=
null
&&
inLessonPersons
.
size
()
>
0
){
List
<
String
>
inLessonIds
=
new
ArrayList
<>();
for
(
BLessonPerson
inLessonPerson
:
inLessonPersons
)
{
UserUtil
.
setCurrentMergeOperation
(
inLessonPerson
);
inLessonPerson
.
setIsAppoint
(
"1"
);
inLessonPerson
.
setAppointId
(
bAppoint
.
getBusinessId
());
inLessonIds
.
add
(
inLessonPerson
.
getPersonId
());
}
//创建对象用于更新
BLessonPerson
updateBLessonPerson
=
new
BLessonPerson
();
updateBLessonPerson
.
setIsAppoint
(
"1"
);
updateBLessonPerson
.
setAppointId
(
bAppoint
.
getBusinessId
());
UserUtil
.
setCurrentMergeOperation
(
updateBLessonPerson
);
//更新b_lesson_person表
bLessonPersonRepository
.
updateList
(
inLessonPerson
s
);
bLessonPersonRepository
.
updateList
(
updateBLessonPerson
,
inLessonId
s
);
//从学生Id中删除已更新的学生id
userIds
.
removeAll
(
inLessonIds
);
}
//剩余学生添加至b_lesson_person表
List
<
BLessonPerson
>
bLessonPersonOthers
=
new
ArrayList
<>();
userIds
.
forEach
(
userId
->{
...
...
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