修改
This commit is contained in:
parent
bf5fdeb95c
commit
43ae10916c
@ -3,7 +3,6 @@ package com.ycwl.basic.controller.mobile;
|
|||||||
import com.ycwl.basic.constant.BaseContextHandler;
|
import com.ycwl.basic.constant.BaseContextHandler;
|
||||||
import com.ycwl.basic.model.jwt.JwtInfo;
|
import com.ycwl.basic.model.jwt.JwtInfo;
|
||||||
import com.ycwl.basic.model.mobile.goods.*;
|
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.mobile.GoodsService;
|
||||||
import com.ycwl.basic.service.task.TaskService;
|
import com.ycwl.basic.service.task.TaskService;
|
||||||
import com.ycwl.basic.utils.ApiResponse;
|
import com.ycwl.basic.utils.ApiResponse;
|
||||||
@ -58,28 +57,34 @@ public class AppGoodsController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询用户当前景区的视频合成任务状态
|
* 查询用户当前景区的视频合成任务状态
|
||||||
* @param faceId 景区id
|
*
|
||||||
* @return 0没有任务 1 合成中 2 合成成功
|
* @return 0没有任务 1 合成中 2 合成成功
|
||||||
*/
|
*/
|
||||||
@ApiOperation("查询用户当前景区的整体视频合成任务状态 0没有任务 1 合成中 2 合成成功 ")
|
@ApiOperation("查询用户当前景区的整体视频合成任务状态 0没有任务 1 合成中 2 合成成功 ")
|
||||||
@GetMapping("/getTaskStatus/{faceId}")
|
|
||||||
public ApiResponse<Integer> getAllTaskStatus(@PathVariable("faceId") Long faceId) {
|
|
||||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
|
||||||
return goodsService.getAllTaskStatus(worker.getUserId(),faceId);
|
|
||||||
}
|
|
||||||
@GetMapping("/getTaskStatus/")
|
@GetMapping("/getTaskStatus/")
|
||||||
public ApiResponse<Integer> getAllTaskStatus() {
|
public ApiResponse<VideoTaskStatusVO> getAllTaskStatus() {
|
||||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||||
return goodsService.getAllTaskStatus(worker.getUserId());
|
return goodsService.getAllTaskStatus(worker.getUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/task/face/{faceId}")
|
||||||
|
public ApiResponse<VideoTaskStatusVO> getTaskStatusByFaceId(@PathVariable("faceId") Long faceId) {
|
||||||
|
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||||
|
return goodsService.getTaskStatusByFaceId(worker.getUserId(), faceId);
|
||||||
|
}
|
||||||
|
@GetMapping("/task/scenic/{scenicId}")
|
||||||
|
public ApiResponse<VideoTaskStatusVO> getAllTaskStatusByScenicId(@PathVariable("scenicId") Long scenicId) {
|
||||||
|
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||||
|
return goodsService.getTaskStatusByScenicId(worker.getUserId(), scenicId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询用户当前景区的具体模版视频合成任务状态
|
* 查询用户当前景区的具体模版视频合成任务状态
|
||||||
* @param templateId 模版id
|
* @param templateId 模版id
|
||||||
* @return 1 合成中 2 合成成功
|
* @return 1 合成中 2 合成成功
|
||||||
*/
|
*/
|
||||||
@ApiOperation("查询用户当前景区的具体模版视频合成任务状态 1 合成中 2 合成成功 ")
|
@ApiOperation("查询用户当前景区的具体模版视频合成任务状态 1 合成中 2 合成成功 ")
|
||||||
@GetMapping("/getTemplateTaskStatus/{templateId}")
|
@GetMapping("/task/template/{templateId}")
|
||||||
public ApiResponse<Integer> getTemplateTaskStatus(@PathVariable("templateId") Long templateId) {
|
public ApiResponse<Integer> getTemplateTaskStatus(@PathVariable("templateId") Long templateId) {
|
||||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||||
return goodsService.getTemplateTaskStatus(worker.getUserId(),templateId);
|
return goodsService.getTemplateTaskStatus(worker.getUserId(),templateId);
|
||||||
|
@ -44,5 +44,11 @@ public class AppIndexController {
|
|||||||
// return scenicService.topState();
|
// return scenicService.topState();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@GetMapping("/faceAgreement")
|
||||||
|
public ApiResponse<String> faceAgreement() {
|
||||||
|
return ApiResponse.success("人脸识别隐私协议:\n" +
|
||||||
|
"1、xxx\n1、xxx\n1、xxx\n1、xxx\n1、xxx\n1、xxx\n1、xxx\n1、xxx\n" +
|
||||||
|
"1、xxx\n1、xxx\n1、xxx\n1、xxx\n1、xxx\n1、xxx\n1、xxx\n1、xxx\n" +
|
||||||
|
"1、xxx\n1、xxx\n1、xxx\n1、xxx\n1、xxx\n1、xxx\n1、xxx\n1、xxx\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,8 @@ package com.ycwl.basic.controller.mobile;
|
|||||||
|
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.ycwl.basic.annotation.IgnoreToken;
|
import com.ycwl.basic.annotation.IgnoreToken;
|
||||||
|
import com.ycwl.basic.constant.BaseContextHandler;
|
||||||
|
import com.ycwl.basic.model.jwt.JwtInfo;
|
||||||
import com.ycwl.basic.model.mobile.goods.GoodsPageVO;
|
import com.ycwl.basic.model.mobile.goods.GoodsPageVO;
|
||||||
import com.ycwl.basic.model.mobile.goods.GoodsReqQuery;
|
import com.ycwl.basic.model.mobile.goods.GoodsReqQuery;
|
||||||
import com.ycwl.basic.model.mobile.scenic.ScenicAppVO;
|
import com.ycwl.basic.model.mobile.scenic.ScenicAppVO;
|
||||||
@ -12,6 +14,7 @@ import com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO;
|
|||||||
import com.ycwl.basic.service.mobile.AppScenicService;
|
import com.ycwl.basic.service.mobile.AppScenicService;
|
||||||
import com.ycwl.basic.service.pc.ScenicService;
|
import com.ycwl.basic.service.pc.ScenicService;
|
||||||
import com.ycwl.basic.utils.ApiResponse;
|
import com.ycwl.basic.utils.ApiResponse;
|
||||||
|
import com.ycwl.basic.utils.JwtTokenUtil;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -38,13 +41,13 @@ public class AppScenicController {
|
|||||||
}
|
}
|
||||||
@ApiOperation("根据id查询景区详情")
|
@ApiOperation("根据id查询景区详情")
|
||||||
@IgnoreToken
|
@IgnoreToken
|
||||||
@GetMapping("getDetails/{id}")
|
@GetMapping("/{id}")
|
||||||
public ApiResponse<ScenicRespVO> getDetails(@PathVariable Long id){
|
public ApiResponse<ScenicRespVO> getDetails(@PathVariable Long id){
|
||||||
return appScenicService.getDetails(id);
|
return appScenicService.getDetails(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("查询景区设备总数和拍到用户的机位数量")
|
@ApiOperation("查询景区设备总数和拍到用户的机位数量")
|
||||||
@GetMapping("/deviceCountByScenicId/{scenicId}")
|
@GetMapping("/{scenicId}/deviceCount/")
|
||||||
public ApiResponse<ScenicDeviceCountVO> deviceCountByScenicId(@PathVariable Long scenicId){
|
public ApiResponse<ScenicDeviceCountVO> deviceCountByScenicId(@PathVariable Long scenicId){
|
||||||
return appScenicService.deviceCountByScenicId(scenicId);
|
return appScenicService.deviceCountByScenicId(scenicId);
|
||||||
}
|
}
|
||||||
@ -56,9 +59,10 @@ public class AppScenicController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("景区视频源素材列表")
|
@ApiOperation("景区视频源素材列表")
|
||||||
@GetMapping("/contentList/{faceId}")
|
@GetMapping("/face/{faceId}/contentList")
|
||||||
public ApiResponse<List<ContentPageVO>> contentList(@PathVariable Long faceId) {
|
public ApiResponse<List<ContentPageVO>> contentList(@PathVariable Long faceId) {
|
||||||
return appScenicService.contentList(faceId);
|
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||||
|
return appScenicService.faceContentList(worker.getUserId(), faceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,11 +9,15 @@ import com.ycwl.basic.utils.ApiResponse;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: songmingsong
|
* @Author: songmingsong
|
||||||
* @CreateTime: 2024-12-06
|
* @CreateTime: 2024-12-06
|
||||||
@ -35,4 +39,12 @@ public class AppWxNotifyController {
|
|||||||
return ApiResponse.success(resJson);
|
return ApiResponse.success(resJson);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getIds")
|
||||||
|
@IgnoreToken
|
||||||
|
public ApiResponse<List<String>> getIds() {
|
||||||
|
return ApiResponse.success(new ArrayList<String>() {{
|
||||||
|
add("5b8vTm7kvwYubqDxb3dxBqFIhc3Swt5l7QHSK5r-ZRI");
|
||||||
|
}});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,12 +4,14 @@ import com.ycwl.basic.annotation.IgnoreToken;
|
|||||||
import com.ycwl.basic.model.mobile.scenic.account.ScenicLoginReq;
|
import com.ycwl.basic.model.mobile.scenic.account.ScenicLoginReq;
|
||||||
import com.ycwl.basic.model.mobile.scenic.account.ScenicLoginRespVO;
|
import com.ycwl.basic.model.mobile.scenic.account.ScenicLoginRespVO;
|
||||||
import com.ycwl.basic.model.mobile.weChat.DTO.WeChatUserInfoDTO;
|
import com.ycwl.basic.model.mobile.weChat.DTO.WeChatUserInfoDTO;
|
||||||
|
import com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO;
|
||||||
import com.ycwl.basic.service.mobile.AppScenicService;
|
import com.ycwl.basic.service.mobile.AppScenicService;
|
||||||
import com.ycwl.basic.utils.ApiResponse;
|
import com.ycwl.basic.utils.ApiResponse;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@ -33,4 +35,9 @@ public class AppScenicAccountController {
|
|||||||
public ApiResponse<ScenicLoginRespVO> login(@RequestBody ScenicLoginReq scenicLoginReq) throws Exception {
|
public ApiResponse<ScenicLoginRespVO> login(@RequestBody ScenicLoginReq scenicLoginReq) throws Exception {
|
||||||
return scenicService.login(scenicLoginReq);
|
return scenicService.login(scenicLoginReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getScenic")
|
||||||
|
public ApiResponse<ScenicRespVO> getMyScenic() {
|
||||||
|
return scenicService.getMyScenic();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,4 +12,6 @@ public interface ScenicAccountMapper {
|
|||||||
int deleteById(Long id);
|
int deleteById(Long id);
|
||||||
int updateStatus(Long id);
|
int updateStatus(Long id);
|
||||||
int deleteByScenicId(Long scenicId);
|
int deleteByScenicId(Long scenicId);
|
||||||
|
|
||||||
|
ScenicAccountEntity findAccountById(String id);
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ public class VideoGoodsDetailVO {
|
|||||||
private Date createTime;
|
private Date createTime;
|
||||||
@ApiModelProperty("价格")
|
@ApiModelProperty("价格")
|
||||||
private String price;
|
private String price;
|
||||||
|
private String slashPrice;
|
||||||
@ApiModelProperty("是否已购买 0否 1是")
|
@ApiModelProperty("是否已购买 0否 1是")
|
||||||
private Integer isBuy;
|
private Integer isBuy;
|
||||||
@ApiModelProperty("镜头数")
|
@ApiModelProperty("镜头数")
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
package com.ycwl.basic.model.mobile.goods;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class VideoTaskStatusVO {
|
||||||
|
private Integer status;
|
||||||
|
private Long faceId;
|
||||||
|
private Long scenicId;
|
||||||
|
}
|
@ -84,4 +84,6 @@ public class ScenicAddOrUpdateReq {
|
|||||||
private String account;
|
private String account;
|
||||||
@ApiModelProperty("密码")
|
@ApiModelProperty("密码")
|
||||||
private String password;
|
private String password;
|
||||||
|
private String kfCodeUrl;
|
||||||
|
private String kfPhone;
|
||||||
}
|
}
|
||||||
|
@ -88,4 +88,6 @@ public class ScenicRespVO {
|
|||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
@ApiModelProperty("镜头数")
|
@ApiModelProperty("镜头数")
|
||||||
private Integer lensNum;
|
private Integer lensNum;
|
||||||
|
private String kfCodeUrl;
|
||||||
|
private String kfPhone;
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,7 @@ public class SourceReqQuery extends BaseQueryParameterReq {
|
|||||||
private String url;
|
private String url;
|
||||||
@ApiModelProperty("是否被购买:0未购买,1已购买")
|
@ApiModelProperty("是否被购买:0未购买,1已购买")
|
||||||
private Integer isBuy;
|
private Integer isBuy;
|
||||||
|
private Integer faceId;
|
||||||
private Date startTime;
|
private Date startTime;
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,7 @@ public class TemplateEntity {
|
|||||||
* 价格,单位元
|
* 价格,单位元
|
||||||
*/
|
*/
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
|
private BigDecimal slashPrice;
|
||||||
/**
|
/**
|
||||||
* 是否启用,0不是,1是
|
* 是否启用,0不是,1是
|
||||||
*/
|
*/
|
||||||
|
@ -85,5 +85,6 @@ public class TemplateRespVO {
|
|||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
private List<TemplateRespVO> children;
|
private List<TemplateRespVO> children;
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
|
private BigDecimal slashPrice;
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@ public class VideoRespVO {
|
|||||||
private String templateName;
|
private String templateName;
|
||||||
@ApiModelProperty("模版价格")
|
@ApiModelProperty("模版价格")
|
||||||
private BigDecimal templatePrice;
|
private BigDecimal templatePrice;
|
||||||
|
private BigDecimal slashPrice;
|
||||||
@ApiModelProperty("模版封面图片")
|
@ApiModelProperty("模版封面图片")
|
||||||
private String templateCoverUrl;
|
private String templateCoverUrl;
|
||||||
@ApiModelProperty("经度")
|
@ApiModelProperty("经度")
|
||||||
|
@ -6,7 +6,8 @@ import java.util.List;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class SearchFaceRespVo {
|
public class SearchFaceRespVo {
|
||||||
private float score;
|
private Float score;
|
||||||
private List<Long> sampleListIds;
|
private List<Long> sampleListIds;
|
||||||
private String searchResultJson;
|
private String searchResultJson;
|
||||||
|
private Float firstMatchRate;
|
||||||
}
|
}
|
||||||
|
@ -21,8 +21,6 @@ import com.ycwl.basic.model.pc.scenic.req.ScenicReqQuery;
|
|||||||
import com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO;
|
import com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO;
|
||||||
import com.ycwl.basic.model.pc.source.req.SourceReqQuery;
|
import com.ycwl.basic.model.pc.source.req.SourceReqQuery;
|
||||||
import com.ycwl.basic.model.pc.source.resp.SourceRespVO;
|
import com.ycwl.basic.model.pc.source.resp.SourceRespVO;
|
||||||
import com.ycwl.basic.model.pc.template.req.TemplateReqQuery;
|
|
||||||
import com.ycwl.basic.model.pc.template.resp.TemplateRespVO;
|
|
||||||
import com.ycwl.basic.model.pc.video.req.VideoReqQuery;
|
import com.ycwl.basic.model.pc.video.req.VideoReqQuery;
|
||||||
import com.ycwl.basic.model.pc.video.resp.VideoRespVO;
|
import com.ycwl.basic.model.pc.video.resp.VideoRespVO;
|
||||||
import com.ycwl.basic.service.mobile.AppScenicService;
|
import com.ycwl.basic.service.mobile.AppScenicService;
|
||||||
@ -36,7 +34,6 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -174,6 +171,50 @@ public class AppScenicServiceImpl implements AppScenicService {
|
|||||||
|
|
||||||
return ApiResponse.success(contentList);
|
return ApiResponse.success(contentList);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public ApiResponse<List<ContentPageVO>> faceContentList(Long userId, Long faceId) {
|
||||||
|
FaceRespVO faceRespVO = faceMapper.getById(faceId);
|
||||||
|
if (faceRespVO == null) {
|
||||||
|
return ApiResponse.success(new ArrayList<>());
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(faceRespVO.getMatchSampleIds())) {
|
||||||
|
return ApiResponse.success(new ArrayList<>());
|
||||||
|
}
|
||||||
|
List<ContentPageVO> contentList = templateMapper.listFor(faceRespVO.getScenicId(), faceId);
|
||||||
|
contentList.forEach(contentPageVO -> {
|
||||||
|
if (contentPageVO.getContentType() == 1) {
|
||||||
|
VideoReqQuery videoReqQuery = new VideoReqQuery();
|
||||||
|
videoReqQuery.setScenicId(contentPageVO.getScenicId());
|
||||||
|
videoReqQuery.setTemplateId(contentPageVO.getTemplateId());
|
||||||
|
videoReqQuery.setMemberId(userId);
|
||||||
|
List<VideoRespVO> videoList = videoMapper.list(videoReqQuery);
|
||||||
|
if (!videoList.isEmpty()) {
|
||||||
|
contentPageVO.setContentId(videoList.get(0).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
SourceReqQuery sourceReqQuery = new SourceReqQuery();
|
||||||
|
sourceReqQuery.setScenicId(faceRespVO.getScenicId());
|
||||||
|
sourceReqQuery.setMemberId(userId);
|
||||||
|
//查询源素材
|
||||||
|
List<SourceRespVO> sourceList = sourceMapper.listGroupByType(sourceReqQuery);
|
||||||
|
sourceList.forEach(sourceRespVO -> {
|
||||||
|
ContentPageVO contentPageVO = new ContentPageVO();
|
||||||
|
Integer type = sourceRespVO.getType();
|
||||||
|
if(type==1){
|
||||||
|
contentPageVO.setName("原片集");
|
||||||
|
}else {
|
||||||
|
contentPageVO.setName("照片集");
|
||||||
|
}
|
||||||
|
contentPageVO.setContentType(2);
|
||||||
|
contentPageVO.setSourceType(type);
|
||||||
|
contentPageVO.setIsBuy(sourceRespVO.getIsBuy());
|
||||||
|
contentList.add(contentPageVO);
|
||||||
|
});
|
||||||
|
|
||||||
|
return ApiResponse.success(contentList);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApiResponse<ScenicLoginRespVO> login(ScenicLoginReq scenicLoginReq) throws Exception {
|
public ApiResponse<ScenicLoginRespVO> login(ScenicLoginReq scenicLoginReq) throws Exception {
|
||||||
@ -207,4 +248,14 @@ public class AppScenicServiceImpl implements AppScenicService {
|
|||||||
FaceRespVO lastFaceByUserId = faceMapper.findLastFaceByUserId(BaseContextHandler.getUserId());
|
FaceRespVO lastFaceByUserId = faceMapper.findLastFaceByUserId(BaseContextHandler.getUserId());
|
||||||
return contentList(lastFaceByUserId.getId());
|
return contentList(lastFaceByUserId.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ApiResponse<ScenicRespVO> getMyScenic() {
|
||||||
|
String userId = BaseContextHandler.getUserId();
|
||||||
|
ScenicAccountEntity account = scenicAccountMapper.findAccountById(userId);
|
||||||
|
if (account == null) {
|
||||||
|
return ApiResponse.fail("用户未绑定景区");
|
||||||
|
}
|
||||||
|
return getDetails(account.getScenicId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,7 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.ycwl.basic.constant.BaseContextHandler;
|
import com.ycwl.basic.constant.BaseContextHandler;
|
||||||
import com.ycwl.basic.mapper.*;
|
import com.ycwl.basic.mapper.*;
|
||||||
import com.ycwl.basic.model.jwt.JwtInfo;
|
|
||||||
import com.ycwl.basic.model.mobile.goods.*;
|
import com.ycwl.basic.model.mobile.goods.*;
|
||||||
import com.ycwl.basic.model.mobile.scenic.ScenicDeviceCountVO;
|
|
||||||
import com.ycwl.basic.model.pc.face.resp.FaceRespVO;
|
import com.ycwl.basic.model.pc.face.resp.FaceRespVO;
|
||||||
import com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO;
|
import com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO;
|
||||||
import com.ycwl.basic.model.pc.source.req.SourceReqQuery;
|
import com.ycwl.basic.model.pc.source.req.SourceReqQuery;
|
||||||
@ -18,7 +16,6 @@ import com.ycwl.basic.model.pc.video.resp.VideoRespVO;
|
|||||||
import com.ycwl.basic.service.mobile.GoodsService;
|
import com.ycwl.basic.service.mobile.GoodsService;
|
||||||
import com.ycwl.basic.utils.ApiResponse;
|
import com.ycwl.basic.utils.ApiResponse;
|
||||||
import com.ycwl.basic.utils.DateUtils;
|
import com.ycwl.basic.utils.DateUtils;
|
||||||
import com.ycwl.basic.utils.JwtTokenUtil;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -27,8 +24,8 @@ import java.math.BigDecimal;
|
|||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:longbinbin
|
* @Author:longbinbin
|
||||||
@ -198,9 +195,11 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
goodsDetailVO.setTemplateCoverUrl(videoRespVO.getTemplateCoverUrl());
|
goodsDetailVO.setTemplateCoverUrl(videoRespVO.getTemplateCoverUrl());
|
||||||
goodsDetailVO.setCreateTime(videoRespVO.getCreateTime());
|
goodsDetailVO.setCreateTime(videoRespVO.getCreateTime());
|
||||||
BigDecimal templatePrice = videoRespVO.getTemplatePrice();
|
BigDecimal templatePrice = videoRespVO.getTemplatePrice();
|
||||||
|
BigDecimal slashPrice = videoRespVO.getSlashPrice();
|
||||||
// 使用DecimalFormat格式化输出
|
// 使用DecimalFormat格式化输出
|
||||||
DecimalFormat df = new DecimalFormat("0.00");
|
DecimalFormat df = new DecimalFormat("0.00");
|
||||||
goodsDetailVO.setPrice(templatePrice==null?"":df.format(templatePrice.setScale(2, RoundingMode.HALF_UP)));
|
goodsDetailVO.setPrice(templatePrice==null?"":df.format(templatePrice.setScale(2, RoundingMode.HALF_UP)));
|
||||||
|
goodsDetailVO.setSlashPrice(slashPrice==null?null:df.format(slashPrice.setScale(2, RoundingMode.HALF_UP)));
|
||||||
goodsDetailVO.setIsBuy(videoRespVO.getIsBuy());
|
goodsDetailVO.setIsBuy(videoRespVO.getIsBuy());
|
||||||
TaskRespVO taskRespVO = taskMapper.getById(videoRespVO.getTaskId());
|
TaskRespVO taskRespVO = taskMapper.getById(videoRespVO.getTaskId());
|
||||||
JSONObject paramJson = JSON.parseObject(taskRespVO.getTaskParams());
|
JSONObject paramJson = JSON.parseObject(taskRespVO.getTaskParams());
|
||||||
@ -217,32 +216,39 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询用户当前景区的视频合成任务状态
|
* 查询用户当前景区的视频合成任务状态
|
||||||
|
*
|
||||||
* @param faceId 景区id
|
* @param faceId 景区id
|
||||||
* @return 0没有任务 1 合成中 2 合成成功
|
* @return 0没有任务 1 合成中 2 合成成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ApiResponse<Integer> getAllTaskStatus(Long userId, Long faceId) {
|
public ApiResponse<VideoTaskStatusVO> getTaskStatusByFaceId(Long userId, Long faceId) {
|
||||||
TaskReqQuery taskReqQuery = new TaskReqQuery();
|
TaskReqQuery taskReqQuery = new TaskReqQuery();
|
||||||
taskReqQuery.setMemberId(userId);
|
taskReqQuery.setMemberId(userId);
|
||||||
taskReqQuery.setFaceId(faceId);
|
taskReqQuery.setFaceId(faceId);
|
||||||
int allCount=taskMapper.countTask(taskReqQuery);
|
VideoTaskStatusVO response = new VideoTaskStatusVO();
|
||||||
if(allCount==0){//没有任务
|
List<TaskRespVO> list=taskMapper.list(taskReqQuery);
|
||||||
return ApiResponse.success(0);
|
if(list.isEmpty()){//没有任务
|
||||||
|
response.setStatus(0);
|
||||||
|
return ApiResponse.success(response);
|
||||||
}
|
}
|
||||||
taskReqQuery.setStatus(2);
|
Optional<TaskRespVO> first = list.stream().filter(item -> item.getStatus() == 0 || item.getStatus() == 2).findFirst();
|
||||||
int count=taskMapper.countTask(taskReqQuery);
|
if (first.isPresent()) {
|
||||||
|
response.setStatus(1);
|
||||||
if(count>0){//有任务在进行中
|
response.setScenicId(first.get().getScenicId());
|
||||||
return ApiResponse.success(1);
|
response.setFaceId(first.get().getFaceId());
|
||||||
}else {//没有任务在进行中
|
return ApiResponse.success(response);
|
||||||
return ApiResponse.success(2);
|
} else {
|
||||||
|
response.setStatus(2);
|
||||||
|
response.setScenicId(list.get(0).getScenicId());
|
||||||
|
response.setFaceId(list.get(0).getFaceId());
|
||||||
|
return ApiResponse.success(response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApiResponse<Integer> getAllTaskStatus(Long userId) {
|
public ApiResponse<VideoTaskStatusVO> getAllTaskStatus(Long userId) {
|
||||||
FaceRespVO lastFaceByUserId = faceMapper.findLastFaceByUserId(String.valueOf(userId));
|
FaceRespVO lastFaceByUserId = faceMapper.findLastFaceByUserId(String.valueOf(userId));
|
||||||
return getAllTaskStatus(userId,lastFaceByUserId.getId());
|
return getTaskStatusByFaceId(userId, lastFaceByUserId.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -263,4 +269,31 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ApiResponse<VideoTaskStatusVO> getTaskStatusByScenicId(Long userId, Long scenicId) {
|
||||||
|
TaskReqQuery taskReqQuery = new TaskReqQuery();
|
||||||
|
taskReqQuery.setMemberId(userId);
|
||||||
|
taskReqQuery.setScenicId(scenicId);
|
||||||
|
int allCount=taskMapper.countTask(taskReqQuery);
|
||||||
|
VideoTaskStatusVO response = new VideoTaskStatusVO();
|
||||||
|
if(allCount==0){//没有任务
|
||||||
|
response.setStatus(0);
|
||||||
|
return ApiResponse.success(response);
|
||||||
|
}
|
||||||
|
List<TaskRespVO> list=taskMapper.list(taskReqQuery);
|
||||||
|
// 未完成是等于0或2
|
||||||
|
Optional<TaskRespVO> first = list.stream().filter(item -> item.getStatus() == 0 || item.getStatus() == 2).findFirst();
|
||||||
|
if (first.isPresent()) {
|
||||||
|
response.setStatus(1);
|
||||||
|
response.setScenicId(first.get().getScenicId());
|
||||||
|
response.setFaceId(first.get().getFaceId());
|
||||||
|
return ApiResponse.success(response);
|
||||||
|
} else {
|
||||||
|
response.setStatus(2);
|
||||||
|
response.setScenicId(list.get(0).getScenicId());
|
||||||
|
response.setFaceId(list.get(0).getFaceId());
|
||||||
|
return ApiResponse.success(response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ import com.ycwl.basic.model.task.resp.SearchFaceRespVo;
|
|||||||
import com.ycwl.basic.service.pc.FaceService;
|
import com.ycwl.basic.service.pc.FaceService;
|
||||||
import com.ycwl.basic.service.task.TaskFaceService;
|
import com.ycwl.basic.service.task.TaskFaceService;
|
||||||
import com.ycwl.basic.service.task.TaskService;
|
import com.ycwl.basic.service.task.TaskService;
|
||||||
|
import com.ycwl.basic.task.FaceCleaner;
|
||||||
import com.ycwl.basic.utils.*;
|
import com.ycwl.basic.utils.*;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -25,6 +26,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -50,6 +52,8 @@ public class FaceServiceImpl implements FaceService {
|
|||||||
private float faceScore;
|
private float faceScore;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TaskService taskTaskService;
|
private TaskService taskTaskService;
|
||||||
|
@Autowired
|
||||||
|
private FaceCleaner faceCleaner;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApiResponse<PageInfo<FaceRespVO>> pageQuery(FaceReqQuery faceReqQuery) {
|
public ApiResponse<PageInfo<FaceRespVO>> pageQuery(FaceReqQuery faceReqQuery) {
|
||||||
@ -130,6 +134,7 @@ public class FaceServiceImpl implements FaceService {
|
|||||||
FaceEntity faceEntity = new FaceEntity();
|
FaceEntity faceEntity = new FaceEntity();
|
||||||
faceEntity.setScore(searchFaceRespVo.getScore());
|
faceEntity.setScore(searchFaceRespVo.getScore());
|
||||||
faceEntity.setMatchResult(searchFaceRespVo.getSearchResultJson());
|
faceEntity.setMatchResult(searchFaceRespVo.getSearchResultJson());
|
||||||
|
faceEntity.setFirstMatchRate(BigDecimal.valueOf(searchFaceRespVo.getFirstMatchRate()));
|
||||||
faceEntity.setMatchSampleIds(searchFaceRespVo.getSampleListIds().stream().map(String::valueOf).collect(Collectors.joining(",")));
|
faceEntity.setMatchSampleIds(searchFaceRespVo.getSampleListIds().stream().map(String::valueOf).collect(Collectors.joining(",")));
|
||||||
faceEntity.setCreateAt(new Date());
|
faceEntity.setCreateAt(new Date());
|
||||||
faceEntity.setScenicId(scenicId);
|
faceEntity.setScenicId(scenicId);
|
||||||
|
@ -6,7 +6,11 @@ import com.aliyuncs.exceptions.ClientException;
|
|||||||
import com.aliyuncs.facebody.model.v20191230.AddFaceEntityRequest;
|
import com.aliyuncs.facebody.model.v20191230.AddFaceEntityRequest;
|
||||||
import com.aliyuncs.facebody.model.v20191230.AddFaceRequest;
|
import com.aliyuncs.facebody.model.v20191230.AddFaceRequest;
|
||||||
import com.aliyuncs.facebody.model.v20191230.AddFaceResponse;
|
import com.aliyuncs.facebody.model.v20191230.AddFaceResponse;
|
||||||
|
import com.aliyuncs.facebody.model.v20191230.CreateFaceDbRequest;
|
||||||
|
import com.aliyuncs.facebody.model.v20191230.DeleteFaceDbRequest;
|
||||||
import com.aliyuncs.facebody.model.v20191230.DeleteFaceEntityRequest;
|
import com.aliyuncs.facebody.model.v20191230.DeleteFaceEntityRequest;
|
||||||
|
import com.aliyuncs.facebody.model.v20191230.ListFaceEntitiesRequest;
|
||||||
|
import com.aliyuncs.facebody.model.v20191230.ListFaceEntitiesResponse;
|
||||||
import com.aliyuncs.facebody.model.v20191230.SearchFaceRequest;
|
import com.aliyuncs.facebody.model.v20191230.SearchFaceRequest;
|
||||||
import com.aliyuncs.facebody.model.v20191230.SearchFaceResponse;
|
import com.aliyuncs.facebody.model.v20191230.SearchFaceResponse;
|
||||||
import com.ycwl.basic.config.FaceDetectConfig;
|
import com.ycwl.basic.config.FaceDetectConfig;
|
||||||
@ -32,6 +36,7 @@ import com.aliyuncs.DefaultAcsClient;
|
|||||||
import com.aliyuncs.IAcsClient;
|
import com.aliyuncs.IAcsClient;
|
||||||
import com.aliyuncs.profile.DefaultProfile;
|
import com.aliyuncs.profile.DefaultProfile;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -62,6 +67,7 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
|||||||
FaceEntity faceEntity = new FaceEntity();
|
FaceEntity faceEntity = new FaceEntity();
|
||||||
faceEntity.setId(faceId);
|
faceEntity.setId(faceId);
|
||||||
faceEntity.setMatchResult(respVo.getSearchResultJson());
|
faceEntity.setMatchResult(respVo.getSearchResultJson());
|
||||||
|
faceEntity.setFirstMatchRate(BigDecimal.valueOf(respVo.getFirstMatchRate()));
|
||||||
faceEntity.setScore(respVo.getScore());
|
faceEntity.setScore(respVo.getScore());
|
||||||
faceEntity.setMatchSampleIds(StringUtils.join(respVo.getSampleListIds(), ","));
|
faceEntity.setMatchSampleIds(StringUtils.join(respVo.getSampleListIds(), ","));
|
||||||
faceMapper.update(faceEntity);
|
faceMapper.update(faceEntity);
|
||||||
@ -83,6 +89,9 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
|||||||
if (matchList.isEmpty()) {
|
if (matchList.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if (matchList.get(0).getFaceItems().isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
SearchFaceRespVo respVo = new SearchFaceRespVo();
|
SearchFaceRespVo respVo = new SearchFaceRespVo();
|
||||||
List<SearchFaceResponse.Data.MatchListItem.FaceItemsItem> faceItems = matchList.get(0).getFaceItems().stream()
|
List<SearchFaceResponse.Data.MatchListItem.FaceItemsItem> faceItems = matchList.get(0).getFaceItems().stream()
|
||||||
.filter(faceItemsItem -> faceItemsItem.getConfidence() > 50).collect(Collectors.toList());
|
.filter(faceItemsItem -> faceItemsItem.getConfidence() > 50).collect(Collectors.toList());
|
||||||
@ -91,6 +100,7 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
|||||||
.map(Long::parseLong)
|
.map(Long::parseLong)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
respVo.setSearchResultJson(JSON.toJSONString(matchList.get(0)));
|
respVo.setSearchResultJson(JSON.toJSONString(matchList.get(0)));
|
||||||
|
respVo.setFirstMatchRate(matchList.get(0).getFaceItems().get(0).getConfidence());
|
||||||
respVo.setSampleListIds(faceSampleIds);
|
respVo.setSampleListIds(faceSampleIds);
|
||||||
respVo.setScore(matchList.get(0).getQualitieScore());
|
respVo.setScore(matchList.get(0).getQualitieScore());
|
||||||
return respVo;
|
return respVo;
|
||||||
@ -164,4 +174,56 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteFaceDB(Long scenicId) {
|
||||||
|
ListFaceEntitiesRequest request = new ListFaceEntitiesRequest();
|
||||||
|
request.setDbName(scenicId.toString());
|
||||||
|
request.setLimit(200);
|
||||||
|
IAcsClient client = getClient();
|
||||||
|
try {
|
||||||
|
while (true) {
|
||||||
|
ListFaceEntitiesResponse response = client.getAcsResponse(request);
|
||||||
|
if (response.getData().getTotalCount() == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
response.getData().getEntities().forEach(entity -> {
|
||||||
|
DeleteFaceEntityRequest deleteFaceEntityRequest = new DeleteFaceEntityRequest();
|
||||||
|
deleteFaceEntityRequest.setDbName(entity.getDbName());
|
||||||
|
deleteFaceEntityRequest.setEntityId(entity.getEntityId());
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
client.getAcsResponse(deleteFaceEntityRequest);
|
||||||
|
} catch (ClientException e) {
|
||||||
|
log.error("删除人脸数据失败!", e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
DeleteFaceDbRequest deleteFaceDbRequest = new DeleteFaceDbRequest();
|
||||||
|
deleteFaceDbRequest.setName(scenicId.toString());
|
||||||
|
try {
|
||||||
|
client.getAcsResponse(deleteFaceDbRequest);
|
||||||
|
} catch (ClientException e) {
|
||||||
|
log.error("删除人脸数据库失败!", e);
|
||||||
|
}
|
||||||
|
} catch (ClientException e) {
|
||||||
|
log.error("删除人脸数据库失败!", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void createFaceDB(Long scenicId) {
|
||||||
|
try {
|
||||||
|
CreateFaceDbRequest request = new CreateFaceDbRequest();
|
||||||
|
request.setName(scenicId.toString());
|
||||||
|
IAcsClient client = getClient();
|
||||||
|
client.getAcsResponse(request);
|
||||||
|
} catch (ClientException e) {
|
||||||
|
log.error("阿里云添加人脸数据库失败!", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,19 +111,19 @@ public class TaskTaskServiceImpl implements TaskService {
|
|||||||
renderWorkerMapper.update(worker);
|
renderWorkerMapper.update(worker);
|
||||||
TaskSyncRespVo resp = new TaskSyncRespVo();
|
TaskSyncRespVo resp = new TaskSyncRespVo();
|
||||||
// Template
|
// Template
|
||||||
String cacheJson = redisTemplate.opsForValue().get(TaskConstant.TASK_TEMPLATE_KEY_PFX + worker.getId());
|
// String cacheJson = redisTemplate.opsForValue().get(TaskConstant.TASK_TEMPLATE_KEY_PFX + worker.getId());
|
||||||
if (cacheJson == null) {
|
// if (cacheJson == null) {
|
||||||
TemplateReqQuery templateReqQuery = new TemplateReqQuery();
|
// TemplateReqQuery templateReqQuery = new TemplateReqQuery();
|
||||||
templateReqQuery.setPid(0L);
|
// templateReqQuery.setPid(0L);
|
||||||
List<TemplateRespVO> templateList = templateMapper.list(templateReqQuery);
|
// List<TemplateRespVO> templateList = templateMapper.list(templateReqQuery);
|
||||||
for (TemplateRespVO template : templateList) {
|
// for (TemplateRespVO template : templateList) {
|
||||||
template.setChildren(templateMapper.getByPid(template.getId()));
|
// template.setChildren(templateMapper.getByPid(template.getId()));
|
||||||
}
|
// }
|
||||||
resp.setTemplates(templateList);
|
// resp.setTemplates(templateList);
|
||||||
redisTemplate.opsForValue().set(TaskConstant.TASK_TEMPLATE_KEY_PFX + worker.getId(), JSON.toJSONString(templateList), 60, TimeUnit.SECONDS);
|
// redisTemplate.opsForValue().set(TaskConstant.TASK_TEMPLATE_KEY_PFX + worker.getId(), JSON.toJSONString(templateList), 60, TimeUnit.SECONDS);
|
||||||
} else {
|
// } else {
|
||||||
resp.setTemplates(JSON.parseArray(cacheJson, TemplateRespVO.class));
|
// resp.setTemplates(JSON.parseArray(cacheJson, TemplateRespVO.class));
|
||||||
}
|
// }
|
||||||
List<TaskRespVO> taskList = taskMapper.selectNotRunning();
|
List<TaskRespVO> taskList = taskMapper.selectNotRunning();
|
||||||
resp.setTasks(taskList);
|
resp.setTasks(taskList);
|
||||||
taskList.forEach(task -> taskMapper.assignToWorker(task.getId(), worker.getId()));
|
taskList.forEach(task -> taskMapper.assignToWorker(task.getId(), worker.getId()));
|
||||||
|
@ -41,8 +41,11 @@ public interface AppScenicService {
|
|||||||
ApiResponse<TopStateResp> topState();
|
ApiResponse<TopStateResp> topState();
|
||||||
|
|
||||||
ApiResponse<List<ContentPageVO>> contentList(Long scenicId);
|
ApiResponse<List<ContentPageVO>> contentList(Long scenicId);
|
||||||
|
ApiResponse<List<ContentPageVO>> faceContentList(Long userId, Long faceId);
|
||||||
|
|
||||||
ApiResponse<ScenicLoginRespVO> login(ScenicLoginReq scenicLoginReq) throws Exception;
|
ApiResponse<ScenicLoginRespVO> login(ScenicLoginReq scenicLoginReq) throws Exception;
|
||||||
|
|
||||||
ApiResponse<List<ContentPageVO>> contentListUseDefaultFace();
|
ApiResponse<List<ContentPageVO>> contentListUseDefaultFace();
|
||||||
|
|
||||||
|
ApiResponse<ScenicRespVO> getMyScenic();
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.ycwl.basic.service.mobile;
|
package com.ycwl.basic.service.mobile;
|
||||||
|
|
||||||
import com.ycwl.basic.model.mobile.goods.*;
|
import com.ycwl.basic.model.mobile.goods.*;
|
||||||
import com.ycwl.basic.model.pc.source.resp.SourceRespVO;
|
|
||||||
import com.ycwl.basic.utils.ApiResponse;
|
import com.ycwl.basic.utils.ApiResponse;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@ -46,8 +45,10 @@ public interface GoodsService {
|
|||||||
* @param userId
|
* @param userId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
ApiResponse<Integer> getAllTaskStatus(Long userId ,Long faceId);
|
ApiResponse<VideoTaskStatusVO> getTaskStatusByFaceId(Long userId ,Long faceId);
|
||||||
ApiResponse<Integer> getAllTaskStatus(Long userId);
|
ApiResponse<VideoTaskStatusVO> getAllTaskStatus(Long userId);
|
||||||
|
|
||||||
ApiResponse<Integer> getTemplateTaskStatus(Long userId, Long templateId);
|
ApiResponse<Integer> getTemplateTaskStatus(Long userId, Long templateId);
|
||||||
|
|
||||||
|
ApiResponse<VideoTaskStatusVO> getTaskStatusByScenicId(Long userId, Long scenicId);
|
||||||
}
|
}
|
||||||
|
@ -12,4 +12,8 @@ public interface TaskFaceService {
|
|||||||
AddFaceRespVo addFaceSample(Long faceSampleId);
|
AddFaceRespVo addFaceSample(Long faceSampleId);
|
||||||
|
|
||||||
void batchDeleteFace(Long scenicId);
|
void batchDeleteFace(Long scenicId);
|
||||||
|
|
||||||
|
void deleteFaceDB(Long scenicId);
|
||||||
|
|
||||||
|
void createFaceDB(Long scenicId);
|
||||||
}
|
}
|
||||||
|
39
src/main/java/com/ycwl/basic/utils/WxMpUtil.java
Normal file
39
src/main/java/com/ycwl/basic/utils/WxMpUtil.java
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
package com.ycwl.basic.utils;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.apache.http.HttpEntity;
|
||||||
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||||
|
import org.apache.http.client.methods.HttpPost;
|
||||||
|
import org.apache.http.entity.StringEntity;
|
||||||
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
|
import org.apache.http.impl.client.HttpClients;
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
|
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
|
||||||
|
public class WxMpUtil {
|
||||||
|
private static final String GET_WXA_CODE_URL = "https://api.weixin.qq.com/wxa/getwxacode?access_token=%s";
|
||||||
|
|
||||||
|
public static void generateWXAQRCode(String accessToken, String path, String filePath) throws Exception {
|
||||||
|
String url = String.format(GET_WXA_CODE_URL, accessToken);
|
||||||
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||||
|
HttpPost httpPost = new HttpPost(url);
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("path", path);
|
||||||
|
json.put("width", 430);
|
||||||
|
StringEntity entity = new StringEntity(json.toJSONString(), "utf-8");
|
||||||
|
httpPost.setEntity(entity);
|
||||||
|
httpPost.setHeader("Content-Type", "application/json");
|
||||||
|
|
||||||
|
try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
|
||||||
|
HttpEntity responseEntity = response.getEntity();
|
||||||
|
if (responseEntity != null) {
|
||||||
|
byte[] bytes = EntityUtils.toByteArray(responseEntity);
|
||||||
|
try (FileOutputStream fos = new FileOutputStream(filePath)) {
|
||||||
|
fos.write(bytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -49,4 +49,9 @@
|
|||||||
from scenic_account
|
from scenic_account
|
||||||
where account = #{account}
|
where account = #{account}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="findAccountById" resultType="com.ycwl.basic.model.pc.scenic.entity.ScenicAccountEntity">
|
||||||
|
select *
|
||||||
|
from scenic_account
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
@ -2,8 +2,8 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.ycwl.basic.mapper.ScenicMapper">
|
<mapper namespace="com.ycwl.basic.mapper.ScenicMapper">
|
||||||
<insert id="add">
|
<insert id="add">
|
||||||
insert into scenic(id, `name`, introduction, phone, cover_url, longitude, latitude, radius, province, city, area, address)
|
insert into scenic(id, `name`, introduction, phone, cover_url, longitude, latitude, radius, province, city, area, address, price, kf_code_url, kf_phone)
|
||||||
values (#{id}, #{name}, #{introduction}, #{phone}, #{coverUrl},#{longitude}, #{latitude}, #{radius}, #{province}, #{city}, #{area}, #{address})
|
values (#{id}, #{name}, #{introduction}, #{phone}, #{coverUrl},#{longitude}, #{latitude}, #{radius}, #{province}, #{city}, #{area}, #{address}, #{price}, #{kfCodeUrl}, #{kfPhone})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="addConfig">
|
<insert id="addConfig">
|
||||||
insert into scenic_config(id, scenic_id, create_time)
|
insert into scenic_config(id, scenic_id, create_time)
|
||||||
@ -46,6 +46,12 @@
|
|||||||
<if test="address!=null and address!=''">
|
<if test="address!=null and address!=''">
|
||||||
address=#{address},
|
address=#{address},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="kfCodeUrl!=null and kfCodeUrl!=''">
|
||||||
|
kf_code_url=#{kfCodeUrl},
|
||||||
|
</if>
|
||||||
|
<if test="kfPhone!=null and kfPhone!=''">
|
||||||
|
kf_phone=#{kfPhone},
|
||||||
|
</if>
|
||||||
</set>
|
</set>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
@ -146,7 +152,7 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<select id="getAppById" resultType="com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO">
|
<select id="getAppById" resultType="com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO">
|
||||||
select s.id, `name`, `phone`, introduction,cover_url, longitude, latitude, radius, province, city, area, address
|
select s.id, `name`, `phone`, introduction,cover_url, longitude, latitude, radius, province, city, area, address, kf_code_url, kf_phone
|
||||||
from scenic s
|
from scenic s
|
||||||
where `status` = 1 and s.id = #{id}
|
where `status` = 1 and s.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
@ -85,6 +85,7 @@ from task
|
|||||||
select id, worker_id, member_id, template_id, scenic_id, task_params, video_url, `status`, result, create_time, update_time
|
select id, worker_id, member_id, template_id, scenic_id, task_params, video_url, `status`, result, create_time, update_time
|
||||||
from task
|
from task
|
||||||
where status = 0 and worker_id is null
|
where status = 0 and worker_id is null
|
||||||
|
limit 1
|
||||||
</select>
|
</select>
|
||||||
<select id="countTask" resultType="java.lang.Integer">
|
<select id="countTask" resultType="java.lang.Integer">
|
||||||
select count(1) from task
|
select count(1) from task
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.ycwl.basic.mapper.TemplateMapper">
|
<mapper namespace="com.ycwl.basic.mapper.TemplateMapper">
|
||||||
<insert id="add">
|
<insert id="add">
|
||||||
insert into template(id, scenic_id, `name`, pid, is_placeholder, source_url, luts, overlays, audios, cover_url, frame_rate, speed, price)
|
insert into template(id, scenic_id, `name`, pid, is_placeholder, source_url, luts, overlays, audios, cover_url, frame_rate, speed, price, slash_price)
|
||||||
values (#{id}, #{scenicId}, #{name}, #{pid}, #{isPlaceholder}, #{sourceUrl}, #{luts}, #{overlays}, #{audios}, #{coverUrl}, #{frameRate}, #{speed}, #{price})
|
values (#{id}, #{scenicId}, #{name}, #{pid}, #{isPlaceholder}, #{sourceUrl}, #{luts}, #{overlays}, #{audios}, #{coverUrl}, #{frameRate}, #{speed}, #{price}, #{slashPrice})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="addConfig">
|
<insert id="addConfig">
|
||||||
insert into template_config(id, template_id, create_time)
|
insert into template_config(id, template_id, create_time)
|
||||||
@ -23,6 +23,7 @@
|
|||||||
<if test="frameRate!= null">frame_rate = #{frameRate}, </if>
|
<if test="frameRate!= null">frame_rate = #{frameRate}, </if>
|
||||||
<if test="coverUrl!= null">cover_url = #{coverUrl}, </if>
|
<if test="coverUrl!= null">cover_url = #{coverUrl}, </if>
|
||||||
<if test="price!= null">price = #{price}, </if>
|
<if test="price!= null">price = #{price}, </if>
|
||||||
|
<if test="slashPrice!= null">slash_price = #{slashPrice}, </if>
|
||||||
<if test="speed!= null">speed = #{speed}, </if>
|
<if test="speed!= null">speed = #{speed}, </if>
|
||||||
</set>
|
</set>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
@ -63,7 +64,7 @@
|
|||||||
delete from template_config where id = #{id}
|
delete from template_config where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
<select id="list" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
|
<select id="list" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
|
||||||
select t.id, t.scenic_id, s.name as scenic_name, t.`name`, t.cover_url, t.status, t.create_time, t.update_time, t.price, t.sort
|
select t.id, t.scenic_id, s.name as scenic_name, t.`name`, t.cover_url, t.status, t.create_time, t.update_time, t.price, t.slash_price, t.sort
|
||||||
from template t left join scenic s on s.id = t.scenic_id
|
from template t left join scenic s on s.id = t.scenic_id
|
||||||
<where>
|
<where>
|
||||||
pid = 0
|
pid = 0
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="getById" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
|
<select id="getById" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
|
||||||
select v.id, v.scenic_id, member_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
|
select v.id, v.scenic_id, member_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
|
||||||
t.name templateName,t.price templatePrice,v.is_buy isBuy, t.cover_url templateCoverUrl,
|
t.name templateName,t.price templatePrice,v.is_buy isBuy, t.cover_url templateCoverUrl, t.slash_price slashPrice,
|
||||||
s.name scenicName
|
s.name scenicName
|
||||||
from video v
|
from video v
|
||||||
left join scenic s on v.scenic_id = s.id
|
left join scenic s on v.scenic_id = s.id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user