프로젝트

일반

사용자정보

개정판 cd172bb8

IDcd172bb80968f2f09bb474fbc1c36014dca3ee26
상위 101da246
하위 6a075b89, 4e96dfb4

김동진이(가) 5년 이상 전에 추가함

issue #000 final service test

Change-Id: I86b3524150cd3a0fdb064f361442b6d45cc5e10b

차이점 보기:

FinalService/KCOM_FinalService/CommonLib/Common.cs
1
using System;
2
using System.Collections.Generic;
3
using System.IO;
4
using System.Linq;
5
using System.Runtime.InteropServices;
6
using System.Text;
7
using System.Threading.Tasks;
8

  
9
namespace CommonLib
10
{
11
    public class Common
12
    {
13
        [DllImport("kernel32")]
14
        public static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
15

  
16
        public static string AppDataFolder
17
        {
18
            get
19
            {
20
                return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MARKUS");
21
            }
22
        }
23
    }
24
}
FinalService/KCOM_FinalService/CommonLib/CommonLib.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>{EE9AAABC-1678-43A4-878E-CEDBB577CF01}</ProjectGuid>
8
    <OutputType>Library</OutputType>
9
    <AppDesignerFolder>Properties</AppDesignerFolder>
10
    <RootNamespace>CommonLib</RootNamespace>
11
    <AssemblyName>CommonLib</AssemblyName>
12
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
13
    <FileAlignment>512</FileAlignment>
14
    <Deterministic>true</Deterministic>
15
  </PropertyGroup>
16
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
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
  </PropertyGroup>
25
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
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.Xml.Linq" />
37
    <Reference Include="System.Data.DataSetExtensions" />
38
    <Reference Include="Microsoft.CSharp" />
39
    <Reference Include="System.Data" />
40
    <Reference Include="System.Xml" />
41
  </ItemGroup>
42
  <ItemGroup>
43
    <Compile Include="Common.cs" />
44
    <Compile Include="Properties\AssemblyInfo.cs" />
45
  </ItemGroup>
