昭阳导出数据修改

dev
ZR20090193-陈敬勇 3 weeks ago
parent 98014b9e63
commit 9b2f5a90eb

@ -67,6 +67,9 @@ namespace DS.WMS.Core.Op.Method
public string { get; set; } public string { get; set; }
public string { get; set; } public string { get; set; }
public string { get; set; } public string { get; set; }
public string { get; set; }
public string { get; set; } public string { get; set; }
public string { get; set; } public string { get; set; }
public string { get; set; } public string { get; set; }
@ -85,6 +88,7 @@ namespace DS.WMS.Core.Op.Method
public string { get; set; } public string { get; set; }
public DateTime? { get; set; } public DateTime? { get; set; }
public int { get; set; } public int { get; set; }
public string { get; set; }
public string { get; set; } public string { get; set; }
public string { get; set; } public string { get; set; }
@ -107,8 +111,8 @@ namespace DS.WMS.Core.Op.Method
public string { get; set; } public string { get; set; }
public string { get; set; } public string { get; set; }
public string { get; set; }
public string { get; set; }
} }
@ -135,6 +139,9 @@ namespace DS.WMS.Core.Op.Method
public string { get; set; } public string { get; set; }
public string { get; set; } public string { get; set; }
public string { get; set; }
public string { get; set; }
public int? { get; set; } public int? { get; set; }
public string { get; set; } public string { get; set; }
@ -231,6 +238,7 @@ namespace DS.WMS.Core.Op.Method
public string { get; set; } public string { get; set; }
public string { get; set; }
public string { get; set; } public string { get; set; }
public string { get; set; } public string { get; set; }
@ -318,6 +326,7 @@ namespace DS.WMS.Core.Op.Method
string savePath = Path.Combine(hostEnvironment.WebRootPath, "templates", "海运出口主单" + NumUtil.GetNo() + ".xlsx"); string savePath = Path.Combine(hostEnvironment.WebRootPath, "templates", "海运出口主单" + NumUtil.GetNo() + ".xlsx");
var ctnpriceList = await tenantDb.Queryable<BusinessCtnPrice>().Filter(null, true).ToListAsync(); var ctnpriceList = await tenantDb.Queryable<BusinessCtnPrice>().Filter(null, true).ToListAsync();
var contactList = await tenantDb.Queryable<BusinessOrderContact>().Filter(null, true).Where(x => x.CustomerType == "controller").ToListAsync(); var contactList = await tenantDb.Queryable<BusinessOrderContact>().Filter(null, true).Where(x => x.CustomerType == "controller").ToListAsync();
var remarkList = await tenantDb.Queryable<SeaExportRemark>().Filter(null, true).ToListAsync();
var data = await tenantDb.Queryable<SeaExport>().Filter(null, true).Where(x => !x.Deleted && x.IsRefund == false && x.IsChangeETD == false) var data = await tenantDb.Queryable<SeaExport>().Filter(null, true).Where(x => !x.Deleted && x.IsRefund == false && x.IsChangeETD == false)
.LeftJoin<BusinessFeeStatus>((x, y) => x.Id == y.BusinessId) .LeftJoin<BusinessFeeStatus>((x, y) => x.Id == y.BusinessId)
@ -325,11 +334,11 @@ namespace DS.WMS.Core.Op.Method
{ {
Id =x.Id, Id =x.Id,
= x.BLType, = x.BLType,
code = x.MBLNO, code = x.CustomerNo,
= x.CustomerNo, = x.CustomerNum,
= x.SourceCode, = x.SourceCode,
= "", //入货通知备注 = "",
= x.Remark, //订单备注 = x.Remark,
qq = "", qq = "",
@ -343,7 +352,8 @@ namespace DS.WMS.Core.Op.Method
= x.UpdateUserName, = x.UpdateUserName,
= x.UpdateTime, = x.UpdateTime,
= 0, = 0,
= x.Sale, = x.Sale,
= x.Laner,
= x.OperatorName, = x.OperatorName,
= x.CustomerServiceName, = x.CustomerServiceName,
= 2, = 2,
@ -357,7 +367,8 @@ namespace DS.WMS.Core.Op.Method
ATA = x.ATA, ATA = x.ATA,
= x.LoadPortCode, = x.LoadPortCode,
= x.DischargePortCode, = x.DischargePortCode,
=x.ShipperCn,
= x.ContractNo
}).ToListAsync(); }).ToListAsync();
foreach (var item in data) foreach (var item in data)
@ -368,7 +379,23 @@ namespace DS.WMS.Core.Op.Method
item. = ctnprice.FloorPrice; item. = ctnprice.FloorPrice;
item. = ctnprice.QuotePrice; item. = ctnprice.QuotePrice;
} }
var remark1 = remarkList.FirstOrDefault(a => a.Pid == item.Id && a.RemarkType =="1" );
if (remark1.IsNotNull())
{
item. = remark1.Remark;
}
var remark2 = remarkList.FirstOrDefault(a => a.Pid == item.Id && a.RemarkType == "2");
if (remark2.IsNotNull())
{
item. = remark2.Remark;
}
var remark3 = remarkList.FirstOrDefault(a => a.Pid == item.Id && a.RemarkType == "3");
if (remark3.IsNotNull())
{
item. = remark3.Remark;
}
var contact = contactList.FirstOrDefault(a => a.BusinessId == item.Id); var contact = contactList.FirstOrDefault(a => a.BusinessId == item.Id);
if (contact.IsNotNull()) if (contact.IsNotNull())
{ {
@ -413,7 +440,7 @@ namespace DS.WMS.Core.Op.Method
Id = x.Id, Id = x.Id,
= x.GoodsName, = x.GoodsName,
= x.HSCode, = x.HSCode,
= y.MBLNO, = y.CustomerNo,
= x.CreateUserName, = x.CreateUserName,
= x.CreateTime, = x.CreateTime,
= x.UpdateTime, = x.UpdateTime,
@ -447,12 +474,13 @@ namespace DS.WMS.Core.Op.Method
.Select(x => new ZySeaExportGoodsInfo .Select(x => new ZySeaExportGoodsInfo
{ {
Id = x.Id, Id = x.Id,
= x.MBLNO, = x.CustomerNo,
= x.Marks, = x.Marks,
= x.GoodsName, = x.GoodsName,
= x.Description,
= x.PKGS, = x.PKGS,
= x.KindPkgsName, = x.KindPkgsName,
= "海运整箱",
= x.KGS, = x.KGS,
= x.CBM, = x.CBM,
@ -474,6 +502,7 @@ namespace DS.WMS.Core.Op.Method
= x.TemperatureMin, = x.TemperatureMin,
= x.TemperatureUnit, = x.TemperatureUnit,
= x.ReeferQuantity, = x.ReeferQuantity,
= x.MBLNO,
}).ToListAsync(); }).ToListAsync();
@ -510,7 +539,7 @@ namespace DS.WMS.Core.Op.Method
.Select((x, y) => new ZySeaExportCtnInfo .Select((x, y) => new ZySeaExportCtnInfo
{ {
Id = x.Id, Id = x.Id,
= y.MBLNO, = y.CustomerNo,
= x.Ctn, = x.Ctn,
= x.CntrNo, = x.CntrNo,
= x.CtnNum, = x.CtnNum,
@ -552,17 +581,18 @@ namespace DS.WMS.Core.Op.Method
string savePath = Path.Combine(hostEnvironment.WebRootPath, "templates", "订单订舱信息" + NumUtil.GetNo() + ".xlsx"); string savePath = Path.Combine(hostEnvironment.WebRootPath, "templates", "订单订舱信息" + NumUtil.GetNo() + ".xlsx");
var ctnpriceList = await tenantDb.Queryable<BusinessCtnPrice>().Filter(null, true).ToListAsync(); var ctnpriceList = await tenantDb.Queryable<BusinessCtnPrice>().Filter(null, true).ToListAsync();
var contactList = await tenantDb.Queryable<BusinessOrderContact>().Filter(null, true).Where(x => x.CustomerType == "controller").ToListAsync(); var contactList = await tenantDb.Queryable<BusinessOrderContact>().Filter(null, true).ToListAsync();
var data = await tenantDb.Queryable<SeaExport>().Filter(null, true).Where(x => !x.Deleted && x.IsRefund == false && x.IsChangeETD == false) var data = await tenantDb.Queryable<SeaExport>().Filter(null, true).Where(x => !x.Deleted && x.IsRefund == false && x.IsChangeETD == false)
.Select(x => new ZySeaExportBookInfo .Select(x => new ZySeaExportBookInfo
{ {
Id = x.Id, Id = x.Id,
= x.MBLNO, = x.CustomerNo,
= x.BookingNo, = x.BookingNo,
= x.Vessel, = x.Vessel,
= x.Voyno, = string.IsNullOrEmpty(x.Voyno)?x.InnerVoyno: x.Voyno,
= x.Service, = x.Service,
= x.MBLFrt,
= x.Carrier, = x.Carrier,
= x.ContractNo, = x.ContractNo,
= x.IssueType, = x.IssueType,
@ -575,11 +605,11 @@ namespace DS.WMS.Core.Op.Method
= x.ClosingDate, = x.ClosingDate,
= x.CloseDocDate, = x.CloseDocDate,
= x.ShipAgency, = x.ShipAgency,
= x.YardATTN, //场站联系人 = x.YardATTN,
= x.YardTel, //场站联系电话 = x.YardTel,
= x.Yard, = x.Yard,
使 = x.ApplyCtnRemark, 使 = x.ApplyCtnRemark,
= x.MBLNO,
= x.CreateUserName, = x.CreateUserName,
= x.CreateTime, = x.CreateTime,
@ -589,7 +619,29 @@ namespace DS.WMS.Core.Op.Method
}).ToListAsync(); }).ToListAsync();
foreach (var item in data)
{
var yard = contactList.FirstOrDefault(a => a.BusinessId == item.Id && a.CustomerType == "yard");
if (yard.IsNotNull())
{
item. = yard.Name;
item. = yard.Tel;
}
var booking = contactList.FirstOrDefault(a => a.BusinessId == item.Id && a.CustomerType == "booking");
if (booking.IsNotNull())
{
item. = booking.Name;
item. = booking.Tel;
item. = booking.Email;
//item.订舱电话 =
}
var agent = contactList.FirstOrDefault(a => a.BusinessId == item.Id && a.CustomerType == "agent");
if (agent.IsNotNull())
{
item. = agent.Name;
item. = agent.Tel;
}
}
model.List = data; model.List = data;
//MemoryStream ms = new(); //MemoryStream ms = new();
await MiniExcel.SaveAsByTemplateAsync(savePath, path, model); await MiniExcel.SaveAsByTemplateAsync(savePath, path, model);
@ -622,7 +674,7 @@ namespace DS.WMS.Core.Op.Method
.Select((x, y) => new ZySeaExportFeeInfo .Select((x, y) => new ZySeaExportFeeInfo
{ {
Id = x.Id, Id = x.Id,
= y.MBLNO, = y.CustomerNo,
= x.FeeName, = x.FeeName,
= x.CustomerName, = x.CustomerName,
= x.FeeType == FeeType.Receivable ? 215 : 214, = x.FeeType == FeeType.Receivable ? 215 : 214,
@ -667,6 +719,7 @@ namespace DS.WMS.Core.Op.Method
string savePath = Path.Combine(hostEnvironment.WebRootPath, "templates", "海运出口-分单 " + NumUtil.GetNo() + ".xlsx"); string savePath = Path.Combine(hostEnvironment.WebRootPath, "templates", "海运出口-分单 " + NumUtil.GetNo() + ".xlsx");
var ctnpriceList = await tenantDb.Queryable<BusinessCtnPrice>().Filter(null, true).ToListAsync(); var ctnpriceList = await tenantDb.Queryable<BusinessCtnPrice>().Filter(null, true).ToListAsync();
var contactList = await tenantDb.Queryable<BusinessOrderContact>().Filter(null, true).Where(x => x.CustomerType == "controller").ToListAsync(); var contactList = await tenantDb.Queryable<BusinessOrderContact>().Filter(null, true).Where(x => x.CustomerType == "controller").ToListAsync();
var remarkList = await tenantDb.Queryable<SeaExportRemark>().Filter(null, true).ToListAsync();
var data = await tenantDb.Queryable<SeaExportBillManage>().Filter(null, true).Where(x => !x.Deleted) var data = await tenantDb.Queryable<SeaExportBillManage>().Filter(null, true).Where(x => !x.Deleted)
.InnerJoin<SeaExport>((x, y) => x.BusinessId == y.Id) .InnerJoin<SeaExport>((x, y) => x.BusinessId == y.Id)
@ -675,11 +728,11 @@ namespace DS.WMS.Core.Op.Method
{ {
Id = x.Id, Id = x.Id,
= "分单", = "分单",
code = x.MBLNO, code = y.CustomerNo,
= y.CustomerNo, = y.CustomerNum,
= y.SourceCode, = y.SourceCode,
= "", //入货通知备注 = "",
= x.Remark, //订单备注 = x.Remark,
qq = "", qq = "",
@ -693,7 +746,8 @@ namespace DS.WMS.Core.Op.Method
= x.UpdateUserName, = x.UpdateUserName,
= x.UpdateTime, = x.UpdateTime,
= 0, = 0,
= y.Sale, = y.Sale,
= y.Laner,
= y.OperatorName, = y.OperatorName,
= y.CustomerServiceName, = y.CustomerServiceName,
= 2, = 2,
@ -707,6 +761,10 @@ namespace DS.WMS.Core.Op.Method
ATA = y.ATA, ATA = y.ATA,
= y.LoadPortCode, = y.LoadPortCode,
= y.DischargePortCode, = y.DischargePortCode,
= x.ShipperCn,
= y.ContractNo,
= x.HBLNO
}).ToListAsync(); }).ToListAsync();
@ -718,7 +776,21 @@ namespace DS.WMS.Core.Op.Method
item. = ctnprice.FloorPrice; item. = ctnprice.FloorPrice;
item. = ctnprice.QuotePrice; item. = ctnprice.QuotePrice;
} }
var remark1 = remarkList.FirstOrDefault(a => a.Pid == item.Id && a.RemarkType == "1");
if (remark1.IsNotNull())
{
item. = remark1.Remark;
}
var remark2 = remarkList.FirstOrDefault(a => a.Pid == item.Id && a.RemarkType == "2");
if (remark2.IsNotNull())
{
item. = remark2.Remark;
}
var remark3 = remarkList.FirstOrDefault(a => a.Pid == item.Id && a.RemarkType == "3");
if (remark3.IsNotNull())
{
item. = remark3.Remark;
}
var contact = contactList.FirstOrDefault(a => a.BusinessId == item.Id); var contact = contactList.FirstOrDefault(a => a.BusinessId == item.Id);
if (contact.IsNotNull()) if (contact.IsNotNull())
{ {
@ -857,10 +929,11 @@ namespace DS.WMS.Core.Op.Method
var data = await tenantDb.Queryable<SeaExportBillManageCtn>().Filter(null, true).Where(x => !x.Deleted) var data = await tenantDb.Queryable<SeaExportBillManageCtn>().Filter(null, true).Where(x => !x.Deleted)
.InnerJoin<SeaExportBillManage>((x, y) => x.Pid == y.Id ) .InnerJoin<SeaExportBillManage>((x, y) => x.Pid == y.Id )
.Select((x, y) => new ZySeaExportCtnInfo .LeftJoin<SeaExport>((x, y,z) => z.Id == y.BusinessId)
.Select((x, y,z) => new ZySeaExportCtnInfo
{ {
Id = x.Id, Id = x.Id,
= y.MBLNO, = z.CustomerNo,
= x.Ctn, = x.Ctn,
= x.CntrNo, = x.CntrNo,
= x.CtnNum, = x.CtnNum,
@ -969,10 +1042,11 @@ namespace DS.WMS.Core.Op.Method
var data = await tenantDb.Queryable<FeeRecord>().Filter(null, true).Where(x => !x.Deleted) var data = await tenantDb.Queryable<FeeRecord>().Filter(null, true).Where(x => !x.Deleted)
.InnerJoin<SeaExportBillManage>((x, y) => x.BusinessId == y.Id ) .InnerJoin<SeaExportBillManage>((x, y) => x.BusinessId == y.Id )
.Select((x, y) => new ZySeaExportFeeInfo .LeftJoin<SeaExport>((x, y, z) => z.Id == y.BusinessId)
.Select((x, y,z) => new ZySeaExportFeeInfo
{ {
Id = x.Id, Id = x.Id,
= y.MBLNO, = z.CustomerNo,
= x.FeeName, = x.FeeName,
= x.CustomerName, = x.CustomerName,
= x.FeeType == FeeType.Receivable ? 215 : 214, = x.FeeType == FeeType.Receivable ? 215 : 214,

Loading…
Cancel
Save