|
|
@@ -435,27 +435,50 @@ namespace ShwasherSys.OrderSendInfo
|
|
|
await Repository.UpdateAsync(entity);
|
|
|
}
|
|
|
|
|
|
- public async Task<string> ExportOrderSend(EntityDto<string> input)
|
|
|
- {
|
|
|
- var bill = await Repository.FirstOrDefaultAsync(input.Id);
|
|
|
- var orderSends =(await ViewOrderSendRepository.GetAllListAsync(i => i.OrderSendBillNo == input.Id)).OrderBy(i => i.SendBillSort).ThenByDescending(i => i.SendDate).ToList();
|
|
|
- var customerInfo =await CustomerRepository.FirstOrDefaultAsync(bill.CustomerId);
|
|
|
- var templateInfo = await QueryAppService.QueryTemplate(bill.CustomerId, 2);
|
|
|
- string[] classPath = templateInfo.ClassPath.Split("@@",StringSplitOptions.RemoveEmptyEntries);
|
|
|
- if (!classPath.Any())
|
|
|
- {
|
|
|
- CheckErrors(IdentityResult.Failed("未查到对应的classPath"));
|
|
|
- }
|
|
|
- string className = classPath[0];
|
|
|
- string methodName = classPath[1];
|
|
|
-
|
|
|
- var tpType = Type.GetType(className);
|
|
|
- object obj = Activator.CreateInstance(tpType ?? throw new InvalidOperationException());
|
|
|
- Object[] paras = { bill, orderSends, customerInfo, templateInfo };
|
|
|
- MethodInfo method = tpType.GetMethod(methodName);
|
|
|
- var result = method?.Invoke(obj, paras);
|
|
|
- return result?.ToString();
|
|
|
- }
|
|
|
+ //public async Task<string> ExportOrderSend(EntityDto<string> input)
|
|
|
+ //{
|
|
|
+ // var bill = await Repository.FirstOrDefaultAsync(input.Id);
|
|
|
+ // var orderSends =(await ViewOrderSendRepository.GetAllListAsync(i => i.OrderSendBillNo == input.Id)).OrderBy(i => i.SendBillSort).ThenByDescending(i => i.SendDate).ToList();
|
|
|
+ // var customerInfo =await CustomerRepository.FirstOrDefaultAsync(bill.CustomerId);
|
|
|
+ // var templateInfo = await QueryAppService.QueryTemplate(bill.CustomerId, 2);
|
|
|
+ // string[] classPath = templateInfo.ClassPath.Split("@@",StringSplitOptions.RemoveEmptyEntries);
|
|
|
+ // if (!classPath.Any())
|
|
|
+ // {
|
|
|
+ // CheckErrors(IdentityResult.Failed("未查到对应的classPath"));
|
|
|
+ // }
|
|
|
+ // string className = classPath[0];
|
|
|
+ // string methodName = classPath[1];
|
|
|
+
|
|
|
+ // var tpType = Type.GetType(className);
|
|
|
+ // object obj = Activator.CreateInstance(tpType ?? throw new InvalidOperationException());
|
|
|
+ // Object[] paras = { bill, orderSends, customerInfo, templateInfo };
|
|
|
+ // MethodInfo method = tpType.GetMethod(methodName);
|
|
|
+ // var result = method?.Invoke(obj, paras);
|
|
|
+ // return result?.ToString();
|
|
|
+ //}
|
|
|
+
|
|
|
+ // public async Task<string> ExportOrderSend(EntityDto<string> input)
|
|
|
+ // {
|
|
|
+ // var bill = await Repository.FirstOrDefaultAsync(input.Id);
|
|
|
+
|
|
|
+ //}
|
|
|
+
|
|
|
+ //处理特殊模板
|
|
|
+ private void HandlerMiniDto(OrderSendMiniExcelDto miniValue, Inspection.TemplateInfo templateInfo)
|
|
|
+ {
|
|
|
+ string[] classPath = templateInfo.ClassPath.Split("@@", StringSplitOptions.RemoveEmptyEntries);
|
|
|
+ if (!classPath.Any())
|
|
|
+ {
|
|
|
+ CheckErrors(IdentityResult.Failed("未查到对应的classPath"));
|
|
|
+ }
|
|
|
+ string className = classPath[0];
|
|
|
+ string methodName = classPath[1];
|
|
|
+ var tpType = Type.GetType(className);
|
|
|
+ object obj = Activator.CreateInstance(tpType ?? throw new InvalidOperationException());
|
|
|
+ Object[] paras = { miniValue };
|
|
|
+ MethodInfo method = tpType.GetMethod(methodName);
|
|
|
+ method?.Invoke(obj, paras);
|
|
|
+ }
|
|
|
|
|
|
public async Task<string> ExportOrderSendCommon(EntityDto<string> input)
|
|
|
{
|
|
|
@@ -463,66 +486,30 @@ namespace ShwasherSys.OrderSendInfo
|
|
|
var orderSends =
|
|
|
(await ViewOrderSendRepository.GetAllListAsync(i => i.OrderSendBillNo == input.Id)).OrderBy(i => i.SendBillSort).ThenByDescending(i => i.SendDate).ToList();
|
|
|
var customerInfo = await CustomerRepository.FirstOrDefaultAsync(bill.CustomerId);
|
|
|
- string path = AppDomain.CurrentDomain.BaseDirectory + "Resources/OrderSendTemplate/送货单模板2.xlsx";
|
|
|
+ var miniValue = ConvertToMiniExcelDto(bill,customerInfo,orderSends);
|
|
|
+
|
|
|
+ string path = AppDomain.CurrentDomain.BaseDirectory + "Resources/OrderSendTemplate/送货单模板.xlsx";
|
|
|
+ var fileName = $"送货单-{Clock.Now:yyMMddHHmmss}.xlsx";
|
|
|
if (orderSends.Any())
|
|
|
{
|
|
|
if (orderSends[0].SaleType == 2)
|
|
|
{
|
|
|
- path = AppDomain.CurrentDomain.BaseDirectory + "Resources/OrderSendTemplate/外销送货单模板2.xlsx";
|
|
|
-
|
|
|
- }
|
|
|
+ path = AppDomain.CurrentDomain.BaseDirectory + "Resources/OrderSendTemplate/外销送货单模板.xlsx";
|
|
|
+ }
|
|
|
}
|
|
|
- OrderSendMiniExcelDto miniValue = new OrderSendMiniExcelDto()
|
|
|
- {
|
|
|
- Ex1 = DateTime.Now.ToString("yyyy-MM-dd"),
|
|
|
- Ex2 = DateTime.Now.ToString("yyyy年MM月dd日"),
|
|
|
- OrderSendBillNo = bill.Id,
|
|
|
- SendAddress = bill.SendAddress,
|
|
|
- CustomerName = customerInfo.CustomerName,
|
|
|
- ContactTels = bill.ContactTels,
|
|
|
- ContactMan = bill.ContactMan
|
|
|
- };
|
|
|
- var savePath = "Download/Excel/OrderSendBill";
|
|
|
- var fileName = $"送货单-{Clock.Now:yyMMddHHmmss}.xlsx";
|
|
|
- int index = 0;
|
|
|
- decimal allPackageCount = 0;
|
|
|
- decimal allSendQuantity = 0;
|
|
|
- decimal allTotalPrice = 0;
|
|
|
- List<OrderSendItemExcelDto> orderSendItem = new List<OrderSendItemExcelDto>();
|
|
|
- foreach (var send in orderSends)
|
|
|
+ var templateInfo = await QueryAppService.QueryTemplate(bill.CustomerId, 2);
|
|
|
+ if (templateInfo != null)
|
|
|
{
|
|
|
- OrderSendItemExcelDto item = new OrderSendItemExcelDto();
|
|
|
- var sendQuantity = Math.Round(Math.Floor(send.SendQuantity * 1000) / 1000, 3);//发货数量
|
|
|
- allSendQuantity += sendQuantity;
|
|
|
- var quantityPerPack = send.QuantityPerPack ?? 0;
|
|
|
- quantityPerPack = quantityPerPack == 0 ? sendQuantity : quantityPerPack;//每包数量,如果为0则等于发货数量
|
|
|
- decimal packageCount = sendQuantity == 0 ? 0 : (sendQuantity <= quantityPerPack ? 1 : Math.Floor(send.SendQuantity / quantityPerPack));
|
|
|
- var sysl = sendQuantity - quantityPerPack * packageCount;
|
|
|
- allPackageCount += packageCount + (sysl > 0 ? 1 : 0);
|
|
|
- item.Index = index + 1;
|
|
|
- item.StockNo = send.StockNo ?? send.OrderNo;
|
|
|
- item.PartNo = send.PartNo ?? "";
|
|
|
- item.ProductName = send.ProductName ?? "";
|
|
|
- item.Model = send.Model ?? "";
|
|
|
- item.SurfaceColor = send.SurfaceColor ?? "";
|
|
|
- item.Material = send.Material ?? "";
|
|
|
- item.Rigidity = send.Rigidity ?? "";
|
|
|
- item.Unit = "千件";
|
|
|
- item.SendQuantity = sendQuantity;
|
|
|
- item.PackageCount = packageCount;
|
|
|
- item.QuantityPerPack = quantityPerPack;
|
|
|
- item.Sysl = sysl;
|
|
|
- item.ProductBatchNum = send.ProductBatchNum ?? "";
|
|
|
- allTotalPrice += send.TotalPrice;
|
|
|
- orderSendItem.Add(item);
|
|
|
- index++;
|
|
|
+ if (!templateInfo.ClassPath.IsNullOrEmpty())
|
|
|
+ {
|
|
|
+ HandlerMiniDto(miniValue, templateInfo);
|
|
|
+ }
|
|
|
+ path = AppDomain.CurrentDomain.BaseDirectory + templateInfo.FilePath;
|
|
|
+ fileName = templateInfo.Name + fileName;
|
|
|
}
|
|
|
|
|
|
- miniValue.AllPackageCount = allPackageCount;
|
|
|
- miniValue.AllSendQuantity = allSendQuantity;
|
|
|
- miniValue.AllTotalPrice = allTotalPrice;
|
|
|
- miniValue.send = orderSendItem;
|
|
|
|
|
|
+ var savePath = "Download/Excel/OrderSendBill";
|
|
|
savePath = Path.Combine($"{AppDomain.CurrentDomain.BaseDirectory}{savePath}", fileName);
|
|
|
string resultPath = $"/Download/Excel/OrderSendBill/{fileName}";
|
|
|
//var result = work?.SaveWorkBook($"{AppDomain.CurrentDomain.BaseDirectory}{savePath}", fileName);
|
|
|
@@ -538,75 +525,135 @@ namespace ShwasherSys.OrderSendInfo
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private OrderSendMiniExcelDto ConvertToMiniExcelDto(OrderSendBill bill,Customer customerInfo,List<ViewOrderSend> orderSends)
|
|
|
+ {
|
|
|
+ OrderSendMiniExcelDto miniValue = new OrderSendMiniExcelDto()
|
|
|
+ {
|
|
|
+ Ex1 = DateTime.Now.ToString("yyyy-MM-dd"),
|
|
|
+ Ex2 = DateTime.Now.ToString("yyyy年MM月dd日"),
|
|
|
+ OrderSendBillNo = bill.Id,
|
|
|
+ SendAddress = bill.SendAddress,
|
|
|
+ CustomerName = customerInfo.CustomerName,
|
|
|
+ ContactTels = bill.ContactTels,
|
|
|
+ ContactMan = bill.ContactMan
|
|
|
+ };
|
|
|
+ miniValue.SendDate = bill.SendDate;
|
|
|
+ int index = 0;
|
|
|
+ decimal allPackageCount = 0;
|
|
|
+ decimal allSendQuantity = 0;
|
|
|
+ decimal allTotalPrice = 0;
|
|
|
+ List<OrderSendItemExcelDto> orderSendItem = new List<OrderSendItemExcelDto>();
|
|
|
+ foreach (var send in orderSends)
|
|
|
+ {
|
|
|
+ OrderSendItemExcelDto item = new OrderSendItemExcelDto();
|
|
|
+ var sendQuantity = Math.Round(Math.Floor(send.SendQuantity * 1000) / 1000, 3);//发货数量
|
|
|
+ allSendQuantity += sendQuantity;
|
|
|
+ var quantityPerPack = send.QuantityPerPack ?? 0;
|
|
|
+ quantityPerPack = quantityPerPack == 0 ? sendQuantity : quantityPerPack;//每包数量,如果为0则等于发货数量
|
|
|
+ decimal packageCount = sendQuantity == 0 ? 0 : (sendQuantity <= quantityPerPack ? 1 : Math.Floor(send.SendQuantity / quantityPerPack));
|
|
|
+ var sysl = sendQuantity - quantityPerPack * packageCount;
|
|
|
+ allPackageCount += packageCount + (sysl > 0 ? 1 : 0);
|
|
|
+ item.Index = index + 1;
|
|
|
+ item.StockNo = send.StockNo ?? send.OrderNo;
|
|
|
+ item.PartNo = send.PartNo ?? "";
|
|
|
+ item.ProductName = send.ProductName ?? "";
|
|
|
+ item.Model = send.Model ?? "";
|
|
|
+ item.SurfaceColor = send.SurfaceColor ?? "";
|
|
|
+ item.Material = send.Material ?? "";
|
|
|
+ item.Rigidity = send.Rigidity ?? "";
|
|
|
+ item.Unit = "千件";
|
|
|
+ item.SendQuantity = sendQuantity;
|
|
|
+ item.PackageCount = packageCount;
|
|
|
+ item.QuantityPerPack = quantityPerPack;
|
|
|
+ item.Sysl = sysl;
|
|
|
+ item.ProductBatchNum = send.ProductBatchNum ?? "";
|
|
|
+ item.SendDate = send.SendDate;
|
|
|
+ item.Remark = send.Remark;
|
|
|
+ item.Price = send.Price;
|
|
|
+ item.AfterTaxPrice = send.AfterTaxPrice;
|
|
|
+ allTotalPrice += send.TotalPrice;
|
|
|
+ orderSendItem.Add(item);
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+
|
|
|
+ miniValue.AllPackageCount = allPackageCount;
|
|
|
+ miniValue.AllSendQuantity = allSendQuantity;
|
|
|
+ miniValue.AllTotalPrice = allTotalPrice;
|
|
|
+ miniValue.send = orderSendItem;
|
|
|
+ return miniValue;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//public async Task<string> ExportOrderSendCommon2(EntityDto<string> input)
|
|
|
- // {
|
|
|
- // var bill = await Repository.FirstOrDefaultAsync(input.Id);
|
|
|
- // //var orderSends = (await ViewOrderSendRepository.GetAllListAsync(i => i.OrderSendBillNo == input.Id)).OrderBy(i=>i.SurfaceColor).ThenBy(i=>i.Rigidity).ToList();
|
|
|
- // var orderSends =
|
|
|
- // (await ViewOrderSendRepository.GetAllListAsync(i => i.OrderSendBillNo == input.Id)).OrderBy(i => i.SendBillSort).ThenByDescending(i=>i.SendDate).ToList();
|
|
|
-
|
|
|
-
|
|
|
- // var customerInfo = await CustomerRepository.FirstOrDefaultAsync(bill.CustomerId);
|
|
|
- // if (orderSends.Any())
|
|
|
- // {
|
|
|
- // if (orderSends[0].SaleType == 2)
|
|
|
- // {
|
|
|
- // return ExportOutSale(orderSends, bill, customerInfo);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // string path = AppDomain.CurrentDomain.BaseDirectory + "Resources/OrderSendTemplate/送货单模板.xlsx";
|
|
|
- // var savePath = "Download/Excel/OrderSendBill";
|
|
|
- // var work = ExcelHelper.CreateWorkBook07(path);
|
|
|
- // var sheet1 = work.GetSheet("Sheet1");
|
|
|
- // sheet1.GenerateCell(2, 1).SetCellValue("单号:"+bill.Id);
|
|
|
- // sheet1.GenerateCell(5, 2).SetCellValue("客户:" + customerInfo.CustomerName);
|
|
|
- // sheet1.GenerateCell(5, 10).SetCellValue("地址:" + bill.SendAddress);
|
|
|
- // sheet1.GenerateCell(6, 2).SetCellValue("联系电话:" + bill.ContactTels);
|
|
|
- // sheet1.GenerateCell(6, 10).SetCellValue("联系人:" + bill.ContactMan);
|
|
|
- // sheet1.GenerateCell(7, 1).SetCellValue("日期:" + DateTime.Now.ToString("yyyy年MM月dd日"));
|
|
|
- // sheet1.InsertRows(10, orderSends.Count);
|
|
|
- // int index = 0;
|
|
|
- // decimal allPackageCount = 0;
|
|
|
- // foreach (var send in orderSends)
|
|
|
- // {
|
|
|
- // var sendQuantity = Math.Round(Math.Floor(send.SendQuantity * 1000) / 1000, 3);//发货数量
|
|
|
- // var quantityPerPack = send.QuantityPerPack ?? 0;
|
|
|
- // quantityPerPack = quantityPerPack == 0 ? sendQuantity : quantityPerPack;//每包数量,如果为0则等于发货数量
|
|
|
- // decimal packageCount = sendQuantity == 0 ? 0 : (sendQuantity <= quantityPerPack ? 1 : Math.Floor(send.SendQuantity / quantityPerPack));
|
|
|
- // var sysl = sendQuantity - quantityPerPack * packageCount;
|
|
|
- // allPackageCount += packageCount+(sysl>0?1:0);
|
|
|
- // sheet1.GenerateCell(10 + index, 1).SetValue<int>(index + 1);
|
|
|
- // sheet1.GenerateCell(10 + index, 2).SetValue(send.StockNo?? send.OrderNo);
|
|
|
- // sheet1.GenerateCell(10 + index, 3).SetValue(send.PartNo ?? "");
|
|
|
- // sheet1.GenerateCell(10 + index, 4).SetValue(send.ProductName??"");
|
|
|
- // sheet1.GenerateCell(10 + index, 5).SetValue(send.Model ?? "");
|
|
|
- // sheet1.GenerateCell(10 + index, 6).SetValue(send.SurfaceColor ?? "");
|
|
|
- // sheet1.GenerateCell(10 + index, 7).SetValue(send.Material ?? "");
|
|
|
- // sheet1.GenerateCell(10 + index, 8).SetValue(send.Rigidity ?? "");
|
|
|
- // sheet1.GenerateCell(10 + index, 9).SetValue("千件");
|
|
|
- // sheet1.GenerateCell(10 + index, 10).SetValue<decimal>(sendQuantity);
|
|
|
- // sheet1.GenerateCell(10 + index, 11).SetValue<decimal>(packageCount);
|
|
|
- // sheet1.GenerateCell(10 + index, 12).SetValue<decimal>(quantityPerPack);
|
|
|
- // sheet1.GenerateCell(10 + index, 13).SetValue<decimal>(sysl);
|
|
|
- // sheet1.GenerateCell(10 + index, 14).SetValue<decimal>(sendQuantity);
|
|
|
- // sheet1.GenerateCell(10 + index, 15).SetValue(send.ProductBatchNum??"");
|
|
|
- // index++;
|
|
|
- // }
|
|
|
- // index++;
|
|
|
- // sheet1.GenerateCell(10 + index, 8).SetValue( "合计: 托盘、"+ allPackageCount + "箱、待进仓");
|
|
|
- // index+=3;
|
|
|
- // sheet1.GenerateCell(10 + index, 12).SetValue( "送货日期:"+DateTime.Now.ToString("yyyy-MM-dd"));
|
|
|
- // var fileName = $"送货单-{Clock.Now:yyMMddHHmmss}.xlsx";
|
|
|
- // var result = work?.SaveWorkBook($"{AppDomain.CurrentDomain.BaseDirectory}{savePath}", fileName);
|
|
|
- // if (!result.IsNullOrEmpty())
|
|
|
- // {
|
|
|
- // //CheckErrors(IwbIdentityResult.Failed(result));
|
|
|
- // return null;
|
|
|
- // }
|
|
|
- // return $"/{savePath}/{fileName}";
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
+ // {
|
|
|
+ // var bill = await Repository.FirstOrDefaultAsync(input.Id);
|
|
|
+ // //var orderSends = (await ViewOrderSendRepository.GetAllListAsync(i => i.OrderSendBillNo == input.Id)).OrderBy(i=>i.SurfaceColor).ThenBy(i=>i.Rigidity).ToList();
|
|
|
+ // var orderSends =
|
|
|
+ // (await ViewOrderSendRepository.GetAllListAsync(i => i.OrderSendBillNo == input.Id)).OrderBy(i => i.SendBillSort).ThenByDescending(i=>i.SendDate).ToList();
|
|
|
+
|
|
|
+
|
|
|
+ // var customerInfo = await CustomerRepository.FirstOrDefaultAsync(bill.CustomerId);
|
|
|
+ // if (orderSends.Any())
|
|
|
+ // {
|
|
|
+ // if (orderSends[0].SaleType == 2)
|
|
|
+ // {
|
|
|
+ // return ExportOutSale(orderSends, bill, customerInfo);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // string path = AppDomain.CurrentDomain.BaseDirectory + "Resources/OrderSendTemplate/送货单模板.xlsx";
|
|
|
+ // var savePath = "Download/Excel/OrderSendBill";
|
|
|
+ // var work = ExcelHelper.CreateWorkBook07(path);
|
|
|
+ // var sheet1 = work.GetSheet("Sheet1");
|
|
|
+ // sheet1.GenerateCell(2, 1).SetCellValue("单号:"+bill.Id);
|
|
|
+ // sheet1.GenerateCell(5, 2).SetCellValue("客户:" + customerInfo.CustomerName);
|
|
|
+ // sheet1.GenerateCell(5, 10).SetCellValue("地址:" + bill.SendAddress);
|
|
|
+ // sheet1.GenerateCell(6, 2).SetCellValue("联系电话:" + bill.ContactTels);
|
|
|
+ // sheet1.GenerateCell(6, 10).SetCellValue("联系人:" + bill.ContactMan);
|
|
|
+ // sheet1.GenerateCell(7, 1).SetCellValue("日期:" + DateTime.Now.ToString("yyyy年MM月dd日"));
|
|
|
+ // sheet1.InsertRows(10, orderSends.Count);
|
|
|
+ // int index = 0;
|
|
|
+ // decimal allPackageCount = 0;
|
|
|
+ // foreach (var send in orderSends)
|
|
|
+ // {
|
|
|
+ // var sendQuantity = Math.Round(Math.Floor(send.SendQuantity * 1000) / 1000, 3);//发货数量
|
|
|
+ // var quantityPerPack = send.QuantityPerPack ?? 0;
|
|
|
+ // quantityPerPack = quantityPerPack == 0 ? sendQuantity : quantityPerPack;//每包数量,如果为0则等于发货数量
|
|
|
+ // decimal packageCount = sendQuantity == 0 ? 0 : (sendQuantity <= quantityPerPack ? 1 : Math.Floor(send.SendQuantity / quantityPerPack));
|
|
|
+ // var sysl = sendQuantity - quantityPerPack * packageCount;
|
|
|
+ // allPackageCount += packageCount+(sysl>0?1:0);
|
|
|
+ // sheet1.GenerateCell(10 + index, 1).SetValue<int>(index + 1);
|
|
|
+ // sheet1.GenerateCell(10 + index, 2).SetValue(send.StockNo?? send.OrderNo);
|
|
|
+ // sheet1.GenerateCell(10 + index, 3).SetValue(send.PartNo ?? "");
|
|
|
+ // sheet1.GenerateCell(10 + index, 4).SetValue(send.ProductName??"");
|
|
|
+ // sheet1.GenerateCell(10 + index, 5).SetValue(send.Model ?? "");
|
|
|
+ // sheet1.GenerateCell(10 + index, 6).SetValue(send.SurfaceColor ?? "");
|
|
|
+ // sheet1.GenerateCell(10 + index, 7).SetValue(send.Material ?? "");
|
|
|
+ // sheet1.GenerateCell(10 + index, 8).SetValue(send.Rigidity ?? "");
|
|
|
+ // sheet1.GenerateCell(10 + index, 9).SetValue("千件");
|
|
|
+ // sheet1.GenerateCell(10 + index, 10).SetValue<decimal>(sendQuantity);
|
|
|
+ // sheet1.GenerateCell(10 + index, 11).SetValue<decimal>(packageCount);
|
|
|
+ // sheet1.GenerateCell(10 + index, 12).SetValue<decimal>(quantityPerPack);
|
|
|
+ // sheet1.GenerateCell(10 + index, 13).SetValue<decimal>(sysl);
|
|
|
+ // sheet1.GenerateCell(10 + index, 14).SetValue<decimal>(sendQuantity);
|
|
|
+ // sheet1.GenerateCell(10 + index, 15).SetValue(send.ProductBatchNum??"");
|
|
|
+ // index++;
|
|
|
+ // }
|
|
|
+ // index++;
|
|
|
+ // sheet1.GenerateCell(10 + index, 8).SetValue( "合计: 托盘、"+ allPackageCount + "箱、待进仓");
|
|
|
+ // index+=3;
|
|
|
+ // sheet1.GenerateCell(10 + index, 12).SetValue( "送货日期:"+DateTime.Now.ToString("yyyy-MM-dd"));
|
|
|
+ // var fileName = $"送货单-{Clock.Now:yyMMddHHmmss}.xlsx";
|
|
|
+ // var result = work?.SaveWorkBook($"{AppDomain.CurrentDomain.BaseDirectory}{savePath}", fileName);
|
|
|
+ // if (!result.IsNullOrEmpty())
|
|
|
+ // {
|
|
|
+ // //CheckErrors(IwbIdentityResult.Failed(result));
|
|
|
+ // return null;
|
|
|
+ // }
|
|
|
+ // return $"/{savePath}/{fileName}";
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
//private string ExportOutSale(List<ViewOrderSend> orderSends, OrderSendBill bill,
|
|
|
// Customer customerInfo)
|
|
|
//{
|
|
|
@@ -614,9 +661,9 @@ namespace ShwasherSys.OrderSendInfo
|
|
|
// OrderSendMiniExcelDto miniValue = new OrderSendMiniExcelDto()
|
|
|
// {
|
|
|
// Ex1 = DateTime.Now.ToString("yyyy-MM-dd"),
|
|
|
- // OrderSendBillNo = bill.Id,
|
|
|
- // SendAddress = bill.SendAddress,
|
|
|
- // CustomerName = customerInfo.CustomerName
|
|
|
+ // OrderSendBillNo = bill.Id,
|
|
|
+ // SendAddress = bill.SendAddress,
|
|
|
+ // CustomerName = customerInfo.CustomerName
|
|
|
// };
|
|
|
// var savePath = "Download/Excel/OrderSendBill";
|
|
|
// var fileName = $"送货单-{Clock.Now:yyMMddHHmmss}.xlsx";
|
|
|
@@ -642,9 +689,9 @@ namespace ShwasherSys.OrderSendInfo
|
|
|
// item.Model = send.Model ?? "";
|
|
|
// item.SurfaceColor = send.SurfaceColor ?? "";
|
|
|
// item.Material = send.Material ?? "";
|
|
|
- // item.Rigidity = send.Rigidity ?? "";
|
|
|
- // item.Unit = "千件";
|
|
|
- // item.SendQuantity = sendQuantity;
|
|
|
+ // item.Rigidity = send.Rigidity ?? "";
|
|
|
+ // item.Unit = "千件";
|
|
|
+ // item.SendQuantity = sendQuantity;
|
|
|
// item.PackageCount = packageCount;
|
|
|
// item.QuantityPerPack = quantityPerPack;
|
|
|
// item.Sysl = sysl;
|
|
|
@@ -658,9 +705,9 @@ namespace ShwasherSys.OrderSendInfo
|
|
|
// miniValue.AllSendQuantity = allSendQuantity;
|
|
|
// miniValue.AllTotalPrice = allTotalPrice;
|
|
|
// miniValue.send=orderSendItem;
|
|
|
-
|
|
|
- // savePath = Path.Combine($"{AppDomain.CurrentDomain.BaseDirectory}{savePath}", fileName);
|
|
|
- // string resultPath = $"/Download/Excel/OrderSendBill/{fileName}";
|
|
|
+
|
|
|
+ // savePath = Path.Combine($"{AppDomain.CurrentDomain.BaseDirectory}{savePath}", fileName);
|
|
|
+ // string resultPath = $"/Download/Excel/OrderSendBill/{fileName}";
|
|
|
// //var result = work?.SaveWorkBook($"{AppDomain.CurrentDomain.BaseDirectory}{savePath}", fileName);
|
|
|
// try
|
|
|
// {
|
|
|
@@ -668,7 +715,7 @@ namespace ShwasherSys.OrderSendInfo
|
|
|
// }
|
|
|
// catch (Exception err)
|
|
|
// {
|
|
|
- // CheckErrors(new IdentityResult(err.Message));
|
|
|
+ // CheckErrors(new IdentityResult(err.Message));
|
|
|
// }
|
|
|
// return resultPath;
|
|
|
//}
|