fix 单个课程拷贝
This commit is contained in:
@@ -32,6 +32,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>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<fileNamePattern>${LOG_HOME}/common-default-%d{yyyy-MM-dd}.log
|
<fileNamePattern>${LOG_HOME}/common-default-%d{yyyy-MM-dd}.log
|
||||||
</fileNamePattern>
|
</fileNamePattern>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
</rollingPolicy>
|
</rollingPolicy>
|
||||||
<encoder>
|
<encoder>
|
||||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
@@ -31,28 +32,13 @@
|
|||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<fileNamePattern>${LOG_HOME}/common-error-%d{yyyy-MM-dd}.log
|
<fileNamePattern>${LOG_HOME}/common-error-%d{yyyy-MM-dd}.log
|
||||||
</fileNamePattern>
|
</fileNamePattern>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
</rollingPolicy>
|
</rollingPolicy>
|
||||||
<encoder>
|
<encoder>
|
||||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
</encoder>
|
</encoder>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<appender name="CONNECTION_APPENDER"
|
|
||||||
class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${LOG_HOME}/connection.log</file>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
||||||
<fileNamePattern>${LOG_HOME}/connection-%d{yyyy-MM-dd}.log
|
|
||||||
</fileNamePattern>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder>
|
|
||||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<logger name="com.sv.netty.netty" additivity="false" >
|
|
||||||
<appender-ref ref="CONNECTION_APPENDER"/>
|
|
||||||
</logger>
|
|
||||||
|
|
||||||
<!-- root -->
|
<!-- root -->
|
||||||
<root level="info">
|
<root level="info">
|
||||||
<appender-ref ref="STDOUT" />
|
<appender-ref ref="STDOUT" />
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<fileNamePattern>${LOG_HOME}/common-default-%d{yyyy-MM-dd}.log
|
<fileNamePattern>${LOG_HOME}/common-default-%d{yyyy-MM-dd}.log
|
||||||
</fileNamePattern>
|
</fileNamePattern>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
</rollingPolicy>
|
</rollingPolicy>
|
||||||
<encoder>
|
<encoder>
|
||||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
@@ -31,6 +32,7 @@
|
|||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<fileNamePattern>${LOG_HOME}/common-error-%d{yyyy-MM-dd}.log
|
<fileNamePattern>${LOG_HOME}/common-error-%d{yyyy-MM-dd}.log
|
||||||
</fileNamePattern>
|
</fileNamePattern>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
</rollingPolicy>
|
</rollingPolicy>
|
||||||
<encoder>
|
<encoder>
|
||||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
|
|||||||
@@ -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.parse("09:00");
|
LocalTime time = LocalTime.parse("09:00");
|
||||||
@@ -70,7 +70,7 @@ public class CopyLessonTask {
|
|||||||
for (VenueLesson venueLesson : allForCopy) {
|
for (VenueLesson venueLesson : allForCopy) {
|
||||||
count ++;
|
count ++;
|
||||||
Date copyDate = DateUtilCard.addDays(venueLesson.getDate(), 7 * copyTarget + 7);
|
Date copyDate = DateUtilCard.addDays(venueLesson.getDate(), 7 * copyTarget + 7);
|
||||||
venueLessonService.copy(venueLesson.getId(),copyDate,copyDate);
|
venueLessonService.copyOneLesson(venueLesson.getId(),copyDate);
|
||||||
}
|
}
|
||||||
logger.info("拷贝的课程数量为:" + count);
|
logger.info("拷贝的课程数量为:" + count);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ spring:
|
|||||||
# url: jdbc:mysql://yingdiandian.mysql.rds.aliyuncs.com:3306/smart_venue?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2b8
|
# url: jdbc:mysql://yingdiandian.mysql.rds.aliyuncs.com:3306/smart_venue?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2b8
|
||||||
# username: yingdd
|
# username: yingdd
|
||||||
# password: Yingdd2015
|
# password: Yingdd2015
|
||||||
url: jdbc:mysql://127.0.0.1:3306/smart_venue?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2b8&useAffectedRows=true
|
url: jdbc:mysql://120.27.209.4:3306/smart_venue?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2b8&useAffectedRows=true
|
||||||
username: root
|
username: root
|
||||||
password: 123456
|
password: hyty1234
|
||||||
redis:
|
redis:
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
password:
|
password:
|
||||||
|
|||||||
@@ -1,13 +1,23 @@
|
|||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:mysql://yingdiandian.mysql.rds.aliyuncs.com:3306/smart_venue?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2b8
|
# url: jdbc:mysql://yingdiandian.mysql.rds.aliyuncs.com:3306/smart_venue?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2b8
|
||||||
username: yingdd
|
# username: yingdd
|
||||||
password: Yingdd2015
|
# password: Yingdd2015
|
||||||
|
url: jdbc:mysql://120.27.209.4:3306/smart_venue?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2b8&useAffectedRows=true
|
||||||
|
username: root
|
||||||
|
password: 123456
|
||||||
redis:
|
redis:
|
||||||
host: 121.41.101.63
|
host: 127.0.0.1
|
||||||
password: yingdiandian2015
|
password:
|
||||||
timeout: 6000
|
timeout: 6000
|
||||||
port: 6379
|
port: 6379
|
||||||
|
|
||||||
jpa:
|
jpa:
|
||||||
show-sql: true
|
show-sql: true
|
||||||
|
|
||||||
|
sv:
|
||||||
|
file:
|
||||||
|
store:
|
||||||
|
image: imagetest/
|
||||||
|
video: videotest/
|
||||||
|
health: health-docstest/
|
||||||
|
|||||||
@@ -335,5 +335,25 @@ public class VenueLessonService extends BaseServiceImpl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* copy单个课程
|
||||||
|
* @param lessonId
|
||||||
|
* @param targetDate
|
||||||
|
*/
|
||||||
|
@Transactional(readOnly = false)
|
||||||
|
public void copyOneLesson(Integer lessonId, Date targetDate) {
|
||||||
|
VenueLesson x = venueLessonMapper.findById(lessonId);
|
||||||
|
Integer oldId = x.getId();
|
||||||
|
x.setId(null);
|
||||||
|
x.setModifiedId(999);
|
||||||
|
x.setSaleNum(0);
|
||||||
|
x.setModifiedTime(new Date());
|
||||||
|
x.setDate(targetDate);
|
||||||
|
venueLessonMapper.insert(x);
|
||||||
|
insertLessonTicket(x);
|
||||||
|
venueLessonMapper.copyImg(oldId, x.getId());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user