개정판 cbea3c14
issue #937: add FinalService_Config module and modified that manage working queue
Change-Id: Ifd23b414a78d9120c6329e513c262eb39f70f2d8
FinalService/KCOM_FinalService/ConsoleApp1/ConsoleApp1.csproj | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
3 |
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
|
4 |
<PropertyGroup> |
|
5 |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|
6 |
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|
7 |
<ProjectGuid>{2068A2DC-AEAD-4473-8C97-CA7370A12E64}</ProjectGuid> |
|
8 |
<OutputType>Exe</OutputType> |
|
9 |
<RootNamespace>ConsoleApp1</RootNamespace> |
|
10 |
<AssemblyName>ConsoleApp1</AssemblyName> |
|
11 |
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> |
|
12 |
<FileAlignment>512</FileAlignment> |
|
13 |
</PropertyGroup> |
|
14 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|
15 |
<PlatformTarget>AnyCPU</PlatformTarget> |
|
16 |
<DebugSymbols>true</DebugSymbols> |
|
17 |
<DebugType>full</DebugType> |
|
18 |
<Optimize>false</Optimize> |
|
19 |
<OutputPath>bin\Debug\</OutputPath> |
|
20 |
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|
21 |
<ErrorReport>prompt</ErrorReport> |
|
22 |
<WarningLevel>4</WarningLevel> |
|
23 |
</PropertyGroup> |
|
24 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|
25 |
<PlatformTarget>AnyCPU</PlatformTarget> |
|
26 |
<DebugType>pdbonly</DebugType> |
|
27 |
<Optimize>true</Optimize> |
|
28 |
<OutputPath>bin\Release\</OutputPath> |
|
29 |
<DefineConstants>TRACE</DefineConstants> |
|
30 |
<ErrorReport>prompt</ErrorReport> |
|
31 |
<WarningLevel>4</WarningLevel> |
|
32 |
</PropertyGroup> |
|
33 |
<ItemGroup> |
|
34 |
<Reference Include="System" /> |
|
35 |
<Reference Include="System.Core" /> |
|
36 |
<Reference Include="System.Data.Entity" /> |
|
37 |
<Reference Include="System.Xml.Linq" /> |
|
38 |
<Reference Include="System.Data.DataSetExtensions" /> |
|
39 |
<Reference Include="Microsoft.CSharp" /> |
|
40 |
<Reference Include="System.Data" /> |
|
41 |
<Reference Include="System.Xml" /> |
|
42 |
</ItemGroup> |
|
43 |
<ItemGroup> |
|
44 |
<Compile Include="Program.cs" /> |
|
45 |
<Compile Include="Properties\AssemblyInfo.cs" /> |
|
46 |
</ItemGroup> |
|
47 |
<ItemGroup> |
|
48 |
<ProjectReference Include="..\CommonLib\CommonLib.csproj"> |
|
49 |
<Project>{6bbe14d5-c998-47c8-bf75-c9647edad561}</Project> |
|
50 |
<Name>CommonLib</Name> |
|
51 |
</ProjectReference> |
|
52 |
<ProjectReference Include="..\IFinalPDF\IFinalPDF.csproj"> |
|
53 |
<Project>{784438be-2074-41ae-a692-24e1a4a67fe3}</Project> |
|
54 |
<Name>IFinalPDF</Name> |
|
55 |
</ProjectReference> |
|
56 |
<ProjectReference Include="..\KCOMDataModel\KCOMDataModel.csproj"> |
|
57 |
<Project>{629DC8CD-D458-47EF-8F02-CD12C7001C3E}</Project> |
|
58 |
<Name>KCOMDataModel</Name> |
|
59 |
</ProjectReference> |
|
60 |
<ProjectReference Include="..\MarkupToPDF\MarkupToPDF.csproj"> |
|
61 |
<Project>{a714bd67-8aac-4ed8-8ecf-7853c3549a68}</Project> |
|
62 |
<Name>MarkupToPDF</Name> |
|
63 |
</ProjectReference> |
|
64 |
</ItemGroup> |
|
65 |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
|
66 |
</Project> |
FinalService/KCOM_FinalService/ConsoleApp1/Program.cs | ||
---|---|---|
1 |
using IFinalPDF; |
|
2 |
using KCOMDataModel; |
|
3 |
using KCOMDataModel.Common; |
|
4 |
using KCOMDataModel.DataModel; |
|
5 |
using MarkupToPDF.Common; |
|
6 |
using System; |
|
7 |
using System.Collections.Generic; |
|
8 |
using System.IO; |
|
9 |
using System.Linq; |
|
10 |
using System.Text; |
|
11 |
|
|
12 |
namespace ConsoleApp1 |
|
13 |
{ |
|
14 |
static class Program |
|
15 |
{ |
|
16 |
static void Main(string[] args) |
|
17 |
{ |
|
18 |
string PdfFilePathRoot = ""; |
|
19 |
string _FinalPDFStorgeLocal = ""; |
|
20 |
string _FinalPDFStorgeRemote = ""; |
|
21 |
|
|
22 |
//using (KCOMEntities _entity = new KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString())) |
|
23 |
//{ |
|
24 |
// var _properties = _entity.PROPERTIES.Where(pro => pro.PROPERTY == "000000"); |
|
25 |
|
|
26 |
// if (_properties.Count() > 0) |
|
27 |
// { |
|
28 |
// PdfFilePathRoot = _properties.Where(t => t.TYPE == MarkupToPDF.PropertiesType.Const_TileSorcePath).First().VALUE; |
|
29 |
// _FinalPDFStorgeLocal = _properties.Where(t => t.TYPE == MarkupToPDF.PropertiesType.Const_FinalPDFStorgeLocal).First().VALUE; |
|
30 |
// _FinalPDFStorgeRemote = _properties.Where(t => t.TYPE == MarkupToPDF.PropertiesType.Const_FinalPDFStorgeRemote).First().VALUE; |
|
31 |
// } |
|
32 |
//} |
|
33 |
// using (CIEntities _entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString("000000").ToString())) |
|
34 |
//{ |
|
35 |
// var _DOCINFO = _entity.DOCINFO.Where(doc => doc.ID == "e16c382e-5c33-3883-d45b-47e4f4d4c23f"); |
|
36 |
|
|
37 |
// if (_DOCINFO.Count() > 0) |
|
38 |
// { |
|
39 |
// var DocInfoItem = _DOCINFO.FirstOrDefault(); |
|
40 |
|
|
41 |
// PdfFilePathRoot = PdfFilePathRoot + @"\" + "000000" + "_Tile" + @"\" |
|
42 |
// + (System.Convert.ToInt64("11111111") / 100).ToString() |
|
43 |
// + @"\" + "11111111" + @"\"; |
|
44 |
// } |
|
45 |
//} |
|
46 |
try |
|
47 |
{ |
|
48 |
Console.WriteLine("Test Process..."); |
|
49 |
Console.WriteLine("Insert Final PDF id :"); |
|
50 |
string inputstr = Console.ReadLine(); |
|
51 |
using (KCOMEntities _entity = new KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString())) |
|
52 |
{ |
|
53 |
//FINAL_PDF item = _entity.FINAL_PDF.Where(d => d.ID == "ngKwBgMotw8d56dea3839120d").FirstOrDefault(); |
|
54 |
FINAL_PDF item = _entity.FINAL_PDF.Where(d => d.ID == inputstr).FirstOrDefault(); |
|
55 |
if (item != null) |
|
56 |
{ |
|
57 |
Console.WriteLine("final pdf start"); |
|
58 |
MarkupToPDF.MarkupToPDF pdf = new MarkupToPDF.MarkupToPDF(); |
|
59 |
pdf.EndFinal += Pdf_EndFinal; |
|
60 |
pdf.FinalMakeError += Pdf_FinalMakeError; |
|
61 |
//pdf.MakeFinalPDF(_entity.FINAL_PDF.FirstOrDefault()); |
|
62 |
pdf.MakeFinalPDF(item); |
|
63 |
//_Thread.Add(item); |
|
64 |
} |
|
65 |
else |
|
66 |
{ |
|
67 |
Console.WriteLine("item is null"); |
|
68 |
} |
|
69 |
|
|
70 |
} |
|
71 |
|
|
72 |
} |
|
73 |
catch (Exception ex) |
|
74 |
{ |
|
75 |
Console.WriteLine("error: "+ ex.ToString()); |
|
76 |
} |
|
77 |
|
|
78 |
} |
|
79 |
|
|
80 |
private static void Pdf_FinalMakeError(object sender, MarkupToPDF.MakeFinalErrorArgs e) |
|
81 |
{ |
|
82 |
|
|
83 |
} |
|
84 |
static List<CommonLib.MARKUS_API.FINAL_PDF> _Thread = new List<CommonLib.MARKUS_API.FINAL_PDF>(); |
|
85 |
private static void Pdf_EndFinal(object sender, MarkupToPDF.EndFinalEventArgs e) |
|
86 |
{ |
|
87 |
FINAL_PDF _item = (sender as MarkupToPDF.MarkupToPDF).FinalItem; |
|
88 |
|
|
89 |
SetFinalState(_item.ID, FinalStatus.PdfStamp); |
|
90 |
|
|
91 |
try |
|
92 |
{ |
|
93 |
Console.WriteLine("final pdf end"); |
|
94 |
string soapurl = CommonLib.Common.GetConfigString("UpLoadServiceUrl", "URL", ""); |
|
95 |
Console.WriteLine("soapurl:"+soapurl); |
|
96 |
if (!string.IsNullOrEmpty(soapurl)) |
|
97 |
{ |
|
98 |
//Legacy IF |
|
99 |
KeyValuePair<bool, string> result = UploadFinal.UploadFinal.UploadFinalPDF(e.FinalPDFPath.Replace(@"\\172.20.121.220\comment3\finalPDF\", ""), e.OriginPDFName, e.FinalPDF, soapurl); |
|
100 |
if (result.Key) |
|
101 |
{ |
|
102 |
SetFinalState(_item.ID, FinalStatus.Success); |
|
103 |
} |
|
104 |
else |
|
105 |
{ |
|
106 |
SetFinalState(_item.ID, FinalStatus.Error); |
|
107 |
Console.WriteLine("pram1:"+ e.FinalPDFPath.Replace(@"\\172.20.121.220\comment3\finalPDF\", "")+",pram2:"+ e.OriginPDFName); |
|
108 |
//_Log.Write("Upload error .." + e.FinalPDFPath + ",pdfname:" + e.OriginPDFName); |
|
109 |
} |
|
110 |
} |
|
111 |
else |
|
112 |
{ |
|
113 |
///TODO: 저장할 폴더 위치를 configuration으로 빼주세요 |
|
114 |
///Local Test 용 저장 위치 |
|
115 |
string savepath = CommonLib.Common.GetConfigString("DebugSavePath", "URL", ""); |
|
116 |
|
|
117 |
string saveFolder = String.Format(savepath, _item.PROJECT_NO, Convert.ToInt32(_item.DOCUMENT_ID) / 100, _item.DOCUMENT_ID); |
|
118 |
if (!System.IO.Directory.Exists(saveFolder)) |
|
119 |
{ |
|
120 |
System.IO.Directory.CreateDirectory(saveFolder); |
|
121 |
} |
|
122 |
|
|
123 |
//this._Log.Write(String.Format("saveFolder : {0}", saveFolder) + DateTime.Now); |
|
124 |
System.IO.File.Copy(e.FinalPDFPath, saveFolder + e.OriginPDFName, true); |
|
125 |
using (DataController dataController = new DataController()) |
|
126 |
{ |
|
127 |
string resultpath = CommonLib.Common.GetConfigString("DebugResultUrlPath", "URL", ""); |
|
128 |
string url = String.Format(resultpath, _item.PROJECT_NO, Convert.ToInt32(_item.DOCUMENT_ID) / 100, _item.DOCUMENT_ID, e.OriginPDFName); |
|
129 |
var result = dataController.SetFinalPDFUrl(_item.PROJECT_NO, _item.DOCUMENT_ID, url); |
|
130 |
|
|
131 |
SetFinalState(_item.ID, FinalStatus.Success); |
|
132 |
} |
|
133 |
} |
|
134 |
} |
|
135 |
catch (Exception ex) |
|
136 |
{ |
|
137 |
SetFinalState(_item.ID, FinalStatus.Error); |
|
138 |
//_Log.Write("에러 .." + ex.Message); |
|
139 |
//_Thread.Remove(_T.First()); |
|
140 |
} |
|
141 |
} |
|
142 |
private static void SetFinalState(string finalID, FinalStatus status) |
|
143 |
{ |
|
144 |
using (KCOMDataModel.DataModel.KCOMEntities _entity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString())) |
|
145 |
{ |
|
146 |
var finalList = _entity.FINAL_PDF.Where(final => final.ID == finalID); |
|
147 |
|
|
148 |
if (finalList.Count() > 0) |
|
149 |
{ |
|
150 |
if (status == FinalStatus.Create) |
|
151 |
{ |
|
152 |
finalList.First().START_DATETIME = DateTime.Now; |
|
153 |
} |
|
154 |
if (status == FinalStatus.Success) |
|
155 |
{ |
|
156 |
finalList.First().END_DATETIME = DateTime.Now; |
|
157 |
} |
|
158 |
|
|
159 |
finalList.First().STATUS = (int)status; |
|
160 |
_entity.SaveChanges(); |
|
161 |
} |
|
162 |
}; |
|
163 |
} |
|
164 |
} |
|
165 |
} |
FinalService/KCOM_FinalService/ConsoleApp1/Properties/AssemblyInfo.cs | ||
---|---|---|
1 |
using System.Reflection; |
|
2 |
using System.Runtime.CompilerServices; |
|
3 |
using System.Runtime.InteropServices; |
|
4 |
|
|
5 |
// General Information about an assembly is controlled through the following |
|
6 |
// set of attributes. Change these attribute values to modify the information |
|
7 |
// associated with an assembly. |
|
8 |
[assembly: AssemblyTitle("ConsoleApp1")] |
|
9 |
[assembly: AssemblyDescription("")] |
|
10 |
[assembly: AssemblyConfiguration("")] |
|
11 |
[assembly: AssemblyCompany("")] |
|
12 |
[assembly: AssemblyProduct("ConsoleApp1")] |
|
13 |
[assembly: AssemblyCopyright("Copyright © 2018")] |
|
14 |
[assembly: AssemblyTrademark("")] |
|
15 |
[assembly: AssemblyCulture("")] |
|
16 |
|
|
17 |
// Setting ComVisible to false makes the types in this assembly not visible |
|
18 |
// to COM components. If you need to access a type in this assembly from |
|
19 |
// COM, set the ComVisible attribute to true on that type. |
|
20 |
[assembly: ComVisible(false)] |
|
21 |
|
|
22 |
// The following GUID is for the ID of the typelib if this project is exposed to COM |
|
23 |
[assembly: Guid("2068a2dc-aead-4473-8c97-ca7370a12e64")] |
|
24 |
|
|
25 |
// Version information for an assembly consists of the following four values: |
|
26 |
// |
|
27 |
// Major Version |
|
28 |
// Minor Version |
|
29 |
// Build Number |
|
30 |
// Revision |
|
31 |
// |
|
32 |
// You can specify all the values or you can default the Build and Revision Numbers |
|
33 |
// by using the '*' as shown below: |
|
34 |
// [assembly: AssemblyVersion("1.0.*")] |
|
35 |
[assembly: AssemblyVersion("1.0.0.0")] |
|
36 |
[assembly: AssemblyFileVersion("1.0.0.0")] |
FinalService/KCOM_FinalService/ConsoleApp2/ConsoleApp2.csproj | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
3 |
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
|
4 |
<PropertyGroup> |
|
5 |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|
6 |
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|
7 |
<ProjectGuid>{877F8436-11DF-4585-8BFC-D5C97266FCD1}</ProjectGuid> |
|
8 |
<OutputType>Exe</OutputType> |
|
9 |
<RootNamespace>ConsoleApp2</RootNamespace> |
|
10 |
<AssemblyName>ConsoleApp2</AssemblyName> |
|
11 |
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion> |
|
12 |
<FileAlignment>512</FileAlignment> |
|
13 |
<TargetFrameworkProfile /> |
|
14 |
</PropertyGroup> |
|
15 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|
16 |
<PlatformTarget>AnyCPU</PlatformTarget> |
|
17 |
<DebugSymbols>true</DebugSymbols> |
|
18 |
<DebugType>full</DebugType> |
|
19 |
<Optimize>false</Optimize> |
|
20 |
<OutputPath>bin\Debug\</OutputPath> |
|
21 |
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|
22 |
<ErrorReport>prompt</ErrorReport> |
|
23 |
<WarningLevel>4</WarningLevel> |
|
24 |
<Prefer32Bit>false</Prefer32Bit> |
|
25 |
</PropertyGroup> |
|
26 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|
27 |
<PlatformTarget>AnyCPU</PlatformTarget> |
|
28 |
<DebugType>pdbonly</DebugType> |
|
29 |
<Optimize>true</Optimize> |
|
30 |
<OutputPath>bin\Release\</OutputPath> |
|
31 |
<DefineConstants>TRACE</DefineConstants> |
|
32 |
<ErrorReport>prompt</ErrorReport> |
|
33 |
<WarningLevel>4</WarningLevel> |
|
34 |
<Prefer32Bit>false</Prefer32Bit> |
|
35 |
</PropertyGroup> |
|
36 |
<ItemGroup> |
|
37 |
<Reference Include="Rxx, Version=1.3.4451.33754, Culture=neutral, PublicKeyToken=09aedbbcd2ef4748, processorArchitecture=MSIL"> |
|
38 |
<HintPath>..\packages\Rxx.1.3.4451.33754\lib\net40\Rxx.dll</HintPath> |
|
39 |
</Reference> |
|
40 |
<Reference Include="System" /> |
|
41 |
<Reference Include="System.Core" /> |
|
42 |
<Reference Include="System.Data.Entity" /> |
|
43 |
<Reference Include="System.Reactive, Version=1.0.10621.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> |
|
44 |
<HintPath>..\packages\Rx-Main.1.0.11226\lib\Net4\System.Reactive.dll</HintPath> |
|
45 |
</Reference> |
|
46 |
<Reference Include="System.Xml.Linq" /> |
|
47 |
<Reference Include="System.Data.DataSetExtensions" /> |
|
48 |
<Reference Include="Microsoft.CSharp" /> |
|
49 |
<Reference Include="System.Data" /> |
|
50 |
<Reference Include="System.Xml" /> |
|
51 |
</ItemGroup> |
|
52 |
<ItemGroup> |
|
53 |
<Compile Include="Program.cs" /> |
|
54 |
<Compile Include="Properties\AssemblyInfo.cs" /> |
|
55 |
</ItemGroup> |
|
56 |
<ItemGroup> |
|
57 |
<None Include="app.config" /> |
|
58 |
<None Include="packages.config" /> |
|
59 |
</ItemGroup> |
|
60 |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
|
61 |
</Project> |
FinalService/KCOM_FinalService/ConsoleApp2/Program.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
|
|
6 |
namespace ConsoleApp2 |
|
7 |
{ |
|
8 |
class Program |
|
9 |
{ |
|
10 |
static void Main(string[] args) |
|
11 |
{ |
|
12 |
} |
|
13 |
} |
|
14 |
} |
FinalService/KCOM_FinalService/ConsoleApp2/Properties/AssemblyInfo.cs | ||
---|---|---|
1 |
using System.Reflection; |
|
2 |
using System.Runtime.CompilerServices; |
|
3 |
using System.Runtime.InteropServices; |
|
4 |
|
|
5 |
// General Information about an assembly is controlled through the following |
|
6 |
// set of attributes. Change these attribute values to modify the information |
|
7 |
// associated with an assembly. |
|
8 |
[assembly: AssemblyTitle("ConsoleApp2")] |
|
9 |
[assembly: AssemblyDescription("")] |
|
10 |
[assembly: AssemblyConfiguration("")] |
|
11 |
[assembly: AssemblyCompany("")] |
|
12 |
[assembly: AssemblyProduct("ConsoleApp2")] |
|
13 |
[assembly: AssemblyCopyright("Copyright © 2018")] |
|
14 |
[assembly: AssemblyTrademark("")] |
|
15 |
[assembly: AssemblyCulture("")] |
|
16 |
|
|
17 |
// Setting ComVisible to false makes the types in this assembly not visible |
|
18 |
// to COM components. If you need to access a type in this assembly from |
|
19 |
// COM, set the ComVisible attribute to true on that type. |
|
20 |
[assembly: ComVisible(false)] |
|
21 |
|
|
22 |
// The following GUID is for the ID of the typelib if this project is exposed to COM |
|
23 |
[assembly: Guid("877f8436-11df-4585-8bfc-d5c97266fcd1")] |
|
24 |
|
|
25 |
// Version information for an assembly consists of the following four values: |
|
26 |
// |
|
27 |
// Major Version |
|
28 |
// Minor Version |
|
29 |
// Build Number |
|
30 |
// Revision |
|
31 |
// |
|
32 |
// You can specify all the values or you can default the Build and Revision Numbers |
|
33 |
// by using the '*' as shown below: |
|
34 |
// [assembly: AssemblyVersion("1.0.*")] |
|
35 |
[assembly: AssemblyVersion("1.0.0.0")] |
|
36 |
[assembly: AssemblyFileVersion("1.0.0.0")] |
FinalService/KCOM_FinalService/ConsoleApp2/app.config | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<configuration> |
|
3 |
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup></configuration> |
FinalService/KCOM_FinalService/ConsoleApp2/obj/Debug/ConsoleApp2.csproj.CoreCompileInputs.cache | ||
---|---|---|
1 |
030f37af40600fbedafd956071bcd671b3372783 |
FinalService/KCOM_FinalService/ConsoleApp2/packages.config | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<packages> |
|
3 |
<package id="Rx-Main" version="1.0.11226" targetFramework="net40" /> |
|
4 |
<package id="Rxx" version="1.3.4451.33754" targetFramework="net40" /> |
|
5 |
</packages> |
FinalService/KCOM_FinalService/FinalService_Config/App.config | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8" ?> |
|
2 |
<configuration> |
|
3 |
<startup> |
|
4 |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> |
|
5 |
</startup> |
|
6 |
</configuration> |
FinalService/KCOM_FinalService/FinalService_Config/FinalService_Config.csproj | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
3 |
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
|
4 |
<PropertyGroup> |
|
5 |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|
6 |
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|
7 |
<ProjectGuid>{ADC39322-0E61-4B6E-89A3-6219F145F185}</ProjectGuid> |
|
8 |
<OutputType>WinExe</OutputType> |
|
9 |
<RootNamespace>FinalService_Config</RootNamespace> |
|
10 |
<AssemblyName>FinalService_Config</AssemblyName> |
|
11 |
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> |
|
12 |
<FileAlignment>512</FileAlignment> |
|
13 |
<Deterministic>true</Deterministic> |
|
14 |
</PropertyGroup> |
|
15 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|
16 |
<PlatformTarget>AnyCPU</PlatformTarget> |
|
17 |
<DebugSymbols>true</DebugSymbols> |
|
18 |
<DebugType>full</DebugType> |
|
19 |
<Optimize>false</Optimize> |
|
20 |
<OutputPath>..\..\..\Setup\FinalService\</OutputPath> |
|
21 |
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|
22 |
<ErrorReport>prompt</ErrorReport> |
|
23 |
<WarningLevel>4</WarningLevel> |
|
24 |
</PropertyGroup> |
|
25 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|
26 |
<PlatformTarget>AnyCPU</PlatformTarget> |
|
27 |
<DebugType>pdbonly</DebugType> |
|
28 |
<Optimize>true</Optimize> |
|
29 |
<OutputPath>..\..\..\Setup\FinalService\</OutputPath> |
|
30 |
<DefineConstants>TRACE</DefineConstants> |
|
31 |
<ErrorReport>prompt</ErrorReport> |
|
32 |
<WarningLevel>4</WarningLevel> |
|
33 |
</PropertyGroup> |
|
34 |
<ItemGroup> |
|
35 |
<Reference Include="System" /> |
|
36 |
<Reference Include="System.Core" /> |
|
37 |
<Reference Include="System.Runtime.Remoting" /> |
|
38 |
<Reference Include="System.Xml.Linq" /> |
|
39 |
<Reference Include="System.Data.DataSetExtensions" /> |
|
40 |
<Reference Include="Microsoft.CSharp" /> |
|
41 |
<Reference Include="System.Data" /> |
|
42 |
<Reference Include="System.Deployment" /> |
|
43 |
<Reference Include="System.Drawing" /> |
|
44 |
<Reference Include="System.Net.Http" /> |
|
45 |
<Reference Include="System.Windows.Forms" /> |
|
46 |
<Reference Include="System.Xml" /> |
|
47 |
<Reference Include="Telerik.WinControls, Version=2018.2.621.40, Culture=neutral, PublicKeyToken=5bb2a467cbec794e" /> |
|
48 |
<Reference Include="Telerik.WinControls.UI, Version=2018.2.621.40, Culture=neutral, PublicKeyToken=5bb2a467cbec794e" /> |
|
49 |
<Reference Include="TelerikCommon, Version=2018.2.621.40, Culture=neutral, PublicKeyToken=5bb2a467cbec794e" /> |
|
50 |
</ItemGroup> |
|
51 |
<ItemGroup> |
|
52 |
<Compile Include="FormConfig.cs"> |
|
53 |
<SubType>Form</SubType> |
|
54 |
</Compile> |
|
55 |
<Compile Include="FormConfig.Designer.cs"> |
|
56 |
<DependentUpon>FormConfig.cs</DependentUpon> |
|
57 |
</Compile> |
|
58 |
<Compile Include="Program.cs" /> |
|
59 |
<Compile Include="Properties\AssemblyInfo.cs" /> |
|
60 |
<EmbeddedResource Include="FormConfig.resx"> |
|
61 |
<DependentUpon>FormConfig.cs</DependentUpon> |
|
62 |
</EmbeddedResource> |
|
63 |
<EmbeddedResource Include="Properties\licenses.licx" /> |
|
64 |
<EmbeddedResource Include="Properties\Resources.resx"> |
|
65 |
<Generator>ResXFileCodeGenerator</Generator> |
|
66 |
<LastGenOutput>Resources.Designer.cs</LastGenOutput> |
|
67 |
<SubType>Designer</SubType> |
|
68 |
</EmbeddedResource> |
|
69 |
<Compile Include="Properties\Resources.Designer.cs"> |
|
70 |
<AutoGen>True</AutoGen> |
|
71 |
<DependentUpon>Resources.resx</DependentUpon> |
|
72 |
<DesignTime>True</DesignTime> |
|
73 |
</Compile> |
|
74 |
<None Include="Properties\Settings.settings"> |
|
75 |
<Generator>SettingsSingleFileGenerator</Generator> |
|
76 |
<LastGenOutput>Settings.Designer.cs</LastGenOutput> |
|
77 |
</None> |
|
78 |
<Compile Include="Properties\Settings.Designer.cs"> |
|
79 |
<AutoGen>True</AutoGen> |
|
80 |
<DependentUpon>Settings.settings</DependentUpon> |
|
81 |
<DesignTimeSharedInput>True</DesignTimeSharedInput> |
|
82 |
</Compile> |
|
83 |
</ItemGroup> |
|
84 |
<ItemGroup> |
|
85 |
<None Include="App.config" /> |
|
86 |
</ItemGroup> |
|
87 |
<ItemGroup> |
|
88 |
<ProjectReference Include="..\IFinalPDF\IFinalPDF.csproj"> |
|
89 |
<Project>{784438be-2074-41ae-a692-24e1a4a67fe3}</Project> |
|
90 |
<Name>IFinalPDF</Name> |
|
91 |
</ProjectReference> |
|
92 |
<ProjectReference Include="..\KCOMDataModel\KCOMDataModel.csproj"> |
|
93 |
<Project>{629dc8cd-d458-47ef-8f02-cd12c7001c3e}</Project> |
|
94 |
<Name>KCOMDataModel</Name> |
|
95 |
</ProjectReference> |
|
96 |
</ItemGroup> |
|
97 |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
|
98 |
</Project> |
FinalService/KCOM_FinalService/FinalService_Config/FormConfig.Designer.cs | ||
---|---|---|
1 |
namespace FinalService_Config |
|
2 |
{ |
|
3 |
partial class FormConfig |
|
4 |
{ |
|
5 |
/// <summary> |
|
6 |
/// 필수 디자이너 변수입니다. |
|
7 |
/// </summary> |
|
8 |
private System.ComponentModel.IContainer components = null; |
|
9 |
|
|
10 |
/// <summary> |
|
11 |
/// 사용 중인 모든 리소스를 정리합니다. |
|
12 |
/// </summary> |
|
13 |
/// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param> |
|
14 |
protected override void Dispose(bool disposing) |
|
15 |
{ |
|
16 |
if (disposing && (components != null)) |
|
17 |
{ |
|
18 |
components.Dispose(); |
|
19 |
} |
|
20 |
base.Dispose(disposing); |
|
21 |
} |
|
22 |
|
|
23 |
#region Windows Form 디자이너에서 생성한 코드 |
|
24 |
|
|
25 |
/// <summary> |
|
26 |
/// 디자이너 지원에 필요한 메서드입니다. |
|
27 |
/// 이 메서드의 내용을 코드 편집기로 수정하지 마세요. |
|
28 |
/// </summary> |
|
29 |
private void InitializeComponent() |
|
30 |
{ |
|
31 |
this.buttonTest = new System.Windows.Forms.Button(); |
|
32 |
this.textBoxLog = new System.Windows.Forms.TextBox(); |
|
33 |
this.label1 = new System.Windows.Forms.Label(); |
|
34 |
this.textBoxPort = new System.Windows.Forms.TextBox(); |
|
35 |
this.SuspendLayout(); |
|
36 |
// |
|
37 |
// buttonTest |
|
38 |
// |
|
39 |
this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) |
|
40 |
| System.Windows.Forms.AnchorStyles.Right))); |
|
41 |
this.buttonTest.Location = new System.Drawing.Point(0, 33); |
|
42 |
this.buttonTest.Name = "buttonTest"; |
|
43 |
this.buttonTest.Size = new System.Drawing.Size(417, 49); |
|
44 |
this.buttonTest.TabIndex = 0; |
|
45 |
this.buttonTest.Text = "파이널 서비스 호출"; |
|
46 |
this.buttonTest.UseVisualStyleBackColor = true; |
|
47 |
this.buttonTest.Click += new System.EventHandler(this.ButtonTest_Click); |
|
48 |
// |
|
49 |
// textBoxLog |
|
50 |
// |
|
51 |
this.textBoxLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) |
|
52 |
| System.Windows.Forms.AnchorStyles.Left) |
|
53 |
| System.Windows.Forms.AnchorStyles.Right))); |
|
54 |
this.textBoxLog.Location = new System.Drawing.Point(0, 88); |
|
55 |
this.textBoxLog.Multiline = true; |
|
56 |
this.textBoxLog.Name = "textBoxLog"; |
|
57 |
this.textBoxLog.Size = new System.Drawing.Size(417, 90); |
|
58 |
this.textBoxLog.TabIndex = 1; |
|
59 |
// |
|
60 |
// label1 |
|
61 |
// |
|
62 |
this.label1.AutoSize = true; |
|
63 |
this.label1.Location = new System.Drawing.Point(12, 9); |
|
64 |
this.label1.Name = "label1"; |
|
65 |
this.label1.Size = new System.Drawing.Size(41, 12); |
|
66 |
this.label1.TabIndex = 2; |
|
67 |
this.label1.Text = "포트 : "; |
|
68 |
// |
|
69 |
// textBoxPort |
|
70 |
// |
|
71 |
this.textBoxPort.Location = new System.Drawing.Point(59, 6); |
|
72 |
this.textBoxPort.Name = "textBoxPort"; |
|
73 |
this.textBoxPort.Size = new System.Drawing.Size(100, 21); |
|
74 |
this.textBoxPort.TabIndex = 3; |
|
75 |
this.textBoxPort.Text = "9092"; |
|
76 |
// |
|
77 |
// FormConfig |
|
78 |
// |
|
79 |
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); |
|
80 |
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
|
81 |
this.ClientSize = new System.Drawing.Size(416, 190); |
|
82 |
this.Controls.Add(this.textBoxPort); |
|
83 |
this.Controls.Add(this.label1); |
|
84 |
this.Controls.Add(this.textBoxLog); |
|
85 |
this.Controls.Add(this.buttonTest); |
|
86 |
this.Name = "FormConfig"; |
|
87 |
this.Text = "파이널 서비스 테스트"; |
|
88 |
this.ResumeLayout(false); |
|
89 |
this.PerformLayout(); |
|
90 |
|
|
91 |
} |
|
92 |
|
|
93 |
#endregion |
|
94 |
|
|
95 |
private System.Windows.Forms.Button buttonTest; |
|
96 |
private System.Windows.Forms.TextBox textBoxLog; |
|
97 |
private System.Windows.Forms.Label label1; |
|
98 |
private System.Windows.Forms.TextBox textBoxPort; |
|
99 |
} |
|
100 |
} |
|
101 |
|
FinalService/KCOM_FinalService/FinalService_Config/FormConfig.cs | ||
---|---|---|
1 |
using KCOMDataModel.DataModel; |
|
2 |
using System; |
|
3 |
using System.Collections.Generic; |
|
4 |
using System.ComponentModel; |
|
5 |
using System.Data; |
|
6 |
using System.Drawing; |
|
7 |
using System.Linq; |
|
8 |
using System.Text; |
|
9 |
using System.Threading.Tasks; |
|
10 |
using System.Windows.Forms; |
|
11 |
using System.Runtime.Remoting.Channels.Tcp; |
|
12 |
using IFinalPDF; |
|
13 |
|
|
14 |
namespace FinalService_Config |
|
15 |
{ |
|
16 |
public partial class FormConfig : Form |
|
17 |
{ |
|
18 |
public FormConfig() |
|
19 |
{ |
|
20 |
InitializeComponent(); |
|
21 |
} |
|
22 |
|
|
23 |
private void ButtonTest_Click(object sender, EventArgs e) |
|
24 |
{ |
|
25 |
FinalPDFResult result = new FinalPDFResult(); |
|
26 |
RemFinalPDFObject remObj = null; |
|
27 |
|
|
28 |
string ChannelID; |
|
29 |
FINAL_PDF pdfData = new FINAL_PDF(); |
|
30 |
System.Runtime.Remoting.Channels.IChannel _ch = System.Runtime.Remoting.Channels.ChannelServices.GetChannel("tcp"); |
|
31 |
if (_ch == null) |
|
32 |
{ |
|
33 |
TcpChannel chan = new TcpChannel(); |
|
34 |
ChannelID = chan.ChannelName; |
|
35 |
System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(chan, false); |
|
36 |
// Create an instance of the remote object |
|
37 |
} |
|
38 |
else |
|
39 |
{ |
|
40 |
ChannelID = _ch.ChannelName; |
|
41 |
} |
|
42 |
|
|
43 |
remObj = (RemFinalPDFObject)Activator.GetObject(typeof(RemFinalPDFObject), |
|
44 |
string.Format("tcp://localhost:{0}/remFinalPDF", this.textBoxPort.Text)); |
|
45 |
|
|
46 |
try |
|
47 |
{ |
|
48 |
result = remObj.SetFinalPDF("000000", "111111"); |
|
49 |
result.FinalID = ShortGuid(); |
|
50 |
result.Status = FinalStatus.Success; |
|
51 |
} |
|
52 |
catch(Exception ex) |
|
53 |
{ |
|
54 |
this.textBoxLog.Text = ex.StackTrace.ToString(); |
|
55 |
} |
|
56 |
} |
|
57 |
|
|
58 |
private static string ShortGuid() |
|
59 |
{ |
|
60 |
byte[] bytes = new byte[16]; |
|
61 |
using (var provider = System.Security.Cryptography.RandomNumberGenerator.Create()) |
|
62 |
{ |
|
63 |
provider.GetBytes(bytes); |
|
64 |
} |
|
65 |
|
|
66 |
var guid = new Guid(bytes); |
|
67 |
|
|
68 |
return Convert.ToBase64String(guid.ToByteArray()) |
|
69 |
.Substring(0, 10) |
|
70 |
.Replace("/", "") |
|
71 |
.Replace("+", "") + DateTime.UtcNow.Ticks.ToString("x"); |
|
72 |
} |
|
73 |
} |
|
74 |
} |
FinalService/KCOM_FinalService/FinalService_Config/FormConfig.resx | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<root> |
|
3 |
<!-- |
|
4 |
Microsoft ResX Schema |
|
5 |
|
|
6 |
Version 2.0 |
|
7 |
|
|
8 |
The primary goals of this format is to allow a simple XML format |
|
9 |
that is mostly human readable. The generation and parsing of the |
|
10 |
various data types are done through the TypeConverter classes |
|
11 |
associated with the data types. |
|
12 |
|
|
13 |
Example: |
|
14 |
|
|
15 |
... ado.net/XML headers & schema ... |
|
16 |
<resheader name="resmimetype">text/microsoft-resx</resheader> |
|
17 |
<resheader name="version">2.0</resheader> |
|
18 |
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
|
19 |
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
|
20 |
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
|
21 |
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
|
22 |
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
|
23 |
<value>[base64 mime encoded serialized .NET Framework object]</value> |
|
24 |
</data> |
|
25 |
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
|
26 |
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
|
27 |
<comment>This is a comment</comment> |
|
28 |
</data> |
|
29 |
|
|
30 |
There are any number of "resheader" rows that contain simple |
|
31 |
name/value pairs. |
|
32 |
|
|
33 |
Each data row contains a name, and value. The row also contains a |
|
34 |
type or mimetype. Type corresponds to a .NET class that support |
|
35 |
text/value conversion through the TypeConverter architecture. |
|
36 |
Classes that don't support this are serialized and stored with the |
|
37 |
mimetype set. |
|
38 |
|
|
39 |
The mimetype is used for serialized objects, and tells the |
|
40 |
ResXResourceReader how to depersist the object. This is currently not |
|
41 |
extensible. For a given mimetype the value must be set accordingly: |
|
42 |
|
|
43 |
Note - application/x-microsoft.net.object.binary.base64 is the format |
|
44 |
that the ResXResourceWriter will generate, however the reader can |
|
45 |
read any of the formats listed below. |
|
46 |
|
|
47 |
mimetype: application/x-microsoft.net.object.binary.base64 |
|
48 |
value : The object must be serialized with |
|
49 |
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
|
50 |
: and then encoded with base64 encoding. |
|
51 |
|
|
52 |
mimetype: application/x-microsoft.net.object.soap.base64 |
|
53 |
value : The object must be serialized with |
|
54 |
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
|
55 |
: and then encoded with base64 encoding. |
|
56 |
|
|
57 |
mimetype: application/x-microsoft.net.object.bytearray.base64 |
|
58 |
value : The object must be serialized into a byte array |
|
59 |
: using a System.ComponentModel.TypeConverter |
|
60 |
: and then encoded with base64 encoding. |
|
61 |
--> |
|
62 |
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
|
63 |
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
|
64 |
<xsd:element name="root" msdata:IsDataSet="true"> |
|
65 |
<xsd:complexType> |
|
66 |
<xsd:choice maxOccurs="unbounded"> |
|
67 |
<xsd:element name="metadata"> |
|
68 |
<xsd:complexType> |
|
69 |
<xsd:sequence> |
|
70 |
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
|
71 |
</xsd:sequence> |
|
72 |
<xsd:attribute name="name" use="required" type="xsd:string" /> |
|
73 |
<xsd:attribute name="type" type="xsd:string" /> |
|
74 |
<xsd:attribute name="mimetype" type="xsd:string" /> |
|
75 |
<xsd:attribute ref="xml:space" /> |
|
76 |
</xsd:complexType> |
|
77 |
</xsd:element> |
|
78 |
<xsd:element name="assembly"> |
|
79 |
<xsd:complexType> |
|
80 |
<xsd:attribute name="alias" type="xsd:string" /> |
|
81 |
<xsd:attribute name="name" type="xsd:string" /> |
|
82 |
</xsd:complexType> |
|
83 |
</xsd:element> |
|
84 |
<xsd:element name="data"> |
|
85 |
<xsd:complexType> |
|
86 |
<xsd:sequence> |
|
87 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
88 |
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
|
89 |
</xsd:sequence> |
|
90 |
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
|
91 |
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
|
92 |
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
|
93 |
<xsd:attribute ref="xml:space" /> |
|
94 |
</xsd:complexType> |
|
95 |
</xsd:element> |
|
96 |
<xsd:element name="resheader"> |
|
97 |
<xsd:complexType> |
|
98 |
<xsd:sequence> |
|
99 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
100 |
</xsd:sequence> |
|
101 |
<xsd:attribute name="name" type="xsd:string" use="required" /> |
|
102 |
</xsd:complexType> |
|
103 |
</xsd:element> |
|
104 |
</xsd:choice> |
|
105 |
</xsd:complexType> |
|
106 |
</xsd:element> |
|
107 |
</xsd:schema> |
|
108 |
<resheader name="resmimetype"> |
|
109 |
<value>text/microsoft-resx</value> |
|
110 |
</resheader> |
|
111 |
<resheader name="version"> |
|
112 |
<value>2.0</value> |
|
113 |
</resheader> |
|
114 |
<resheader name="reader"> |
|
115 |
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
116 |
</resheader> |
|
117 |
<resheader name="writer"> |
|
118 |
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
119 |
</resheader> |
|
120 |
</root> |
FinalService/KCOM_FinalService/FinalService_Config/Program.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Threading.Tasks; |
|
5 |
using System.Windows.Forms; |
|
6 |
|
|
7 |
namespace FinalService_Config |
|
8 |
{ |
|
9 |
static class Program |
|
10 |
{ |
|
11 |
/// <summary> |
|
12 |
/// 해당 응용 프로그램의 주 진입점입니다. |
|
13 |
/// </summary> |
|
14 |
[STAThread] |
|
15 |
static void Main() |
|
16 |
{ |
|
17 |
Application.EnableVisualStyles(); |
|
18 |
Application.SetCompatibleTextRenderingDefault(false); |
|
19 |
Application.Run(new FormConfig()); |
|
20 |
} |
|
21 |
} |
|
22 |
} |
FinalService/KCOM_FinalService/FinalService_Config/Properties/AssemblyInfo.cs | ||
---|---|---|
1 |
using System.Reflection; |
|
2 |
using System.Runtime.CompilerServices; |
|
3 |
using System.Runtime.InteropServices; |
|
4 |
|
|
5 |
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 |
|
6 |
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면 |
|
7 |
// 이러한 특성 값을 변경하세요. |
|
8 |
[assembly: AssemblyTitle("FinalService_Tester")] |
|
9 |
[assembly: AssemblyDescription("")] |
|
10 |
[assembly: AssemblyConfiguration("")] |
|
11 |
[assembly: AssemblyCompany("Microsoft Corporation")] |
|
12 |
[assembly: AssemblyProduct("FinalService_Tester")] |
|
13 |
[assembly: AssemblyCopyright("Copyright © Microsoft Corporation 2019")] |
|
14 |
[assembly: AssemblyTrademark("")] |
|
15 |
[assembly: AssemblyCulture("")] |
|
16 |
|
|
17 |
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에 |
|
18 |
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면 |
|
19 |
// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요. |
|
20 |
[assembly: ComVisible(false)] |
|
21 |
|
|
22 |
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다. |
|
23 |
[assembly: Guid("adc39322-0e61-4b6e-89a3-6219f145f185")] |
|
24 |
|
|
25 |
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다. |
|
26 |
// |
|
27 |
// 주 버전 |
|
28 |
// 부 버전 |
|
29 |
// 빌드 번호 |
|
30 |
// 수정 버전 |
|
31 |
// |
|
32 |
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호가 자동으로 |
|
33 |
// 지정되도록 할 수 있습니다. |
|
34 |
// [assembly: AssemblyVersion("1.0.*")] |
|
35 |
[assembly: AssemblyVersion("1.0.0.0")] |
|
36 |
[assembly: AssemblyFileVersion("1.0.0.0")] |
FinalService/KCOM_FinalService/FinalService_Config/Properties/Resources.Designer.cs | ||
---|---|---|
1 |
//------------------------------------------------------------------------------ |
|
2 |
// <auto-generated> |
|
3 |
// 이 코드는 도구를 사용하여 생성되었습니다. |
|
4 |
// 런타임 버전:4.0.30319.42000 |
|
5 |
// |
|
6 |
// 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 |
|
7 |
// 이러한 변경 내용이 손실됩니다. |
|
8 |
// </auto-generated> |
|
9 |
//------------------------------------------------------------------------------ |
|
10 |
|
|
11 |
namespace FinalService_Config.Properties { |
|
12 |
using System; |
|
13 |
|
|
14 |
|
|
15 |
/// <summary> |
|
16 |
/// 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다. |
|
17 |
/// </summary> |
|
18 |
// 이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder |
|
19 |
// 클래스에서 자동으로 생성되었습니다. |
|
20 |
// 멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여 ResGen을 |
|
21 |
// 다시 실행하거나 VS 프로젝트를 다시 빌드하십시오. |
|
22 |
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] |
|
23 |
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
|
24 |
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] |
|
25 |
internal class Resources { |
|
26 |
|
|
27 |
private static global::System.Resources.ResourceManager resourceMan; |
|
28 |
|
|
29 |
private static global::System.Globalization.CultureInfo resourceCulture; |
|
30 |
|
|
31 |
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] |
|
32 |
internal Resources() { |
|
33 |
} |
|
34 |
|
|
35 |
/// <summary> |
|
36 |
/// 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다. |
|
37 |
/// </summary> |
|
38 |
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] |
|
39 |
internal static global::System.Resources.ResourceManager ResourceManager { |
|
40 |
get { |
|
41 |
if (object.ReferenceEquals(resourceMan, null)) { |
|
42 |
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FinalService_Config.Properties.Resources", typeof(Resources).Assembly); |
|
43 |
resourceMan = temp; |
|
44 |
} |
|
45 |
return resourceMan; |
|
46 |
} |
|
47 |
} |
|
48 |
|
|
49 |
/// <summary> |
|
50 |
/// 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대해 현재 스레드의 CurrentUICulture 속성을 |
|
51 |
/// 재정의합니다. |
|
52 |
/// </summary> |
|
53 |
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] |
|
54 |
internal static global::System.Globalization.CultureInfo Culture { |
|
55 |
get { |
|
56 |
return resourceCulture; |
|
57 |
} |
|
58 |
set { |
|
59 |
resourceCulture = value; |
|
60 |
} |
|
61 |
} |
|
62 |
} |
|
63 |
} |
FinalService/KCOM_FinalService/FinalService_Config/Properties/Resources.resx | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<root> |
|
3 |
<!-- |
|
4 |
Microsoft ResX Schema |
|
5 |
|
|
6 |
Version 2.0 |
|
7 |
|
|
8 |
The primary goals of this format is to allow a simple XML format |
|
9 |
that is mostly human readable. The generation and parsing of the |
|
10 |
various data types are done through the TypeConverter classes |
|
11 |
associated with the data types. |
|
12 |
|
|
13 |
Example: |
|
14 |
|
|
15 |
... ado.net/XML headers & schema ... |
|
16 |
<resheader name="resmimetype">text/microsoft-resx</resheader> |
|
17 |
<resheader name="version">2.0</resheader> |
|
18 |
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
|
19 |
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
|
20 |
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
|
21 |
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
|
22 |
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
|
23 |
<value>[base64 mime encoded serialized .NET Framework object]</value> |
|
24 |
</data> |
|
25 |
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
|
26 |
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
|
27 |
<comment>This is a comment</comment> |
|
28 |
</data> |
|
29 |
|
|
30 |
There are any number of "resheader" rows that contain simple |
|
31 |
name/value pairs. |
|
32 |
|
|
33 |
Each data row contains a name, and value. The row also contains a |
|
34 |
type or mimetype. Type corresponds to a .NET class that support |
|
35 |
text/value conversion through the TypeConverter architecture. |
|
36 |
Classes that don't support this are serialized and stored with the |
|
37 |
mimetype set. |
|
38 |
|
|
39 |
The mimetype is used for serialized objects, and tells the |
|
40 |
ResXResourceReader how to depersist the object. This is currently not |
|
41 |
extensible. For a given mimetype the value must be set accordingly: |
|
42 |
|
|
43 |
Note - application/x-microsoft.net.object.binary.base64 is the format |
|
44 |
that the ResXResourceWriter will generate, however the reader can |
|
45 |
read any of the formats listed below. |
|
46 |
|
|
47 |
mimetype: application/x-microsoft.net.object.binary.base64 |
|
48 |
value : The object must be serialized with |
|
49 |
: System.Serialization.Formatters.Binary.BinaryFormatter |
|
50 |
: and then encoded with base64 encoding. |
|
51 |
|
|
52 |
mimetype: application/x-microsoft.net.object.soap.base64 |
|
53 |
value : The object must be serialized with |
|
54 |
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
|
55 |
: and then encoded with base64 encoding. |
|
56 |
|
|
57 |
mimetype: application/x-microsoft.net.object.bytearray.base64 |
|
58 |
value : The object must be serialized into a byte array |
|
59 |
: using a System.ComponentModel.TypeConverter |
|
60 |
: and then encoded with base64 encoding. |
|
61 |
--> |
|
62 |
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
|
63 |
<xsd:element name="root" msdata:IsDataSet="true"> |
|
64 |
<xsd:complexType> |
|
65 |
<xsd:choice maxOccurs="unbounded"> |
|
66 |
<xsd:element name="metadata"> |
|
67 |
<xsd:complexType> |
|
68 |
<xsd:sequence> |
|
69 |
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
|
70 |
</xsd:sequence> |
|
71 |
<xsd:attribute name="name" type="xsd:string" /> |
|
72 |
<xsd:attribute name="type" type="xsd:string" /> |
|
73 |
<xsd:attribute name="mimetype" type="xsd:string" /> |
|
74 |
</xsd:complexType> |
|
75 |
</xsd:element> |
|
76 |
<xsd:element name="assembly"> |
|
77 |
<xsd:complexType> |
|
78 |
<xsd:attribute name="alias" type="xsd:string" /> |
|
79 |
<xsd:attribute name="name" type="xsd:string" /> |
|
80 |
</xsd:complexType> |
|
81 |
</xsd:element> |
|
82 |
<xsd:element name="data"> |
|
83 |
<xsd:complexType> |
|
84 |
<xsd:sequence> |
|
85 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
86 |
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
|
87 |
</xsd:sequence> |
|
88 |
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> |
|
89 |
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
|
90 |
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
|
91 |
</xsd:complexType> |
|
92 |
</xsd:element> |
|
93 |
<xsd:element name="resheader"> |
|
94 |
<xsd:complexType> |
|
95 |
<xsd:sequence> |
|
96 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
97 |
</xsd:sequence> |
|
98 |
<xsd:attribute name="name" type="xsd:string" use="required" /> |
|
99 |
</xsd:complexType> |
|
100 |
</xsd:element> |
|
101 |
</xsd:choice> |
|
102 |
</xsd:complexType> |
|
103 |
</xsd:element> |
|
104 |
</xsd:schema> |
|
105 |
<resheader name="resmimetype"> |
|
106 |
<value>text/microsoft-resx</value> |
|
107 |
</resheader> |
|
108 |
<resheader name="version"> |
|
109 |
<value>2.0</value> |
|
110 |
</resheader> |
|
111 |
<resheader name="reader"> |
|
112 |
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
113 |
</resheader> |
|
114 |
<resheader name="writer"> |
|
115 |
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
116 |
</resheader> |
|
117 |
</root> |
FinalService/KCOM_FinalService/FinalService_Config/Properties/Settings.Designer.cs | ||
---|---|---|
1 |
//------------------------------------------------------------------------------ |
|
2 |
// <auto-generated> |
|
3 |
// 이 코드는 도구를 사용하여 생성되었습니다. |
|
4 |
// 런타임 버전:4.0.30319.42000 |
|
5 |
// |
|
6 |
// 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 |
|
7 |
// 이러한 변경 내용이 손실됩니다. |
|
8 |
// </auto-generated> |
|
9 |
//------------------------------------------------------------------------------ |
|
10 |
|
|
11 |
namespace FinalService_Config.Properties { |
|
12 |
|
|
13 |
|
|
14 |
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] |
|
15 |
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")] |
|
16 |
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { |
|
17 |
|
|
18 |
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); |
|
19 |
|
|
20 |
public static Settings Default { |
|
21 |
get { |
|
22 |
return defaultInstance; |
|
23 |
} |
|
24 |
} |
|
25 |
} |
|
26 |
} |
FinalService/KCOM_FinalService/FinalService_Config/Properties/Settings.settings | ||
---|---|---|
1 |
<?xml version='1.0' encoding='utf-8'?> |
|
2 |
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> |
|
3 |
<Profiles> |
|
4 |
<Profile Name="(Default)" /> |
|
5 |
</Profiles> |
|
6 |
<Settings /> |
|
7 |
</SettingsFile> |
FinalService/KCOM_FinalService/FinalService_Config/Properties/licenses.licx | ||
---|---|---|
1 |
Telerik.WinControls.UI.RadWaitingBar, Telerik.WinControls.UI, Version=2018.2.621.40, Culture=neutral, PublicKeyToken=5bb2a467cbec794e |
FinalService/KCOM_FinalService/KCOM_FinalService.sln | ||
---|---|---|
27 | 27 |
EndProject |
28 | 28 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UploadFinal", "..\..\Site\SNI\UploadFinal\UploadFinal.csproj", "{9CF3737A-E04D-4A55-924E-C88725DFBEC7}" |
29 | 29 |
EndProject |
30 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FinalService_Config", "FinalService_Config\FinalService_Config.csproj", "{ADC39322-0E61-4B6E-89A3-6219F145F185}" |
|
31 |
EndProject |
|
30 | 32 |
Global |
31 | 33 |
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
32 | 34 |
Debug|Any CPU = Debug|Any CPU |
... | ... | |
155 | 157 |
{9CF3737A-E04D-4A55-924E-C88725DFBEC7}.Release|x64.Build.0 = Release|Any CPU |
156 | 158 |
{9CF3737A-E04D-4A55-924E-C88725DFBEC7}.Release|x86.ActiveCfg = Release|Any CPU |
157 | 159 |
{9CF3737A-E04D-4A55-924E-C88725DFBEC7}.Release|x86.Build.0 = Release|Any CPU |
160 |
{ADC39322-0E61-4B6E-89A3-6219F145F185}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
161 |
{ADC39322-0E61-4B6E-89A3-6219F145F185}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
162 |
{ADC39322-0E61-4B6E-89A3-6219F145F185}.Debug|x64.ActiveCfg = Debug|Any CPU |
|
163 |
{ADC39322-0E61-4B6E-89A3-6219F145F185}.Debug|x64.Build.0 = Debug|Any CPU |
|
164 |
{ADC39322-0E61-4B6E-89A3-6219F145F185}.Debug|x86.ActiveCfg = Debug|Any CPU |
|
165 |
{ADC39322-0E61-4B6E-89A3-6219F145F185}.Debug|x86.Build.0 = Debug|Any CPU |
|
166 |
{ADC39322-0E61-4B6E-89A3-6219F145F185}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
167 |
{ADC39322-0E61-4B6E-89A3-6219F145F185}.Release|Any CPU.Build.0 = Release|Any CPU |
|
168 |
{ADC39322-0E61-4B6E-89A3-6219F145F185}.Release|x64.ActiveCfg = Release|Any CPU |
|
169 |
{ADC39322-0E61-4B6E-89A3-6219F145F185}.Release|x64.Build.0 = Release|Any CPU |
|
170 |
{ADC39322-0E61-4B6E-89A3-6219F145F185}.Release|x86.ActiveCfg = Release|Any CPU |
|
171 |
{ADC39322-0E61-4B6E-89A3-6219F145F185}.Release|x86.Build.0 = Release|Any CPU |
|
158 | 172 |
EndGlobalSection |
159 | 173 |
GlobalSection(SolutionProperties) = preSolution |
160 | 174 |
HideSolutionNode = FALSE |
FinalService/KCOM_FinalService/KCOM_FinalService/Common/ServiceEventLog.cs | ||
---|---|---|
16 | 16 |
this.Source = SourceName; |
17 | 17 |
this.Log = LogName; |
18 | 18 |
|
19 |
if (!EventLog.SourceExists(SourceName)) |
|
20 |
EventLog.CreateEventSource(SourceName, "Application"); |
|
19 |
//if (!EventLog.SourceExists(SourceName))
|
|
20 |
// EventLog.CreateEventSource(SourceName, "Application");
|
|
21 | 21 |
} |
22 | 22 |
|
23 | 23 |
public void Write(string Message) |
FinalService/KCOM_FinalService/KCOM_FinalService/FinalService.cs | ||
---|---|---|
36 | 36 |
_remotingFinal = new RemFinalPDFStation(_log); |
37 | 37 |
} |
38 | 38 |
|
39 |
public void TestStartupAndStop(string[] args) |
|
40 |
{ |
|
41 |
this.OnStart(args); |
|
42 |
Program.FileLogger.Debug("TestStartupAndStop"); |
|
43 |
|
|
44 |
Console.ReadLine(); |
|
45 |
this.OnStop(); |
|
46 |
} |
|
47 |
|
|
39 | 48 |
private void _Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) |
40 | 49 |
{ |
41 | 50 |
Program.FileLogger.Debug("FinalService가 정상적으로 실행 중입니다"); |
FinalService/KCOM_FinalService/KCOM_FinalService/Program.cs | ||
---|---|---|
58 | 58 |
Program.UploadFinalPDFInst = Activator.CreateInstance(_UploadFinalClassType, null); |
59 | 59 |
} |
60 | 60 |
} |
61 |
/// up to here |
|
62 |
#if DEBUG |
|
63 |
RemFinalPDFStation oFinalStation = new RemFinalPDFStation(); |
|
64 |
#else |
|
65 |
ServicesToRun = new ServiceBase[] |
|
61 |
|
|
62 |
if (Environment.UserInteractive) |
|
63 |
{ |
|
64 |
FinalService service = new FinalService(); |
|
65 |
service.TestStartupAndStop(args); |
|
66 |
} |
|
67 |
else |
|
66 | 68 |
{ |
69 |
/// up to here |
|
70 |
ServicesToRun = new ServiceBase[] |
|
71 |
{ |
|
67 | 72 |
new FinalService() |
68 |
}; |
|
69 |
ServiceBase.Run(ServicesToRun); |
|
70 |
#endif
|
|
73 |
};
|
|
74 |
ServiceBase.Run(ServicesToRun);
|
|
75 |
}
|
|
71 | 76 |
} |
72 | 77 |
|
73 | 78 |
/// <summary> |
FinalService/KCOM_FinalService/KCOM_FinalService/Remoting/RemFinalPDFStation.cs | ||
---|---|---|
19 | 19 |
#region Properties |
20 | 20 |
TcpChannel _Channel = null; |
21 | 21 |
ServiceEventLog _Log = null; |
22 |
Thread _FinalPDFThread = null; |
|
23 | 22 |
string _NoticeMessageBase = null; |
24 | 23 |
string _NoticeTitleBase = null; |
25 | 24 |
string _MyIP = null; |
26 | 25 |
int _TypeName = 1; |
27 | 26 |
readonly Properties.Settings _SettingPlace = null; |
28 | 27 |
|
29 |
ConcurrentQueue<FINAL_PDF> WorkingQueue = null; |
|
30 |
List<FINAL_PDF> WaitThread = null; |
|
31 |
List<FINAL_PDF> WorkingThread = null; |
|
32 |
|
|
33 |
private Type _UploadFinalType { get; set; } /// upload final class type |
|
34 |
#endregion |
|
28 |
ConcurrentQueue<FINAL_PDF> WaitingQueue = new ConcurrentQueue<FINAL_PDF>(); |
|
29 |
List<FINAL_PDF> WorkingList = new List<FINAL_PDF>(); |
|
30 |
#endregion |
|
35 | 31 |
|
36 | 32 |
public RemFinalPDFStation() |
37 | 33 |
{ |
... | ... | |
59 | 55 |
{ |
60 | 56 |
try |
61 | 57 |
{ |
62 |
//_MyIP = System.Net.Dns.Resolve(System.Net.Dns.GetHostName()).AddressList[0].ToString(); |
|
63 | 58 |
using (KCOMDataModel.DataModel.KCOMEntities _systemEntity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString())) |
64 | 59 |
{ |
65 | 60 |
#if DEBUG |
... | ... | |
74 | 69 |
_Channel = new TcpChannel(Properties.Settings.Default.RemotingPort); |
75 | 70 |
System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(_Channel, false); |
76 | 71 |
System.Runtime.Remoting.RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemFinalPDFObject), "remFinalPDF", System.Runtime.Remoting.WellKnownObjectMode.Singleton); |
77 |
WorkingQueue = new ConcurrentQueue<FINAL_PDF>(); |
|
78 |
WorkingThread = new List<FINAL_PDF>(); |
|
79 |
WaitThread = new List<FINAL_PDF>(); |
|
80 | 72 |
} |
81 | 73 |
catch (Exception ex) |
82 | 74 |
{ |
... | ... | |
116 | 108 |
System.Runtime.Remoting.Channels.ChannelServices.UnregisterChannel(_Channel); |
117 | 109 |
} |
118 | 110 |
} |
119 |
private void FinalPDFEnqueue(FINAL_PDF pdf) |
|
111 |
|
|
112 |
/// <summary> |
|
113 |
/// 큐에 finalpdf를 넣고 작업 실행한다 |
|
114 |
/// </summary> |
|
115 |
/// <param name="pdf"></param> |
|
116 |
private void MakeMergedPDF(object pdf) |
|
120 | 117 |
{ |
121 |
Task tEnq = Task.Factory.StartNew(() => |
|
118 |
/// 동시 수행 작업 갯수가 정해진 값보다 작을 경우 쓰레드를 생성하여 작업을 수행한다 |
|
119 |
if (WorkingList.Count < Properties.Settings.Default.MultipleFinalCount) |
|
122 | 120 |
{ |
123 |
WorkingQueue.Enqueue(pdf); |
|
124 |
Thread.Sleep(100); |
|
125 |
}); |
|
126 |
FinalPDFDequeueThreadStart(); |
|
127 |
} |
|
121 |
/// 작업중인 동일한 merged pdf가 없을 경우 작업 수행 |
|
122 |
IEnumerable<FINAL_PDF> matched = WorkingList.Where(item => item.DOCUMENT_ID == ((FINAL_PDF)pdf).DOCUMENT_ID); |
|
123 |
if (matched.Count() == 0) |
|
124 |
{ |
|
125 |
lock(WorkingList) |
|
126 |
{ |
|
127 |
WorkingList.Add(pdf as FINAL_PDF); |
|
128 |
Thread.Sleep(100); |
|
129 |
}; |
|
128 | 130 |
|
129 |
private void FinalPDFDequeueThreadStart() |
|
130 |
{ |
|
131 |
_FinalPDFThread = new Thread(new ThreadStart(FinalPDFDequeueandProcessing)); |
|
132 |
_FinalPDFThread.SetApartmentState(ApartmentState.STA); |
|
133 |
_FinalPDFThread.Start(); |
|
134 |
} |
|
131 |
Thread thread = new Thread(new ParameterizedThreadStart(FinalPDFDequeueandProcessing)); |
|
132 |
thread.SetApartmentState(ApartmentState.STA); |
|
133 |
thread.Start(pdf); |
|
134 |
} |
|
135 |
else |
|
136 |
{ |
|
137 |
WaitingQueue.Enqueue((FINAL_PDF)pdf); |
|
138 |
} |
|
139 |
} |
|
140 |
else |
|
141 |
{ |
|
142 |
WaitingQueue.Enqueue((FINAL_PDF)pdf); |
|
143 |
} |
|
144 |
} |
|
135 | 145 |
|
136 |
private void FinalPDFDequeueandProcessing() |
|
146 |
/// <summary> |
|
147 |
/// 실제 Merged PDF를 생성한다 |
|
148 |
/// </summary> |
|
149 |
private void FinalPDFDequeueandProcessing(object pdf) |
|
137 | 150 |
{ |
138 | 151 |
Task tDeq = Task.Factory.StartNew(() => |
139 | 152 |
{ |
140 |
FINAL_PDF _item = null; |
|
141 | 153 |
try |
142 | 154 |
{ |
143 |
while (WorkingQueue.Count > 0) |
|
155 |
Program.FileLogger.Debug(pdf.ToString()); |
|
156 |
if (((FINAL_PDF)pdf).STATUS == (int)FinalStatus.Insert) |
|
144 | 157 |
{ |
145 |
if (WorkingQueue.TryDequeue(out _item)) |
|
158 |
/// 작업중이라고 데이타베이스에 저장한다 |
|
159 |
((FINAL_PDF)pdf).STATUS = (int)(FinalStatus.Wait); |
|
160 |
using (KCOMDataModel.DataModel.KCOMEntities _entity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString())) |
|
146 | 161 |
{ |
147 |
if (WorkingThread.Count() < Properties.Settings.Default.MultipleFinalCount) |
|
148 |
{ |
|
149 |
if (_item.STATUS == (int)FinalStatus.Insert) |
|
150 |
{ |
|
151 |
_item.STATUS = (int)(FinalStatus.Wait); |
|
152 |
using (KCOMDataModel.DataModel.KCOMEntities _entity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString())) |
|
153 |
{ |
|
154 |
var selectItem = _entity.FINAL_PDF.Where(data => data.ID == _item.ID).FirstOrDefault(); |
|
155 |
|
|
156 |
selectItem.STATUS = (int)(FinalStatus.Wait); |
|
157 |
|
|
158 |
_entity.SaveChanges(); |
|
159 |
} |
|
160 |
} |
|
161 |
var _identPathItem = WorkingThread.Where(item => item.DOCUMENT_ID == _item.DOCUMENT_ID); |
|
162 |
|
|
163 |
if (_identPathItem.Count() > 0) |
|
164 |
{ |
|
165 |
WaitThread.Add(_item); |
|
166 |
} |
|
167 |
else |
|
168 |
{ |
|
169 |
MarkupToPDF.MarkupToPDF _markuptoPDF = new MarkupToPDF.MarkupToPDF(); |
|
170 |
_markuptoPDF.FinalMakeError += new EventHandler<MarkupToPDF.MakeFinalErrorArgs>(_markuptoPDF_FinalMakeError); |
|
171 |
_markuptoPDF.EndFinal += new EventHandler<MarkupToPDF.EndFinalEventArgs>(_markuptoPDF_EndFinal); |
|
172 |
Thread _stathread = new Thread(new ParameterizedThreadStart(_markuptoPDF.MakeFinalPDF)) |
|
173 |
{ |
|
174 |
Name = _item.ID.ToString() |
|
175 |
}; |
|
176 |
SetFinalState(_item.ID, IFinalPDF.FinalStatus.Create); |
|
177 |
//_stathread.Priority = ThreadPriority.Normal; |
|
178 |
_stathread.SetApartmentState(ApartmentState.STA); |
|
179 |
_stathread.Start(_item); |
|
180 |
WorkingThread.Add(_item); |
|
181 |
} |
|
182 |
} |
|
162 |
var selectItem = _entity.FINAL_PDF.Where(data => data.ID == ((FINAL_PDF)pdf).ID).FirstOrDefault(); |
|
163 |
selectItem.STATUS = (int)(FinalStatus.Wait); |
|
164 |
_entity.SaveChanges(); |
|
183 | 165 |
} |
184 |
Thread.Sleep(100); |
|
185 | 166 |
} |
167 |
|
|
168 |
/// 작업 수행 |
|
169 |
MarkupToPDF.MarkupToPDF _markuptoPDF = new MarkupToPDF.MarkupToPDF(); |
|
170 |
_markuptoPDF.FinalMakeError += new EventHandler<MarkupToPDF.MakeFinalErrorArgs>(_markuptoPDF_FinalMakeError); |
|
171 |
_markuptoPDF.EndFinal += new EventHandler<MarkupToPDF.EndFinalEventArgs>(_markuptoPDF_EndFinal); |
|
172 |
Thread _stathread = new Thread(new ParameterizedThreadStart(_markuptoPDF.MakeFinalPDF)) |
|
173 |
{ |
|
174 |
Name = ((FINAL_PDF)pdf).ID.ToString() |
|
175 |
}; |
|
176 |
SetFinalState(((FINAL_PDF)pdf).ID, IFinalPDF.FinalStatus.Create); |
|
177 |
_stathread.SetApartmentState(ApartmentState.STA); |
|
178 |
_stathread.Start(pdf); |
|
186 | 179 |
} |
187 | 180 |
catch (Exception ex) |
188 | 181 |
{ |
189 | 182 |
Program.FileLogger.Fatal(ex); |
190 | 183 |
} |
191 |
|
|
192 | 184 |
}); |
193 | 185 |
} |
194 | 186 |
|
187 |
/// <summary> |
|
188 |
/// callback for WebService |
|
189 |
/// </summary> |
|
190 |
/// <param name="ProjectNo"></param> |
|
191 |
/// <param name="FinalID"></param> |
내보내기 Unified diff