jianghaiqing 6 months ago
commit ede6279616

@ -19,5 +19,10 @@ namespace Myshipping.Application.Entity
/// 标签使用范围 1-舱位管理台账
/// </summary>
public int Scope { get; set; }
/// <summary>
/// 颜色
/// </summary>
public string Color { get; set; }
}
}

@ -206,7 +206,7 @@ namespace Myshipping.Application
/// 所在周数
/// </summary>
[SugarColumn(ColumnName = "WEEK_AT")]
public string WEEK_AT { get; set; }
public int? WEEK_AT { get; set; }
/// <summary>
/// 箱使天数

@ -223,7 +223,7 @@ namespace Myshipping.Application
/// </summary>
[SugarColumn(ColumnName = "WEEK_AT")]
[Description("所在周数")]
public string WEEK_AT{ get; set; }
public int? WEEK_AT{ get; set; }
/// <summary>
/// 箱使天数

@ -131,23 +131,23 @@ namespace Myshipping.Application
[Description("卸货港国家名称")]
public string PORTDISCHARGE_COUNTRY { get; set; }
/// <summary>
/// 航线代码(船公司)
/// </summary>
[SugarColumn(ColumnName = "LANECODE")]
public string LANECODE { get; set; }
/// <summary>
/// 航线名称(船公司)
/// </summary>
[SugarColumn(ColumnName = "LANENAME")]
public string LANENAME { get; set; }
/// <summary>
/// 所在周数
/// </summary>
[SugarColumn(ColumnName = "WEEK_AT")]
public string WEEK_AT { get; set; }
///// <summary>
///// 航线代码(船公司)
///// </summary>
//[SugarColumn(ColumnName = "LANECODE")]
//public string LANECODE { get; set; }
///// <summary>
///// 航线名称(船公司)
///// </summary>
//[SugarColumn(ColumnName = "LANENAME")]
//public string LANENAME { get; set; }
///// <summary>
///// 所在周数
///// </summary>
//[SugarColumn(ColumnName = "WEEK_AT")]
//public string WEEK_AT { get; set; }
/// <summary>
/// 箱型箱量

@ -94,6 +94,20 @@ namespace Myshipping.Application
: cacheList.Where(x => x.Scope == scope).ToList();
return result;
}
/// <summary>
/// 分页获取全部或指定范围类型的标签列表
/// </summary>
[HttpPost("/BookingLabel/PageList")]
public async Task<SqlSugarPagedList<BookingLabelBaseDto>> PageList(BookingLabelPageListInput input)
{
var list = await _rep.AsQueryable()
.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name))
.WhereIF(input.Scope != null, x => x.Scope == input.Scope)
.ToPagedListAsync(input.PageNo, input.PageSize);
var result = list.Adapt<SqlSugarPagedList<BookingLabelBaseDto>>();
return result;
}
/// <summary>
/// 新增或修改标签信息

@ -1,4 +1,5 @@
namespace Myshipping.Application.Service.BookingLabel.Dto
using Myshipping.Core;
namespace Myshipping.Application.Service.BookingLabel.Dto
{
public class BookingLabelBaseDto
{
@ -12,6 +13,10 @@
/// 标签使用范围 1-舱位
/// </summary>
public int Scope { get; set; }
/// <summary>
/// 颜色
/// </summary>
public string Color { get; set; }
}
/// <summary>
@ -28,4 +33,16 @@
/// </summary>
public long[] BusinessIdArray { get; set; }
}
public class BookingLabelPageListInput : PageInputBase
{
/// <summary>
/// 标签名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 标签使用范围 1-舱位
/// </summary>
public int? Scope { get; set; }
}
}

