import request from '@/utils/request';
import { tableList } from '@/utils/format';
import { wrapTreeNode } from '@/utils/format';
import type { BankRoyaltyParams } from './data';
import type {REVENUECONFIRMModel} from "./data";

// // 获取客无忧交易和收银交易流水订单比较列表
// export async function GetSellMasterCompareList(params?: any) {
//   const data = await request(`/Revenue/GetSellMasterCompareList?serverpartShopIds=${params.serverpartShopIds}&startDate=${params.startDate}&endDate=${params.endDate}`, {
//     method: 'POST',
//     data: params,
//   });

//   if (data.Result_Code !== 100) {
//     return {
//       data: [],
//       current: 1,
//       pageSize: 10,
//       total: 0,
//       success: false
//     };
//   }
//   return tableList(data.Result_Data);
// }


// 根据销售流水重新生成自然日报表数据
export async function getRebuildDailyAccount(params: any) {
  const data = await request('/Verification/RebuildDailyAccount', {
    method: 'GET',
    params
  })

  return data
}

// 获取服务区日度营收拆分表列表
export async function GetREVENUEDAILYSPLITList(params?: any) {
  const data = await request(`/Revenue/GetREVENUEDAILYSPLITList`, {
    method: 'POST',
    data: params,
  });

  if (data.Result_Code !== 100) {
    return {
      data: [],
      current: 1,
      pageSize: 10,
      total: 0,
      success: false
    };
  }
  return tableList(data.Result_Data);
}


// 批量更新同步服务区日度营收拆分表
export async function SynchroREVENUEDAILYSPLIT(REVENUECONFIRMList: REVENUECONFIRMModel[]) {
  return  request(`/Revenue/ModifyRevenueDailySplitList`, {
    method: 'POST',
    data: REVENUECONFIRMList,
  });

}
