public ActionResult OutFeeInfoToExecl(InFeeListFilterModel filterModel)
        {
            var model     = ListExport(filterModel);
            var titleList = new List <string> {
                "WayBillNumber-运单号", "CustomerOrderNumber-客户订单号", "CustomerCode-客户代码", "InDateTime-收货时间",
                "TrackingNumber-跟踪号", "ChineseName-发货国家", "InShippingName-运输方式", "SettleWeight-计费重量",
                "Freight-运费", "Register-挂号费", "FuelCharge-燃油费", "Surcharge-附加费", "TotalFee-总费用"
            };

            ExportExcelByWeb.WriteToDownLoad(model.List, titleList, null);
            return(View(model));
        }
        public ActionResult ToExecl(BillingViewModels param)
        {
            var viewModel = List(param.Filter);
            var list      = new List <BillingExecModel>();

            viewModel.BillingList.InnerList.ForEach(p =>
            {
                var m = new BillingExecModel()
                {
                    Balance                  = p.Balance,
                    CreatedOn                = p.CreatedOn,
                    CustomerCode             = p.CustomerCode,
                    MoneyChangeTypeShortName = p.MoneyChangeTypeShortName,
                    Remark       = p.Remark,
                    SerialNumber = p.SerialNumber,
                    InCash       = 0,
                    OutCash      = 0
                };
                if (p.Amount.HasValue)
                {
                    if (p.Amount.Value > 0)
                    {
                        m.InCash = p.Amount.Value;
                    }
                    else
                    {
                        m.OutCash = p.Amount.Value;
                    }
                }
                list.Add(m);
            });
            var titleList = new List <string> {
                "CustomerCode-客户代码", "CreatedOn-日期", "MoneyChangeTypeShortName-费用类型", "Remark-费用说明", "InCash-进账金额", "OutCash-出账金额", "Balance-帐户结余"
            };

            ExportExcelByWeb.WriteToDownLoad(list, titleList, null);
            return(View(viewModel));
        }
