Commit 66ffc5e5 by 叶立庆

修复编辑学习计划从立即锁定到限时锁定,已锁定人员未解锁

课程列表查询增加可屏蔽未分组的课程参数
1 parent b38d42d5
...@@ -17,6 +17,9 @@ public class CourseSearchDTO implements Serializable { ...@@ -17,6 +17,9 @@ public class CourseSearchDTO implements Serializable {
@ApiModelProperty(notes = "课程分类id") @ApiModelProperty(notes = "课程分类id")
private Integer courseCategoryId; private Integer courseCategoryId;
@ApiModelProperty(notes = "排除未分类课程:1-排除")
private Integer excludeNullCategoryId;
@ApiModelProperty(notes = "课程id列表") @ApiModelProperty(notes = "课程id列表")
private List<String> courseIds; private List<String> courseIds;
......
...@@ -18,4 +18,9 @@ public interface LearningCenterTrainingPlanPersonMapper extends OreMapper<Learni ...@@ -18,4 +18,9 @@ public interface LearningCenterTrainingPlanPersonMapper extends OreMapper<Learni
* 超时未完成自动锁住开单权限 * 超时未完成自动锁住开单权限
*/ */
void autoLockOpenOrder(@Param("trainingPlanId") Integer trainingPlanId, @Param("updatedBy") String updatedBy); void autoLockOpenOrder(@Param("trainingPlanId") Integer trainingPlanId, @Param("updatedBy") String updatedBy);
/**
* 未超时未完成限时可开单
*/
void autoOpenOrder(@Param("planId") Integer planId, @Param("updatedBy") String updatedBy);
} }
\ No newline at end of file \ No newline at end of file
...@@ -683,6 +683,8 @@ public class LearningCenterTrainingPlanService { ...@@ -683,6 +683,8 @@ public class LearningCenterTrainingPlanService {
} else { } else {
// 开放,限时锁定:非白名单内且未完成计划且权限开放且超时,改为锁定 // 开放,限时锁定:非白名单内且未完成计划且权限开放且超时,改为锁定
trainingPlanPersonMapper.autoLockOpenOrder(planId, updatedBy); trainingPlanPersonMapper.autoLockOpenOrder(planId, updatedBy);
// 开放,限时锁定::非白名单内且未完成计划且权限未开放且未超时,改为开放
trainingPlanPersonMapper.autoOpenOrder(planId, updatedBy);
} }
} }
} }
......
...@@ -81,6 +81,9 @@ ...@@ -81,6 +81,9 @@
<if test="title != null and title != ''"> <if test="title != null and title != ''">
and bc.title like concat('%', #{title}, '%') and bc.title like concat('%', #{title}, '%')
</if> </if>
<if test="excludeNullCategoryId != null and excludeNullCategoryId == 1">
and ccr.category_id IS NOT NULL
</if>
<if test="courseFileType != null and courseFileType != ''"> <if test="courseFileType != null and courseFileType != ''">
and bc.course_file_type = #{courseFileType} and bc.course_file_type = #{courseFileType}
</if> </if>
......
...@@ -80,9 +80,33 @@ ...@@ -80,9 +80,33 @@
and p.order_permission_status = 1 and p.order_permission_status = 1
and p.order_permission_type = 2 and p.order_permission_type = 2
and find_in_set(pp.person_id, p.white_list) = 0 and find_in_set(pp.person_id, p.white_list) = 0
and DATEDIFF(now(), lep.created_date) > p.limit_time_param and DATEDIFF(now(), lep.created_date) <![CDATA[>]]> p.limit_time_param
<if test="trainingPlanId != null"> <if test="trainingPlanId != null">
and pp.plan_id = #{trainingPlanId} and pp.plan_id = #{trainingPlanId}
</if> </if>
</update> </update>
<update id="autoOpenOrder">
update dj_car_life_learning_center_training_plan_person pp
inner join dj_car_life_learning_center_training_plan p on pp.plan_id = p.id
inner join dj_car_life_learning_center_level_exam_person lep on p.exam_id = lep.exam_id and pp.person_id = lep.person_id and lep.deleted_flag = 'N'
set pp.open_order_status = 1, pp.updated_date = now()
<if test="updatedBy == null">
, pp.updated_by = 'Job'
</if>
<if test="updatedBy != null and updatedBy != ''">
, pp.updated_by = #{updatedBy}
</if>
where pp.deleted_flag = 'N'
and pp.is_completed = 0
and pp.open_order_status = 1
and p.deleted_flag = 'N'
and p.status = 1
and p.order_permission_status = 1
and p.order_permission_type = 2
and find_in_set(pp.person_id, p.white_list) = 0
and DATEDIFF(now(), lep.created_date) <![CDATA[<]]> p.limit_time_param
<if test="planId != null">
and pp.plan_id = #{planId}
</if>
</update>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -15,10 +15,11 @@ public class LearningCenterCourseServiceTest extends BaseServiceTest { ...@@ -15,10 +15,11 @@ public class LearningCenterCourseServiceTest extends BaseServiceTest {
public void testPageCourse() { public void testPageCourse() {
RpcPagination<CourseSearchDTO> pagination = new RpcPagination<>(); RpcPagination<CourseSearchDTO> pagination = new RpcPagination<>();
pagination.setPageNum(1); pagination.setPageNum(1);
pagination.setPageSize(10); pagination.setPageSize(100);
CourseSearchDTO request = new CourseSearchDTO(); CourseSearchDTO request = new CourseSearchDTO();
pagination.setCondition(request); pagination.setCondition(request);
request.setTitle("测试课程"); // request.setTitle("测试课程");
request.setExcludeNullCategoryId(1);
request.setOrderByType(0); request.setOrderByType(0);
Page<CoursePageInfo> res1 = learningCenterCourseService.pageCourse(pagination); Page<CoursePageInfo> res1 = learningCenterCourseService.pageCourse(pagination);
System.out.println(res1); System.out.println(res1);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!