You've already forked FrameTour-BE
额外更新少字段的relation
This commit is contained in:
@@ -87,13 +87,13 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
||||
|
||||
@Override
|
||||
public SearchFaceRespVo searchFace(Long faceId) {
|
||||
FaceRespVO faceRespVO = faceMapper.getById(faceId);
|
||||
if (faceRespVO == null) {
|
||||
FaceRespVO face = faceMapper.getById(faceId);
|
||||
if (face == null) {
|
||||
SearchFaceRespVo vo = new SearchFaceRespVo();
|
||||
vo.setSampleListIds(new ArrayList<>());
|
||||
return vo;
|
||||
}
|
||||
Long scenicId = faceRespVO.getScenicId();
|
||||
Long scenicId = face.getScenicId();
|
||||
ScenicConfigEntity scenicConfig = scenicRepository.getScenicConfig(scenicId);
|
||||
IFaceBodyAdapter faceBodyAdapter;
|
||||
if (scenicConfig != null && scenicConfig.getFaceType() != null) {
|
||||
@@ -102,7 +102,7 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
||||
} else {
|
||||
faceBodyAdapter = FaceBodyFactory.use();
|
||||
}
|
||||
SearchFaceRespVo respVo = searchFace(faceBodyAdapter, scenicId.toString(), faceRespVO.getFaceUrl(), "系统定时任务检索");
|
||||
SearchFaceRespVo respVo = searchFace(faceBodyAdapter, scenicId.toString(), face.getFaceUrl(), "系统定时任务检索");
|
||||
if (respVo != null) {
|
||||
FaceEntity faceEntity = new FaceEntity();
|
||||
faceEntity.setId(faceId);
|
||||
@@ -120,17 +120,9 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
||||
MemberSourceEntity memberSourceEntity = new MemberSourceEntity();
|
||||
memberSourceEntity.setScenicId(scenicId);
|
||||
memberSourceEntity.setFaceId(faceEntity.getId());
|
||||
memberSourceEntity.setMemberId(faceRespVO.getMemberId());
|
||||
memberSourceEntity.setMemberId(face.getMemberId());
|
||||
memberSourceEntity.setSourceId(sourceEntity.getId());
|
||||
memberSourceEntity.setType(sourceEntity.getType());
|
||||
IsBuyRespVO isBuy = orderBiz.isBuy(faceRespVO.getMemberId(), scenicId, sourceEntity.getType(), sourceEntity.getId());
|
||||
if (isBuy.isBuy()) { // 如果用户买过
|
||||
memberSourceEntity.setIsBuy(1);
|
||||
} else if (isBuy.isFree()) { // 全免费逻辑
|
||||
memberSourceEntity.setIsBuy(1);
|
||||
} else {
|
||||
memberSourceEntity.setIsBuy(0);
|
||||
}
|
||||
memberSourceEntity.setIsFree(0);
|
||||
if (deviceConfig != null) {
|
||||
if (sourceEntity.getType() == 1) {
|
||||
@@ -146,11 +138,21 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
||||
return memberSourceEntity;
|
||||
}).collect(Collectors.toList());
|
||||
if (!memberSourceEntityList.isEmpty()) {
|
||||
IsBuyRespVO isBuy = orderBiz.isBuy(face.getMemberId(), face.getScenicId(), memberSourceEntityList.getFirst().getType(), faceEntity.getId());
|
||||
for (MemberSourceEntity memberSourceEntity : memberSourceEntityList) {
|
||||
if (isBuy.isBuy()) { // 如果用户买过
|
||||
memberSourceEntity.setIsBuy(1);
|
||||
} else if (isBuy.isFree()) { // 全免费逻辑
|
||||
memberSourceEntity.setIsBuy(1);
|
||||
} else {
|
||||
memberSourceEntity.setIsBuy(0);
|
||||
}
|
||||
}
|
||||
sourceMapper.addRelations(memberSourceEntityList);
|
||||
VideoPieceGetter.Task task = new VideoPieceGetter.Task();
|
||||
task.faceId = faceEntity.getId();
|
||||
task.faceSampleIds = sampleListIds;
|
||||
task.memberId = faceRespVO.getMemberId();
|
||||
task.memberId = face.getMemberId();
|
||||
VideoPieceGetter.addTask(task);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user