fix(订单中心):新增订单支付类型后,订单列表显示和首页统计添加筛选条件
This commit is contained in:
+17
-1
@@ -22,6 +22,7 @@ public interface DashboardMapper {
|
|||||||
" AND q.is_test = 0",
|
" AND q.is_test = 0",
|
||||||
"</if>",
|
"</if>",
|
||||||
"AND o.order_status IN (1, 3, 4, 5, 7, 8, 9)",
|
"AND o.order_status IN (1, 3, 4, 5, 7, 8, 9)",
|
||||||
|
"AND (o.pay_type = 1 OR o.pay_type IS NULL)",
|
||||||
"<if test='p.tourismId != null'>",
|
"<if test='p.tourismId != null'>",
|
||||||
" AND o.tourism_id = #{p.tourismId}",
|
" AND o.tourism_id = #{p.tourismId}",
|
||||||
"</if>",
|
"</if>",
|
||||||
@@ -52,6 +53,7 @@ public interface DashboardMapper {
|
|||||||
"</if>",
|
"</if>",
|
||||||
"AND DATE(o.create_time) = CURDATE()",
|
"AND DATE(o.create_time) = CURDATE()",
|
||||||
"AND o.order_status IN (1, 3, 4, 5, 7, 8, 9)",
|
"AND o.order_status IN (1, 3, 4, 5, 7, 8, 9)",
|
||||||
|
"AND (o.pay_type = 1 OR o.pay_type IS NULL)",
|
||||||
"<if test='p.tourismId != null'>",
|
"<if test='p.tourismId != null'>",
|
||||||
" AND o.tourism_id = #{p.tourismId}",
|
" AND o.tourism_id = #{p.tourismId}",
|
||||||
"</if>",
|
"</if>",
|
||||||
@@ -75,6 +77,7 @@ public interface DashboardMapper {
|
|||||||
" AND q.is_test = 0",
|
" AND q.is_test = 0",
|
||||||
"</if>",
|
"</if>",
|
||||||
"AND o.order_status = 8",
|
"AND o.order_status = 8",
|
||||||
|
"AND (o.pay_type = 1 OR o.pay_type IS NULL)",
|
||||||
"<if test='p.tourismId != null'>",
|
"<if test='p.tourismId != null'>",
|
||||||
" AND o.tourism_id = #{p.tourismId}",
|
" AND o.tourism_id = #{p.tourismId}",
|
||||||
"</if>",
|
"</if>",
|
||||||
@@ -128,6 +131,7 @@ public interface DashboardMapper {
|
|||||||
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
|
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
|
||||||
" AND q.is_test = 0",
|
" AND q.is_test = 0",
|
||||||
"</if>",
|
"</if>",
|
||||||
|
"AND (o.pay_type = 1 OR o.pay_type IS NULL)",
|
||||||
"<if test='p.tourismId != null'>",
|
"<if test='p.tourismId != null'>",
|
||||||
" AND o.tourism_id = #{p.tourismId}",
|
" AND o.tourism_id = #{p.tourismId}",
|
||||||
"</if>",
|
"</if>",
|
||||||
@@ -158,6 +162,7 @@ public interface DashboardMapper {
|
|||||||
" AND q.is_test = 0",
|
" AND q.is_test = 0",
|
||||||
"</if>",
|
"</if>",
|
||||||
" AND DATE(o.create_time) = CURDATE()",
|
" AND DATE(o.create_time) = CURDATE()",
|
||||||
|
"AND (o.pay_type = 1 OR o.pay_type IS NULL)",
|
||||||
"<if test='p.tourismId != null'>",
|
"<if test='p.tourismId != null'>",
|
||||||
" AND o.tourism_id = #{p.tourismId}",
|
" AND o.tourism_id = #{p.tourismId}",
|
||||||
"</if>",
|
"</if>",
|
||||||
@@ -182,6 +187,7 @@ public interface DashboardMapper {
|
|||||||
" AND q.is_test = 0",
|
" AND q.is_test = 0",
|
||||||
"</if>",
|
"</if>",
|
||||||
"AND o.order_status IN (1, 3, 4, 5, 6, 7, 8, 9)",
|
"AND o.order_status IN (1, 3, 4, 5, 6, 7, 8, 9)",
|
||||||
|
"AND (o.pay_type = 1 OR o.pay_type IS NULL)",
|
||||||
"<if test='p.tourismId != null'>",
|
"<if test='p.tourismId != null'>",
|
||||||
" AND o.tourism_id = #{p.tourismId}",
|
" AND o.tourism_id = #{p.tourismId}",
|
||||||
"</if>",
|
"</if>",
|
||||||
@@ -211,6 +217,7 @@ public interface DashboardMapper {
|
|||||||
" AND q.is_test = 0",
|
" AND q.is_test = 0",
|
||||||
"</if>",
|
"</if>",
|
||||||
"AND o.order_status = 8",
|
"AND o.order_status = 8",
|
||||||
|
"AND (o.pay_type = 1 OR o.pay_type IS NULL)",
|
||||||
"<if test='p.tourismId != null'>",
|
"<if test='p.tourismId != null'>",
|
||||||
" AND o.tourism_id = #{p.tourismId}",
|
" AND o.tourism_id = #{p.tourismId}",
|
||||||
"</if>",
|
"</if>",
|
||||||
@@ -244,6 +251,7 @@ public interface DashboardMapper {
|
|||||||
" AND q.is_test = 0",
|
" AND q.is_test = 0",
|
||||||
"</if>",
|
"</if>",
|
||||||
"AND o.order_status IN (1, 3, 4, 5, 7, 8, 9)",
|
"AND o.order_status IN (1, 3, 4, 5, 7, 8, 9)",
|
||||||
|
"AND (o.pay_type = 1 OR o.pay_type IS NULL)",
|
||||||
"<if test='p.startTime != null and p.startTime != \"\"'>",
|
"<if test='p.startTime != null and p.startTime != \"\"'>",
|
||||||
" AND o.create_time >= #{p.startTime}",
|
" AND o.create_time >= #{p.startTime}",
|
||||||
"</if>",
|
"</if>",
|
||||||
@@ -272,6 +280,7 @@ public interface DashboardMapper {
|
|||||||
" AND q.is_test = 0",
|
" AND q.is_test = 0",
|
||||||
"</if>",
|
"</if>",
|
||||||
" AND o.order_status = 3",
|
" AND o.order_status = 3",
|
||||||
|
"AND (o.pay_type = 1 OR o.pay_type IS NULL)",
|
||||||
"<if test='p.startTime != null and p.startTime != \"\"'>",
|
"<if test='p.startTime != null and p.startTime != \"\"'>",
|
||||||
" AND o.create_time >= #{p.startTime}",
|
" AND o.create_time >= #{p.startTime}",
|
||||||
"</if>",
|
"</if>",
|
||||||
@@ -300,6 +309,7 @@ public interface DashboardMapper {
|
|||||||
" AND q.is_test = 0",
|
" AND q.is_test = 0",
|
||||||
"</if>",
|
"</if>",
|
||||||
" AND o.order_status = 8",
|
" AND o.order_status = 8",
|
||||||
|
"AND (o.pay_type = 1 OR o.pay_type IS NULL)",
|
||||||
"<if test='p.startTime != null and p.startTime != \"\"'>",
|
"<if test='p.startTime != null and p.startTime != \"\"'>",
|
||||||
" AND o.create_time >= #{p.startTime}",
|
" AND o.create_time >= #{p.startTime}",
|
||||||
"</if>",
|
"</if>",
|
||||||
@@ -328,7 +338,7 @@ public interface DashboardMapper {
|
|||||||
" q.code_id as qrcodeId,",
|
" q.code_id as qrcodeId,",
|
||||||
" COUNT(o.id) as orderCount",
|
" COUNT(o.id) as orderCount",
|
||||||
"FROM qrcodes q",
|
"FROM qrcodes q",
|
||||||
"LEFT JOIN orders o ON q.code_id = o.code_id AND o.order_status IN (3, 7)",
|
"LEFT JOIN orders o ON q.code_id = o.code_id AND o.order_status IN (3, 7) AND (o.pay_type = 1 OR o.pay_type IS NULL)",
|
||||||
"WHERE q.is_del = 0",
|
"WHERE q.is_del = 0",
|
||||||
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
|
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
|
||||||
" AND q.is_test = 0",
|
" AND q.is_test = 0",
|
||||||
@@ -361,6 +371,7 @@ public interface DashboardMapper {
|
|||||||
"</if>",
|
"</if>",
|
||||||
"AND DATE(o.create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)",
|
"AND DATE(o.create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)",
|
||||||
"AND o.order_status IN (1, 3, 4, 5, 7, 8, 9)",
|
"AND o.order_status IN (1, 3, 4, 5, 7, 8, 9)",
|
||||||
|
"AND (o.pay_type = 1 OR o.pay_type IS NULL)",
|
||||||
"<if test='p.tourismId != null'>",
|
"<if test='p.tourismId != null'>",
|
||||||
" AND o.tourism_id = #{p.tourismId}",
|
" AND o.tourism_id = #{p.tourismId}",
|
||||||
"</if>",
|
"</if>",
|
||||||
@@ -384,6 +395,7 @@ public interface DashboardMapper {
|
|||||||
" AND q.is_test = 0",
|
" AND q.is_test = 0",
|
||||||
"</if>",
|
"</if>",
|
||||||
"AND o.order_status = 3",
|
"AND o.order_status = 3",
|
||||||
|
"AND (o.pay_type = 1 OR o.pay_type IS NULL)",
|
||||||
"<if test='p.tourismId != null'>",
|
"<if test='p.tourismId != null'>",
|
||||||
" AND o.tourism_id = #{p.tourismId}",
|
" AND o.tourism_id = #{p.tourismId}",
|
||||||
"</if>",
|
"</if>",
|
||||||
@@ -426,6 +438,7 @@ public interface DashboardMapper {
|
|||||||
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
|
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
|
||||||
" AND q.is_test = 0",
|
" AND q.is_test = 0",
|
||||||
"</if>",
|
"</if>",
|
||||||
|
"AND (o.pay_type = 1 OR o.pay_type IS NULL)",
|
||||||
"<if test='p.tourismId != null'>",
|
"<if test='p.tourismId != null'>",
|
||||||
" AND o.tourism_id = #{p.tourismId}",
|
" AND o.tourism_id = #{p.tourismId}",
|
||||||
"</if>",
|
"</if>",
|
||||||
@@ -457,6 +470,7 @@ public interface DashboardMapper {
|
|||||||
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
|
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
|
||||||
" AND q.is_test = 0",
|
" AND q.is_test = 0",
|
||||||
"</if>",
|
"</if>",
|
||||||
|
"AND (o.pay_type = 1 OR o.pay_type IS NULL)",
|
||||||
"<if test='p.tourismId != null'>",
|
"<if test='p.tourismId != null'>",
|
||||||
" AND o.tourism_id = #{p.tourismId}",
|
" AND o.tourism_id = #{p.tourismId}",
|
||||||
"</if>",
|
"</if>",
|
||||||
@@ -482,6 +496,7 @@ public interface DashboardMapper {
|
|||||||
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
|
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
|
||||||
" AND q.is_test = 0",
|
" AND q.is_test = 0",
|
||||||
"</if>",
|
"</if>",
|
||||||
|
"AND (o.pay_type = 1 OR o.pay_type IS NULL)",
|
||||||
"<if test='p.tourismId != null'>",
|
"<if test='p.tourismId != null'>",
|
||||||
" AND o.tourism_id = #{p.tourismId}",
|
" AND o.tourism_id = #{p.tourismId}",
|
||||||
"</if>",
|
"</if>",
|
||||||
@@ -507,6 +522,7 @@ public interface DashboardMapper {
|
|||||||
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
|
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
|
||||||
" AND q.is_test = 0",
|
" AND q.is_test = 0",
|
||||||
"</if>",
|
"</if>",
|
||||||
|
"AND (o.pay_type = 1 OR o.pay_type IS NULL)",
|
||||||
"<if test='p.tourismId != null'>",
|
"<if test='p.tourismId != null'>",
|
||||||
" AND o.tourism_id = #{p.tourismId}",
|
" AND o.tourism_id = #{p.tourismId}",
|
||||||
"</if>",
|
"</if>",
|
||||||
|
|||||||
@@ -31,6 +31,21 @@ const TableList: React.FC = () => {
|
|||||||
return <Tag color={statusInfo.color}>{statusInfo.text}</Tag>;
|
return <Tag color={statusInfo.color}>{statusInfo.text}</Tag>;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// 支付类型选项
|
||||||
|
const PAY_TYPE_OPTIONS = [
|
||||||
|
{ label: '微信支付', value: 1 },
|
||||||
|
{ label: '优惠券支付', value: 2 },
|
||||||
|
];
|
||||||
|
|
||||||
|
// 渲染支付类型标签
|
||||||
|
const renderPayType = (payType: number) => {
|
||||||
|
const payTypeInfo = PAY_TYPE_OPTIONS.find(option => option.value === payType);
|
||||||
|
if (!payTypeInfo) return <Tag color="default">未知</Tag>;
|
||||||
|
|
||||||
|
const color = payType === 1 ? 'green' : 'blue';
|
||||||
|
return <Tag color={color}>{payTypeInfo.label}</Tag>;
|
||||||
|
};
|
||||||
|
|
||||||
// 处理修改操作
|
// 处理修改操作
|
||||||
const handleEdit = useCallback(async (fields: { orderStatus: number }) => {
|
const handleEdit = useCallback(async (fields: { orderStatus: number }) => {
|
||||||
const hide = message.loading('正在更新');
|
const hide = message.loading('正在更新');
|
||||||
@@ -161,6 +176,17 @@ const TableList: React.FC = () => {
|
|||||||
copyable: true,
|
copyable: true,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '支付类型',
|
||||||
|
dataIndex: 'payType',
|
||||||
|
render: (payType) => renderPayType(payType as number),
|
||||||
|
width: 120,
|
||||||
|
filters: PAY_TYPE_OPTIONS.map(option => ({
|
||||||
|
text: option.label,
|
||||||
|
value: option.value,
|
||||||
|
})),
|
||||||
|
filterMultiple: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
dataIndex: 'orderStatus',
|
dataIndex: 'orderStatus',
|
||||||
@@ -223,6 +249,7 @@ const TableList: React.FC = () => {
|
|||||||
orderNo: values.orderNo?.trim(), // 去除空格
|
orderNo: values.orderNo?.trim(), // 去除空格
|
||||||
orderStatus: values.orderStatus, // 状态
|
orderStatus: values.orderStatus, // 状态
|
||||||
tourismId: values.tourismId, // 景区ID
|
tourismId: values.tourismId, // 景区ID
|
||||||
|
payType: values.payType, // 支付类型
|
||||||
};
|
};
|
||||||
// 过滤掉空值
|
// 过滤掉空值
|
||||||
const validParams = Object.fromEntries(
|
const validParams = Object.fromEntries(
|
||||||
@@ -244,6 +271,13 @@ const TableList: React.FC = () => {
|
|||||||
options={STATUS_OPTIONS}
|
options={STATUS_OPTIONS}
|
||||||
allowClear
|
allowClear
|
||||||
/>
|
/>
|
||||||
|
<ProFormSelect
|
||||||
|
name="payType"
|
||||||
|
label="支付类型"
|
||||||
|
placeholder="请选择支付类型"
|
||||||
|
options={PAY_TYPE_OPTIONS}
|
||||||
|
allowClear
|
||||||
|
/>
|
||||||
<ProFormSelect
|
<ProFormSelect
|
||||||
name="tourismId"
|
name="tourismId"
|
||||||
label="景区"
|
label="景区"
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ declare namespace ORDERS {
|
|||||||
id: number;
|
id: number;
|
||||||
orderNo: string;
|
orderNo: string;
|
||||||
orderStatus: string;
|
orderStatus: string;
|
||||||
|
payType?: number; // 支付类型(1:微信支付,2:优惠券支付)
|
||||||
createTime?: string;
|
createTime?: string;
|
||||||
tenantId?: string;
|
tenantId?: string;
|
||||||
updateTime?: string;
|
updateTime?: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user