import {customerOrderFinishPie, transportTypeOrderFinishPie} from '../../../api/apiList';

export const getTransportTypeOrderFinishPie = async (callback,date) => {
  let choiceMap = {
    '10': '汽运',
    '20': '铁运',
    '30': '水运',
    '50': '码头/仓库',
  }
  let resList = new Array();
  let data = {"10":{"pre_buy_settle_amount":168825.74767,"cur_gross_profit_amount":97617.06634,"cur_sell_settle_amount":161709.98145,"pre_unit_weight":20541.888,"pre_sell_settle_amount":947153.95138,"cur_transport_type":"10","cur_buy_settle_amount":64092.91511,"pre_gross_profit_amount":778328.20371,"cur_unit_weight":8306.726},"20":{"pre_buy_settle_amount":0,"cur_gross_profit_amount":0,"cur_sell_settle_amount":0,"pre_unit_weight":0,"pre_sell_settle_amount":0,"cur_transport_type":"20","cur_buy_settle_amount":0,"pre_gross_profit_amount":0,"cur_unit_weight":0},"30":{"pre_buy_settle_amount":45627.6114,"cur_gross_profit_amount":-25654.24,"cur_sell_settle_amount":48353.725,"pre_unit_weight":3743.459,"pre_sell_settle_amount":165140.1423,"cur_transport_type":"30","cur_buy_settle_amount":74007.965,"pre_gross_profit_amount":119512.5309,"cur_unit_weight":2583.125},"50":{"pre_buy_settle_amount":0,"cur_gross_profit_amount":0,"cur_sell_settle_amount":0,"pre_unit_weight":0,"pre_sell_settle_amount":0,"cur_transport_type":"50","cur_buy_settle_amount":0,"pre_gross_profit_amount":0,"cur_unit_weight":0}}
  for (let key in choiceMap) {
    resList.push({name: choiceMap[key], value: data[key].cur_unit_weight});
  }
  callback(resList);
  return resList
}
export const getCustomerOrderFinishPie = async (callback,date) => {
  let resList = new Array();
  let data = {"上海******有限公司1":{"cur_gross_profit_amount":1381.535,"cur_sell_settle_amount":48353.725,"entrust_agency_name":"上海******有限公司1","cur_buy_settle_amount":46972.19,"cur_unit_weight":1381.535},"上海******有限公司2":{"cur_gross_profit_amount":735.775,"cur_sell_settle_amount":0,"entrust_agency_name":"上海******有限公司2","cur_buy_settle_amount":735.775,"cur_unit_weight":1201.59},"浙江******有限公司":{"cur_gross_profit_amount":1237.95,"cur_sell_settle_amount":1237.95,"entrust_agency_name":"浙江******有限公司","cur_buy_settle_amount":0,"cur_unit_weight":160.506},"上海******有限公司3":{"cur_gross_profit_amount":460.7568,"cur_sell_settle_amount":1330.8498,"entrust_agency_name":"上海******有限公司3","cur_buy_settle_amount":870.093,"cur_unit_weight":135.801},"天津******有限公司":{"cur_gross_profit_amount":938.212,"cur_sell_settle_amount":0,"entrust_agency_name":"天津******有限公司","cur_buy_settle_amount":938.212,"cur_unit_weight":520.244},"南京******有限公司":{"cur_gross_profit_amount":359.415,"cur_sell_settle_amount":1096.245,"entrust_agency_name":"南京******有限公司","cur_buy_settle_amount":736.83,"cur_unit_weight":730.083},"北京******有限公司":{"cur_gross_profit_amount":2318.555,"cur_sell_settle_amount":2318.555,"entrust_agency_name":"北京******有限公司","cur_buy_settle_amount":0,"cur_unit_weight":440.45},"广州******有限公司":{"cur_gross_profit_amount":4211.0898,"cur_sell_settle_amount":4211.0898,"entrust_agency_name":"广州******有限公司","cur_buy_settle_amount":0,"cur_unit_weight":460.486},"青岛******有限公司":{"cur_gross_profit_amount":2502.201,"cur_sell_settle_amount":2502.201,"entrust_agency_name":"青岛******有限公司","cur_buy_settle_amount":0,"cur_unit_weight":300.147}};
  for (let key in data) {
    resList.push({name: key, value: data[key].cur_unit_weight});
  }
  callback(resList);
  return resList
}
