This commit is contained in:
longbinbin
2024-12-06 14:47:39 +08:00
parent d18f370b12
commit 4a4019334e
9 changed files with 34 additions and 20 deletions

View File

@ -9,10 +9,7 @@ import com.ycwl.basic.utils.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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 org.springframework.web.bind.annotation.*;
import java.util.List;
@ -41,10 +38,16 @@ public class AppGoodsController {
return goodsService.sourceGoodsList(query);
}
// @ApiOperation("成片vlog商品详情")
// @GetMapping("/getVideoGoodsDetail/{goodId}")
// public ApiResponse<GoodsVO> videoGoodsDetail(@RequestBody GoodsReqQuery query) {
//
// return ApiResponse.success("");
// }
@ApiOperation("查询价格")
@PostMapping("/queryPrice")
public ApiResponse queryPrice(@RequestBody GoodsPriceQueryReq queryPriceData) {
//TODO 处理购买逻辑
return goodsService.queryPrice(queryPriceData);
}
}

View File

@ -1,6 +1,7 @@
package com.ycwl.basic.controller.mobile;
import com.ycwl.basic.annotation.IgnoreToken;
import com.ycwl.basic.constant.BaseContextHandler;
import com.ycwl.basic.model.pc.order.req.OrderAddOrUpdateReq;
import com.ycwl.basic.model.pc.order.req.OrderReqQuery;
import com.ycwl.basic.service.pc.OrderService;
@ -56,8 +57,7 @@ public class AppOrderController {
@ApiOperation("获取用户订单数量")
@GetMapping("/getUserOrderCount")
public ApiResponse getUserOrderCount() {
//TODO 获取用户信息
Long userId = 1L;
Long userId = Long.parseLong(BaseContextHandler.getUserId());
return orderService.getOrderCountByUserId(userId);
}

View File

@ -22,5 +22,5 @@ public class WeChatUserInfoUpdateDTO {
/**
* 是否同意用户协议1同意0未同意
*/
private Long id;
private Integer agreement;
}

View File

@ -32,6 +32,6 @@ public class GoodsVO {
private Integer sourceType;
@ApiModelProperty("商品id goodsType为1时才有值")
private Long goodsId;
@ApiModelProperty("视频链接 goodsType为1时才有值")
private String videoUrl;
@ApiModelProperty("模版封面图片")
private String templateCoverUrl;
}

View File

@ -92,4 +92,6 @@ public class OrderReqQuery extends BaseQueryParameterReq {
private Date startRefundTime;
private Date endRefundTime;
@ApiModelProperty("订单类型 0成片vlog 1原片 2照片")
private Integer type;
}

View File

@ -1,8 +1,6 @@
package com.ycwl.basic.model.pc.video.resp;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ycwl.basic.model.common.BaseQueryParameterReq;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -39,7 +37,9 @@ public class VideoRespVO {
@ApiModelProperty("模版名称")
private String templateName;
@ApiModelProperty("模版价格")
private BigDecimal tmplatePrice;
private BigDecimal templatePrice;
@ApiModelProperty("模版封面图片")
private String templateCoverUrl;
@ApiModelProperty("经度")
private BigDecimal longitude;
@ApiModelProperty("纬度")

View File

@ -1,13 +1,11 @@
package com.ycwl.basic.service.impl.mobile;
import com.github.pagehelper.PageInfo;
import com.ycwl.basic.mapper.pc.ScenicMapper;
import com.ycwl.basic.mapper.pc.SourceMapper;
import com.ycwl.basic.mapper.pc.VideoMapper;
import com.ycwl.basic.model.mobile.goods.GoodsPriceQueryReq;
import com.ycwl.basic.model.mobile.goods.GoodsReqQuery;
import com.ycwl.basic.model.mobile.goods.GoodsVO;
import com.ycwl.basic.model.pc.order.resp.OrderItemVO;
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;
@ -53,7 +51,7 @@ public class GoodsServiceImpl implements GoodsService {
goodsVO.setLatitude(videoRespVO.getLatitude());
goodsVO.setGoodsType(1);
goodsVO.setGoodsId(videoRespVO.getId());
goodsVO.setVideoUrl(videoRespVO.getVideoUrl());
goodsVO.setTemplateCoverUrl(videoRespVO.getTemplateCoverUrl());
goodsList.add(goodsVO);
});
@ -106,7 +104,7 @@ public class GoodsServiceImpl implements GoodsService {
if(videoRespVO==null){
return ApiResponse.fail("该vlog不存在或已失效");
}
BigDecimal tmplatePrice = videoRespVO.getTmplatePrice();
BigDecimal tmplatePrice = videoRespVO.getTemplatePrice();
if(tmplatePrice==null){
return ApiResponse.fail("该vlog使用的模板价格或状态异常请联系管理员");
}

View File

@ -325,6 +325,17 @@
<if test="endCancelTime!= null ">
and cancel_at &lt;= #{endCancelTime}
</if>
<if test="type!= null ">
<if test="type== 0 ">
and oi.goods_type = 1
</if>
<if test="type== 1 ">
and oi.goods_type = 2 and sr.type = 1
</if>
<if test="type== 2 ">
and oi.goods_type = 2 and sr.type = 2
</if>
</if>
</where>
order by o.create_at desc
</select>

View File

@ -21,13 +21,13 @@
delete from video where id = #{id}
</delete>
<select id="list" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
select v.id, scenic_id, member_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
s.name scenicName, s.latitude, s.longitude, t.name templateName, t.price templatePrice
select v.id, v.scenic_id, member_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
s.name scenicName, s.latitude, s.longitude, t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl
from video v
left join scenic s on s.id = v.scenic_id
left join template t on v.template_id = t.id
<where>
<if test="scenicId!= null">and scenic_id = #{scenicId} </if>
<if test="scenicId!= null">and v.scenic_id = #{scenicId} </if>
<if test="memberId!= null">and member_id = #{memberId} </if>
<if test="templateId!= null">and template_id = #{templateId} </if>
<if test="taskId!=null">