部分逻辑修改
This commit is contained in:
parent
37e6f29a33
commit
dab3f4356f
@ -4,6 +4,7 @@ import com.ycwl.basic.model.jwt.JwtInfo;
|
||||
import com.ycwl.basic.model.mobile.goods.*;
|
||||
import com.ycwl.basic.model.pc.source.resp.SourceRespVO;
|
||||
import com.ycwl.basic.service.mobile.GoodsService;
|
||||
import com.ycwl.basic.service.task.TaskService;
|
||||
import com.ycwl.basic.utils.ApiResponse;
|
||||
import com.ycwl.basic.utils.JwtTokenUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -26,6 +27,8 @@ public class AppGoodsController {
|
||||
|
||||
@Autowired
|
||||
private GoodsService goodsService;
|
||||
@Autowired
|
||||
private TaskService taskService;
|
||||
|
||||
@ApiOperation("商品列表")
|
||||
@PostMapping("/goodsList")
|
||||
@ -53,14 +56,14 @@ public class AppGoodsController {
|
||||
|
||||
/**
|
||||
* 查询用户当前景区的视频合成任务状态
|
||||
* @param scenicId 景区id
|
||||
* @param faceId 景区id
|
||||
* @return 0没有任务 1 合成中 2 合成成功
|
||||
*/
|
||||
@ApiOperation("查询用户当前景区的整体视频合成任务状态 0没有任务 1 合成中 2 合成成功 ")
|
||||
@GetMapping("/getTaskStatus/{scenicId}")
|
||||
public ApiResponse<Integer> getAllTaskStatus(@PathVariable("scenicId") Long scenicId) {
|
||||
@GetMapping("/getTaskStatus/{faceId}")
|
||||
public ApiResponse<Integer> getAllTaskStatus(@PathVariable("faceId") Long faceId) {
|
||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||
return goodsService.getAllTaskStatus(worker.getUserId(),scenicId);
|
||||
return goodsService.getAllTaskStatus(worker.getUserId(),faceId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -75,5 +78,10 @@ public class AppGoodsController {
|
||||
return goodsService.getTemplateTaskStatus(worker.getUserId(),templateId);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/submitVideoTask")
|
||||
public ApiResponse<String> submitVideoTask(@RequestBody VideoTaskReq videoTaskReq) {
|
||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||
taskService.autoCreateTaskByFaceIdAndTempalteId(videoTaskReq.getFaceId(),videoTaskReq.getTemplateId(),0);
|
||||
return ApiResponse.success("成功");
|
||||
}
|
||||
}
|
||||
|
@ -50,9 +50,9 @@ public class AppScenicController {
|
||||
}
|
||||
|
||||
@ApiOperation("景区视频源素材列表")
|
||||
@GetMapping("/contentList/{scenicId}")
|
||||
public ApiResponse<List<ContentPageVO>> contentList(@PathVariable Long scenicId) {
|
||||
return appScenicService.contentList(scenicId);
|
||||
@GetMapping("/contentList/{faceId}")
|
||||
public ApiResponse<List<ContentPageVO>> contentList(@PathVariable Long faceId) {
|
||||
return appScenicService.contentList(faceId);
|
||||
}
|
||||
|
||||
|
||||
|
@ -58,8 +58,8 @@ public class TemplateController {
|
||||
return templateService.update(template);
|
||||
}
|
||||
@ApiOperation("修改模板状态")
|
||||
@PostMapping("/updateStatus")
|
||||
public ApiResponse<Boolean> updateStatus(@RequestBody Long id) {
|
||||
@PostMapping("/updateStatus/{id}")
|
||||
public ApiResponse<Boolean> updateStatus(@PathVariable("id") Long id) {
|
||||
return templateService.updateStatus(id);
|
||||
}
|
||||
|
||||
|
@ -54,4 +54,6 @@ public interface TaskMapper {
|
||||
int setStart(TaskEntity taskUpdate);
|
||||
int setSuccess(TaskEntity taskUpdate);
|
||||
int setFail(TaskEntity taskUpdate);
|
||||
|
||||
TaskEntity getFaceAutomaticTask(Long faceId);
|
||||
}
|
||||
|
@ -0,0 +1,9 @@
|
||||
package com.ycwl.basic.model.mobile.face;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FaceRecognizeResp {
|
||||
private String url;
|
||||
private Long faceId;
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.ycwl.basic.model.mobile.goods;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VideoTaskReq {
|
||||
private Long scenicId;
|
||||
private Long templateId;
|
||||
private Long faceId;
|
||||
}
|
@ -29,6 +29,7 @@ public class TaskReqQuery extends BaseQueryParameterReq {
|
||||
*/
|
||||
@ApiModelProperty("用户ID")
|
||||
private Long memberId;
|
||||
private Long faceId;
|
||||
/**
|
||||
* 模板ID
|
||||
*/
|
||||
|
@ -22,6 +22,8 @@ public class VideoReqQuery extends BaseQueryParameterReq {
|
||||
*/
|
||||
@ApiModelProperty("景区id")
|
||||
private Long scenicId;
|
||||
@ApiModelProperty("人脸id")
|
||||
private Long faceId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
|
@ -131,14 +131,16 @@ public class AppScenicServiceImpl implements AppScenicService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse<List<ContentPageVO>> contentList(Long scenicId) {
|
||||
public ApiResponse<List<ContentPageVO>> contentList(Long faceId) {
|
||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||
//查询原素材
|
||||
List<ContentPageVO> contentList = new ArrayList<>();
|
||||
|
||||
FaceRespVO faceRespVO = faceMapper.getById(faceId);
|
||||
|
||||
HashMap<Long, String> videoMap = new HashMap<>();
|
||||
VideoReqQuery videoReqQuery = new VideoReqQuery();
|
||||
videoReqQuery.setScenicId(scenicId);
|
||||
videoReqQuery.setFaceId(faceId);
|
||||
videoReqQuery.setMemberId(worker.getUserId());
|
||||
//查询成片vlog
|
||||
List<VideoRespVO> videoList = videoMapper.list(videoReqQuery);
|
||||
@ -154,7 +156,7 @@ public class AppScenicServiceImpl implements AppScenicService {
|
||||
});
|
||||
|
||||
TemplateReqQuery templateReqQuery = new TemplateReqQuery();
|
||||
templateReqQuery.setScenicId(scenicId);
|
||||
templateReqQuery.setScenicId(faceRespVO.getScenicId());
|
||||
List<TemplateRespVO> list = templateMapper.list(templateReqQuery);
|
||||
list.forEach(templateRespVO -> {
|
||||
Long templateId = templateRespVO.getId();
|
||||
@ -169,7 +171,7 @@ public class AppScenicServiceImpl implements AppScenicService {
|
||||
});
|
||||
|
||||
SourceReqQuery sourceReqQuery = new SourceReqQuery();
|
||||
videoReqQuery.setScenicId(scenicId);
|
||||
videoReqQuery.setScenicId(faceRespVO.getScenicId());
|
||||
videoReqQuery.setMemberId(worker.getUserId());
|
||||
//查询源素材
|
||||
List<SourceRespVO> sourceList = sourceMapper.listGroupByType(sourceReqQuery);
|
||||
|
@ -200,14 +200,14 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
|
||||
/**
|
||||
* 查询用户当前景区的视频合成任务状态
|
||||
* @param scenicId 景区id
|
||||
* @param faceId 景区id
|
||||
* @return 0没有任务 1 合成中 2 合成成功
|
||||
*/
|
||||
@Override
|
||||
public ApiResponse<Integer> getAllTaskStatus(Long userId, Long scenicId) {
|
||||
public ApiResponse<Integer> getAllTaskStatus(Long userId, Long faceId) {
|
||||
TaskReqQuery taskReqQuery = new TaskReqQuery();
|
||||
taskReqQuery.setMemberId(userId);
|
||||
taskReqQuery.setScenicId(scenicId);
|
||||
taskReqQuery.setFaceId(faceId);
|
||||
int allCount=taskMapper.countTask(taskReqQuery);
|
||||
if(allCount==0){//没有任务
|
||||
return ApiResponse.success(0);
|
||||
|
@ -8,6 +8,7 @@ import com.ycwl.basic.exception.BaseException;
|
||||
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.statistic.req.StatisticsRecordAddReq;
|
||||
import com.ycwl.basic.model.pc.face.entity.FaceEntity;
|
||||
import com.ycwl.basic.model.pc.face.req.FaceReqQuery;
|
||||
@ -157,7 +158,10 @@ public class FaceServiceImpl implements FaceService {
|
||||
statisticsRecordAddReq.setScenicId(scenicId);
|
||||
statisticsRecordAddReq.setMorphId(faceEntity.getId());
|
||||
statisticsMapper.addStatisticsRecord(statisticsRecordAddReq);
|
||||
return ApiResponse.success(faceUrl);
|
||||
FaceRecognizeResp resp = new FaceRecognizeResp();
|
||||
resp.setUrl(faceUrl);
|
||||
resp.setFaceId(faceEntity.getId());
|
||||
return ApiResponse.success(resp);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -199,6 +199,10 @@ public class TaskTaskServiceImpl implements TaskService {
|
||||
if (templateList == null || templateList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
TaskEntity faceAutomaticTask = taskMapper.getFaceAutomaticTask(id);
|
||||
if (faceAutomaticTask != null) {
|
||||
return;
|
||||
}
|
||||
autoCreateTaskByFaceIdAndTempalteId(id, templateList.get(0).getId(), 1);
|
||||
}
|
||||
@Override
|
||||
|
@ -91,6 +91,7 @@ from task
|
||||
<where>
|
||||
<if test="workerId!= null">and worker_id = #{workerId} </if>
|
||||
<if test="memberId!= null">and member_id = #{memberId} </if>
|
||||
<if test="faceId!= null">and face_id = #{faceId} </if>
|
||||
<if test="templateId!= null">and template_id = #{templateId} </if>
|
||||
<if test="scenicId!= null">and scenic_id = #{scenicId} </if>
|
||||
<if test="status!= null">and `status` = #{status} </if>
|
||||
@ -98,4 +99,10 @@ from task
|
||||
<if test="endTime!= null">and create_time <= #{endTime} </if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getFaceAutomaticTask" resultType="com.ycwl.basic.model.pc.task.entity.TaskEntity">
|
||||
select *
|
||||
from task
|
||||
where face_id = #{faceId} and automatic = 1
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -40,6 +40,11 @@
|
||||
</if>
|
||||
<if test="startTime!= null">and v.create_time >= #{startTime} </if>
|
||||
<if test="endTime!= null">and v.create_time <= #{endTime} </if>
|
||||
<if test="faceId!= null">
|
||||
and v.task_id in (
|
||||
select id from task where face_id = #{faceId}
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getById" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
|
||||
|
Loading…
x
Reference in New Issue
Block a user