From dfbc55d8b42f8d48f01d6efd209caeef45908d52 Mon Sep 17 00:00:00 2001 From: cjy Date: Wed, 6 Nov 2024 11:17:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=9B=B4=E6=96=B0=E6=B5=B7?= =?UTF-8?q?=E8=BF=90=E5=87=BA=E5=8F=A3=E6=9C=8D=E5=8A=A1=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ServiceProjectRes.cs | 68 +++++++++++++++++++ .../Op/Interface/ISeaExportService.cs | 6 ++ .../DS.WMS.Core/Op/Method/SeaExportService.cs | 35 ++++++++++ .../Controllers/SeaExportController.cs | 12 +++- ds-wms-service/DS.WMS.Test/Startup.cs | 3 +- 5 files changed, 122 insertions(+), 2 deletions(-) create mode 100644 ds-wms-service/DS.Module.DjyServiceStatus/ServiceProjectRes.cs diff --git a/ds-wms-service/DS.Module.DjyServiceStatus/ServiceProjectRes.cs b/ds-wms-service/DS.Module.DjyServiceStatus/ServiceProjectRes.cs new file mode 100644 index 00000000..15c984be --- /dev/null +++ b/ds-wms-service/DS.Module.DjyServiceStatus/ServiceProjectRes.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static System.Net.Mime.MediaTypeNames; + +namespace DS.Module.DjyServiceStatus +{ + /// + /// 服务项目返回 + /// + public class ServiceProjectRes + { + /// + /// + /// + public string ProjectPKId { get; set; } + /// + /// + /// + public string ProjectCode { get; set; } + /// + /// 订舱 + /// + public string ProjectName { get; set; } + /// + /// + /// + public int SortNo { get; set; } + /// + /// + /// + public bool IsYield { get; set; } + /// + /// + /// + public DateTime ActDate { get; set; } + /// + /// + /// + public int StatusNum { get; set; } + } + + public class ServiceProjectRoot + { + /// + /// + /// + public bool Succ { get; set; } + /// + /// + /// + public int Status { get; set; } + /// + /// + /// + public List Ext { get; set; } + /// + /// + /// + public bool IsTimeout { get; set; } + /// + /// + /// + public DateTime ExecuteTime { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportService.cs b/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportService.cs index 8ba1596a..ca7824ad 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportService.cs @@ -280,4 +280,10 @@ public interface ISeaExportService /// /// public Task CreateOrderAuditTaskAsync(IdModel req); + + /// + /// 更新服务项目 + /// + /// + public Task UpdateSeaExportServiceItem(); } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs index 95052b6c..bbea8402 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs @@ -102,6 +102,7 @@ public partial class SeaExportService : ISeaExportService //_bookingSlotService = _serviceProvider.GetRequiredService(); _seaTaskService = _serviceProvider.GetRequiredService(); + _taskManageBaseService = _serviceProvider.GetRequiredService>(); } @@ -1652,4 +1653,38 @@ public partial class SeaExportService : ISeaExportService return DataResult.Success; } } + + + /// + /// 更新服务项目 + /// + /// + public async Task UpdateSeaExportServiceItem() + { + + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var list = await tenantDb.Queryable().Where(x => x.ServiceItem == null || x.ServiceItem == "").ToListAsync();//.Where(x => x.IsRefund == false && x.IsChangeETD == false) + + foreach (var item in list) + { + var res = await _djyServiceStatusService.GetServiceProjectList(new EmbedQueryServiceProjectWithStatus() + { + BusinessId = item.Id.ToString(), + QueryType = 0, + }); + + var data = JsonConvert.DeserializeObject(res.data.ToString()); + var res1 = data.Ext; + if (res1 != null && res1.Count>0) { + + var codes = res1.Where(x=>x.IsYield == true).Select(x=> x.ProjectCode.ToLower()).ToList(); + var codeStr = String.Join(",", codes); + item.ServiceItem = codeStr; + await tenantDb.Updateable(item).UpdateColumns(x=>new { x.ServiceItem}).ExecuteCommandAsync(); + } + Console.WriteLine(res.data); + } + + return DataResult.Success; + } } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs index 41cdcb8c..18266968 100644 --- a/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs +++ b/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs @@ -593,5 +593,15 @@ public class SeaExportController : ApiController var res = await _invokeService.CreateOrderAuditTaskAsync(req); return res; } - + /// + /// 更新服务项目 + /// + /// + [HttpGet] + [Route("UpdateSeaExportServiceItem")] + public async Task UpdateSeaExportServiceItem() + { + var res = await _invokeService.UpdateSeaExportServiceItem(); + return res; + } } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Test/Startup.cs b/ds-wms-service/DS.WMS.Test/Startup.cs index 3905d24f..437f5f7a 100644 --- a/ds-wms-service/DS.WMS.Test/Startup.cs +++ b/ds-wms-service/DS.WMS.Test/Startup.cs @@ -56,7 +56,8 @@ public class Startup services.AddSqlSugarInstall(); services.AddSaasDbInstall(); services.AddPrintModuleInstall(); - + services.AddDjyModuleInstall(); //djy服务 + } ///