개정판 e05bed4e
issue #000 connectionString App.Config -> ini move , daelim final service setupfile add
Change-Id: I62de9b0cdbd79173f7da663a4ea897433de2849e
FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.cs | ||
---|---|---|
13 | 13 |
using System.Net; |
14 | 14 |
using System.Runtime.InteropServices; |
15 | 15 |
using System.Text; |
16 |
using System.Web; |
|
16 | 17 |
using System.Windows; |
17 | 18 |
using System.Windows.Media; |
18 | 19 |
|
... | ... | |
77 | 78 |
|
78 | 79 |
private string GetFileName(string hrefLink) |
79 | 80 |
{ |
80 |
return System.IO.Path.GetFileName(hrefLink.Replace("/", "\\")); |
|
81 |
try |
|
82 |
{ |
|
83 |
if (hrefLink.Contains("vpcs_doclib")) |
|
84 |
{ |
|
85 |
return System.IO.Path.GetFileName(hrefLink.Replace("/", "\\")); |
|
86 |
} |
|
87 |
else |
|
88 |
{ |
|
89 |
Uri fileurl = new Uri(hrefLink); |
|
90 |
int index = hrefLink.IndexOf("?"); |
|
91 |
string filename = HttpUtility.ParseQueryString(fileurl.Query).Get("fileName"); |
|
92 |
return filename; |
|
93 |
} |
|
94 |
} |
|
95 |
catch (Exception ex) |
|
96 |
{ |
|
97 |
throw ex; |
|
98 |
} |
|
81 | 99 |
} |
82 | 100 |
|
83 | 101 |
public Point GetPdfPointSystem(Point point) |
... | ... | |
211 | 229 |
#region 파일 체크 |
212 | 230 |
if (_files.Count() == 1) |
213 | 231 |
{ |
214 |
if (_files.First().Name.ToLower() == GetFileName(documentItem.ORIGINAL_FILE).ToLower())
|
|
232 |
if (_files.First().Name.ToLower() == GetFileName(HttpUtility.UrlDecode(documentItem.ORIGINAL_FILE).ToLower()))
|
|
215 | 233 |
{ |
216 | 234 |
OriginFileName = _files.First().Name; |
217 | 235 |
PdfFilePath = _files.First().CopyTo(TestFile, true); |
218 | 236 |
} |
219 | 237 |
else |
220 | 238 |
{ |
221 |
throw new Exception("현재 폴더 내 파일명이 데이터베이스와 상이합니다");
|
|
239 |
throw new Exception("현재 폴더 내 파일명이 데이터베이스와 상이합니다.filename:" + _files.First().Name.ToLower() + ",url:" + HttpUtility.UrlDecode(documentItem.ORIGINAL_FILE).ToLower());
|
|
222 | 240 |
} |
223 | 241 |
} |
224 | 242 |
else if (_files.Count() > 1) |
225 | 243 |
{ |
226 |
var originalFile = _files.Where(data => data.Name == GetFileName(documentItem.ORIGINAL_FILE)).FirstOrDefault();
|
|
244 |
var originalFile = _files.Where(data => data.Name == GetFileName(HttpUtility.UrlDecode(documentItem.ORIGINAL_FILE))).FirstOrDefault();
|
|
227 | 245 |
|
228 | 246 |
if (originalFile == null) |
229 | 247 |
{ |
... | ... | |
299 | 317 |
EndFinal(this, new EndFinalEventArgs |
300 | 318 |
{ |
301 | 319 |
OriginPDFName = OriginFileName, |
302 |
FinalPDFPath = _FinalPDFStorgeRemote + "\\" + FinalPDFPath.Name,
|
|
320 |
FinalPDFPath = FinalPDFPath.FullName,
|
|
303 | 321 |
Error = "", |
304 | 322 |
Message = "", |
305 | 323 |
FinalPDF = FinalPDF, |
... | ... | |
1024 | 1042 |
SolidColorBrush FontColor = _SetColor; |
1025 | 1043 |
double Angle = control.Angle; |
1026 | 1044 |
double Opacity = control.Opac; |
1027 |
|
|
1028 |
StringBuilder ApprovedImgPath = new StringBuilder(512); |
|
1029 |
GetPrivateProfileString("ApprovedImgPath", "URL", "(NONE)", ApprovedImgPath, 512, Path.Combine(AppDataFolder, "FinalService.ini")); |
|
1030 |
|
|
1031 |
Controls_PDF.HoneyPDFLib_DrawSet_Symbol.DrawApproval(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, ApprovedImgPath.ToString()); |
|
1045 |
|
|
1046 |
string imgpath = CommonLib.Common.GetConfigString("ApprovedImgPath", "URL", ""); |
|
1047 |
Controls_PDF.HoneyPDFLib_DrawSet_Symbol.DrawApproval(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, imgpath); |
|
1032 | 1048 |
} |
1033 | 1049 |
break; |
1034 | 1050 |
case "SymControl": |
... | ... | |
1040 | 1056 |
SolidColorBrush FontColor = _SetColor; |
1041 | 1057 |
double Angle = control.Angle; |
1042 | 1058 |
double Opacity = control.Opac; |
1043 |
|
|
1044 |
StringBuilder imgpath = new StringBuilder(512); |
|
1045 |
GetPrivateProfileString("CheckmarkImgPath", "URL", "(NONE)", imgpath, 512, Path.Combine(AppDataFolder, "FinalService.ini")); |
|
1046 |
|
|
1047 |
Controls_PDF.HoneyPDFLib_DrawSet_Symbol.DrawCheckMark(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, imgpath.ToString()); |
|
1059 |
|
|
1060 |
string imgpath = CommonLib.Common.GetConfigString("ApprovedImgPath", "URL", ""); |
|
1061 |
Controls_PDF.HoneyPDFLib_DrawSet_Symbol.DrawCheckMark(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, imgpath); |
|
1048 | 1062 |
} |
1049 | 1063 |
break; |
1050 | 1064 |
#endregion |
... | ... | |
1097 | 1111 |
FinalPDFPath = new FileInfo(pdfFilePath); |
1098 | 1112 |
|
1099 | 1113 |
///TODO : 복사할 경로를 configuration으로 빼주세요 |
1100 |
//File.Move(FinalPDFPath.FullName, @"\\192.168.0.67\finalpdf\" + FinalPDFPath.Name.Replace(".tmp", ".pdf")); |
|
1101 |
//FinalPDFPath = new FileInfo(@"\\192.168.0.67\finalpdf\" + FinalPDFPath.Name.Replace(".tmp", ".pdf")); |
|
1102 |
StringBuilder PDFMovePath = new StringBuilder(512); |
|
1103 |
GetPrivateProfileString("PDFMovePath", "URL", "(NONE)", PDFMovePath, 512, Path.Combine(AppDataFolder, "FinalService.ini")); |
|
1104 |
File.Move(FinalPDFPath.FullName, PDFMovePath.ToString() + FinalPDFPath.Name.Replace(".tmp", ".pdf")); |
|
1105 |
FinalPDFPath = new FileInfo(PDFMovePath.ToString() + FinalPDFPath.Name.Replace(".tmp", ".pdf")); |
|
1114 |
|
|
1115 |
string pdfmovepath = CommonLib.Common.GetConfigString("PDFMovePath", "URL", ""); |
|
1116 |
File.Move(FinalPDFPath.FullName, pdfmovepath + FinalPDFPath.Name.Replace(".tmp", ".pdf")); |
|
1117 |
FinalPDFPath = new FileInfo(pdfmovepath + FinalPDFPath.Name.Replace(".tmp", ".pdf")); |
|
1106 | 1118 |
|
1107 | 1119 |
try |
1108 | 1120 |
{ |
... | ... | |
1129 | 1141 |
public void Dispose() |
1130 | 1142 |
{ |
1131 | 1143 |
throw new NotImplementedException(); |
1132 |
} |
|
1133 |
|
|
1134 |
[DllImport("kernel32")] |
|
1135 |
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath); |
|
1136 |
|
|
1137 |
public static string AppDataFolder |
|
1138 |
{ |
|
1139 |
get |
|
1140 |
{ |
|
1141 |
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MARKUS"); |
|
1142 |
} |
|
1143 |
} |
|
1144 |
} |
|
1144 | 1145 |
|
1145 | 1146 |
#endregion |
1146 | 1147 |
} |
내보내기 Unified diff