From 9736fcfee49f419697026b5ba6e59ca746de84cb Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Wed, 5 Jul 2023 15:13:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=88=AA=E7=BA=BF=E6=93=8D=E4=BD=9C=E5=92=8C?= =?UTF-8?q?=E8=88=AA=E7=BA=BF=E7=AE=A1=E7=90=86=E9=85=8D=E7=BD=AE=20EDI?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=A2=9E=E5=8A=A0=E4=B8=BB=E5=8A=A8=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entity/BookingLineOpMgrConfig.cs | 52 ++++++++ .../BookingOrder/BookingOrderService.cs | 92 ++++++++++++- .../BookingOrder/Dto/LineOpMgrConfig.cs | 121 ++++++++++++++++++ Myshipping.Core/Entity/DJY/DjyEdiSetting.cs | 5 + .../DjyEdiSetting/Dto/DjyEdiSettingInput.cs | 5 + 5 files changed, 273 insertions(+), 2 deletions(-) create mode 100644 Myshipping.Application/Entity/BookingLineOpMgrConfig.cs create mode 100644 Myshipping.Application/Service/BookingOrder/Dto/LineOpMgrConfig.cs diff --git a/Myshipping.Application/Entity/BookingLineOpMgrConfig.cs b/Myshipping.Application/Entity/BookingLineOpMgrConfig.cs new file mode 100644 index 00000000..badf02c5 --- /dev/null +++ b/Myshipping.Application/Entity/BookingLineOpMgrConfig.cs @@ -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 +{ + /// + /// 航线操作和航线管理配置 + /// + [SugarTable("booking_line_op_mgr_config")] + [Description("航线操作和航线管理配置")] + public class BookingLineOpMgrConfig : DBEntityTenant + { + /// + /// 船公司代号 + /// + public string CARRIERID { get; set; } + /// + /// 船公司 + /// + public string CARRIER { get; set; } + /// + /// 航线 + /// + public string LineName { get; set; } + /// + /// 部门ID + /// + public long? DeptId { get; set; } + /// + /// 部门名称 + /// + public string DeptName { get; set; } + /// + /// 生效日期 + /// + public DateTime? StartDate { get; set; } + /// + /// 失效日期 + /// + public DateTime? EndDate { get; set; } + /// + /// 备注 + /// + public string REMARK { get; set; } + } +} diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 7fd38530..394c119e 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -125,6 +125,9 @@ namespace Myshipping.Application private readonly IHttpContextAccessor _httpContextAccessor; private readonly ISysOrgService _orgService; private readonly IBookingGoodsStatusConfigService _GoodsConfig; + private readonly SqlSugarRepository _repLineOpMgrConfig; + private readonly SqlSugarRepository _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 excelrep, SqlSugarRepository repUserMail, SqlSugarRepository goodsStatus, SqlSugarRepository goodsStatusConfig, SqlSugarRepository repTenant, SqlSugarRepository repBookingStatus, SqlSugarRepository bookingEDIExt, SqlSugarRepository serviceItem, SqlSugarRepository paraContractNoInfoRepository, IHttpContextAccessor httpContextAccessor, IBookingGoodsStatusConfigService GoodsConfig, SqlSugarRepository djyWebsiteAccountConfigRepository, - ISysOrgService orgService) + ISysOrgService orgService, SqlSugarRepository repLineOpMgrConfig, SqlSugarRepository 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 主表和箱信息 @@ -715,7 +721,7 @@ namespace Myshipping.Application { var mlist = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == input.Id).FirstAsync(); - if (!(mlist.OPID == UserManager.UserId.ToString() || mlist.DOCID == UserManager.UserId.ToString() || mlist.CUSTSERVICEID == UserManager.UserId.ToString() || mlist.ROUTEID == UserManager.UserId.ToString() || mlist.CreatedUserId.ToString() == UserManager.UserId.ToString()||UserManager.DjyUserId== "d85fd590-d9f6-4410-93a1-f6fac77b606e")) + if (!(mlist.OPID == UserManager.UserId.ToString() || mlist.DOCID == UserManager.UserId.ToString() || mlist.CUSTSERVICEID == UserManager.UserId.ToString() || mlist.ROUTEID == UserManager.UserId.ToString() || mlist.CreatedUserId.ToString() == UserManager.UserId.ToString() || UserManager.DjyUserId == "d85fd590-d9f6-4410-93a1-f6fac77b606e")) { throw Oops.Bah("您没有当前单据的操作权限!"); @@ -8227,5 +8233,87 @@ namespace Myshipping.Application } #endregion + + #region 航线操作和航线管理 + + /// + /// 航线操作和航线管理列表 + /// + /// + [HttpPost("/BookingOrder/LineOpMgrConfigList")] + public async Task> 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>(); + + return list; + } + + + /// + /// 航线操作和航线管理配置保存 + /// + /// + [HttpPost("/BookingOrder/LineOpMgrConfigSave")] + public async Task 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(); + await _repLineOpMgrConfig.InsertAsync(model); + } + + return model.Adapt(); + } + + ///// + ///// 根据条件(船司、航线、当前登录人部门)查询匹配的航线操作和航线管理 + ///// + ///// 船司ID + ///// 航线名称 + ///// + //[HttpGet("/BookingOrder/LineOpMgrConfigSearch")] + //public async Task 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 } } diff --git a/Myshipping.Application/Service/BookingOrder/Dto/LineOpMgrConfig.cs b/Myshipping.Application/Service/BookingOrder/Dto/LineOpMgrConfig.cs new file mode 100644 index 00000000..d147e64f --- /dev/null +++ b/Myshipping.Application/Service/BookingOrder/Dto/LineOpMgrConfig.cs @@ -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 + { + /// + /// 船公司代号 + /// + public string CARRIERID { get; set; } + /// + /// 船公司 + /// + public string CARRIER { get; set; } + /// + /// 航线 + /// + public string LineName { get; set; } + /// + /// 部门ID + /// + public long? DeptId { get; set; } + /// + /// 部门名称 + /// + public string DeptName { get; set; } + /// + /// 生效日期起始 + /// + public DateTime? StartDateBegin { get; set; } + /// + /// 生效日期结束 + /// + public DateTime? StartDateEnd { get; set; } + /// + /// 失效日期起始 + /// + public DateTime? EndDateBegin { get; set; } + /// + /// 失效日期结束 + /// + public DateTime? EndDateEnd { get; set; } + } + + //列表输出 + public class LineOpMgrConfigListModel + { + /// + /// 船公司代号 + /// + public string CARRIERID { get; set; } + /// + /// 船公司 + /// + public string CARRIER { get; set; } + /// + /// 航线 + /// + public string LineName { get; set; } + /// + /// 部门ID + /// + public long? DeptId { get; set; } + /// + /// 部门名称 + /// + public string DeptName { get; set; } + /// + /// 生效日期 + /// + public string StartDate { get; set; } + /// + /// 失效日期 + /// + public string EndDate { get; set; } + } + + + //保存输入 + public class LineOpMgrConfigSaveModel + { + /// + /// 主键Id + /// + public long Id { get; set; } + /// + /// 船公司代号 + /// + public string CARRIERID { get; set; } + /// + /// 船公司 + /// + public string CARRIER { get; set; } + /// + /// 航线 + /// + public string LineName { get; set; } + /// + /// 部门ID + /// + public long? DeptId { get; set; } + /// + /// 部门名称 + /// + public string DeptName { get; set; } + /// + /// 生效日期 + /// + public DateTime? StartDate { get; set; } + /// + /// 失效日期 + /// + public DateTime? EndDate { get; set; } + } +} diff --git a/Myshipping.Core/Entity/DJY/DjyEdiSetting.cs b/Myshipping.Core/Entity/DJY/DjyEdiSetting.cs index 4fd332fe..1c606671 100644 --- a/Myshipping.Core/Entity/DJY/DjyEdiSetting.cs +++ b/Myshipping.Core/Entity/DJY/DjyEdiSetting.cs @@ -129,5 +129,10 @@ namespace Myshipping.Core.Entity /// 发货方代码 /// public string SENDSHIPPERCODE { get; set; } + + /// + /// FTP主动模式 + /// + public bool FtpModeActive { get; set; } } } \ No newline at end of file diff --git a/Myshipping.Core/Service/DjyEdiSetting/Dto/DjyEdiSettingInput.cs b/Myshipping.Core/Service/DjyEdiSetting/Dto/DjyEdiSettingInput.cs index 19b3c95e..1d068035 100644 --- a/Myshipping.Core/Service/DjyEdiSetting/Dto/DjyEdiSettingInput.cs +++ b/Myshipping.Core/Service/DjyEdiSetting/Dto/DjyEdiSettingInput.cs @@ -152,6 +152,11 @@ namespace Myshipping.Core /// 发货方代码 /// public string SENDSHIPPERCODE { get; set; } + + /// + /// FTP主动模式 + /// + public bool FtpModeActive { get; set; } } ///