课程自动复制
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF8"?>
|
||||
<configuration>
|
||||
<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">
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package com.sv.dto.api;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.sv.entity.VenueCard;
|
||||
import com.sv.entity.VenueImage;
|
||||
import com.sv.entity.VenuePrice;
|
||||
import com.sv.json.LocalTimeSerializer;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalTime;
|
||||
import java.util.Date;
|
||||
import java.math.*;
|
||||
import java.util.List;
|
||||
@@ -132,6 +136,18 @@ public class VenueDTO implements Serializable {
|
||||
*/
|
||||
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) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,18 @@ public class Venue implements Serializable {
|
||||
*/
|
||||
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) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF8"?>
|
||||
<configuration>
|
||||
<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">
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
|
||||
@@ -36,6 +36,10 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF8"?>
|
||||
<configuration>
|
||||
<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">
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
|
||||
@@ -157,4 +157,6 @@ public interface VenueLessonMapper {
|
||||
List<VenueLesson> getCopyLesson(@Param("venueId") Integer venueId,@Param("date") Date date);
|
||||
|
||||
void copyImg(@Param("id") Integer id,@Param("nId") Integer nId);
|
||||
|
||||
List<VenueLesson> findAllForCopy(@Param("leftTime") String leftTime, @Param("rightTime") String rightTime);
|
||||
}
|
||||
|
||||
@@ -156,4 +156,11 @@ public class DateUtilCard {
|
||||
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(); //这个时间就是日期往后推一天的结果
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -290,6 +290,15 @@ public class VenueLessonService extends BaseServiceImpl {
|
||||
return pagination;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询场馆课程
|
||||
*
|
||||
* @return 需要拷贝的场馆课程
|
||||
*/
|
||||
public List<VenueLesson> findAllForCopy(String leftTime, String rightTime) {
|
||||
return venueLessonMapper.findAllForCopy(leftTime, rightTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看教练有多少课程
|
||||
* @param id
|
||||
|
||||
@@ -670,4 +670,19 @@
|
||||
)
|
||||
</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 >= #{leftTime}
|
||||
</if>
|
||||
<if test="rightTime != null">
|
||||
and date <= #{rightTime}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
<result column="deleted" property="deleted"/>
|
||||
<result column="limit_day" property="limitDay"/>
|
||||
<result column="limit_week" property="limitWeek"/>
|
||||
<result column="copy_week" property="copyWeek"/>
|
||||
<result column="copy_time" property="copyTime"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="VenueDtoMap" type="com.sv.dto.api.VenueDTO">
|
||||
@@ -54,6 +56,8 @@
|
||||
<result column="deleted" property="deleted"/>
|
||||
<result column="limit_day" property="limitDay"/>
|
||||
<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>
|
||||
<association property="cards" select="com.sv.mapper.VenueCardMapper.findByVenueId"
|
||||
column="{venueId = id,venueType=type}"></association>
|
||||
@@ -111,7 +115,9 @@
|
||||
code_url,
|
||||
deleted,
|
||||
limit_day,
|
||||
limit_week
|
||||
limit_week,
|
||||
copy_week,
|
||||
copy_time
|
||||
</sql>
|
||||
|
||||
<!-- 字段值 -->
|
||||
@@ -137,6 +143,8 @@
|
||||
#{deleted, jdbcType=TINYINT}
|
||||
#{limit_day, jdbcType=TINYINT}
|
||||
#{limit_week, jdbcType=TINYINT}
|
||||
#{copy_week, jdbcType=TINYINT}
|
||||
#{copy_time, jdbcType=TIMESTAMP}
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部记录 -->
|
||||
@@ -265,6 +273,12 @@
|
||||
<if test="limitWeek != null">
|
||||
limit_week,
|
||||
</if>
|
||||
<if test="copyWeek != null">
|
||||
copy_week,
|
||||
</if>
|
||||
<if test="copyTime != null">
|
||||
copy_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
@@ -345,6 +359,12 @@
|
||||
<if test="limitWeek != null">
|
||||
#{limitWeek},
|
||||
</if>
|
||||
<if test="copyWeek != null">
|
||||
#{copyWeek},
|
||||
</if>
|
||||
<if test="copyTime != null">
|
||||
#{copyTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -456,6 +476,12 @@
|
||||
<if test="limitWeek != null">
|
||||
limit_week = #{limitWeek},
|
||||
</if>
|
||||
<if test="copyWeek != null">
|
||||
copy_week = #{copyWeek},
|
||||
</if>
|
||||
<if test="copyTime != null">
|
||||
copy_time = #{copyTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
@@ -493,7 +519,9 @@
|
||||
latitude,
|
||||
card_content,
|
||||
limit_day,
|
||||
limit_week
|
||||
limit_week,
|
||||
copy_week,
|
||||
copy_time
|
||||
FROM
|
||||
sv_venue
|
||||
WHERE
|
||||
|
||||
Reference in New Issue
Block a user