You've already forked FrameTour-BE
bug修复
This commit is contained in:
@@ -13,7 +13,9 @@ import com.ycwl.basic.repository.ScenicRepository;
|
||||
import com.ycwl.basic.repository.TemplateRepository;
|
||||
import com.ycwl.basic.service.task.TaskFaceService;
|
||||
import com.ycwl.basic.service.task.impl.TaskTaskServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -21,8 +23,10 @@ import org.springframework.stereotype.Component;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@EnableScheduling
|
||||
@Component
|
||||
@Profile("prod")
|
||||
public class VideoTaskGenerator {
|
||||
@Autowired
|
||||
private FaceMapper faceMapper;
|
||||
@@ -55,31 +59,10 @@ public class VideoTaskGenerator {
|
||||
taskFaceService.searchFace(face.getId());
|
||||
boolean canAutoGenerate = templateBiz.determineTemplateCanAutoGenerate(templateId, face.getId(), false);
|
||||
if (canAutoGenerate) {
|
||||
taskTaskService.autoCreateTaskByFaceId(face.getId());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Scheduled(cron = "0 30 4 * * *")
|
||||
public void generateVideoTaskZTJQ() {
|
||||
// 指定,获取指定日期的未完成人脸样本,并生成任务
|
||||
Long scenicId = 3930324797233434624L;
|
||||
List<ContentPageVO> contentList = templateMapper.listFor(scenicId);
|
||||
if (contentList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Long templateId = contentList.get(0).getTemplateId();
|
||||
FaceReqQuery query = new FaceReqQuery();
|
||||
query.setScenicId(scenicId);
|
||||
query.setStartTime(DateUtil.beginOfDay(new Date()));
|
||||
query.setEndTime(DateUtil.endOfDay(new Date()));
|
||||
List<FaceRespVO> list = faceMapper.list(query);
|
||||
list.stream().parallel().forEach(face -> {
|
||||
taskFaceService.searchFace(face.getId());
|
||||
boolean canAutoGenerate = templateBiz.determineTemplateCanAutoGenerate(templateId, face.getId(), false);
|
||||
if (canAutoGenerate) {
|
||||
taskTaskService.autoCreateTaskByFaceId(face.getId());
|
||||
log.info("task callback: 自动生成");
|
||||
taskTaskService.forceCreateTaskByFaceIdAndTempalteId(face.getId(), templateId);
|
||||
} else {
|
||||
log.info("task callback: 不自动生成");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user