From 509d1784679ed131a105fb5e64b7ae1e852a9dac Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 19 Jul 2024 18:17:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9MSK=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Constants/MultiLanguageConst.cs | 16 ++++++ .../SpaceBooking/SpaceBookingMSKAPIService.cs | 49 ++++++++++--------- .../DS.WMS.OpApi/DS.WMS.OpApi.csproj.user | 2 +- .../PublishProfiles/FolderProfile.pubxml.user | 2 +- 4 files changed, 44 insertions(+), 25 deletions(-) diff --git a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs index a5b659e8..ffef9ec4 100644 --- a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs @@ -1293,6 +1293,22 @@ public static class MultiLanguageConst [Description("清除缓存成功")] public const string RemoveCacheSucc = "RemoveCache_Succ"; + /// + /// 预订舱数据不存在或已作废 + /// + [Description("预订舱数据不存在或已作废")] + public const string SpaceBookingRecordDeletedOrNoExists = "SpaceBooking_Record_DeletedOrNoExists"; + /// + /// 预订舱数据已发送成功,不能重复发送 + /// + [Description("预订舱数据已发送成功,不能重复发送")] + public const string SpaceBookingBeSendNotRepeat = "SpaceBooking_BeSend_NotRepeat"; + + /// + /// 预订舱数据已发送成功,不能修改 + /// + [Description("预订舱数据已发送成功,不能修改")] + public const string SpaceBookingBeSendNotModify = "SpaceBooking_BeSend_NotModify"; #endregion } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs index 7d408a64..7fe1b622 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs @@ -1464,7 +1464,7 @@ namespace DS.WMS.Core.Op.Method selectedShipSchedule = JsonConvert.DeserializeObject(shipScheduleRecord.ShipJson); } - //if (selectedShipSchedule == null) + if (selectedShipSchedule == null) //throw Oops.Oh("船期数据校验失败,请重新查询船期信息"); model.placeOfReceiptCountryName = selectedShipSchedule.originCountryName; @@ -1487,15 +1487,18 @@ namespace DS.WMS.Core.Op.Method var oldInfo = tenantDb.Queryable() .First(a => a.Id == model.id); - //if (oldInfo == null) - //throw Oops.Oh("订舱数据不存在或已作废"); + //预订舱数据不存在或已作废 + if (oldInfo == null) + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingRecordDeletedOrNoExists))); if (oldInfo.Status == "SUCC") { - //if (isSendApi) - //throw Oops.Oh("订舱数据已发送成功,不能重复发送"); + //预订舱数据已发送成功,不能重复发送 + if (isSendApi) + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingBeSendNotRepeat))); - //throw Oops.Oh("订舱数据已发送成功,不能修改"); + //预订舱数据已发送成功,不能修改 + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingBeSendNotModify))); } @@ -1504,7 +1507,7 @@ namespace DS.WMS.Core.Op.Method entity.Id = model.id.Value; entity.UpdateTime = nowDate; entity.UpdateBy = long.Parse(user.UserId); - //entity.UpdatedUserName = UserManager.Name; + entity.UpdateUserName = user.UserName; entity.CtnStat = ctnStat; entity.BookingChannelType = "CON_API"; entity.BookingChannelTypeName = "合约订舱"; @@ -1513,7 +1516,7 @@ namespace DS.WMS.Core.Op.Method { x.CreateTime, x.CreateBy, - //x.CreatedUserName, + x.CreateUserName, x.BookingReference, x.BookingId, x.RequestAcknowledgementId, @@ -1546,12 +1549,12 @@ namespace DS.WMS.Core.Op.Method ctnEntity.RecordId = entity.Id; ctnEntity.UpdateTime = nowDate; ctnEntity.UpdateBy = long.Parse(user.UserId); - //ctnEntity.UpdatedUserName = UserManager.Name; + ctnEntity.UpdateUserName = user.UserName; tenantDb.Updateable(ctnEntity).IgnoreColumns(x => new { x.CreateBy, - //x.CreatedUserName, + x.CreateUserName, x.CreateTime, //x.TenantId, x.StuffingMeasurementType, @@ -1573,7 +1576,7 @@ namespace DS.WMS.Core.Op.Method ctnEntity.CreateTime = nowDate; ctnEntity.UpdateTime = nowDate; ctnEntity.CreateBy = long.Parse(user.UserId); - //ctnEntity.CreatedUserName = UserManager.Name; + ctnEntity.CreateUserName = user.UserName; ctnEntity.StuffingMeasurementType = "WEIGHT"; ctnEntity.StuffingMeasurementUnit = "KGS"; @@ -1589,14 +1592,14 @@ namespace DS.WMS.Core.Op.Method ctn.Deleted = true; ctn.DeleteTime = nowDate; ctn.DeleteBy = long.Parse(user.UserId); - //ctn.UpdatedUserName = UserManager.Name; + ctn.UpdateUserName = user.UserName; await tenantDb.Updateable(ctn).UpdateColumns(x => new { x.Deleted, x.DeleteTime, x.DeleteBy, - //x.UpdatedUserName + x.UpdateUserName }).ExecuteCommandAsync(); }); } @@ -1616,7 +1619,7 @@ namespace DS.WMS.Core.Op.Method CreateTime = nowDate, UpdateTime = nowDate, CreateBy = long.Parse(user.UserId), - //CreatedUserName = UserManager.Name + UpdateUserName = user.UserName }; await tenantDb.Insertable(shipScheduleRecord).ExecuteCommandAsync(); @@ -1632,7 +1635,7 @@ namespace DS.WMS.Core.Op.Method entity.CreateTime = nowDate; entity.UpdateTime = nowDate; entity.CreateBy = long.Parse(user.UserId); - //entity.CreatedUserName = UserManager.Name; + entity.CreateUserName = user.UserName; entity.Status = "TEMP"; entity.StatusName = "暂存"; entity.CtnStat = ctnStat; @@ -1657,7 +1660,7 @@ namespace DS.WMS.Core.Op.Method ctnEntity.CreateTime = nowDate; ctnEntity.UpdateTime = nowDate; ctnEntity.CreateBy = long.Parse(user.UserId); - //ctnEntity.CreatedUserName = UserManager.Name; + ctnEntity.CreateUserName = user.UserName; ctnEntity.StuffingMeasurementType = "WEIGHT"; ctnEntity.StuffingMeasurementUnit = "KGS"; @@ -1679,7 +1682,7 @@ namespace DS.WMS.Core.Op.Method CreateTime = nowDate, UpdateTime = nowDate, CreateBy = long.Parse(user.UserId), - //CreatedUserName = UserManager.Name + CreateUserName = user.UserName }; await tenantDb.Insertable(shipScheduleRecord).ExecuteCommandAsync(); @@ -1690,19 +1693,19 @@ namespace DS.WMS.Core.Op.Method //只有船期发生变化时才重新写入新的船期记录 if (model.PId != shipScheduleRecord.ShipRatePid.Value) { - //_logger.LogInformation($"MSK CON id={model.id} 换了船期 原记录:{selectedShipSchedule.PId} 新记录:{model.PId} 作废原船期,插入新船期"); + Logger.Log(NLog.LogLevel.Info, $"MSK CON id={model.id} 换了船期 原记录:{selectedShipSchedule.PId} 新记录:{model.PId} 作废原船期,插入新船期"); shipScheduleRecord.Deleted = true; shipScheduleRecord.DeleteTime = nowDate; shipScheduleRecord.DeleteBy = long.Parse(user.UserId); - //shipScheduleRecord.UpdatedUserName = UserManager.Name; + shipScheduleRecord.UpdateUserName = user.UserName; await tenantDb.Updateable(shipScheduleRecord).UpdateColumns(x => new { x.Deleted, x.DeleteTime, x.DeleteBy, - //x.UpdatedTime + x.UpdateTime }).ExecuteCommandAsync(); shipScheduleRecord = new SpaceBookingOrderShipSchedule @@ -1715,14 +1718,14 @@ namespace DS.WMS.Core.Op.Method CreateTime = nowDate, UpdateTime = nowDate, CreateBy = long.Parse(user.UserId), - //CreatedUserName = UserManager.Name + CreateUserName = user.UserName }; await tenantDb.Insertable(shipScheduleRecord).ExecuteCommandAsync(); } else { - //_logger.LogInformation($"MSK CON id={model.id} 船期没变化 model.PId={model.PId} shipScheduleRecord.SHIP_RATE_PID={shipScheduleRecord.SHIP_RATE_PID.Value}"); + Logger.Log(NLog.LogLevel.Info, $"MSK CON id={model.id} 船期没变化 model.PId={model.PId} shipScheduleRecord.SHIP_RATE_PID={shipScheduleRecord.ShipRatePid.Value}"); } } @@ -1749,7 +1752,7 @@ namespace DS.WMS.Core.Op.Method info.Deleted = true; info.DeleteTime = DateTime.Now; info.DeleteBy = long.Parse(user.UserId); - //info.UpdatedUserName = UserManager.Name; + info.DeleteUserName = user.UserName; await tenantDb.Updateable(info).UpdateColumns(x => new { diff --git a/ds-wms-service/DS.WMS.OpApi/DS.WMS.OpApi.csproj.user b/ds-wms-service/DS.WMS.OpApi/DS.WMS.OpApi.csproj.user index 99e0fcb6..da141c5a 100644 --- a/ds-wms-service/DS.WMS.OpApi/DS.WMS.OpApi.csproj.user +++ b/ds-wms-service/DS.WMS.OpApi/DS.WMS.OpApi.csproj.user @@ -1,7 +1,7 @@  - D:\Code\DS\ds8-solution-pro\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml + E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml MvcControllerEmptyScaffolder root/Common/MVC/Controller diff --git a/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user b/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user index 47a47f25..e2a27942 100644 --- a/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -6,7 +6,7 @@ <_PublishTargetUrl>D:\Code\PublishCopy\ds8-opapi - True|2024-07-19T07:33:45.3242155Z||;False|2024-07-19T15:32:41.9604526+08:00||;True|2024-07-19T13:48:27.9722093+08:00||;False|2024-07-19T13:47:56.7900396+08:00||;True|2024-07-19T11:41:15.4223247+08:00||;True|2024-07-19T08:46:28.8014836+08:00||;True|2024-07-18T19:24:50.4184188+08:00||;True|2024-07-18T19:19:14.7056635+08:00||;True|2024-07-18T19:04:43.5615501+08:00||;True|2024-07-18T18:38:39.1976753+08:00||;True|2024-07-18T18:25:15.6833492+08:00||;True|2024-07-18T18:08:46.3114951+08:00||;True|2024-07-18T17:59:12.5292256+08:00||;True|2024-07-18T16:18:45.8049777+08:00||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||; + True|2024-07-19T07:45:49.1068004Z||;True|2024-07-19T15:33:45.3242155+08:00||;False|2024-07-19T15:32:41.9604526+08:00||;True|2024-07-19T13:48:27.9722093+08:00||;False|2024-07-19T13:47:56.7900396+08:00||;True|2024-07-19T11:41:15.4223247+08:00||;True|2024-07-19T08:46:28.8014836+08:00||;True|2024-07-18T19:24:50.4184188+08:00||;True|2024-07-18T19:19:14.7056635+08:00||;True|2024-07-18T19:04:43.5615501+08:00||;True|2024-07-18T18:38:39.1976753+08:00||;True|2024-07-18T18:25:15.6833492+08:00||;True|2024-07-18T18:08:46.3114951+08:00||;True|2024-07-18T17:59:12.5292256+08:00||;True|2024-07-18T16:18:45.8049777+08:00||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||; \ No newline at end of file