You've already forked FrameTour-BE
Merge remote-tracking branch 'origin/master'
# Conflicts: # src/main/java/com/ycwl/basic/service/impl/pc/OrderServiceImpl.java # src/main/java/com/ycwl/basic/service/pc/OrderService.java
This commit is contained in:
@ -0,0 +1,50 @@
|
||||
package com.ycwl.basic.controller.mobile;
|
||||
|
||||
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.source.resp.SourceRespVO;
|
||||
import com.ycwl.basic.service.mobile.GoodsService;
|
||||
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 java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/5 14:49
|
||||
* 成片(video)和源素材(source)都可作为商品,订单中可购买多个
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/mobile/goods/v1")
|
||||
@Api(tags = "商品相关接口")
|
||||
public class AppGoodsController {
|
||||
|
||||
@Autowired
|
||||
private GoodsService goodsService;
|
||||
|
||||
@ApiOperation("商品列表")
|
||||
@PostMapping("/goodsList")
|
||||
public ApiResponse<List<GoodsVO>> goodsList(@RequestBody GoodsReqQuery query) {
|
||||
return goodsService.goodsList(query);
|
||||
}
|
||||
|
||||
@ApiOperation("源素材(原片/照片)商品列表")
|
||||
@PostMapping("/sourceGoodsList")
|
||||
public ApiResponse<List<SourceRespVO>> sourceGoodsList(@RequestBody GoodsReqQuery query) {
|
||||
return goodsService.sourceGoodsList(query);
|
||||
}
|
||||
|
||||
@ApiOperation("查询价格")
|
||||
@PostMapping("/queryPrice")
|
||||
public ApiResponse queryPrice(@RequestBody GoodsPriceQueryReq queryPriceData) {
|
||||
//TODO 处理购买逻辑
|
||||
return goodsService.queryPrice(queryPriceData);
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.ycwl.basic.controller.mobile;
|
||||
|
||||
import com.ycwl.basic.annotation.IgnoreToken;
|
||||
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;
|
||||
@ -9,6 +10,8 @@ import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/4 17:16
|
||||
@ -23,14 +26,17 @@ public class AppOrderController {
|
||||
|
||||
@ApiOperation("用户端订单列表查询")
|
||||
@PostMapping("/page")
|
||||
@IgnoreToken
|
||||
public ApiResponse pageQuery(@RequestBody OrderReqQuery orderReqQuery) {
|
||||
//TODO 添加用户openid查询条件,仅查询当前用户自己的订单
|
||||
return orderService.pageQuery(orderReqQuery);
|
||||
|
||||
return orderService.appPageQuery(orderReqQuery);
|
||||
}
|
||||
@ApiOperation("用户端订单详情查询")
|
||||
@GetMapping("getOrderDetails/{id}")
|
||||
@IgnoreToken
|
||||
public ApiResponse getOrderDetails(@PathVariable("id") Long id) {
|
||||
return orderService.detail(id);
|
||||
return orderService.appDetail(id);
|
||||
}
|
||||
|
||||
@ApiOperation("用户端订单新增")
|
||||
@ -46,4 +52,14 @@ public class AppOrderController {
|
||||
//TODO 处理购买逻辑
|
||||
return ApiResponse.success("");
|
||||
}
|
||||
|
||||
@ApiOperation("获取用户订单数量")
|
||||
@GetMapping("/getUserOrderCount")
|
||||
public ApiResponse getUserOrderCount() {
|
||||
//TODO 获取用户信息
|
||||
Long userId = 1L;
|
||||
|
||||
return orderService.getOrderCountByUserId(userId);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
package com.ycwl.basic.mapper.pc;
|
||||
|
||||
import com.ycwl.basic.model.pc.order.entity.OrderEntity;
|
||||
import com.ycwl.basic.model.pc.order.entity.OrderItemEntity;
|
||||
import com.ycwl.basic.model.pc.order.req.OrderAddOrUpdateReq;
|
||||
import com.ycwl.basic.model.pc.order.req.OrderReqQuery;
|
||||
import com.ycwl.basic.model.pc.order.resp.OrderAppRespVO;
|
||||
import com.ycwl.basic.model.pc.order.resp.OrderRespVO;
|
||||
import com.ycwl.basic.utils.ApiResponse;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
@ -29,4 +30,9 @@ public interface OrderMapper {
|
||||
*/
|
||||
int addOrderItems(List<OrderItemEntity> orderItems);
|
||||
|
||||
ApiResponse getOrderCount(OrderReqQuery query);
|
||||
|
||||
List<OrderAppRespVO> appList(OrderReqQuery orderReqQuery);
|
||||
|
||||
OrderAppRespVO appDetail(Long id);
|
||||
}
|
||||
|
@ -19,4 +19,11 @@ public interface SourceMapper {
|
||||
int add(SourceEntity source);
|
||||
int deleteById(Long id);
|
||||
int update(SourceEntity source);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param sourceReqQuery
|
||||
* @return
|
||||
*/
|
||||
List<SourceRespVO> listGroupByType(SourceReqQuery sourceReqQuery);
|
||||
}
|
||||
|
@ -0,0 +1,20 @@
|
||||
package com.ycwl.basic.model.mobile.goods;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/5 16:35
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("查询商品价格请求参数")
|
||||
public class GoodsPriceQueryReq {
|
||||
@ApiModelProperty("景区id")
|
||||
private Long scenicId;
|
||||
@ApiModelProperty("商品类型 1:成片vlog 2:源素材")
|
||||
private Integer goodsType;
|
||||
@ApiModelProperty("商品id goodsType=1时才有值")
|
||||
private Long goodsId;
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.ycwl.basic.model.mobile.goods;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/5 15:40
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "商品查询对象")
|
||||
public class GoodsReqQuery {
|
||||
@ApiModelProperty("是否已购买 0否 1是")
|
||||
private Integer isBuy;
|
||||
@ApiModelProperty("用户id")
|
||||
private Long memberId;
|
||||
@ApiModelProperty("景区id")
|
||||
private Long scenicId;
|
||||
@ApiModelProperty("源素材商品类型 1视频 2图像")
|
||||
private Integer sourceType;
|
||||
}
|
37
src/main/java/com/ycwl/basic/model/mobile/goods/GoodsVO.java
Normal file
37
src/main/java/com/ycwl/basic/model/mobile/goods/GoodsVO.java
Normal file
@ -0,0 +1,37 @@
|
||||
package com.ycwl.basic.model.mobile.goods;
|
||||
|
||||
import com.ycwl.basic.model.pc.source.resp.SourceRespVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/5 15:10
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("商品")
|
||||
public class GoodsVO {
|
||||
@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时才有值")
|
||||
private Long goodsId;
|
||||
@ApiModelProperty("视频链接 goodsType为1时才有值")
|
||||
private String videoUrl;
|
||||
}
|
@ -19,11 +19,11 @@ public class OrderItemEntity {
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 商品类型,0其他,1成片,2原片,3模板成片
|
||||
* 商品类型,0其他,1成片,,2源素材
|
||||
*/
|
||||
private Integer goodsType;
|
||||
/**
|
||||
* 商品ID,goods_type=1关联video.id,=2关联source.id,=3关联template.id
|
||||
* 商品ID,goods_type=1关联video.id,=2关联source.id
|
||||
*/
|
||||
private Long goodsId;
|
||||
|
||||
|
@ -18,13 +18,13 @@ public class OrderItemDTO {
|
||||
@ApiModelProperty("订单id")
|
||||
private Long orderId;
|
||||
/**
|
||||
* 商品类型,0其他,1成片,2原片,3模板成片
|
||||
* 商品类型,0其他,1成片,2原片
|
||||
*/
|
||||
@ApiModelProperty("商品类型,0其他,1成片,2原片,3模板成片")
|
||||
@ApiModelProperty("商品类型,0其他,1成片,,2源素材")
|
||||
private Integer goodsType;
|
||||
/**
|
||||
* 商品ID,goods_type=1关联video.id,=2关联source.id,=3关联template.id
|
||||
* 商品ID,goods_type=1关联video.id,=2关联source.id
|
||||
*/
|
||||
@ApiModelProperty("商品ID,goods_type=1关联video.id,=2关联source.id,=3关联template.id")
|
||||
@ApiModelProperty("商品ID,goods_type=1关联video.id,=2关联source.id")
|
||||
private Long goodsId;
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import java.util.Date;
|
||||
@Data
|
||||
@ApiModel(value = "订单查询对象")
|
||||
public class OrderReqQuery extends BaseQueryParameterReq {
|
||||
private Long memberId;
|
||||
@ApiModelProperty("用户昵称")
|
||||
private String memberNickname;
|
||||
@ApiModelProperty("用户真实名称")
|
||||
|
@ -0,0 +1,88 @@
|
||||
package com.ycwl.basic.model.pc.order.resp;
|
||||
|
||||
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;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/11/29 15:59
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("移动端订单信息响应类")
|
||||
public class OrderAppRespVO {
|
||||
private Long id;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
@ApiModelProperty("价格")
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 实际支付价格
|
||||
*/
|
||||
@ApiModelProperty("实际支付价格")
|
||||
private BigDecimal payPrice;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
/**
|
||||
* 退款原因
|
||||
*/
|
||||
@ApiModelProperty("退款原因")
|
||||
private String refundReason;
|
||||
/**
|
||||
* 退款状态,0未提出,1已通过,2待审核
|
||||
*/
|
||||
@ApiModelProperty("退款状态,0未提出,1已通过,2待审核")
|
||||
private Integer refundStatus;
|
||||
/**
|
||||
* 状态,0未支付,1已支付,2已退款,9已取消
|
||||
*/
|
||||
@ApiModelProperty("状态,0未支付,1已支付,2已退款,9已取消")
|
||||
private Integer status;
|
||||
/**
|
||||
* 订单创建时间
|
||||
*/
|
||||
@ApiModelProperty("订单创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createAt;
|
||||
/**
|
||||
* 订单更新时间
|
||||
*/
|
||||
@ApiModelProperty("订单更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date updateAt;
|
||||
/**
|
||||
* 订单支付时间
|
||||
*/
|
||||
@ApiModelProperty("订单支付时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date payAt;
|
||||
/**
|
||||
* 订单取消时间
|
||||
*/
|
||||
@ApiModelProperty("订单取消时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date cancelAt;
|
||||
/**
|
||||
* 订单退款时间
|
||||
*/
|
||||
@ApiModelProperty("订单退款时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date refundAt;
|
||||
@ApiModelProperty("景区名称")
|
||||
private String scenicName;
|
||||
@ApiModelProperty("商品名称")
|
||||
private String goodsName;
|
||||
@ApiModelProperty("拍摄时间")
|
||||
private Date shootingTime;
|
||||
@ApiModelProperty("订单明细")
|
||||
private List<OrderItemVO> orderItemList;
|
||||
}
|
@ -22,11 +22,21 @@ public class OrderItemVO {
|
||||
/**
|
||||
* 商品类型,0其他,1成片,2原片,3模板成片
|
||||
*/
|
||||
@ApiModelProperty("商品类型,0其他,1成片,2原片,3模板成片")
|
||||
@ApiModelProperty("商品类型,0其他,1成片,2源素材")
|
||||
private Integer goodsType;
|
||||
/**
|
||||
* 商品ID,goods_type=1关联video.id,=2关联source.id,=3关联template.id
|
||||
*/
|
||||
@ApiModelProperty("商品ID,goods_type=1关联video.id,=2关联source.id,=3关联template.id")
|
||||
@ApiModelProperty("商品ID,goods_type=1关联video.id,=2关联source.id")
|
||||
private Long goodsId;
|
||||
@ApiModelProperty("景区名称")
|
||||
private String scenicName;
|
||||
@ApiModelProperty("商品名称 模版名称/原片x个/照片x个")
|
||||
private String goodsName;
|
||||
@ApiModelProperty("视频链接")
|
||||
private String videoUrl;
|
||||
@ApiModelProperty("图片存储地址")
|
||||
private String imgUrl;
|
||||
@ApiModelProperty("原素材类型:1视频,2图像")
|
||||
private Integer sourceType;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.ycwl.basic.model.pc.scenic.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -59,4 +60,8 @@ public class ScenicEntity {
|
||||
private String status;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 景区源素材价格,元
|
||||
*/
|
||||
private BigDecimal price;
|
||||
}
|
||||
|
@ -73,4 +73,6 @@ public class ScenicAddOrUpdateReq {
|
||||
private Date updateTime;
|
||||
@ApiModelProperty("景区配置")
|
||||
private ScenicConfigEntity scenicConfig;
|
||||
@ApiModelProperty("景区源素材价格,元")
|
||||
private BigDecimal price;
|
||||
}
|
||||
|
@ -74,4 +74,6 @@ public class ScenicRespVO {
|
||||
private Date updateTime;
|
||||
@ApiModelProperty("景区配置")
|
||||
private ScenicConfigEntity scenicConfig;
|
||||
@ApiModelProperty("景区源素材价格,元")
|
||||
private BigDecimal price;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.ycwl.basic.model.pc.source.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -29,10 +30,22 @@ public class SourceEntity {
|
||||
* 所属用户
|
||||
*/
|
||||
private Long memberId;
|
||||
/**
|
||||
* 原素材类型:1视频,2图像
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 文件存储地址
|
||||
*/
|
||||
private String url;
|
||||
/**
|
||||
* 视频文件存储地址
|
||||
*/
|
||||
private String videoUrl;
|
||||
/**
|
||||
* 是否被购买 0未购买 1已购买
|
||||
*/
|
||||
private Integer isBuy;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
}
|
||||
|
@ -35,11 +35,15 @@ public class SourceReqQuery extends BaseQueryParameterReq {
|
||||
*/
|
||||
@ApiModelProperty("所属用户")
|
||||
private Long memberId;
|
||||
@ApiModelProperty("原素材类型:1视频,2图像")
|
||||
private Integer type;
|
||||
/**
|
||||
* 文件存储地址
|
||||
*/
|
||||
@ApiModelProperty("文件存储地址")
|
||||
private String url;
|
||||
@ApiModelProperty("是否被购买:0未购买,1已购买")
|
||||
private Integer isBuy;
|
||||
private Date startTime;
|
||||
private Date endTime;
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@ -25,6 +26,10 @@ public class SourceRespVO {
|
||||
private Long scenicId;
|
||||
@ApiModelProperty("景区名称")
|
||||
private String scenicName;
|
||||
@ApiModelProperty("经度")
|
||||
private BigDecimal longitude;
|
||||
@ApiModelProperty("纬度")
|
||||
private BigDecimal latitude;
|
||||
/**
|
||||
* 来源设备id
|
||||
*/
|
||||
@ -35,11 +40,15 @@ public class SourceRespVO {
|
||||
*/
|
||||
@ApiModelProperty("所属用户")
|
||||
private Long memberId;
|
||||
@ApiModelProperty("原素材类型:1视频,2图像")
|
||||
private Integer type;
|
||||
/**
|
||||
* 文件存储地址
|
||||
*/
|
||||
@ApiModelProperty("文件存储地址")
|
||||
@ApiModelProperty("图片文件存储地址")
|
||||
private String url;
|
||||
@ApiModelProperty("视频文件存储地址")
|
||||
private String videoUrl;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
|
@ -2,6 +2,7 @@ package com.ycwl.basic.model.pc.video.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
@ -40,6 +41,10 @@ public class VideoEntity {
|
||||
* 视频链接
|
||||
*/
|
||||
private String videoUrl;
|
||||
/**
|
||||
* 是否购买 1是 0否
|
||||
*/
|
||||
private Integer isBuy;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
}
|
||||
|
@ -47,6 +47,8 @@ public class VideoReqQuery extends BaseQueryParameterReq {
|
||||
*/
|
||||
@ApiModelProperty("视频链接")
|
||||
private String videoUrl;
|
||||
@ApiModelProperty("是否购买 1是 0否")
|
||||
private Integer isBuy;
|
||||
private Date startTime;
|
||||
private Date endTime;
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@ -23,6 +24,8 @@ public class VideoRespVO {
|
||||
*/
|
||||
@ApiModelProperty("景区id")
|
||||
private Long scenicId;
|
||||
@ApiModelProperty("景区名称")
|
||||
private String scenicName;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ -33,6 +36,14 @@ public class VideoRespVO {
|
||||
*/
|
||||
@ApiModelProperty("模版id")
|
||||
private Long templateId;
|
||||
@ApiModelProperty("模版名称")
|
||||
private String templateName;
|
||||
@ApiModelProperty("模版价格")
|
||||
private BigDecimal tmplatePrice;
|
||||
@ApiModelProperty("经度")
|
||||
private BigDecimal longitude;
|
||||
@ApiModelProperty("纬度")
|
||||
private BigDecimal latitude;
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
@ -48,6 +59,8 @@ public class VideoRespVO {
|
||||
*/
|
||||
@ApiModelProperty("视频链接")
|
||||
private String videoUrl;
|
||||
@ApiModelProperty("是否购买 1是 0否")
|
||||
private Integer isBuy;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
|
@ -0,0 +1,130 @@
|
||||
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;
|
||||
import com.ycwl.basic.model.pc.video.req.VideoReqQuery;
|
||||
import com.ycwl.basic.model.pc.video.resp.VideoRespVO;
|
||||
import com.ycwl.basic.service.mobile.GoodsService;
|
||||
import com.ycwl.basic.utils.ApiResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/5 15:04
|
||||
*/@Service
|
||||
public class GoodsServiceImpl implements GoodsService {
|
||||
@Autowired
|
||||
private VideoMapper videoMapper;
|
||||
@Autowired
|
||||
private SourceMapper sourceMapper;
|
||||
@Autowired
|
||||
private ScenicMapper scenicMapper;
|
||||
|
||||
public ApiResponse<List<GoodsVO>> goodsList(GoodsReqQuery query) {
|
||||
//查询原素材
|
||||
List<GoodsVO> goodsList = new ArrayList<>();
|
||||
|
||||
VideoReqQuery videoReqQuery = new VideoReqQuery();
|
||||
videoReqQuery.setScenicId(query.getScenicId());
|
||||
videoReqQuery.setIsBuy(query.getIsBuy());
|
||||
videoReqQuery.setMemberId(query.getMemberId());
|
||||
//查询成片vlog
|
||||
List<VideoRespVO> videoList = videoMapper.list(videoReqQuery);
|
||||
videoList.forEach(videoRespVO -> {
|
||||
GoodsVO goodsVO = new GoodsVO();
|
||||
goodsVO.setGoodsName(videoRespVO.getTemplateName());
|
||||
goodsVO.setScenicId(videoRespVO.getScenicId());
|
||||
goodsVO.setScenicName(videoRespVO.getScenicName());
|
||||
goodsVO.setLongitude(videoRespVO.getLongitude());
|
||||
goodsVO.setLatitude(videoRespVO.getLatitude());
|
||||
goodsVO.setGoodsType(1);
|
||||
goodsVO.setGoodsId(videoRespVO.getId());
|
||||
goodsVO.setVideoUrl(videoRespVO.getVideoUrl());
|
||||
goodsList.add(goodsVO);
|
||||
});
|
||||
|
||||
|
||||
SourceReqQuery sourceReqQuery = new SourceReqQuery();
|
||||
videoReqQuery.setScenicId(query.getScenicId());
|
||||
videoReqQuery.setIsBuy(query.getIsBuy());
|
||||
videoReqQuery.setMemberId(query.getMemberId());
|
||||
//查询源素材
|
||||
List<SourceRespVO> sourceList = sourceMapper.listGroupByType(sourceReqQuery);
|
||||
sourceList.forEach(sourceRespVO -> {
|
||||
GoodsVO goodsVO = new GoodsVO();
|
||||
Integer type = sourceRespVO.getType();
|
||||
if(type==1){
|
||||
goodsVO.setGoodsName("原片集");
|
||||
}else {
|
||||
goodsVO.setGoodsName("照片集");
|
||||
}
|
||||
goodsVO.setScenicId(sourceRespVO.getScenicId());
|
||||
goodsVO.setScenicName(sourceRespVO.getScenicName());
|
||||
goodsVO.setLongitude(sourceRespVO.getLongitude());
|
||||
goodsVO.setLatitude(sourceRespVO.getLatitude());
|
||||
goodsVO.setGoodsType(2);
|
||||
goodsVO.setSourceType(type);
|
||||
goodsList.add(goodsVO);
|
||||
});
|
||||
|
||||
return ApiResponse.success(goodsList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse<List<SourceRespVO>> sourceGoodsList(GoodsReqQuery query) {
|
||||
SourceReqQuery sourceReqQuery = new SourceReqQuery();
|
||||
sourceReqQuery.setScenicId(query.getScenicId());
|
||||
sourceReqQuery.setIsBuy(query.getIsBuy());
|
||||
sourceReqQuery.setMemberId(query.getMemberId());
|
||||
sourceReqQuery.setType(query.getSourceType());
|
||||
List<SourceRespVO> list = sourceMapper.list(sourceReqQuery);
|
||||
return ApiResponse.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse queryPrice(GoodsPriceQueryReq queryPriceData) {
|
||||
Integer goodsType = queryPriceData.getGoodsType();
|
||||
|
||||
if(goodsType==1){//成片vlog
|
||||
//成片的价格就是成片所用template的价格
|
||||
Long videoId = queryPriceData.getGoodsId();
|
||||
VideoRespVO videoRespVO = videoMapper.getById(videoId);
|
||||
if(videoRespVO==null){
|
||||
return ApiResponse.fail("该vlog不存在或已失效");
|
||||
}
|
||||
BigDecimal tmplatePrice = videoRespVO.getTmplatePrice();
|
||||
if(tmplatePrice==null){
|
||||
return ApiResponse.fail("该vlog使用的模板价格或状态异常,请联系管理员");
|
||||
}
|
||||
return ApiResponse.success(tmplatePrice);
|
||||
|
||||
}else if(goodsType==2){//原素材
|
||||
//原素材的价格就是原素材对应景区定的价格
|
||||
Long scenicId = queryPriceData.getScenicId();
|
||||
ScenicRespVO scenicRespVO = scenicMapper.getById(scenicId);
|
||||
if(scenicRespVO==null){
|
||||
return ApiResponse.fail("该景区不存在或状态异常,请联系管理员");
|
||||
}
|
||||
BigDecimal price = scenicRespVO.getPrice();
|
||||
if(price==null){
|
||||
return ApiResponse.fail("该景区的原片价格未设定或状态异常,请联系管理员");
|
||||
}
|
||||
return ApiResponse.success(price);
|
||||
}
|
||||
return ApiResponse.fail("不合法的商品,请联系管理员");
|
||||
}
|
||||
}
|
@ -10,6 +10,8 @@ import com.ycwl.basic.model.pc.order.entity.OrderItemEntity;
|
||||
import com.ycwl.basic.model.pc.order.req.OrderAddOrUpdateReq;
|
||||
import com.ycwl.basic.model.pc.order.req.OrderItemDTO;
|
||||
import com.ycwl.basic.model.pc.order.req.OrderReqQuery;
|
||||
import com.ycwl.basic.model.pc.order.resp.OrderAppRespVO;
|
||||
import com.ycwl.basic.model.pc.order.resp.OrderItemVO;
|
||||
import com.ycwl.basic.model.pc.order.resp.OrderRespVO;
|
||||
import com.ycwl.basic.service.pc.OrderService;
|
||||
import com.ycwl.basic.utils.ApiResponse;
|
||||
@ -109,4 +111,40 @@ public class OrderServiceImpl implements OrderService {
|
||||
}
|
||||
orderMapper.update(orderAddOrUpdateReq);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse getOrderCountByUserId(Long userId) {
|
||||
OrderReqQuery query = new OrderReqQuery();
|
||||
query.setMemberId(userId);
|
||||
return orderMapper.getOrderCount(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse<PageInfo<OrderAppRespVO>> appPageQuery(OrderReqQuery orderReqQuery) {
|
||||
PageHelper.startPage(orderReqQuery.getPageNum(), orderReqQuery.getPageSize());
|
||||
List<OrderAppRespVO> list = orderMapper.appList(orderReqQuery);
|
||||
for (OrderAppRespVO appRespVO : list) {
|
||||
List<OrderItemVO> orderItemList = appRespVO.getOrderItemList();
|
||||
if(orderItemList!= null && orderItemList.size() > 0){
|
||||
OrderItemVO itemVO = orderItemList.get(0);
|
||||
appRespVO.setScenicName(itemVO.getScenicName());
|
||||
appRespVO.setGoodsName(itemVO.getGoodsName());
|
||||
}
|
||||
}
|
||||
PageInfo<OrderAppRespVO> pageInfo = new PageInfo<>(list);
|
||||
return ApiResponse.success(pageInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse<OrderAppRespVO> appDetail(Long id) {
|
||||
OrderAppRespVO orderAppRespVO=orderMapper.appDetail(id);
|
||||
List<OrderItemVO> orderItemList = orderAppRespVO.getOrderItemList();
|
||||
if(orderItemList!= null && orderItemList.size() > 0){
|
||||
OrderItemVO itemVO = orderItemList.get(0);
|
||||
orderAppRespVO.setScenicName(itemVO.getScenicName());
|
||||
orderAppRespVO.setGoodsName(itemVO.getGoodsName());
|
||||
}
|
||||
return ApiResponse.success(orderAppRespVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,37 @@
|
||||
package com.ycwl.basic.service.mobile;
|
||||
|
||||
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.source.resp.SourceRespVO;
|
||||
import com.ycwl.basic.utils.ApiResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/5 15:03
|
||||
*/
|
||||
public interface GoodsService {
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
* @param query 查询条件
|
||||
* @return
|
||||
*/
|
||||
ApiResponse<List<GoodsVO>> goodsList(GoodsReqQuery query);
|
||||
|
||||
/**
|
||||
* 查询源素材商品列表
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
ApiResponse<List<SourceRespVO>> sourceGoodsList(GoodsReqQuery query);
|
||||
|
||||
/**
|
||||
* 查询订单应付价格
|
||||
* @param queryPriceData
|
||||
* @return
|
||||
*/
|
||||
ApiResponse queryPrice(GoodsPriceQueryReq queryPriceData);
|
||||
}
|
@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo;
|
||||
import com.ycwl.basic.enums.OrderStateEnum;
|
||||
import com.ycwl.basic.model.pc.order.req.OrderAddOrUpdateReq;
|
||||
import com.ycwl.basic.model.pc.order.req.OrderReqQuery;
|
||||
import com.ycwl.basic.model.pc.order.resp.OrderAppRespVO;
|
||||
import com.ycwl.basic.model.pc.order.resp.OrderRespVO;
|
||||
import com.ycwl.basic.utils.ApiResponse;
|
||||
|
||||
@ -22,4 +23,12 @@ public interface OrderService {
|
||||
|
||||
|
||||
void updateOrderState(Long orderSn, OrderStateEnum orderStateEnum, String refundReason);
|
||||
|
||||
ApiResponse getOrderCountByUserId(Long userId);
|
||||
|
||||
ApiResponse<PageInfo<OrderAppRespVO>> appPageQuery(OrderReqQuery orderReqQuery);
|
||||
|
||||
ApiResponse<OrderAppRespVO> appDetail(Long id);
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user