From 7870db98f3808cf2f7fb1eb80182606fad12c570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZR20090193-=E9=99=88=E6=95=AC=E5=8B=87?= Date: Tue, 23 Apr 2024 18:10:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=B7=E8=BF=90=E5=87=BA=E5=8F=A3=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E8=A1=A8=E5=8D=95=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Constants/MultiLanguageConst.cs | 3 +- .../DS.WMS.Core/Code/Dtos/FormCopyItem.cs | 28 ++++++++ .../DS.WMS.Core/Op/Dtos/SeaExportReq.cs | 8 +-- .../DS.WMS.Core/Op/Dtos/SeaExportRes.cs | 8 +-- .../DS.WMS.Core/Op/Entity/SeaExport.cs | 10 +-- .../DS.WMS.Core/Op/Method/SeaExportService.cs | 72 +++++++++++++++++++ .../DS.WMS.MainApi/Logs/internal-nlog.txt | 7 ++ 7 files changed, 122 insertions(+), 14 deletions(-) create mode 100644 ds-wms-service/DS.WMS.Core/Code/Dtos/FormCopyItem.cs diff --git a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs index 0543c337..8d27ee9c 100644 --- a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs @@ -302,7 +302,8 @@ public static class MultiLanguageConst #region 海关出口 [Description("海运出口信息已存在")] public const string SeaExportExist = "Sea_Export_Exist"; - + [Description("海运出口信息不存在")] + public const string SeaExportNotExist = "Sea_Export_Not_Exist"; [Description("海运出口信息业务已锁定")] public const string SeaExportBusinessLock = "Sea_Export_Business_Lock"; [Description("海运出口信息费用已锁定")] diff --git a/ds-wms-service/DS.WMS.Core/Code/Dtos/FormCopyItem.cs b/ds-wms-service/DS.WMS.Core/Code/Dtos/FormCopyItem.cs new file mode 100644 index 00000000..e4c3b5fe --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Code/Dtos/FormCopyItem.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.Code.Dtos +{ + /// + /// 表单复制选项 + /// + public class FormCopyItem + { + /// + /// 字段 + /// + public string Field { get; set; } + + /// + /// 是否复制 + /// + public bool IsCopy { get; set; } + /// + /// 是否显示 + /// + public bool Show { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportReq.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportReq.cs index 28b92c08..816ba3b7 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportReq.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportReq.cs @@ -568,10 +568,10 @@ public class SeaExportReq /// public string BookingType { get; set; } - /// - /// 订舱编号 - /// - public string BookingNo { get; set; } + ///// + ///// 订舱编号 + ///// + //public string BookingNo { get; set; } /// /// Desc:保险人 diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs index 60f50497..9580070d 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs @@ -566,10 +566,10 @@ public class SeaExportRes /// public string BookingType { get; set; } - /// - /// 订舱编号 - /// - public string BookingNo { get; set; } + ///// + ///// 订舱编号 + ///// + //public string BookingNo { get; set; } /// /// Desc:保险人 diff --git a/ds-wms-service/DS.WMS.Core/Op/Entity/SeaExport.cs b/ds-wms-service/DS.WMS.Core/Op/Entity/SeaExport.cs index 12a2662c..c5dff8f8 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Entity/SeaExport.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Entity/SeaExport.cs @@ -668,11 +668,11 @@ public class SeaExport : BaseOrgModel [SugarColumn(ColumnDescription = "订舱类型", IsNullable = true, Length = 50)] public string BookingType { get; set; } - /// - /// 订舱编号 - /// - [SugarColumn(ColumnDescription = "订舱编号", IsNullable = true, Length = 20)] - public string BookingNo { get; set; } + ///// + ///// 订舱编号 + ///// + //[SugarColumn(ColumnDescription = "订舱编号", IsNullable = true, Length = 20)] + //public string BookingNo { get; set; } /// /// Desc:保险人 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 63e0c83f..7b4bfd5d 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs @@ -2,6 +2,7 @@ using DS.Module.Core; using DS.Module.Core.Extensions; using DS.Module.SqlSugar; using DS.Module.UserModule; +using DS.WMS.Core.Code.Entity; using DS.WMS.Core.Op.Dtos; using DS.WMS.Core.Op.Entity; using DS.WMS.Core.Op.Interface; @@ -9,6 +10,7 @@ using DS.WMS.Core.System.Interface; using DS.WMS.Core.System.Method; using Mapster; using Microsoft.Extensions.DependencyInjection; +using Org.BouncyCastle.Ocsp; using SqlSugar; namespace DS.WMS.Core.Op.Method; @@ -141,4 +143,74 @@ public class SeaExportService : ISeaExportService return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess); } + + + /// + /// 业务单据复制 + /// + /// 业务Id + /// + public DataResult SeaExportCopy(string id) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var info = tenantDb.Queryable().Where(x => x.Id == long.Parse(id)).First(); + if (info.IsNullOrEmpty()) + { + return DataResult.Failed("海运出口信息不存在!", MultiLanguageConst.SeaExportNotExist); + } + //获取表单复制模板 + var template = tenantDb.Queryable().Where(x=>x.PermissionId == 1772509201441099776).First(); + + var entity = new SeaExport(); + if (template.IsNullOrEmpty()) { + + var sequence = commonService.GetSequenceNext(); + if (!sequence.Succeeded) + { + return DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist); + } + + entity = info.Adapt(entity); + entity.Id = 0; + entity.ParentId = 0; + entity.IsBusinessLocking = false; + entity.IsFeeLocking = false; + entity.CustomerNo = sequence.Data; + } + + info.IsFeeLocking = true; + + var partList = tenantDb.Queryable().Where(x => x.ParentId == long.Parse(id)).ToList(); + + + + return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess); + } + /// + /// 费用锁定 + /// + /// 业务Id + /// + public DataResult SeaExportFeeLook(string id) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var info = tenantDb.Queryable().Where(x => x.Id == long.Parse(id)).First(); + if (info.IsNullOrEmpty()) { + return DataResult.Failed("海运出口信息不存在!", MultiLanguageConst.SeaExportNotExist); + } + if ((bool)info.IsFeeLocking) { + return DataResult.Failed("海运出口信息费用已锁定!", MultiLanguageConst.SeaExportFeeLock); + } + + info.IsFeeLocking = true; + + var partList= tenantDb.Queryable().Where(x => x.ParentId == long.Parse(id)).ToList(); + + + + return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess); + } + + + } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.MainApi/Logs/internal-nlog.txt b/ds-wms-service/DS.WMS.MainApi/Logs/internal-nlog.txt index 8ef9e43d..b7f9b69e 100644 --- a/ds-wms-service/DS.WMS.MainApi/Logs/internal-nlog.txt +++ b/ds-wms-service/DS.WMS.MainApi/Logs/internal-nlog.txt @@ -1223,3 +1223,10 @@ 2024-04-22 15:35:58.1631 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config 2024-04-22 15:35:58.1631 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile 2024-04-22 15:35:58.1866 Info Configuration initialized. +2024-04-23 09:01:23.6191 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-04-23 09:01:23.6657 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-04-23 09:01:23.6657 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-04-23 09:01:23.7103 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-04-23 09:01:23.7292 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config +2024-04-23 09:01:23.7292 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-04-23 09:01:23.7573 Info Configuration initialized.