航线操作和航线管理配置

EDI设置增加主动模式
optimize
wanghaomei 1 year ago
parent 0a13b7df58
commit 9736fcfee4

@ -0,0 +1,52 @@
using Myshipping.Core.Entity;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application.Entity
{
/// <summary>
/// 航线操作和航线管理配置
/// </summary>
[SugarTable("booking_line_op_mgr_config")]
[Description("航线操作和航线管理配置")]
public class BookingLineOpMgrConfig : DBEntityTenant
{
/// <summary>
/// 船公司代号
/// </summary>
public string CARRIERID { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string CARRIER { get; set; }
/// <summary>
/// 航线
/// </summary>
public string LineName { get; set; }
/// <summary>
/// 部门ID
/// </summary>
public long? DeptId { get; set; }
/// <summary>
/// 部门名称
/// </summary>
public string DeptName { get; set; }
/// <summary>
/// 生效日期
/// </summary>
public DateTime? StartDate { get; set; }
/// <summary>
/// 失效日期
/// </summary>
public DateTime? EndDate { get; set; }
/// <summary>
/// 备注
/// </summary>
public string REMARK { get; set; }
}
}

@ -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
}
}

@ -0,0 +1,121 @@
using Myshipping.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application.Service.BookingOrder.Dto
{
//查询输入
public class LineOpMgrConfigQueryInput : PageInputBase
{
/// <summary>
/// 船公司代号
/// </summary>
public string CARRIERID { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string CARRIER { get; set; }
/// <summary>
/// 航线
/// </summary>
public string LineName { get; set; }
/// <summary>
/// 部门ID
/// </summary>
public long? DeptId { get; set; }
/// <summary>
/// 部门名称
/// </summary>
public string DeptName { get; set; }
/// <summary>
/// 生效日期起始
/// </summary>
public DateTime? StartDateBegin { get; set; }
/// <summary>
/// 生效日期结束
/// </summary>
public DateTime? StartDateEnd { get; set; }
/// <summary>
/// 失效日期起始
/// </summary>
public DateTime? EndDateBegin { get; set; }
/// <summary>
/// 失效日期结束
/// </summary>
public DateTime? EndDateEnd { get; set; }
}
//列表输出
public class LineOpMgrConfigListModel
{
/// <summary>
/// 船公司代号
/// </summary>
public string CARRIERID { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string CARRIER { get; set; }
/// <summary>
/// 航线
/// </summary>
public string LineName { get; set; }
/// <summary>
/// 部门ID
/// </summary>
public long? DeptId { get; set; }
/// <summary>
/// 部门名称
/// </summary>
public string DeptName { get; set; }
/// <summary>
/// 生效日期
/// </summary>
public string StartDate { get; set; }
/// <summary>
/// 失效日期
/// </summary>
public string EndDate { get; set; }
}
//保存输入
public class LineOpMgrConfigSaveModel
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 船公司代号
/// </summary>
public string CARRIERID { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string CARRIER { get; set; }
/// <summary>
/// 航线
/// </summary>
public string LineName { get; set; }
/// <summary>
/// 部门ID
/// </summary>
public long? DeptId { get; set; }
/// <summary>
/// 部门名称
/// </summary>
public string DeptName { get; set; }
/// <summary>
/// 生效日期
/// </summary>
public DateTime? StartDate { get; set; }
/// <summary>
/// 失效日期
/// </summary>
public DateTime? EndDate { get; set; }
}
}

@ -129,5 +129,10 @@ namespace Myshipping.Core.Entity
/// 发货方代码
/// </summary>
public string SENDSHIPPERCODE { get; set; }
/// <summary>
/// FTP主动模式
/// </summary>
public bool FtpModeActive { get; set; }
}
}

@ -152,6 +152,11 @@ namespace Myshipping.Core
/// 发货方代码
/// </summary>
public string SENDSHIPPERCODE { get; set; }
/// <summary>
/// FTP主动模式
/// </summary>
public bool FtpModeActive { get; set; }
}
/// <summary>

Loading…
Cancel
Save