fix copy bug
This commit is contained in:
@@ -43,8 +43,8 @@ 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.parse("09:00");
|
||||||
LocalDate date = LocalDate.now();
|
LocalDate date = LocalDate.parse("2022-02-21");
|
||||||
logger.info(time.toString());
|
logger.info(time.toString());
|
||||||
logger.info(date.toString());
|
logger.info(date.toString());
|
||||||
int cWeek = date.getDayOfWeek().getValue();
|
int cWeek = date.getDayOfWeek().getValue();
|
||||||
@@ -59,7 +59,7 @@ public class CopyLessonTask {
|
|||||||
LocalDate endDate = date.plusDays(-1);
|
LocalDate endDate = date.plusDays(-1);
|
||||||
String startTime = dtf.format(startDate);
|
String startTime = dtf.format(startDate);
|
||||||
String endTime = dtf.format(endDate);
|
String endTime = dtf.format(endDate);
|
||||||
List<VenueLesson> allForCopy = venueLessonService.findAllForCopy(startTime, endTime);
|
List<VenueLesson> allForCopy = venueLessonService.findAllForCopy(startTime, endTime,venue.getId());
|
||||||
if (allForCopy!= null && allForCopy.size()>0){
|
if (allForCopy!= null && allForCopy.size()>0){
|
||||||
logger.info("需要操作的课程数为:" + allForCopy.size());
|
logger.info("需要操作的课程数为:" + allForCopy.size());
|
||||||
Integer copyTarget = venue.getCopyTarget();
|
Integer copyTarget = venue.getCopyTarget();
|
||||||
|
|||||||
@@ -158,5 +158,5 @@ public interface VenueLessonMapper {
|
|||||||
|
|
||||||
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);
|
List<VenueLesson> findAllForCopy(@Param("leftTime") String leftTime, @Param("rightTime") String rightTime, @Param("venueId") Integer venueId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -295,8 +295,8 @@ public class VenueLessonService extends BaseServiceImpl {
|
|||||||
*
|
*
|
||||||
* @return 需要拷贝的场馆课程
|
* @return 需要拷贝的场馆课程
|
||||||
*/
|
*/
|
||||||
public List<VenueLesson> findAllForCopy(String leftTime, String rightTime) {
|
public List<VenueLesson> findAllForCopy(String leftTime, String rightTime,Integer venueId) {
|
||||||
return venueLessonMapper.findAllForCopy(leftTime, rightTime);
|
return venueLessonMapper.findAllForCopy(leftTime, rightTime, venueId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -683,6 +683,9 @@
|
|||||||
<if test="rightTime != null">
|
<if test="rightTime != null">
|
||||||
and date <= #{rightTime}
|
and date <= #{rightTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="venueId != null">
|
||||||
|
and venue_id = #{venueId}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user