wjx 1 year ago
parent
commit
4aa160479d

+ 22 - 1
src/components/QueryForm/index.tsx

@@ -223,6 +223,8 @@ interface Props {
     isAddCorpWechat?: boolean
     /** 是否开启 是否唤醒 搜索 */
     isWakeUp?: boolean
+    /** 是否开启 回传状态 搜索 */
+    isBackStatus?: boolean
 }
 /**
  * 游戏数据系统 请求参数
@@ -237,7 +239,7 @@ const QueryForm: React.FC<Props> = (props) => {
         isSysUserName, isRechargeDate, isBGGameClassify, isGameUserId, isSysUserId, isSysUserIds, isUserName, isUserId, isSelectRanking, isGameType, isConsumeDay, rechargeDay, isBeginDay, isType, isAdTTStatus, isUserEnterType, isServerName, isServerId, isServerDay, isAdTXStatus,
         payTimeDay, placeAnOrderDay, isPayIntervalTime, isActiveTypes, isNickname, isMobile, isRegIp, isIsAuth, isIsBindMobile, isIsRecharge, isUserStatus, isCreateRole, isRoleCount, isVipLevel, isCreateRoleDay, isIsChange, isIsSendMail, isWeChatCompany, isWeChat,
         isCustomerServerId, isOperatorId, isGsId, isServerIds, isRankingNum, isIsMergeServer, isSuperParentGameId, isGameServerName, isIp, isDeviceType, isLoginType, isServerIdUn, isSourceServerName, isProjectId1, isRemoveGame, isRemoveGameForSystem, isOrderLy, isAddCorpWechat,
-        isWakeUp
+        isWakeUp, isBackStatus
     } = props
     const [form] = Form.useForm()
     const parentId = Form.useWatch('parentId', form)
@@ -1031,6 +1033,7 @@ const QueryForm: React.FC<Props> = (props) => {
                     {Object.keys(PayStatus).map(key => <Select.Option value={key} key={key}>{PayStatus[key]}</Select.Option>)}
                 </Select>
             </Form.Item></Col>}
+            
             {/* 支付方式 */}
             {isPayWay && <Col><Form.Item name='payWay'>
                 <Select
@@ -1439,6 +1442,24 @@ const QueryForm: React.FC<Props> = (props) => {
                 </Select>
             </Form.Item></Col>}
 
+            {/* 支付状态 */}
+            {isBackStatus && <Col><Form.Item name='backStatus'>
+                <Select
+                    showSearch
+                    style={{ width: 100 }}
+                    allowClear
+                    placeholder={'回传状态'}
+                    filterOption={(input, option) =>
+                        (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
+                    }
+                >
+                    <Select.Option value={-1}>回传失败</Select.Option>
+                    <Select.Option value={0}>未回传</Select.Option>
+                    <Select.Option value={1}>回传成功</Select.Option>
+                    <Select.Option value={2}>无回传数据</Select.Option>
+                </Select>
+            </Form.Item></Col>}
+
             {/* 用户注册日期搜索 */}
             {isRegDay && <Col><Form.Item name='regDay'>
                 <DatePicker.RangePicker style={{ width: 230 }} placeholder={['注册开始日期', '注册结束日期']} {...isRegDay} />

+ 43 - 0
src/pages/gameDataStatistics/order/back.tsx

@@ -0,0 +1,43 @@
+import { useAjax } from "@/Hook/useAjax"
+import { setBackApi } from "@/services/gameData/order"
+import { InputNumber, Modal, message } from "antd"
+import React, { useState } from "react"
+
+interface Props {
+    data: any
+    visible?: boolean
+    onClose?: () => void
+    onChange?: () => void
+}
+const Back: React.FC<Props> = ({ data, visible, onClose, onChange }) => {
+
+    /****************************/
+    const [backMoney, setBackMoney] = useState<number>()
+    const setBack = useAjax((params) => setBackApi(params))
+    /****************************/
+
+    const handleOk = () => {
+        if (backMoney) {
+            setBack.run({ type: data.backTableName, id: data.backId, backMoney }).then(res => {
+                if (res) {
+                    message.success('回传成功')
+                    onChange?.()
+                }
+            })
+        } else {
+            message.error('请输入回传金额')
+        }
+    }
+
+
+    return <Modal
+        title="手动回传"
+        visible={visible}
+        onCancel={onClose}
+        onOk={handleOk}
+    >
+        <InputNumber placeholder="请输入回传金额" value={backMoney} onChange={(e) => setBackMoney(e)} style={{ width: '100%' }} />
+    </Modal>
+}
+
+export default React.memo(Back)

+ 24 - 5
src/pages/gameDataStatistics/order/index.tsx

@@ -7,16 +7,20 @@ import columns12 from "./tableConfig"
 import { getPresets } from "@/components/QueryForm/const"
 import moment from "moment"
 import Details from "./details"
-import TablePro from "../components/TablePro"
+import modal from "antd/lib/modal"
+import { InputNumber, message } from "antd"
+import Back from "./back"
 
 
 const Order: React.FC = () => {
 
     /***************************/
-    const [queryForm, setQueryForm] = useState<OrderListType>({ pageNum: 1, pageSize: 100, sourceSystem: 'ZX_ONE', sortFiled: 'orderCreateTime', sortType: 'desc' })
+    const [queryForm, setQueryForm] = useState<OrderListType>({ pageNum: 1, pageSize: 40, sourceSystem: 'ZX_ONE', sortFiled: 'orderCreateTime', sortType: 'desc' })
     const [totalData, setTotalData] = useState<any[]>([])
     const [visible, setVisible] = useState<boolean>(false)
     const [orderData, setOrderData] = useState<any>({})
+    const [backVisible, setBackVisible] = useState<boolean>(false)
+    const [backData, setBackData] = useState<any>({})
     const getOrderList = useAjax((params) => getOrderListApi(params))
     const getOrderTotal = useAjax((params) => getOrderTotalApi(params))
     /***************************/
@@ -36,8 +40,22 @@ const Order: React.FC = () => {
         setVisible(true)
     }
 
-    return <div>
+    const back = (data: any) => {
+        setBackData(data)
+        setBackVisible(true)
+    }
 
+    return <div>
+        {backVisible && <Back
+            data={backData}
+            visible={backVisible}
+            onClose={() => { setBackVisible(false); setBackData({}) }}
+            onChange={() => {
+                setBackVisible(false); 
+                setBackData({});
+                getOrderList.refresh()
+            }}
+        />}
         <TableData
             leftChild={<QueryForm
                 initialValues={{ sourceSystem: 'ZX_ONE' }}
@@ -103,6 +121,7 @@ const Order: React.FC = () => {
                 isUserName
                 isPayIntervalTime={{ tips: '充值距注册时间区间(分钟)' }}
                 isAgentId
+                isBackStatus
                 payTimeDay={{ ranges: getPresets() }}
                 isRegDay={{ ranges: getPresets() }}
                 placeAnOrderDay={{ ranges: getPresets() }}
@@ -111,7 +130,7 @@ const Order: React.FC = () => {
             totalData={totalData}
             scroll={{ x: 1000, y: 600 }}
             ajax={getOrderList}
-            fixed={{ left: 3, right: 2 }}
+            fixed={{ left: 3, right: 3 }}
             dataSource={getOrderList?.data?.records?.map((item: any, index: number) => ({ ...item, id: item?.orderId?.replace(/\D/g, '') || index }))}
             total={getOrderList?.data?.total}
             page={queryForm.pageNum}
@@ -132,7 +151,7 @@ const Order: React.FC = () => {
                 newQueryForm.pageSize = pageSize
                 setQueryForm({ ...newQueryForm })
             }}
-            config={columns12(onDetail)}
+            config={columns12(onDetail, back)}
             configName={'订单明细'}
         />
 

+ 40 - 23
src/pages/gameDataStatistics/order/tableConfig.tsx

@@ -1,12 +1,38 @@
 import { PayScene, PayStatus, PayType, gameClassifyEnum } from "@/components/QueryForm/const"
 import WidthEllipsis from "@/components/widthEllipsis"
-import { Statistic } from "antd"
+import { Badge, Space, Statistic } from "antd"
 import React from "react"
 
-
-function columns12(onDetail: (data: any) => void): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
+function columns12(onDetail: (data: any) => void, back: (b: any) => void): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
 
     return [
+        {
+            label: '回传信息',
+            data: [
+                {
+                    title: '角色累计充值金额', dataIndex: 'roleTotalAmount', label: '回传信息', align: 'center', width: 100, default: 34,
+                    render: (a: any, b: any) => <Statistic value={a || 0} valueStyle={b?.day === '总计' ? { color: 'red' } : {}} precision={2} />
+                },
+                {
+                    title: '角色累计充值次数', dataIndex: 'roleTotalAmountCount', label: '回传信息', align: 'center', width: 90, default: 35,
+                    render: (a: any, b: any) => <Statistic value={a || 0} valueStyle={b?.day === '总计' ? { color: 'red' } : {}} />
+                },
+                {
+                    title: '回传状态', dataIndex: 'backStatus', label: '回传信息', width: 100, default: 38,
+                    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: 'backMoney', label: '回传信息', align: 'center', width: 90, default: 36,
+                    render: (a: any, b: any) => <Statistic value={a || 0} valueStyle={b?.day === '总计' ? { color: 'red' } : {}} precision={2} />
+                },
+                {
+                    title: '回传信息', dataIndex: 'backMsg', label: '回传信息', align: 'center', width: 150, default: 37,
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                }
+            ]
+        },
         {
             label: '订单明细',
             data: [
@@ -66,18 +92,6 @@ function columns12(onDetail: (data: any) => void): { label: string, fieldSHow?:
                     title: '归因投放人员', dataIndex: 'zxPitcherName', label: '订单明细', align: 'center', width: 65, default: 12,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
-                // {
-                //     title: '归因推广账号', dataIndex: 'accountId', label: '订单明细', align: 'center', width: 80, default: 13,
-                //     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
-                // },
-                // {
-                //     title: '归因媒体', dataIndex: 'accountType', label: '订单明细', align: 'center', width: 70, default: 14,
-                //     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
-                // },
-                // {
-                //     title: '归因广告', dataIndex: 'adId', label: '订单明细', align: 'center', width: 70, default: 15,
-                //     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
-                // },
                 {
                     title: '玩家充值游戏', dataIndex: 'orderGameName', label: '订单明细', align: 'center', width: 70, default: 13,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
@@ -197,7 +211,7 @@ function columns12(onDetail: (data: any) => void): { label: string, fieldSHow?:
                     render: (a: string, b: any) => (<WidthEllipsis value={PayStatus[a]} />)
                 },
                 {
-                    title: '是否首充', dataIndex: 'isFirstRecharge', label: '订单明细', align: 'center', width: 45, default: 34,
+                    title: '是否首充', dataIndex: 'isFirstRecharge', label: '订单明细', align: 'center', width: 45, default: 39,
                     render: (a: any, b: any) => {
                         if (b?.day !== '总计') {
                             return a == 1 ? '是' : '否'
@@ -206,15 +220,18 @@ function columns12(onDetail: (data: any) => void): { label: string, fieldSHow?:
                     }
                 },
                 {
-                    title: '操作', 
-                    dataIndex: 'cz', 
-                    label: '订单明细', 
-                    align: 'center', 
-                    width: 70, 
-                    default: 35,
+                    title: '操作',
+                    dataIndex: 'cz',
+                    label: '订单明细',
+                    align: 'center',
+                    width: 100,
+                    default: 40,
                     render: (a: any, b: any) => {
                         if (b?.day !== '总计') {
-                            return <a onClick={() => onDetail(b)}>订单详情</a>
+                            return <Space>
+                                {(b?.backStatus !== 2 && b?.backStatus !== 1) && <a onClick={() => back(b)}>回传</a>}
+                                <a onClick={() => onDetail(b)}>订单详情</a>
+                            </Space>
                         }
                         return '--'
 

+ 22 - 4
src/services/gameData/order.ts

@@ -1,5 +1,5 @@
 import { request } from 'umi';
-import { api } from '../api';
+import { api, erpApi } from '../api';
 import { Paging, SortProps } from './rankingList';
 let wapi = api + '/gameData'
 
@@ -18,13 +18,13 @@ export interface OrderListType extends Paging, SortProps {
     // CP订单号
     cpOrderId?: string
     // CP通知状态 // 1为待处理,2为成功,-1为失败
-    cpStatus?: string, 
+    cpStatus?: string,
     // 操作系统
     deviceSystem?: string,
     // 游戏ID
     gameId?: number
     // 是否首充 0 否 1 是
-    isFirstRecharge?: string, 
+    isFirstRecharge?: string,
     // 商户号
     merchantNo?: string
     // 第三方支付订单号
@@ -51,7 +51,7 @@ export interface OrderListType extends Paging, SortProps {
     regTimeStart?: string
     // 玩家注册时间-结束
     regTimeEnd?: string
-    
+
     // 下单时间开始
     beginDate?: string,
     // 下单时间结束
@@ -100,4 +100,22 @@ export async function getOrderCpNoticeApi(data: CpLogListProps) {
         method: 'POST',
         data
     });
+}
+
+
+export async function setBackApi(data: { type: 'byte' | 'tencent_mini' | 'tencent_h5', id: any, backMoney: number }) {
+    switch (data.type) {
+        case 'byte':
+            return request(erpApi + `/gameBack/oceanengine/orderReport/${data.id}/${data.backMoney}`, {
+                method: 'POST'
+            });
+        case 'tencent_mini':
+            return request(erpApi + `/gameBack/tencentMiniGame/orderReport/${data.id}/${data.backMoney}`, {
+                method: 'POST'
+            });
+        case 'tencent_h5':
+            return request(erpApi + `/gameBack/tencent/orderReport/${data.id}/${data.backMoney}`, {
+                method: 'POST'
+            });
+    }
 }