|
|
@ -409,9 +409,48 @@ public partial class SeaExportService : ISeaExportService
|
|
|
|
|
|
|
|
|
|
|
|
_logger.Info("执行完保存日志");
|
|
|
|
_logger.Info("执行完保存日志");
|
|
|
|
|
|
|
|
|
|
|
|
//处理订单联系人信息
|
|
|
|
//处理订单联系人信息 2024-11-18 联系人信息改为可以直接修改,不用弹出窗体
|
|
|
|
DealBusinessOrderContact(info, tenantDb);
|
|
|
|
//DealBusinessOrderContact(info, tenantDb);
|
|
|
|
|
|
|
|
if (req.OrderContacts.IsNotNull() && req.OrderContacts.Count > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var contacts = await tenantDb.Queryable<BusinessOrderContact>().Where(x => x.BusinessId == req.Id).ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var existContacts = contacts.Select(x => x.Id);
|
|
|
|
|
|
|
|
var reqContacts = req.OrderContacts.Where(x => x.Id != 0).Select(x => x.Id);
|
|
|
|
|
|
|
|
//删除
|
|
|
|
|
|
|
|
IEnumerable<long> delContacts = existContacts.AsQueryable().Except(reqContacts);
|
|
|
|
|
|
|
|
if (delContacts.Count() > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
await tenantDb.Deleteable<BusinessOrderContact>()
|
|
|
|
|
|
|
|
.Where(it => it.BusinessId == info.Id && delContacts.Contains(it.Id))
|
|
|
|
|
|
|
|
.ExecuteCommandAsync();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in req.OrderContacts)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (item.Id == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var contact = item.Adapt<BusinessOrderContact>();
|
|
|
|
|
|
|
|
contact.BusinessId = info.Id;
|
|
|
|
|
|
|
|
await tenantDb.Insertable(contact).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var contact = contacts.First(x => x.Id == item.Id);
|
|
|
|
|
|
|
|
contact = item.Adapt(contact);
|
|
|
|
|
|
|
|
await tenantDb.Updateable(contact).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else //删除
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var contacts = await tenantDb.Queryable<BusinessOrderContact>().Where(x => x.BusinessId == req.Id).ToListAsync();
|
|
|
|
|
|
|
|
if (contacts.IsNotNull() && contacts.Count > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
await tenantDb.Deleteable(contacts).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
_logger.Info("执行完订单联系人");
|
|
|
|
_logger.Info("执行完订单联系人");
|
|
|
|
|
|
|
|
|
|
|
|
if (req.CtnInfo.IsNotNull() && req.CtnInfo.Count > 0)
|
|
|
|
if (req.CtnInfo.IsNotNull() && req.CtnInfo.Count > 0)
|
|
|
@ -510,7 +549,6 @@ public partial class SeaExportService : ISeaExportService
|
|
|
|
ctnGood = item.Adapt(ctnGood);
|
|
|
|
ctnGood = item.Adapt(ctnGood);
|
|
|
|
await tenantDb.Updateable(ctnGood).ExecuteCommandAsync();
|
|
|
|
await tenantDb.Updateable(ctnGood).ExecuteCommandAsync();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else //删除
|
|
|
|
else //删除
|
|
|
@ -518,7 +556,7 @@ public partial class SeaExportService : ISeaExportService
|
|
|
|
var ctnGoods = await tenantDb.Queryable<OpCtnGoods>().Where(x => x.BusinessId == req.Id).ToListAsync();
|
|
|
|
var ctnGoods = await tenantDb.Queryable<OpCtnGoods>().Where(x => x.BusinessId == req.Id).ToListAsync();
|
|
|
|
if (ctnGoods.IsNotNull() && ctnGoods.Count > 0)
|
|
|
|
if (ctnGoods.IsNotNull() && ctnGoods.Count > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tenantDb.Deleteable(ctnGoods).ExecuteCommand();
|
|
|
|
await tenantDb.Deleteable(ctnGoods).ExecuteCommandAsync();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_logger.Info("执行完订单多品名信息");
|
|
|
|
_logger.Info("执行完订单多品名信息");
|
|
|
@ -718,8 +756,17 @@ public partial class SeaExportService : ISeaExportService
|
|
|
|
|
|
|
|
|
|
|
|
var entity = await tenantDb.Insertable(data).ExecuteReturnEntityAsync();
|
|
|
|
var entity = await tenantDb.Insertable(data).ExecuteReturnEntityAsync();
|
|
|
|
|
|
|
|
|
|
|
|
//处理订单联系人信息
|
|
|
|
//处理订单联系人信息 2024-11-18 联系人信息改为可以直接修改,不用弹出窗体
|
|
|
|
DealBusinessOrderContact(entity, tenantDb);
|
|
|
|
//DealBusinessOrderContact(info, tenantDb);
|
|
|
|
|
|
|
|
if (req.OrderContacts.IsNotNull() && req.OrderContacts.Count > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var item in req.OrderContacts)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var contact = item.Adapt<BusinessOrderContact>();
|
|
|
|
|
|
|
|
contact.BusinessId = entity.Id;
|
|
|
|
|
|
|
|
await tenantDb.Insertable(contact).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (req.CtnInfo.IsNotNull() && req.CtnInfo.Count > 0)
|
|
|
|
if (req.CtnInfo.IsNotNull() && req.CtnInfo.Count > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|