同步订舱

optimize
wet 2 years ago
parent 937f2381a2
commit c20dbd3b25

@ -805,7 +805,7 @@ namespace Myshipping.Application.Entity
/// <summary>
/// 航线
/// 仓库
/// </summary>
[Description("仓库")]
public string Warehouse { get; set; }

@ -317,7 +317,7 @@ namespace Myshipping.Application
.WhereIF(!string.IsNullOrWhiteSpace(input.ROUTE), u => u.ROUTE.Contains(input.ROUTE))
.WhereIF(!string.IsNullOrWhiteSpace(input.CreatedUserName), u => u.CreatedUserName.Contains(input.CreatedUserName))
.WhereIF(!string.IsNullOrWhiteSpace(input.FREIGHTPAYER), u => u.FREIGHTPAYER.Contains(input.FREIGHTPAYER))
.WhereIF(userlist != null && userlist.Count() > 0, u => userlist.Contains((long)u.CreatedUserId) || UserManager.UserId.ToString() == u.ROUTEID || UserManager.UserId.ToString() == u.SALEID || UserManager.UserId.ToString() == u.OPID || UserManager.UserId.ToString() == u.DOCID || UserManager.UserId.ToString() == u.CUSTSERVICEID)
.WhereIF(userlist != null && userlist.Count() > 0, u => userlist.Contains((long)u.CreatedUserId) || UserManager.UserId.ToString() == u.ROUTEID|| UserManager.Name.ToString() == u.ROUTE || UserManager.UserId.ToString() == u.SALEID|| UserManager.Name.ToString() == u.SALE || UserManager.UserId.ToString() == u.OPID || UserManager.Name.ToString() == u.OP || UserManager.UserId.ToString() == u.DOCID|| UserManager.Name.ToString() == u.DOC || UserManager.UserId.ToString() == u.CUSTSERVICEID || UserManager.Name.ToString() == u.CUSTSERVICE)
.OrderBy(PageInputOrder.OrderBuilder(input.SortField, input.descSort))
.ToPagedListAsync(input.PageNo, input.PageSize);

