课程自动复制

This commit is contained in:
limqhz
2022-02-08 23:17:22 +08:00
parent 083d4ebf80
commit a2adc8b62f
11 changed files with 130 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF8"?> <?xml version="1.0" encoding="UTF8"?>
<configuration> <configuration>
<jmxConfigurator /> <jmxConfigurator />
<property name="LOG_HOME" value="/home/logs/api_log"/> <property name="LOG_HOME" value="./home/logs/api_log"/>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">

View File

@@ -1,10 +1,14 @@
package com.sv.dto.api; package com.sv.dto.api;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.sv.entity.VenueCard; import com.sv.entity.VenueCard;
import com.sv.entity.VenueImage; import com.sv.entity.VenueImage;
import com.sv.entity.VenuePrice; import com.sv.entity.VenuePrice;
import com.sv.json.LocalTimeSerializer;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalTime;
import java.util.Date; import java.util.Date;
import java.math.*; import java.math.*;
import java.util.List; import java.util.List;
@@ -132,6 +136,18 @@ public class VenueDTO implements Serializable {
*/ */
private Integer limitWeek; private Integer limitWeek;
/**
* 复制周几
*/
private Integer copyWeek;
/**
* 复制时间
*/
@DateTimeFormat(iso = DateTimeFormat.ISO.TIME)
@JsonSerialize(using = LocalTimeSerializer.class)
private LocalTime copyTime;
/** /**
* 场馆图片列表 * 场馆图片列表
*/ */
@@ -553,4 +569,20 @@ public class VenueDTO implements Serializable {
public void setLimitWeek(Integer limitWeek) { public void setLimitWeek(Integer limitWeek) {
this.limitWeek = limitWeek; this.limitWeek = limitWeek;
} }
public Integer getCopyWeek() {
return copyWeek;
}
public void setCopyWeek(Integer copyWeek) {
this.copyWeek = copyWeek;
}
public LocalTime getCopyTime() {
return copyTime;
}
public void setCopyTime(LocalTime copyTime) {
this.copyTime = copyTime;
}
} }

View File

@@ -30,6 +30,18 @@ public class Venue implements Serializable {
*/ */
private String name; private String name;
/**
* 复制周几
*/
private Integer copyWeek;
/**
* 复制时间
*/
@DateTimeFormat(iso = DateTimeFormat.ISO.TIME)
@JsonSerialize(using = LocalTimeSerializer.class)
private LocalTime copyTime;
/** /**
* 地址 * 地址
*/ */
@@ -600,4 +612,20 @@ public class Venue implements Serializable {
public void setLimitWeek(Integer limitWeek) { public void setLimitWeek(Integer limitWeek) {
this.limitWeek = limitWeek; this.limitWeek = limitWeek;
} }
public Integer getCopyWeek() {
return copyWeek;
}
public void setCopyWeek(Integer copyWeek) {
this.copyWeek = copyWeek;
}
public LocalTime getCopyTime() {
return copyTime;
}
public void setCopyTime(LocalTime copyTime) {
this.copyTime = copyTime;
}
} }

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF8"?> <?xml version="1.0" encoding="UTF8"?>
<configuration> <configuration>
<jmxConfigurator /> <jmxConfigurator />
<property name="LOG_HOME" value="/home/logs/netty_log"/> <property name="LOG_HOME" value="./home/logs/netty_log"/>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">

View File

@@ -36,6 +36,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF8"?> <?xml version="1.0" encoding="UTF8"?>
<configuration> <configuration>
<jmxConfigurator /> <jmxConfigurator />
<property name="LOG_HOME" value="/home/logs/oms_log"/> <property name="LOG_HOME" value="./home/logs/oms_log"/>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">

View File

