From 58409d5e3da3c82ca2d52c89e8e80fc0d7746290 Mon Sep 17 00:00:00 2001 From: cjy Date: Thu, 8 Aug 2024 11:35:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Code/Dtos/CodeServiceSelectRes.cs | 8 +++- .../DS.WMS.MainApi/DS.WMS.MainApi.csproj.user | 2 +- .../Service/OpenPrintService.cs | 43 +++++++++++++++---- 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeServiceSelectRes.cs b/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeServiceSelectRes.cs index eb3bf472..e2fbeed5 100644 --- a/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeServiceSelectRes.cs +++ b/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeServiceSelectRes.cs @@ -1,4 +1,5 @@ using DS.Module.Core; +using SqlSugar; namespace DS.WMS.Core.Code.Dtos; @@ -19,8 +20,11 @@ public class CodeServiceSelectRes /// 中文名称 /// public string CnName { get; set; } - - + + /// + /// EDI代码 + /// + public string EdiCode { get; set; } /// /// 备注 /// diff --git a/ds-wms-service/DS.WMS.MainApi/DS.WMS.MainApi.csproj.user b/ds-wms-service/DS.WMS.MainApi/DS.WMS.MainApi.csproj.user index 73975b0c..996c16b7 100644 --- a/ds-wms-service/DS.WMS.MainApi/DS.WMS.MainApi.csproj.user +++ b/ds-wms-service/DS.WMS.MainApi/DS.WMS.MainApi.csproj.user @@ -1,6 +1,6 @@  - D:\Source\Repos\DS8\ds-wms-service\DS.WMS.MainApi\Properties\PublishProfiles\FolderProfile.pubxml + D:\Code\DS\ds8-solution-pro\ds-wms-service\DS.WMS.MainApi\Properties\PublishProfiles\FolderProfile.pubxml \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.PrintApi/Service/OpenPrintService.cs b/ds-wms-service/DS.WMS.PrintApi/Service/OpenPrintService.cs index 375dc725..0e0b930e 100644 --- a/ds-wms-service/DS.WMS.PrintApi/Service/OpenPrintService.cs +++ b/ds-wms-service/DS.WMS.PrintApi/Service/OpenPrintService.cs @@ -14,6 +14,7 @@ using System.Collections.Generic; using Newtonsoft.Json; using Microsoft.Extensions.DependencyInjection; using DS.WMS.PrintApi.Middleware; +using Newtonsoft.Json.Schema; namespace DS.WMS.PrintApi.Service { @@ -322,18 +323,42 @@ namespace DS.WMS.PrintApi.Service FastReport.Report report = new FastReport.Report(); report.Load(printFile); - report.Dictionary.Connections.Clear(); - - //var dataSource = report.Dictionary.Connections[0] as JsonDataSourceConnection; var str = new FastReport.Data.JsonConnection.JsonDataSourceConnectionStringBuilder(); str.Json = JsonConvert.SerializeObject(data); - //dataSource.ConnectionString = str.ConnectionString; - //重置数据源 - report.Dictionary.Connections.Add(new JsonDataSourceConnection() + if (report.Dictionary.Connections.Count == 0) { - ConnectionString = str.ConnectionString, - Alias = "JSON" - }); + //重置数据源 + report.Dictionary.Connections.Add(new JsonDataSourceConnection() + { + ConnectionString = str.ConnectionString, + Name = "Connection", + }); + } + else { + var dataSource = report.Dictionary.Connections[0] as JsonDataSourceConnection; + dataSource.ConnectionString = str.ConnectionString; + } + //var dataSource = report.Dictionary.Connections[0] as JsonDataSourceConnection; + //var str = new FastReport.Data.JsonConnection.JsonDataSourceConnectionStringBuilder(); + //str.Json = JsonConvert.SerializeObject(data); + //dataSource.ConnectionString = str.ConnectionString; + //JsonSchemaGenerator generator = new JsonSchemaGenerator(); + //JsonSchema jsonSchema = generator.Generate() + + //report.Dictionary.Connections.Clear(); + + //var dataSource = report.Dictionary.Connections[0] as JsonDataSourceConnection; + //var str = new FastReport.Data.JsonConnection.JsonDataSourceConnectionStringBuilder(); + //str.Json = JsonConvert.SerializeObject(data); + ////dataSource.ConnectionString = str.ConnectionString; + ////重置数据源 + //report.Dictionary.Connections.Add(new JsonDataSourceConnection() + //{ + // ConnectionString = str.ConnectionString, + // Alias = "JSON" + //}); + + //report.Dictionary.Connections[0].ConnectionString = str.ConnectionString; report.Prepare();