修改bug,添加数据统计相关类
This commit is contained in:
parent
18f7f8a943
commit
405b48d9d3
@ -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);
|
||||
}
|
@ -21,9 +21,9 @@
|
||||
<result column="cancel_at" property="cancelAt"/>
|
||||
<result column="create_at" property="createAt"/>
|
||||
<result column="update_at" property="updateAt"/>
|
||||
<collection property="orderItemList" ofType="com.ycwl.basic.model.pc.order.resp.OrderItemVO">
|
||||
<collection property="orderItemList" select="getOrderItemList" column="id" ofType="com.ycwl.basic.model.pc.order.resp.OrderItemVO">
|
||||
<result column="oiId" property="id"/>
|
||||
<result column="id" property="orderId"/>
|
||||
<result column="orderId" property="orderId"/>
|
||||
<result column="goods_id" property="goodsId"/>
|
||||
<result column="scenicName" property="scenicName"/>
|
||||
<result column="goodsName" property="goodsName"/>
|
||||
@ -58,7 +58,7 @@
|
||||
<result column="sourceType" property="sourceType"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
<select id="getOrderItemList" parameterType="java.lang.Integer" resultType="com.ycwl.basic.model.pc.order.resp.OrderItemVO">
|
||||
<select id="getOrderItemList" parameterType="java.lang.Long" resultType="com.ycwl.basic.model.pc.order.resp.OrderItemVO">
|
||||
select oi.id oiId,oi.order_id orderId,oi.goods_id,
|
||||
sc.name scenicName,t.cover_url coverUrl,
|
||||
if(oi.goods_type='1',t.name,(select count(1) from order_item oi2 where oi2.order_id=oi.order_id)) as goodsName,
|
||||
@ -120,8 +120,8 @@
|
||||
delete from `order` where id = #{id}
|
||||
</delete>
|
||||
<select id="list" resultMap="PCBaseResultMap">
|
||||
select o.id, o.member_id,m.nickname ,m.real_name , o.openid, o.price, pay_price, remark, o.broker_id, o.promo_code,
|
||||
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at,oi.id oiId, o.goods_type, oi.goods_id
|
||||
select distinct o.id, o.member_id,m.nickname ,m.real_name , o.openid, o.price, pay_price, remark, o.broker_id, o.promo_code,
|
||||
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at, o.goods_type
|
||||
from `order` AS o
|
||||
left join member m on o.member_id = m.id
|
||||
left join order_item oi on o.id = oi.order_id
|
||||
@ -204,10 +204,6 @@
|
||||
select count(1) num
|
||||
from `order` o
|
||||
left join member m on o.member_id = m.id
|
||||
left join order_item oi on o.id = oi.order_id
|
||||
left join template t on o.goods_type='3' and oi.goods_id = t.id
|
||||
left join source sr on o.goods_type='2' and oi.goods_id = sr.id
|
||||
left join video vd on o.goods_type='1' and oi.goods_id = vd.id
|
||||
<where>
|
||||
<if test="id!= null ">
|
||||
and o.id = #{id}
|
||||
|
@ -2,8 +2,8 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ycwl.basic.mapper.pc.ScenicMapper">
|
||||
<insert id="add">
|
||||
insert into scenic(id, `name`, introduction, longitude, latitude, radius, province, city, area, address)
|
||||
values (#{id}, #{name}, #{introduction}, #{longitude}, #{latitude}, #{radius}, #{province}, #{city}, #{area}, #{address})
|
||||
insert into scenic(id, `name`, introduction,cover_url, longitude, latitude, radius, province, city, area, address)
|
||||
values (#{id}, #{name}, #{introduction}, #{coverUrl},#{longitude}, #{latitude}, #{radius}, #{province}, #{city}, #{area}, #{address})
|
||||
</insert>
|
||||
<insert id="addConfig">
|
||||
insert into scenic_config(id, scenic_id, start_time, end_time, is_default)
|
||||
@ -22,6 +22,9 @@
|
||||
<if test="introduction!=null and introduction!=''">
|
||||
introduction=#{introduction},
|
||||
</if>
|
||||
<if test="coverUrl!=null and coverUrl!=''">
|
||||
cover_url=#{coverUrl},
|
||||
</if>
|
||||
<if test="longitude!=null">
|
||||
longitude=#{longitude},
|
||||
</if>
|
||||
@ -80,7 +83,7 @@
|
||||
delete from scenic_config where scenic_id = #{scenicId}
|
||||
</delete>
|
||||
<select id="list" resultMap="scenicAndConfig">
|
||||
select s.id, `name`, `phone`, introduction, longitude, latitude, radius, province, city, area, address, `status`, s.create_time, update_time,
|
||||
select s.id, `name`, `phone`, introduction,cover_url, longitude, latitude, radius, province, city, area, address, `status`, s.create_time, update_time,
|
||||
c.start_time, c.end_time,
|
||||
(select scenic_account.account from scenic_account where scenic_account.scenic_id = s.id and scenic_account.is_super = 1 limit 1) as account,
|
||||
c.is_default, c.create_time createTime2,s.price
|
||||
@ -111,14 +114,14 @@
|
||||
</where>
|
||||
</select>
|
||||
<select id="getById" resultMap="scenicAndConfig">
|
||||
select s.id, `name`, `phone`, introduction, longitude, latitude, radius, province, city, area, address, `status`, s.create_time, update_time,
|
||||
select s.id, `name`, `phone`, introduction,cover_url, longitude, latitude, radius, province, city, area, address, `status`, s.create_time, update_time,
|
||||
c.start_time, c.end_time, c.is_default, c.create_time createTime2,s.price
|
||||
from scenic s
|
||||
left join scenic_config c on s.id = c.id
|
||||
where s.id = #{id}
|
||||
</select>
|
||||
<select id="appList" resultType="com.ycwl.basic.model.mobile.scenic.ScenicAppVO">
|
||||
select s.id, `name`, `phone`, introduction, longitude, latitude, radius, province, city, area, address
|
||||
select s.id, `name`, `phone`, introduction,cover_url, longitude, latitude, radius, province, city, area, address
|
||||
from scenic s
|
||||
where
|
||||
`status` = 1
|
||||
@ -142,7 +145,7 @@
|
||||
</if>
|
||||
</select>
|
||||
<select id="getAppById" resultType="com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO">
|
||||
select s.id, `name`, `phone`, introduction, longitude, latitude, radius, province, city, area, address
|
||||
select s.id, `name`, `phone`, introduction,cover_url, longitude, latitude, radius, province, city, area, address
|
||||
from scenic s
|
||||
where `status` = 1 and s.id = #{id}
|
||||
</select>
|
||||
@ -151,6 +154,7 @@
|
||||
`name`,
|
||||
`phone`,
|
||||
introduction,
|
||||
cover_url,
|
||||
longitude,
|
||||
latitude,
|
||||
radius,
|
||||
@ -178,6 +182,7 @@
|
||||
<result property="phone" column="phone"/>
|
||||
<result property="account" column="account"/>
|
||||
<result property="introduction" column="introduction"/>
|
||||
<result property="coverUrl" column="cover_url"/>
|
||||
<result property="longitude" column="longitude"/>
|
||||
<result property="latitude" column="latitude"/>
|
||||
<result property="radius" column="radius"/>
|
||||
|
@ -11,6 +11,7 @@
|
||||
<if test="deviceId!= null">device_id = #{deviceId}, </if>
|
||||
<if test="memberId!= null">member_id = #{memberId}, </if>
|
||||
<if test="url!= null">url = #{url}, </if>
|
||||
<if test="isBuy!=null">is_buy = #{isBuy}, </if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -43,7 +44,7 @@
|
||||
where so.id = #{id}
|
||||
</select>
|
||||
<select id="listGroupByType" resultType="com.ycwl.basic.model.pc.source.resp.SourceRespVO">
|
||||
select so.id, scenic_id,sc.name scenicName, sc.longitude ,sc.latitude,so.type
|
||||
select so.id, scenic_id,sc.name scenicName, sc.longitude ,sc.latitude,so.type,so.is_buy
|
||||
from source so
|
||||
left join scenic sc on sc.id = so.scenic_id
|
||||
<where>
|
||||
|
4
src/main/resources/mapper/pc/StatisticsMapper.xml
Normal file
4
src/main/resources/mapper/pc/StatisticsMapper.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ycwl.basic.mapper.StatisticsMapper">
|
||||
</mapper>
|
@ -45,7 +45,7 @@
|
||||
delete from template where scenic_id = #{id}
|
||||
</delete>
|
||||
<select id="list" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
|
||||
select t.id, t.scenic_id, s.name as scenic_name, t.`name`, cover_url, t.status, t.create_time, t.update_time
|
||||
select t.id, t.scenic_id, s.name as scenic_name, t.`name`, t.cover_url, t.status, t.create_time, t.update_time
|
||||
from template t left join scenic s on s.id = t.scenic_id
|
||||
<where>
|
||||
<if test="pid!=null" >
|
||||
@ -62,12 +62,12 @@
|
||||
</where>
|
||||
</select>
|
||||
<select id="getById" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
|
||||
select t.id, t.scenic_id, s.name as scenic_name, t.`name`, pid, is_placeholder, source_url, luts, overlays, audios, frame_rate, speed, cover_url, t.status, t.create_time, t.update_time
|
||||
select t.id, t.scenic_id, s.name as scenic_name, t.`name`, pid, is_placeholder, source_url, luts, overlays, audios, frame_rate, speed, t.cover_url, t.status, t.create_time, t.update_time
|
||||
from template t left join scenic s on s.id = t.scenic_id
|
||||
where t.id = #{id}
|
||||
</select>
|
||||
<select id="getByPid" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
|
||||
select t.id, t.scenic_id, s.name as scenic_name, t.`name`, pid, is_placeholder, source_url, luts, overlays, audios, frame_rate, speed, cover_url, t.status, t.create_time, t.update_time
|
||||
select t.id, t.scenic_id, s.name as scenic_name, t.`name`, pid, is_placeholder, source_url, luts, overlays, audios, frame_rate, speed, t.cover_url, t.status, t.create_time, t.update_time
|
||||
from template t left join scenic s on s.id = t.scenic_id
|
||||
where pid = #{id}
|
||||
</select>
|
||||
|
@ -23,7 +23,7 @@
|
||||
</delete>
|
||||
<select id="list" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
|
||||
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
|
||||
s.name scenicName, s.latitude, s.longitude, t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl,v.is_buy
|
||||
from video v
|
||||
left join scenic s on s.id = v.scenic_id
|
||||
left join template t on v.template_id = t.id
|
||||
@ -44,7 +44,7 @@
|
||||
</select>
|
||||
<select id="getById" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
|
||||
select v.id, v.scenic_id, member_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
|
||||
t.name templateName,t.price templatePrice
|
||||
t.name templateName,t.price templatePrice,v.is_buy isBuy
|
||||
from video v
|
||||
left join template t on v.template_id = t.id
|
||||
where v.id = #{id}
|
||||
|
Loading…
x
Reference in New Issue
Block a user