订单详情添加人脸ID
This commit is contained in:
parent
d5cef538d1
commit
19e9d547fa
14
src/main/java/com/ycwl/basic/mapper/PaymentMapper.java
Normal file
14
src/main/java/com/ycwl/basic/mapper/PaymentMapper.java
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package com.ycwl.basic.mapper;
|
||||||
|
|
||||||
|
import com.ycwl.basic.model.pc.payment.entity.PaymentEntity;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface PaymentMapper {
|
||||||
|
Long addGetId(PaymentEntity entity);
|
||||||
|
PaymentEntity findByOutTradeNo(@Param("outTradeNo") String outTradeNo);
|
||||||
|
int update(PaymentEntity entity);
|
||||||
|
int setOutTradeNo(@Param("id") Long id, @Param("outTradeNo") String outTradeNo);
|
||||||
|
int setPaid(Long paymentId);
|
||||||
|
}
|
14
src/main/java/com/ycwl/basic/mapper/RefundMapper.java
Normal file
14
src/main/java/com/ycwl/basic/mapper/RefundMapper.java
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package com.ycwl.basic.mapper;
|
||||||
|
|
||||||
|
import com.ycwl.basic.model.pc.refund.entity.RefundEntity;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface RefundMapper {
|
||||||
|
Long addGetId(RefundEntity entity);
|
||||||
|
RefundEntity findByOutRefundNo(String outRefundNo);
|
||||||
|
int update(RefundEntity entity);
|
||||||
|
int setRefundNo(@Param("id") Long id, @Param("outRefundNo") String outRefundNo);
|
||||||
|
int setRefunded(Long id);
|
||||||
|
}
|
@ -29,6 +29,7 @@ public class OrderItemVO {
|
|||||||
*/
|
*/
|
||||||
@ApiModelProperty("商品ID,goods_type=1关联video.id,=2关联source.id")
|
@ApiModelProperty("商品ID,goods_type=1关联video.id,=2关联source.id")
|
||||||
private Long goodsId;
|
private Long goodsId;
|
||||||
|
private Long faceId;
|
||||||
@ApiModelProperty("景区名称")
|
@ApiModelProperty("景区名称")
|
||||||
private String scenicName;
|
private String scenicName;
|
||||||
@ApiModelProperty("商品名称 模版名称/原片x个/照片x个")
|
@ApiModelProperty("商品名称 模版名称/原片x个/照片x个")
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.ycwl.basic.model.pc.payment.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@TableName("payment")
|
||||||
|
@Data
|
||||||
|
public class PaymentEntity {
|
||||||
|
private Long id;
|
||||||
|
private Long memberId;
|
||||||
|
private Long orderId;
|
||||||
|
private String outOrderNo;
|
||||||
|
private BigDecimal payPrice;
|
||||||
|
private Date createTime;
|
||||||
|
private Date payTime;
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.ycwl.basic.model.pc.refund.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@TableName("refund")
|
||||||
|
@Data
|
||||||
|
public class RefundEntity {
|
||||||
|
private Long id;
|
||||||
|
private Long memberId;
|
||||||
|
private Long orderId;
|
||||||
|
private String outRefundNo;
|
||||||
|
private BigDecimal refundPrice;
|
||||||
|
private String reason;
|
||||||
|
private Date createTime;
|
||||||
|
private Date acceptTime;
|
||||||
|
}
|
@ -28,4 +28,6 @@ public class WXPayOrderReqVO {
|
|||||||
private Long orderSn;
|
private Long orderSn;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
private Long memberId;
|
||||||
}
|
}
|
||||||
|
@ -27,9 +27,11 @@ import com.ycwl.basic.enums.BizCodeEnum;
|
|||||||
import com.ycwl.basic.enums.OrderStateEnum;
|
import com.ycwl.basic.enums.OrderStateEnum;
|
||||||
import com.ycwl.basic.enums.StatisticEnum;
|
import com.ycwl.basic.enums.StatisticEnum;
|
||||||
import com.ycwl.basic.exception.AppException;
|
import com.ycwl.basic.exception.AppException;
|
||||||
|
import com.ycwl.basic.mapper.PaymentMapper;
|
||||||
import com.ycwl.basic.mapper.StatisticsMapper;
|
import com.ycwl.basic.mapper.StatisticsMapper;
|
||||||
import com.ycwl.basic.model.mobile.statistic.req.StatisticsRecordAddReq;
|
import com.ycwl.basic.model.mobile.statistic.req.StatisticsRecordAddReq;
|
||||||
import com.ycwl.basic.model.pc.order.resp.OrderRespVO;
|
import com.ycwl.basic.model.pc.order.resp.OrderRespVO;
|
||||||
|
import com.ycwl.basic.model.pc.payment.entity.PaymentEntity;
|
||||||
import com.ycwl.basic.model.wx.WXPayOrderReqVO;
|
import com.ycwl.basic.model.wx.WXPayOrderReqVO;
|
||||||
import com.ycwl.basic.model.wx.WxPayRespVO;
|
import com.ycwl.basic.model.wx.WxPayRespVO;
|
||||||
import com.ycwl.basic.model.wx.WxchatCallbackSuccessData;
|
import com.ycwl.basic.model.wx.WxchatCallbackSuccessData;
|
||||||
@ -55,6 +57,7 @@ import java.io.IOException;
|
|||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.math.BigInteger;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.security.*;
|
import java.security.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -82,10 +85,17 @@ public class WxPayServiceImpl implements WxPayService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private OrderService orderService;
|
private OrderService orderService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private PaymentMapper paymentMapper;
|
||||||
|
@Autowired
|
||||||
private StatisticsMapper statisticsMapper;
|
private StatisticsMapper statisticsMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WxPayRespVO createOrder(WXPayOrderReqVO req) {
|
public WxPayRespVO createOrder(WXPayOrderReqVO req) {
|
||||||
|
PaymentEntity entity = new PaymentEntity();
|
||||||
|
entity.setOrderId(req.getOrderSn());
|
||||||
|
entity.setMemberId(req.getMemberId());
|
||||||
|
entity.setPayPrice(new BigDecimal(BigInteger.valueOf(req.getTotalPrice()), 2));
|
||||||
|
Long entityId = paymentMapper.addGetId(entity);
|
||||||
try {
|
try {
|
||||||
// 使用自动更新平台证书的RSA配置
|
// 使用自动更新平台证书的RSA配置
|
||||||
Config config = getInstance(wechatConfig);
|
Config config = getInstance(wechatConfig);
|
||||||
@ -95,7 +105,7 @@ public class WxPayServiceImpl implements WxPayService {
|
|||||||
// request.setXxx(val)设置所需参数,具体参数可见Request定义
|
// request.setXxx(val)设置所需参数,具体参数可见Request定义
|
||||||
PrepayRequest request = new PrepayRequest();
|
PrepayRequest request = new PrepayRequest();
|
||||||
Amount amount = new Amount();
|
Amount amount = new Amount();
|
||||||
amount.setTotal(1);
|
amount.setTotal(req.getTotalPrice());
|
||||||
request.setAmount(amount);
|
request.setAmount(amount);
|
||||||
request.setAppid(wechatConfig.getMiniProgramAppId());
|
request.setAppid(wechatConfig.getMiniProgramAppId());
|
||||||
request.setMchid(wechatConfig.getMchId());
|
request.setMchid(wechatConfig.getMchId());
|
||||||
|
@ -183,6 +183,7 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
wxPayOrderReqVO.setOpenId(order.getOpenid())
|
wxPayOrderReqVO.setOpenId(order.getOpenid())
|
||||||
|
.setMemberId(order.getMemberId())
|
||||||
.setOrderSn(order.getId())
|
.setOrderSn(order.getId())
|
||||||
.setTotalPrice(BigDecimalUtil.convertToCents(order.getPrice()))
|
.setTotalPrice(BigDecimalUtil.convertToCents(order.getPrice()))
|
||||||
.setGoodsName(goodsName)
|
.setGoodsName(goodsName)
|
||||||
|
@ -55,6 +55,7 @@
|
|||||||
<result column="oiId" property="id"/>
|
<result column="oiId" property="id"/>
|
||||||
<result column="orderId" property="orderId"/>
|
<result column="orderId" property="orderId"/>
|
||||||
<result column="goods_id" property="goodsId"/>
|
<result column="goods_id" property="goodsId"/>
|
||||||
|
<result column="face_id" property="faceId"/>
|
||||||
<result column="scenicName" property="scenicName"/>
|
<result column="scenicName" property="scenicName"/>
|
||||||
<result column="goodsName" property="goodsName"/>
|
<result column="goodsName" property="goodsName"/>
|
||||||
<result column="videoUrl" property="videoUrl"/>
|
<result column="videoUrl" property="videoUrl"/>
|
||||||
@ -66,6 +67,10 @@
|
|||||||
select oi.id oiId,oi.order_id orderId,oi.goods_id,
|
select oi.id oiId,oi.order_id orderId,oi.goods_id,
|
||||||
sc.name scenicName,t.cover_url coverUrl,
|
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,
|
if(oi.goods_type='1',t.name,(select count(1) from order_item oi2 where oi2.order_id=oi.order_id)) as goodsName,
|
||||||
|
if(oi.goods_type='1',
|
||||||
|
(select task.face_id from task where task.id = vd.task_id),
|
||||||
|
(select id face_id from face where FIND_IN_SET(sr.face_sample_id, face.match_sample_ids) > 0 limit 1)
|
||||||
|
) as face_id,
|
||||||
if(oi.goods_type='1',vd.video_url,sr.video_url) videoUrl,
|
if(oi.goods_type='1',vd.video_url,sr.video_url) videoUrl,
|
||||||
if(oi.goods_type='2',sr.url,null) imgUrl,
|
if(oi.goods_type='2',sr.url,null) imgUrl,
|
||||||
if(oi.goods_type='2',sr.type,null) sourceType,
|
if(oi.goods_type='2',sr.type,null) sourceType,
|
||||||
@ -308,7 +313,7 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="appDetail" resultMap="AppBaseResultMap">
|
<select id="appDetail" resultMap="AppBaseResultMap">
|
||||||
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,
|
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
|
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at,o.goods_type, o.create_at, o.scenic_id
|
||||||
,t.cover_url coverUrl
|
,t.cover_url coverUrl
|
||||||
from `order` AS o
|
from `order` AS o
|
||||||
left join member m on o.member_id = m.id
|
left join member m on o.member_id = m.id
|
||||||
|
27
src/main/resources/mapper/PaymentMapper.xml
Normal file
27
src/main/resources/mapper/PaymentMapper.xml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?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.PaymentMapper">
|
||||||
|
<insert id="addGetId" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||||||
|
INSERT INTO payment(member_id,order_id,pay_price,create_time)
|
||||||
|
VALUES (#{memberId},#{orderId},#{payPrice},now())
|
||||||
|
</insert>
|
||||||
|
<update id="setPaid">
|
||||||
|
UPDATE payment SET pay_time = now() WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
<update id="setOutTradeNo">
|
||||||
|
UPDATE payment SET out_order_no = #{outOrderNo} WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
<update id="update">
|
||||||
|
UPDATE payment
|
||||||
|
<set>
|
||||||
|
<if test="memberId != null">member_id = #{memberId},</if>
|
||||||
|
<if test="orderId != null">order_id = #{orderId},</if>
|
||||||
|
<if test="outOrderNo != null">out_order_no = #{outOrderNo},</if>
|
||||||
|
<if test="payPrice != null">pay_price = #{payPrice},</if>
|
||||||
|
</set>
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
<select id="findByOutTradeNo" resultType="com.ycwl.basic.model.pc.payment.entity.PaymentEntity">
|
||||||
|
SELECT * FROM payment WHERE out_order_no = #{outOrderNo}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
28
src/main/resources/mapper/RefundMapper.xml
Normal file
28
src/main/resources/mapper/RefundMapper.xml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?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.RefundMapper">
|
||||||
|
<insert id="addGetId" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||||||
|
INSERT INTO refund(member_id,order_id,out_refund_no,refund_price,reason,create_time)
|
||||||
|
VALUES (#{memberId},#{orderId},#{outRefundNo},#{refundPrice},#{reason},now())
|
||||||
|
</insert>
|
||||||
|
<update id="update">
|
||||||
|
UPDATE refund
|
||||||
|
<set>
|
||||||
|
<if test="memberId != null">member_id = #{memberId},</if>
|
||||||
|
<if test="orderId != null">order_id = #{orderId},</if>
|
||||||
|
<if test="outRefundNo != null">out_refund_no = #{outRefundNo},</if>
|
||||||
|
<if test="refundPrice != null">refund_price = #{refundPrice},</if>
|
||||||
|
<if test="reason != null">reason = #{reason},</if>
|
||||||
|
</set>
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
<update id="setRefundNo">
|
||||||
|
UPDATE refund SET out_refund_no = #{outRefundNo} WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
<update id="setRefunded">
|
||||||
|
UPDATE refund SET refund_time = now() WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
<select id="findByOutRefundNo" resultType="com.ycwl.basic.model.pc.refund.entity.RefundEntity">
|
||||||
|
SELECT * FROM refund WHERE out_refund_no = #{outRefundNo}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Loading…
x
Reference in New Issue
Block a user