jianghaiqing 6 months ago
commit ede6279616

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

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

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

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

@ -94,6 +94,20 @@ namespace Myshipping.Application
: cacheList.Where(x => x.Scope == scope).ToList(); : cacheList.Where(x => x.Scope == scope).ToList();
return result; 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> /// <summary>
/// 新增或修改标签信息 /// 新增或修改标签信息

@ -1,4 +1,5 @@
namespace Myshipping.Application.Service.BookingLabel.Dto using Myshipping.Core;
namespace Myshipping.Application.Service.BookingLabel.Dto
{ {
public class BookingLabelBaseDto public class BookingLabelBaseDto
{ {
@ -12,6 +13,10 @@
/// 标签使用范围 1-舱位 /// 标签使用范围 1-舱位
/// </summary> /// </summary>
public int Scope { get; set; } public int Scope { get; set; }
/// <summary>
/// 颜色
/// </summary>
public string Color { get; set; }
} }
/// <summary> /// <summary>
@ -28,4 +33,16 @@
/// </summary> /// </summary>
public long[] BusinessIdArray { get; set; } 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,10 +1367,6 @@ namespace Myshipping.Application
[HttpPost("/BookingSlot/page")] [HttpPost("/BookingSlot/page")]
public async Task<dynamic> Page(BookingSlotBasePageInput input) public async Task<dynamic> Page(BookingSlotBasePageInput input)
{ {
if (!string.IsNullOrEmpty(input.WEEK_AT))
{
input.WEEK_AT = "W" + input.WEEK_AT;
}
ISugarQueryable<BookingSlotBase> select = null; ISugarQueryable<BookingSlotBase> select = null;
// 箱型筛选 // 箱型筛选
@ -1409,7 +1405,7 @@ namespace Myshipping.Application
.WhereIF(!string.IsNullOrEmpty(input.BOOKING_SLOT_TYPE), u => u.BOOKING_SLOT_TYPE == input.BOOKING_SLOT_TYPE) .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.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,

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

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

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

@ -13932,7 +13932,7 @@
<param name="dto"></param> <param name="dto"></param>
<returns></returns> <returns></returns>
</member> </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>
下拉列表 下拉列表
</summary> </summary>

@ -150,15 +150,22 @@ namespace Myshipping.Core.Service
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpGet("/DjyVesselInfoService/GetList")] [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). var query = _rep.AsQueryable().Filter(null, true).
Where(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false && x.CARRIERID != null && x.CARRIERID != ""). 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.IsNullOrWhiteSpace(KeyWord), x => x.Vessel.StartsWith(KeyWord.ToUpper())).
WhereIF(!string.IsNullOrEmpty(PortDischargeId), x => x.PortDischargeId == PortDischargeId). 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, 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(ETD == null && etdStart == null && etdEnd == null, x => x.ETD > DateTime.Now.AddDays(-7)).//领导需求当前日期7天之前
WhereIF(etdStart.HasValue, x => x.ETD >= etdStart). WhereIF(etdStart.HasValue, x => x.ETD >= etdStart).
@ -183,6 +190,7 @@ namespace Myshipping.Core.Service
query = query.OrderBy(PageInputOrder.OrderBuilder(sortField, descSort)); query = query.OrderBy(PageInputOrder.OrderBuilder(sortField, descSort));
} }
var tlist = await query var tlist = await query
.Take(limit) .Take(limit)
.ToListAsync(); .ToListAsync();
@ -193,26 +201,55 @@ namespace Myshipping.Core.Service
return tlist; return tlist;
} }
List<CodeVessel> commonList = await _sysCacheService.GetAllCodeVessel();
if (string.IsNullOrEmpty(KeyWord))
var ves = tlist.Select(x => x.Vessel).ToList();
var all = list.WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Name.StartsWith(KeyWord.ToUpper())).
Select(x => new
{ {
foreach (var item in commonList)
Voyno = "", {
VoynoInside = "", if (tlist.Count >= 10)
Vessel = x.Name, {
ETD = "", return tlist;
ATD = "", }
PortDischargeId = "", if (tlist.Any(x => x.Vessel == item.Name))
PortDischarge = "" {
}).Take(limit).ToList(); continue;
foreach (var item in ves) }
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.ForegroundColor = ConsoleColor.Blue;
} }
//Console.WriteLine("Sql:" + "\r\n\r\n" + UtilMethods.GetSqlString(c.DbType, sql, pars)); if (App.WebHostEnvironment.EnvironmentName == "Development")
//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(); //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