修改提单管理

dev
jianghaiqing 3 weeks ago
parent 88fbf6c305
commit 32668cc5f1

@ -25,5 +25,76 @@ namespace DS.WMS.Core.Op.Dtos
/// 收费状态ALL-全部NORECV-仅未收RECV-仅已收)
/// </summary>
public string ChargeFeeStaus { get; set; }
/// <summary>
/// ETD起始时间
/// </summary>
public Nullable<DateTime> ETDStart { get; set; }
/// <summary>
/// ETD结束时间
/// </summary>
public Nullable<DateTime> ETDEnd { get; set; }
/// <summary>
/// 签入起始时间
/// </summary>
public Nullable<DateTime> CheckInDateStart { get; set; }
/// <summary>
/// 签入结束时间
/// </summary>
public Nullable<DateTime> CheckInDateEnd { get; set; }
/// <summary>
/// 签入起始时间
/// </summary>
public Nullable<DateTime> CheckOutDateStart { get; set; }
/// <summary>
/// 签入结束时间
/// </summary>
public Nullable<DateTime> CheckOutDateEnd { get; set; }
/// <summary>
/// 提单号
/// </summary>
public string BlNo { get; set; }
/// <summary>
/// 签单方式
/// </summary>
public string IssueType { get; set; }
/// <summary>
/// 状态
/// </summary>
public string Status { get; set; }
/// <summary>
/// 船名
/// </summary>
public string Vessel { get; set; }
/// <summary>
/// 航次
/// </summary>
public string Voyno { get; set; }
/// <summary>
/// 委托客户ID
/// </summary>
public Nullable<long> CustomerId { get; set; }
/// <summary>
/// 单证ID
/// </summary>
public Nullable<long> Doc { get; set; }
/// <summary>
/// 业务类型
/// </summary>
public string BusinessType { get; set; }
}
}

@ -381,5 +381,17 @@ namespace DS.WMS.Core.Op.Entity
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "是否扣单", IsNullable = true)]
public bool IsBLSeize { get; set; }
/// <summary>
/// 签单方式
/// </summary>
[SugarColumn(ColumnDescription = "签单方式", IsNullable = true, Length = 12)]
public string IssueType { get; set; }
/// <summary>
/// 签单方式代码
/// </summary>
[SugarColumn(ColumnDescription = "签单方式代码", IsNullable = true, Length = 30)]
public string IssueTypeCode { get; set; }
}
}

