修改bug

This commit is contained in:
longbinbin
2024-12-11 11:35:32 +08:00
parent 3c502c600c
commit 6ad8541b2e
11 changed files with 109 additions and 48 deletions

View File

@ -1,10 +1,7 @@
package com.ycwl.basic.controller.mobile;
import com.ycwl.basic.model.jwt.JwtInfo;
import com.ycwl.basic.model.mobile.goods.GoodsDetailVO;
import com.ycwl.basic.model.mobile.goods.GoodsPriceQueryReq;
import com.ycwl.basic.model.mobile.goods.GoodsReqQuery;
import com.ycwl.basic.model.mobile.goods.GoodsPageVO;
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.utils.ApiResponse;
@ -44,7 +41,7 @@ public class AppGoodsController {
@ApiOperation("成片vlog商品详情")
@GetMapping("/getVideoGoodsDetail/{goodId}")
public ApiResponse<GoodsDetailVO> videoGoodsDetail(@PathVariable("goodId") Long goodsId) {
public ApiResponse<VideoGoodsDetailVO> videoGoodsDetail(@PathVariable("goodId") Long goodsId) {
return goodsService.videoGoodsDetail(goodsId);
}

View File

@ -6,6 +6,7 @@ import com.ycwl.basic.model.pc.device.req.DeviceAddOrUpdateReq;
import com.ycwl.basic.model.pc.device.req.DeviceReqQuery;
import com.ycwl.basic.model.pc.device.resp.DeviceRespVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -25,5 +26,5 @@ public interface DeviceMapper {
List<DeviceRespVO> listByScenicId(Long scenicId);
ScenicDeviceCountVO deviceCountByScenicId(Long scenicId, String userId);
ScenicDeviceCountVO deviceCountByScenicId(@Param("scenicId") Long scenicId,@Param("userId") Long userId);
}

View File

@ -39,4 +39,8 @@ public class GoodsDetailVO {
private String videoUrl;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
@ApiModelProperty("价格")
private BigDecimal price;
@ApiModelProperty("是否已购买 0否 1是")
private Integer isBuy;
}

View File

@ -0,0 +1,48 @@
package com.ycwl.basic.model.mobile.goods;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Authorlongbinbin
* @Date2024/12/5 15:10
*/
@Data
@ApiModel("vlog商品详情")
public class VideoGoodsDetailVO {
@ApiModelProperty("商品名称")
private String goodsName;
@ApiModelProperty("景区id")
private Long scenicId;
@ApiModelProperty("景区名称")
private String scenicName;
@ApiModelProperty("经度")
private BigDecimal longitude;
@ApiModelProperty("纬度")
private BigDecimal latitude;
@ApiModelProperty("商品类型 1:成片视频 2:源素材")
private Integer goodsType;
@ApiModelProperty("源素材类型 1:视频 2:图片")
private Integer sourceType;
@ApiModelProperty("商品id goodsType=1时为videoIdgoodsType=2时为sourceId")
private Long goodsId;
@ApiModelProperty("模版封面图片")
private String templateCoverUrl;
@ApiModelProperty("图片文件存储地址")
private String url;
@ApiModelProperty("视频文件存储地址")
private String videoUrl;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
@ApiModelProperty("价格")
private BigDecimal price;
@ApiModelProperty("是否已购买 0否 1是")
private Integer isBuy;
@ApiModelProperty("镜头数")
private Integer lensNum;
}

View File

@ -19,6 +19,8 @@ public class OrderItemVO {
*/
@ApiModelProperty("订单id")
private Long orderId;
@ApiModelProperty("商品类型1成片2源素材")
private Integer goodsType;
/**
* 商品IDgoods_type=1关联video.id=2关联source.id=3关联template.id
*/

View File

@ -72,8 +72,8 @@ public class AppScenicServiceImpl implements AppScenicService {
@Override
public ApiResponse<ScenicDeviceCountVO> deviceCountByScenicId(Long scenicId) {
String userId = BaseContextHandler.getUserId();
ScenicDeviceCountVO scenicDeviceCountVO = deviceMapper.deviceCountByScenicId(scenicId, userId);
JwtInfo worker = JwtTokenUtil.getWorker();
ScenicDeviceCountVO scenicDeviceCountVO = deviceMapper.deviceCountByScenicId(scenicId, worker.getUserId());
return ApiResponse.success(scenicDeviceCountVO);
}

View File

@ -1,14 +1,9 @@
package com.ycwl.basic.service.impl.mobile;
import com.ycwl.basic.mapper.pc.ScenicMapper;
import com.ycwl.basic.mapper.pc.SourceMapper;
import com.ycwl.basic.mapper.pc.TaskMapper;
import com.ycwl.basic.mapper.pc.VideoMapper;
import com.ycwl.basic.mapper.pc.*;
import com.ycwl.basic.model.jwt.JwtInfo;
import com.ycwl.basic.model.mobile.goods.GoodsDetailVO;
import com.ycwl.basic.model.mobile.goods.GoodsPriceQueryReq;
import com.ycwl.basic.model.mobile.goods.GoodsReqQuery;
import com.ycwl.basic.model.mobile.goods.GoodsPageVO;
import com.ycwl.basic.model.mobile.goods.*;
import com.ycwl.basic.model.mobile.scenic.ScenicDeviceCountVO;
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.resp.SourceRespVO;
@ -39,6 +34,8 @@ public class GoodsServiceImpl implements GoodsService {
private ScenicMapper scenicMapper;
@Autowired
private TaskMapper taskMapper;
@Autowired
private DeviceMapper deviceMapper;
public ApiResponse<List<GoodsPageVO>> goodsList(GoodsReqQuery query) {
JwtInfo worker = JwtTokenUtil.getWorker();
@ -171,9 +168,12 @@ public class GoodsServiceImpl implements GoodsService {
}
@Override
public ApiResponse<GoodsDetailVO> videoGoodsDetail(Long goodsId) {
GoodsDetailVO goodsDetailVO = new GoodsDetailVO();
public ApiResponse<VideoGoodsDetailVO> videoGoodsDetail(Long goodsId) {
VideoGoodsDetailVO goodsDetailVO = new VideoGoodsDetailVO();
VideoRespVO videoRespVO = videoMapper.getById(goodsId);
if(videoRespVO==null){
return ApiResponse.fail("该vlog不存在或已失效");
}
goodsDetailVO.setGoodsName(videoRespVO.getTemplateName());
goodsDetailVO.setScenicId(videoRespVO.getScenicId());
goodsDetailVO.setScenicName(videoRespVO.getScenicName());
@ -184,6 +184,10 @@ public class GoodsServiceImpl implements GoodsService {
goodsDetailVO.setVideoUrl(videoRespVO.getVideoUrl());
goodsDetailVO.setTemplateCoverUrl(videoRespVO.getTemplateCoverUrl());
goodsDetailVO.setCreateTime(videoRespVO.getCreateTime());
goodsDetailVO.setPrice(videoRespVO.getTemplatePrice());
goodsDetailVO.setIsBuy(videoRespVO.getIsBuy());
ScenicDeviceCountVO scenicDeviceCountVO = deviceMapper.deviceCountByScenicId(videoRespVO.getScenicId(), -1L);
goodsDetailVO.setLensNum(scenicDeviceCountVO.getTotalDeviceCount());
return ApiResponse.success(goodsDetailVO);
}

View File

@ -264,6 +264,7 @@ public class OrderServiceImpl implements OrderService {
OrderItemVO itemVO = orderItemList.get(NumberConstant.ZERO);
appRespVO.setScenicName(itemVO.getScenicName());
appRespVO.setGoodsName(itemVO.getGoodsName());
appRespVO.setSourceType(itemVO.getSourceType());
}
}
PageInfo<OrderAppRespVO> pageInfo = new PageInfo<>(list);

View File

@ -1,9 +1,6 @@
package com.ycwl.basic.service.mobile;
import com.ycwl.basic.model.mobile.goods.GoodsDetailVO;
import com.ycwl.basic.model.mobile.goods.GoodsPriceQueryReq;
import com.ycwl.basic.model.mobile.goods.GoodsReqQuery;
import com.ycwl.basic.model.mobile.goods.GoodsPageVO;
import com.ycwl.basic.model.mobile.goods.*;
import com.ycwl.basic.model.pc.source.resp.SourceRespVO;
import com.ycwl.basic.utils.ApiResponse;
@ -42,7 +39,7 @@ public interface GoodsService {
* @param goodsId 商品vlogid
* @return
*/
ApiResponse<GoodsDetailVO> videoGoodsDetail(Long goodsId);
ApiResponse<VideoGoodsDetailVO> videoGoodsDetail(Long goodsId);
/**
* 查询当前用户的成片合成任务状态