프로젝트

일반

사용자정보

개정판 abaa85b4

IDabaa85b44d765caf5e64dc0f50c0cac02bd5f9e6
상위 1fdcd6ff
하위 e25875e0, 476b7d4f

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

issue #1022 wcf 수정 및 final service 직접 접근 수정.

Change-Id: Iab45b6919293bf86848d3e5fa9768fae3f794410

차이점 보기:

FinalService/KCOM_FinalService/ConsoleApp1/Program.cs
2 2
using KCOMDataModel;
3 3
using KCOMDataModel.Common;
4 4
using KCOMDataModel.DataModel;
5
using MarkupToPDF.Common;
5 6
using System;
6 7
using System.Collections.Generic;
7 8
using System.IO;
......
47 48
                Console.WriteLine("Test Process...");
48 49
                Console.WriteLine("Insert Final PDF id :");
49 50
                string inputstr = Console.ReadLine();
50
                using (KCOMEntities _entity = new KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString()))
51
                using (DataController dc = new DataController())
51 52
                {
52
                    //FINAL_PDF item = _entity.FINAL_PDF.Where(d => d.ID == "ngKwBgMotw8d56dea3839120d").FirstOrDefault();
53
                    FINAL_PDF item = _entity.FINAL_PDF.Where(d => d.ID == inputstr).FirstOrDefault();
54
                    if (item != null)
53
                    var finals = dc.GetFinalpdfs(inputstr);
54
                    if(finals.Count > 0)
55 55
                    {
56 56
                        Console.WriteLine("final pdf start");
57 57
                        MarkupToPDF.MarkupToPDF pdf = new MarkupToPDF.MarkupToPDF();
58 58
                        pdf.EndFinal += Pdf_EndFinal;
59
                        pdf.FinalMakeError += Pdf_FinalMakeError;
60
                        //pdf.MakeFinalPDF(_entity.FINAL_PDF.FirstOrDefault());
61
                        pdf.MakeFinalPDF(item);
62
                        //_Thread.Add(item);
59
                        pdf.FinalMakeError += Pdf_FinalMakeError;                        
60
                        pdf.MakeFinalPDF(finals[0]);
63 61
                    }
64 62
                    else
65 63
                    {
66 64
                        Console.WriteLine("item is null");
67 65
                    }
68

  
69
                }
66
                }                
70 67

  
71 68
            }
72 69
            catch (Exception ex)
......
80 77
        {
81 78
            
82 79
        }
83
        static List<FINAL_PDF> _Thread = new List<FINAL_PDF>();
80
        static List<CommonLib.MARKUS_API.FINAL_PDF> _Thread = new List<CommonLib.MARKUS_API.FINAL_PDF>();
84 81
        private static void Pdf_EndFinal(object sender, MarkupToPDF.EndFinalEventArgs e)
85 82
        {
86
            FINAL_PDF _item = (sender as MarkupToPDF.MarkupToPDF).FinalItem;
83
            CommonLib.MARKUS_API.FINAL_PDF _item = (sender as MarkupToPDF.MarkupToPDF).FinalItem;
87 84

  
88 85
            SetFinalState(_item.ID, FinalStatus.PdfStamp);
89 86

  
90 87
            try
91 88
            {
92 89
                Console.WriteLine("final pdf end");
93
                string soapurl = string.Empty;
94
                using (KCOMDataModel.DataModel.KCOMEntities _systemEntity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString()))
95
                {
96
                    var item = _systemEntity.PROPERTIES.Where(data => data.TYPE == "UpLoadServiceUrl").FirstOrDefault();
97
                    if (item != null) soapurl = item.VALUE;
98
                }
90
                string soapurl = CommonLib.Common.GetConfigString("UpLoadServiceUrl", "URL", "");
99 91
                Console.WriteLine("soapurl:"+soapurl);
100 92
                if (!string.IsNullOrEmpty(soapurl))
101 93
                {
......
126 118

  
127 119
                    //this._Log.Write(String.Format("saveFolder : {0}", saveFolder) + DateTime.Now);
128 120
                    System.IO.File.Copy(e.FinalPDFPath, saveFolder + e.OriginPDFName, true);
129

  
130
                    using (CIEntities _entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(_item.PROJECT_NO).ToString()))
121
                    using (DataController dataController = new DataController())
131 122
                    {
132
                        var item = _entity.DOCUMENT_ITEM.Where(d => d.DOCUMENT_ID == _item.DOCUMENT_ID).FirstOrDefault();
133
                        ///TODO: RESULT FILE 경로 위치를 configuration으로 빼주세요
134
                        ///Local Test 용 result url
135
                        
136 123
                        string resultpath = CommonLib.Common.GetConfigString("DebugResultUrlPath", "URL", "");
137
                        item.RESULT_FILE = String.Format(resultpath.ToString(), _item.PROJECT_NO, Convert.ToInt32(_item.DOCUMENT_ID) / 100, _item.DOCUMENT_ID, e.OriginPDFName);
124
                        string url = String.Format(resultpath, _item.PROJECT_NO, Convert.ToInt32(_item.DOCUMENT_ID) / 100, _item.DOCUMENT_ID, e.OriginPDFName);
125
                        var result = dataController.SetFinalPDFUrl(_item.PROJECT_NO, _item.DOCUMENT_ID, url);
138 126

  
139
                        //sendReqLog("RESULT_FILE_PATH", item.RESULT_FILE);
140
                        _entity.SaveChanges();
141 127
                        SetFinalState(_item.ID, FinalStatus.Success);
142
                        //_Thread.Remove(_T.First());
143
                    }
128
                    }                    
144 129
                }
145 130
            }
146 131
            catch (Exception ex)

내보내기 Unified diff

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