@ -70,6 +70,7 @@ using iText.Layout.Element;
using AngleSharp.Html;
using DS.WMS.Core.Op.Dtos.Enum;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
using iText.StyledXmlParser.Jsoup.Safety;
namespace DS.WMS.Core.Op.Method
{
@ -110,48 +111,84 @@ namespace DS.WMS.Core.Op.Method
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
List<IConditionalModel> whereList = null;
BLIssueMangeQueryExtDto otherQueryCondition = querySearch.OtherQueryCondition;
string blNo = string.Empty;
string etdStart = string.Empty;
string etdEnd = string.Empty;
if (!querySearch.QueryCondition.IsNullOrEmpty())
{
whereList = querySearch.GetConditionalModels(db);
//if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("blNo", StringComparison.OrdinalIgnoreCase)))
//{
// var t = whereList.FirstOrDefault(t => ((ConditionalModel)t).FieldName.Equals("blNo", StringComparison.OrdinalIgnoreCase));
// blNo = ((ConditionalModel)t).FieldValue;
whereList = GetPageCondition(querySearch,out otherQueryCondition);
// whereList.Remove(t);
//}
//if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("etd", StringComparison.OrdinalIgnoreCase)))
//{
// var t = whereList.FirstOrDefault(t => ((ConditionalModel)t).FieldName.Equals("etd", StringComparison.OrdinalIgnoreCase));
// blNo = ((ConditionalModel)t).FieldValue;
// whereList.Remove(t);
//}
}
var eqlStatus = new string[] { "StatusModify", "ReleaseNotice", "BLModify", "CheckOut", "CheckIn", "BLSeize", "ChangeEndorse", "RejectReleaeNotice" };
var query = tenantDb.Queryable<SeaExport>().ClearFilter(typeof(IOrgId))
.LeftJoin<BLIssueManageBase>((l, r) => l.Id == r.BookingId)
.WhereIF(querySearch.OtherQueryCondition != null && !string.IsNullOrWhiteSpace(querySearch.OtherQueryCondition.QueryTabCode)
&& querySearch.OtherQueryCondition.QueryTabCode.Equals(BLQueryStatusEnum.CheckInQuery.ToString(), StringComparison.OrdinalIgnoreCase),(l,r)=> r.IsCheckIn == false)
.WhereIF(querySearch.OtherQueryCondition != null && !string.IsNullOrWhiteSpace(querySearch.OtherQueryCondition.QueryTabCode)
&& querySearch.OtherQueryCondition.QueryTabCode.Equals(BLQueryStatusEnum.CheckOutQuery.ToString(), StringComparison.OrdinalIgnoreCase), (l, r) => r.IsCheckIn == true)
.WhereIF(querySearch.OtherQueryCondition != null && !string.IsNullOrWhiteSpace(querySearch.OtherQueryCondition.QueryTabCode)
&& querySearch.OtherQueryCondition.QueryTabCode.Equals(BLQueryStatusEnum.HasCheckOutQuery.ToString(), StringComparison.OrdinalIgnoreCase), (l, r) => r.IsCheckOut == true)
.WhereIF(querySearch.OtherQueryCondition != null && !string.IsNullOrWhiteSpace(querySearch.OtherQueryCondition.QueryTabCode)
&& querySearch.OtherQueryCondition.QueryTabCode.Equals(BLQueryStatusEnum.BLModifyQuery.ToString(), StringComparison.OrdinalIgnoreCase), (l, r) => r.IsBLModify == true)
.WhereIF(querySearch.OtherQueryCondition != null && !string.IsNullOrWhiteSpace(querySearch.OtherQueryCondition.QueryTabCode)
&& querySearch.OtherQueryCondition.QueryTabCode.Equals(BLQueryStatusEnum.BLSeizeQuery.ToString(), StringComparison.OrdinalIgnoreCase), (l, r) => r.IsBLSeize == true)
.WhereIF(querySearch.OtherQueryCondition != null && !string.IsNullOrWhiteSpace(querySearch.OtherQueryCondition.MHouseFlag)
&& querySearch.OtherQueryCondition.QueryTabCode.Equals("M", StringComparison.OrdinalIgnoreCase), (l, r) => l.ParentId == 0)
.WhereIF(querySearch.OtherQueryCondition != null && !string.IsNullOrWhiteSpace(querySearch.OtherQueryCondition.MHouseFlag)
&& querySearch.OtherQueryCondition.QueryTabCode.Equals("H", StringComparison.OrdinalIgnoreCase), (l, r) => l.ParentId > 0)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& otherQueryCondition.QueryTabCode.Equals(BLQueryStatusEnum.CheckInQuery.ToString(), StringComparison.OrdinalIgnoreCase),(l,r)=> r.IsCheckIn == false)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& otherQueryCondition.QueryTabCode.Equals(BLQueryStatusEnum.CheckOutQuery.ToString(), StringComparison.OrdinalIgnoreCase), (l, r) => r.IsCheckIn == true)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& otherQueryCondition.QueryTabCode.Equals(BLQueryStatusEnum.HasCheckOutQuery.ToString(), StringComparison.OrdinalIgnoreCase), (l, r) => r.IsCheckOut == true)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& otherQueryCondition.QueryTabCode.Equals(BLQueryStatusEnum.BLModifyQuery.ToString(), StringComparison.OrdinalIgnoreCase), (l, r) => r.IsBLModify == true)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& otherQueryCondition.QueryTabCode.Equals(BLQueryStatusEnum.BLSeizeQuery.ToString(), StringComparison.OrdinalIgnoreCase), (l, r) => r.IsBLSeize == true)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.MHouseFlag)
&& otherQueryCondition.QueryTabCode.Equals("M", StringComparison.OrdinalIgnoreCase), (l, r) => l.ParentId == 0)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.MHouseFlag)
&& otherQueryCondition.QueryTabCode.Equals("H", StringComparison.OrdinalIgnoreCase), (l, r) => l.ParentId > 0)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& otherQueryCondition.QueryTabCode.Equals(BLQueryStatusEnum.BLQuery.ToString(), StringComparison.OrdinalIgnoreCase)
&& !string.IsNullOrWhiteSpace(otherQueryCondition.BlNo), (l, r) => l.MBLNO.Contains(otherQueryCondition.BlNo))
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& otherQueryCondition.QueryTabCode.Equals(BLQueryStatusEnum.BLQuery.ToString(), StringComparison.OrdinalIgnoreCase)
&& !string.IsNullOrWhiteSpace(otherQueryCondition.IssueType), (l, r) => l.IssueType == otherQueryCondition.IssueType)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& !string.IsNullOrWhiteSpace(otherQueryCondition.Vessel), (l, r) => l.Vessel == otherQueryCondition.Vessel)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& !string.IsNullOrWhiteSpace(otherQueryCondition.Voyno), (l, r) => l.Voyno == otherQueryCondition.Voyno)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& otherQueryCondition.CustomerId.HasValue, (l, r) => l.CustomerId == otherQueryCondition.CustomerId.Value)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& otherQueryCondition.Doc.HasValue, (l, r) => l.Doc == otherQueryCondition.Doc.Value)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& otherQueryCondition.ETDStart.HasValue, (l, r) => l.ETD >= otherQueryCondition.ETDStart)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& otherQueryCondition.ETDEnd.HasValue, (l, r) => l.ETD < otherQueryCondition.ETDEnd)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& otherQueryCondition.CheckInDateStart.HasValue, (l, r) => r.CheckInDate >= otherQueryCondition.CheckInDateStart)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& otherQueryCondition.CheckInDateEnd.HasValue, (l, r) => r.CheckInDate < otherQueryCondition.CheckInDateEnd)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& otherQueryCondition.CheckOutDateStart.HasValue, (l, r) => r.CheckOutDate >= otherQueryCondition.CheckOutDateStart)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& otherQueryCondition.CheckOutDateEnd.HasValue, (l, r) => r.CheckOutDate < otherQueryCondition.CheckOutDateEnd)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& otherQueryCondition.Doc.HasValue, (l, r) => l.Doc == otherQueryCondition.Doc.Value)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& !string.IsNullOrWhiteSpace(otherQueryCondition.Status)
&& otherQueryCondition.Status.Equals(BLIssueStatusEnum.UnCheckIn.ToString(), StringComparison.OrdinalIgnoreCase),
(l, r) => r.Id == 0)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& !string.IsNullOrWhiteSpace(otherQueryCondition.Status)
&& otherQueryCondition.Status.Equals(BLIssueStatusEnum.CheckInUnCheckOut.ToString(), StringComparison.OrdinalIgnoreCase),
(l, r) => r.IsCheckIn == true && r.IsCheckOut == false)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& !string.IsNullOrWhiteSpace(otherQueryCondition.Status)
&& otherQueryCondition.Status.Equals(BLIssueStatusEnum.UnCheckOut.ToString(), StringComparison.OrdinalIgnoreCase),
(l, r) => r.IsCheckOut == false)
.WhereIF(otherQueryCondition != null && !string.IsNullOrWhiteSpace(otherQueryCondition.QueryTabCode)
&& !string.IsNullOrWhiteSpace(otherQueryCondition.Status)
&& eqlStatus.Contains(otherQueryCondition.Status),
(l, r) => r.IsCheckIn == true && r.IsCheckOut == false)
.Select((l, r) => new { order = l, bl = r });
BLIssueMangeQueryExtDto otherQuery = null;
@ -315,6 +352,187 @@ namespace DS.WMS.Core.Op.Method
}
#endregion
#region 获取台账查询条件
/// <summary>
/// 获取台账查询条件
/// </summary>
/// <param name="querySearch">原始查询条件</param>
/// <param name="queryExt">其他查询条件</param>
/// <returns></returns>
private List<IConditionalModel> GetPageCondition(PageRequest<BLIssueMangeQueryExtDto> querySearch,out BLIssueMangeQueryExtDto queryExt)
{
List<IConditionalModel> whereList = null;
queryExt = querySearch.OtherQueryCondition;
if (!querySearch.QueryCondition.IsNullOrEmpty())
{
whereList = querySearch.GetConditionalModels(db);
#region 处理查询条件
if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("blNo", StringComparison.OrdinalIgnoreCase)))
{
var t = whereList.FirstOrDefault(t => ((ConditionalModel)t).FieldName.Equals("blNo", StringComparison.OrdinalIgnoreCase));
queryExt.BlNo = ((ConditionalModel)t).FieldValue;
whereList.Remove(t);
}
if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("issueType", StringComparison.OrdinalIgnoreCase)))
{
var t = whereList.FirstOrDefault(t => ((ConditionalModel)t).FieldName.Equals("issueType", StringComparison.OrdinalIgnoreCase));
queryExt.IssueType = ((ConditionalModel)t).FieldValue;
whereList.Remove(t);
}
if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("status", StringComparison.OrdinalIgnoreCase)))
{
var t = whereList.FirstOrDefault(t => ((ConditionalModel)t).FieldName.Equals("Status", StringComparison.OrdinalIgnoreCase));
queryExt.Status = ((ConditionalModel)t).FieldValue;
whereList.Remove(t);
}
if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("vessel", StringComparison.OrdinalIgnoreCase)))
{
var t = whereList.FirstOrDefault(t => ((ConditionalModel)t).FieldName.Equals("vessel", StringComparison.OrdinalIgnoreCase));
queryExt.Vessel = ((ConditionalModel)t).FieldValue;
whereList.Remove(t);
}
if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("voyno", StringComparison.OrdinalIgnoreCase)))
{
var t = whereList.FirstOrDefault(t => ((ConditionalModel)t).FieldName.Equals("voyno", StringComparison.OrdinalIgnoreCase));
queryExt.Voyno = ((ConditionalModel)t).FieldValue;
whereList.Remove(t);
}
if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("customerId", StringComparison.OrdinalIgnoreCase)))
{
var t = whereList.FirstOrDefault(t => ((ConditionalModel)t).FieldName.Equals("customerId", StringComparison.OrdinalIgnoreCase));
queryExt.CustomerId = long.Parse(((ConditionalModel)t).FieldValue);
whereList.Remove(t);
}
if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("customerName", StringComparison.OrdinalIgnoreCase)
|| ((ConditionalModel)t).FieldName.Equals("vesselId", StringComparison.OrdinalIgnoreCase)))
{
var curList = whereList.Where(t => ((ConditionalModel)t).FieldName.Equals("customerName", StringComparison.OrdinalIgnoreCase)
|| ((ConditionalModel)t).FieldName.Equals("vesselId", StringComparison.OrdinalIgnoreCase)).ToList();
foreach (ConditionalModel b in curList)
{
whereList.Remove(b);
}
}
if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("businessType", StringComparison.OrdinalIgnoreCase)))
{
var t = whereList.FirstOrDefault(t => ((ConditionalModel)t).FieldName.Equals("businessType", StringComparison.OrdinalIgnoreCase));
queryExt.BusinessType = ((ConditionalModel)t).FieldValue;
whereList.Remove(t);
}
if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("doc", StringComparison.OrdinalIgnoreCase)))
{
var t = whereList.FirstOrDefault(t => ((ConditionalModel)t).FieldName.Equals("doc", StringComparison.OrdinalIgnoreCase));
queryExt.Doc = long.Parse(((ConditionalModel)t).FieldValue);
whereList.Remove(t);
}
if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("etd", StringComparison.OrdinalIgnoreCase)))
{
var curList = whereList.Where(t => ((ConditionalModel)t).FieldName.Equals("etd", StringComparison.OrdinalIgnoreCase)).ToList();
foreach (ConditionalModel b in curList)
{
if (b.ConditionalType == ConditionalType.GreaterThanOrEqual)
{
DateTime currDate = DateTime.MinValue;
if (DateTime.TryParse(b.FieldValue, out currDate))
{
querySearch.OtherQueryCondition.ETDStart = currDate;
}
}
else if (b.ConditionalType == ConditionalType.LessThanOrEqual)
{
DateTime currDate = DateTime.MinValue;
if (DateTime.TryParse(b.FieldValue, out currDate))
{
querySearch.OtherQueryCondition.ETDEnd = currDate.AddDays(1);
}
}
whereList.Remove(b);
}
}
if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("checkInDate", StringComparison.OrdinalIgnoreCase)))
{
var curList = whereList.Where(t => ((ConditionalModel)t).FieldName.Equals("checkInDate", StringComparison.OrdinalIgnoreCase)).ToList();
foreach (ConditionalModel b in curList)
{
if (b.ConditionalType == ConditionalType.GreaterThanOrEqual)
{
DateTime currDate = DateTime.MinValue;
if (DateTime.TryParse(b.FieldValue, out currDate))
{
querySearch.OtherQueryCondition.CheckInDateStart = currDate;
}
}
else if (b.ConditionalType == ConditionalType.LessThanOrEqual)
{
DateTime currDate = DateTime.MinValue;
if (DateTime.TryParse(b.FieldValue, out currDate))
{
querySearch.OtherQueryCondition.CheckInDateEnd = currDate.AddDays(1);
}
}
whereList.Remove(b);
}
}
if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("checkOutDate", StringComparison.OrdinalIgnoreCase)))
{
var curList = whereList.Where(t => ((ConditionalModel)t).FieldName.Equals("checkOutDate", StringComparison.OrdinalIgnoreCase)).ToList();
foreach (ConditionalModel b in curList)
{
if (b.ConditionalType == ConditionalType.GreaterThanOrEqual)
{
DateTime currDate = DateTime.MinValue;
if (DateTime.TryParse(b.FieldValue, out currDate))
{
querySearch.OtherQueryCondition.CheckOutDateStart = currDate;
}
}
else if (b.ConditionalType == ConditionalType.LessThanOrEqual)
{
DateTime currDate = DateTime.MinValue;
if (DateTime.TryParse(b.FieldValue, out currDate))
{
querySearch.OtherQueryCondition.CheckOutDateEnd = currDate.AddDays(1);
}
}
whereList.Remove(b);
}
}
#endregion
}
return whereList;
}
#endregion
#region 打印
/// <summary>
/// 打印

Loading…
Cancel
Save