Commit 3f02fb59 authored by zhangqingle's avatar zhangqingle

修改定时设置缺勤

parent 8b029b71
......@@ -309,7 +309,8 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
// "and su.del_flag = 0 and su.flag = 1 " +
"<if test= \" param.isApply != null and param.isApply != ''\">and is_apply = #{param.isApply} </if> " +
"<if test= \" param.trainIsSign != null and param.trainIsSign != ''\">and train_is_sign = #{param.trainIsSign} </if> " +
"and lesson_id = #{param.lessonId}</script>")
"and lesson_id = #{param.lessonId}" +
"order by is_appoint desc</script>")
@ResultMap(value = "BaseResultMap")
List<BLessonPerson> trainPersons(@Param("param") FindTrainPersonDTO param);
......@@ -334,13 +335,11 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
" train_is_sign = 1 ",
" </set>",
"where 1=1 ",
"<if test=\"lessonId!=null and lessonId != ''\">",
" and lesson_id in ",
" <foreach item='item' collection='lessonIds' open='(' separator=',' close=')'> #{item} </foreach> " ,
"</if>" ,
"and train_is_sign != 2 ",
"</script>"})
int selectByLessonIds(@Param("lessonId") List<String> lessonIds);
int updateByLessonIds(@Param("lessonIds") List<String> lessonIds);
}
......@@ -1079,9 +1079,8 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
"where 1=1 " +
"and del_flag = 0 and flag = 1 " +
"and lesson_type = 1 " +
"AND #{nowDate} between SUBDATE(train_start_date,interval #{sec} second) and train_start_date </script>")
@ResultMap(value = "BaseResultMap")
List<String> selectByTrainStartBeforeNow(@Param("nowDate")Date newDate ,@Param("sec")String sec);
"AND #{nowDate} between train_over_date and SUBDATE(train_over_date,interval -#{sec} second) </script>")
List<String> selectByTrainNowBeforeOver(@Param("nowDate")Date newDate ,@Param("sec")String sec);
@Select("select * from b_lesson where business_id = #{id}")
@ResultMap(value = "BaseResultMap")
......
......@@ -11,6 +11,8 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.validation.Valid;
import java.util.Date;
......@@ -36,12 +38,13 @@ public class TrainSignConfig {
private String sec;
@Scheduled(cron = "${eduJob.taskInterval}")
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
public void trainBegin() {
log.debug("--------------正在将未签到的人员置为缺勤------------");
Date newDate = new Date();
List<String> lessonIds = bLessonRepository.selectByTrainStartBeforeNow(newDate,sec);
List<String> lessonIds = bLessonRepository.selectByTrainNowBeforeOver(newDate,sec);
if (lessonIds != null && lessonIds.size() > 0){
bLessonPersonRepository.selectByLessonIds(lessonIds);
bLessonPersonRepository.updateByLessonIds(lessonIds);
}
}
}
......@@ -94,8 +94,8 @@ global:
eduJob:
taskInterval: 0 0/5 * * * ?
trainBegin: false
sec: 300 #培训开始前 多少秒 之内的报名人员设置为缺勤
trainBegin: true
sec: 300 #培训结束后 多少秒 之内的报名人员设置为缺勤
libreoffice:
ip: mt_libre
......
......@@ -94,6 +94,44 @@
</collection>
</resultMap>
<resultMap id="OnlyLessonInfoResultMap" type="org.rcisoft.business.blesson.entity.BLesson">
<id column="business_id" jdbcType="VARCHAR" property="businessId"/>
<result column="code" jdbcType="VARCHAR" property="code"/>
<result column="lesson_name" jdbcType="VARCHAR" property="lessonName"/>
<result column="default_url" jdbcType="VARCHAR" property="defaultUrl"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="del_flag" jdbcType="VARCHAR" property="delFlag"/>
<result column="flag" jdbcType="VARCHAR" property="flag"/>
<result column="remarks" jdbcType="VARCHAR" property="remarks"/>
<result column="class_hour" jdbcType="VARCHAR" property="classHour"/>
<result column="lecturer_id" jdbcType="VARCHAR" property="lecturerId"/>
<result column="release_state" jdbcType="VARCHAR" property="releaseState"/>
<result column="course_id" jdbcType="VARCHAR" property="courseId"/>
<result column="person_number" jdbcType="VARCHAR" property="personNumber"/>
<result column="course_time" jdbcType="VARCHAR" property="courseTime"/>
<result column="course_description" jdbcType="VARCHAR" property="courseDescription"/>
<result column="view_range" jdbcType="VARCHAR" property="viewRange"/>
<result column="release_date" jdbcType="TIMESTAMP" property="releaseDate"/>
<result column="close_date" jdbcType="TIMESTAMP" property="closeDate"/>
<result column="lesson_type" jdbcType="VARCHAR" property="lessonType"/>
<result column="discuss_number" jdbcType="VARCHAR" property="discussNumber"/>
<result column="recommend" jdbcType="VARCHAR" property="recommend"/>
<result column="collect_number" jdbcType="VARCHAR" property="collectNumber"/>
<result column="hot_number" jdbcType="VARCHAR" property="hotNumber"/>
<!--培训-->
<result column="apply_start_date" jdbcType="TIMESTAMP" property="applyStartDate"/>
<result column="apply_over_date" jdbcType="TIMESTAMP" property="applyOverDate"/>
<result column="train_start_date" jdbcType="TIMESTAMP" property="trainStartDate"/>
<result column="train_over_date" jdbcType="TIMESTAMP" property="trainOverDate"/>
<result column="max_apply_person" jdbcType="VARCHAR" property="maxApplyPerson"/>
<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"/>
</resultMap>
<!--<resultMap id="SupperChildListResultMap" type="org.rcisoft.business.blesson.entity.BLesson" extends="BaseResultMap">-->
<!--<association column="business_id" property="labelList" select="org.rcisoft.business.blesson.dao.BLessonRepository.queryLabelByLessonId"></association>-->
<!--</resultMap>-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment