개정판 6c45db59
autoupdate setup 수정
Change-Id: Ib142366f183244e817361d5a39a1973a63f7d756
FinalService/KCOM_FinalService/UploadFinal/UploadPDF.cs | ||
---|---|---|
10 | 10 |
using System.Data.SqlClient; |
11 | 11 |
using KCOMDataModel.DataModel; |
12 | 12 |
using KCOMDataModel.Common; |
13 |
using log4net; |
|
14 |
|
|
13 | 15 |
namespace UploadFinal |
14 | 16 |
{ |
15 | 17 |
public class UploadFinal |
16 | 18 |
{ |
17 |
|
|
19 |
public static ILog Logger = null; |
|
20 |
|
|
18 | 21 |
public static KeyValuePair<bool, string> UploadFinalPDF(string PdfFilePath, string OriginFileName, FINAL_PDF FinalPDF, string UploadServiceUrl) |
19 |
{ |
|
22 |
{ |
|
23 |
Logger = LogManager.GetLogger(typeof(UploadFinal)); |
|
24 |
|
|
20 | 25 |
string _vendorItemId = null; |
21 | 26 |
string _objid = null; |
22 | 27 |
string _SharepointItemID = null; |
... | ... | |
51 | 56 |
|
52 | 57 |
WebClient webClient = new WebClient(); |
53 | 58 |
string data = string.Empty; |
59 |
|
|
60 |
Logger.Info($"doc Uri :{docurl}"); |
|
61 |
|
|
54 | 62 |
if (docurl.ToUpper().Contains("VPCS_DOCLIB")) |
55 | 63 |
{ |
56 | 64 |
string connectionString = "data source=ESB-DB;Initial Catalog=markus;uid=ProjectPortalDBConn;password=ProjectPortalDBConn"; |
... | ... | |
85 | 93 |
sqlConn.Close(); |
86 | 94 |
UploadServiceUrl = "http://esb-vpcs-new.daelimplant.com/ProjectPortal/UserControls/DaelimCI2/FinalPDFUpload/UploadVpcsFile.asmx"; |
87 | 95 |
|
96 |
string finalpdfroot = CommonLib.Common.GetConfigString("FinalPDFRootUrl", "URL", ""); |
|
97 |
|
|
98 |
if (!string.IsNullOrEmpty(finalpdfroot)) |
|
99 |
{ |
|
100 |
string filename = Path.GetFileName(PdfFilePath); |
|
101 |
PdfFilePath = !string.IsNullOrEmpty(finalpdfroot) ? finalpdfroot + filename : filename; |
|
102 |
} |
|
103 |
|
|
104 |
Logger.Info($"UploadServiceUrl :{UploadServiceUrl}"); |
|
105 |
|
|
88 | 106 |
data = "<soap12:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap12=\"http://www.w3.org/2003/05/soap-envelope\" ><soap12:Body><UploadFinalPDF xmlns=\"http://FinalPDFUpload\">" |
89 | 107 |
+ "<ProjectNo>" + FinalPDF.PROJECT_NO + "</ProjectNo>" |
90 | 108 |
+ "<VendorItemID>" + _objid + "</VendorItemID>" |
91 | 109 |
+ "<SlipNumber>" + _slipNO + "</SlipNumber>" |
92 | 110 |
+ "<filePath>" + PdfFilePath + "</filePath>" |
93 | 111 |
+ "<OriginFileName>" + OriginFileName + "</OriginFileName></UploadFinalPDF></soap12:Body></soap12:Envelope>"; |
94 |
|
|
112 |
|
|
113 |
Logger.Info($"PROJECT_NO :{FinalPDF.PROJECT_NO}"); |
|
114 |
Logger.Info($"FinalPDF. :{_objid}"); |
|
115 |
Logger.Info($"SlipNumber :{_slipNO}"); |
|
116 |
Logger.Info($"filePath :{PdfFilePath}"); |
|
117 |
Logger.Info($"OriginFileName :{OriginFileName}"); |
|
118 |
|
|
95 | 119 |
//WriteLog(data); |
96 | 120 |
webClient.Headers.Add(HttpRequestHeader.ContentType, "application/soap+xml; charset=utf-8"); |
97 | 121 |
webClient.Headers.Add("SOAPAction", "http://FinalPDFUpload/UploadFinalPDF"); |
... | ... | |
136 | 160 |
} |
137 | 161 |
else |
138 | 162 |
{ |
163 |
Logger.Info($"UploadServiceUrl :{UploadServiceUrl}"); |
|
139 | 164 |
// 앙상블+는 파일명만 전달함 |
165 |
|
|
166 |
string finalpdfroot = CommonLib.Common.GetConfigString("FinalPDFRootUrl", "URL", ""); |
|
167 |
|
|
140 | 168 |
PdfFilePath = PdfFilePath.Split('/').Last(); |
141 | 169 |
|
170 |
if (PdfFilePath.StartsWith(finalpdfroot)) |
|
171 |
{ |
|
172 |
PdfFilePath = PdfFilePath.Split('\\').Last(); |
|
173 |
} |
|
174 |
|
|
142 | 175 |
data = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ens=\"http://EnsemblePlus.Webservice\"> <soapenv:Header/> <soapenv:Body> <ens:fnFinalPDFCheckInService>" |
143 | 176 |
+ "<ens:ProjectNo>" + FinalPDF.PROJECT_NO + "</ens:ProjectNo>" |
144 | 177 |
+ "<ens:ObjectId>" + _objid + "</ens:ObjectId>" |
... | ... | |
147 | 180 |
+ "<ens:OriginalFileName>" + OriginFileName + "</ens:OriginalFileName>" |
148 | 181 |
+ "</ens:fnFinalPDFCheckInService> </soapenv:Body></soapenv:Envelope>"; |
149 | 182 |
|
183 |
Logger.Info($"PROJECT_NO :{FinalPDF.PROJECT_NO}"); |
|
184 |
Logger.Info($"FinalPDF. :{_objid}"); |
|
185 |
Logger.Info($"SlipNumber :{_slipNO}"); |
|
186 |
Logger.Info($"filePath :{PdfFilePath}"); |
|
187 |
Logger.Info($"OriginFileName :{OriginFileName}"); |
|
188 |
|
|
150 | 189 |
webClient.Headers.Add(HttpRequestHeader.ContentType, "text/xml"); |
151 | 190 |
webClient.Headers.Add("SOAPAction", "http://EnsemblePlus.Webservice"); |
152 | 191 |
webClient.Encoding = System.Text.Encoding.UTF8; |
내보내기 Unified diff