개정판 e77fc685
finalservice 코드 정리 및 오류 수정
Change-Id: I4165d5e2bc070a961a565fa6fbdaf477efde41d4
ConvertService/ServiceBase/Markus.Service.Convert/ConvertService.cs | ||
---|---|---|
222 | 222 |
if(gMarkusPDF.PageCount() > 0) |
223 | 223 |
{ |
224 | 224 |
/// 설정된 MultiThreadMaxPages에 따른 컨버터 분기 |
225 |
if (gMarkusPDF.PageCount() > ConvertProcessContext.MultiThreadMaxPages) |
|
226 |
{ |
|
227 |
// 큰 사이즈의 파일 컨버팅 |
|
228 |
result = ConvertBigFileProcess(saveitem);
|
|
229 |
} |
|
230 |
else |
|
231 |
{ |
|
232 |
/// 작은 사이즈의 컨버팅 |
|
233 |
await Task.Factory.StartNew(new Action(() => |
|
234 |
{ |
|
235 |
result = gSaveTask.SaveFile(saveitem); |
|
236 |
}), TaskCreationOptions.LongRunning); |
|
237 |
} |
|
225 |
//if (gMarkusPDF.PageCount() > ConvertProcessContext.MultiThreadMaxPages)
|
|
226 |
//{
|
|
227 |
// // 큰 사이즈의 파일 컨버팅
|
|
228 |
result = ConvertBigFileProcess(saveitem); |
|
229 |
//}
|
|
230 |
//else
|
|
231 |
//{
|
|
232 |
// /// 작은 사이즈의 컨버팅
|
|
233 |
// await Task.Factory.StartNew(new Action(() =>
|
|
234 |
// {
|
|
235 |
// result = gSaveTask.SaveFile(saveitem);
|
|
236 |
// }), TaskCreationOptions.LongRunning);
|
|
237 |
//}
|
|
238 | 238 |
|
239 | 239 |
// 파일 체크 후 갯수가 안맞으면 다시 컨버팅한다. |
240 | 240 |
if (ReConvert < 1 && (result.PageInfoList.Count() != saveitem.TotalPages |
... | ... | |
477 | 477 |
Console.WriteLine($"CurrentPage : {currentPageNo}"); |
478 | 478 |
|
479 | 479 |
/// 설정된 최대 페이지이거나 설정된 메모리보다 크면 릴리즈 |
480 |
if (currentPageNo % ConvertProcessContext.MultiThreadMaxPages == 0 || ConvertProcessContext.ReleaseWorkMemory < Environment.WorkingSet) |
|
480 |
if ((currentPageNo % ConvertProcessContext.MultiThreadMaxPages == 0 && ConvertProcessContext.MultiThreadMaxPages > 0) |
|
481 |
|| ConvertProcessContext.ReleaseWorkMemory < Environment.WorkingSet) |
|
481 | 482 |
{ |
482 | 483 |
Console.WriteLine($"physical memory : {Environment.WorkingSet}"); |
483 | 484 |
|
FinalService/KCOM_FinalService/CommonLib/Common.cs | ||
---|---|---|
18 | 18 |
{ |
19 | 19 |
get |
20 | 20 |
{ |
21 |
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MARKUS"); |
|
21 |
return AppDomain.CurrentDomain.BaseDirectory; |
|
22 |
//return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MARKUS"); |
|
22 | 23 |
} |
23 | 24 |
} |
24 | 25 |
public static string GetConfigString(string section, string key, string def) |
FinalService/KCOM_FinalService/KCOM_FinalService/Program.cs | ||
---|---|---|
28 | 28 |
public static MethodInfo UploadFinalPDFMethod { get; set; } |
29 | 29 |
public static object UploadFinalPDFInst { get; set; } |
30 | 30 |
|
31 |
static MarkusFinalService service = new MarkusFinalService();
|
|
31 |
static MarkusFinalService service; |
|
32 | 32 |
|
33 | 33 |
/// <summary> |
34 | 34 |
/// The main entry point for the application. |
... | ... | |
56 | 56 |
|
57 | 57 |
try |
58 | 58 |
{ |
59 |
service.TestStartupAndStop(args); |
|
59 |
|
|
60 |
if (Environment.UserInteractive) |
|
61 |
{ |
|
62 |
service = new MarkusFinalService(); |
|
63 |
service.TestStartupAndStop(args); |
|
64 |
} |
|
65 |
else |
|
66 |
{ |
|
67 |
/// up to here |
|
68 |
ServicesToRun = new ServiceBase[] |
|
69 |
{ |
|
70 |
new MarkusFinalService() |
|
71 |
}; |
|
72 |
ServiceBase.Run(ServicesToRun); |
|
73 |
} |
|
60 | 74 |
} |
61 | 75 |
catch (Exception ex) |
62 | 76 |
{ |
FinalService/KCOM_FinalService/KCOM_FinalService/Remoting/RemFinalPDFStation.cs | ||
---|---|---|
265 | 265 |
try |
266 | 266 |
{ |
267 | 267 |
string soapurl = CommonLib.Common.GetConfigString("UpLoadServiceUrl", "URL", ""); |
268 |
string finalpdfroot = CommonLib.Common.GetConfigString("FinalPDFRootUrl", "URL", ""); |
|
269 |
string filename = Path.GetFileName(e.FinalPDFPath); |
|
270 |
string pdfpath = !string.IsNullOrEmpty(finalpdfroot) ? finalpdfroot + filename : filename; |
|
268 |
//string finalpdfroot = CommonLib.Common.GetConfigString("FinalPDFRootUrl", "URL", ""); |
|
269 |
//string filename = Path.GetFileName(e.FinalPDFPath); |
|
270 |
//string pdfpath = !string.IsNullOrEmpty(finalpdfroot) ? finalpdfroot + filename : filename; |
|
271 |
|
|
271 | 272 |
if (!string.IsNullOrEmpty(soapurl) && (Program.UploadFinalPDFInst != null) && (Program.UploadFinalPDFMethod != null)) |
272 | 273 |
{ |
273 |
object[] parameters = new object[] { pdfpath, e.OriginPDFName, e.FinalPDF, soapurl };
|
|
274 |
object[] parameters = new object[] { e.FinalPDFRemotePath, e.OriginPDFName, e.FinalPDF, soapurl };
|
|
274 | 275 |
|
275 |
_Logger.Write("Call Upload Final .." + filename + ",pdfname:" + e.OriginPDFName,LogLevel.Info);
|
|
276 |
_Logger.Write("Call Upload Final .." + e.FinalPDFRemotePath + ",pdfname:" + e.OriginPDFName + ",finalPDF ID : " + e.FinalPDF.ID + ",soapUri:" + soapurl,LogLevel.Info);
|
|
276 | 277 |
|
277 | 278 |
KeyValuePair<bool, string> result = (KeyValuePair<bool, string>)(Program.UploadFinalPDFMethod.Invoke(Program.UploadFinalPDFInst, parameters)); |
278 | 279 |
|
... | ... | |
283 | 284 |
else |
284 | 285 |
{ |
285 | 286 |
SetFinalState(_item.ID, FinalStatus.Error); |
286 |
_Logger.Write("Upload error .." + filename + ",pdfname:" + e.OriginPDFName, LogLevel.Error);
|
|
287 |
_Logger.Write("Upload error .." + e.FinalPDFRemotePath + ",pdfname:" + e.OriginPDFName, LogLevel.Error);
|
|
287 | 288 |
} |
288 | 289 |
} |
289 | 290 |
else |
FinalService/KCOM_FinalService/MarkupToPDF/EventMember.cs | ||
---|---|---|
10 | 10 |
public string Message { get; set; } |
11 | 11 |
public string Error { get; set; } |
12 | 12 |
public string FinalPDFPath { get; set; } |
13 |
public string FinalPDFRemotePath { get; set; } |
|
14 |
|
|
13 | 15 |
public string OriginPDFName { get; set; } |
14 | 16 |
public KCOMDataModel.DataModel.FINAL_PDF FinalPDF { get; set; } |
15 | 17 |
|
FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.cs | ||
---|---|---|
22 | 22 |
{ |
23 | 23 |
public class MarkupToPDF : IDisposable |
24 | 24 |
{ |
25 |
|
|
25 | 26 |
#region 초기 데이터 |
26 | 27 |
private static iTextSharp.text.Rectangle mediaBox; |
27 | 28 |
private FileInfo PdfFilePath = null; |
... | ... | |
462 | 463 |
{ |
463 | 464 |
EndFinal(this, new EndFinalEventArgs |
464 | 465 |
{ |
466 |
FinalPDFRemotePath = _FinalPDFStorgeRemote + @"\" + FinalPDFPath.Name, |
|
465 | 467 |
OriginPDFName = OriginFileName, |
466 | 468 |
FinalPDFPath = FinalPDFPath.FullName, |
467 | 469 |
Error = "", |
... | ... | |
1219 | 1221 |
|
1220 | 1222 |
if (File.Exists(pdfFilePath)) |
1221 | 1223 |
{ |
1224 |
string destfilepath = null; |
|
1222 | 1225 |
try |
1223 | 1226 |
{ |
1224 | 1227 |
FinalPDFPath = new FileInfo(pdfFilePath); |
1225 | 1228 |
|
1226 |
string pdfmovepath = CommonLib.Common.GetConfigString("PDFMovePath", "URL", ""); |
|
1227 |
string destfilepath = Path.Combine(pdfmovepath,FinalPDFPath.Name.Replace(".tmp", ".pdf")); |
|
1229 |
// string pdfmovepath = CommonLib.Common.GetConfigString("PDFMovePath", "URL", ""); |
|
1230 |
destfilepath = Path.Combine(_FinalPDFStorgeLocal, FinalPDFPath.Name.Replace(".tmp", ".pdf")); |
|
1231 |
|
|
1228 | 1232 |
if (File.Exists(destfilepath)) |
1229 | 1233 |
File.Delete(destfilepath); |
1234 |
|
|
1230 | 1235 |
File.Move(FinalPDFPath.FullName, destfilepath); |
1231 | 1236 |
FinalPDFPath = new FileInfo(destfilepath); |
1232 | 1237 |
File.Delete(pdfFilePath); |
1233 | 1238 |
} |
1234 | 1239 |
catch (Exception ex) |
1235 | 1240 |
{ |
1236 |
SetNotice(finaldata.ID, "File move error: " + ex.ToString());
|
|
1241 |
SetNotice(finaldata.ID, $"File move error - Source File : {FinalPDFPath.FullName} dest File : {destfilepath}" + ex.ToString());
|
|
1237 | 1242 |
} |
1238 | 1243 |
|
1239 | 1244 |
return true; |
KCOM/Controls/Symbol.xaml.cs | ||
---|---|---|
149 | 149 |
{ |
150 | 150 |
symbol_Public = await ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseTaskClient.GetPublicSymbolListAsync(null); |
151 | 151 |
} |
152 |
|
|
153 |
foreach (var item in symbol_Public)
|
|
152 |
|
|
153 |
if (symbol_Public != null)
|
|
154 | 154 |
{ |
155 |
Custom.Name = item.NAME; |
|
156 |
Custom.ImageUri = CommonLib.Common.IPReplace(item.IMAGE_URL, App.isExternal); |
|
157 |
Custom.ID = item.ID; |
|
158 |
Custom_List.Add(Custom); |
|
159 |
Custom = new Symbol_Custom(); |
|
160 |
} |
|
155 |
foreach (var item in symbol_Public) |
|
156 |
{ |
|
157 |
Custom.Name = item.NAME; |
|
158 |
Custom.ImageUri = CommonLib.Common.IPReplace(item.IMAGE_URL, App.isExternal); |
|
159 |
Custom.ID = item.ID; |
|
160 |
Custom_List.Add(Custom); |
|
161 |
Custom = new Symbol_Custom(); |
|
162 |
} |
|
161 | 163 |
|
162 |
lstSymbolPublic.ItemsSource = Custom_List; |
|
164 |
lstSymbolPublic.ItemsSource = Custom_List; |
|
165 |
} |
|
163 | 166 |
} |
164 | 167 |
|
165 | 168 |
public async Task<PngBitmapEncoder> symImageAsync(string data,double PageAngle) |
KCOM/KCOM.csproj.user | ||
---|---|---|
28 | 28 |
<StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjQwMDAwMTQyIiwiYlBhcnRuZXIiOmZhbHNlLCJDcmVhdGVGaW5hbFBERlBlcm1pc3Npb24iOmZhbHNlLCJOZXdDb21tZW50UGVybWlzc2lvbiI6dHJ1ZSwiUHJvamVjdE5PIjoiMDAwMDAwIiwiVXNlcklEIjoiZG9mdGVjaCIsIk1vZGUiOjB9</StartArguments> |
29 | 29 |
</PropertyGroup> |
30 | 30 |
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug_HyoSung|AnyCPU'"> |
31 |
<StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjIwMDUyIiwiYlBhcnRuZXIiOiJmYWxzZSIsIkNyZWF0ZUZpbmFsUERGUGVybWlzc2lvbiI6ImZhbHNlIiwiTmV3Q29tbWVudFBlcm1pc3Npb24iOiJmYWxzZSIsIlByb2plY3ROTyI6IkxQRyIsIlVzZXJJRCI6IlJFUE9JTlRcXHN5c3RlbSIsIk1vZGUiOjB9/</StartArguments>
|
|
31 |
<StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjgwMDA3IiwiYlBhcnRuZXIiOmZhbHNlLCJDcmVhdGVGaW5hbFBERlBlcm1pc3Npb24iOnRydWUsIk5ld0NvbW1lbnRQZXJtaXNzaW9uIjp0cnVlLCJQcm9qZWN0Tk8iOiJKRVQiLCJVc2VySUQiOiJ0c3RsZTEifQ==</StartArguments>
|
|
32 | 32 |
</PropertyGroup> |
33 | 33 |
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug_HyoSung|x64'"> |
34 | 34 |
<StartProgram>C:\Program Files\DOFTECH\MARKUS\KCOM.exe</StartProgram> |
내보내기 Unified diff