Commit 66ffc5e5 by 叶立庆

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

课程列表查询增加可屏蔽未分组的课程参数
1 parent b38d42d5
......@@ -17,6 +17,9 @@ public class CourseSearchDTO implements Serializable {
@ApiModelProperty(notes = "课程分类id")
private Integer courseCategoryId;
@ApiModelProperty(notes = "排除未分类课程:1-排除")
private Integer excludeNullCategoryId;
@ApiModelProperty(notes = "课程id列表")
private List<String> courseIds;
......
......@@ -18,4 +18,9 @@ public interface LearningCenterTrainingPlanPersonMapper extends OreMapper<Learni
* 超时未完成自动锁住开单权限
*/
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
......@@ -683,6 +683,8 @@ public class LearningCenterTrainingPlanService {
} else {
// 开放,限时锁定:非白名单内且未完成计划且权限开放且超时,改为锁定
trainingPlanPersonMapper.autoLockOpenOrder(planId, updatedBy);
// 开放,限时锁定::非白名单内且未完成计划且权限未开放且未超时,改为开放
trainingPlanPersonMapper.autoOpenOrder(planId, updatedBy);
}
}
}
......
......@@ -65,60 +65,63 @@
beisen_created_by, created_time, created_by, updated_time, updated_by, deleted_flag
</sql>
<sql id="coursePageCondition">
<where>
bc.deleted_flag = 'N'
<if test="courseCategoryId != null">
<choose>
<when test="courseCategoryId == 1">
and (ccr.course_id = #{courseCategoryId} or ccr.id is null)
</when>
<otherwise>
and (ccr.category_id = #{courseCategoryId} or ccr.parent_id = #{courseCategoryId})
</otherwise>
</choose>
</if>
<if test="title != null and title != ''">
and bc.title like concat('%', #{title}, '%')
</if>
<if test="courseFileType != null and courseFileType != ''">
and bc.course_file_type = #{courseFileType}
</if>
<if test="courseStatus != null and courseStatus != ''">
and bc.course_status = #{courseStatus}
</if>
<if test="createTimeStart != null">
and bc.beisen_created_time &gt;= #{createTimeStart}
</if>
<if test="createTimeEnd != null">
and bc.beisen_created_time &lt;= #{createTimeEnd}
</if>
<if test="courseIds != null and courseIds.size() > 0">
and bc.id in
<foreach collection="courseIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="statusList != null and statusList.size() > 0">
and bc.course_status in
<foreach collection="statusList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="organizationIdList != null and organizationIdList.size() > 0">
and bc.organization in
<foreach collection="organizationIdList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="userIdList != null and userIdList.size() > 0">
and bc.beisen_created_by in
<foreach collection="userIdList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</sql>
<sql id="coursePageCondition">
<where>
bc.deleted_flag = 'N'
<if test="courseCategoryId != null">
<choose>
<when test="courseCategoryId == 1">
and (ccr.course_id = #{courseCategoryId} or ccr.id is null)
</when>
<otherwise>
and (ccr.category_id = #{courseCategoryId} or ccr.parent_id = #{courseCategoryId})
</otherwise>
</choose>
</if>
<if test="title != null and title != ''">
and bc.title like concat('%', #{title}, '%')
</if>
<if test="excludeNullCategoryId != null and excludeNullCategoryId == 1">
and ccr.category_id IS NOT NULL
</if>
<if test="courseFileType != null and courseFileType != ''">
and bc.course_file_type = #{courseFileType}
</if>
<if test="courseStatus != null and courseStatus != ''">
and bc.course_status = #{courseStatus}
</if>
<if test="createTimeStart != null">
and bc.beisen_created_time &gt;= #{createTimeStart}
</if>
<if test="createTimeEnd != null">
and bc.beisen_created_time &lt;= #{createTimeEnd}
</if>
<if test="courseIds != null and courseIds.size() > 0">
and bc.id in
<foreach collection="courseIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="statusList != null and statusList.size() > 0">
and bc.course_status in
<foreach collection="statusList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="organizationIdList != null and organizationIdList.size() > 0">
and bc.organization in
<foreach collection="organizationIdList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="userIdList != null and userIdList.size() > 0">
and bc.beisen_created_by in
<foreach collection="userIdList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</sql>
<select id="listCoursePageInfo" resultMap="CoursePageMap" parameterType="cn.com.glsx.dj.riskmanage.dto.learningcenter.CourseSearchDTO" >
select bc.id, bc.title, bc.course_file_type,round(bc.total_duration) as total_duration, bc.course_status,
......
......@@ -80,9 +80,33 @@
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) > p.limit_time_param
and DATEDIFF(now(), lep.created_date) <![CDATA[>]]> p.limit_time_param
<if test="trainingPlanId != null">
and pp.plan_id = #{trainingPlanId}
</if>
</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>
\ No newline at end of file
......@@ -15,10 +15,11 @@ public class LearningCenterCourseServiceTest extends BaseServiceTest {
public void testPageCourse() {
RpcPagination<CourseSearchDTO> pagination = new RpcPagination<>();
pagination.setPageNum(1);
pagination.setPageSize(10);
pagination.setPageSize(100);
CourseSearchDTO request = new CourseSearchDTO();
pagination.setCondition(request);
request.setTitle("测试课程");
// request.setTitle("测试课程");
request.setExcludeNullCategoryId(1);
request.setOrderByType(0);
Page<CoursePageInfo> res1 = learningCenterCourseService.pageCourse(pagination);
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!