Example #3
0
        public ActionResult ExportMailReturnGoods(MailReturnGoodsLogsParam filterModel)
        {
            var titleList = new List <string>
            {
                "TrackNumber-包裹单号",
                "InShippingMethodName-运输方式",
                "CountryCode-发货国家",
                "Weight-重量kg",
                "ReturnReason-退回原因",
                "ReturnOn-退回时间",
                "ReturnBy-退回操作人"
            };

            var getModel = ReturnBagLogDataBind(filterModel);
            var getList  = getModel.PagedList.InnerList;


            string fileName = "退件记录查询导出" + DateTime.Now.ToString("yyyy-dd-MM-hh-mm-ss");

            ExportExcelByWeb.ListExcel(fileName, getList, titleList);

            return(View(getModel));
        }
        public void ExportExcel(string VenderCode, string ShippingMethodId, DateTime?StartTime, DateTime?EndTime, int?Status, int?SearchWhere, string SearchContext, int ShippingType, int page = 1, int pageSize = 20)
        {
            HttpContext.Server.ScriptTimeout = 100 * 60; //10 minutes
            Log.Info("开始导出小包发货费用");
            var filter    = GetFilter(VenderCode, ShippingMethodId, StartTime, EndTime, Status, SearchWhere, SearchContext, page, ShippingType, pageSize);
            var titleList = new List <string>
            {
                "WayBillNumber-运单号",
                "CustomerOrderNumber-客户订单号",
                "CustomerName-客户名称",
                "Trackingnumber-跟踪号",
                "VenderName-服务商",
                "OutStorageCreatedOn-发货时间",
                "CountryCode-发货国家",
                "ShippingmethodName-运输方式",
                "SetWeight-计费重量",
                "Weight-称重重量",
                "AprroveWeight-最终重量",
                "Freight-运费",
                "Register-挂号费",
                "FuelCharge-燃油费",
                "Surcharge-附加费",
                "TariffPrepayFee-关税服务费用",
                "TotalFee-系统总费用",
                "TotalFeeFinal-最终总费用",
                "StatusStr-状态",
                "Auditor-审核人",
                "AuditorDate-审核时间"
            };
            ExportFile result = new ExportFile();

            try
            {
                string fileName = "DeliveryCostDetailsReview-" + filter.VenderCode + "-" + DateTime.Now.ToString("yyyy-dd-MM-hh-mm-ss") + "1";
                filter.IsExportExcel = true;//设置获取全部
                Log.Info("开始转化小包查询参数");
                DeliveryReviewParam para = Mapper.Map <DeliveryCostDetailsFilterModel, DeliveryReviewParam>(filter);
                Log.Info("完成转化小包查询参数");
                var exports = new List <DeliveryFeeExportExcel>();
                Log.Info("开始获取小包的运输方式");
                var list = GetShippingMethods(para.VenderCode, ShippingType);
                Log.Info("完成获取小包的运输方式");
                if (list != null && list.Any())
                {
                    Log.Info("开始查询小包发货费用列表");
                    para.ShippingMethodIds = list.Select(p => p.ShippingMethodId).ToArray();
                    var data = _financialService.ExportExcel(para);
                    foreach (var d in data)
                    {
                        var t = new DeliveryFeeExportExcel
                        {
                            AprroveWeight       = d.AprroveWeight,
                            Auditor             = d.Auditor,
                            AuditorDate         = d.AuditorDate,
                            CountryChineseName  = d.CountryChineseName,
                            CountryCode         = d.CountryCode,
                            CustomerName        = d.CustomerName,
                            CreatedBy           = d.CreatedBy,
                            CreatedOn           = d.CreatedOn,
                            CustomerOrderNumber = d.CustomerOrderNumber,
                            DeliveryFeeID       = d.DeliveryFeeID,
                            Freight             = d.Freight,
                            FuelCharge          = d.FuelCharge,
                            LastUpdatedBy       = d.LastUpdatedBy,
                            LastUpdatedOn       = d.LastUpdatedOn,
                            OutStorageCreatedOn = d.OutStorageCreatedOn,
                            Register            = d.Register,
                            Remark             = d.Remark,
                            SetWeight          = d.SetWeight,
                            ShippingmethodID   = d.ShippingmethodID,
                            ShippingmethodName = d.ShippingmethodName,
                            Status             = d.Status,
                            StatusStr          = ConvertStatusToString(d.Status),
                            Surcharge          = d.Surcharge,
                            TariffPrepayFee    = d.TariffPrepayFee,
                            TotalFee           = d.TotalFee,
                            TotalFeeFinal      = d.TotalFeeFinal,
                            Trackingnumber     = d.Trackingnumber,
                            VenderCode         = d.VenderCode,
                            VenderData         = d.VenderData,
                            VenderId           = d.VenderId,
                            VenderName         = d.VenderName,
                            WayBillNumber      = d.WayBillNumber,
                            Weight             = d.Weight
                        };
                        exports.Add(t);
                    }
                    Log.Info("完成查询小包发货费用列表");
                }
                Log.Info("开始生成小包execl");
                ExportExcelByWeb.ListExcel(fileName, exports, titleList);
                Log.Info("完成生成小包execl");
                result.IsSuccess = true;
                result.FilePaths = new string[] { fileName };
            }
            catch (Exception ex)
            {
                result.ErrorMessage = ex.Message;
            }
        }
        public ActionResult ExpressExportExcel(ExpressDeliveryFeeListFilterModel filter)
        {
            HttpContext.Server.ScriptTimeout = 100 * 60; //10 minutes
            Log.Info("开始导出快递发货费用");
            string fileName = "ExpressDeliveryFeeList-" + filter.VenderCode + "-" + DateTime.Now.ToString("yyyy-dd-MM-hh-mm-ss") + "1";
            var    list     = new List <ExpressDeliveryFeeModel>();

            Log.Info("开始获取快递的运输方式");
            var shippingMethods = GetShippingMethods(filter.VenderCode, filter.ShippingType);

            Log.Info("完成获取快递的运输方式");
            if (shippingMethods != null && shippingMethods.Any())
            {
                Log.Info("开始查询快递发货费用列表");
                _financialService.ExportExcel(new DeliveryReviewParam()
                {
                    EndTime           = filter.EndTime,
                    Page              = filter.Page,
                    PageSize          = filter.PageSize,
                    SearchContext     = filter.SearchContext,
                    SearchWhere       = filter.SearchWhere,
                    ShippingMethodId  = filter.ShippingMethodId,
                    StartTime         = filter.StartTime,
                    Status            = filter.Status,
                    VenderCode        = filter.VenderCode,
                    IsExportExcel     = true,
                    ShippingMethodIds = shippingMethods.Select(p => p.ShippingMethodId).ToArray(),
                }, false, true).ForEach(d => list.Add(new ExpressDeliveryFeeModel()
                {
                    AprroveWeight       = d.AprroveWeight,
                    Auditor             = d.Auditor,
                    AuditorDate         = d.AuditorDate,
                    CountryChineseName  = d.CountryChineseName,
                    CountryCode         = d.CountryCode,
                    CustomerName        = d.CustomerName,
                    CreatedBy           = d.CreatedBy,
                    CreatedOn           = d.CreatedOn,
                    CustomerOrderNumber = d.CustomerOrderNumber,
                    DeliveryFeeID       = d.DeliveryFeeID,
                    Freight             = d.Freight,
                    FuelCharge          = d.FuelCharge,
                    LastUpdatedBy       = d.LastUpdatedBy,
                    LastUpdatedOn       = d.LastUpdatedOn,
                    OutStorageCreatedOn = d.OutStorageCreatedOn,
                    Register            = d.Register,
                    Remark                   = d.Remark,
                    SetWeight                = d.SetWeight,
                    ShippingmethodID         = d.ShippingmethodID,
                    ShippingmethodName       = d.ShippingmethodName,
                    Status                   = d.Status,
                    StatusStr                = ConvertStatusToString(d.Status),
                    Surcharge                = d.Surcharge,
                    TariffPrepayFee          = d.TariffPrepayFee,
                    OverWeightLengthGirthFee = d.OverWeightLengthGirthFee,
                    SecurityAppendFee        = d.SecurityAppendFee,
                    AddedTaxFee              = d.AddedTaxFee,
                    OtherFee                 = d.OtherFee,
                    OtherFeeRemark           = d.OtherFeeRemark,
                    TotalFee                 = d.TotalFee,
                    TotalFeeFinal            = d.TotalFeeFinal,
                    Trackingnumber           = d.Trackingnumber,
                    VenderCode               = d.VenderCode,
                    VenderId                 = d.VenderId,
                    VenderName               = d.VenderName,
                    WayBillNumber            = d.WayBillNumber,
                    Weight                   = d.Weight,
                }));
                Log.Info("完成查询快递发货费用列表");
            }
            Log.Info("开始生成快递execl");
            var titleList = new List <string>
            {
                "WayBillNumber-运单号",
                "CustomerOrderNumber-客户订单号",
                "CustomerName-客户名称",
                "Trackingnumber-跟踪号",
                "VenderName-服务商",
                "OutStorageCreatedOn-发货时间",
                "CountryCode-发货国家",
                "ShippingmethodName-运输方式",
                "SetWeight-计费重量",
                "Weight-称重重量",
                "AprroveWeight-最终重量",
                "Freight-运费",
                "Register-挂号费",
                "FuelCharge-燃油费",
                "Surcharge-附加费",
                "TariffPrepayFee-关税服务费用",
                "OverWeightLengthGirthFee-超长超重超周长费",
                "SecurityAppendFee-安全附加费",
                "AddedTaxFee-增值税费",
                "OtherFee-杂费",
                "OtherFeeRemark-杂费备注",
                "TotalFee-系统总费用",
                "TotalFeeFinal-最终总费用",
                "StatusStr-状态",
                "Auditor-审核人",
                "AuditorDate-审核时间"
            };

            ExportExcelByWeb.ListExcel(fileName, list, titleList);
            Log.Info("完成生成快递execl");
            Log.Info("完成导出快递发货费用");
            return(new EmptyResult());
        }