@@ -157,4 +157,6 @@ public interface VenueLessonMapper {
List<VenueLesson> getCopyLesson(@Param("venueId") Integer venueId,@Param("date") Date date); List<VenueLesson> getCopyLesson(@Param("venueId") Integer venueId,@Param("date") Date date);
void copyImg(@Param("id") Integer id,@Param("nId") Integer nId); void copyImg(@Param("id") Integer id,@Param("nId") Integer nId);
List<VenueLesson> findAllForCopy(@Param("leftTime") String leftTime, @Param("rightTime") String rightTime);
} }

View File

@@ -156,4 +156,11 @@ public class DateUtilCard {
return calendar.getTime(); //这个时间就是日期往后推一天的结果 return calendar.getTime(); //这个时间就是日期往后推一天的结果
} }
public static Date addDays(Date date,int days){
Calendar calendar = new GregorianCalendar();
calendar.setTime(date);
calendar.add(calendar.DATE,days); //把日期往后增加一天,整数 往后推,负数往前移动
return calendar.getTime(); //这个时间就是日期往后推一天的结果
}
} }

View File

@@ -290,6 +290,15 @@ public class VenueLessonService extends BaseServiceImpl {
return pagination; return pagination;
} }
/**
* 查询场馆课程
*
* @return 需要拷贝的场馆课程
*/
public List<VenueLesson> findAllForCopy(String leftTime, String rightTime) {
return venueLessonMapper.findAllForCopy(leftTime, rightTime);
}
/** /**
* 查看教练有多少课程 * 查看教练有多少课程
* @param id * @param id

View File

@@ -670,4 +670,19 @@
) )
</update> </update>
<select id="findAllForCopy" resultMap="VenueLessonMap">
SELECT
<include refid="Field"></include>
FROM
<include refid="tableName"></include>
WHERE
deleted = 0
<if test="leftTime != null">
and date &gt;= #{leftTime}
</if>
<if test="rightTime != null">
and date &lt;= #{rightTime}
</if>
</select>
</mapper> </mapper>

View File

@@ -30,6 +30,8 @@
<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="copy_week" property="copyWeek"/>
<result column="copy_time" property="copyTime"/>
</resultMap> </resultMap>
<resultMap id="VenueDtoMap" type="com.sv.dto.api.VenueDTO"> <resultMap id="VenueDtoMap" type="com.sv.dto.api.VenueDTO">
@@ -54,6 +56,8 @@
<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="copy_week" property="copyWeek"/>
<result column="copy_time" property="copyTime"/>
<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>
@@ -111,7 +115,9 @@
code_url, code_url,
deleted, deleted,
limit_day, limit_day,
limit_week limit_week,
copy_week,
copy_time
</sql> </sql>
<!-- 字段值 --> <!-- 字段值 -->
@@ -137,6 +143,8 @@
#{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}
#{copy_time, jdbcType=TIMESTAMP}
</sql> </sql>
<!-- 查询全部记录 --> <!-- 查询全部记录 -->
@@ -265,6 +273,12 @@
<if test="limitWeek != null"> <if test="limitWeek != null">
limit_week, limit_week,
</if> </if>
<if test="copyWeek != null">
copy_week,
</if>
<if test="copyTime != null">
copy_time,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
@@ -345,6 +359,12 @@
<if test="limitWeek != null"> <if test="limitWeek != null">
#{limitWeek}, #{limitWeek},
</if> </if>
<if test="copyWeek != null">
#{copyWeek},
</if>
<if test="copyTime != null">
#{copyTime},
</if>
</trim> </trim>
</insert> </insert>
@@ -456,6 +476,12 @@
<if test="limitWeek != null"> <if test="limitWeek != null">
limit_week = #{limitWeek}, limit_week = #{limitWeek},
</if> </if>
<if test="copyWeek != null">
copy_week = #{copyWeek},
</if>
<if test="copyTime != null">
copy_time = #{copyTime},
</if>
</set> </set>
WHERE id = #{id} WHERE id = #{id}
</update> </update>
@@ -493,7 +519,9 @@
latitude, latitude,
card_content, card_content,
limit_day, limit_day,
limit_week limit_week,
copy_week,
copy_time
FROM FROM
sv_venue sv_venue
WHERE WHERE