You've already forked FrameTour-BE
逻辑调整
This commit is contained in:
@@ -3,6 +3,7 @@ package com.ycwl.basic.service.impl.mobile;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ycwl.basic.biz.OrderBiz;
|
||||
import com.ycwl.basic.biz.TaskStatusBiz;
|
||||
import com.ycwl.basic.constant.BaseContextHandler;
|
||||
import com.ycwl.basic.mapper.*;
|
||||
import com.ycwl.basic.model.mobile.goods.*;
|
||||
@@ -66,6 +67,8 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
private OrderBiz orderBiz;
|
||||
@Autowired
|
||||
private FaceRepository faceRepository;
|
||||
@Autowired
|
||||
private TaskStatusBiz taskStatusBiz;
|
||||
|
||||
public ApiResponse<List<GoodsPageVO>> goodsList(GoodsReqQuery query) {
|
||||
//查询原素材
|
||||
@@ -256,7 +259,6 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
@Override
|
||||
public VideoTaskStatusVO getTaskStatusByFaceId(Long userId, Long faceId) {
|
||||
FaceEntity face = faceRepository.getFace(faceId);
|
||||
List<MemberVideoEntity> taskList = videoMapper.listRelationByFace(userId, faceId);
|
||||
VideoTaskStatusVO response = new VideoTaskStatusVO();
|
||||
response.setFaceId(faceId);
|
||||
if (face == null) {
|
||||
@@ -264,6 +266,19 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
return response;
|
||||
}
|
||||
response.setScenicId(face.getScenicId());
|
||||
int faceCutStatus = taskStatusBiz.getFaceCutStatus(faceId);
|
||||
response.setCutStatus(faceCutStatus);
|
||||
if (faceCutStatus == 0) {
|
||||
// 切视频中,也显示正在处理
|
||||
response.setStatus(2);
|
||||
return response;
|
||||
}
|
||||
List<MemberVideoEntity> taskList = videoMapper.listRelationByFace(userId, faceId);
|
||||
if (faceCutStatus != 1 && taskList.isEmpty()) {
|
||||
// 视频切成了能够获取视频的状态,但是没有任务,还是显示正在处理
|
||||
response.setStatus(0);
|
||||
return response;
|
||||
}
|
||||
if (taskList.isEmpty()) {
|
||||
response.setStatus(0);
|
||||
return response;
|
||||
|
||||
@@ -26,7 +26,6 @@ import com.ycwl.basic.service.task.TaskService;
|
||||
import com.ycwl.basic.storage.StorageFactory;
|
||||
import com.ycwl.basic.storage.adapters.IStorageAdapter;
|
||||
import com.ycwl.basic.storage.utils.StorageUtil;
|
||||
import com.ycwl.basic.task.VideoPieceGetter;
|
||||
import com.ycwl.basic.utils.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -188,7 +187,7 @@ public class FaceServiceImpl implements FaceService {
|
||||
FaceRecognizeResp resp = new FaceRecognizeResp();
|
||||
resp.setUrl(faceUrl);
|
||||
resp.setFaceId(newFaceId);
|
||||
matchFaceId(newFaceId);
|
||||
matchFaceId(newFaceId, oldFaceId == null);
|
||||
return ApiResponse.success(resp);
|
||||
}
|
||||
|
||||
@@ -197,8 +196,14 @@ public class FaceServiceImpl implements FaceService {
|
||||
return faceMapper.listByScenicAndUserId(scenicId, userId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SearchFaceRespVo matchFaceId(Long faceId) {
|
||||
return matchFaceId(faceId, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SearchFaceRespVo matchFaceId(Long faceId, boolean isNew) {
|
||||
FaceEntity face = faceRepository.getFace(faceId);
|
||||
if (face == null) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user