查询交易记录 添加付款人字段

This commit is contained in:
2025-01-15 10:45:51 +08:00
parent 51e2c9af02
commit b6a66bed41
6 changed files with 56 additions and 38 deletions

View File

@@ -5,7 +5,6 @@ import com.ai.da.model.dto.*;
import com.ai.da.model.vo.*;
import com.ai.da.service.DesignItemService;
import com.ai.da.service.DesignService;
import com.ai.da.service.UserLikeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@@ -15,8 +14,6 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.io.IOException;
import java.util.List;
import java.util.Map;
@Api(tags = "design Detail模块")

View File

@@ -16,11 +16,11 @@ public interface PaymentInfoMapper extends BaseMapper<PaymentInfo> {
List<PaymentInfoVO> queryPaymentInfo(String paymentType,String payerTotal, String type, String status,
String country, String city, String startTime, String endTime,
int limit, int offset, String order
int limit, int offset, String order, String payer
);
Long queryPaymentInfoCount(String paymentType,String payerTotal, String type, String status,
String country, String city, String startTime, String endTime
String country, String city, String startTime, String endTime, String payer
);
List<Map<String, String>> getCities();

View File

@@ -25,4 +25,6 @@ public class QueryPaymentInfoDTO extends QueryPageByTimeDTO {
private String city;
@ApiModelProperty("按id排序 DESC || ASC")
private String order = "DESC";
@ApiModelProperty("付款用户名")
private String payer;
}

View File

@@ -11,6 +11,8 @@ import lombok.NoArgsConstructor;
@ApiModel("交易记录详情")
public class PaymentInfoVO {
private Long id;
@ApiModelProperty("付款用户名")
private String payer;
@ApiModelProperty("选择的支付平台 PayPal || Stripe || Alipay-HK")
private String platform;
@ApiModelProperty("支付的金额 单位:HKD")

View File

@@ -628,12 +628,12 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
queryPaymentInfoDTO.getType(), queryPaymentInfoDTO.getStatus(),
queryPaymentInfoDTO.getCountry(), queryPaymentInfoDTO.getCity(),
queryPaymentInfoDTO.getStartTime(), queryPaymentInfoDTO.getEndTime(),
size, offset, order);
size, offset, order, queryPaymentInfoDTO.getPayer());
// 查询数据总量
Long total = paymentInfoMapper.queryPaymentInfoCount(queryPaymentInfoDTO.getPlatform(), queryPaymentInfoDTO.getPayerTotal(),
queryPaymentInfoDTO.getType(), queryPaymentInfoDTO.getStatus(),
queryPaymentInfoDTO.getCountry(), queryPaymentInfoDTO.getCity(),
queryPaymentInfoDTO.getStartTime(), queryPaymentInfoDTO.getEndTime());
queryPaymentInfoDTO.getStartTime(), queryPaymentInfoDTO.getEndTime(), queryPaymentInfoDTO.getPayer());
// 总页数
double totalPage = Math.ceil((double) total / size);

View File

@@ -46,52 +46,62 @@
<select id="queryPaymentInfo" resultType="com.ai.da.model.vo.PaymentInfoVO">
SELECT
id,
payment_type platform,
payer_total,
type,
payment_method,
last4,
country,
city,
create_time,
p.id,
a.user_name payer,
p.payment_type platform,
p.payer_total,
p.type,
p.payment_method,
p.last4,
p.country,
p.city,
p.create_time,
CASE
WHEN trade_state IN ('paid', 'COMPLETED', 'complete', 'liquidated') THEN 'Success'
WHEN trade_state IN ('failed', 'expired', 'VOIDED', 'void', 'uncollectible') THEN 'Fail'
ELSE 'Pending'
WHEN p.trade_state IN ( 'paid', 'COMPLETED', 'complete', 'liquidated' ) THEN
'Success'
WHEN p.trade_state IN ( 'failed', 'expired', 'VOIDED', 'void', 'uncollectible' ) THEN
'Fail' ELSE 'Pending'
END AS status
FROM
t_payment_info
t_payment_info p
LEFT JOIN
t_order_info o ON p.order_no = o.order_no
LEFT JOIN
t_account a ON a.id = o.account_id
WHERE
1 = 1
<if test="paymentType != null and paymentType != ''">
AND payment_type = #{paymentType}
AND p.payment_type = #{paymentType}
</if>
<if test="payerTotal != null and payerTotal != ''">
AND payer_total = #{payerTotal}
AND p.payer_total = #{payerTotal}
</if>
<if test="type != null and type != ''">
AND type = #{type}
AND p.type = #{type}
</if>
<if test="status != null and status != ''">
AND
CASE
WHEN trade_state IN ('paid', 'COMPLETED', 'complete', 'liquidated') THEN 'Success'
WHEN trade_state IN ('failed', 'expired', 'VOIDED', 'void', 'uncollectible') THEN 'Fail'
WHEN p.trade_state IN ('paid', 'COMPLETED', 'complete', 'liquidated') THEN 'Success'
WHEN p.trade_state IN ('failed', 'expired', 'VOIDED', 'void', 'uncollectible') THEN 'Fail'
ELSE 'Pending'
END = #{status}
</if>
<if test="country != null and country != ''">
AND country = #{country}
AND p.country = #{country}
</if>
<if test="city != null and city != ''">
AND city = #{city}
AND p.city = #{city}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND create_time BETWEEN #{startTime} AND #{endTime}
AND p.create_time BETWEEN #{startTime} AND #{endTime}
</if>
<if test="payer != null and payer != ''">
AND a.user_name = #{payer}
</if>
ORDER BY
id ${order}
p.id ${order}
LIMIT ${limit} OFFSET ${offset}
</select>
@@ -99,34 +109,41 @@
SELECT
COUNT(*)
FROM
t_payment_info
t_payment_info p
LEFT JOIN
t_order_info o ON p.order_no = o.order_no
LEFT JOIN
t_account a ON a.id = o.account_id
WHERE
1 = 1
<if test="paymentType != null and paymentType != ''">
AND payment_type = #{paymentType}
AND p.payment_type = #{paymentType}
</if>
<if test="payerTotal != null and payerTotal != ''">
AND payer_total = #{payerTotal}
AND p.payer_total = #{payerTotal}
</if>
<if test="type != null and type != ''">
AND type = #{type}
AND p.type = #{type}
</if>
<if test="status != null and status != ''">
AND
CASE
WHEN trade_state IN ('paid', 'COMPLETED', 'complete', 'liquidated') THEN 'Success'
WHEN trade_state IN ('failed', 'expired', 'VOIDED', 'void', 'uncollectible') THEN 'Fail'
WHEN p.trade_state IN ('paid', 'COMPLETED', 'complete', 'liquidated') THEN 'Success'
WHEN p.trade_state IN ('failed', 'expired', 'VOIDED', 'void', 'uncollectible') THEN 'Fail'
ELSE 'Pending'
END = #{status}
</if>
<if test="country != null and country != ''">
AND country = #{country}
AND p.country = #{country}
</if>
<if test="city != null and city != ''">
AND city = #{city}
AND p.city = #{city}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND create_time BETWEEN #{startTime} AND #{endTime}
AND p.create_time BETWEEN #{startTime} AND #{endTime}
</if>
<if test="payer != null and payer != ''">
AND a.user_name = #{payer}
</if>
</select>