2
This commit is contained in:
parent
7bd9a7507f
commit
1b11342e5d
@ -71,7 +71,7 @@ public class AppGoodsController {
|
|||||||
@GetMapping("/getTaskStatus/")
|
@GetMapping("/getTaskStatus/")
|
||||||
public ApiResponse<VideoTaskStatusVO> getAllTaskStatus() {
|
public ApiResponse<VideoTaskStatusVO> getAllTaskStatus() {
|
||||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||||
return goodsService.getAllTaskStatus(worker.getUserId());
|
return ApiResponse.success(goodsService.getAllTaskStatus(worker.getUserId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -84,6 +84,6 @@ public class AppGoodsController {
|
|||||||
@GetMapping("/task/face/{faceId}/template/{templateId}")
|
@GetMapping("/task/face/{faceId}/template/{templateId}")
|
||||||
public ApiResponse<VideoTaskStatusVO> getTemplateTaskStatus(@PathVariable("faceId") Long faceId, @PathVariable("templateId") Long templateId) {
|
public ApiResponse<VideoTaskStatusVO> getTemplateTaskStatus(@PathVariable("faceId") Long faceId, @PathVariable("templateId") Long templateId) {
|
||||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||||
return goodsService.getTaskStatusByTemplateId(worker.getUserId(), faceId, templateId);
|
return ApiResponse.success(goodsService.getTaskStatusByTemplateId(worker.getUserId(), faceId, templateId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,13 +29,15 @@ public class AppTaskController {
|
|||||||
@IgnoreLogReq
|
@IgnoreLogReq
|
||||||
public ApiResponse<VideoTaskStatusVO> getTaskStatusByFaceId(@PathVariable("faceId") Long faceId) {
|
public ApiResponse<VideoTaskStatusVO> getTaskStatusByFaceId(@PathVariable("faceId") Long faceId) {
|
||||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||||
return goodsService.getTaskStatusByFaceId(worker.getUserId(), faceId);
|
return ApiResponse.success(goodsService.getTaskStatusByFaceId(worker.getUserId(), faceId));
|
||||||
}
|
}
|
||||||
@GetMapping("/scenic/{scenicId}")
|
@GetMapping("/scenic/{scenicId}")
|
||||||
@IgnoreLogReq
|
@IgnoreLogReq
|
||||||
public ApiResponse<VideoTaskStatusVO> getAllTaskStatusByScenicId(@PathVariable("scenicId") Long scenicId) {
|
public ApiResponse<VideoTaskStatusVO> getAllTaskStatusByScenicId(@PathVariable("scenicId") Long scenicId) {
|
||||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||||
return goodsService.getTaskStatusByScenicId(worker.getUserId(), scenicId);
|
VideoTaskStatusVO taskStatus = goodsService.getTaskStatusByScenicId(worker.getUserId(), scenicId);
|
||||||
|
taskStatus.setScenicId(scenicId);
|
||||||
|
return ApiResponse.success(taskStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -49,7 +51,7 @@ public class AppTaskController {
|
|||||||
@IgnoreLogReq
|
@IgnoreLogReq
|
||||||
public ApiResponse<VideoTaskStatusVO> getTemplateTaskStatus(@PathVariable("faceId") Long faceId, @PathVariable("templateId") Long templateId) {
|
public ApiResponse<VideoTaskStatusVO> getTemplateTaskStatus(@PathVariable("faceId") Long faceId, @PathVariable("templateId") Long templateId) {
|
||||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||||
return goodsService.getTaskStatusByTemplateId(worker.getUserId(), faceId, templateId);
|
return ApiResponse.success(goodsService.getTaskStatusByTemplateId(worker.getUserId(), faceId, templateId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/submit")
|
@PostMapping("/submit")
|
||||||
|
@ -0,0 +1,38 @@
|
|||||||
|
package com.ycwl.basic.controller.mobile.manage;
|
||||||
|
|
||||||
|
import com.ycwl.basic.constant.BaseContextHandler;
|
||||||
|
import com.ycwl.basic.mapper.ScenicAccountMapper;
|
||||||
|
import com.ycwl.basic.model.pc.order.req.OrderReqQuery;
|
||||||
|
import com.ycwl.basic.model.pc.order.resp.OrderRespVO;
|
||||||
|
import com.ycwl.basic.model.pc.scenic.entity.ScenicAccountEntity;
|
||||||
|
import com.ycwl.basic.service.pc.OrderService;
|
||||||
|
import com.ycwl.basic.utils.ApiResponse;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/mobile/scenic/order/v1")
|
||||||
|
@Api(tags = "景区账号相关接口")
|
||||||
|
public class AppScenicOrderController {
|
||||||
|
@Autowired
|
||||||
|
private OrderService orderService;
|
||||||
|
@Autowired
|
||||||
|
private ScenicAccountMapper scenicAccountMapper;
|
||||||
|
|
||||||
|
@PostMapping("/list")
|
||||||
|
public ApiResponse<List<OrderRespVO>> list(@RequestBody OrderReqQuery query) {
|
||||||
|
String userId = BaseContextHandler.getUserId();
|
||||||
|
ScenicAccountEntity account = scenicAccountMapper.findAccountById(userId);
|
||||||
|
if (account == null) {
|
||||||
|
return ApiResponse.fail("用户未绑定景区");
|
||||||
|
}
|
||||||
|
query.setScenicId(account.getScenicId());
|
||||||
|
return orderService.list(query);
|
||||||
|
}
|
||||||
|
}
|
@ -64,6 +64,7 @@ public class AppStatisticsController {
|
|||||||
|
|
||||||
@ApiOperation("统计数据记录")
|
@ApiOperation("统计数据记录")
|
||||||
@PostMapping("/addStatistics")
|
@PostMapping("/addStatistics")
|
||||||
|
@IgnoreToken
|
||||||
public ApiResponse addStatistics(@RequestBody StatisticsRecordAddReq req) {
|
public ApiResponse addStatistics(@RequestBody StatisticsRecordAddReq req) {
|
||||||
|
|
||||||
return statisticsService.addStatistics(req);
|
return statisticsService.addStatistics(req);
|
||||||
|
@ -82,4 +82,9 @@ public class ScenicController {
|
|||||||
scenicService.saveConfig(id, config);
|
scenicService.saveConfig(id, config);
|
||||||
return ApiResponse.success(null);
|
return ApiResponse.success(null);
|
||||||
}
|
}
|
||||||
|
@PostMapping("/saveConfig/undefined")
|
||||||
|
public ApiResponse saveConfig(@RequestBody ScenicConfigEntity config) {
|
||||||
|
scenicService.addConfig(config);
|
||||||
|
return ApiResponse.success(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,11 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.ycwl.basic.annotation.IgnoreLogReq;
|
import com.ycwl.basic.annotation.IgnoreLogReq;
|
||||||
import com.ycwl.basic.annotation.IgnoreToken;
|
import com.ycwl.basic.annotation.IgnoreToken;
|
||||||
|
import com.ycwl.basic.annotation.RequestToFile;
|
||||||
import com.ycwl.basic.mapper.DeviceMapper;
|
import com.ycwl.basic.mapper.DeviceMapper;
|
||||||
import com.ycwl.basic.mapper.FaceSampleMapper;
|
import com.ycwl.basic.mapper.FaceSampleMapper;
|
||||||
import com.ycwl.basic.mapper.SourceMapper;
|
import com.ycwl.basic.mapper.SourceMapper;
|
||||||
|
import com.ycwl.basic.model.pc.device.entity.DeviceConfigEntity;
|
||||||
import com.ycwl.basic.model.pc.device.entity.DeviceEntity;
|
import com.ycwl.basic.model.pc.device.entity.DeviceEntity;
|
||||||
import com.ycwl.basic.model.pc.faceSample.entity.FaceSampleEntity;
|
import com.ycwl.basic.model.pc.faceSample.entity.FaceSampleEntity;
|
||||||
import com.ycwl.basic.model.pc.source.entity.SourceEntity;
|
import com.ycwl.basic.model.pc.source.entity.SourceEntity;
|
||||||
@ -50,6 +52,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@IgnoreToken
|
@IgnoreToken
|
||||||
@RestController
|
@RestController
|
||||||
@ -190,6 +193,7 @@ public class ViidController {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/Faces", method = RequestMethod.POST)
|
@RequestMapping(value = "/Faces", method = RequestMethod.POST)
|
||||||
@IgnoreLogReq
|
@IgnoreLogReq
|
||||||
|
@RequestToFile
|
||||||
public VIIDBaseResp faces(@RequestBody FaceUploadReq req) {
|
public VIIDBaseResp faces(@RequestBody FaceUploadReq req) {
|
||||||
FaceListObject faceListObject = req.getFaceListObject();
|
FaceListObject faceListObject = req.getFaceListObject();
|
||||||
List<FaceObject> faceObject = faceListObject.getFaceObject();
|
List<FaceObject> faceObject = faceListObject.getFaceObject();
|
||||||
@ -198,7 +202,6 @@ public class ViidController {
|
|||||||
for (FaceObject face : faceObject) {
|
for (FaceObject face : faceObject) {
|
||||||
// 设置FaceId
|
// 设置FaceId
|
||||||
faceId = face.getFaceID();
|
faceId = face.getFaceID();
|
||||||
Long newFaceSampleId = SnowFlakeUtil.getLongId();
|
|
||||||
// 获取图片信息
|
// 获取图片信息
|
||||||
SubImageList subImageList = face.getSubImageList();
|
SubImageList subImageList = face.getSubImageList();
|
||||||
// 判断人脸对象中的列表是否为空
|
// 判断人脸对象中的列表是否为空
|
||||||
@ -207,14 +210,31 @@ public class ViidController {
|
|||||||
if (device == null) {
|
if (device == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Date shotTime = new Date();
|
DeviceConfigEntity deviceConfig = deviceRepository.getDeviceConfig(device.getId());
|
||||||
|
int viidMode = 0;
|
||||||
|
if (deviceConfig != null && deviceConfig.getViidType() != null) {
|
||||||
|
viidMode = deviceConfig.getViidType();
|
||||||
|
}
|
||||||
|
Date shotTime = null;
|
||||||
if (StringUtils.isNotBlank(face.getShotTime())) {
|
if (StringUtils.isNotBlank(face.getShotTime())) {
|
||||||
try {
|
try {
|
||||||
shotTime = sdfTime.parse(face.getShotTime());
|
shotTime = sdfTime.parse(face.getShotTime());
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
throw new RuntimeException(e);
|
log.warn("拍摄时间时间转换失败,使用当前时间。错误entity:{}", face);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (shotTime == null) {
|
||||||
|
if (StringUtils.isNotBlank(face.getFaceAppearTime())) {
|
||||||
|
try {
|
||||||
|
shotTime = sdfTime.parse(face.getFaceAppearTime());
|
||||||
|
} catch (ParseException e) {
|
||||||
|
log.warn("拍摄时间时间转换失败,使用当前时间。错误entity:{}", face);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (shotTime == null) {
|
||||||
|
shotTime = new Date();
|
||||||
|
}
|
||||||
Long scenicId = device.getScenicId();
|
Long scenicId = device.getScenicId();
|
||||||
if (scenicId == null) {
|
if (scenicId == null) {
|
||||||
continue;
|
continue;
|
||||||
@ -225,48 +245,79 @@ public class ViidController {
|
|||||||
facePosition.setRbY(face.getRightBtmY());
|
facePosition.setRbY(face.getRightBtmY());
|
||||||
facePosition.setRbX(face.getRightBtmX());
|
facePosition.setRbX(face.getRightBtmX());
|
||||||
if (ObjectUtil.isNotEmpty(subImageList) && CollUtil.isNotEmpty(subImageList.getSubImageInfoObject())) {
|
if (ObjectUtil.isNotEmpty(subImageList) && CollUtil.isNotEmpty(subImageList.getSubImageInfoObject())) {
|
||||||
// 遍历每个图片对象
|
if (viidMode == 0) {
|
||||||
for (SubImageInfoObject subImage : subImageList.getSubImageInfoObject()) {
|
// 遍历每个图片对象
|
||||||
// base64转换成MultipartFIle
|
// 先找到type14的图片
|
||||||
MultipartFile file = ImageUtils.base64ToMultipartFile(subImage.getData());
|
List<SubImageInfoObject> type14ImageList = subImageList.getSubImageInfoObject().stream().filter(subImage -> "14".equals(subImage.getType())).collect(Collectors.toList());
|
||||||
String ext = subImage.getFileFormat();
|
for (SubImageInfoObject subImage : subImageList.getSubImageInfoObject()) {
|
||||||
if (ext.equalsIgnoreCase("jpeg")) {
|
// base64转换成MultipartFIle
|
||||||
ext = "jpg";
|
MultipartFile file = ImageUtils.base64ToMultipartFile(subImage.getData());
|
||||||
|
String ext = subImage.getFileFormat();
|
||||||
|
if (ext.equalsIgnoreCase("jpeg")) {
|
||||||
|
ext = "jpg";
|
||||||
|
}
|
||||||
|
IStorageAdapter adapter = StorageFactory.use("faces");
|
||||||
|
// Type=11 人脸
|
||||||
|
if (subImage.getType().equals("11")) {
|
||||||
|
// 上传oss
|
||||||
|
FaceSampleEntity faceSample = new FaceSampleEntity();
|
||||||
|
Long newFaceSampleId = SnowFlakeUtil.getLongId();
|
||||||
|
faceSample.setId(newFaceSampleId);
|
||||||
|
faceSample.setScenicId(scenicId);
|
||||||
|
faceSample.setDeviceId(device.getId());
|
||||||
|
faceSample.setStatus(0);
|
||||||
|
faceSample.setCreateAt(shotTime);
|
||||||
|
String url = adapter.uploadFile(file, "user-face", UUID.randomUUID() + "." + ext);
|
||||||
|
faceSample.setFaceUrl(url);
|
||||||
|
faceSampleMapper.add(faceSample);
|
||||||
|
DynamicTaskGenerator.addTask(faceSample.getId());
|
||||||
|
taskFaceService.addFaceSample(faceSample.getId());
|
||||||
|
for (SubImageInfoObject _subImage : type14ImageList) {
|
||||||
|
facePosition.setImgHeight(_subImage.getHeight());
|
||||||
|
facePosition.setImgWidth(_subImage.getWidth());
|
||||||
|
SourceEntity source = new SourceEntity();
|
||||||
|
source.setId(SnowFlakeUtil.getLongId());
|
||||||
|
source.setDeviceId(device.getId());
|
||||||
|
source.setScenicId(device.getScenicId());
|
||||||
|
source.setFaceSampleId(newFaceSampleId);
|
||||||
|
source.setCreateTime(shotTime);
|
||||||
|
source.setType(2);
|
||||||
|
// 上传oss
|
||||||
|
MultipartFile _file = ImageUtils.base64ToMultipartFile(_subImage.getData());
|
||||||
|
String _sourceUrl = adapter.uploadFile(_file, "user-photo", UUID.randomUUID() + "." + ext);
|
||||||
|
source.setUrl(_sourceUrl);
|
||||||
|
source.setPosJson(JSON.toJSONString(facePosition));
|
||||||
|
sourceMapper.add(source);
|
||||||
|
}
|
||||||
|
log.info("人脸信息及原图{}张入库成功!设备ID:{}", type14ImageList.size(), deviceID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
IStorageAdapter adapter = StorageFactory.use("faces");
|
} else if (viidMode == 1) {
|
||||||
// Type=11 人脸
|
for (SubImageInfoObject subImage : subImageList.getSubImageInfoObject()) {
|
||||||
if (subImage.getType().equals("11")) {
|
// base64转换成MultipartFIle
|
||||||
// 上传oss
|
MultipartFile file = ImageUtils.base64ToMultipartFile(subImage.getData());
|
||||||
FaceSampleEntity faceSample = new FaceSampleEntity();
|
String ext = subImage.getFileFormat();
|
||||||
faceSample.setId(newFaceSampleId);
|
if (ext.equalsIgnoreCase("jpeg")) {
|
||||||
faceSample.setScenicId(scenicId);
|
ext = "jpg";
|
||||||
faceSample.setDeviceId(device.getId());
|
}
|
||||||
faceSample.setStatus(0);
|
IStorageAdapter adapter = StorageFactory.use("faces");
|
||||||
faceSample.setCreateAt(shotTime);
|
// Type=14 人脸,传™的,有这么传的嘛
|
||||||
String url = adapter.uploadFile(file, "user-face", UUID.randomUUID() + "." + ext);
|
if (subImage.getType().equals("14")) {
|
||||||
faceSample.setFaceUrl(url);
|
// 上传oss
|
||||||
faceSampleMapper.add(faceSample);
|
FaceSampleEntity faceSample = new FaceSampleEntity();
|
||||||
log.info("人脸信息入库成功!设备ID:{}", deviceID);
|
Long newFaceSampleId = SnowFlakeUtil.getLongId();
|
||||||
DynamicTaskGenerator.addTask(faceSample.getId());
|
faceSample.setId(newFaceSampleId);
|
||||||
taskFaceService.addFaceSample(faceSample.getId());
|
faceSample.setScenicId(scenicId);
|
||||||
}
|
faceSample.setDeviceId(device.getId());
|
||||||
// Type=14 场景图
|
faceSample.setStatus(0);
|
||||||
else if (subImage.getType().equals("14")) {
|
faceSample.setCreateAt(shotTime);
|
||||||
facePosition.setImgHeight(subImage.getHeight());
|
String url = adapter.uploadFile(file, "user-face", UUID.randomUUID() + "." + ext);
|
||||||
facePosition.setImgWidth(subImage.getWidth());
|
faceSample.setFaceUrl(url);
|
||||||
SourceEntity source = new SourceEntity();
|
faceSampleMapper.add(faceSample);
|
||||||
source.setId(SnowFlakeUtil.getLongId());
|
DynamicTaskGenerator.addTask(faceSample.getId());
|
||||||
source.setDeviceId(device.getId());
|
taskFaceService.addFaceSample(faceSample.getId());
|
||||||
source.setScenicId(device.getScenicId());
|
log.info("模式1人脸信息入库成功!设备ID:{}", deviceID);
|
||||||
source.setFaceSampleId(newFaceSampleId);
|
}
|
||||||
source.setCreateTime(shotTime);
|
|
||||||
source.setType(2);
|
|
||||||
// 上传oss
|
|
||||||
String url = adapter.uploadFile(file, "user-photo", UUID.randomUUID() + "." + ext);
|
|
||||||
source.setUrl(url);
|
|
||||||
source.setPosJson(JSON.toJSONString(facePosition));
|
|
||||||
sourceMapper.add(source);
|
|
||||||
log.info("源照片入库成功!设备ID:{}", deviceID);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ public enum StatisticEnum {
|
|||||||
MESSAGE_PUSH(6,"消息推送"),
|
MESSAGE_PUSH(6,"消息推送"),
|
||||||
DOWNLOAD(8,"下载"),
|
DOWNLOAD(8,"下载"),
|
||||||
CLICK_ON_PAYMENT(9,"点击支付、购买"),
|
CLICK_ON_PAYMENT(9,"点击支付、购买"),
|
||||||
|
OTHER_ENTER(10,"其他渠道进入"),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -33,4 +33,5 @@ public class ContentPageVO {
|
|||||||
@ApiModelProperty("是否购买:0未购买,1已购买")
|
@ApiModelProperty("是否购买:0未购买,1已购买")
|
||||||
private Integer isBuy;
|
private Integer isBuy;
|
||||||
private BigDecimal duration;
|
private BigDecimal duration;
|
||||||
|
private Integer goodsType;
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,8 @@ import lombok.Data;
|
|||||||
public class AppStatisticsFunnelVO {
|
public class AppStatisticsFunnelVO {
|
||||||
|
|
||||||
@ApiModelProperty("镜头检测游客数")
|
@ApiModelProperty("镜头检测游客数")
|
||||||
private Integer cameraShotOfMemberNum;
|
// private Integer cameraShotOfMemberNum;
|
||||||
|
private String cameraShotOfMemberNum;
|
||||||
@ApiModelProperty("镜头检测游客数_扫码访问人数_转化率")
|
@ApiModelProperty("镜头检测游客数_扫码访问人数_转化率")
|
||||||
private String csom_scaom;
|
private String csom_scaom;
|
||||||
@ApiModelProperty("扫码访问人数")
|
@ApiModelProperty("扫码访问人数")
|
||||||
|
@ -15,6 +15,7 @@ public class DeviceConfigEntity {
|
|||||||
* 设备id
|
* 设备id
|
||||||
*/
|
*/
|
||||||
private Long deviceId;
|
private Long deviceId;
|
||||||
|
private Integer viidType;
|
||||||
/**
|
/**
|
||||||
* 启用时间
|
* 启用时间
|
||||||
*/
|
*/
|
||||||
|
@ -31,6 +31,7 @@ public class OrderItemVO {
|
|||||||
@ApiModelProperty("商品ID,goods_type=1关联video.id,=2关联source.id")
|
@ApiModelProperty("商品ID,goods_type=1关联video.id,=2关联source.id")
|
||||||
private Long goodsId;
|
private Long goodsId;
|
||||||
private Long faceId;
|
private Long faceId;
|
||||||
|
private String faceUrl;
|
||||||
@ApiModelProperty("景区名称")
|
@ApiModelProperty("景区名称")
|
||||||
private String scenicName;
|
private String scenicName;
|
||||||
@ApiModelProperty("商品名称 模版名称/原片x个/照片x个")
|
@ApiModelProperty("商品名称 模版名称/原片x个/照片x个")
|
||||||
|
@ -12,11 +12,14 @@ public class SlidingWindowRateLimiter {
|
|||||||
|
|
||||||
public SlidingWindowRateLimiter(int maxRequestsPerSecond) {
|
public SlidingWindowRateLimiter(int maxRequestsPerSecond) {
|
||||||
this.semaphore = new Semaphore(maxRequestsPerSecond);
|
this.semaphore = new Semaphore(maxRequestsPerSecond);
|
||||||
// Schedule a task to release all permits every second
|
scheduler.scheduleAtFixedRate(() -> {
|
||||||
scheduler.scheduleAtFixedRate(() -> semaphore.release(maxRequestsPerSecond - semaphore.availablePermits()), 1, 1, TimeUnit.SECONDS);
|
if (semaphore.availablePermits() < maxRequestsPerSecond) {
|
||||||
|
semaphore.release(1);
|
||||||
|
}
|
||||||
|
}, 0, (1000 / maxRequestsPerSecond), TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void allowRequest() throws InterruptedException {
|
public void aquire() throws InterruptedException {
|
||||||
semaphore.acquire();
|
semaphore.acquire();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,8 +70,12 @@ public class DeviceRepository {
|
|||||||
}
|
}
|
||||||
if (redisTemplate.hasKey(String.format(DEVICE_CACHE_KEY, deviceNo))) {
|
if (redisTemplate.hasKey(String.format(DEVICE_CACHE_KEY, deviceNo))) {
|
||||||
DeviceEntity device = getDeviceByDeviceNo(deviceNo);
|
DeviceEntity device = getDeviceByDeviceNo(deviceNo);
|
||||||
redisTemplate.delete(String.format(DEVICE_CACHE_KEY, device.getNo()));
|
if (device != null) {
|
||||||
clearDeviceCache(device.getId());
|
redisTemplate.delete(String.format(DEVICE_CACHE_KEY, device.getNo()));
|
||||||
|
clearDeviceCache(device.getId());
|
||||||
|
} else {
|
||||||
|
redisTemplate.delete(String.format(DEVICE_CACHE_KEY, deviceNo));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
redisTemplate.delete(String.format(DEVICE_CACHE_KEY, deviceNo));
|
redisTemplate.delete(String.format(DEVICE_CACHE_KEY, deviceNo));
|
||||||
return true;
|
return true;
|
||||||
|
@ -70,6 +70,9 @@ public class ScenicRepository {
|
|||||||
return JSONObject.parseObject(redisTemplate.opsForValue().get(String.format(SCENIC_MP_NOTIFY_CACHE_KEY, scenicId)), ScenicMpNotifyVO.class);
|
return JSONObject.parseObject(redisTemplate.opsForValue().get(String.format(SCENIC_MP_NOTIFY_CACHE_KEY, scenicId)), ScenicMpNotifyVO.class);
|
||||||
}
|
}
|
||||||
MpConfigEntity mpConfig = getScenicMpConfig(scenicId);
|
MpConfigEntity mpConfig = getScenicMpConfig(scenicId);
|
||||||
|
if (mpConfig == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
ScenicMpNotifyVO mpNotifyConfig = new ScenicMpNotifyVO();
|
ScenicMpNotifyVO mpNotifyConfig = new ScenicMpNotifyVO();
|
||||||
mpNotifyConfig.setAppId(mpConfig.getAppId());
|
mpNotifyConfig.setAppId(mpConfig.getAppId());
|
||||||
mpNotifyConfig.setAppSecret(mpConfig.getAppSecret());
|
mpNotifyConfig.setAppSecret(mpConfig.getAppSecret());
|
||||||
|
@ -8,6 +8,7 @@ import org.springframework.data.redis.core.RedisTemplate;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class SourceRepository {
|
public class SourceRepository {
|
||||||
@ -44,10 +45,16 @@ public class SourceRepository {
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case 1:
|
case 1:
|
||||||
List<SourceEntity> videoSourceList = sourceMapper.listVideoByFaceRelation(userId, faceId);
|
List<SourceEntity> videoSourceList = sourceMapper.listVideoByFaceRelation(userId, faceId);
|
||||||
return videoSourceList.stream().anyMatch(item -> Integer.valueOf(1).equals(item.getIsBuy()));
|
if (videoSourceList == null || videoSourceList.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return videoSourceList.stream().filter(Objects::nonNull).anyMatch(item -> Integer.valueOf(1).equals(item.getIsBuy()));
|
||||||
case 2:
|
case 2:
|
||||||
List<SourceEntity> imageSourceList = sourceMapper.listImageByFaceRelation(userId, faceId);
|
List<SourceEntity> imageSourceList = sourceMapper.listImageByFaceRelation(userId, faceId);
|
||||||
return imageSourceList.stream().anyMatch(item -> Integer.valueOf(1).equals(item.getIsBuy()));
|
if (imageSourceList == null || imageSourceList.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return imageSourceList.stream().filter(Objects::nonNull).anyMatch(item -> Integer.valueOf(1).equals(item.getIsBuy()));
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -110,6 +110,7 @@ public class AppScenicServiceImpl implements AppScenicService {
|
|||||||
List<ContentPageVO> contentList = templateMapper.listFor(faceRespVO.getScenicId());
|
List<ContentPageVO> contentList = templateMapper.listFor(faceRespVO.getScenicId());
|
||||||
contentList.forEach(contentPageVO -> {
|
contentList.forEach(contentPageVO -> {
|
||||||
List<MemberVideoEntity> memberVideoEntityList = videoMapper.userFaceTemplateVideo(userId, faceId, contentPageVO.getTemplateId());
|
List<MemberVideoEntity> memberVideoEntityList = videoMapper.userFaceTemplateVideo(userId, faceId, contentPageVO.getTemplateId());
|
||||||
|
contentPageVO.setGoodsType(0);
|
||||||
contentPageVO.setContentType(1);
|
contentPageVO.setContentType(1);
|
||||||
if (!memberVideoEntityList.isEmpty()) {
|
if (!memberVideoEntityList.isEmpty()) {
|
||||||
contentPageVO.setIsBuy(memberVideoEntityList.get(0).getIsBuy());
|
contentPageVO.setIsBuy(memberVideoEntityList.get(0).getIsBuy());
|
||||||
@ -145,6 +146,8 @@ public class AppScenicServiceImpl implements AppScenicService {
|
|||||||
sourceImageContent.setName("照片集");
|
sourceImageContent.setName("照片集");
|
||||||
sourceVideoContent.setScenicId(faceRespVO.getScenicId());
|
sourceVideoContent.setScenicId(faceRespVO.getScenicId());
|
||||||
sourceImageContent.setScenicId(faceRespVO.getScenicId());
|
sourceImageContent.setScenicId(faceRespVO.getScenicId());
|
||||||
|
sourceVideoContent.setGoodsType(1);
|
||||||
|
sourceImageContent.setGoodsType(2);
|
||||||
sourceVideoContent.setContentType(2);
|
sourceVideoContent.setContentType(2);
|
||||||
sourceImageContent.setContentType(2);
|
sourceImageContent.setContentType(2);
|
||||||
sourceVideoContent.setLockType(1);
|
sourceVideoContent.setLockType(1);
|
||||||
|
@ -141,7 +141,8 @@ public class AppStatisticsServiceImpl implements AppStatisticsService {
|
|||||||
//扫码访问人数
|
//扫码访问人数
|
||||||
Integer scanCodeVisitorOfMemberNum=statisticsMapper.countScanCodeOfMember(query);
|
Integer scanCodeVisitorOfMemberNum=statisticsMapper.countScanCodeOfMember(query);
|
||||||
//镜头检测游客数_扫码访问人数_转化率
|
//镜头检测游客数_扫码访问人数_转化率
|
||||||
vo.setCsom_scaom(calculateConversionRate(scanCodeVisitorOfMemberNum,cameraShotOfMemberNum));
|
// vo.setCsom_scaom(calculateConversionRate(scanCodeVisitorOfMemberNum,cameraShotOfMemberNum));
|
||||||
|
vo.setCsom_scaom("-");
|
||||||
//上传头像(人脸)人数
|
//上传头像(人脸)人数
|
||||||
Integer uploadFaceOfMemberNum=statisticsMapper.countUploadFaceOfMember(query);
|
Integer uploadFaceOfMemberNum=statisticsMapper.countUploadFaceOfMember(query);
|
||||||
//扫码访问人数_上传头像人数_转化率
|
//扫码访问人数_上传头像人数_转化率
|
||||||
@ -170,9 +171,8 @@ public class AppStatisticsServiceImpl implements AppStatisticsService {
|
|||||||
//点击购买人数_支付订单人数_转化率
|
//点击购买人数_支付订单人数_转化率
|
||||||
vo.setCpom_pom((calculateConversionRate(payOfMemberNum,clickOnPayOfMemberNum)));
|
vo.setCpom_pom((calculateConversionRate(payOfMemberNum,clickOnPayOfMemberNum)));
|
||||||
//总访问人数
|
//总访问人数
|
||||||
//TODO 2024/12/12 17:56 目前只有扫码访问的方式,所以这里总访问人数先等于扫码访问人数
|
Integer totalVisitorOfMemberNum =statisticsMapper.countTotalVisitorOfMember(query);
|
||||||
// Integer totalVisitorOfMemberNum =statisticsMapper.countTotalVisitorOfMember(query);
|
// Integer totalVisitorOfMemberNum =scanCodeVisitorOfMemberNum;
|
||||||
Integer totalVisitorOfMemberNum =scanCodeVisitorOfMemberNum;
|
|
||||||
//生成视频条数
|
//生成视频条数
|
||||||
Integer completeOfVideoNum =statisticsMapper.countCompleteOfVideo(query);
|
Integer completeOfVideoNum =statisticsMapper.countCompleteOfVideo(query);
|
||||||
//预览视频条数
|
//预览视频条数
|
||||||
@ -186,7 +186,8 @@ public class AppStatisticsServiceImpl implements AppStatisticsService {
|
|||||||
//退款订单金额
|
//退款订单金额
|
||||||
BigDecimal refundOfOrderAmount =statisticsMapper.countRefundAmount(query);
|
BigDecimal refundOfOrderAmount =statisticsMapper.countRefundAmount(query);
|
||||||
|
|
||||||
vo.setCameraShotOfMemberNum(cameraShotOfMemberNum);
|
// vo.setCameraShotOfMemberNum(cameraShotOfMemberNum);
|
||||||
|
vo.setCameraShotOfMemberNum("-");
|
||||||
vo.setScanCodeVisitorOfMemberNum(scanCodeVisitorOfMemberNum);
|
vo.setScanCodeVisitorOfMemberNum(scanCodeVisitorOfMemberNum);
|
||||||
vo.setUploadFaceOfMemberNum(uploadFaceOfMemberNum);
|
vo.setUploadFaceOfMemberNum(uploadFaceOfMemberNum);
|
||||||
vo.setPushOfMemberNum(pushOfMemberNum);
|
vo.setPushOfMemberNum(pushOfMemberNum);
|
||||||
@ -212,9 +213,13 @@ public class AppStatisticsServiceImpl implements AppStatisticsService {
|
|||||||
@Override
|
@Override
|
||||||
public ApiResponse addStatistics(StatisticsRecordAddReq req) {
|
public ApiResponse addStatistics(StatisticsRecordAddReq req) {
|
||||||
// req.setId(SnowFlakeUtil.getLongId());
|
// req.setId(SnowFlakeUtil.getLongId());
|
||||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
try {
|
||||||
Long userId = worker.getUserId();
|
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||||
req.setMemberId(userId);
|
Long userId = worker.getUserId();
|
||||||
|
req.setMemberId(userId);
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
|
||||||
|
}
|
||||||
Integer type = req.getType();
|
Integer type = req.getType();
|
||||||
if(type==null){
|
if(type==null){
|
||||||
return ApiResponse.fail("类型不能为空");
|
return ApiResponse.fail("类型不能为空");
|
||||||
@ -331,6 +336,7 @@ public class AppStatisticsServiceImpl implements AppStatisticsService {
|
|||||||
int scanCode=statisticsMapper.countScanCodeOfMember(query);
|
int scanCode=statisticsMapper.countScanCodeOfMember(query);
|
||||||
//查询付费人数
|
//查询付费人数
|
||||||
int pay=statisticsMapper.countPayOfMember(query);
|
int pay=statisticsMapper.countPayOfMember(query);
|
||||||
|
int payCount=statisticsMapper.countPayOfOrder(query);
|
||||||
|
|
||||||
if(cycle==1){
|
if(cycle==1){
|
||||||
//当前周期的支付订单金额
|
//当前周期的支付订单金额
|
||||||
@ -340,9 +346,9 @@ public class AppStatisticsServiceImpl implements AppStatisticsService {
|
|||||||
vo.setNowPreviewPay("0.00");
|
vo.setNowPreviewPay("0.00");
|
||||||
vo.setNowScanCodePay("0.00");
|
vo.setNowScanCodePay("0.00");
|
||||||
}else {
|
}else {
|
||||||
BigDecimal previewPay = new BigDecimal(preview).divide(new BigDecimal(pay), 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
|
BigDecimal previewPay = new BigDecimal(payCount).divide(new BigDecimal(preview), 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
|
||||||
vo.setNowPreviewPay(df.format(previewPay));
|
vo.setNowPreviewPay(df.format(previewPay));
|
||||||
BigDecimal scanCodePay = new BigDecimal(scanCode).divide(new BigDecimal(pay), 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
|
BigDecimal scanCodePay = new BigDecimal(pay).divide(new BigDecimal(scanCode), 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
|
||||||
vo.setNowScanCodePay(df.format(scanCodePay));
|
vo.setNowScanCodePay(df.format(scanCodePay));
|
||||||
}
|
}
|
||||||
}else if(cycle==2){
|
}else if(cycle==2){
|
||||||
|
@ -8,6 +8,7 @@ import com.ycwl.basic.mapper.*;
|
|||||||
import com.ycwl.basic.model.mobile.goods.*;
|
import com.ycwl.basic.model.mobile.goods.*;
|
||||||
import com.ycwl.basic.model.mobile.order.IsBuyRespVO;
|
import com.ycwl.basic.model.mobile.order.IsBuyRespVO;
|
||||||
import com.ycwl.basic.model.mobile.order.PriceObj;
|
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;
|
import com.ycwl.basic.model.pc.face.resp.FaceRespVO;
|
||||||
import com.ycwl.basic.model.pc.scenic.entity.ScenicConfigEntity;
|
import com.ycwl.basic.model.pc.scenic.entity.ScenicConfigEntity;
|
||||||
import com.ycwl.basic.model.pc.source.req.SourceReqQuery;
|
import com.ycwl.basic.model.pc.source.req.SourceReqQuery;
|
||||||
@ -17,6 +18,7 @@ import com.ycwl.basic.model.pc.template.resp.TemplateRespVO;
|
|||||||
import com.ycwl.basic.model.pc.video.entity.MemberVideoEntity;
|
import com.ycwl.basic.model.pc.video.entity.MemberVideoEntity;
|
||||||
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.repository.FaceRepository;
|
||||||
import com.ycwl.basic.repository.OrderRepository;
|
import com.ycwl.basic.repository.OrderRepository;
|
||||||
import com.ycwl.basic.repository.ScenicRepository;
|
import com.ycwl.basic.repository.ScenicRepository;
|
||||||
import com.ycwl.basic.repository.VideoTaskRepository;
|
import com.ycwl.basic.repository.VideoTaskRepository;
|
||||||
@ -62,6 +64,8 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
private OrderRepository orderRepository;
|
private OrderRepository orderRepository;
|
||||||
@Autowired
|
@Autowired
|
||||||
private OrderBiz orderBiz;
|
private OrderBiz orderBiz;
|
||||||
|
@Autowired
|
||||||
|
private FaceRepository faceRepository;
|
||||||
|
|
||||||
public ApiResponse<List<GoodsPageVO>> goodsList(GoodsReqQuery query) {
|
public ApiResponse<List<GoodsPageVO>> goodsList(GoodsReqQuery query) {
|
||||||
//查询原素材
|
//查询原素材
|
||||||
@ -250,15 +254,20 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
* @return 0没有任务 1 合成中 2 合成成功
|
* @return 0没有任务 1 合成中 2 合成成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ApiResponse<VideoTaskStatusVO> getTaskStatusByFaceId(Long userId, Long faceId) {
|
public VideoTaskStatusVO getTaskStatusByFaceId(Long userId, Long faceId) {
|
||||||
|
FaceEntity face = faceRepository.getFace(faceId);
|
||||||
List<MemberVideoEntity> taskList = videoMapper.listRelationByFace(userId, faceId);
|
List<MemberVideoEntity> taskList = videoMapper.listRelationByFace(userId, faceId);
|
||||||
VideoTaskStatusVO response = new VideoTaskStatusVO();
|
VideoTaskStatusVO response = new VideoTaskStatusVO();
|
||||||
response.setFaceId(faceId);
|
response.setFaceId(faceId);
|
||||||
|
if (face == null) {
|
||||||
|
response.setStatus(0);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
response.setScenicId(face.getScenicId());
|
||||||
if (taskList.isEmpty()) {
|
if (taskList.isEmpty()) {
|
||||||
response.setStatus(0);
|
response.setStatus(0);
|
||||||
return ApiResponse.success(response);
|
return response;
|
||||||
}
|
}
|
||||||
response.setScenicId(taskList.get(0).getScenicId());
|
|
||||||
List<TemplateRespVO> templateList = templateRepository.getTemplateListByScenicId(response.getScenicId());
|
List<TemplateRespVO> templateList = templateRepository.getTemplateListByScenicId(response.getScenicId());
|
||||||
List<Long> templateIds = templateList.stream().map(TemplateRespVO::getId).collect(Collectors.toList());
|
List<Long> templateIds = templateList.stream().map(TemplateRespVO::getId).collect(Collectors.toList());
|
||||||
response.setMaxCount(templateList.size());
|
response.setMaxCount(templateList.size());
|
||||||
@ -277,7 +286,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
response.setTemplateId(notFinishedTasks.get(0).getTemplateId());
|
response.setTemplateId(notFinishedTasks.get(0).getTemplateId());
|
||||||
response.setTaskId(notFinishedTasks.get(0).getTaskId());
|
response.setTaskId(notFinishedTasks.get(0).getTaskId());
|
||||||
response.setStatus(2);
|
response.setStatus(2);
|
||||||
return ApiResponse.success(response);
|
return response;
|
||||||
}
|
}
|
||||||
MemberVideoEntity lastVideo = taskList.get(taskList.size() - 1);
|
MemberVideoEntity lastVideo = taskList.get(taskList.size() - 1);
|
||||||
response.setTaskId(lastVideo.getTaskId());
|
response.setTaskId(lastVideo.getTaskId());
|
||||||
@ -285,24 +294,24 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
response.setVideoId(lastVideo.getVideoId());
|
response.setVideoId(lastVideo.getVideoId());
|
||||||
response.setCount(taskList.size());
|
response.setCount(taskList.size());
|
||||||
response.setStatus(1);
|
response.setStatus(1);
|
||||||
return ApiResponse.success(response);
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApiResponse<VideoTaskStatusVO> getAllTaskStatus(Long userId) {
|
public VideoTaskStatusVO getAllTaskStatus(Long userId) {
|
||||||
FaceRespVO lastFaceByUserId = faceMapper.findLastFaceByUserId(String.valueOf(userId));
|
FaceRespVO lastFaceByUserId = faceMapper.findLastFaceByUserId(String.valueOf(userId));
|
||||||
return getTaskStatusByFaceId(userId, lastFaceByUserId.getId());
|
return getTaskStatusByFaceId(userId, lastFaceByUserId.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApiResponse<VideoTaskStatusVO> getTaskStatusByTemplateId(Long userId, Long faceId, Long templateId) {
|
public VideoTaskStatusVO getTaskStatusByTemplateId(Long userId, Long faceId, Long templateId) {
|
||||||
List<MemberVideoEntity> taskList = videoMapper.listRelationByFaceAndTemplate(userId, faceId, templateId);
|
List<MemberVideoEntity> taskList = videoMapper.listRelationByFaceAndTemplate(userId, faceId, templateId);
|
||||||
VideoTaskStatusVO response = new VideoTaskStatusVO();
|
VideoTaskStatusVO response = new VideoTaskStatusVO();
|
||||||
response.setFaceId(faceId);
|
response.setFaceId(faceId);
|
||||||
response.setTemplateId(templateId);
|
response.setTemplateId(templateId);
|
||||||
if (taskList.isEmpty()) {
|
if (taskList.isEmpty()) {
|
||||||
response.setStatus(0);
|
response.setStatus(0);
|
||||||
return ApiResponse.success(response);
|
return response;
|
||||||
}
|
}
|
||||||
response.setScenicId(taskList.get(0).getScenicId());
|
response.setScenicId(taskList.get(0).getScenicId());
|
||||||
response.setMaxCount(templateRepository.getTemplateListByScenicId(response.getScenicId()).size());
|
response.setMaxCount(templateRepository.getTemplateListByScenicId(response.getScenicId()).size());
|
||||||
@ -319,7 +328,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
response.setTemplateId(notFinishedTasks.get(0).getTemplateId());
|
response.setTemplateId(notFinishedTasks.get(0).getTemplateId());
|
||||||
response.setTaskId(notFinishedTasks.get(0).getTaskId());
|
response.setTaskId(notFinishedTasks.get(0).getTaskId());
|
||||||
response.setStatus(2);
|
response.setStatus(2);
|
||||||
return ApiResponse.success(response);
|
return response;
|
||||||
}
|
}
|
||||||
MemberVideoEntity lastVideo = taskList.get(taskList.size() - 1);
|
MemberVideoEntity lastVideo = taskList.get(taskList.size() - 1);
|
||||||
response.setTaskId(lastVideo.getTaskId());
|
response.setTaskId(lastVideo.getTaskId());
|
||||||
@ -332,18 +341,18 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
response.setStatus(1);
|
response.setStatus(1);
|
||||||
response.setVideoId(lastVideo.getVideoId());
|
response.setVideoId(lastVideo.getVideoId());
|
||||||
}
|
}
|
||||||
return ApiResponse.success(response);
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApiResponse<VideoTaskStatusVO> getTaskStatusByScenicId(Long userId, Long scenicId) {
|
public VideoTaskStatusVO getTaskStatusByScenicId(Long userId, Long scenicId) {
|
||||||
FaceRespVO faceVO = faceMapper.getByMemberId(userId, scenicId);
|
FaceRespVO faceVO = faceMapper.getByMemberId(userId, scenicId);
|
||||||
VideoTaskStatusVO response = new VideoTaskStatusVO();
|
VideoTaskStatusVO response = new VideoTaskStatusVO();
|
||||||
response.setScenicId(scenicId);
|
response.setScenicId(scenicId);
|
||||||
if (faceVO == null) {
|
if (faceVO == null) {
|
||||||
// 从来没露脸
|
// 从来没露脸
|
||||||
response.setStatus(-2);
|
response.setStatus(-2);
|
||||||
return ApiResponse.success(response);
|
return response;
|
||||||
}
|
}
|
||||||
return getTaskStatusByFaceId(userId, faceVO.getId());
|
return getTaskStatusByFaceId(userId, faceVO.getId());
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,7 @@ import com.ycwl.basic.service.HttpService;
|
|||||||
import com.ycwl.basic.service.mobile.WxPayService;
|
import com.ycwl.basic.service.mobile.WxPayService;
|
||||||
import com.ycwl.basic.service.pc.OrderService;
|
import com.ycwl.basic.service.pc.OrderService;
|
||||||
import com.ycwl.basic.utils.ApiResponse;
|
import com.ycwl.basic.utils.ApiResponse;
|
||||||
|
import com.ycwl.basic.utils.DateUtils;
|
||||||
import com.ycwl.basic.utils.SnowFlakeUtil;
|
import com.ycwl.basic.utils.SnowFlakeUtil;
|
||||||
import com.ycwl.basic.utils.WXPayUtil;
|
import com.ycwl.basic.utils.WXPayUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -233,13 +234,18 @@ public class WxPayServiceImpl implements WxPayService {
|
|||||||
|
|
||||||
StatisticsRecordAddReq statisticsRecordAddReq = new StatisticsRecordAddReq();
|
StatisticsRecordAddReq statisticsRecordAddReq = new StatisticsRecordAddReq();
|
||||||
statisticsRecordAddReq.setMemberId(orderData.getMemberId());
|
statisticsRecordAddReq.setMemberId(orderData.getMemberId());
|
||||||
// TODO
|
Calendar calendar = Calendar.getInstance();
|
||||||
//如果订单在商品创建后30分钟内支付,则为现场支付,否则为事后支付
|
calendar.setTime(createTime);
|
||||||
// if(DateUtils.addDateMinute(createTime,30).compareTo(payAt)>0){//
|
calendar.set(Calendar.HOUR_OF_DAY, 21);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
// TODO: 他的购买的内容于内容生成当天晚9点之前算现场订单,否则算推送订单
|
||||||
|
if(calendar.getTime().compareTo(payAt)>0){//
|
||||||
statisticsRecordAddReq.setType(StatisticEnum.ON_SITE_PAYMENT.code);
|
statisticsRecordAddReq.setType(StatisticEnum.ON_SITE_PAYMENT.code);
|
||||||
// }else {
|
}else {
|
||||||
// statisticsRecordAddReq.setType(StatisticEnum.POST_PAYMENT.code);
|
statisticsRecordAddReq.setType(StatisticEnum.POST_PAYMENT.code);
|
||||||
// }
|
}
|
||||||
|
calendar.clear();
|
||||||
statisticsRecordAddReq.setScenicId(orderData.getScenicId());
|
statisticsRecordAddReq.setScenicId(orderData.getScenicId());
|
||||||
statisticsRecordAddReq.setMorphId(orderId);
|
statisticsRecordAddReq.setMorphId(orderId);
|
||||||
statisticsMapper.addStatisticsRecord(statisticsRecordAddReq);
|
statisticsMapper.addStatisticsRecord(statisticsRecordAddReq);
|
||||||
|
@ -147,7 +147,7 @@ public class FaceServiceImpl implements FaceService {
|
|||||||
if (face == null) {
|
if (face == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return face.getScenicId().equals(scenicId);
|
return face.getMemberId().equals(userId);
|
||||||
}).findAny();
|
}).findAny();
|
||||||
if (faceAny.isPresent()) {
|
if (faceAny.isPresent()) {
|
||||||
oldFaceId = faceAny.get();
|
oldFaceId = faceAny.get();
|
||||||
@ -197,6 +197,7 @@ public class FaceServiceImpl implements FaceService {
|
|||||||
}
|
}
|
||||||
SearchFaceRespVo scenicDbSearchResult = faceService.searchFace(face.getScenicId(), face.getFaceUrl());
|
SearchFaceRespVo scenicDbSearchResult = faceService.searchFace(face.getScenicId(), face.getFaceUrl());
|
||||||
FaceEntity faceEntity = new FaceEntity();
|
FaceEntity faceEntity = new FaceEntity();
|
||||||
|
faceEntity.setId(faceId);
|
||||||
faceEntity.setScore(scenicDbSearchResult.getScore());
|
faceEntity.setScore(scenicDbSearchResult.getScore());
|
||||||
faceEntity.setMatchResult(scenicDbSearchResult.getSearchResultJson());
|
faceEntity.setMatchResult(scenicDbSearchResult.getSearchResultJson());
|
||||||
if (scenicDbSearchResult.getFirstMatchRate() != null) {
|
if (scenicDbSearchResult.getFirstMatchRate() != null) {
|
||||||
@ -210,6 +211,8 @@ public class FaceServiceImpl implements FaceService {
|
|||||||
faceEntity.setMemberId(face.getMemberId());
|
faceEntity.setMemberId(face.getMemberId());
|
||||||
faceEntity.setFaceUrl(face.getFaceUrl());
|
faceEntity.setFaceUrl(face.getFaceUrl());
|
||||||
List<Long> sampleListIds = scenicDbSearchResult.getSampleListIds();
|
List<Long> sampleListIds = scenicDbSearchResult.getSampleListIds();
|
||||||
|
faceMapper.update(faceEntity);
|
||||||
|
faceRepository.clearFaceCache(faceEntity.getId());
|
||||||
if (sampleListIds != null && !sampleListIds.isEmpty()) {// 匹配原片:照片
|
if (sampleListIds != null && !sampleListIds.isEmpty()) {// 匹配原片:照片
|
||||||
List<SourceEntity> sourceEntities = sourceMapper.listBySampleIds(sampleListIds);
|
List<SourceEntity> sourceEntities = sourceMapper.listBySampleIds(sampleListIds);
|
||||||
List<MemberSourceEntity> memberSourceEntityList = sourceEntities.stream().map(sourceEntity -> {
|
List<MemberSourceEntity> memberSourceEntityList = sourceEntities.stream().map(sourceEntity -> {
|
||||||
@ -231,16 +234,14 @@ public class FaceServiceImpl implements FaceService {
|
|||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
if (!memberSourceEntityList.isEmpty()) {
|
if (!memberSourceEntityList.isEmpty()) {
|
||||||
sourceMapper.addRelations(memberSourceEntityList);
|
sourceMapper.addRelations(memberSourceEntityList);
|
||||||
taskTaskService.autoCreateTaskByFaceId(faceEntity.getId());
|
taskTaskService.autoCreateTaskByFaceId(face.getId());
|
||||||
VideoPieceGetter.Task task = new VideoPieceGetter.Task();
|
VideoPieceGetter.Task task = new VideoPieceGetter.Task();
|
||||||
task.faceId = faceEntity.getId();
|
task.faceId = face.getId();
|
||||||
task.faceSampleIds = sampleListIds;
|
task.faceSampleIds = sampleListIds;
|
||||||
task.memberId = face.getMemberId();
|
task.memberId = face.getMemberId();
|
||||||
VideoPieceGetter.addTask(task);
|
VideoPieceGetter.addTask(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
faceMapper.update(faceEntity);
|
|
||||||
faceRepository.clearFaceCache(faceEntity.getId());
|
|
||||||
return scenicDbSearchResult;
|
return scenicDbSearchResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,6 +148,9 @@ public class ScenicServiceImpl implements ScenicService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApiResponse<Boolean> addConfig(ScenicConfigEntity scenicConfig) {
|
public ApiResponse<Boolean> addConfig(ScenicConfigEntity scenicConfig) {
|
||||||
|
if (scenicConfig.getId() == null) {
|
||||||
|
scenicConfig.setId(SnowFlakeUtil.getLongId());
|
||||||
|
}
|
||||||
int i = scenicMapper.addConfig(scenicConfig);
|
int i = scenicMapper.addConfig(scenicConfig);
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
scenicRepository.clearCache(scenicConfig.getScenicId());
|
scenicRepository.clearCache(scenicConfig.getScenicId());
|
||||||
|
@ -39,10 +39,10 @@ public interface GoodsService {
|
|||||||
* @param userId
|
* @param userId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
ApiResponse<VideoTaskStatusVO> getAllTaskStatus(Long userId);
|
VideoTaskStatusVO getAllTaskStatus(Long userId);
|
||||||
ApiResponse<VideoTaskStatusVO> getTaskStatusByFaceId(Long userId ,Long faceId);
|
VideoTaskStatusVO getTaskStatusByFaceId(Long userId ,Long faceId);
|
||||||
ApiResponse<VideoTaskStatusVO> getTaskStatusByTemplateId(Long userId, Long faceId, Long templateId);
|
VideoTaskStatusVO getTaskStatusByTemplateId(Long userId, Long faceId, Long templateId);
|
||||||
ApiResponse<VideoTaskStatusVO> getTaskStatusByScenicId(Long userId, Long scenicId);
|
VideoTaskStatusVO getTaskStatusByScenicId(Long userId, Long scenicId);
|
||||||
|
|
||||||
ApiResponse<GoodsDetailVO> sourceGoodsInfo(Long userId, Long sourceId);
|
ApiResponse<GoodsDetailVO> sourceGoodsInfo(Long userId, Long sourceId);
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
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.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.aliyuncs.DefaultAcsClient;
|
import com.aliyuncs.DefaultAcsClient;
|
||||||
import com.aliyuncs.IAcsClient;
|
import com.aliyuncs.IAcsClient;
|
||||||
@ -87,7 +86,12 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
|||||||
private SourceMapper sourceMapper;
|
private SourceMapper sourceMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private OrderBiz orderBiz;
|
private OrderBiz orderBiz;
|
||||||
private SlidingWindowRateLimiter limiter = new SlidingWindowRateLimiter(5); // 阿里云人脸检索限制qps=5
|
// 阿里云人脸检索限制qps=2
|
||||||
|
private final SlidingWindowRateLimiter addEntityLimiter = new SlidingWindowRateLimiter(1);
|
||||||
|
// 阿里云人脸检索限制qps=5
|
||||||
|
private final SlidingWindowRateLimiter searchFaceLimiter = new SlidingWindowRateLimiter(4);
|
||||||
|
private final SlidingWindowRateLimiter deleteDbLimiter = new SlidingWindowRateLimiter(1);
|
||||||
|
private final SlidingWindowRateLimiter deleteEntityLimiter = new SlidingWindowRateLimiter(1);
|
||||||
|
|
||||||
private IAcsClient getClient() {
|
private IAcsClient getClient() {
|
||||||
DefaultProfile profile = DefaultProfile.getProfile(
|
DefaultProfile profile = DefaultProfile.getProfile(
|
||||||
@ -163,6 +167,10 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
|||||||
request.setLimit(100);
|
request.setLimit(100);
|
||||||
// request.setQualityScoreThreshold(60f);
|
// request.setQualityScoreThreshold(60f);
|
||||||
FaceDetectLog log = FaceDetectLog.quickCreate("预留字段", request);
|
FaceDetectLog log = FaceDetectLog.quickCreate("预留字段", request);
|
||||||
|
try {
|
||||||
|
searchFaceLimiter.aquire();
|
||||||
|
} catch (InterruptedException ignored) {
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
SearchFaceResponse response = client.getAcsResponse(request);
|
SearchFaceResponse response = client.getAcsResponse(request);
|
||||||
log.fillResponse(response);
|
log.fillResponse(response);
|
||||||
@ -197,7 +205,7 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
log.matchLocalRecord(records);
|
log.matchLocalRecord(records);
|
||||||
List<Long> faceSampleIds = records.stream()
|
List<Long> faceSampleIds = records.stream()
|
||||||
.filter(record -> record.getScore() > 0.6)
|
.filter(record -> record.getScore() > 0.525F)
|
||||||
.map(MatchLocalRecord::getFaceSampleId)
|
.map(MatchLocalRecord::getFaceSampleId)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
respVo.setFirstMatchRate(matchList.get(0).getFaceItems().get(0).getScore());
|
respVo.setFirstMatchRate(matchList.get(0).getFaceItems().get(0).getScore());
|
||||||
@ -235,9 +243,8 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
|||||||
request.setEntityId(entityId);
|
request.setEntityId(entityId);
|
||||||
IAcsClient client = getClient();
|
IAcsClient client = getClient();
|
||||||
try {
|
try {
|
||||||
limiter.allowRequest();
|
addEntityLimiter.aquire();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException ignored) {
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
client.getAcsResponse(request);
|
client.getAcsResponse(request);
|
||||||
@ -256,7 +263,7 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
|||||||
respVo.setScore(acsResponse.getData().getQualitieScore());
|
respVo.setScore(acsResponse.getData().getQualitieScore());
|
||||||
return respVo;
|
return respVo;
|
||||||
} catch (ClientException e) {
|
} catch (ClientException e) {
|
||||||
log.error("addFaceEntity", e);
|
log.error("addFace", e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -283,6 +290,10 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
|||||||
DeleteFaceEntityRequest request = new DeleteFaceEntityRequest();
|
DeleteFaceEntityRequest request = new DeleteFaceEntityRequest();
|
||||||
request.setDbName(scenicId.toString());
|
request.setDbName(scenicId.toString());
|
||||||
request.setEntityId(entityId);
|
request.setEntityId(entityId);
|
||||||
|
try {
|
||||||
|
deleteEntityLimiter.aquire();
|
||||||
|
} catch (InterruptedException ignored) {
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
client.getAcsResponse(request);
|
client.getAcsResponse(request);
|
||||||
} catch (ClientException e) {
|
} catch (ClientException e) {
|
||||||
@ -310,9 +321,8 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
|||||||
deleteFaceEntityRequest.setDbName(entity.getDbName());
|
deleteFaceEntityRequest.setDbName(entity.getDbName());
|
||||||
deleteFaceEntityRequest.setEntityId(entity.getEntityId());
|
deleteFaceEntityRequest.setEntityId(entity.getEntityId());
|
||||||
try {
|
try {
|
||||||
Thread.sleep(1000);
|
deleteEntityLimiter.aquire();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException ignored) {
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
client.getAcsResponse(deleteFaceEntityRequest);
|
client.getAcsResponse(deleteFaceEntityRequest);
|
||||||
@ -323,6 +333,10 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
|||||||
}
|
}
|
||||||
DeleteFaceDbRequest deleteFaceDbRequest = new DeleteFaceDbRequest();
|
DeleteFaceDbRequest deleteFaceDbRequest = new DeleteFaceDbRequest();
|
||||||
deleteFaceDbRequest.setName(dbName);
|
deleteFaceDbRequest.setName(dbName);
|
||||||
|
try {
|
||||||
|
deleteDbLimiter.aquire();
|
||||||
|
} catch (InterruptedException ignored) {
|
||||||
|
}
|
||||||
client.getAcsResponse(deleteFaceDbRequest);
|
client.getAcsResponse(deleteFaceDbRequest);
|
||||||
removeFaceDBCache(dbName);
|
removeFaceDBCache(dbName);
|
||||||
} catch (ClientException e) {
|
} catch (ClientException e) {
|
||||||
|
@ -545,7 +545,7 @@ public class TaskTaskServiceImpl implements TaskService {
|
|||||||
}
|
}
|
||||||
ScenicEntity scenic = scenicRepository.getScenic(item.getScenicId());
|
ScenicEntity scenic = scenicRepository.getScenic(item.getScenicId());
|
||||||
String title = "您在【" + scenic.getName() + "】的专属影像";
|
String title = "您在【" + scenic.getName() + "】的专属影像";
|
||||||
String page = "pages/videoSynthesis/buy?scenicId=" + item.getScenicId() + "&faceId=" + item.getFaceId() + "&id=" + item.getVideoId();
|
String page = "pages/videoSynthesis/index?scenicId=" + item.getScenicId() + "&faceId=" + item.getFaceId();
|
||||||
/**
|
/**
|
||||||
* 视频名称 {{thing1.DATA}}
|
* 视频名称 {{thing1.DATA}}
|
||||||
* 生成时间 {{time4.DATA}}
|
* 生成时间 {{time4.DATA}}
|
||||||
|
@ -57,7 +57,7 @@ public class DownloadNotificationTasker {
|
|||||||
log.info("发送模板消息");
|
log.info("发送模板消息");
|
||||||
ScenicEntity scenic = scenicRepository.getScenic(item.getScenicId());
|
ScenicEntity scenic = scenicRepository.getScenic(item.getScenicId());
|
||||||
String title = "您在【" + scenic.getName() + "】的专属影像";
|
String title = "您在【" + scenic.getName() + "】的专属影像";
|
||||||
String page = "pages/videoSynthesis/buy?scenicId=" + item.getScenicId() + "&faceId=" + item.getFaceId() + "&id=" + item.getVideoId();
|
String page = "pages/videoSynthesis/index?scenicId=" + item.getScenicId() + "&faceId=" + item.getFaceId();
|
||||||
/**
|
/**
|
||||||
* 景区 {{thing1.DATA}}
|
* 景区 {{thing1.DATA}}
|
||||||
* 备注 {{thing3.DATA}}
|
* 备注 {{thing3.DATA}}
|
||||||
@ -91,6 +91,9 @@ public class DownloadNotificationTasker {
|
|||||||
MpConfigEntity scenicMp = scenicRepository.getScenicMpConfig(member.getScenicId());
|
MpConfigEntity scenicMp = scenicRepository.getScenicMpConfig(member.getScenicId());
|
||||||
ScenicConfigEntity scenicConfig = scenicRepository.getScenicConfig(item.getScenicId());
|
ScenicConfigEntity scenicConfig = scenicRepository.getScenicConfig(item.getScenicId());
|
||||||
Integer videoStoreDay = scenicConfig.getVideoStoreDay();
|
Integer videoStoreDay = scenicConfig.getVideoStoreDay();
|
||||||
|
if (videoStoreDay == null) {
|
||||||
|
videoStoreDay = 3;
|
||||||
|
}
|
||||||
// 发送模板消息
|
// 发送模板消息
|
||||||
String templateId = scenicRepository.getVideoPreExpireTemplateId(item.getScenicId());
|
String templateId = scenicRepository.getVideoPreExpireTemplateId(item.getScenicId());
|
||||||
if (StringUtils.isBlank(templateId)) {
|
if (StringUtils.isBlank(templateId)) {
|
||||||
@ -100,7 +103,7 @@ public class DownloadNotificationTasker {
|
|||||||
log.info("发送模板消息");
|
log.info("发送模板消息");
|
||||||
ScenicEntity scenic = scenicRepository.getScenic(item.getScenicId());
|
ScenicEntity scenic = scenicRepository.getScenic(item.getScenicId());
|
||||||
String title = "您在【" + scenic.getName() + "】的专属影像";
|
String title = "您在【" + scenic.getName() + "】的专属影像";
|
||||||
String page = "pages/videoSynthesis/buy?scenicId=" + item.getScenicId() + "&faceId=" + item.getFaceId() + "&id=" + item.getVideoId();
|
String page = "pages/videoSynthesis/index?scenicId=" + item.getScenicId() + "&faceId=" + item.getFaceId();
|
||||||
/**
|
/**
|
||||||
* 影像名称 {{thing1.DATA}}
|
* 影像名称 {{thing1.DATA}}
|
||||||
* 过期时间 {{time2.DATA}}
|
* 过期时间 {{time2.DATA}}
|
||||||
|
@ -85,12 +85,12 @@ public class DynamicTaskGenerator {
|
|||||||
|
|
||||||
public static void addTask(Long faceSampleId) {
|
public static void addTask(Long faceSampleId) {
|
||||||
Date createTime = new Date();
|
Date createTime = new Date();
|
||||||
// 两分钟后
|
// 半分钟后
|
||||||
createTime.setTime(createTime.getTime() + 30000L);
|
createTime.setTime(createTime.getTime() + 30000L);
|
||||||
queue.add(new Task(faceSampleId, createTime));
|
queue.add(new Task(faceSampleId, createTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Scheduled(fixedRate = 10000L)
|
@Scheduled(fixedDelay = 500L)
|
||||||
public void doTask() {
|
public void doTask() {
|
||||||
Task task = queue.poll();
|
Task task = queue.poll();
|
||||||
if (task == null) {
|
if (task == null) {
|
||||||
|
@ -41,7 +41,7 @@ public class WxMpUtil {
|
|||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("env_version", "trial");
|
json.put("env_version", "trial");
|
||||||
json.put("path", path);
|
json.put("path", path);
|
||||||
json.put("width", 430);
|
json.put("width", 1000);
|
||||||
StringEntity entity = new StringEntity(json.toJSONString(), "utf-8");
|
StringEntity entity = new StringEntity(json.toJSONString(), "utf-8");
|
||||||
httpPost.setEntity(entity);
|
httpPost.setEntity(entity);
|
||||||
httpPost.setHeader("Content-Type", "application/json");
|
httpPost.setHeader("Content-Type", "application/json");
|
||||||
@ -58,6 +58,6 @@ public class WxMpUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
generateWXAQRCode("wxe7ff26af70bfc37c", "5252fbbc68513bc77b7cc0052b9f9695", "pages/home/index?scenicId=3942994647776890880", "a.jpg");
|
generateWXAQRCode("wxe7ff26af70bfc37c", "5252fbbc68513bc77b7cc0052b9f9695", "pages/home/index?scenicId=3946669713328836608", "cxzh_t.jpg");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,8 @@
|
|||||||
</update>
|
</update>
|
||||||
<update id="updateConfig">
|
<update id="updateConfig">
|
||||||
update device_config
|
update device_config
|
||||||
set store_type = #{storeType},
|
set viid_type = #{viidType},
|
||||||
|
store_type = #{storeType},
|
||||||
store_config_json = #{storeConfigJson},
|
store_config_json = #{storeConfigJson},
|
||||||
store_expire_day = #{storeExpireDay},
|
store_expire_day = #{storeExpireDay},
|
||||||
online_check = #{onlineCheck},
|
online_check = #{onlineCheck},
|
||||||
|
@ -63,14 +63,16 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
<select id="getOrderItemList" parameterType="java.lang.Long" resultType="com.ycwl.basic.model.pc.order.resp.OrderItemVO">
|
<select id="getOrderItemList" parameterType="java.lang.Long" resultType="com.ycwl.basic.model.pc.order.resp.OrderItemVO">
|
||||||
WITH member_video_data AS (
|
WITH member_video_data AS (
|
||||||
SELECT mv.member_id, mv.video_id, t.cover_url, t.name, mv.face_id, v.video_url
|
SELECT mv.member_id, mv.video_id, t.cover_url, t.name, mv.face_id, f.face_url, v.video_url
|
||||||
FROM member_video mv
|
FROM member_video mv
|
||||||
|
LEFT JOIN face f ON mv.face_id = f.id
|
||||||
LEFT JOIN template t ON mv.template_id = t.id
|
LEFT JOIN template t ON mv.template_id = t.id
|
||||||
LEFT JOIN video v ON mv.video_id = v.id
|
LEFT JOIN video v ON mv.video_id = v.id
|
||||||
),
|
),
|
||||||
member_source_data AS (
|
member_source_data AS (
|
||||||
SELECT ms.member_id, ms.source_id, ms.face_id, s.video_url, s.url
|
SELECT ms.member_id, ms.source_id, ms.face_id, f.face_url, s.video_url, s.url
|
||||||
FROM member_source ms
|
FROM member_source ms
|
||||||
|
LEFT JOIN face f ON ms.face_id = f.id
|
||||||
LEFT JOIN source s ON ms.source_id = s.id
|
LEFT JOIN source s ON ms.source_id = s.id
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
@ -94,6 +96,11 @@
|
|||||||
WHEN '1' THEN oi.goods_id
|
WHEN '1' THEN oi.goods_id
|
||||||
WHEN '2' THEN oi.goods_id
|
WHEN '2' THEN oi.goods_id
|
||||||
END AS face_id,
|
END AS face_id,
|
||||||
|
CASE oi.goods_type
|
||||||
|
WHEN '0' THEN mvd.face_url
|
||||||
|
WHEN '1' THEN msd.face_url
|
||||||
|
WHEN '2' THEN msd.face_url
|
||||||
|
END AS face_url,
|
||||||
CASE oi.goods_type
|
CASE oi.goods_type
|
||||||
WHEN '0' THEN mvd.video_url
|
WHEN '0' THEN mvd.video_url
|
||||||
WHEN '1' THEN msd.video_url
|
WHEN '1' THEN msd.video_url
|
||||||
|
@ -55,6 +55,9 @@
|
|||||||
<if test="logoUrl!=null">
|
<if test="logoUrl!=null">
|
||||||
logo_url=#{logoUrl},
|
logo_url=#{logoUrl},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="price!=null">
|
||||||
|
price=#{price},
|
||||||
|
</if>
|
||||||
</set>
|
</set>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
select ifnull(sum(pay_price),0) as payPrice
|
select ifnull(sum(pay_price),0) as payPrice
|
||||||
from `order`
|
from `order`
|
||||||
where
|
where
|
||||||
status = 1 and scenic_id = #{scenicId}
|
(status = 1 or status = 2) and scenic_id = #{scenicId}
|
||||||
<if test="startTime!= null">
|
<if test="startTime!= null">
|
||||||
and create_at >= #{startTime}
|
and create_at >= #{startTime}
|
||||||
</if>
|
</if>
|
||||||
@ -36,7 +36,7 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="countScanCodeOfMember" resultType="java.lang.Integer">
|
<select id="countScanCodeOfMember" resultType="java.lang.Integer">
|
||||||
SELECT
|
SELECT
|
||||||
IFNULL(SUM(count), 0) AS count
|
IFNULL(count(count), 0) AS count
|
||||||
FROM (
|
FROM (
|
||||||
select count(1) as count
|
select count(1) as count
|
||||||
from statistics
|
from statistics
|
||||||
@ -52,7 +52,7 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="countClickPayOfMember" resultType="java.lang.Integer">
|
<select id="countClickPayOfMember" resultType="java.lang.Integer">
|
||||||
SELECT
|
SELECT
|
||||||
IFNULL(SUM(count), 0) AS count
|
IFNULL(count(count), 0) AS count
|
||||||
FROM (
|
FROM (
|
||||||
select count(1) as count
|
select count(1) as count
|
||||||
from statistics
|
from statistics
|
||||||
@ -68,7 +68,7 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="countPayOfMember" resultType="java.lang.Integer">
|
<select id="countPayOfMember" resultType="java.lang.Integer">
|
||||||
SELECT
|
SELECT
|
||||||
IFNULL(SUM(count), 0) AS count
|
IFNULL(count(count), 0) AS count
|
||||||
FROM (
|
FROM (
|
||||||
select count(1) as count
|
select count(1) as count
|
||||||
from statistics
|
from statistics
|
||||||
@ -116,7 +116,7 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="countPushOfMember" resultType="java.lang.Integer">
|
<select id="countPushOfMember" resultType="java.lang.Integer">
|
||||||
SELECT
|
SELECT
|
||||||
IFNULL(SUM(count), 0) AS count
|
IFNULL(count(count), 0) AS count
|
||||||
FROM (
|
FROM (
|
||||||
select count(1) as count
|
select count(1) as count
|
||||||
from statistics
|
from statistics
|
||||||
@ -142,15 +142,17 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<select id="countUploadFaceOfMember" resultType="java.lang.Integer">
|
<select id="countUploadFaceOfMember" resultType="java.lang.Integer">
|
||||||
select count(1) as count
|
select ifnull(count(1),0) as count
|
||||||
from face
|
from(
|
||||||
where scenic_id = #{scenicId}
|
select count(1) as count
|
||||||
<if test="startTime!= null">
|
from face
|
||||||
and create_at >= #{startTime}
|
where scenic_id = #{scenicId}
|
||||||
</if>
|
<if test="startTime!= null">and create_at >= #{startTime}
|
||||||
<if test="endTime!= null">
|
</if><if test="
|
||||||
and create_at <= #{endTime}
|
endTime!= null">and create_at <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
group by member_id
|
||||||
|
) a
|
||||||
</select>
|
</select>
|
||||||
<select id="countCompleteVideoOfMember" resultType="java.lang.Integer">
|
<select id="countCompleteVideoOfMember" resultType="java.lang.Integer">
|
||||||
select ifnull(count(1),0) as count
|
select ifnull(count(1),0) as count
|
||||||
@ -170,11 +172,11 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="countTotalVisitorOfMember" resultType="java.lang.Integer">
|
<select id="countTotalVisitorOfMember" resultType="java.lang.Integer">
|
||||||
SELECT
|
SELECT
|
||||||
IFNULL(SUM(count), 0) AS count
|
IFNULL(count(count), 0) AS count
|
||||||
FROM (
|
FROM (
|
||||||
select count(1) as count
|
select count(1) as count
|
||||||
from statistics
|
from statistics
|
||||||
where type=0 and scenic_id = #{scenicId}
|
where type in (0,10) and scenic_id = #{scenicId}
|
||||||
<if test="startTime!= null">
|
<if test="startTime!= null">
|
||||||
and create_time >= #{startTime}
|
and create_time >= #{startTime}
|
||||||
</if>
|
</if>
|
||||||
@ -186,7 +188,7 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="countCompleteOfVideo" resultType="java.lang.Integer">
|
<select id="countCompleteOfVideo" resultType="java.lang.Integer">
|
||||||
select count(1) as count
|
select count(1) as count
|
||||||
from video
|
from task
|
||||||
where scenic_id = #{scenicId}
|
where scenic_id = #{scenicId}
|
||||||
<if test="startTime!= null">
|
<if test="startTime!= null">
|
||||||
and create_time >= #{startTime}
|
and create_time >= #{startTime}
|
||||||
|
@ -68,7 +68,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.slash_price, t.sort
|
select t.*, s.name as scenic_name
|
||||||
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
|
||||||
@ -84,12 +84,12 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="getById" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
|
<select id="getById" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
|
||||||
select t.id, t.scenic_id, s.name as scenic_name, t.`name`, pid, is_placeholder, source_url, luts, overlays, audios, frame_rate, speed, t.cover_url, t.status, t.create_time, t.update_time, t.price, t.sort
|
select t.*, s.name as scenic_name
|
||||||
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 t.id = #{id}
|
where t.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
<select id="getByPid" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
|
<select id="getByPid" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
|
||||||
select t.id, t.scenic_id, s.name as scenic_name, t.`name`, pid, is_placeholder, source_url, luts, overlays, audios, frame_rate, speed, t.cover_url, t.status, t.create_time, t.update_time
|
select t.*, s.name as scenic_name
|
||||||
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 pid = #{id}
|
where pid = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user