@ -1367,12 +1367,8 @@ namespace Myshipping.Application
[HttpPost("/BookingSlot/page")]
public async Task<dynamic> Page(BookingSlotBasePageInput input)
{
if (!string.IsNullOrEmpty(input.WEEK_AT))
{
input.WEEK_AT = "W" + input.WEEK_AT;
}
ISugarQueryable<BookingSlotBase> select = null;
// 箱型筛选
string[] ctnCodeArr = null;
if (!string.IsNullOrEmpty(input.CTN_STAT))
@ -1409,10 +1405,10 @@ namespace Myshipping.Application
.WhereIF(!string.IsNullOrEmpty(input.BOOKING_SLOT_TYPE), u => u.BOOKING_SLOT_TYPE == input.BOOKING_SLOT_TYPE)
.WhereIF(!string.IsNullOrEmpty(input.LANENAME), u => u.LANENAME.Contains(input.LANENAME))
.WhereIF(!string.IsNullOrEmpty(input.WEEK_AT), u => u.WEEK_AT == input.WEEK_AT)
.WhereIF(input.WEEK_AT != null, u => u.WEEK_AT == input.WEEK_AT)
// 标签筛选
.WhereIF(input.LabelIdArray != null && input.LabelIdArray.Length > 0,
.WhereIF(input.LabelIdArray != null && input.LabelIdArray.Length > 0,
u => SqlFunc.Subqueryable<BookingLabelAllocation>()
.Where(x => x.BusinessId == u.Id && input.LabelIdArray.Contains(x.LabelId))
.Any());

@ -123,7 +123,7 @@ namespace Myshipping.Application.Service.BookingSlot.Dto
/// <summary>
/// 周数
/// </summary>
public string WEEK_AT { get; set; }
public int? WEEK_AT { get; set; }
/// <summary>
/// 标签Id列表
@ -313,7 +313,7 @@ namespace Myshipping.Application.Service.BookingSlot.Dto
/// 所在周数
/// </summary>
[Description("所在周数")]
public string WEEK_AT { get; set; }
public int? WEEK_AT { get; set; }
/// <summary>
/// 箱使天数

@ -129,7 +129,7 @@ namespace Myshipping.Application.Service.BookingSlot.Dto
/// <summary>
/// 所在周数
/// </summary>
public string WEEK_AT { get; set; }
public int? WEEK_AT { get; set; }
/// <summary>
/// 箱型箱量

@ -1249,7 +1249,7 @@ namespace Myshipping.Application
VESSEL = taskBCInfo.VESSEL,
VOYNO = taskBCInfo.VOYNO,
VGM_SUBMISSION_CUT_DATE = taskBCInfo.VGM_CUTOFF_TIME,
WEEK_AT = taskBCInfo.WEEK_AT,
//WEEK_AT = taskBCInfo.WEEK_AT,
CARRIAGE_TYPE = taskBCInfo.CARRIAGE_TYPE,
CARRIAGE_TYPE_NAME = taskBCInfo.CARRIAGE_TYPE_NAME,
CONTRACT_NO = taskBCInfo.CONTRACTNO,
@ -1273,6 +1273,10 @@ namespace Myshipping.Application
},
OpType = opType
};
if (int.TryParse(taskBCInfo.WEEK_AT, out int _weekat))
{
slotModel.DataObj.WEEK_AT = _weekat;
}
var ctnCodeList = _cache.GetAllCodeCtn().GetAwaiter().GetResult().ToList();
@ -2924,7 +2928,7 @@ namespace Myshipping.Application
VESSEL = taskBCInfo.VESSEL,
VOYNO = taskBCInfo.VOYNO,
VGM_SUBMISSION_CUT_DATE = taskBCInfo.VGM_CUTOFF_TIME,
WEEK_AT = taskBCInfo.WEEK_AT,
//WEEK_AT = taskBCInfo.WEEK_AT,
CARRIAGE_TYPE = taskBCInfo.CARRIAGE_TYPE,
CARRIAGE_TYPE_NAME = taskBCInfo.CARRIAGE_TYPE_NAME,
CONTRACT_NO = taskBCInfo.CONTRACTNO,
@ -2948,6 +2952,10 @@ namespace Myshipping.Application
},
OpType = "update"
};
if (int.TryParse(taskBCInfo.WEEK_AT, out int _weekat))
{
slotModel.DataObj.WEEK_AT = _weekat;
}
var ctnList = _taskBCCTNInfoRepository.AsQueryable().Where(a => a.P_ID == taskBCInfo.PK_ID).ToList();

@ -13932,7 +13932,7 @@
<param name="dto"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyVesselInfoService.GetList(System.String,System.Nullable{System.DateTime},System.String,System.String,System.Nullable{System.DateTime},System.Nullable{System.DateTime},System.String,System.Boolean,System.Int32)">
<member name="M:Myshipping.Core.Service.DjyVesselInfoService.GetList(System.String,System.Nullable{System.DateTime},System.String,System.String,System.String,System.Nullable{System.DateTime},System.Nullable{System.DateTime},System.String,System.Boolean,System.Int32)">
<summary>
下拉列表
</summary>

