/// <summary> /// 丰富信息 /// </summary> /// <returns></returns> private CustomerOrderInfoModel DecorateCustomerOrderInfo(CustomerOrderInfo model) { var ApplicationInfos = new List <ApplicationInfoModel>(); model.ApplicationInfos.ToList().ForEach(m => ApplicationInfos.Add(new ApplicationInfoModel() { ApplicationID = m.ApplicationID, ApplicationName = m.ApplicationName, HSCode = m.HSCode, PickingName = m.PickingName, Qty = m.Qty ?? 0, Remark = m.Remark, Total = m.Total ?? 0, UnitPrice = m.UnitPrice ?? 0, UnitWeight = m.UnitWeight ?? 0, WayBillNumber = m.WayBillNumber })); var customer = _customerService.GetCustomer(model.CustomerCode); var customerOrderInfoModel = new CustomerOrderInfoModel() { CustomerOrderID = model.CustomerOrderID, CustomerOrderNumber = model.CustomerOrderNumber, CustomerCode = model.CustomerCode, TrackingNumber = model.TrackingNumber, ShippingMethodId = model.ShippingMethodId ?? 0, ShippingMethodName = model.ShippingMethodName, GoodsTypeID = model.GoodsTypeID ?? 0, InsuredID = model.InsuredID ?? 0, IsReturn = model.IsReturn, IsInsured = model.IsInsured, IsBattery = model.IsBattery, IsPrinted = model.IsPrinted, IsHold = model.IsHold, Status = model.Status, CreatedOn = model.CreatedOn, SensitiveTypeID = model.SensitiveTypeID ?? 0, PackageNumber = model.PackageNumber, AppLicationType = model.AppLicationType, Weight = model.Weight, Length = model.Length, Width = model.Width, Height = model.Height, ApplicationInfoList = ApplicationInfos, WayBillInfos = model.WayBillInfos.ToList(), WayBillNumber = model.WayBillInfos.FirstOrDefault() == null ? "" : model.WayBillInfos.FirstOrDefault().WayBillNumber, ShippingAddress = (model.ShippingInfo.ShippingAddress + " " + model.ShippingInfo.ShippingAddress1 + " " + model.ShippingInfo.ShippingAddress2).Trim(), ShippingCity = model.ShippingInfo.ShippingCity, ShippingCompany = model.ShippingInfo.ShippingCompany, ShippingFirstLastName = model.ShippingInfo.ShippingFirstName + " " + model.ShippingInfo.ShippingLastName, ShippingFirstName = model.ShippingInfo.ShippingFirstName, ShippingLastName = model.ShippingInfo.ShippingLastName, ShippingPhone = model.ShippingInfo.ShippingPhone, ShippingState = model.ShippingInfo.ShippingState, ShippingZip = model.ShippingInfo.ShippingZip, ShippingTaxId = model.ShippingInfo.ShippingTaxId, CountryCode = model.ShippingInfo.CountryCode, CustomerName = customer.Name, ShippingZone = GetShippingZone(model.ShippingMethodId ?? 0, model.ShippingInfo.ShippingZip, model.ShippingInfo.CountryCode), }; if (string.IsNullOrWhiteSpace(customerOrderInfoModel.TrackingNumber)) { var firstOrDefault = customerOrderInfoModel.WayBillInfos.FirstOrDefault(); if (firstOrDefault != null) { customerOrderInfoModel.TrackingNumber = firstOrDefault.WayBillNumber; } } customerOrderInfoModel.BarCode = "<img id=\"img\" src=\"/barcode.ashx?m=0&h=35&vCode=" + customerOrderInfoModel.TrackingNumber + "\" alt=\"" + customerOrderInfoModel.TrackingNumber + "\" style=\"width:200px;height:35px;\" />"; customerOrderInfoModel.BarCode128 = "<img id=\"img\" src=\"/print/barcode128h?Code=" + customerOrderInfoModel.TrackingNumber + "\" alt=\"" + customerOrderInfoModel.TrackingNumber + "\" style=\"\" />"; customerOrderInfoModel.CustomerOrderNumberCode39 = "<img id=\"img\" src=\"/print/barcode39?Code=" + customerOrderInfoModel.CustomerOrderNumber + "\" alt=\"" + customerOrderInfoModel.CustomerOrderNumber + "\" style=\"\" />"; customerOrderInfoModel.CustomerOrderNumberCode128 = "<img id=\"img\" src=\"/print/barcode128?Code=" + customerOrderInfoModel.CustomerOrderNumber + "\" alt=\"" + customerOrderInfoModel.CustomerOrderNumber + "\" style=\"\" />"; customerOrderInfoModel.CustomerOrderNumberCode128L = "<img id=\"img\" src=\"/print/barcode128?Code=" + customerOrderInfoModel.CustomerOrderNumber + "&dpiy=40\" alt=\"" + customerOrderInfoModel.CustomerOrderNumber + "\" style=\"\" />"; customerOrderInfoModel.TrackingNumberCode39 = "<img id=\"img\" src=\"/print/barcode39?Code=" + customerOrderInfoModel.TrackingNumber + "\" alt=\"" + customerOrderInfoModel.TrackingNumber + "\" style=\"\" />"; customerOrderInfoModel.TrackingNumberCode128 = "<img id=\"img\" src=\"/print/barcode128?Code=" + customerOrderInfoModel.TrackingNumber + "\" alt=\"" + customerOrderInfoModel.TrackingNumber + "\" style=\"\" />"; customerOrderInfoModel.WayBillNumberCode39 = "<img id=\"img\" src=\"/print/barcode39?Code=" + customerOrderInfoModel.WayBillNumber + "\" alt=\"" + customerOrderInfoModel.WayBillNumber + "\" style=\"\" />"; customerOrderInfoModel.WayBillNumberCode128 = "<img id=\"img\" src=\"/print/barcode128?Code=" + customerOrderInfoModel.WayBillNumber + "\" alt=\"" + customerOrderInfoModel.WayBillNumber + "\" style=\"\" />"; customerOrderInfoModel.CustomerOrderNumberCode128Lh = "<img id=\"img\" src=\"/print/barcode128?Code=" + customerOrderInfoModel.CustomerOrderNumber + "&dpiy=40&angleF=90&showText=true\" alt=\"" + customerOrderInfoModel.CustomerOrderNumber + "\" style=\"\" />"; var country = GetCountryList().Single(c => c.CountryCode == customerOrderInfoModel.CountryCode); customerOrderInfoModel.CountryName = country.Name; customerOrderInfoModel.CountryChineseName = country.ChineseName; var mouthCountry = GetMouthCountryList().Find(c => c.CountryCode == customerOrderInfoModel.CountryCode); customerOrderInfoModel.MouthNumber = mouthCountry == null ? 0 : mouthCountry.MouthNumber; customerOrderInfoModel.SortingIdentity = GetSortingIdentityHtml(model.ShippingInfo.ShippingZip, model.ShippingInfo.CountryCode); customerOrderInfoModel.BatteryIdentity = (model.IsBattery && (model.SensitiveTypeID == 1 || model.SensitiveTypeID == 2)) ? "D" : ""; return(customerOrderInfoModel); }
public ScanPrintLabelViewModel() { PrintTemplate = new List <SelectListItem>(); Filter = new ScanPrintLabelFilter(); OrderInfoModel = new CustomerOrderInfoModel(); }