You've already forked FrameTour-BE
逻辑调整
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
package com.ycwl.basic.service.task;
|
||||
|
||||
public interface TaskTemplateService {
|
||||
}
|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ycwl.basic.biz.OrderBiz;
|
||||
import com.ycwl.basic.biz.TaskStatusBiz;
|
||||
import com.ycwl.basic.biz.TemplateBiz;
|
||||
import com.ycwl.basic.constant.TaskConstant;
|
||||
import com.ycwl.basic.mapper.FaceMapper;
|
||||
@@ -109,6 +110,8 @@ public class TaskTaskServiceImpl implements TaskService {
|
||||
@Autowired
|
||||
private OrderRepository orderRepository;
|
||||
private final ReentrantLock lock = new ReentrantLock();
|
||||
@Autowired
|
||||
private TaskStatusBiz taskStatusBiz;
|
||||
|
||||
|
||||
private RenderWorkerEntity getWorker(@NonNull WorkerAuthReqVo req) {
|
||||
@@ -370,6 +373,12 @@ public class TaskTaskServiceImpl implements TaskService {
|
||||
if (faceSampleList.isEmpty()) {
|
||||
log.info("faceId:{} sample list not exist", faceId);
|
||||
}
|
||||
if (automatic == 1) {
|
||||
if (templateBiz.determineTemplateCanGenerate(templateId, faceId, false)) {
|
||||
// 临时写死,当自动生成视频,切片也算合成中,并更新状态
|
||||
taskStatusBiz.setFaceCutStatus(face.getId(), 0);
|
||||
}
|
||||
}
|
||||
List<Long> faceSampleIds = faceSampleList.stream().map(FaceSampleEntity::getId).collect(Collectors.toList());
|
||||
List<SourceEntity> sourceList = sourceMapper.listVideoByScenicFaceRelation(face.getScenicId(), faceId);
|
||||
// ScenicConfigEntity scenicConfig = scenicRepository.getScenicConfig(face.getScenicId());
|
||||
@@ -493,6 +502,8 @@ public class TaskTaskServiceImpl implements TaskService {
|
||||
}
|
||||
}
|
||||
videoMapper.addRelation(memberVideoEntity);
|
||||
// 任务生成了,需要更新切割任务状态
|
||||
taskStatusBiz.setFaceCutStatus(faceId, 2);
|
||||
};
|
||||
if (faceSampleIds.isEmpty()) {
|
||||
// 没有人脸样本
|
||||
|
@@ -1,31 +0,0 @@
|
||||
package com.ycwl.basic.service.task.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.ycwl.basic.mapper.TemplateMapper;
|
||||
import com.ycwl.basic.model.pc.template.entity.TemplateConfigEntity;
|
||||
import com.ycwl.basic.service.task.TaskTemplateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class TaskTemplateServiceImpl implements TaskTemplateService {
|
||||
@Autowired
|
||||
private RedisTemplate<String, String> redisTemplate;
|
||||
@Autowired
|
||||
private TemplateMapper templateMapper;
|
||||
|
||||
private static final String TEMPLATE_KEY = "template:";
|
||||
private static final String TEMPLATE_CONFIG_KEY = "template:config:";
|
||||
|
||||
private TemplateConfigEntity getTemplateConfig(Long templateId) {
|
||||
if (redisTemplate.hasKey(TEMPLATE_CONFIG_KEY + templateId)) {
|
||||
return JSON.parseObject(redisTemplate.opsForValue().get(TEMPLATE_CONFIG_KEY + templateId), TemplateConfigEntity.class);
|
||||
}
|
||||
TemplateConfigEntity config = templateMapper.getConfig(templateId);
|
||||
if (config != null) {
|
||||
redisTemplate.opsForValue().set(TEMPLATE_CONFIG_KEY + templateId, JSON.toJSONString(config));
|
||||
}
|
||||
return config;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user