|
|
|
@ -125,6 +125,9 @@ namespace Myshipping.Application
|
|
|
|
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
|
|
|
|
private readonly ISysOrgService _orgService;
|
|
|
|
|
private readonly IBookingGoodsStatusConfigService _GoodsConfig;
|
|
|
|
|
private readonly SqlSugarRepository<BookingLineOpMgrConfig> _repLineOpMgrConfig;
|
|
|
|
|
private readonly SqlSugarRepository<SysEmp> _repSysEmp;
|
|
|
|
|
|
|
|
|
|
const string CONST_MAPPING_MODULE = "BOOK_OR_CLOSING";
|
|
|
|
|
const string CONST_MAPPING_MODULE_ROUTE = "BOOK_OR_CLOSING_RT";
|
|
|
|
|
private const string PrintRecentListTypeKey = "booking_print_recent_list";
|
|
|
|
@ -145,7 +148,7 @@ namespace Myshipping.Application
|
|
|
|
|
SqlSugarRepository<BookingExcelTemplate> excelrep, SqlSugarRepository<DjyUserMailAccount> repUserMail, SqlSugarRepository<BookingGoodsStatus> goodsStatus, SqlSugarRepository<BookingGoodsStatusConfig> goodsStatusConfig,
|
|
|
|
|
SqlSugarRepository<SysTenant> repTenant, SqlSugarRepository<BookingStatus> repBookingStatus, SqlSugarRepository<BookingEDIExt> bookingEDIExt, SqlSugarRepository<BookingServiceItem> serviceItem,
|
|
|
|
|
SqlSugarRepository<ParaContractNoInfo> paraContractNoInfoRepository, IHttpContextAccessor httpContextAccessor, IBookingGoodsStatusConfigService GoodsConfig, SqlSugarRepository<DjyWebsiteAccountConfig> djyWebsiteAccountConfigRepository,
|
|
|
|
|
ISysOrgService orgService)
|
|
|
|
|
ISysOrgService orgService, SqlSugarRepository<BookingLineOpMgrConfig> repLineOpMgrConfig, SqlSugarRepository<SysEmp> repSysEmp)
|
|
|
|
|
{
|
|
|
|
|
this._logger = logger;
|
|
|
|
|
this._rep = rep;
|
|
|
|
@ -187,6 +190,9 @@ namespace Myshipping.Application
|
|
|
|
|
_GoodsConfig = GoodsConfig;
|
|
|
|
|
|
|
|
|
|
_djyWebsiteAccountConfigRepository = djyWebsiteAccountConfigRepository;
|
|
|
|
|
|
|
|
|
|
this._repLineOpMgrConfig = repLineOpMgrConfig;
|
|
|
|
|
this._repSysEmp = repSysEmp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 主表和箱信息
|
|
|
|
@ -8227,5 +8233,87 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 航线操作和航线管理
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 航线操作和航线管理列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("/BookingOrder/LineOpMgrConfigList")]
|
|
|
|
|
public async Task<SqlSugarPagedList<LineOpMgrConfigListModel>> LineOpMgrConfigList(LineOpMgrConfigQueryInput input)
|
|
|
|
|
{
|
|
|
|
|
var query = _repLineOpMgrConfig.AsQueryable()
|
|
|
|
|
.WhereIF(string.IsNullOrEmpty(input.CARRIERID), x => x.CARRIERID == input.CARRIERID)
|
|
|
|
|
.WhereIF(string.IsNullOrEmpty(input.CARRIER), x => x.CARRIER.Contains(input.CARRIER))
|
|
|
|
|
.WhereIF(input.DeptId.HasValue, x => x.DeptId == input.DeptId)
|
|
|
|
|
.WhereIF(string.IsNullOrEmpty(input.DeptName), x => x.DeptName.Contains(input.DeptName))
|
|
|
|
|
.WhereIF(input.StartDateBegin.HasValue, x => x.StartDate > input.StartDateBegin);
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(input.SortField) || input.MultiSort == null || input.MultiSort.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
query = query.OrderBy(PageInputOrder.OrderBuilder(input.SortField, input.DescSort));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
query = query.OrderBy(PageInputOrder.MultiOrderBuilder(input.MultiSort));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var entities = await query.ToPagedListAsync(input.PageNo, input.PageSize);
|
|
|
|
|
var list = entities.Adapt<SqlSugarPagedList<LineOpMgrConfigListModel>>();
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 航线操作和航线管理配置保存
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("/BookingOrder/LineOpMgrConfigSave")]
|
|
|
|
|
public async Task<LineOpMgrConfigSaveModel> LineOpMgrConfigSave(LineOpMgrConfigSaveModel input)
|
|
|
|
|
{
|
|
|
|
|
BookingLineOpMgrConfig model = null;
|
|
|
|
|
if (input.Id > 0)
|
|
|
|
|
{
|
|
|
|
|
model = _repLineOpMgrConfig.FirstOrDefault(x => x.Id == input.Id);
|
|
|
|
|
if (model == null)
|
|
|
|
|
throw Oops.Bah("未找到数据");
|
|
|
|
|
|
|
|
|
|
input.Adapt(model);
|
|
|
|
|
await _repLineOpMgrConfig.UpdateAsync(model);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
model = input.Adapt<BookingLineOpMgrConfig>();
|
|
|
|
|
await _repLineOpMgrConfig.InsertAsync(model);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return model.Adapt<LineOpMgrConfigSaveModel>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///// <summary>
|
|
|
|
|
///// 根据条件(船司、航线、当前登录人部门)查询匹配的航线操作和航线管理
|
|
|
|
|
///// </summary>
|
|
|
|
|
///// <param name="carrierId">船司ID</param>
|
|
|
|
|
///// <param name="line">航线名称</param>
|
|
|
|
|
///// <returns></returns>
|
|
|
|
|
//[HttpGet("/BookingOrder/LineOpMgrConfigSearch")]
|
|
|
|
|
//public async Task<LineOpMgrConfigSaveModel> LineOpMgrConfigSearch(string carrierId, string line)
|
|
|
|
|
//{
|
|
|
|
|
// var emp = _repSysEmp.FirstOrDefault(x => x.Id == UserManager.UserId);
|
|
|
|
|
// if (emp == null || emp.OrgId > 0 || string.IsNullOrEmpty(emp.OrgName))
|
|
|
|
|
// throw Oops.Bah("未找到用户部门");
|
|
|
|
|
|
|
|
|
|
// var list = _repLineOpMgrConfig.AsQueryable()
|
|
|
|
|
// .Where(x => x.StartDate <= DateTime.Today && x.EndDate >= DateTime.Today)
|
|
|
|
|
// .WhereIF(!string.IsNullOrEmpty(carrierId), x => x.CARRIERID == carrierId)
|
|
|
|
|
// .WhereIF(!string.IsNullOrEmpty(line), x => x.LineName == line)
|
|
|
|
|
// .ToList();
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|