昭阳导出数据修改

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

Loading…
Cancel
Save