@ -192,6 +192,25 @@ namespace Myshipping.Application
throw Oops.Bah("当前提单号已存在,请勿重复录入!");
}
var entity = model.Adapt<BookingOrder>();
if (!string.IsNullOrEmpty(entity.ROUTE)) {
entity.ROUTEID = userlist.Result.Where(x => x.Name == entity.ROUTE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.ROUTE).Select(x => x.Id).FirstOrDefault().ToString();
}
if (!string.IsNullOrEmpty(entity.SALE))
{
entity.SALEID = userlist.Result.Where(x => x.Name == entity.SALE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.SALE).Select(x => x.Id).FirstOrDefault().ToString();
}
if (!string.IsNullOrEmpty(entity.OP))
{
entity.OPID = userlist.Result.Where(x => x.Name == entity.OP).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.OP).Select(x => x.Id).FirstOrDefault().ToString();
}
if (!string.IsNullOrEmpty(entity.DOC))
{
entity.DOCID = userlist.Result.Where(x => x.Name == entity.DOC).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.DOC).Select(x => x.Id).FirstOrDefault().ToString();
}
if (!string.IsNullOrEmpty(entity.CUSTSERVICE))
{
entity.CUSTSERVICEID = userlist.Result.Where(x => x.Name == entity.CUSTSERVICE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.CUSTSERVICE).Select(x => x.Id).FirstOrDefault().ToString();
}
entity.CreatedUserId = user.Result.Id;
entity.CreatedUserName = user.Result.Name.ToString();
entity.CreatedTime = DateTime.Now;
@ -276,6 +295,26 @@ namespace Myshipping.Application
}
var fdentity = item.Adapt<BookingOrder>();
if (!string.IsNullOrEmpty(fdentity.ROUTE))
{
fdentity.ROUTEID = userlist.Result.Where(x => x.Name == entity.ROUTE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.ROUTE).Select(x => x.Id).FirstOrDefault().ToString();
}
if (!string.IsNullOrEmpty(fdentity.SALE))
{
fdentity.SALEID = userlist.Result.Where(x => x.Name == entity.SALE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.SALE).Select(x => x.Id).FirstOrDefault().ToString();
}
if (!string.IsNullOrEmpty(fdentity.OP))
{
fdentity.OPID = userlist.Result.Where(x => x.Name == entity.OP).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.OP).Select(x => x.Id).FirstOrDefault().ToString();
}
if (!string.IsNullOrEmpty(fdentity.DOC))
{
fdentity.DOCID = userlist.Result.Where(x => x.Name == entity.DOC).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.DOC).Select(x => x.Id).FirstOrDefault().ToString();
}
if (!string.IsNullOrEmpty(fdentity.CUSTSERVICE))
{
fdentity.CUSTSERVICEID = userlist.Result.Where(x => x.Name == entity.CUSTSERVICE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.CUSTSERVICE).Select(x => x.Id).FirstOrDefault().ToString();
}
fdentity.CreatedUserId = user.Result.Id;
fdentity.CreatedUserName = user.Result.Name;
fdentity.CreatedTime = DateTime.Now;
@ -369,6 +408,26 @@ namespace Myshipping.Application
entity.UpdatedUserName = user.Result.Name;
entity.UpdatedUserId = user.Result.Id;
entity.UpdatedTime = DateTime.Now;
if (!string.IsNullOrEmpty(entity.ROUTE))
{
entity.ROUTEID = userlist.Result.Where(x => x.Name == entity.ROUTE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.ROUTE).Select(x => x.Id).FirstOrDefault().ToString();
}
if (!string.IsNullOrEmpty(entity.SALE))
{
entity.SALEID = userlist.Result.Where(x => x.Name == entity.SALE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.SALE).Select(x => x.Id).FirstOrDefault().ToString();
}
if (!string.IsNullOrEmpty(entity.OP))
{
entity.OPID = userlist.Result.Where(x => x.Name == entity.OP).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.OP).Select(x => x.Id).FirstOrDefault().ToString();
}
if (!string.IsNullOrEmpty(entity.DOC))
{
entity.DOCID = userlist.Result.Where(x => x.Name == entity.DOC).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.DOC).Select(x => x.Id).FirstOrDefault().ToString();
}
if (!string.IsNullOrEmpty(entity.CUSTSERVICE))
{
entity.CUSTSERVICEID = userlist.Result.Where(x => x.Name == entity.CUSTSERVICE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.CUSTSERVICE).Select(x => x.Id).FirstOrDefault().ToString();
}
await _rep.AsUpdateable(entity).IgnoreColumns(it => new
{
it.ParentId,
@ -517,6 +576,26 @@ namespace Myshipping.Application
fdentity.UpdatedUserName = user.Result.Name;
fdentity.UpdatedUserId = user.Result.Id;
fdentity.UpdatedTime = DateTime.Now;
if (!string.IsNullOrEmpty(fdentity.ROUTE))
{
fdentity.ROUTEID = userlist.Result.Where(x => x.Name == entity.ROUTE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.ROUTE).Select(x => x.Id).FirstOrDefault().ToString();
}
if (!string.IsNullOrEmpty(fdentity.SALE))
{
fdentity.SALEID = userlist.Result.Where(x => x.Name == entity.SALE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.SALE).Select(x => x.Id).FirstOrDefault().ToString();
}
if (!string.IsNullOrEmpty(fdentity.OP))
{
fdentity.OPID = userlist.Result.Where(x => x.Name == entity.OP).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.OP).Select(x => x.Id).FirstOrDefault().ToString();
}
if (!string.IsNullOrEmpty(fdentity.DOC))
{
fdentity.DOCID = userlist.Result.Where(x => x.Name == entity.DOC).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.DOC).Select(x => x.Id).FirstOrDefault().ToString();
}
if (!string.IsNullOrEmpty(fdentity.CUSTSERVICE))
{
fdentity.CUSTSERVICEID = userlist.Result.Where(x => x.Name == entity.CUSTSERVICE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.CUSTSERVICE).Select(x => x.Id).FirstOrDefault().ToString();
}
await _rep.AsUpdateable(fdentity).IgnoreColumns(it => new
{
it.ParentId,

@ -616,6 +616,58 @@ namespace Myshipping.Application.Service.DataSync.Dto
/// 品名
/// </summary>
public string GOODSNAME { get; set; }
/// <summary>
/// 件数合计
/// </summary>
public string PKGSTOTAL { get; set; }
/// <summary>
/// 毛重合计
/// </summary>
public string KGSTOTAL { get; set; }
/// <summary>
/// 尺寸合计
/// </summary>
public string CBMTOTAL { get; set; }
/// <summary>
/// 航线ID
/// </summary>
public string ROUTEID { get; set; }
public string ROUTE { get; set; }
public string Warehouse { get; set; }
public string WarehouseID { get; set; }
/// <summary>
/// ep号
/// </summary>
public string EPCode { get; set; }
/// <summary>
/// 创建者名称
/// </summary>
@ -1220,12 +1272,6 @@ namespace Myshipping.Application.Service.DataSync.Dto
public List<BookingCtnDto> ctnInputs { get; set; }
/// <summary>
/// EDI扩展信息
/// </summary>
public BookingEDIExtDto BookingEDIExt { get; set; }
/// <summary>
/// 品名代码
@ -1267,5 +1313,12 @@ namespace Myshipping.Application.Service.DataSync.Dto
public string EPCode { get; set; }
public List<BookingCtnDto> ctnInputs { get; set; }
/// <summary>
/// EDI扩展信息
/// </summary>
public BookingEDIExtDto BookingEDIExt { get; set; }
}
}

Loading…
Cancel
Save