记得上下班打卡 | git大法好,push需谨慎

Commit 80190639 authored by 姜秀龙's avatar 姜秀龙

fix(kylin,admin): 对齐多小程序 payment_type 统计、导出与后台展示

批量退款统计补全微信/支付宝 payment_type 枚举;导出 CASE 用 APPLET%WEPAY 覆盖新渠道;Admin 票务列表格式化支付方式;查单对未知 payment_type 明确报错。
Co-authored-by: 's avatarCursor <cursoragent@cursor.com>
parent 385affa1
...@@ -69,4 +69,54 @@ public final class WepayAppletPaySupport { ...@@ -69,4 +69,54 @@ public final class WepayAppletPaySupport {
public static boolean isAppletWechatPaymentType(String paymentType) { public static boolean isAppletWechatPaymentType(String paymentType) {
return paymentType != null && paymentType.contains("APPLET") && paymentType.endsWith("WEPAY"); return paymentType != null && paymentType.contains("APPLET") && paymentType.endsWith("WEPAY");
} }
/** 场次批量退款统计:微信渠道 payment_type 白名单 */
public static String[] wechatPaymentTypesForRefundStatis() {
return new String[]{
"APPWEPAY", "APPLETWEPAY", "APPLETBWEPAY",
"APPLETDOUDOUWEPAY", "APPLETMOOTOOWEPAY", "APPLETWENQUEWEPAY",
"WAPWEPAY", "JSWEPAY", "wepay", "MICROPAYWEPAY"
};
}
/** 场次批量退款统计:支付宝渠道 payment_type 白名单 */
public static String[] alipayPaymentTypesForRefundStatis() {
return new String[]{"APPALIPAY", "WAPALIPAY", "APPLETALIPAY", "alipay"};
}
/** Admin 列表/详情:payment_type 展示文案 */
public static String paymentChannelDisplayLabel(String paymentType) {
if (paymentType == null || paymentType.trim().isEmpty()) {
return "";
}
String pt = paymentType.trim();
if (pt.contains("UNIONPAY")) {
return "银联云闪付";
}
if (pt.contains("DOUYIN")) {
return "抖音支付";
}
if (pt.contains("ALIPAY") || "alipay".equalsIgnoreCase(pt)) {
return "支付宝";
}
if (isAppletWechatPaymentType(pt)) {
if (pt.contains("DOUDOU")) {
return "微信(DouDou)";
}
if (pt.contains("MOOTOO")) {
return "微信(mootoo)";
}
if (pt.contains("WENQUE")) {
return "微信(wenque)";
}
if (pt.contains("APPLETB")) {
return "微信(摩登)";
}
return "微信小程序";
}
if (pt.endsWith("WEPAY") || "wepay".equalsIgnoreCase(pt)) {
return "微信";
}
return pt;
}
} }
...@@ -111,6 +111,41 @@ ...@@ -111,6 +111,41 @@
var removeFlag = [[${@permission.hasPermi('kylin:tickets:remove')}]]; var removeFlag = [[${@permission.hasPermi('kylin:tickets:remove')}]];
var prefix = ctx + "kylin/tickets"; var prefix = ctx + "kylin/tickets";
function formatPaymentType(value) {
if (!value) {
return '';
}
var pt = value;
if (pt.indexOf('UNIONPAY') >= 0) {
return '银联云闪付';
}
if (pt.indexOf('DOUYIN') >= 0) {
return '抖音支付';
}
if (pt.indexOf('ALIPAY') >= 0 || pt.toLowerCase() === 'alipay') {
return '支付宝';
}
if (pt.indexOf('APPLET') >= 0 && pt.lastIndexOf('WEPAY') === pt.length - 5) {
if (pt.indexOf('DOUDOU') >= 0) {
return '微信(DouDou)';
}
if (pt.indexOf('MOOTOO') >= 0) {
return '微信(mootoo)';
}
if (pt.indexOf('WENQUE') >= 0) {
return '微信(wenque)';
}
if (pt.indexOf('APPLETB') >= 0) {
return '微信(摩登)';
}
return '微信小程序';
}
if (pt.indexOf('WEPAY') >= 0 || pt.toLowerCase() === 'wepay') {
return '微信';
}
return pt;
}
$(function() { $(function() {
var options = { var options = {
url: prefix + "/list", url: prefix + "/list",
...@@ -144,7 +179,10 @@ ...@@ -144,7 +179,10 @@
}, },
{ {
field: 'paymentType', field: 'paymentType',
title: '支付方式' title: '支付方式',
formatter: function(value) {
return formatPaymentType(value);
}
}, },
{ {
field: 'userId', field: 'userId',
......
...@@ -28,6 +28,11 @@ ...@@ -28,6 +28,11 @@
<artifactId>liquidnet-service-kylin-api</artifactId> <artifactId>liquidnet-service-kylin-api</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-dragon-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency> <dependency>
<groupId>com.liquidnet</groupId> <groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-adam-api</artifactId> <artifactId>liquidnet-service-adam-api</artifactId>
......
...@@ -21,6 +21,7 @@ import com.liquidnet.service.kylin.mapper.KylinOrderRefundBatchesMapper; ...@@ -21,6 +21,7 @@ import com.liquidnet.service.kylin.mapper.KylinOrderRefundBatchesMapper;
import com.liquidnet.service.kylin.mapper.KylinOrderRefundsMapper; import com.liquidnet.service.kylin.mapper.KylinOrderRefundsMapper;
import com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper; import com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper;
import com.liquidnet.service.kylin.mapper.KylinPerformancesMapper; import com.liquidnet.service.kylin.mapper.KylinPerformancesMapper;
import com.liquidnet.service.dragon.support.WepayAppletPaySupport;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -67,9 +68,9 @@ public class KylinRefundPerformancesAdminServiceImpl { ...@@ -67,9 +68,9 @@ public class KylinRefundPerformancesAdminServiceImpl {
public ResponseDto refundBatchApply(RefundBatchApplyParam refundBatchApplyParam) { public ResponseDto refundBatchApply(RefundBatchApplyParam refundBatchApplyParam) {
String targetId = refundBatchApplyParam.getTargetId(); String targetId = refundBatchApplyParam.getTargetId();
// 查询需要退的金额和数量 // 查询需要退的金额和数量
String[] paymentTypeAlipay = {"APPALIPAY", "WAPALIPAY", "alipay"}; String[] paymentTypeAlipay = WepayAppletPaySupport.alipayPaymentTypesForRefundStatis();
HashMap<String, Object> orderStatisAlipay = kylinOrderTicketsMapper.getPerformanceRefundOrderStatis(targetId, paymentTypeAlipay); HashMap<String, Object> orderStatisAlipay = kylinOrderTicketsMapper.getPerformanceRefundOrderStatis(targetId, paymentTypeAlipay);
String[] paymentTypeWepay = {"APPWEPAY", "APPLETWEPAY", "WAPWEPAY", "JSWEPAY", "wepay"}; String[] paymentTypeWepay = WepayAppletPaySupport.wechatPaymentTypesForRefundStatis();
HashMap<String, Object> orderStatisWepay = kylinOrderTicketsMapper.getPerformanceRefundOrderStatis(targetId, paymentTypeWepay); HashMap<String, Object> orderStatisWepay = kylinOrderTicketsMapper.getPerformanceRefundOrderStatis(targetId, paymentTypeWepay);
BigDecimal totalPriceRefundAlipay = new BigDecimal(0.0); BigDecimal totalPriceRefundAlipay = new BigDecimal(0.0);
Integer totalRefundNumberAlipay = 0; Integer totalRefundNumberAlipay = 0;
......
...@@ -919,7 +919,7 @@ GROUP BY user_mobile,tickets_id; ...@@ -919,7 +919,7 @@ GROUP BY user_mobile,tickets_id;
WHEN temtable.payment_type = 'WAPALIPAY' THEN '支付宝' WHEN temtable.payment_type = 'WAPALIPAY' THEN '支付宝'
WHEN temtable.payment_type = 'APPALIPAY' THEN '支付宝' WHEN temtable.payment_type = 'APPALIPAY' THEN '支付宝'
WHEN temtable.payment_type = 'JSWEPAY' THEN '微信' WHEN temtable.payment_type = 'JSWEPAY' THEN '微信'
WHEN temtable.payment_type = 'APPLETWEPAY' THEN '微信' WHEN temtable.payment_type LIKE 'APPLET%WEPAY' THEN '微信'
WHEN temtable.payment_type = 'APPWEPAY' THEN '微信' WHEN temtable.payment_type = 'APPWEPAY' THEN '微信'
WHEN temtable.payment_type = 'WAPWEPAY' THEN '微信' WHEN temtable.payment_type = 'WAPWEPAY' THEN '微信'
WHEN temtable.payment_type = 'APPUNIONPAY' THEN '银联云闪付' WHEN temtable.payment_type = 'APPUNIONPAY' THEN '银联云闪付'
...@@ -1023,7 +1023,7 @@ GROUP BY user_mobile,tickets_id; ...@@ -1023,7 +1023,7 @@ GROUP BY user_mobile,tickets_id;
WHEN kot.payment_type = 'WAPALIPAY' THEN '支付宝' WHEN kot.payment_type = 'WAPALIPAY' THEN '支付宝'
WHEN kot.payment_type = 'APPALIPAY' THEN '支付宝' WHEN kot.payment_type = 'APPALIPAY' THEN '支付宝'
WHEN kot.payment_type = 'JSWEPAY' THEN '微信' WHEN kot.payment_type = 'JSWEPAY' THEN '微信'
WHEN kot.payment_type = 'APPLETWEPAY' THEN '微信' WHEN kot.payment_type LIKE 'APPLET%WEPAY' THEN '微信'
WHEN kot.payment_type = 'APPWEPAY' THEN '微信' WHEN kot.payment_type = 'APPWEPAY' THEN '微信'
WHEN kot.payment_type = 'WAPWEPAY' THEN '微信' WHEN kot.payment_type = 'WAPWEPAY' THEN '微信'
WHEN kot.payment_type = 'APPUNIONPAY' THEN '银联云闪付' WHEN kot.payment_type = 'APPUNIONPAY' THEN '银联云闪付'
...@@ -1069,7 +1069,7 @@ GROUP BY user_mobile,tickets_id; ...@@ -1069,7 +1069,7 @@ GROUP BY user_mobile,tickets_id;
WHEN kot.payment_type = 'WAPALIPAY' THEN '支付宝' WHEN kot.payment_type = 'WAPALIPAY' THEN '支付宝'
WHEN kot.payment_type = 'APPALIPAY' THEN '支付宝' WHEN kot.payment_type = 'APPALIPAY' THEN '支付宝'
WHEN kot.payment_type = 'JSWEPAY' THEN '微信' WHEN kot.payment_type = 'JSWEPAY' THEN '微信'
WHEN kot.payment_type = 'APPLETWEPAY' THEN '微信' WHEN kot.payment_type LIKE 'APPLET%WEPAY' THEN '微信'
WHEN kot.payment_type = 'APPWEPAY' THEN '微信' WHEN kot.payment_type = 'APPWEPAY' THEN '微信'
WHEN kot.payment_type = 'WAPWEPAY' THEN '微信' WHEN kot.payment_type = 'WAPWEPAY' THEN '微信'
WHEN kot.payment_type = 'APPUNIONPAY' THEN '银联云闪付' WHEN kot.payment_type = 'APPUNIONPAY' THEN '银联云闪付'
...@@ -1144,16 +1144,16 @@ GROUP BY user_mobile,tickets_id; ...@@ -1144,16 +1144,16 @@ GROUP BY user_mobile,tickets_id;
select temtable.code as code, select temtable.code as code,
temtable.payment_id as payment_id, temtable.payment_id as payment_id,
name as name, name as name,
(CASE temtable.payment_type (CASE
WHEN 'WAPALIPAY' THEN '支付宝' WHEN temtable.payment_type = 'WAPALIPAY' THEN '支付宝'
WHEN 'APPALIPAY' THEN '支付宝' WHEN temtable.payment_type = 'APPALIPAY' THEN '支付宝'
WHEN 'JSWEPAY' THEN '微信' WHEN temtable.payment_type = 'JSWEPAY' THEN '微信'
WHEN 'APPLETWEPAY' THEN '微信' WHEN temtable.payment_type LIKE 'APPLET%WEPAY' THEN '微信'
WHEN 'APPWEPAY' THEN '微信' WHEN temtable.payment_type = 'APPWEPAY' THEN '微信'
WHEN 'WAPWEPAY' THEN '微信' WHEN temtable.payment_type = 'WAPWEPAY' THEN '微信'
WHEN 'APPUNIONPAY' THEN '银联云闪付' WHEN temtable.payment_type = 'APPUNIONPAY' THEN '银联云闪付'
WHEN 'WAPUNIONPAY' THEN '银联云闪付' WHEN temtable.payment_type = 'WAPUNIONPAY' THEN '银联云闪付'
WHEN 'APPLETDOUYINPAY' THEN '抖音支付' WHEN temtable.payment_type = 'APPLETDOUYINPAY' THEN '抖音支付'
ELSE '其他' END) as payment_type, ELSE '其他' END) as payment_type,
temtable.price_actual as price_actual, temtable.price_actual as price_actual,
temtable.created_at as created_at, temtable.created_at as created_at,
......
...@@ -121,8 +121,12 @@ public class DragonOrdersServiceImpl implements IDragonOrdersService { ...@@ -121,8 +121,12 @@ public class DragonOrdersServiceImpl implements IDragonOrdersService {
return dragonPayBiz.buildPayOrderQueryRespDto(ordersDto); return dragonPayBiz.buildPayOrderQueryRespDto(ordersDto);
} }
//如果未支付进行三方查询` //如果未支付进行三方查询`
String payType = DragonConstant.PayTypeEnum.getEnumByCode(ordersDto.getPaymentType()).getPayType(); DragonConstant.PayTypeEnum payTypeEnum = DragonConstant.PayTypeEnum.getEnumByCode(ordersDto.getPaymentType());
return payChannelStrategyContext.getStrategy(payType).checkOrderStatus(code); if (payTypeEnum == null) {
throw new LiquidnetServiceException(DragonErrorCodeEnum.TRADE_ERROR_NOT_EXISTS.getCode(),
"不支持的支付类型: " + ordersDto.getPaymentType());
}
return payChannelStrategyContext.getStrategy(payTypeEnum.getPayType()).checkOrderStatus(code);
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment