jianghaiqing 6 days ago
commit 29ffabf054

@ -19,7 +19,11 @@ public class SeaExportReq
/// </summary>
public List<OpCtnReq> CtnInfo { get; set; }
/// <summary>
/// 订单业务联系人
/// </summary>
public List<BusinessOrderContactReq> OrderContacts { get; set; }
/// <summary>
/// <summary>
/// 箱型报价信息
/// </summary>

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

@ -679,7 +679,7 @@ namespace DS.WMS.Core.TaskPlat.Method
taskInfo = new TaskBaseInfo
{
Id = SnowFlakeSingle.Instance.NextId(),
TASK_NO = Guid.NewGuid().ToString(),
TASK_NO = SnowFlakeSingle.Instance.NextId().ToString(),
STATUS = TaskStatusEnum.Create.ToString(),
STATUS_NAME = TaskStatusEnum.Create.EnumDescription(),
IS_EXCEPT = 0,

Loading…
Cancel
Save