46
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
47
</Project>
FinalService/KCOM_FinalService/CommonLib/Properties/AssemblyInfo.cs
1
using System.Reflection;
2
using System.Runtime.CompilerServices;
3
using System.Runtime.InteropServices;
4

  
5
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 
6
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
7
// 이러한 특성 값을 변경하세요.
8
[assembly: AssemblyTitle("CommonLib")]
9
[assembly: AssemblyDescription("")]
10
[assembly: AssemblyConfiguration("")]
11
[assembly: AssemblyCompany("")]
12
[assembly: AssemblyProduct("CommonLib")]
13
[assembly: AssemblyCopyright("Copyright ©  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("ee9aaabc-1678-43a4-878e-cedbb577cf01")]
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_Watcher/FinalService_Watcher.cs
8 8
using System.Text;
9 9
using System.Runtime.Remoting.Channels;
10 10
using System.Runtime.Remoting.Channels.Tcp;
11
using System.IO;
11 12

  
12 13
namespace FinalService_Watcher
13 14
{
......
17 18
        {
18 19
            InitializeComponent();
19 20

  
21
            System.Text.StringBuilder monitorservicename = new System.Text.StringBuilder(512);
22
            CommonLib.Common.GetPrivateProfileString("FinalServiceName", "NAME", "FinalService", monitorservicename, 512, Path.Combine(CommonLib.Common.AppDataFolder, "FinalService.ini"));
23
            _controller = new ServiceController(monitorservicename.ToString());
20 24
            this.EventLog.Source = this.ServiceName;
21 25
            this.EventLog.Log = "Application";
22 26

  
......
29 33

  
30 34
        System.Timers.Timer _Timer = new System.Timers.Timer();
31 35
        //ServiceController _controller = new ServiceController("ConverterStation");
32
        ServiceController _controller = new ServiceController("FinalStation");
36

  
37
        ServiceController _controller = null;
33 38

  
34 39
        protected override void OnStart(string[] args)
35 40
        {
FinalService/KCOM_FinalService/FinalService_Watcher/FinalService_Watcher.csproj
62 62
    </Compile>
63 63
  </ItemGroup>
64 64
  <ItemGroup>
65
    <ProjectReference Include="..\CommonLib\CommonLib.csproj">
66
      <Project>{ee9aaabc-1678-43a4-878e-cedbb577cf01}</Project>
67
      <Name>CommonLib</Name>
68
    </ProjectReference>
65 69
    <ProjectReference Include="..\EmailClient\EmailClient.csproj">
66 70
      <Project>{50EBCC06-AB49-4C8F-A4C4-1A7520AC2F2D}</Project>
67 71
      <Name>EmailClient</Name>
FinalService/KCOM_FinalService/KCOM_FinalService.sln
4 4
VisualStudioVersion = 15.0.27130.2010
5 5
MinimumVisualStudioVersion = 10.0.40219.1
6 6
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KCOM_FinalService", "KCOM_FinalService\KCOM_FinalService.csproj", "{2BE3F054-D494-4712-927F-47E2FFB52170}"
7
	ProjectSection(ProjectDependencies) = postProject
8
		{78839E61-B116-4AB2-B358-FF4FB19090EF} = {78839E61-B116-4AB2-B358-FF4FB19090EF}
9
		{EE9AAABC-1678-43A4-878E-CEDBB577CF01} = {EE9AAABC-1678-43A4-878E-CEDBB577CF01}
10
	EndProjectSection
7 11
EndProject
8 12
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KCOMDataModel", "KCOMDataModel\KCOMDataModel.csproj", "{629DC8CD-D458-47EF-8F02-CD12C7001C3E}"
9 13
EndProject
......
17 21
EndProject
18 22
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FinalService_Watcher", "FinalService_Watcher\FinalService_Watcher.csproj", "{78839E61-B116-4AB2-B358-FF4FB19090EF}"
19 23
EndProject
24
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonLib", "CommonLib\CommonLib.csproj", "{EE9AAABC-1678-43A4-878E-CEDBB577CF01}"
25
EndProject
20 26
Global
21 27
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
22 28
		Debug|Any CPU = Debug|Any CPU
......
100 106
		{9CF3737A-E04D-4A55-924E-C88725DFBEC7}.Release|x86.ActiveCfg = Release|Any CPU
101 107
		{9CF3737A-E04D-4A55-924E-C88725DFBEC7}.Release|x86.Build.0 = Release|Any CPU
102 108
		{78839E61-B116-4AB2-B358-FF4FB19090EF}.Debug|Any CPU.ActiveCfg = Debug|x86
109
		{78839E61-B116-4AB2-B358-FF4FB19090EF}.Debug|Any CPU.Build.0 = Debug|x86
103 110
		{78839E61-B116-4AB2-B358-FF4FB19090EF}.Debug|x64.ActiveCfg = Debug|x86
111
		{78839E61-B116-4AB2-B358-FF4FB19090EF}.Debug|x64.Build.0 = Debug|x86
104 112
		{78839E61-B116-4AB2-B358-FF4FB19090EF}.Debug|x86.ActiveCfg = Debug|x86
105 113
		{78839E61-B116-4AB2-B358-FF4FB19090EF}.Debug|x86.Build.0 = Debug|x86
106 114
		{78839E61-B116-4AB2-B358-FF4FB19090EF}.Release|Any CPU.ActiveCfg = Release|x86
107 115
		{78839E61-B116-4AB2-B358-FF4FB19090EF}.Release|x64.ActiveCfg = Release|x86
108 116
		{78839E61-B116-4AB2-B358-FF4FB19090EF}.Release|x86.ActiveCfg = Release|x86
109 117
		{78839E61-B116-4AB2-B358-FF4FB19090EF}.Release|x86.Build.0 = Release|x86
118
		{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
119
		{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Debug|Any CPU.Build.0 = Debug|Any CPU
120
		{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Debug|x64.ActiveCfg = Debug|Any CPU
121
		{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Debug|x64.Build.0 = Debug|Any CPU
122
		{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Debug|x86.ActiveCfg = Debug|Any CPU
123
		{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Debug|x86.Build.0 = Debug|Any CPU
124
		{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Release|Any CPU.ActiveCfg = Release|Any CPU
125
		{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Release|Any CPU.Build.0 = Release|Any CPU
126
		{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Release|x64.ActiveCfg = Release|Any CPU
127
		{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Release|x64.Build.0 = Release|Any CPU
128
		{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Release|x86.ActiveCfg = Release|Any CPU
129
		{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Release|x86.Build.0 = Release|Any CPU
110 130
	EndGlobalSection
111 131
	GlobalSection(SolutionProperties) = preSolution
112 132
		HideSolutionNode = FALSE
FinalService/KCOM_FinalService/KCOM_FinalService/KCOM_FinalService.csproj
62 62
    <Compile Include="Remoting\RemFinalPDFStation.cs" />
63 63
  </ItemGroup>
64 64
  <ItemGroup>
65
    <ProjectReference Include="..\CommonLib\CommonLib.csproj">
66
      <Project>{ee9aaabc-1678-43a4-878e-cedbb577cf01}</Project>
67
      <Name>CommonLib</Name>
68
    </ProjectReference>
65 69
    <ProjectReference Include="..\IFinalPDF\IFinalPDF.csproj">
66 70
      <Project>{784438be-2074-41ae-a692-24e1a4a67fe3}</Project>
67 71
      <Name>IFinalPDF</Name>
FinalService/KCOM_FinalService/KCOM_FinalService/Remoting/RemFinalPDFStation.cs
211 211
                    using (KCOMDataModel.DataModel.KCOMEntities _systemEntity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString()))
212 212
                    {
213 213
                        var item = _systemEntity.PROPERTIES.Where(data => data.TYPE == "UpLoadServiceUrl").FirstOrDefault();
214
                        soapurl = item.VALUE;
214
                        if(item != null)
215
                            soapurl = item.VALUE;
215 216
                    }
216 217
                    if(!string.IsNullOrEmpty(soapurl))
217 218
                    {
......
231 232
                    else
232 233
                    {
233 234
                        ///TODO: 저장할 폴더 위치를 configuration으로 빼주세요
234
                        string saveFolder = String.Format(Properties.Settings.Default.saveFileFolder, _item.PROJECT_NO, Convert.ToInt32(_item.DOCUMENT_ID) / 100, _item.DOCUMENT_ID);
235
                        System.Text.StringBuilder pdfsavepath = new System.Text.StringBuilder(512);
236
                        CommonLib.Common.GetPrivateProfileString("DebugSavePath", "URL", "(NONE)", pdfsavepath, 512, Path.Combine(CommonLib.Common.AppDataFolder, "FinalService.ini"));
237

  
238

  
239
                        string saveFolder = String.Format(pdfsavepath.ToString(), _item.PROJECT_NO, Convert.ToInt32(_item.DOCUMENT_ID) / 100, _item.DOCUMENT_ID);
235 240
                        if (!System.IO.Directory.Exists(saveFolder))
236 241
                        {
237 242
                            System.IO.Directory.CreateDirectory(saveFolder);
238 243
                        }
239 244

  
240 245
                        this._Log.Write(String.Format("saveFolder : {0}", saveFolder) + DateTime.Now);
241
                        System.IO.File.Copy(e.FinalPDFPath, saveFolder + e.OriginPDFName, true);
246
                        try
247
                        {
248
                            System.IO.File.Copy(e.FinalPDFPath, saveFolder + e.OriginPDFName, true);
249
                        }
250
                        catch (Exception)
251
                        {
252
                            _Log.Write("e.FinalPDFPath:" + e.FinalPDFPath+ ",saveFolder:" + saveFolder+ ",e.OriginPDFName:" + e.OriginPDFName);
253
                        }                        
242 254

  
243 255
                        using (CIEntities _entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(_item.PROJECT_NO).ToString()))
244 256
                        {
245 257
                            var item = _entity.DOCUMENT_ITEM.Where(d => d.DOCUMENT_ID == _item.DOCUMENT_ID).FirstOrDefault();
246 258
                            ///TODO: RESULT FILE 경로 위치를 configuration으로 빼주세요
247
                            item.RESULT_FILE = String.Format(Properties.Settings.Default.resultFileFolder, _item.PROJECT_NO, Convert.ToInt32(_item.DOCUMENT_ID) / 100, _item.DOCUMENT_ID, e.OriginPDFName);
248
                            //@"http://cloud.devdoftech.co.kr:5977/FinalPDF/{0}_app/VPCS_DOCLIB/{1}/{2}/ToVendor/{3}"
259
                            System.Text.StringBuilder resultFileFolder = new System.Text.StringBuilder(512);
260
                            CommonLib.Common.GetPrivateProfileString("DebugResultUrlPath", "URL", "(NONE)", resultFileFolder, 512, Path.Combine(CommonLib.Common.AppDataFolder, "FinalService.ini"));
261
                            item.RESULT_FILE = String.Format(resultFileFolder.ToString(), _item.PROJECT_NO, Convert.ToInt32(_item.DOCUMENT_ID) / 100, _item.DOCUMENT_ID, e.OriginPDFName);
249 262
                            sendReqLog("RESULT_FILE_PATH", item.RESULT_FILE);
250 263
                            _entity.SaveChanges();
251 264
                            SetFinalState(_item.ID, FinalStatus.Success);

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)