You've already forked FrameTour-BE
修改bug,添加数据统计相关类
This commit is contained in:
@ -40,6 +40,7 @@ AppFaceController {
|
||||
return faceService.faceUPload(file,scenicId);
|
||||
}
|
||||
|
||||
@ApiOperation("查询人脸照片信息")
|
||||
@GetMapping("/getFaceData")
|
||||
public ApiResponse<FaceRespVO> getFaceData() {
|
||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||
|
@ -54,9 +54,9 @@ public class AppGoodsController {
|
||||
/**
|
||||
* 查询用户当前景区的视频合成任务状态
|
||||
* @param scenicId 景区id
|
||||
* @return 1 合成中 2 合成成功
|
||||
* @return 0没有任务 1 合成中 2 合成成功
|
||||
*/
|
||||
@ApiOperation("查询用户当前景区的整体视频合成任务状态 1 合成中 2 合成成功 ")
|
||||
@ApiOperation("查询用户当前景区的整体视频合成任务状态 0没有任务 1 合成中 2 合成成功 ")
|
||||
@GetMapping("/getTaskStatus/{scenicId}")
|
||||
public ApiResponse<Integer> getAllTaskStatus(@PathVariable("scenicId") Long scenicId) {
|
||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||
|
@ -30,19 +30,19 @@ public class AppIndexController {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "首页景区列表", notes = "首页景区列表")
|
||||
@PostMapping("/scenicList")
|
||||
@IgnoreToken
|
||||
public ApiResponse<List<ScenicAppVO>> scenicList(@RequestBody ScenicIndexVO scenicIndexVO) {
|
||||
return scenicService.scenicList(scenicIndexVO);
|
||||
}
|
||||
// @ApiOperation(value = "首页景区列表", notes = "首页景区列表")
|
||||
// @PostMapping("/scenicList")
|
||||
// @IgnoreToken
|
||||
// public ApiResponse<List<ScenicAppVO>> scenicList(@RequestBody ScenicIndexVO scenicIndexVO) {
|
||||
// return scenicService.scenicList(scenicIndexVO);
|
||||
// }
|
||||
|
||||
@ApiOperation(value = "顶部状态", notes = "顶部状态")
|
||||
@GetMapping("/topState")
|
||||
@IgnoreToken
|
||||
public ApiResponse<TopStateResp> topState() {
|
||||
return scenicService.topState();
|
||||
}
|
||||
// @ApiOperation(value = "顶部状态", notes = "顶部状态")
|
||||
// @GetMapping("/topState")
|
||||
// @IgnoreToken
|
||||
// public ApiResponse<TopStateResp> topState() {
|
||||
// return scenicService.topState();
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,34 @@
|
||||
package com.ycwl.basic.controller.mobile;
|
||||
|
||||
import com.ycwl.basic.model.mobile.statistic.AppSta1VO;
|
||||
import com.ycwl.basic.model.mobile.statistic.CommonQueryReq;
|
||||
import com.ycwl.basic.service.mobile.AppStatisticsService;
|
||||
import com.ycwl.basic.utils.ApiResponse;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/11 18:08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/mobile/statistics/v1")
|
||||
@Api(tags = "数据统计相关接口")
|
||||
public class AppStatisticsController {
|
||||
|
||||
@Autowired
|
||||
private AppStatisticsService statisticsService;
|
||||
|
||||
@ApiOperation("支付订单金额、预览_支付转化率、扫码_付费用户转化率")
|
||||
@PostMapping("/one")
|
||||
public ApiResponse<AppSta1VO> oneStatistics(@RequestBody CommonQueryReq query) {
|
||||
|
||||
return statisticsService.oneStatistics(query);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package com.ycwl.basic.mapper;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/12 9:51
|
||||
*/
|
||||
public interface StatisticsMapper {
|
||||
}
|
@ -55,7 +55,7 @@ public interface ScenicMapper {
|
||||
|
||||
List<ScenicAppVO> appList(ScenicReqQuery scenicReqQuery);
|
||||
|
||||
ApiResponse<ScenicRespVO> getAppById(Long id);
|
||||
ScenicRespVO getAppById(Long id);
|
||||
|
||||
/**
|
||||
* 通过经纬度计算景区距离
|
||||
|
@ -40,7 +40,7 @@ public class VideoGoodsDetailVO {
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
@ApiModelProperty("价格")
|
||||
private BigDecimal price;
|
||||
private String price;
|
||||
@ApiModelProperty("是否已购买 0否 1是")
|
||||
private Integer isBuy;
|
||||
@ApiModelProperty("镜头数")
|
||||
|
@ -29,6 +29,8 @@ public class ScenicAppVO {
|
||||
*/
|
||||
@ApiModelProperty("景区介绍")
|
||||
private String introduction;
|
||||
@ApiModelProperty("封面图")
|
||||
private String coverUrl;
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
|
@ -31,4 +31,6 @@ public class ContentPageVO {
|
||||
private Long contentId;
|
||||
@ApiModelProperty("模版封面图片 contentType为0或1时才有值")
|
||||
private String templateCoverUrl;
|
||||
@ApiModelProperty("是否购买:0未购买,1已购买")
|
||||
private Integer isBuy;
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
package com.ycwl.basic.model.mobile.statistic;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/11 18:23
|
||||
*/
|
||||
@ApiModel("移动端订单金额、预览_支付转化率、扫码_付费用户转化率统计结果类")
|
||||
public class AppSta1VO {
|
||||
@ApiModelProperty("现在的数据 支付订单金额")
|
||||
private String nowOrderAmount;
|
||||
@ApiModelProperty("上一期的数据 支付订单金额")
|
||||
private String previousOrderAmount;
|
||||
@ApiModelProperty("现在的数据 预览_支付转化率")
|
||||
private String nowPreviewPay;
|
||||
@ApiModelProperty("上一期的数据 预览_支付转化率")
|
||||
private String previousPreviewPay;
|
||||
@ApiModelProperty("现在的数据 扫码_付费用户转化率")
|
||||
private String nowScanCodePay;
|
||||
@ApiModelProperty("上一期的数据 扫码_付费用户转化率")
|
||||
private String previousScanCodePay;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.ycwl.basic.model.mobile.statistic;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/11 19:03
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("移动端公用请求参数")
|
||||
public class CommonQueryReq {
|
||||
@ApiModelProperty(value = "查询统计纬度 0今天、1昨天、2-近一周(7天)、3-近30天、4-近1年")
|
||||
private Integer standard;
|
||||
private Date startTime;
|
||||
private Date endTime;
|
||||
}
|
@ -1,13 +1,11 @@
|
||||
package com.ycwl.basic.model.pc.order.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ycwl.basic.model.mobile.goods.GoodsDetailVO;
|
||||
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;
|
||||
|
||||
/**
|
||||
@ -25,7 +23,7 @@ public class OrderAddReq {
|
||||
* 微信openId
|
||||
*/
|
||||
@ApiModelProperty(value = "微信openId", hidden = true)
|
||||
private Long openId;
|
||||
private String openid;
|
||||
|
||||
@ApiModelProperty("景区id")
|
||||
private Long scenicId;
|
||||
@ -44,17 +42,17 @@ public class OrderAddReq {
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
// /**
|
||||
// * 推客id
|
||||
// */
|
||||
// @ApiModelProperty("推客id")
|
||||
// private Long brokerId;
|
||||
// /**
|
||||
// * 推客优惠码
|
||||
// */
|
||||
// @ApiModelProperty("推客优惠码")
|
||||
// private String promoCode;
|
||||
@ApiModelProperty("订单商品类型 1成片,2源素材")
|
||||
/**
|
||||
* 推客id
|
||||
*/
|
||||
@ApiModelProperty(value = "推客id",hidden = true)
|
||||
private Long brokerId;
|
||||
/**
|
||||
* 推客优惠码
|
||||
*/
|
||||
@ApiModelProperty(value="推客优惠码",hidden = true)
|
||||
private String promoCode;
|
||||
@ApiModelProperty(value = "订单商品类型 1成片,2源素材")
|
||||
private Integer goodsType;
|
||||
@ApiModelProperty("订单商品明细")
|
||||
private List<GoodsDetailVO> goodsItemList;
|
||||
|
@ -32,6 +32,8 @@ public class ScenicAddOrUpdateReq {
|
||||
*/
|
||||
@ApiModelProperty("景区介绍")
|
||||
private String introduction;
|
||||
@ApiModelProperty("封面图")
|
||||
private String coverUrl;
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
|
@ -38,6 +38,8 @@ public class ScenicRespVO {
|
||||
*/
|
||||
@ApiModelProperty("景区介绍")
|
||||
private String introduction;
|
||||
@ApiModelProperty("封面图")
|
||||
private String coverUrl;
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@ -86,4 +88,6 @@ public class ScenicRespVO {
|
||||
private ScenicConfigEntity scenicConfig;
|
||||
@ApiModelProperty("景区源素材价格,元")
|
||||
private BigDecimal price;
|
||||
@ApiModelProperty("镜头数")
|
||||
private Integer lensNum;
|
||||
}
|
||||
|
@ -51,4 +51,6 @@ public class SourceRespVO {
|
||||
private String videoUrl;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
@ApiModelProperty("是否购买:0未购买,1已购买")
|
||||
private Integer isBuy;
|
||||
}
|
||||
|
@ -79,7 +79,10 @@ public class AppScenicServiceImpl implements AppScenicService {
|
||||
|
||||
@Override
|
||||
public ApiResponse<ScenicRespVO> getDetails(Long id) {
|
||||
return scenicMapper.getAppById(id);
|
||||
ScenicRespVO scenicRespVO = scenicMapper.getAppById(id);
|
||||
ScenicDeviceCountVO scenicDeviceCountVO = deviceMapper.deviceCountByScenicId(id, -1L);
|
||||
scenicRespVO.setLensNum(scenicDeviceCountVO.getTotalDeviceCount());
|
||||
return ApiResponse.success(scenicRespVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -138,6 +141,7 @@ public class AppScenicServiceImpl implements AppScenicService {
|
||||
contentPageVO.setContentType(1);
|
||||
contentPageVO.setContentId(videoRespVO.getId());
|
||||
contentPageVO.setTemplateCoverUrl(videoRespVO.getTemplateCoverUrl());
|
||||
contentPageVO.setIsBuy(videoRespVO.getIsBuy());
|
||||
contentList.add(contentPageVO);
|
||||
videoMap.put(videoRespVO.getTemplateId(),"");
|
||||
});
|
||||
@ -172,6 +176,7 @@ public class AppScenicServiceImpl implements AppScenicService {
|
||||
}
|
||||
contentPageVO.setContentType(2);
|
||||
contentPageVO.setSourceType(type);
|
||||
contentPageVO.setIsBuy(sourceRespVO.getIsBuy());
|
||||
contentList.add(contentPageVO);
|
||||
});
|
||||
|
||||
|
@ -0,0 +1,25 @@
|
||||
package com.ycwl.basic.service.impl.mobile;
|
||||
|
||||
import com.ycwl.basic.model.mobile.statistic.AppSta1VO;
|
||||
import com.ycwl.basic.model.mobile.statistic.CommonQueryReq;
|
||||
import com.ycwl.basic.service.mobile.AppStatisticsService;
|
||||
import com.ycwl.basic.utils.ApiResponse;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/12 9:48
|
||||
*/
|
||||
@Service
|
||||
public class AppStatisticsServiceImpl implements AppStatisticsService {
|
||||
|
||||
/**
|
||||
* 支付订单金额、预览_支付转化率、扫码_付费用户转化率
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ApiResponse<AppSta1VO> oneStatistics(CommonQueryReq query) {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -18,6 +18,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -63,9 +65,9 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
|
||||
|
||||
SourceReqQuery sourceReqQuery = new SourceReqQuery();
|
||||
videoReqQuery.setScenicId(query.getScenicId());
|
||||
videoReqQuery.setIsBuy(query.getIsBuy());
|
||||
videoReqQuery.setMemberId(query.getMemberId());
|
||||
sourceReqQuery.setScenicId(query.getScenicId());
|
||||
sourceReqQuery.setIsBuy(query.getIsBuy());
|
||||
sourceReqQuery.setMemberId(query.getMemberId());
|
||||
//查询源素材
|
||||
List<SourceRespVO> sourceList = sourceMapper.listGroupByType(sourceReqQuery);
|
||||
sourceList.forEach(sourceRespVO -> {
|
||||
@ -111,6 +113,7 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
int i=1;
|
||||
for (SourceRespVO sourceRespVO : list) {
|
||||
GoodsDetailVO goodsDetailVO = new GoodsDetailVO();
|
||||
goodsDetailVO.setGoodsId(sourceRespVO.getId());
|
||||
String shootingTime = DateUtils.format(sourceRespVO.getCreateTime(), "yyyy.MM.dd HH:mm:ss");
|
||||
if(i<10){
|
||||
goodsDetailVO.setGoodsName(goodsNamePrefix +"0"+i+" "+shootingTime);
|
||||
@ -127,6 +130,7 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
goodsDetailVO.setVideoUrl(sourceRespVO.getVideoUrl());
|
||||
goodsDetailVO.setUrl(sourceRespVO.getUrl());
|
||||
goodsDetailVO.setCreateTime(sourceRespVO.getCreateTime());
|
||||
|
||||
goodsDetailVOList.add(goodsDetailVO);
|
||||
i++;
|
||||
}
|
||||
@ -185,7 +189,9 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
goodsDetailVO.setTemplateCoverUrl(videoRespVO.getTemplateCoverUrl());
|
||||
goodsDetailVO.setCreateTime(videoRespVO.getCreateTime());
|
||||
BigDecimal templatePrice = videoRespVO.getTemplatePrice();
|
||||
goodsDetailVO.setPrice(templatePrice==null ? null : templatePrice.setScale(2));
|
||||
// 使用DecimalFormat格式化输出
|
||||
DecimalFormat df = new DecimalFormat("0.00");
|
||||
goodsDetailVO.setPrice(templatePrice==null?"":df.format(templatePrice.setScale(2, RoundingMode.HALF_UP)));
|
||||
goodsDetailVO.setIsBuy(videoRespVO.getIsBuy());
|
||||
ScenicDeviceCountVO scenicDeviceCountVO = deviceMapper.deviceCountByScenicId(videoRespVO.getScenicId(), -1L);
|
||||
goodsDetailVO.setLensNum(scenicDeviceCountVO.getTotalDeviceCount());
|
||||
@ -195,18 +201,23 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
/**
|
||||
* 查询用户当前景区的视频合成任务状态
|
||||
* @param scenicId 景区id
|
||||
* @return 1 合成中 2 合成成功
|
||||
* @return 0没有任务 1 合成中 2 合成成功
|
||||
*/
|
||||
@Override
|
||||
public ApiResponse<Integer> getAllTaskStatus(Long userId, Long scenicId) {
|
||||
TaskReqQuery taskReqQuery = new TaskReqQuery();
|
||||
taskReqQuery.setMemberId(userId);
|
||||
taskReqQuery.setScenicId(scenicId);
|
||||
int allCount=taskMapper.countTask(taskReqQuery);
|
||||
if(allCount==0){//没有任务
|
||||
return ApiResponse.success(0);
|
||||
}
|
||||
taskReqQuery.setStatus(2);
|
||||
int count=taskMapper.countTask(taskReqQuery);
|
||||
if(count>0){
|
||||
|
||||
if(count>0){//有任务在进行中
|
||||
return ApiResponse.success(1);
|
||||
}else {
|
||||
}else {//没有任务在进行中
|
||||
return ApiResponse.success(2);
|
||||
}
|
||||
}
|
||||
@ -215,7 +226,11 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
public ApiResponse<Integer> getTemplateTaskStatus(Long userId, Long templateId) {
|
||||
TaskReqQuery taskReqQuery = new TaskReqQuery();
|
||||
taskReqQuery.setMemberId(userId);
|
||||
taskReqQuery.setScenicId(templateId);
|
||||
taskReqQuery.setTemplateId(templateId);
|
||||
int allCount=taskMapper.countTask(taskReqQuery);
|
||||
if(allCount==0){//没有任务
|
||||
return ApiResponse.success(0);
|
||||
}
|
||||
taskReqQuery.setStatus(2);
|
||||
int count=taskMapper.countTask(taskReqQuery);
|
||||
if(count>0){
|
||||
|
@ -9,10 +9,8 @@ import com.ycwl.basic.enums.GoodsTypeEnum;
|
||||
import com.ycwl.basic.enums.OrderStateEnum;
|
||||
import com.ycwl.basic.enums.SourceTypeNameEnum;
|
||||
import com.ycwl.basic.exception.AppException;
|
||||
import com.ycwl.basic.mapper.pc.OrderMapper;
|
||||
import com.ycwl.basic.mapper.pc.OrderOperationMapper;
|
||||
import com.ycwl.basic.mapper.pc.SourceMapper;
|
||||
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.order.OrderAppPageReq;
|
||||
@ -31,12 +29,12 @@ import com.ycwl.basic.model.pc.source.entity.SourceEntity;
|
||||
import com.ycwl.basic.model.pc.video.entity.VideoEntity;
|
||||
import com.ycwl.basic.model.wx.WXPayOrderReqVO;
|
||||
import com.ycwl.basic.model.wx.WxPayRespVO;
|
||||
import com.ycwl.basic.service.mobile.AppMemberService;
|
||||
import com.ycwl.basic.service.mobile.GoodsService;
|
||||
import com.ycwl.basic.service.mobile.WxPayService;
|
||||
import com.ycwl.basic.service.pc.OrderService;
|
||||
import com.ycwl.basic.utils.ApiResponse;
|
||||
import com.ycwl.basic.utils.BigDecimalUtil;
|
||||
import com.ycwl.basic.utils.JwtTokenUtil;
|
||||
import com.ycwl.basic.utils.SnowFlakeUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -67,7 +65,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
private WxPayService wxPayService;
|
||||
|
||||
@Autowired
|
||||
private AppMemberService memberService;
|
||||
private MemberMapper memberMapper;
|
||||
@Autowired
|
||||
private GoodsService goodsService;
|
||||
@Autowired
|
||||
@ -96,20 +94,35 @@ public class OrderServiceImpl implements OrderService {
|
||||
public ApiResponse<WxPayRespVO> add(OrderAddReq order) throws Exception {
|
||||
Long orderId = SnowFlakeUtil.getLongId();
|
||||
order.setId(orderId);
|
||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||
Long userId = worker.getUserId();
|
||||
MemberRespVO memberRespVO = memberMapper.getById(userId);
|
||||
order.setMemberId(userId);
|
||||
order.setOpenid(memberRespVO.getOpenId());
|
||||
|
||||
/* 成片的时候子订单只会有一个,素材的时候 子订单多个且价格与子订单数量无关,只与子订单商品对应景区定义的价格相同*/
|
||||
List<GoodsDetailVO> goodsItemList = order.getGoodsItemList();
|
||||
GoodsDetailVO goodsDetailVO = goodsItemList.get(NumberConstant.ZERO);
|
||||
GoodsPriceQueryReq goodsPriceQueryReq = new GoodsPriceQueryReq();
|
||||
goodsPriceQueryReq.setGoodsId(goodsDetailVO.getGoodsId());
|
||||
goodsPriceQueryReq.setGoodsType(order.getGoodsType());
|
||||
goodsPriceQueryReq.setScenicId(order.getScenicId());
|
||||
BigDecimal price = goodsService.queryPrice(goodsPriceQueryReq).getData();
|
||||
order.setPrice(price);
|
||||
order.setPayPrice(price);
|
||||
|
||||
int add = orderMapper.add(order);
|
||||
if (add == NumberConstant.ZERO) {
|
||||
return ApiResponse.fail("订单添加失败");
|
||||
} else {
|
||||
List<GoodsDetailVO> goodsItemList = order.getGoodsItemList();
|
||||
GoodsDetailVO goodsDetailVO = goodsItemList.get(NumberConstant.ZERO);
|
||||
Integer goodsType = goodsDetailVO.getGoodsType();
|
||||
Integer goodsType = order.getGoodsType();
|
||||
List<OrderItemEntity> orderItems = new ArrayList<>();
|
||||
goodsItemList.forEach(goodsDto -> {
|
||||
Long goodsId = goodsDto.getGoodsId();
|
||||
OrderItemEntity orderItemEntity = new OrderItemEntity();
|
||||
orderItemEntity.setId(SnowFlakeUtil.getLongId());
|
||||
orderItemEntity.setOrderId(orderId);
|
||||
orderItemEntity.setGoodsType(goodsDto.getGoodsType());
|
||||
orderItemEntity.setGoodsType(goodsType);
|
||||
orderItemEntity.setGoodsId(goodsId);
|
||||
orderItems.add(orderItemEntity);
|
||||
|
||||
@ -132,23 +145,22 @@ public class OrderServiceImpl implements OrderService {
|
||||
return ApiResponse.fail("订单添加失败");
|
||||
}
|
||||
|
||||
//封装微信支付请求
|
||||
WxPayRespVO wxPayRespVO = initiatePayment(orderId, goodsDetailVO);
|
||||
return ApiResponse.success(wxPayRespVO);
|
||||
//TODO 封装微信支付请求
|
||||
// WxPayRespVO wxPayRespVO = initiatePayment(order, goodsDetailVO);
|
||||
// return ApiResponse.success(wxPayRespVO);
|
||||
return ApiResponse.success(null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发起支付
|
||||
* @param orderId 订单id
|
||||
* @param order 订单
|
||||
* @param goodsDetailVO 商品详情
|
||||
* @return 支付请求结果
|
||||
*/
|
||||
private WxPayRespVO initiatePayment(Long orderId,GoodsDetailVO goodsDetailVO) throws Exception {
|
||||
private WxPayRespVO initiatePayment(OrderAddReq order,GoodsDetailVO goodsDetailVO) throws Exception {
|
||||
WXPayOrderReqVO wxPayOrderReqVO = new WXPayOrderReqVO();
|
||||
|
||||
Integer goodsType = goodsDetailVO.getGoodsType();
|
||||
Long goodsId = goodsDetailVO.getGoodsId();
|
||||
Integer goodsType = order.getGoodsType();
|
||||
|
||||
String goodsName = null;
|
||||
if (goodsType == NumberConstant.ONE) {
|
||||
@ -158,18 +170,9 @@ public class OrderServiceImpl implements OrderService {
|
||||
goodsName = SourceTypeNameEnum.getRemark(sourceType);
|
||||
}
|
||||
|
||||
/* 成片的时候子订单只会有一个,素材的时候 子订单多个且价格与子订单数量无关,只与子订单商品对应景区定义的价格相同*/
|
||||
GoodsPriceQueryReq goodsPriceQueryReq = new GoodsPriceQueryReq();
|
||||
goodsPriceQueryReq.setGoodsId(goodsId);
|
||||
goodsPriceQueryReq.setGoodsType(goodsType);
|
||||
goodsPriceQueryReq.setScenicId(goodsDetailVO.getScenicId());
|
||||
BigDecimal price = goodsService.queryPrice(goodsPriceQueryReq).getData();
|
||||
|
||||
MemberRespVO memberRespVO = memberService.getUserInfo().getData();
|
||||
|
||||
wxPayOrderReqVO.setOpenId(memberRespVO.getOpenId())
|
||||
.setOrderSn(orderId)
|
||||
.setTotalPrice(BigDecimalUtil.convertToCents(price))
|
||||
wxPayOrderReqVO.setOpenId(order.getOpenid())
|
||||
.setOrderSn(order.getId())
|
||||
.setTotalPrice(BigDecimalUtil.convertToCents(order.getPrice()))
|
||||
.setGoodsName(goodsName);
|
||||
|
||||
return wxPayService.createOrder(wxPayOrderReqVO);
|
||||
|
@ -0,0 +1,14 @@
|
||||
package com.ycwl.basic.service.mobile;
|
||||
|
||||
import com.ycwl.basic.model.mobile.statistic.AppSta1VO;
|
||||
import com.ycwl.basic.model.mobile.statistic.CommonQueryReq;
|
||||
import com.ycwl.basic.utils.ApiResponse;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/12 9:32
|
||||
*/
|
||||
|
||||
public interface AppStatisticsService {
|
||||
ApiResponse<AppSta1VO> oneStatistics(CommonQueryReq query);
|
||||
}
|
Reference in New Issue
Block a user