bug修复等
This commit is contained in:
parent
cfc870edb6
commit
a329100212
@ -41,8 +41,7 @@ public class AppGoodsController {
|
|||||||
@ApiOperation("源素材(原片/照片)商品列表")
|
@ApiOperation("源素材(原片/照片)商品列表")
|
||||||
@PostMapping("/sourceGoodsList")
|
@PostMapping("/sourceGoodsList")
|
||||||
public ApiResponse<List<GoodsDetailVO>> sourceGoodsList(@RequestBody GoodsReqQuery query) {
|
public ApiResponse<List<GoodsDetailVO>> sourceGoodsList(@RequestBody GoodsReqQuery query) {
|
||||||
query.setMemberId(Long.valueOf(BaseContextHandler.getUserId()));
|
return goodsService.sourceGoodsList(Long.valueOf(BaseContextHandler.getUserId()), query);
|
||||||
return goodsService.sourceGoodsList(query);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("成片vlog商品详情")
|
@ApiOperation("成片vlog商品详情")
|
||||||
|
@ -14,8 +14,6 @@ public class GoodsReqQuery {
|
|||||||
@ApiModelProperty("是否已购买 0否 1是")
|
@ApiModelProperty("是否已购买 0否 1是")
|
||||||
private Integer isBuy;
|
private Integer isBuy;
|
||||||
private Long faceId;
|
private Long faceId;
|
||||||
@ApiModelProperty(value = "用户id", hidden = true)
|
|
||||||
private Long memberId;
|
|
||||||
@ApiModelProperty("景区id")
|
@ApiModelProperty("景区id")
|
||||||
private Long scenicId;
|
private Long scenicId;
|
||||||
@ApiModelProperty("源素材商品类型 1视频 2图像")
|
@ApiModelProperty("源素材商品类型 1视频 2图像")
|
||||||
|
@ -7,6 +7,7 @@ import com.ycwl.basic.biz.OrderBiz;
|
|||||||
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.jwt.JwtInfo;
|
||||||
|
import com.ycwl.basic.model.mobile.goods.GoodsPageVO;
|
||||||
import com.ycwl.basic.model.mobile.order.IsBuyRespVO;
|
import com.ycwl.basic.model.mobile.order.IsBuyRespVO;
|
||||||
import com.ycwl.basic.model.mobile.scenic.ScenicAppVO;
|
import com.ycwl.basic.model.mobile.scenic.ScenicAppVO;
|
||||||
import com.ycwl.basic.model.mobile.scenic.ScenicDeviceCountVO;
|
import com.ycwl.basic.model.mobile.scenic.ScenicDeviceCountVO;
|
||||||
@ -36,6 +37,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:longbinbin
|
* @Author:longbinbin
|
||||||
@ -132,40 +134,45 @@ public class AppScenicServiceImpl implements AppScenicService {
|
|||||||
|
|
||||||
SourceReqQuery sourceReqQuery = new SourceReqQuery();
|
SourceReqQuery sourceReqQuery = new SourceReqQuery();
|
||||||
sourceReqQuery.setScenicId(faceRespVO.getScenicId());
|
sourceReqQuery.setScenicId(faceRespVO.getScenicId());
|
||||||
|
sourceReqQuery.setFaceId(faceId);
|
||||||
sourceReqQuery.setMemberId(userId);
|
sourceReqQuery.setMemberId(userId);
|
||||||
//查询源素材
|
//查询源素材
|
||||||
List<SourceRespVO> sourceList = sourceMapper.listGroupByType(sourceReqQuery);
|
List<SourceRespVO> sourceList = sourceMapper.queryByRelation(sourceReqQuery);
|
||||||
ScenicConfigEntity scenicConfig = scenicRepository.getScenicConfig(faceRespVO.getScenicId());
|
ScenicConfigEntity scenicConfig = scenicRepository.getScenicConfig(faceRespVO.getScenicId());
|
||||||
sourceList.stream().filter(item -> {
|
sourceList.stream().collect(Collectors.groupingBy(SourceRespVO::getType)).keySet()
|
||||||
if (item.getType() == 1) {
|
.stream()
|
||||||
if (Integer.valueOf(1).equals(scenicConfig.getDisableSourceVideo())) {
|
.filter(type -> {
|
||||||
return false;
|
if (Integer.valueOf(1).equals(type)) {
|
||||||
}
|
if (Integer.valueOf(1).equals(scenicConfig.getDisableSourceVideo())) {
|
||||||
} else if (item.getType() == 2) {
|
return false;
|
||||||
if (Integer.valueOf(1).equals(scenicConfig.getDisableSourceImage())) {
|
}
|
||||||
return false;
|
} else if (Integer.valueOf(2).equals(type)) {
|
||||||
}
|
if (Integer.valueOf(1).equals(scenicConfig.getDisableSourceImage())) {
|
||||||
}
|
return false;
|
||||||
return true;
|
}
|
||||||
}).forEach(sourceRespVO -> {
|
}
|
||||||
ContentPageVO contentPageVO = new ContentPageVO();
|
return true;
|
||||||
Integer type = sourceRespVO.getType();
|
})
|
||||||
if(type==1){
|
.forEach(type -> {
|
||||||
contentPageVO.setName("原片集");
|
ContentPageVO contentPageVO = new ContentPageVO();
|
||||||
} else {
|
if (type == 1) {
|
||||||
contentPageVO.setName("照片集");
|
contentPageVO.setName("原片集");
|
||||||
}
|
} else {
|
||||||
IsBuyRespVO isBuyRespVO = orderBiz.isBuy(userId, faceRespVO.getScenicId(), type, faceId);
|
contentPageVO.setName("照片集");
|
||||||
contentPageVO.setSourceType(isBuyRespVO.getGoodsType());
|
}
|
||||||
contentPageVO.setContentId(isBuyRespVO.getGoodsId());
|
IsBuyRespVO isBuyRespVO = orderBiz.isBuy(userId, faceRespVO.getScenicId(), type, faceId);
|
||||||
if (isBuyRespVO.isBuy()) {
|
contentPageVO.setSourceType(isBuyRespVO.getGoodsType());
|
||||||
contentPageVO.setIsBuy(1);
|
contentPageVO.setContentId(isBuyRespVO.getGoodsId());
|
||||||
} else {
|
if (isBuyRespVO.isBuy()) {
|
||||||
contentPageVO.setIsBuy(0);
|
contentPageVO.setIsBuy(1);
|
||||||
}
|
} else {
|
||||||
contentPageVO.setContentType(2);
|
contentPageVO.setIsBuy(0);
|
||||||
contentList.add(contentPageVO);
|
}
|
||||||
});
|
contentPageVO.setScenicId(faceRespVO.getScenicId());
|
||||||
|
contentPageVO.setTemplateCoverUrl(sourceList.get(0).getUrl());
|
||||||
|
contentPageVO.setContentType(2);
|
||||||
|
contentList.add(contentPageVO);
|
||||||
|
});
|
||||||
|
|
||||||
return ApiResponse.success(contentList);
|
return ApiResponse.success(contentList);
|
||||||
}
|
}
|
||||||
|
@ -1,23 +1,21 @@
|
|||||||
package com.ycwl.basic.service.impl.mobile;
|
package com.ycwl.basic.service.impl.mobile;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
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.mobile.goods.*;
|
import com.ycwl.basic.model.mobile.goods.*;
|
||||||
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.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.task.entity.TaskEntity;
|
import com.ycwl.basic.model.pc.task.entity.TaskEntity;
|
||||||
import com.ycwl.basic.model.pc.task.resp.TaskRespVO;
|
|
||||||
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.ScenicRepository;
|
||||||
import com.ycwl.basic.repository.VideoTaskRepository;
|
import com.ycwl.basic.repository.VideoTaskRepository;
|
||||||
import com.ycwl.basic.service.impl.pc.TaskServiceImpl;
|
|
||||||
import com.ycwl.basic.service.impl.task.TaskTaskServiceImpl;
|
|
||||||
import com.ycwl.basic.service.mobile.GoodsService;
|
import com.ycwl.basic.service.mobile.GoodsService;
|
||||||
import com.ycwl.basic.repository.TemplateRepository;
|
import com.ycwl.basic.repository.TemplateRepository;
|
||||||
import com.ycwl.basic.service.task.TaskService;
|
import com.ycwl.basic.service.task.TaskService;
|
||||||
@ -31,66 +29,80 @@ 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.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:longbinbin
|
* @Author:longbinbin
|
||||||
* @Date:2024/12/5 15:04
|
* @Date:2024/12/5 15:04
|
||||||
*/@Service
|
*/
|
||||||
|
@Service
|
||||||
public class GoodsServiceImpl implements GoodsService {
|
public class GoodsServiceImpl implements GoodsService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private VideoMapper videoMapper;
|
private VideoMapper videoMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SourceMapper sourceMapper;
|
private SourceMapper sourceMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ScenicMapper scenicMapper;
|
private ScenicMapper scenicMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private FaceMapper faceMapper;
|
private FaceMapper faceMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TemplateRepository templateRepository;
|
private TemplateRepository templateRepository;
|
||||||
@Autowired
|
@Autowired
|
||||||
private VideoTaskRepository videoTaskRepository;
|
private VideoTaskRepository videoTaskRepository;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TaskService taskTaskService;
|
private TaskService taskTaskService;
|
||||||
|
@Autowired
|
||||||
|
private ScenicRepository scenicRepository;
|
||||||
|
|
||||||
public ApiResponse<List<GoodsPageVO>> goodsList(GoodsReqQuery query) {
|
public ApiResponse<List<GoodsPageVO>> goodsList(GoodsReqQuery query) {
|
||||||
//查询原素材
|
//查询原素材
|
||||||
List<GoodsPageVO> goodsList = new ArrayList<>();
|
List<GoodsPageVO> goodsList = new ArrayList<>();
|
||||||
|
VideoReqQuery videoReqQuery = new VideoReqQuery();
|
||||||
|
videoReqQuery.setScenicId(query.getScenicId());
|
||||||
|
videoReqQuery.setIsBuy(query.getIsBuy());
|
||||||
|
videoReqQuery.setFaceId(query.getFaceId());
|
||||||
|
videoReqQuery.setMemberId(Long.valueOf(BaseContextHandler.getUserId()));
|
||||||
|
//查询成片vlog
|
||||||
|
List<VideoRespVO> videoList = videoMapper.queryByRelation(videoReqQuery);
|
||||||
|
videoList.forEach(videoRespVO -> {
|
||||||
|
GoodsPageVO goodsPageVO = new GoodsPageVO();
|
||||||
|
goodsPageVO.setGoodsName(videoRespVO.getTemplateName());
|
||||||
|
goodsPageVO.setScenicId(videoRespVO.getScenicId());
|
||||||
|
goodsPageVO.setScenicName(videoRespVO.getScenicName());
|
||||||
|
goodsPageVO.setGoodsType(0);
|
||||||
|
goodsPageVO.setFaceId(videoRespVO.getFaceId());
|
||||||
|
goodsPageVO.setGoodsId(videoRespVO.getId());
|
||||||
|
goodsPageVO.setTemplateName(videoRespVO.getTemplateName());
|
||||||
|
goodsPageVO.setTemplateCoverUrl(videoRespVO.getTemplateCoverUrl());
|
||||||
|
goodsList.add(goodsPageVO);
|
||||||
|
});
|
||||||
|
|
||||||
VideoReqQuery videoReqQuery = new VideoReqQuery();
|
SourceReqQuery sourceReqQuery = new SourceReqQuery();
|
||||||
videoReqQuery.setScenicId(query.getScenicId());
|
sourceReqQuery.setScenicId(query.getScenicId());
|
||||||
videoReqQuery.setIsBuy(query.getIsBuy());
|
sourceReqQuery.setIsBuy(query.getIsBuy());
|
||||||
videoReqQuery.setMemberId(Long.valueOf(BaseContextHandler.getUserId()));
|
sourceReqQuery.setFaceId(query.getFaceId());
|
||||||
//查询成片vlog
|
sourceReqQuery.setMemberId(Long.valueOf(BaseContextHandler.getUserId()));
|
||||||
List<VideoRespVO> videoList = videoMapper.queryByRelation(videoReqQuery);
|
//查询源素材
|
||||||
videoList.forEach(videoRespVO -> {
|
List<SourceRespVO> sourceList = sourceMapper.queryByRelation(sourceReqQuery);
|
||||||
GoodsPageVO goodsPageVO = new GoodsPageVO();
|
ScenicConfigEntity scenicConfig = scenicRepository.getScenicConfig(query.getScenicId());
|
||||||
goodsPageVO.setGoodsName(videoRespVO.getTemplateName());
|
|
||||||
goodsPageVO.setScenicId(videoRespVO.getScenicId());
|
|
||||||
goodsPageVO.setScenicName(videoRespVO.getScenicName());
|
|
||||||
goodsPageVO.setGoodsType(0);
|
|
||||||
goodsPageVO.setFaceId(videoRespVO.getFaceId());
|
|
||||||
goodsPageVO.setGoodsId(videoRespVO.getId());
|
|
||||||
goodsPageVO.setTemplateName(videoRespVO.getTemplateName());
|
|
||||||
goodsPageVO.setTemplateCoverUrl(videoRespVO.getTemplateCoverUrl());
|
|
||||||
goodsList.add(goodsPageVO);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
SourceReqQuery sourceReqQuery = new SourceReqQuery();
|
|
||||||
sourceReqQuery.setScenicId(query.getScenicId());
|
|
||||||
sourceReqQuery.setIsBuy(query.getIsBuy());
|
|
||||||
sourceReqQuery.setMemberId(Long.valueOf(BaseContextHandler.getUserId()));
|
|
||||||
//查询源素材
|
|
||||||
List<SourceRespVO> sourceList = sourceMapper.queryByRelation(sourceReqQuery);
|
|
||||||
List<GoodsPageVO> sourceGoods = sourceList.stream().collect(Collectors.groupingBy(SourceRespVO::getFaceId)).entrySet().stream().flatMap((faceEntry) -> {
|
List<GoodsPageVO> sourceGoods = sourceList.stream().collect(Collectors.groupingBy(SourceRespVO::getFaceId)).entrySet().stream().flatMap((faceEntry) -> {
|
||||||
Long faceId = faceEntry.getKey();
|
Long faceId = faceEntry.getKey();
|
||||||
List<SourceRespVO> goods = faceEntry.getValue();
|
List<SourceRespVO> goods = faceEntry.getValue();
|
||||||
return goods.stream().collect(Collectors.groupingBy(SourceRespVO::getType)).keySet().stream().map(type -> {
|
return goods.stream().collect(Collectors.groupingBy(SourceRespVO::getType)).keySet().stream().filter(type -> {
|
||||||
|
if (Integer.valueOf(1).equals(type)) {
|
||||||
|
if (Integer.valueOf(1).equals(scenicConfig.getDisableSourceVideo())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (Integer.valueOf(2).equals(type)) {
|
||||||
|
if (Integer.valueOf(1).equals(scenicConfig.getDisableSourceImage())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}).map(type -> {
|
||||||
GoodsPageVO goodsPageVO = new GoodsPageVO();
|
GoodsPageVO goodsPageVO = new GoodsPageVO();
|
||||||
|
goodsPageVO.setTemplateCoverUrl(goods.get(0).getUrl());
|
||||||
goodsPageVO.setFaceId(faceId);
|
goodsPageVO.setFaceId(faceId);
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
goodsPageVO.setGoodsName("原片集");
|
goodsPageVO.setGoodsName("原片集");
|
||||||
@ -111,27 +123,27 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ApiResponse.success(goodsList);
|
return ApiResponse.success(goodsList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApiResponse<List<GoodsDetailVO>> sourceGoodsList(GoodsReqQuery query) {
|
public ApiResponse<List<GoodsDetailVO>> sourceGoodsList(Long userId, GoodsReqQuery query) {
|
||||||
Integer sourceType = query.getSourceType();
|
Integer sourceType = query.getSourceType();
|
||||||
SourceReqQuery sourceReqQuery = new SourceReqQuery();
|
SourceReqQuery sourceReqQuery = new SourceReqQuery();
|
||||||
sourceReqQuery.setScenicId(query.getScenicId());
|
sourceReqQuery.setScenicId(query.getScenicId());
|
||||||
sourceReqQuery.setIsBuy(query.getIsBuy());
|
sourceReqQuery.setIsBuy(query.getIsBuy());
|
||||||
sourceReqQuery.setMemberId(query.getMemberId());
|
sourceReqQuery.setMemberId(userId);
|
||||||
sourceReqQuery.setType(sourceType);
|
sourceReqQuery.setType(sourceType);
|
||||||
sourceReqQuery.setFaceId(query.getFaceId());
|
sourceReqQuery.setFaceId(query.getFaceId());
|
||||||
List<SourceRespVO> list = sourceMapper.listUser(sourceReqQuery);
|
List<SourceRespVO> list = sourceMapper.listUser(sourceReqQuery);
|
||||||
List<GoodsDetailVO> goodsDetailVOList = new ArrayList<>();
|
List<GoodsDetailVO> goodsDetailVOList = new ArrayList<>();
|
||||||
|
|
||||||
String goodsNamePrefix = "";
|
String goodsNamePrefix = "";
|
||||||
if(sourceType==1){
|
if (sourceType == 1) {
|
||||||
goodsNamePrefix="视频";
|
goodsNamePrefix = "视频";
|
||||||
}else if (sourceType==2){
|
} else if (sourceType == 2) {
|
||||||
goodsNamePrefix="图片";
|
goodsNamePrefix = "图片";
|
||||||
}else {
|
} else {
|
||||||
goodsNamePrefix="其他类型";
|
goodsNamePrefix = "其他类型";
|
||||||
}
|
}
|
||||||
//图片编号
|
//图片编号
|
||||||
int i=1;
|
int i=1;
|
||||||
@ -139,10 +151,10 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
GoodsDetailVO goodsDetailVO = new GoodsDetailVO();
|
GoodsDetailVO goodsDetailVO = new GoodsDetailVO();
|
||||||
goodsDetailVO.setGoodsId(sourceRespVO.getId());
|
goodsDetailVO.setGoodsId(sourceRespVO.getId());
|
||||||
String shootingTime = DateUtils.format(sourceRespVO.getCreateTime(), "yyyy.MM.dd HH:mm:ss");
|
String shootingTime = DateUtils.format(sourceRespVO.getCreateTime(), "yyyy.MM.dd HH:mm:ss");
|
||||||
if(i<10){
|
if (i < 10) {
|
||||||
goodsDetailVO.setGoodsName(goodsNamePrefix +"0"+i+" "+shootingTime);
|
goodsDetailVO.setGoodsName(goodsNamePrefix + "0" + i + " " + shootingTime);
|
||||||
}else {
|
} else {
|
||||||
goodsDetailVO.setGoodsName(goodsNamePrefix +i+" "+shootingTime);
|
goodsDetailVO.setGoodsName(goodsNamePrefix + i + " " + shootingTime);
|
||||||
}
|
}
|
||||||
goodsDetailVO.setScenicId(sourceRespVO.getScenicId());
|
goodsDetailVO.setScenicId(sourceRespVO.getScenicId());
|
||||||
goodsDetailVO.setScenicName(sourceRespVO.getScenicName());
|
goodsDetailVO.setScenicName(sourceRespVO.getScenicName());
|
||||||
@ -166,28 +178,28 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
public ApiResponse<BigDecimal> queryPrice(GoodsPriceQueryReq queryPriceData) {
|
public ApiResponse<BigDecimal> queryPrice(GoodsPriceQueryReq queryPriceData) {
|
||||||
Integer goodsType = queryPriceData.getGoodsType();
|
Integer goodsType = queryPriceData.getGoodsType();
|
||||||
|
|
||||||
if(goodsType==0){//成片vlog
|
if (goodsType == 0) {//成片vlog
|
||||||
//成片的价格就是成片所用template的价格
|
//成片的价格就是成片所用template的价格
|
||||||
Long videoId = queryPriceData.getGoodsId();
|
Long videoId = queryPriceData.getGoodsId();
|
||||||
VideoRespVO videoRespVO = videoMapper.getById(videoId);
|
VideoRespVO videoRespVO = videoMapper.getById(videoId);
|
||||||
if(videoRespVO==null){
|
if (videoRespVO == null) {
|
||||||
return ApiResponse.fail("该vlog不存在或已失效");
|
return ApiResponse.fail("该vlog不存在或已失效");
|
||||||
}
|
}
|
||||||
BigDecimal templatePrice = videoRespVO.getTemplatePrice();
|
BigDecimal templatePrice = videoRespVO.getTemplatePrice();
|
||||||
if(templatePrice==null){
|
if (templatePrice == null) {
|
||||||
return ApiResponse.fail("该vlog使用的模板价格或状态异常,请联系管理员");
|
return ApiResponse.fail("该vlog使用的模板价格或状态异常,请联系管理员");
|
||||||
}
|
}
|
||||||
return ApiResponse.success(templatePrice);
|
return ApiResponse.success(templatePrice);
|
||||||
|
|
||||||
}else if(goodsType==1 || goodsType == 2){//原素材
|
} else if (goodsType == 1 || goodsType == 2) {//原素材
|
||||||
//原素材的价格就是原素材对应景区定的价格
|
//原素材的价格就是原素材对应景区定的价格
|
||||||
Long scenicId = queryPriceData.getScenicId();
|
Long scenicId = queryPriceData.getScenicId();
|
||||||
ScenicRespVO scenicRespVO = scenicMapper.getById(scenicId);
|
ScenicRespVO scenicRespVO = scenicMapper.getById(scenicId);
|
||||||
if(scenicRespVO==null){
|
if (scenicRespVO == null) {
|
||||||
return ApiResponse.fail("该景区不存在或状态异常,请联系管理员");
|
return ApiResponse.fail("该景区不存在或状态异常,请联系管理员");
|
||||||
}
|
}
|
||||||
BigDecimal price = scenicRespVO.getPrice();
|
BigDecimal price = scenicRespVO.getPrice();
|
||||||
if(price==null){
|
if (price == null) {
|
||||||
return ApiResponse.fail("该景区的原片价格未设定或状态异常,请联系管理员");
|
return ApiResponse.fail("该景区的原片价格未设定或状态异常,请联系管理员");
|
||||||
}
|
}
|
||||||
return ApiResponse.success(price);
|
return ApiResponse.success(price);
|
||||||
@ -199,7 +211,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
public ApiResponse<VideoGoodsDetailVO> videoGoodsDetail(Long userId, Long videoId) {
|
public ApiResponse<VideoGoodsDetailVO> videoGoodsDetail(Long userId, Long videoId) {
|
||||||
VideoGoodsDetailVO goodsDetailVO = new VideoGoodsDetailVO();
|
VideoGoodsDetailVO goodsDetailVO = new VideoGoodsDetailVO();
|
||||||
VideoRespVO videoRespVO = videoMapper.getById(videoId);
|
VideoRespVO videoRespVO = videoMapper.getById(videoId);
|
||||||
if(videoRespVO==null){
|
if (videoRespVO == null) {
|
||||||
return ApiResponse.fail("该vlog不存在或已失效");
|
return ApiResponse.fail("该vlog不存在或已失效");
|
||||||
}
|
}
|
||||||
goodsDetailVO.setGoodsName(videoRespVO.getTemplateName());
|
goodsDetailVO.setGoodsName(videoRespVO.getTemplateName());
|
||||||
@ -223,8 +235,8 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
BigDecimal slashPrice = videoRespVO.getSlashPrice();
|
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.setSlashPrice(slashPrice == null ? null : df.format(slashPrice.setScale(2, RoundingMode.HALF_UP)));
|
||||||
}
|
}
|
||||||
TaskEntity task = videoTaskRepository.getTaskById(videoRespVO.getTaskId());
|
TaskEntity task = videoTaskRepository.getTaskById(videoRespVO.getTaskId());
|
||||||
JSONObject paramJson = JSON.parseObject(task.getTaskParams());
|
JSONObject paramJson = JSON.parseObject(task.getTaskParams());
|
||||||
|
@ -57,7 +57,7 @@ public class FaceServiceImpl implements FaceService {
|
|||||||
|
|
||||||
@Value("${face.score}")
|
@Value("${face.score}")
|
||||||
private float faceScore;
|
private float faceScore;
|
||||||
private final float strictScore = 0.90F;
|
private final float strictScore = 0.75F;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TaskService taskTaskService;
|
private TaskService taskTaskService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -21,10 +21,12 @@ public interface GoodsService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询源素材商品列表
|
* 查询源素材商品列表
|
||||||
|
*
|
||||||
|
* @param userId
|
||||||
* @param query
|
* @param query
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
ApiResponse<List<GoodsDetailVO>> sourceGoodsList(GoodsReqQuery query);
|
ApiResponse<List<GoodsDetailVO>> sourceGoodsList(Long userId, GoodsReqQuery query);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询订单应付价格
|
* 查询订单应付价格
|
||||||
|
@ -137,9 +137,11 @@
|
|||||||
left join scenic sc on sc.id = so.scenic_id
|
left join scenic sc on sc.id = so.scenic_id
|
||||||
where
|
where
|
||||||
ms.member_id = #{memberId}
|
ms.member_id = #{memberId}
|
||||||
|
<if test="faceId!= null">and ms.face_id = #{faceId} </if>
|
||||||
<if test="type!=null">and ms.type = #{type} </if>
|
<if test="type!=null">and ms.type = #{type} </if>
|
||||||
<if test="scenicId!= null">and ms.scenic_id = #{scenicId} </if>
|
<if test="scenicId!= null">and ms.scenic_id = #{scenicId} </if>
|
||||||
<if test="isBuy!=null">and ms.is_buy = #{isBuy}</if>
|
<if test="isBuy!=null">and ms.is_buy = #{isBuy}</if>
|
||||||
|
order by so.create_time desc
|
||||||
</select>
|
</select>
|
||||||
<select id="querySameVideo" resultType="com.ycwl.basic.model.pc.source.entity.SourceEntity">
|
<select id="querySameVideo" resultType="com.ycwl.basic.model.pc.source.entity.SourceEntity">
|
||||||
select *
|
select *
|
||||||
|
@ -99,11 +99,7 @@
|
|||||||
<if test="isBuy!=null">and mv.is_buy = #{isBuy}</if>
|
<if test="isBuy!=null">and mv.is_buy = #{isBuy}</if>
|
||||||
<if test="startTime!= null">and v.create_time >= #{startTime} </if>
|
<if test="startTime!= null">and v.create_time >= #{startTime} </if>
|
||||||
<if test="endTime!= null">and v.create_time <= #{endTime} </if>
|
<if test="endTime!= null">and v.create_time <= #{endTime} </if>
|
||||||
<if test="faceId!= null">
|
<if test="faceId!= null">and mv.face_id = #{faceId} </if>
|
||||||
and mv.task_id in (
|
|
||||||
select id from task where face_id = #{faceId}
|
|
||||||
)
|
|
||||||
</if>
|
|
||||||
</where>
|
</where>
|
||||||
order by v.create_time desc
|
order by v.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user