From cab17ae5341aa742f8849da7a7d5ffc5dd820577 Mon Sep 17 00:00:00 2001 From: cjy Date: Tue, 16 Jul 2024 12:01:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Constants/TenantParamCode.cs | 60 +++++++++ .../Enums/BillCheckStatusEnum.cs | 33 +++++ .../DS.Module.SqlSugar/SqlsugarInstall.cs | 2 +- .../Op/Entity/BusinessFeeStatus.cs | 9 +- .../Op/Method/DataCallBackService.cs | 119 ++++++++++++++++++ .../DS.WMS.Core/Sys/Method/CommonService.cs | 10 +- 6 files changed, 223 insertions(+), 10 deletions(-) create mode 100644 ds-wms-service/DS.Module.Core/Constants/TenantParamCode.cs create mode 100644 ds-wms-service/DS.Module.Core/Enums/BillCheckStatusEnum.cs diff --git a/ds-wms-service/DS.Module.Core/Constants/TenantParamCode.cs b/ds-wms-service/DS.Module.Core/Constants/TenantParamCode.cs new file mode 100644 index 00000000..52b56453 --- /dev/null +++ b/ds-wms-service/DS.Module.Core/Constants/TenantParamCode.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.Module.Core.Constants +{ + /// + /// 租户参数Code常量 + /// + public class TenantParamCode + { + /// + /// 是否启用舱位相关功能 + /// + public const string ENABLE_SLOT_ABILITY = "ENABLE_SLOT_ABILITY"; + + /// + /// 是否启用费用相关功能 + /// + public const string ENABLE_FEE_ABILITY = "ENABLE_FEE_ABILITY"; + + /// + /// 是否必须使用船期表录入船期参数 + /// + public const string VESSEL_FROM_CONFIG_ONLY = "VESSEL_FROM_CONFIG_ONLY"; + + /// + /// 通过运踪更新船舶动态开关 + /// + public const string ENABLE_STATUS_TO_SAILING_DATE = "EnableStatusToSailingDate"; + + /// + /// 删除订舱前是否先询问东胜 + /// + public const string ASK_DS_BEFORE_DELETE_BOOKING_ORDER = "AskDsBeforeDeleteBookingOrder"; + + /// + /// 是否启用委托单位权限显示控制 + /// + /// 开启此参数后,在部分接口查询数据时会根据当前登陆人的权限范围来决定返回哪些委托单位,如委托单位管理台账查询接口、委托单位下拉查询接口、舱位管理台账查询接口、舱位管理详情查询接口等 + public const string IS_ENABLE_CUSTOMER_AUTHORITY = "IS_ENABLE_CUSTOMER_AUTHORITY"; + + /// + /// 订舱途径选择 + /// + public const string BOOKING_CHANNEL_SELECT_SHOW = "BOOKING_CHANNEL_SELECT_SHOW"; + + /// + /// BC任务生成默认选项 + /// + public const string BC_TASK_CREATE_ORDER = "BC_TASK_CREATE_ORDER"; + + /// + /// 订舱分公司信息 + /// + public const string BOOKING_SUB_TENANT = "BOOKING_SUB_TENANT"; + } +} diff --git a/ds-wms-service/DS.Module.Core/Enums/BillCheckStatusEnum.cs b/ds-wms-service/DS.Module.Core/Enums/BillCheckStatusEnum.cs new file mode 100644 index 00000000..690a8711 --- /dev/null +++ b/ds-wms-service/DS.Module.Core/Enums/BillCheckStatusEnum.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.Module.Core.Enums +{ + /// + /// 对账状态枚举 + /// + public enum BillCheckStatusEnum + { + /// + /// 未对账 + /// + [Description("未对账")] + NotChecked = 0, + /// + /// 已对账 + /// + [Description("已对账")] + Checked = 1, + /// + /// 部分对账 + /// + [Description("部分对账")] + PartiallyChecked = 2 + + + } +} diff --git a/ds-wms-service/DS.Module.SqlSugar/SqlsugarInstall.cs b/ds-wms-service/DS.Module.SqlSugar/SqlsugarInstall.cs index 4dd2f17e..81db135a 100644 --- a/ds-wms-service/DS.Module.SqlSugar/SqlsugarInstall.cs +++ b/ds-wms-service/DS.Module.SqlSugar/SqlsugarInstall.cs @@ -233,7 +233,7 @@ public static class SqlsugarInstall Sql = it.Sql, Param = JsonConvert.SerializeObject(it.Parameters), OperateType = diffType.ToString(), - OldValue = JsonConvert.SerializeObject(editAfterData), + OldValue = JsonConvert.SerializeObject(editBeforeData), NewValue = JsonConvert.SerializeObject(editAfterData), DiffData = diffData.DiffData, AopData = JsonConvert.SerializeObject(it.BusinessData), diff --git a/ds-wms-service/DS.WMS.Core/Op/Entity/BusinessFeeStatus.cs b/ds-wms-service/DS.WMS.Core/Op/Entity/BusinessFeeStatus.cs index 479b0269..01b8de6d 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Entity/BusinessFeeStatus.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Entity/BusinessFeeStatus.cs @@ -1,6 +1,7 @@ using System.ComponentModel; using DS.Module.Core; using DS.Module.Core.Data; +using DS.Module.Core.Enums; using SqlSugar; namespace DS.WMS.Core.Op.Entity @@ -53,7 +54,7 @@ namespace DS.WMS.Core.Op.Entity /// 应收对账状态 /// [SqlSugar.SugarColumn(ColumnDescription = "应收对账状态", IsNullable = false, DefaultValue = "0")] - public int ARCheckStatus { get; set; } = 0; + public BillCheckStatusEnum ARCheckStatus { get; set; } = BillCheckStatusEnum.NotChecked; /// @@ -161,9 +162,9 @@ namespace DS.WMS.Core.Op.Entity BusinessId = businessId, ARFeeStatus = BillFeeStatus.Entering, APFeeStatus = BillFeeStatus.Entering, - ARInvoiceStatus = 0, - APInvoiceStatus = 0, - ARCheckStatus = 0, + ARInvoiceStatus = BillInvoiceStatus.NotIssued, + APInvoiceStatus = BillInvoiceStatus.NotIssued, + ARCheckStatus = BillCheckStatusEnum.NotChecked, IsBusinessLocking = false, IsFeeLocking = false, BillAuditStatus = BillAuditStatus.Pending, diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/DataCallBackService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/DataCallBackService.cs index 8083a3e2..f4c288ea 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/DataCallBackService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/DataCallBackService.cs @@ -13,6 +13,8 @@ using NLog.Web; using DS.Module.Core.Extensions; using Logger = NLog.Logger; using Mapster; +using Microsoft.AspNetCore.Identity; +using DS.Module.Core.Constants; namespace DS.WMS.Core.Op.Method { @@ -317,6 +319,123 @@ namespace DS.WMS.Core.Op.Method } #endregion #endregion + + #region 船舶动态:ATD ETD ATA ETA MDGETA MDGATA + if (item.Status == "ATD" || item.Status == "ETD" || item.Status == "ATA" || item.Status == "ETA" || item.Status == "MDGETA" || item.Status == "MDGATA") + { + var config = await tenantDb.Queryable().FirstAsync(x => x.Code == TenantParamCode.ENABLE_STATUS_TO_SAILING_DATE); + + if (config.IsNotNull() && config.Value == "YES") + { + var order = await tenantDb.Queryable().Where(x => x.Id == businessId && x.MBLNO == item.MBLNO).FirstAsync(); + if (item.Status == "ATD") + { + //2023-8-31,排查单号为177GZHZHQ5711V的数据,原来录入的船已开船,运踪港前不再查询,而因订阅港后数据会继续回推数据,所以导致ATD被改 + //因此,暂时取消运踪回推时写入ATD,还是以船期表查询为准 + + // 2024-4-8 因为港捷需要,重新开启,并通过租户参数判断 + //变更ATD + + if (order != null && item.OpTime != null && order.ATD != item.OpTime) + { + order.ATD = item.OpTime; + await tenantDb.Updateable(order).UpdateColumns(x => new + { + x.ATD + }).EnableDiffLogEvent().ExecuteCommandAsync(); + //sendDsList.Add(item.BookingId); + //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期"); + } + + /* + * 2023年8月24日改,取消运踪回推ATD的批量更新功能 + * 和川操作经常修改提单号和船名航次,但修改时间会差好几天,导致运踪根据提单号查询的数据,回写回来之后,再根据船名航次去批量更新数据时,错误的把其他数据修改了 + * 因此,不能根据船名航次去批量修改数据,因为操作写的船名航次可能是错误的,导致把他人的数据修改错误 + */ + ////批量变更相同船期 + //if (!string.IsNullOrEmpty(o.VESSEL) && !string.IsNullOrEmpty(o.VOYNO) && !string.IsNullOrEmpty(o.CARRIERID)) + //{ + // var order = await _rep.AsQueryable().Filter(null, true).Where(x => x.VOYNO == o.VOYNO && x.VESSEL == o.VESSEL && x.CARRIERID == o.CARRIERID && x.TenantId == o.TenantId && x.IsDeleted == false && x.Id != item.BookingId).ToListAsync(); + + // foreach (var it in order) + // { + // var _oldorder = it; + // var _oldatd = it.ATD; + // if (_oldatd != item.OpTime) + // { + // it.ATD = item.OpTime; + // await _rep.UpdateAsync(it); + // await _bookingorderservice.SaveLog(it, _oldorder); + // await _bookingorderservice.SendBookingOrder(new long[] { it.Id }); + // } + // } + //} + } + //else if (item.Status == "ETD") + //{ + // if (order != null && item.OpTime != null && order.YgtETD != item.OpTime) + // { + // order.YgtETD = item.OpTime; + // await tenantDb.Updateable(order).UpdateColumns(x => new + // { + // x.YgtETD + // }).EnableDiffLogEvent().ExecuteCommandAsync(); + // //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期"); + // } + //} + //else if (item.Status == "ATA") + //{ + // if (order != null && item.OpTime != null && order.StartATA != item.OpTime) + // { + // order.StartATA = item.OpTime; + // await tenantDb.Updateable(order).UpdateColumns(x => new + // { + // x.StartATA + // }).EnableDiffLogEvent().ExecuteCommandAsync(); + // //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期"); + // } + //} + //else if (item.Status == "ETA") + //{ + // if (order != null && item.OpTime != null && order.StartETA != item.OpTime) + // { + // order.StartETA = item.OpTime; + // await tenantDb.Updateable(order).UpdateColumns(x => new + // { + // x.StartETA + // }).EnableDiffLogEvent().ExecuteCommandAsync(); + // //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期"); + // } + //} + else if (item.Status == "MDGETA") + { + if (order != null && item.OpTime != null && order.ETA != item.OpTime) + { + order.ETA = item.OpTime; + await tenantDb.Updateable(order).UpdateColumns(x => new + { + x.ETA + }).EnableDiffLogEvent().ExecuteCommandAsync(); + //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期"); + } + + } + else if (item.Status == "MDGATA") + { + if (order != null && item.OpTime != null && order.ATA != item.OpTime) + { + order.ATA = item.OpTime; + await tenantDb.Updateable(order).UpdateColumns(x => new + { + x.ATA + }).EnableDiffLogEvent().ExecuteCommandAsync(); + //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期"); + } + + } + } + } + #endregion } } diff --git a/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs index 6930da9f..74ce81a4 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs @@ -651,7 +651,7 @@ public class CommonService : ICommonService .Select(a => new RouteItem { Id = a.Id, - ParentId = a.ParentId, + ParentId = a.PermissionId, Path = a.Url, Name = a.PermissionName, EnName = a.PermissionEnName, @@ -671,14 +671,14 @@ public class CommonService : ICommonService foreach (var child in childs) { - var grandsons = db.Queryable().Where(x => - x.MenuType == 2 && x.ParentId == child.Id && x.IsHidden == false && - permissions.Contains(x.Id)) //获取第三层路由 + var grandsons = db.Queryable().Where(x => + x.MenuType == 2 && x.ParentId == child.ParentId && x.IsHidden == false && + permissions.Contains(x.PermissionId)) //获取第三层路由 .OrderBy(x => x.SortCode) .Select(a => new RouteItem { Id = a.Id, - ParentId = a.ParentId, + ParentId = a.PermissionId, Path = a.Url, Name = a.PermissionName, EnName = a.PermissionEnName,