From 6053eb6e85da1fb0997b3269e154aa238f31fc9d Mon Sep 17 00:00:00 2001 From: douhandong Date: Wed, 6 Nov 2024 08:50:10 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=8A=A5=E9=94=80=E5=8D=95=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=AE=A1=E6=89=B9=E6=89=A7=E8=A1=8C=E4=BA=BA=E5=8F=98?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .../PublishProfiles/FolderProfile1.pubxml.user | 11 ----------- 2 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user diff --git a/.gitignore b/.gitignore index 93439c4d..a9a3b011 100644 --- a/.gitignore +++ b/.gitignore @@ -83,3 +83,4 @@ LinkAttach /ds-wms-service/DS.WMS.CheckApi/Logs/internal-nlog.txt /ds-wms-service/DS.WMS.FinanceApi/.config/dotnet-tools.json /ds-wms-service/DS.WMS.FinanceApi/Properties/PublishProfiles/FolderProfile.pubxml +/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user diff --git a/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user b/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user deleted file mode 100644 index 1f70f192..00000000 --- a/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user +++ /dev/null @@ -1,11 +0,0 @@ - - - - - <_PublishTargetUrl>D:\Publish\DS8\FeeApi - True|2024-11-04T09:39:07.1315345Z||;True|2024-11-04T17:32:28.9239052+08:00||;True|2024-11-04T15:49:58.6422421+08:00||;True|2024-11-04T15:39:25.1892907+08:00||;True|2024-11-04T15:21:49.7395112+08:00||;True|2024-11-04T11:26:53.4821041+08:00||;True|2024-11-04T11:19:48.8467193+08:00||;True|2024-11-04T11:01:39.9398452+08:00||;True|2024-11-04T10:30:55.0743204+08:00||;True|2024-11-02T21:17:44.8575190+08:00||;True|2024-11-02T20:54:29.9931812+08:00||;True|2024-11-02T20:39:20.4100370+08:00||;True|2024-11-02T18:33:41.0724285+08:00||;True|2024-11-02T18:21:55.8561639+08:00||;True|2024-11-02T17:36:24.3401782+08:00||;True|2024-11-02T16:38:03.0054105+08:00||;True|2024-11-02T16:26:26.1698304+08:00||;True|2024-11-02T16:15:20.2872358+08:00||;True|2024-11-02T15:19:14.9663838+08:00||;True|2024-11-02T14:39:47.8808708+08:00||;False|2024-11-02T14:22:04.2841792+08:00||;True|2024-11-02T11:50:48.2452805+08:00||;True|2024-10-29T18:52:12.7978878+08:00||;True|2024-10-29T10:27:49.1623527+08:00||;True|2024-10-25T15:09:27.7029075+08:00||;True|2024-10-25T10:29:26.9218878+08:00||;True|2024-10-22T17:58:39.9582805+08:00||;True|2024-10-21T17:57:21.7047579+08:00||;True|2024-10-21T14:30:54.4520206+08:00||;True|2024-10-21T10:19:05.7405749+08:00||;True|2024-10-18T16:11:05.4049685+08:00||;True|2024-10-18T14:59:49.1162741+08:00||;True|2024-10-16T16:29:15.3185348+08:00||;True|2024-10-16T14:12:58.1754214+08:00||;True|2024-10-16T14:08:06.5805581+08:00||;True|2024-10-16T11:55:29.8273176+08:00||;True|2024-10-15T17:39:40.4090324+08:00||;True|2024-10-15T17:06:43.0181578+08:00||;True|2024-10-15T15:07:38.9601925+08:00||;True|2024-10-12T13:33:32.4412583+08:00||;True|2024-10-11T17:00:54.0916209+08:00||;True|2024-10-11T10:54:50.3307087+08:00||;True|2024-10-11T10:45:07.8181500+08:00||;True|2024-10-11T10:40:44.2066046+08:00||;True|2024-10-11T10:21:25.7226983+08:00||;True|2024-10-11T10:09:05.5257478+08:00||;True|2024-10-10T14:58:29.1228618+08:00||;True|2024-10-10T14:05:59.4501659+08:00||;True|2024-10-10T11:08:58.9765455+08:00||;True|2024-10-08T17:59:07.5583287+08:00||;True|2024-09-27T19:01:59.6945760+08:00||;True|2024-09-27T18:45:48.2812860+08:00||;True|2024-09-27T18:10:25.5697467+08:00||;True|2024-09-27T17:39:06.3169139+08:00||;True|2024-09-27T17:30:14.1043193+08:00||;True|2024-09-27T16:02:09.0703159+08:00||;True|2024-09-27T15:53:05.1789245+08:00||;True|2024-09-27T15:32:52.1934490+08:00||;True|2024-09-27T13:51:24.9197626+08:00||;True|2024-09-27T13:48:17.2817346+08:00||;True|2024-09-27T11:51:46.8193040+08:00||;True|2024-09-27T10:58:33.1059648+08:00||;True|2024-09-27T10:37:35.0336563+08:00||;False|2024-09-27T10:31:52.6302264+08:00||;True|2024-09-26T19:50:15.5513195+08:00||;True|2024-09-26T19:47:14.0781788+08:00||;True|2024-09-26T19:01:26.5428388+08:00||;True|2024-09-26T18:35:28.7455319+08:00||;True|2024-09-26T18:24:30.8084807+08:00||;True|2024-09-26T18:20:47.3005460+08:00||;True|2024-09-26T18:04:39.8012913+08:00||;True|2024-09-26T17:48:13.8526872+08:00||;True|2024-09-26T16:08:20.1746970+08:00||;True|2024-09-26T16:01:01.1501975+08:00||;False|2024-09-26T16:00:34.1516745+08:00||;True|2024-09-26T14:33:03.4007570+08:00||;True|2024-09-25T19:14:27.8906774+08:00||;True|2024-09-25T18:57:40.1435131+08:00||;True|2024-09-25T17:38:44.0915841+08:00||;True|2024-09-25T15:33:58.4630618+08:00||;True|2024-09-25T15:10:31.3022063+08:00||;False|2024-09-25T14:14:40.9640545+08:00||;True|2024-09-25T10:09:32.2558600+08:00||;True|2024-09-25T09:59:17.1525160+08:00||;False|2024-09-25T09:57:58.7265103+08:00||;False|2024-09-25T09:53:36.7732713+08:00||;False|2024-09-24T18:40:10.0166224+08:00||;True|2024-09-24T08:59:56.1995425+08:00||;True|2024-09-23T18:07:54.7222163+08:00||;True|2024-09-23T17:23:57.7568406+08:00||;True|2024-09-23T16:28:49.3169826+08:00||;True|2024-09-23T15:57:31.8052490+08:00||;True|2024-09-23T11:47:21.1445419+08:00||;True|2024-09-23T09:24:36.0732229+08:00||;True|2024-09-21T11:59:19.0549926+08:00||;True|2024-09-21T11:24:32.4451752+08:00||;True|2024-09-21T10:39:11.5297411+08:00||;True|2024-09-20T18:24:31.7827684+08:00||;True|2024-09-19T17:55:53.1666689+08:00||;True|2024-09-19T17:42:47.9061485+08:00||; - - - \ No newline at end of file From 41ce92284bb9a1985912e7614bafefbb2fcb9bce Mon Sep 17 00:00:00 2001 From: douhandong Date: Wed, 6 Nov 2024 08:51:08 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E4=BA=BA=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.WMS.Core/Fee/Method/FeeReimbursementService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeReimbursementService.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeReimbursementService.cs index 164d5712..925866b8 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeReimbursementService.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeReimbursementService.cs @@ -485,7 +485,7 @@ namespace DS.WMS.Core.Fee.Method /// 为null时引发 public virtual async Task MarkerChangedAsync(MarkerChangedCallback callback) { - await MarkerChangedAsync(callback); + await taskService.MarkerChangedAsync(callback); //同步到钉钉 From f906dd05e3adbffc39b6e8063f12e8916aee7b44 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 6 Nov 2024 10:14:51 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E5=8D=95?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BLIssueManage/BLIssueManageService.cs | 109 ++++++++---------- 1 file changed, 48 insertions(+), 61 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs index a00582fc..b24b0e9e 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs @@ -663,13 +663,13 @@ namespace DS.WMS.Core.Op.Method { var checkIds = model.bookids.Where(a => a.MHBillType.Equals("H", StringComparison.OrdinalIgnoreCase)).Select(a => a.bookid).ToArray(); #region 主单处理 + + var orderList = tenantDb.Queryable().ClearFilter(typeof(IOrgId)) - .LeftJoin((l, r) => l.BusinessId == r.Id) - .Select((l,r) => new { m = r, h=l }) - .MergeTable() - .LeftJoin((l, r) => l.h.Id == r.BookingId) - .Where((l, r) => checkIds.Contains(l.h.Id) && l.h.Deleted == false) - .Select((l, r) => new { order = l, bl = r }) + .InnerJoin((l, r) => l.BusinessId == r.Id) + .LeftJoin((l, r, t) => l.Id == t.BookingId) + .Where((l, r, t) => checkIds.Contains(l.Id) && l.Deleted == false) + .Select((l, r, t) => new { order = r, sub = l,bl = t }) .ToList(); //if (orderList.Count != model.bookids.Length) @@ -685,7 +685,7 @@ namespace DS.WMS.Core.Op.Method if (blModel == null || blModel.Id == 0) { - var dto = GetReadSaveInfo(data.order.m, data.order.h); + var dto = GetReadSaveInfo(data.order, data.sub); var saveRlt = await Save(dto); @@ -940,14 +940,13 @@ namespace DS.WMS.Core.Op.Method if (model.bookids.Any(a => a.MHBillType.Equals("H", StringComparison.OrdinalIgnoreCase))) { var checkIds = model.bookids.Where(a => a.MHBillType.Equals("H", StringComparison.OrdinalIgnoreCase)).Select(a => a.bookid).ToArray(); + #region 主单处理 var orderList = tenantDb.Queryable().ClearFilter(typeof(IOrgId)) - .LeftJoin((l, r) => l.BusinessId == r.Id) - .Select((l, r) => new { m = r, h = l }) - .MergeTable() - .LeftJoin((l, r) => l.h.Id == r.BookingId) - .Where((l, r) => checkIds.Contains(l.h.Id) && l.h.Deleted == false) - .Select((l, r) => new { order = l, bl = r }) + .InnerJoin((l, r) => l.BusinessId == r.Id) + .LeftJoin((l, r, t) => l.Id == t.BookingId) + .Where((l, r, t) => checkIds.Contains(l.Id) && l.Deleted == false) + .Select((l, r, t) => new { order = r, sub = l, bl = t }) .ToList(); foreach (var data in orderList) @@ -956,7 +955,7 @@ namespace DS.WMS.Core.Op.Method if (blModel == null || blModel.Id == 0) { - var dto = GetReadSaveInfo(data.order.m, data.order.h); + var dto = GetReadSaveInfo(data.order, data.sub); var saveRlt = await Save(dto); @@ -1174,12 +1173,10 @@ namespace DS.WMS.Core.Op.Method var checkIds = model.bookids.Where(a => a.MHBillType.Equals("H", StringComparison.OrdinalIgnoreCase)).Select(a => a.bookid).ToArray(); #region 主单处理 var orderList = tenantDb.Queryable().ClearFilter(typeof(IOrgId)) - .LeftJoin((l, r) => l.BusinessId == r.Id) - .Select((l, r) => new { m = r, h = l }) - .MergeTable() - .LeftJoin((l, r) => l.h.Id == r.BookingId) - .Where((l, r) => checkIds.Contains(l.h.Id) && l.h.Deleted == false) - .Select((l, r) => new { order = l, bl = r }) + .InnerJoin((l, r) => l.BusinessId == r.Id) + .LeftJoin((l, r, t) => l.Id == t.BookingId) + .Where((l, r, t) => checkIds.Contains(l.Id) && l.Deleted == false) + .Select((l, r, t) => new { order = r, sub = l, bl = t }) .ToList(); foreach (var data in orderList) @@ -1188,7 +1185,7 @@ namespace DS.WMS.Core.Op.Method if (blModel == null || blModel.Id == 0) { - var dto = GetReadSaveInfo(data.order.m, data.order.h); + var dto = GetReadSaveInfo(data.order, data.sub); var saveRlt = await Save(dto); @@ -1397,15 +1394,13 @@ namespace DS.WMS.Core.Op.Method if (model.bookids.Any(a => a.MHBillType.Equals("H", StringComparison.OrdinalIgnoreCase))) { var checkIds = model.bookids.Where(a => a.MHBillType.Equals("H", StringComparison.OrdinalIgnoreCase)).Select(a => a.bookid).ToArray(); - + #region 主单处理 var orderList = tenantDb.Queryable().ClearFilter(typeof(IOrgId)) - .LeftJoin((l, r) => l.BusinessId == r.Id) - .Select((l, r) => new { m = r, h = l }) - .MergeTable() - .LeftJoin((l, r) => l.h.Id == r.BookingId) - .Where((l, r) => checkIds.Contains(l.h.Id) && l.h.Deleted == false) - .Select((l, r) => new { order = l, bl = r }) + .InnerJoin((l, r) => l.BusinessId == r.Id) + .LeftJoin((l, r, t) => l.Id == t.BookingId) + .Where((l, r, t) => checkIds.Contains(l.Id) && l.Deleted == false) + .Select((l, r, t) => new { order = r, sub = l, bl = t }) .ToList(); foreach (var data in orderList) @@ -1414,7 +1409,7 @@ namespace DS.WMS.Core.Op.Method if (blModel == null || blModel.Id == 0) { - var dto = GetReadSaveInfo(data.order.m, data.order.h); + var dto = GetReadSaveInfo(data.order, data.sub); var saveRlt = await Save(dto); @@ -1631,12 +1626,10 @@ namespace DS.WMS.Core.Op.Method #region 主单处理 var orderList = tenantDb.Queryable().ClearFilter(typeof(IOrgId)) - .LeftJoin((l, r) => l.BusinessId == r.Id) - .Select((l, r) => new { m = r, h = l }) - .MergeTable() - .LeftJoin((l, r) => l.h.Id == r.BookingId) - .Where((l, r) => checkIds.Contains(l.h.Id) && l.h.Deleted == false) - .Select((l, r) => new { order = l, bl = r }) + .InnerJoin((l, r) => l.BusinessId == r.Id) + .LeftJoin((l, r, t) => l.Id == t.BookingId) + .Where((l, r, t) => checkIds.Contains(l.Id) && l.Deleted == false) + .Select((l, r, t) => new { order = r, sub = l, bl = t }) .ToList(); foreach (var data in orderList) @@ -1645,7 +1638,7 @@ namespace DS.WMS.Core.Op.Method if (blModel == null || blModel.Id == 0) { - var dto = GetReadSaveInfo(data.order.m, data.order.h); + var dto = GetReadSaveInfo(data.order, data.sub); var saveRlt = await Save(dto); @@ -1653,7 +1646,7 @@ namespace DS.WMS.Core.Op.Method blModel = saveRlt.Data; } - if (blModel.IsCheckIn) + if (blModel.IsCheckIn || !blModel.IsChangeEndorse) { blModel.Status = BLIssueStatusEnum.ChangeEndorse.ToString(); blModel.StatusName = BLIssueStatusEnum.ChangeEndorse.GetDescription(); @@ -1893,12 +1886,10 @@ namespace DS.WMS.Core.Op.Method #region 主单处理 var orderList = tenantDb.Queryable().ClearFilter(typeof(IOrgId)) - .LeftJoin((l, r) => l.BusinessId == r.Id) - .Select((l, r) => new { m = r, h = l }) - .MergeTable() - .LeftJoin((l, r) => l.h.Id == r.BookingId) - .Where((l, r) => checkIds.Contains(l.h.Id) && l.h.Deleted == false) - .Select((l, r) => new { order = l, bl = r }) + .InnerJoin((l, r) => l.BusinessId == r.Id) + .LeftJoin((l, r, t) => l.Id == t.BookingId) + .Where((l, r, t) => checkIds.Contains(l.Id) && l.Deleted == false) + .Select((l, r, t) => new { order = r, sub = l, bl = t }) .ToList(); foreach (var data in orderList) @@ -1907,7 +1898,7 @@ namespace DS.WMS.Core.Op.Method if (blModel == null || blModel.Id == 0) { - var dto = GetReadSaveInfo(data.order.m, data.order.h); + var dto = GetReadSaveInfo(data.order, data.sub); var saveRlt = await Save(dto); @@ -1919,7 +1910,7 @@ namespace DS.WMS.Core.Op.Method { blModel.Status = BLIssueStatusEnum.RejectReleaeNotice.ToString(); blModel.StatusName = BLIssueStatusEnum.RejectReleaeNotice.GetDescription(); - blModel.IsChangeEndorse = true; + //blModel.Isrej = true; await tenantDb.Updateable(blModel) .UpdateColumns(x => new @@ -2042,12 +2033,10 @@ namespace DS.WMS.Core.Op.Method #region 主单处理 var orderList = tenantDb.Queryable().ClearFilter(typeof(IOrgId)) - .LeftJoin((l, r) => l.BusinessId == r.Id) - .Select((l, r) => new { m = r, h = l }) - .MergeTable() - .LeftJoin((l, r) => l.h.Id == r.BookingId) - .Where((l, r) => checkIds.Contains(l.h.Id) && l.h.Deleted == false) - .Select((l, r) => new { order = l, bl = r }) + .InnerJoin((l, r) => l.BusinessId == r.Id) + .LeftJoin((l, r, t) => l.Id == t.BookingId) + .Where((l, r, t) => checkIds.Contains(l.Id) && l.Deleted == false) + .Select((l, r, t) => new { order = r, sub = l, bl = t }) .ToList(); foreach (var data in orderList) @@ -2056,7 +2045,7 @@ namespace DS.WMS.Core.Op.Method if (blModel == null || blModel.Id == 0) { - var dto = GetReadSaveInfo(data.order.m, data.order.h); + var dto = GetReadSaveInfo(data.order, data.sub); var saveRlt = await Save(dto); @@ -2080,8 +2069,8 @@ namespace DS.WMS.Core.Op.Method var log = new BLIssueManageLog { Pid = blModel.Id, - ActionCode = BLIssueActionEnum.RejectReleaeNotice.ToString(), - ActionName = BLIssueActionEnum.RejectReleaeNotice.GetDescription(), + ActionCode = BLIssueActionEnum.BLModify.ToString(), + ActionName = BLIssueActionEnum.BLModify.GetDescription(), Note = model.Notes, Result = "成功", CreateBy = long.Parse(user.UserId), @@ -2187,12 +2176,10 @@ namespace DS.WMS.Core.Op.Method #region 主单处理 var orderList = tenantDb.Queryable().ClearFilter(typeof(IOrgId)) - .LeftJoin((l, r) => l.BusinessId == r.Id) - .Select((l, r) => new { m = r, h = l }) - .MergeTable() - .LeftJoin((l, r) => l.h.Id == r.BookingId) - .Where((l, r) => checkIds.Contains(l.h.Id) && l.h.Deleted == false) - .Select((l, r) => new { order = l, bl = r }) + .InnerJoin((l, r) => l.BusinessId == r.Id) + .LeftJoin((l, r, t) => l.Id == t.BookingId) + .Where((l, r, t) => checkIds.Contains(l.Id) && l.Deleted == false) + .Select((l, r, t) => new { order = r, sub = l, bl = t }) .ToList(); foreach (var data in orderList) @@ -2201,7 +2188,7 @@ namespace DS.WMS.Core.Op.Method if (blModel == null || blModel.Id == 0) { - var dto = GetReadSaveInfo(data.order.m, data.order.h); + var dto = GetReadSaveInfo(data.order, data.sub); var saveRlt = await Save(dto); From bc01f3f02d29a230ac4c40b6e010a19b09c6b131 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 6 Nov 2024 10:36:15 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B4=B9=E7=94=A8?= =?UTF-8?q?=E8=B4=A6=E5=8D=95=E6=8E=A5=E6=94=B6=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.WMS.FeeBillRecvService.csproj | 10 ++++++++++ ds-wms-service/DS.WMS.FeeBillRecvService/Program.cs | 2 ++ ds-wms-service/ds-wms-service.sln | 9 ++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 ds-wms-service/DS.WMS.FeeBillRecvService/DS.WMS.FeeBillRecvService.csproj create mode 100644 ds-wms-service/DS.WMS.FeeBillRecvService/Program.cs diff --git a/ds-wms-service/DS.WMS.FeeBillRecvService/DS.WMS.FeeBillRecvService.csproj b/ds-wms-service/DS.WMS.FeeBillRecvService/DS.WMS.FeeBillRecvService.csproj new file mode 100644 index 00000000..2150e379 --- /dev/null +++ b/ds-wms-service/DS.WMS.FeeBillRecvService/DS.WMS.FeeBillRecvService.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/ds-wms-service/DS.WMS.FeeBillRecvService/Program.cs b/ds-wms-service/DS.WMS.FeeBillRecvService/Program.cs new file mode 100644 index 00000000..3751555c --- /dev/null +++ b/ds-wms-service/DS.WMS.FeeBillRecvService/Program.cs @@ -0,0 +1,2 @@ +// See https://aka.ms/new-console-template for more information +Console.WriteLine("Hello, World!"); diff --git a/ds-wms-service/ds-wms-service.sln b/ds-wms-service/ds-wms-service.sln index f15560dc..856bf38b 100644 --- a/ds-wms-service/ds-wms-service.sln +++ b/ds-wms-service/ds-wms-service.sln @@ -78,7 +78,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.WMS.JobService", "DS.WMS EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.Module.MQ", "DS.Module.MQ\DS.Module.MQ.csproj", "{9A0BAA77-B0C3-44F8-A97E-E041ED159FFA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.Module.Quartz", "DS.Module.Quartz\DS.Module.Quartz.csproj", "{A2D8FB23-569C-46F9-9B1F-902BA87D0481}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.Module.Quartz", "DS.Module.Quartz\DS.Module.Quartz.csproj", "{A2D8FB23-569C-46F9-9B1F-902BA87D0481}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.WMS.FeeBillRecvService", "DS.WMS.FeeBillRecvService\DS.WMS.FeeBillRecvService.csproj", "{A56184E2-1480-49EC-BB62-BDE95B4C262A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -222,6 +224,10 @@ Global {A2D8FB23-569C-46F9-9B1F-902BA87D0481}.Debug|Any CPU.Build.0 = Debug|Any CPU {A2D8FB23-569C-46F9-9B1F-902BA87D0481}.Release|Any CPU.ActiveCfg = Release|Any CPU {A2D8FB23-569C-46F9-9B1F-902BA87D0481}.Release|Any CPU.Build.0 = Release|Any CPU + {A56184E2-1480-49EC-BB62-BDE95B4C262A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A56184E2-1480-49EC-BB62-BDE95B4C262A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A56184E2-1480-49EC-BB62-BDE95B4C262A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A56184E2-1480-49EC-BB62-BDE95B4C262A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -261,6 +267,7 @@ Global {99B79A25-3732-4023-BD56-ABD169CE43AD} = {65D75DB2-12D5-4D1F-893D-9750905CE5E4} {9A0BAA77-B0C3-44F8-A97E-E041ED159FFA} = {518DB9B5-80A8-4B2C-8570-52BD406458DE} {A2D8FB23-569C-46F9-9B1F-902BA87D0481} = {518DB9B5-80A8-4B2C-8570-52BD406458DE} + {A56184E2-1480-49EC-BB62-BDE95B4C262A} = {65D75DB2-12D5-4D1F-893D-9750905CE5E4} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {66115F23-94B4-43C0-838E-33B5CF77F788} From e14d16c65448ad023e1cdf368f2df1d18d9a6415 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 6 Nov 2024 10:38:26 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E5=8D=95?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Op/Method/BLIssueManage/BLIssueManageService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs index b24b0e9e..eb9f806f 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs @@ -2340,7 +2340,6 @@ namespace DS.WMS.Core.Op.Method { var model = new BLIssueManageBaseInputDto { - BookingId = order.Id, BLNo = order.MBLNO, CustomerId = order.CustomerId, CustomerName = order.CustomerName, @@ -2362,6 +2361,7 @@ namespace DS.WMS.Core.Op.Method if (hOrder != null && hOrder.Id > 0) { + model.BookingId = hOrder.Id; model.IssueType = hOrder.IssueType; //model.IssueTypeCode = hOrder.IssueTypeCode; //model.IssuePlaceCode = hOrder.IssuePlaceCode; @@ -2375,6 +2375,7 @@ namespace DS.WMS.Core.Op.Method } else { + model.BookingId = order.Id; model.IssueType = order.IssueType; model.IssueTypeCode = order.IssueTypeCode; model.IssuePlaceCode = order.IssuePlaceCode; From 6eaa4fd51d6b9c5dc7d6f6e664ce7f7e5129d16a Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 6 Nov 2024 10:45:47 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E5=8D=95?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Op/Method/BLIssueManage/BLIssueManageService.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs index eb9f806f..53b61c43 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs @@ -2397,6 +2397,10 @@ namespace DS.WMS.Core.Op.Method model.AgreementDays = (Int16)Math.Ceiling(timeDiff / (24 * 60m)); } + model.UpdateBy = long.Parse(user.UserId); + model.UpdateUserName = user.UserName; + model.UpdateTime = DateTime.Now; + return model; } #endregion From c07d2a0e33a0ccfa03a1e8bbe7533f6df331f6f5 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 6 Nov 2024 11:14:57 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B4=A6=E5=8D=95?= =?UTF-8?q?=E6=8E=A5=E6=94=B6=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ArgumentExceptionHandler.cs | 28 ++++ .../DS.WMS.FeeBillRecvService.csproj | 13 ++ .../GlobalExceptionFilter .cs | 35 +++++ .../GlobalExceptionsFilter.cs | 129 ++++++++++++++++++ .../DS.WMS.FeeBillRecvService/Program.cs | 59 +++++++- 5 files changed, 262 insertions(+), 2 deletions(-) create mode 100644 ds-wms-service/DS.WMS.FeeBillRecvService/ArgumentExceptionHandler.cs create mode 100644 ds-wms-service/DS.WMS.FeeBillRecvService/GlobalExceptionFilter .cs create mode 100644 ds-wms-service/DS.WMS.FeeBillRecvService/GlobalExceptionsFilter.cs diff --git a/ds-wms-service/DS.WMS.FeeBillRecvService/ArgumentExceptionHandler.cs b/ds-wms-service/DS.WMS.FeeBillRecvService/ArgumentExceptionHandler.cs new file mode 100644 index 00000000..b04475e7 --- /dev/null +++ b/ds-wms-service/DS.WMS.FeeBillRecvService/ArgumentExceptionHandler.cs @@ -0,0 +1,28 @@ +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc; + +namespace DS.WMS.FeeBillRecvService +{ + //public sealed class ArgumentExceptionHandler : IExceptionHandler + //{ + // public async ValueTask TryHandleAsync(HttpContext httpContext, Exception exception, CancellationToken cancellationToken) + // { + // httpContext.RequestServices.GetRequiredService>() + // .LogError(exception, "Exception handled"); + // if (exception is not ArgumentException) return false; + + // httpContext.Response.StatusCode = 400; + // await httpContext.Response.WriteAsJsonAsync(new + // { + // exception.Message + // }, cancellationToken); + // return true; + // } + //} +} diff --git a/ds-wms-service/DS.WMS.FeeBillRecvService/DS.WMS.FeeBillRecvService.csproj b/ds-wms-service/DS.WMS.FeeBillRecvService/DS.WMS.FeeBillRecvService.csproj index 2150e379..befc2135 100644 --- a/ds-wms-service/DS.WMS.FeeBillRecvService/DS.WMS.FeeBillRecvService.csproj +++ b/ds-wms-service/DS.WMS.FeeBillRecvService/DS.WMS.FeeBillRecvService.csproj @@ -7,4 +7,17 @@ enable + + + + + + + + + + + + + diff --git a/ds-wms-service/DS.WMS.FeeBillRecvService/GlobalExceptionFilter .cs b/ds-wms-service/DS.WMS.FeeBillRecvService/GlobalExceptionFilter .cs new file mode 100644 index 00000000..c9b0bd75 --- /dev/null +++ b/ds-wms-service/DS.WMS.FeeBillRecvService/GlobalExceptionFilter .cs @@ -0,0 +1,35 @@ +using Hangfire.Server; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.FeeBillRecvService +{ + public class GlobalExceptionFilter : IServerFilter + { + public void OnPerforming(PerformingContext context) + { + // 不需要在这里做任何事情 + } + + public void OnPerformed(PerformedContext context) + { + + Console.WriteLine(context.BackgroundJob); + // 当job执行完毕后,检查是否有异常 + //if (context.BackgroundJob.State == JobState.Failed) + //{ + // // 获取异常信息 + // var exception = context.Exception; + // if (exception != null) + // { + // // 处理异常,例如发送邮件、记录日志等 + // // 这里可以使用依赖注入来处理异常,如记录日志到Logging Service + // Console.WriteLine($"Job failed with exception: {exception.Message}"); + // } + //} + } + } +} diff --git a/ds-wms-service/DS.WMS.FeeBillRecvService/GlobalExceptionsFilter.cs b/ds-wms-service/DS.WMS.FeeBillRecvService/GlobalExceptionsFilter.cs new file mode 100644 index 00000000..8dc8670b --- /dev/null +++ b/ds-wms-service/DS.WMS.FeeBillRecvService/GlobalExceptionsFilter.cs @@ -0,0 +1,129 @@ +using DS.Module.Core.Log; +using DS.Module.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; + +namespace DS.WMS.FeeBillRecvService +{ + /// + /// 全局异常错误日志 + /// + public class GlobalExceptionsFilter : IExceptionFilter + { + private readonly IHostingEnvironment _env; + private readonly IServiceProvider _serviceProvider; + public GlobalExceptionsFilter(IHostingEnvironment env, IServiceProvider serviceProvider) + { + _env = env; + _serviceProvider = serviceProvider; + } + + public void OnException(ExceptionContext context) + { + var json = new JsonErrorResponse(); + + json.Message = context.Exception.Message; //错误信息 + if (_env.IsDevelopment()) + { + json.DevelopmentMessage = context.Exception.StackTrace; //堆栈信息 + } + + var result = DataResult.Failed(json.Message); + + var objectResult = new BadRequestObjectResult(result); + objectResult.StatusCode = (int?)StatusCodes.Status200OK; + context.Result = objectResult; + // context.Result = new InternalServerErrorObjectResult(json); + + //MiniProfiler.Current.CustomTiming("Errors:", json.Message); + //记录异常到日志 + StringBuilder exMsg = new(); + exMsg.AppendLine($"【异常方法:】{context.HttpContext.Request.Path}"); + exMsg.AppendLine($"【请求类型:】{context.HttpContext.Request.Method}"); + exMsg.AppendLine($"【异常错误:】{context.Exception.Message}"); + exMsg.AppendLine($"【堆栈跟踪:】{context.Exception.StackTrace}"); + + + #region 写入日志库 + + var className = context.Exception.TargetSite.DeclaringType?.FullName; + var groupCollection = Regex.Match(className, "<(.*?)>").Groups; + var methodName = ""; + if (groupCollection.Count > 1) + { + methodName = groupCollection[1].Value; + } + var exLog = new SysLogException() + { + ClassName = className, + MethodName = methodName, + ExceptionName = context.Exception.Message, + ExceptionMsg = context.Exception.Message, + ExceptionSource = context.Exception.Source, + StackTrace = context.Exception.StackTrace, + ParamsObj = context.Exception.TargetSite.GetParameters().ToString(), + }; + + + #endregion + + + // Logger.Log(NLog.LogLevel.Info, "异常信息:" + JsonConvert.SerializeObject(context.Exception)); + //采用log4net 进行错误日志记录 + //_loggerHelper.Error(json.Message, WriteLog(json.Message, context.Exception)); + + //_hubContext.Clients.All.SendAsync("ReceiveUpdate", LogLock.GetLogData()).Wait(); + } + + /// + /// 自定义返回格式 + /// + /// + /// + /// + public string WriteLog(string throwMsg, Exception ex) + { + return string.Format("【自定义错误】:{0} \r\n【异常类型】:{1} \r\n【异常信息】:{2} \r\n【堆栈调用】:{3}", new object[] + { + throwMsg, + ex.GetType().Name, ex.Message, ex.StackTrace + }); + } + } + + /// + /// + /// + public class InternalServerErrorObjectResult : ObjectResult + { + public InternalServerErrorObjectResult(object value) : base(value) + { + StatusCode = StatusCodes.Status500InternalServerError; + } + } + + /// + /// 返回错误信息 + /// + public class JsonErrorResponse + { + /// + /// 生产环境的消息 + /// + public string Message { get; set; } + + /// + /// 开发环境的消息 + /// + public string DevelopmentMessage { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.FeeBillRecvService/Program.cs b/ds-wms-service/DS.WMS.FeeBillRecvService/Program.cs index 3751555c..aad6e58a 100644 --- a/ds-wms-service/DS.WMS.FeeBillRecvService/Program.cs +++ b/ds-wms-service/DS.WMS.FeeBillRecvService/Program.cs @@ -1,2 +1,57 @@ -// See https://aka.ms/new-console-template for more information -Console.WriteLine("Hello, World!"); +using Autofac.Extensions.DependencyInjection; +using Autofac; +using DS.Module.AutofacModule; +using DS.Module.SqlSugar; +using DS.Module.UserModule; +using DS.Module.RedisModule; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using NLog.Web; +using DS.WMS.FeeBillRecvService; + + +var builder = Host.CreateApplicationBuilder(args); + +builder.Services.AddWindowsService(options => +{ + options.ServiceName = ".NET Work Service"; +}); +//注册配置 +builder.Configuration + .AddJsonFile(path: "appsettings.json", optional: false, reloadOnChange: true) + .Build(); +builder.Configuration.AddEnvironmentVariables(); + +builder.Logging.AddNLog("nlog.config"); +//Autofac注入 +builder.ConfigureContainer(new AutofacServiceProviderFactory(), builder => builder.RegisterModule(new AutofacModuleRegister())); + +//builder.Services.AddTransient(); +//builder.Services.AddExceptionHandler(); //全局异常 +builder.Services.AddControllers(options => +{ + options.Filters.Add(); +}); +builder.Services.AddUserModuleInstall(); //用户服务 +builder.Services.AddRedisModuleInstall();//redis +builder.Services.AddSqlSugarInstall(); +builder.Services.AddSaasDbInstall();//分库服务 + +//应用作为 Windows 服务 +//builder.Services.AddWindowsService(); +//builder.Services.AddHostedService(); + +//允许 BackgroundService 中存在未经处理的异常,不停止主机 +builder.Services.Configure(hostOptions => +{ + hostOptions.BackgroundServiceExceptionBehavior = BackgroundServiceExceptionBehavior.Ignore; + hostOptions.ServicesStartConcurrently = true; + hostOptions.ServicesStopConcurrently = true; +}); + + +var host = builder.Build(); + +host.Run();