You've already forked FrameTour-BE
1
This commit is contained in:
@@ -48,4 +48,6 @@ public interface GoodsService {
|
||||
List<GoodsUrlVO> sourceGoodsListPreview(GoodsReqQuery query);
|
||||
|
||||
List<GoodsUrlVO> sourceGoodsListDownload(GoodsReqQuery query);
|
||||
|
||||
Integer sourceGoodsCount(GoodsReqQuery query);
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.extra.qrcode.QrCodeUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
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;
|
||||
@@ -199,6 +200,8 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
goodsDetailVO.setScenicName(sourceRespVO.getScenicName());
|
||||
goodsDetailVO.setGoodsType(sourceType);
|
||||
goodsDetailVO.setGoodsId(sourceRespVO.getId());
|
||||
goodsDetailVO.setIsFree(sourceRespVO.getIsFree());
|
||||
goodsDetailVO.setIsBuy(sourceRespVO.getIsBuy());
|
||||
if (sourceRespVO.getVideoUrl() != null) {
|
||||
try {
|
||||
URL url = new URL(sourceRespVO.getVideoUrl());
|
||||
@@ -278,9 +281,14 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
paramJson.entrySet().stream()
|
||||
.filter(entry -> StringUtils.isNumeric(entry.getKey()))
|
||||
.forEach(entry -> {
|
||||
if (templatePlaceholder.contains(entry.getKey())) {
|
||||
deviceCount.getAndIncrement();
|
||||
templatePlaceholder.remove(entry.getKey());
|
||||
JSONArray jsonArray = paramJson.getJSONArray(entry.getKey());
|
||||
if (jsonArray != null && !jsonArray.isEmpty()) {
|
||||
for (Object ignored : jsonArray) {
|
||||
if (templatePlaceholder.contains(entry.getKey())) {
|
||||
deviceCount.getAndIncrement();
|
||||
templatePlaceholder.remove(entry.getKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -573,14 +581,9 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
if (face == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
IsBuyRespVO isBuy = orderBiz.isBuy(face.getMemberId(), query.getScenicId(), query.getSourceType(), query.getFaceId());
|
||||
if (!isBuy.isBuy()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Integer sourceType = query.getSourceType();
|
||||
SourceReqQuery sourceReqQuery = new SourceReqQuery();
|
||||
sourceReqQuery.setScenicId(query.getScenicId());
|
||||
sourceReqQuery.setIsBuy(query.getIsBuy());
|
||||
sourceReqQuery.setScenicId(face.getScenicId());
|
||||
sourceReqQuery.setMemberId(face.getMemberId());
|
||||
sourceReqQuery.setType(sourceType);
|
||||
sourceReqQuery.setFaceId(query.getFaceId());
|
||||
@@ -598,6 +601,21 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
return goodsUrlVO;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
long count = list.stream().filter((item) -> {
|
||||
if (item.getIsFree() > 0) {
|
||||
return false;
|
||||
}
|
||||
if (item.getIsBuy() > 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}).count();
|
||||
if (count > 0) {
|
||||
IsBuyRespVO isBuy = orderBiz.isBuy(face.getMemberId(), query.getScenicId(), query.getSourceType(), query.getFaceId());
|
||||
if (!isBuy.isBuy()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
List<GoodsUrlVO> defaultUrlList = list.stream().map(source -> {
|
||||
GoodsUrlVO goodsUrlVO = new GoodsUrlVO();
|
||||
goodsUrlVO.setGoodsType(source.getType());
|
||||
@@ -678,4 +696,20 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
}
|
||||
return defaultUrlList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer sourceGoodsCount(GoodsReqQuery query) {
|
||||
FaceEntity face = faceRepository.getFace(query.getFaceId());
|
||||
if (face == null) {
|
||||
return 0;
|
||||
}
|
||||
Integer sourceType = query.getSourceType();
|
||||
SourceReqQuery sourceReqQuery = new SourceReqQuery();
|
||||
sourceReqQuery.setScenicId(query.getScenicId());
|
||||
sourceReqQuery.setIsBuy(query.getIsBuy());
|
||||
sourceReqQuery.setMemberId(face.getMemberId());
|
||||
sourceReqQuery.setType(sourceType);
|
||||
sourceReqQuery.setFaceId(query.getFaceId());
|
||||
return sourceMapper.countUser(sourceReqQuery);
|
||||
}
|
||||
}
|
||||
|
@@ -202,14 +202,11 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
||||
SearchFaceRespVo respVo = new SearchFaceRespVo();
|
||||
List<SearchFaceResultItem> records = response.getResult();
|
||||
respVo.setScore(response.getOriginalFaceScore());
|
||||
if (records.isEmpty()) {
|
||||
return respVo;
|
||||
}
|
||||
respVo.setSearchResultJson(JSON.toJSONString(records));
|
||||
logEntity.setMatchRawRecord(records);
|
||||
if (records.isEmpty()) {
|
||||
return respVo;
|
||||
}
|
||||
logEntity.setMatchRawRecord(records);
|
||||
acceptFaceSampleIds = records.stream()
|
||||
.filter(record -> record.getScore() > _threshold)
|
||||
.map(SearchFaceResultItem::getExtData)
|
||||
@@ -268,12 +265,12 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
||||
record.setMatched(item.getScore() > _threshold);
|
||||
collect.add(record);
|
||||
}
|
||||
logEntity.setMatchLocalRecord(JSONObject.toJSONString(collect));
|
||||
if (acceptFaceSampleIds.isEmpty()) {
|
||||
respVo.setFirstMatchRate(0f);
|
||||
respVo.setSampleListIds(Collections.emptyList());
|
||||
return respVo;
|
||||
}
|
||||
logEntity.setMatchLocalRecord(JSONObject.toJSONString(collect));
|
||||
respVo.setFirstMatchRate(response.getFirstMatchRate());
|
||||
respVo.setSampleListIds(acceptFaceSampleIds);
|
||||
return respVo;
|
||||
|
@@ -45,7 +45,6 @@ import com.ycwl.basic.notify.entity.NotifyContent;
|
||||
import com.ycwl.basic.notify.enums.NotifyType;
|
||||
import com.ycwl.basic.repository.DeviceRepository;
|
||||
import com.ycwl.basic.repository.FaceRepository;
|
||||
import com.ycwl.basic.repository.OrderRepository;
|
||||
import com.ycwl.basic.repository.ScenicRepository;
|
||||
import com.ycwl.basic.repository.VideoRepository;
|
||||
import com.ycwl.basic.repository.VideoTaskRepository;
|
||||
@@ -74,10 +73,7 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -603,7 +599,7 @@ public class TaskTaskServiceImpl implements TaskService {
|
||||
IStorageAdapter adapter = scenicService.getScenicTmpStorageAdapter(task.getScenicId());
|
||||
String filename = StorageUtil.joinPath(StorageConstant.VLOG_PATH, task.getId() + "_" + task.getScenicId() + ".mp4");
|
||||
adapter.setAcl(StorageAcl.PUBLIC_READ, filename);
|
||||
videoReUploader.addVideoTask(task.getVideoUrl(), video.getId());
|
||||
videoReUploader.addVideoTask(video.getId());
|
||||
int isBuy = 0;
|
||||
FaceEntity face = faceRepository.getFace(task.getFaceId());
|
||||
if (face != null) {
|
||||
|
Reference in New Issue
Block a user