You've already forked FrameTour-BE
修改
This commit is contained in:
@ -25,22 +25,20 @@ import com.ycwl.basic.model.pc.source.req.SourceReqQuery;
|
||||
import com.ycwl.basic.model.pc.source.resp.SourceRespVO;
|
||||
import com.ycwl.basic.model.pc.task.entity.TaskEntity;
|
||||
import com.ycwl.basic.model.pc.video.entity.MemberVideoEntity;
|
||||
import com.ycwl.basic.model.pc.video.entity.VideoEntity;
|
||||
import com.ycwl.basic.model.pc.video.resp.VideoRespVO;
|
||||
import com.ycwl.basic.repository.ScenicRepository;
|
||||
import com.ycwl.basic.repository.VideoRepository;
|
||||
import com.ycwl.basic.repository.VideoTaskRepository;
|
||||
import com.ycwl.basic.service.mobile.AppScenicService;
|
||||
import com.ycwl.basic.repository.TemplateRepository;
|
||||
import com.ycwl.basic.utils.ApiResponse;
|
||||
import com.ycwl.basic.utils.JwtTokenUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -75,6 +73,8 @@ public class AppScenicServiceImpl implements AppScenicService {
|
||||
private TemplateBiz templateBiz;
|
||||
@Autowired
|
||||
private VideoTaskRepository videoTaskRepository;
|
||||
@Autowired
|
||||
private VideoRepository videoRepository;
|
||||
|
||||
@Override
|
||||
public ApiResponse<PageInfo<ScenicAppVO>> pageQuery(ScenicReqQuery scenicReqQuery) {
|
||||
@ -106,10 +106,10 @@ public class AppScenicServiceImpl implements AppScenicService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse<List<ContentPageVO>> faceContentList(Long userId, Long faceId) {
|
||||
public List<ContentPageVO> faceContentList(Long userId, Long faceId) {
|
||||
FaceRespVO faceRespVO = faceMapper.getById(faceId);
|
||||
if (faceRespVO == null) {
|
||||
return ApiResponse.success(new ArrayList<>());
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<ContentPageVO> contentList = templateMapper.listFor(faceRespVO.getScenicId());
|
||||
contentList.forEach(contentPageVO -> {
|
||||
@ -119,9 +119,9 @@ public class AppScenicServiceImpl implements AppScenicService {
|
||||
if (!memberVideoEntityList.isEmpty()) {
|
||||
contentPageVO.setIsBuy(memberVideoEntityList.get(0).getIsBuy());
|
||||
contentPageVO.setContentId(memberVideoEntityList.get(0).getVideoId());
|
||||
VideoRespVO videoMapperById = videoMapper.getById(contentPageVO.getContentId());
|
||||
if (videoMapperById != null) {
|
||||
contentPageVO.setDuration(videoMapperById.getDuration());
|
||||
VideoEntity video = videoRepository.getVideo(contentPageVO.getContentId());
|
||||
if (video != null) {
|
||||
contentPageVO.setDuration(video.getDuration());
|
||||
contentPageVO.setLockType(-1);
|
||||
} else {
|
||||
TaskEntity taskById = videoTaskRepository.getTaskById(memberVideoEntityList.get(0).getTaskId());
|
||||
@ -198,7 +198,7 @@ public class AppScenicServiceImpl implements AppScenicService {
|
||||
}
|
||||
});
|
||||
|
||||
return ApiResponse.success(contentList);
|
||||
return contentList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -231,7 +231,8 @@ public class AppScenicServiceImpl implements AppScenicService {
|
||||
@Override
|
||||
public ApiResponse<List<ContentPageVO>> contentListUseDefaultFace() {
|
||||
FaceRespVO lastFaceByUserId = faceMapper.findLastFaceByUserId(BaseContextHandler.getUserId());
|
||||
return faceContentList(lastFaceByUserId.getMemberId(), lastFaceByUserId.getId());
|
||||
List<ContentPageVO> contentPageVOS = faceContentList(lastFaceByUserId.getMemberId(), lastFaceByUserId.getId());
|
||||
return ApiResponse.success(contentPageVOS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -7,7 +7,6 @@ import com.ycwl.basic.biz.TaskStatusBiz;
|
||||
import com.ycwl.basic.constant.BaseContextHandler;
|
||||
import com.ycwl.basic.mapper.*;
|
||||
import com.ycwl.basic.model.mobile.goods.*;
|
||||
import com.ycwl.basic.model.mobile.order.IsBuyRespVO;
|
||||
import com.ycwl.basic.model.mobile.order.PriceObj;
|
||||
import com.ycwl.basic.model.pc.face.entity.FaceEntity;
|
||||
import com.ycwl.basic.model.pc.face.resp.FaceRespVO;
|
||||
@ -32,9 +31,6 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@ -141,7 +137,7 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse<List<GoodsDetailVO>> sourceGoodsList(Long userId, GoodsReqQuery query) {
|
||||
public List<GoodsDetailVO> sourceGoodsList(Long userId, GoodsReqQuery query) {
|
||||
Integer sourceType = query.getSourceType();
|
||||
SourceReqQuery sourceReqQuery = new SourceReqQuery();
|
||||
sourceReqQuery.setScenicId(query.getScenicId());
|
||||
@ -186,7 +182,7 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
i++;
|
||||
}
|
||||
|
||||
return ApiResponse.success(goodsDetailVOList);
|
||||
return goodsDetailVOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,7 +8,6 @@ import com.ycwl.basic.mapper.FaceSampleMapper;
|
||||
import com.ycwl.basic.mapper.SourceMapper;
|
||||
import com.ycwl.basic.mapper.StatisticsMapper;
|
||||
import com.ycwl.basic.mapper.FaceMapper;
|
||||
import com.ycwl.basic.model.jwt.JwtInfo;
|
||||
import com.ycwl.basic.model.mobile.face.FaceRecognizeResp;
|
||||
import com.ycwl.basic.model.mobile.order.IsBuyRespVO;
|
||||
import com.ycwl.basic.model.mobile.statistic.req.StatisticsRecordAddReq;
|
||||
@ -113,12 +112,8 @@ public class FaceServiceImpl implements FaceService {
|
||||
}
|
||||
|
||||
@Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
public ApiResponse faceUpload(MultipartFile file, Long scenicId) {
|
||||
//获取用户id
|
||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||
Long userId = worker.getUserId();
|
||||
log.info("当前登录用户信息:{}",worker);
|
||||
public FaceRecognizeResp faceUpload(MultipartFile file, Long scenicId, Long userId) {
|
||||
|
||||
|
||||
//1、上传人脸照片
|
||||
IStorageAdapter adapter = StorageFactory.use("faces");
|
||||
@ -188,7 +183,7 @@ public class FaceServiceImpl implements FaceService {
|
||||
resp.setUrl(faceUrl);
|
||||
resp.setFaceId(newFaceId);
|
||||
matchFaceId(newFaceId, oldFaceId == null);
|
||||
return ApiResponse.success(resp);
|
||||
return resp;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -29,6 +29,8 @@ import com.ycwl.basic.model.pc.video.entity.VideoEntity;
|
||||
import com.ycwl.basic.model.pc.video.resp.VideoRespVO;
|
||||
import com.ycwl.basic.model.wx.WXPayOrderReqVO;
|
||||
import com.ycwl.basic.model.wx.WxPayRespVO;
|
||||
import com.ycwl.basic.repository.VideoRepository;
|
||||
import com.ycwl.basic.repository.VideoTaskRepository;
|
||||
import com.ycwl.basic.service.mobile.GoodsService;
|
||||
import com.ycwl.basic.service.mobile.WxPayService;
|
||||
import com.ycwl.basic.service.pc.OrderService;
|
||||
@ -76,6 +78,10 @@ public class OrderServiceImpl implements OrderService {
|
||||
private OrderBiz orderBiz;
|
||||
@Autowired
|
||||
private TaskTaskServiceImpl taskTaskServiceImpl;
|
||||
@Autowired
|
||||
private VideoRepository videoRepository;
|
||||
@Autowired
|
||||
private VideoTaskRepository videoTaskRepository;
|
||||
|
||||
@Override
|
||||
public ApiResponse<PageInfo<OrderRespVO>> pageQuery(OrderReqQuery query) {
|
||||
@ -109,9 +115,9 @@ public class OrderServiceImpl implements OrderService {
|
||||
}
|
||||
} else {
|
||||
item.setCoverList(Collections.singletonList(item.getCoverUrl()));
|
||||
VideoRespVO videoMapperById = videoMapper.getById(item.getGoodsId());
|
||||
VideoEntity videoMapperById = videoRepository.getVideoByTaskId(item.getGoodsId());
|
||||
if (videoMapperById != null) {
|
||||
item.setShootingTime(taskTaskServiceImpl.getTaskShotDate(videoMapperById.getTaskId()));
|
||||
item.setShootingTime(videoTaskRepository.getTaskShotDate(videoMapperById.getTaskId()));
|
||||
item.setVideoUrl(videoMapperById.getVideoUrl());
|
||||
}
|
||||
}
|
||||
@ -229,9 +235,9 @@ public class OrderServiceImpl implements OrderService {
|
||||
}
|
||||
} else {
|
||||
item.setCoverList(Collections.singletonList(item.getCoverUrl()));
|
||||
VideoRespVO videoMapperById = videoMapper.getById(item.getGoodsId());
|
||||
if (videoMapperById != null) {
|
||||
item.setShootingTime(taskTaskServiceImpl.getTaskShotDate(videoMapperById.getTaskId()));
|
||||
VideoEntity video = videoRepository.getVideo(item.getGoodsId());
|
||||
if (video != null) {
|
||||
item.setShootingTime(videoTaskRepository.getTaskShotDate(video.getTaskId()));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -42,34 +42,4 @@ public class VideoServiceImpl implements VideoService {
|
||||
return ApiResponse.success(videoMapper.getById(id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse<Boolean> add(VideoEntity video) {
|
||||
video.setId(SnowFlakeUtil.getLongId());
|
||||
int i = videoMapper.add(video);
|
||||
if (i > 0) {
|
||||
return ApiResponse.success(true);
|
||||
}else {
|
||||
return ApiResponse.fail("成片新增失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse<Boolean> deleteById(Long id) {
|
||||
int i = videoMapper.deleteById(id);
|
||||
if (i > 0) {
|
||||
return ApiResponse.success(true);
|
||||
}else {
|
||||
return ApiResponse.fail("成片删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse<Boolean> update(VideoEntity video) {
|
||||
int i = videoMapper.update(video);
|
||||
if (i > 0) {
|
||||
return ApiResponse.success(true);
|
||||
}else {
|
||||
return ApiResponse.fail("成片修改失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public interface AppScenicService {
|
||||
ApiResponse<List<ScenicAppVO>> scenicList(ScenicIndexVO scenicIndexVO);
|
||||
|
||||
|
||||
ApiResponse<List<ContentPageVO>> faceContentList(Long userId, Long faceId);
|
||||
List<ContentPageVO> faceContentList(Long userId, Long faceId);
|
||||
|
||||
ApiResponse<ScenicLoginRespVO> login(ScenicLoginReq scenicLoginReq) throws Exception;
|
||||
|
||||
|
@ -25,7 +25,7 @@ public interface GoodsService {
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
ApiResponse<List<GoodsDetailVO>> sourceGoodsList(Long userId, GoodsReqQuery query);
|
||||
List<GoodsDetailVO> sourceGoodsList(Long userId, GoodsReqQuery query);
|
||||
|
||||
/**
|
||||
* @param userId 商品(vlog)id
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.ycwl.basic.service.pc;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.ycwl.basic.model.mobile.face.FaceRecognizeResp;
|
||||
import com.ycwl.basic.model.pc.face.entity.FaceEntity;
|
||||
import com.ycwl.basic.model.pc.face.req.FaceReqQuery;
|
||||
import com.ycwl.basic.model.pc.face.resp.FaceRespVO;
|
||||
@ -22,7 +23,7 @@ public interface FaceService {
|
||||
ApiResponse<Integer> deleteById(Long id);
|
||||
ApiResponse<Integer> deleteByIds(List<Long> ids);
|
||||
|
||||
ApiResponse faceUpload(MultipartFile file, Long scrnicId);
|
||||
FaceRecognizeResp faceUpload(MultipartFile file, Long scenicId, Long userId);
|
||||
|
||||
List<FaceRespVO> listByUser(Long userId, String scenicId);
|
||||
SearchFaceRespVo matchFaceId(Long faceId);
|
||||
|
@ -16,9 +16,6 @@ public interface VideoService {
|
||||
ApiResponse<PageInfo<VideoRespVO>> pageQuery(VideoReqQuery videoReqQuery);
|
||||
ApiResponse<List<VideoRespVO>> list(VideoReqQuery videoReqQuery);
|
||||
ApiResponse<VideoRespVO> getById(Long id);
|
||||
ApiResponse<Boolean> add(VideoEntity task);
|
||||
ApiResponse<Boolean> deleteById(Long id);
|
||||
ApiResponse<Boolean> update(VideoEntity task);
|
||||
|
||||
|
||||
}
|
||||
|
@ -316,8 +316,8 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
||||
listFaceEntitiesRequest.setOrder("asc");
|
||||
try {
|
||||
IAcsClient client = getClient();
|
||||
AtomicBoolean flag = new AtomicBoolean(false);
|
||||
while (true) {
|
||||
AtomicBoolean flag = new AtomicBoolean(false);
|
||||
ListFaceEntitiesResponse listFaceEntitiesResponse = client.getAcsResponse(listFaceEntitiesRequest);
|
||||
if (listFaceEntitiesResponse == null || listFaceEntitiesResponse.getData() == null || listFaceEntitiesResponse.getData().getEntities() == null || listFaceEntitiesResponse.getData().getEntities().isEmpty()) {
|
||||
break;
|
||||
@ -346,6 +346,8 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
||||
});
|
||||
if (!flag.get()) {
|
||||
break;
|
||||
} else {
|
||||
flag.set(false);
|
||||
}
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
|
@ -438,6 +438,8 @@ public class TaskTaskServiceImpl implements TaskService {
|
||||
}
|
||||
List<SourceEntity> videoSourceList = sourceMapper.listVideoByScenicFaceRelation(face.getScenicId(), faceId);
|
||||
Map<String, List<SourceEntity>> sourcesMap = videoSourceList.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.filter(item -> Objects.nonNull(item.getVideoUrl()))
|
||||
.peek(item -> item.setUrl(item.getVideoUrl()))
|
||||
.filter(item -> {
|
||||
DeviceEntity device = deviceRepository.getDevice(item.getDeviceId());
|
||||
@ -555,6 +557,7 @@ public class TaskTaskServiceImpl implements TaskService {
|
||||
video.setDuration(req.getVideoInfo().getDuration());
|
||||
}
|
||||
videoMapper.update(video);
|
||||
videoRepository.clearVideoCache(video.getId());
|
||||
} else {
|
||||
video = new VideoEntity();
|
||||
video.setId(SnowFlakeUtil.getLongId());
|
||||
|
Reference in New Issue
Block a user