@ -150,15 +150,22 @@ namespace Myshipping.Core.Service
/// </summary>
/// <returns></returns>
[HttpGet("/DjyVesselInfoService/GetList")]
public async Task<dynamic> GetList([FromQuery] string CarrierID, DateTime? ETD = null, string PortDischargeId = null, string KeyWord = "", DateTime? etdStart = null, DateTime? etdEnd = null, string sortField = null, bool descSort = false, int limit = 20)
public async Task<dynamic> GetList([FromQuery] string CarrierID,
DateTime? ETD = null,
string PortDischargeId = null,
string PortLoadingId = null,
string KeyWord = "",
DateTime? etdStart = null,
DateTime? etdEnd = null,
string sortField = null,
bool descSort = false,
int limit = 20)
{
//获取船名
List<CodeVessel> list = await _sysCacheService.GetAllCodeVessel();
var query = _rep.AsQueryable().Filter(null, true).
Where(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false && x.CARRIERID != null && x.CARRIERID != "").
WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Vessel.StartsWith(KeyWord.ToUpper())).
WhereIF(!string.IsNullOrEmpty(PortDischargeId), x => x.PortDischargeId == PortDischargeId).
WhereIF(!string.IsNullOrEmpty(PortLoadingId), x => x.PortLoadingId == PortLoadingId).
WhereIF(ETD != null, x => Convert.ToDateTime(x.ETD).ToString("yyyy-MM-dd") == Convert.ToDateTime(ETD).ToString("yyyy-MM-dd")).//船期关联船名
WhereIF(ETD == null && etdStart == null && etdEnd == null, x => x.ETD > DateTime.Now.AddDays(-7)).//领导需求当前日期7天之前
WhereIF(etdStart.HasValue, x => x.ETD >= etdStart).
@ -183,6 +190,7 @@ namespace Myshipping.Core.Service
query = query.OrderBy(PageInputOrder.OrderBuilder(sortField, descSort));
}
var tlist = await query
.Take(limit)
.ToListAsync();
@ -193,26 +201,55 @@ namespace Myshipping.Core.Service
return tlist;
}
var ves = tlist.Select(x => x.Vessel).ToList();
var all = list.WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Name.StartsWith(KeyWord.ToUpper())).
Select(x => new
List<CodeVessel> commonList = await _sysCacheService.GetAllCodeVessel();
if (string.IsNullOrEmpty(KeyWord))
{
Voyno = "",
VoynoInside = "",
Vessel = x.Name,
ETD = "",
ATD = "",
PortDischargeId = "",
PortDischarge = ""
}).Take(limit).ToList();
foreach (var item in ves)
foreach (var item in commonList)
{
if (tlist.Count >= 10)
{
return tlist;
}
if (tlist.Any(x => x.Vessel == item.Name))
{
continue;
}
tlist.Add(new
{
Voyno = "",
VoynoInside = "",
Vessel = item.Name,
ETD = "",
ATD = "",
PortDischargeId = "",
PortDischarge = "",
ClosingDate = "",
CloseDocTime = ""
});
}
return tlist;
}
else
{
all.RemoveAll(x => x.Vessel.StartsWith(item));
commonList = commonList.Where(x => x.Name.StartsWith(KeyWord.ToUpper())).ToList();
foreach (var item in tlist)
{
commonList.RemoveAll(x => x.Name == item.Vessel);
}
var temp = commonList.Select(x => new
{
Voyno = "",
VoynoInside = "",
Vessel = x.Name,
ETD = "",
ATD = "",
PortDischargeId = "",
PortDischarge = "",
ClosingDate = "",
CloseDocTime = ""
});
return tlist.Union(temp);
}
return tlist.Union<dynamic>(all);
}
}
}

@ -119,9 +119,12 @@ public static class SqlSugarSetup
{
Console.ForegroundColor = ConsoleColor.Blue;
}
//Console.WriteLine("Sql:" + "\r\n\r\n" + UtilMethods.GetSqlString(c.DbType, sql, pars));
//App.PrintToMiniProfiler("SqlSugar", "Info", UtilMethods.GetSqlString(c.DbType, sql, pars));
//$"DB:{c.ConfigId}, Sql:\r\n\r\n { UtilMethods.GetSqlString(c.DbType, sql, pars)}".LogInformation();
if (App.WebHostEnvironment.EnvironmentName == "Development")
{
//Console.WriteLine("Sql:" + "\r\n\r\n" + UtilMethods.GetSqlString(c.DbType, sql, pars));
//App.PrintToMiniProfiler("SqlSugar", "Info", UtilMethods.GetSqlString(c.DbType, sql, pars));
$"DB:{c.ConfigId}, Sql:\r\n\r\n {UtilMethods.GetSqlString(c.DbType, sql, pars)}".LogInformation();
}
};

Loading…
Cancel
Save