课程自动复制,往下下周开始复制
This commit is contained in:
@@ -136,6 +136,16 @@ public class VenueDTO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Integer limitWeek;
|
private Integer limitWeek;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每天预约限制
|
||||||
|
*/
|
||||||
|
private Integer limitNoDay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每周预约限制
|
||||||
|
*/
|
||||||
|
private Integer limitNoWeek;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 复制周几
|
* 复制周几
|
||||||
*/
|
*/
|
||||||
@@ -148,6 +158,11 @@ public class VenueDTO implements Serializable {
|
|||||||
@JsonSerialize(using = LocalTimeSerializer.class)
|
@JsonSerialize(using = LocalTimeSerializer.class)
|
||||||
private LocalTime copyTime;
|
private LocalTime copyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 向后复制多少
|
||||||
|
*/
|
||||||
|
private Integer copyTarget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 场馆图片列表
|
* 场馆图片列表
|
||||||
*/
|
*/
|
||||||
@@ -585,4 +600,28 @@ public class VenueDTO implements Serializable {
|
|||||||
public void setCopyTime(LocalTime copyTime) {
|
public void setCopyTime(LocalTime copyTime) {
|
||||||
this.copyTime = copyTime;
|
this.copyTime = copyTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getCopyTarget() {
|
||||||
|
return copyTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCopyTarget(Integer copyTarget) {
|
||||||
|
this.copyTarget = copyTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getLimitNoDay() {
|
||||||
|
return limitNoDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLimitNoDay(Integer limitNoDay) {
|
||||||
|
this.limitNoDay = limitNoDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getLimitNoWeek() {
|
||||||
|
return limitNoWeek;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLimitNoWeek(Integer limitNoWeek) {
|
||||||
|
this.limitNoWeek = limitNoWeek;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,11 @@ public class Venue implements Serializable {
|
|||||||
@JsonSerialize(using = LocalTimeSerializer.class)
|
@JsonSerialize(using = LocalTimeSerializer.class)
|
||||||
private LocalTime copyTime;
|
private LocalTime copyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 向后复制多少
|
||||||
|
*/
|
||||||
|
private Integer copyTarget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 地址
|
* 地址
|
||||||
*/
|
*/
|
||||||
@@ -174,6 +179,17 @@ public class Venue implements Serializable {
|
|||||||
private Integer limitWeek;
|
private Integer limitWeek;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每天预约限制
|
||||||
|
*/
|
||||||
|
private Integer limitNoDay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每周预约限制
|
||||||
|
*/
|
||||||
|
private Integer limitNoWeek;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置
|
* 设置
|
||||||
*
|
*
|
||||||
@@ -628,4 +644,28 @@ public class Venue implements Serializable {
|
|||||||
public void setCopyTime(LocalTime copyTime) {
|
public void setCopyTime(LocalTime copyTime) {
|
||||||
this.copyTime = copyTime;
|
this.copyTime = copyTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getCopyTarget() {
|
||||||
|
return copyTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCopyTarget(Integer copyTarget) {
|
||||||
|
this.copyTarget = copyTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getLimitNoDay() {
|
||||||
|
return limitNoDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLimitNoDay(Integer limitNoDay) {
|
||||||
|
this.limitNoDay = limitNoDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getLimitNoWeek() {
|
||||||
|
return limitNoWeek;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLimitNoWeek(Integer limitNoWeek) {
|
||||||
|
this.limitNoWeek = limitNoWeek;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class CopyLessonTask {
|
|||||||
/**
|
/**
|
||||||
* 每周一九点
|
* 每周一九点
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0 */1 * * * ?")
|
// @Scheduled(cron = "0 */1 * * * ?")
|
||||||
public void execute(){
|
public void execute(){
|
||||||
logger.info("开始执行拷贝课程批处理");
|
logger.info("开始执行拷贝课程批处理");
|
||||||
LocalTime time = LocalTime.now();
|
LocalTime time = LocalTime.now();
|
||||||
@@ -62,10 +62,14 @@ public class CopyLessonTask {
|
|||||||
List<VenueLesson> allForCopy = venueLessonService.findAllForCopy(startTime, endTime);
|
List<VenueLesson> allForCopy = venueLessonService.findAllForCopy(startTime, endTime);
|
||||||
if (allForCopy!= null && allForCopy.size()>0){
|
if (allForCopy!= null && allForCopy.size()>0){
|
||||||
logger.info("需要操作的课程数为:" + allForCopy.size());
|
logger.info("需要操作的课程数为:" + allForCopy.size());
|
||||||
|
Integer copyTarget = venue.getCopyTarget();
|
||||||
|
if (copyTarget == null){
|
||||||
|
copyTarget = 1;
|
||||||
|
}
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (VenueLesson venueLesson : allForCopy) {
|
for (VenueLesson venueLesson : allForCopy) {
|
||||||
count ++;
|
count ++;
|
||||||
Date copyDate = DateUtilCard.addDays(venueLesson.getDate(), 7);
|
Date copyDate = DateUtilCard.addDays(venueLesson.getDate(), 7 * copyTarget + 7);
|
||||||
venueLessonService.copy(venueLesson.getId(),copyDate,copyDate);
|
venueLessonService.copy(venueLesson.getId(),copyDate,copyDate);
|
||||||
}
|
}
|
||||||
logger.info("拷贝的课程数量为:" + count);
|
logger.info("拷贝的课程数量为:" + count);
|
||||||
|
|||||||
@@ -30,8 +30,11 @@
|
|||||||
<result column="deleted" property="deleted"/>
|
<result column="deleted" property="deleted"/>
|
||||||
<result column="limit_day" property="limitDay"/>
|
<result column="limit_day" property="limitDay"/>
|
||||||
<result column="limit_week" property="limitWeek"/>
|
<result column="limit_week" property="limitWeek"/>
|
||||||
|
<result column="limit_no_day" property="limitNoDay"/>
|
||||||
|
<result column="limit_no_week" property="limitNoWeek"/>
|
||||||
<result column="copy_week" property="copyWeek"/>
|
<result column="copy_week" property="copyWeek"/>
|
||||||
<result column="copy_time" property="copyTime"/>
|
<result column="copy_time" property="copyTime"/>
|
||||||
|
<result column="copy_target" property="copyTarget"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap id="VenueDtoMap" type="com.sv.dto.api.VenueDTO">
|
<resultMap id="VenueDtoMap" type="com.sv.dto.api.VenueDTO">
|
||||||
@@ -56,8 +59,11 @@
|
|||||||
<result column="deleted" property="deleted"/>
|
<result column="deleted" property="deleted"/>
|
||||||
<result column="limit_day" property="limitDay"/>
|
<result column="limit_day" property="limitDay"/>
|
||||||
<result column="limit_week" property="limitWeek"/>
|
<result column="limit_week" property="limitWeek"/>
|
||||||
|
<result column="limit_no_day" property="limitNoDay"/>
|
||||||
|
<result column="limit_no_week" property="limitNoWeek"/>
|
||||||
<result column="copy_week" property="copyWeek"/>
|
<result column="copy_week" property="copyWeek"/>
|
||||||
<result column="copy_time" property="copyTime"/>
|
<result column="copy_time" property="copyTime"/>
|
||||||
|
<result column="copy_target" property="copyTarget"/>
|
||||||
<result column="code_url" property="codeUrl"></result>
|
<result column="code_url" property="codeUrl"></result>
|
||||||
<association property="cards" select="com.sv.mapper.VenueCardMapper.findByVenueId"
|
<association property="cards" select="com.sv.mapper.VenueCardMapper.findByVenueId"
|
||||||
column="{venueId = id,venueType=type}"></association>
|
column="{venueId = id,venueType=type}"></association>
|
||||||
@@ -116,8 +122,11 @@
|
|||||||
deleted,
|
deleted,
|
||||||
limit_day,
|
limit_day,
|
||||||
limit_week,
|
limit_week,
|
||||||
|
limit_no_day,
|
||||||
|
limit_no_week,
|
||||||
copy_week,
|
copy_week,
|
||||||
copy_time
|
copy_time,
|
||||||
|
copy_target
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 字段值 -->
|
<!-- 字段值 -->
|
||||||
@@ -140,11 +149,14 @@
|
|||||||
#{modifiedId, jdbcType=INTEGER},
|
#{modifiedId, jdbcType=INTEGER},
|
||||||
#{createdTime, jdbcType=TIMESTAMP},
|
#{createdTime, jdbcType=TIMESTAMP},
|
||||||
#{modifiedTime, jdbcType=TIMESTAMP},
|
#{modifiedTime, jdbcType=TIMESTAMP},
|
||||||
#{deleted, jdbcType=TINYINT}
|
#{deleted, jdbcType=TINYINT},
|
||||||
#{limit_day, jdbcType=TINYINT}
|
#{limit_day, jdbcType=TINYINT},
|
||||||
#{limit_week, jdbcType=TINYINT}
|
#{limit_week, jdbcType=TINYINT},
|
||||||
#{copy_week, jdbcType=TINYINT}
|
#{limit_no_day, jdbcType=TINYINT},
|
||||||
#{copy_time, jdbcType=TIMESTAMP}
|
#{limit_no_week, jdbcType=TINYINT},
|
||||||
|
#{copy_week, jdbcType=TINYINT},
|
||||||
|
#{copy_time, jdbcType=TIMESTAMP},
|
||||||
|
#{copy_target, jdbcType=TINYINT}
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 查询全部记录 -->
|
<!-- 查询全部记录 -->
|
||||||
@@ -273,12 +285,21 @@
|
|||||||
<if test="limitWeek != null">
|
<if test="limitWeek != null">
|
||||||
limit_week,
|
limit_week,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="limitNoDay != null">
|
||||||
|
limit_no_day,
|
||||||
|
</if>
|
||||||
|
<if test="limitNoWeek != null">
|
||||||
|
limit_no_week,
|
||||||
|
</if>
|
||||||
<if test="copyWeek != null">
|
<if test="copyWeek != null">
|
||||||
copy_week,
|
copy_week,
|
||||||
</if>
|
</if>
|
||||||
<if test="copyTime != null">
|
<if test="copyTime != null">
|
||||||
copy_time,
|
copy_time,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="copyTarget != null">
|
||||||
|
copy_target,
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">
|
<if test="id != null">
|
||||||
@@ -365,6 +386,9 @@
|
|||||||
<if test="copyTime != null">
|
<if test="copyTime != null">
|
||||||
#{copyTime},
|
#{copyTime},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="copyTarget != null">
|
||||||
|
#{copyTarget},
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -476,12 +500,21 @@
|
|||||||
<if test="limitWeek != null">
|
<if test="limitWeek != null">
|
||||||
limit_week = #{limitWeek},
|
limit_week = #{limitWeek},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="limitNoDay != null">
|
||||||
|
limit_no_day = #{limitNoDay},
|
||||||
|
</if>
|
||||||
|
<if test="limitNoWeek != null">
|
||||||
|
limit_no_week = #{limitNoWeek},
|
||||||
|
</if>
|
||||||
<if test="copyWeek != null">
|
<if test="copyWeek != null">
|
||||||
copy_week = #{copyWeek},
|
copy_week = #{copyWeek},
|
||||||
</if>
|
</if>
|
||||||
<if test="copyTime != null">
|
<if test="copyTime != null">
|
||||||
copy_time = #{copyTime},
|
copy_time = #{copyTime},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="copyTarget != null">
|
||||||
|
copy_target = #{copyTarget},
|
||||||
|
</if>
|
||||||
</set>
|
</set>
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
@@ -520,8 +553,11 @@
|
|||||||
card_content,
|
card_content,
|
||||||
limit_day,
|
limit_day,
|
||||||
limit_week,
|
limit_week,
|
||||||
|
limit_no_day,
|
||||||
|
limit_no_week,
|
||||||
copy_week,
|
copy_week,
|
||||||
copy_time
|
copy_time,
|
||||||
|
copy_target
|
||||||
FROM
|
FROM
|
||||||
sv_venue
|
sv_venue
|
||||||
WHERE
|
WHERE
|
||||||
|
|||||||
Reference in New Issue
Block a user