wjx 1 rok pred
rodič
commit
ca17260e0a

+ 44 - 0
src/pages/gameDataStatistics/order/logA.tsx

@@ -0,0 +1,44 @@
+import { useAjax } from "@/Hook/useAjax"
+import { getBackLogApi } from "@/services/gameData/order"
+import { Modal, Table } from "antd"
+import React, { useEffect, useState } from "react"
+import columnsLog from "./logTableConfig"
+
+
+interface Props {
+    orderId: string,
+    backTableName: string
+}
+/**
+ * 回传日志
+ * @returns 
+ */
+const LogA: React.FC<Props> = ({ orderId, backTableName }) => {
+
+    /*****************************/
+    const [visible, setVisible] = useState<boolean>(false)
+
+    const getBackLog = useAjax((params) => getBackLogApi(params))
+    /*****************************/
+
+    const logHandle = () => {
+        setVisible(true)
+        getBackLog.run({ type: backTableName, orderId })
+    }
+
+    return <>
+        <a onClick={logHandle}>日志</a>
+        {visible && <Modal
+            title={`${orderId} 订单日志`}
+            visible={visible}
+            onCancel={() => setVisible(false)}
+            footer={null}
+            width={900}
+            bodyStyle={{padding: '0 10px'}}
+        >
+            <Table columns={columnsLog()} rowKey={'id'} scroll={{ x: 1000 }} dataSource={getBackLog?.data} />
+        </Modal>}
+    </>
+}
+
+export default React.memo(LogA)

+ 77 - 0
src/pages/gameDataStatistics/order/logTableConfig.tsx

@@ -0,0 +1,77 @@
+import { Badge } from "antd";
+import { ColumnsType } from "antd/lib/table";
+import React from "react";
+
+const columnsLog = (): ColumnsType<any> => {
+
+    const dataSource: ColumnsType<any> = [
+        {
+            title: 'ID',
+            dataIndex: 'id',
+            key: 'id',
+            width: 50,
+            align: 'center'
+        },
+        {
+            title: '订单编号',
+            dataIndex: 'orderNo',
+            key: 'orderNo',
+            width: 120,
+            ellipsis: true
+        },
+        {
+            title: '回传序号',
+            dataIndex: 'backIndex',
+            key: 'backIndex',
+            width: 80,
+            align: 'center'
+        },
+        {
+            title: '拆分的回传金额',
+            dataIndex: 'splitMoney',
+            key: 'splitMoney',
+            width: 100,
+            align: 'center'
+        },
+        {
+            title: '回传时间',
+            dataIndex: 'backTime',
+            key: 'backTime',
+            width: 130,
+            align: 'center',
+            ellipsis: true
+        },
+        {
+            title: '真实的回传时间',
+            dataIndex: 'executeTime',
+            key: 'executeTime',
+            width: 130,
+            align: 'center',
+            ellipsis: true
+        },
+        {
+            title: '回传状态',
+            dataIndex: 'backStatus',
+            key: 'backStatus',
+            width: 90,
+            align: 'center',
+            render: (a: any) => {
+                return a === -1 ? <Badge status="error" text="回传失败" /> : a === 0 ? <Badge status="warning" text="未回传" /> : a === 1 ? <Badge status="success" text="回传成功" /> : a === 2 ? <Badge status="default" text="部分成功" /> : '--'
+            }
+        },
+        {
+            title: '回传失败消息',
+            dataIndex: 'backErrorMsg',
+            key: 'backErrorMsg',
+            ellipsis: true,
+            width: 250
+        },
+    ];
+
+
+    return dataSource
+
+}
+
+
+export default columnsLog

+ 3 - 1
src/pages/gameDataStatistics/order/tableConfig.tsx

@@ -2,6 +2,7 @@ import { PayScene, PayStatus, PayType, gameClassifyEnum } from "@/components/Que
 import WidthEllipsis from "@/components/widthEllipsis"
 import { Badge, Space, Statistic } from "antd"
 import React from "react"
+import LogA from "./logA"
 
 function columns12(onDetail: (data: any) => void, back: (b: any) => void): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
 
@@ -246,11 +247,12 @@ function columns12(onDetail: (data: any) => void, back: (b: any) => void): { lab
                     dataIndex: 'cz',
                     label: '订单明细',
                     align: 'center',
-                    width: 100,
+                    width: 140,
                     default: 40,
                     render: (a: any, b: any) => {
                         if (b?.day !== '总计') {
                             return <Space>
+                                <LogA orderId={b?.orderId} backTableName={b?.backTableName} />
                                 {(b?.backStatus !== 2 && b?.backStatus !== 1) && <a onClick={() => back(b)}>回传</a>}
                                 <a onClick={() => onDetail(b)}>订单详情</a>
                             </Space>

+ 29 - 2
src/services/gameData/order.ts

@@ -102,8 +102,12 @@ export async function getOrderCpNoticeApi(data: CpLogListProps) {
     });
 }
 
-
-export async function setBackApi({type, ...data}: { type: 'byte' | 'tencent_mini' | 'tencent_h5', ids: string, splitOrder: boolean, splitMoney?: number[], money?: number }) {
+/**
+ * 回传
+ * @param param0 
+ * @returns 
+ */
+export async function setBackApi({ type, ...data }: { type: 'byte' | 'tencent_mini' | 'tencent_h5', ids: string, splitOrder: boolean, splitMoney?: number[], money?: number }) {
     switch (type) {
         case 'byte':
             return request(erpApi + `/gameBack/oceanengine/orderReport`, {
@@ -121,4 +125,27 @@ export async function setBackApi({type, ...data}: { type: 'byte' | 'tencent_mini
                 data
             });
     }
+}
+
+
+/**
+ * 回传日志
+ * @param param0 
+ * @returns 
+ */
+export async function getBackLogApi({ type, orderId }: { type: 'byte' | 'tencent_mini' | 'tencent_h5', orderId: string }) {
+    switch (type) {
+        case 'byte':
+            return request(erpApi + `/gameBack/oceanengine/orderSplitList/${orderId}`, {
+                method: 'GET'
+            });
+        case 'tencent_mini':
+            return request(erpApi + `/gameBack/tencentMiniGame/orderSplitList/${orderId}`, {
+                method: 'GET'
+            });
+        case 'tencent_h5':
+            return request(erpApi + `/gameBack/tencent/orderSplitList/${orderId}`, {
+                method: 'GET'
+            });
+    }
 }