개정판 0177db7a
issue #1188: Conversion.asmx 기존 SNI 호출 로직, 신규 컨버팅 서비스 호출 로직 merged
Change-Id: I308dcab2a3c6732f1faa02ce4c1e81badf685a99
ConvertService/ServiceBase/ConvertionWebService/Conversion.asmx.cs | ||
---|---|---|
68 | 68 |
logger.Error("Conversion Web Service Error",new Exception(ex)); |
69 | 69 |
} |
70 | 70 |
} |
71 |
[WebMethod] |
|
72 |
public string Run(string rev_No, string document_No, string document_Name, string group_No, string prj_No, string document_Id, string document_Url) |
|
73 |
{ |
|
74 |
string _result = null; |
|
75 |
try |
|
76 |
{ |
|
77 |
using (DeepView_Entity deepViewEntity = new DeepView_Entity(ConnectStringBuilder.DeepViewConnectionString().ToString())) |
|
78 |
{ |
|
79 |
//_result = ConnectStringBuilder.DeepViewConnectionString().ToString(); |
|
80 |
//var _RunProjects = deepViewEntity.RUN_PROJECTS.Where(r => r.PROJECT_NO == projNumber && DateTime.Parse(r.RUN_DATETIME)<= DateTime.Now); |
|
81 |
//var _RunProjects = deepViewEntity.RUN_PROJECTS.Where(r => r.PROJECT_NO == projNumber); |
|
82 |
var _RunProjects = deepViewEntity.RUN_PROJECTS.Where(r => r.PROJECT_NO != null); |
|
71 | 83 |
|
84 |
if (_RunProjects.Count() > 0) |
|
85 |
{ |
|
86 |
_result = SendKcom(rev_No, document_No, document_Name, group_No, prj_No, document_Id, document_Url); |
|
87 |
} |
|
88 |
else |
|
89 |
{ |
|
90 |
_result = false.ToString(); |
|
91 |
} |
|
92 |
} |
|
93 |
} |
|
94 |
catch (Exception ex) |
|
95 |
{ |
|
96 |
_result = ex.Message.ToString(); |
|
97 |
SendNotice("Project NO : " + prj_No + "\r\n DocumentUrl : " + document_Url + "\r\n Error" + ex.ToString()); |
|
98 |
} |
|
99 |
return _result; |
|
100 |
} |
|
101 |
|
|
102 |
|
|
72 | 103 |
[WebMethod] |
73 | 104 |
public string ConvertRun(string rev_No, string document_No, string document_Name, string group_No, string prj_No, string document_Id, string document_Url) |
74 | 105 |
{ |
... | ... | |
568 | 599 |
private string SendKcom(string rev_No, string document_No, string document_Name, string group_No, string prj_No, string document_Id, string document_Url) |
569 | 600 |
{ |
570 | 601 |
string result = false.ToString(); |
571 |
|
|
572 | 602 |
if (remObj == null) |
573 | 603 |
{ |
574 |
result = "Window Service Connection Error";
|
|
604 |
result = "Window Service Connection Error";
|
|
575 | 605 |
} |
576 | 606 |
else |
577 | 607 |
{ |
578 | 608 |
//string _id = GetGuid(0, GuidGenerator.GetUniqueGuid()).ToString(); |
579 | 609 |
string _id = shortGuid(); |
580 |
string _doc_id = ((UInt32)document_Id.GetHashCode()).ToString(); |
|
581 |
using (DeepView_Entity _entity = new DeepView_Entity(ConnectStringBuilder.DeepViewConnectionString().ToString())) |
|
582 |
{ |
|
583 |
if (string.IsNullOrEmpty(group_No)) |
|
584 |
{ |
|
585 |
group_No = "0"; |
|
586 |
} |
|
587 |
if (!document_Url.Contains("http%3a%2f%2f")) |
|
588 |
{ |
|
589 |
document_Url = Base64Decode(document_Url); |
|
590 |
document_Url = HttpUtility.UrlEncodeUnicode(document_Url); |
|
591 |
} |
|
592 |
document_Name = Base64DecodeFromStr(document_Name); |
|
593 | 610 |
|
594 |
var doc = _entity.DOCUMENT_ITEM.Where(d => d.ID == document_Id).FirstOrDefault(); |
|
595 |
if(doc != null) |
|
596 |
{ |
|
597 |
doc.DOCUMENT_ID = _doc_id; |
|
598 |
doc.REVISION = rev_No; |
|
599 |
doc.GROUP_NO = group_No; |
|
600 |
doc.DOCUMENT_NO = document_No; |
|
601 |
doc.DOCUMENT_NAME = document_Name; |
|
602 |
doc.ORIGINAL_FILE = document_Url; |
|
603 |
} |
|
604 |
else |
|
605 |
{ |
|
606 |
_entity.AddToDOCUMENT_ITEM(new DOCUMENT_ITEM |
|
607 |
{ |
|
608 |
ID = document_Id, |
|
609 |
REVISION = rev_No, |
|
610 |
DOCUMENT_NO = document_No, |
|
611 |
DOCUMENT_NAME = document_Name, |
|
612 |
GROUP_NO = group_No, |
|
613 |
ORIGINAL_FILE = document_Url, |
|
614 |
DOCUMENT_ID = _doc_id, |
|
615 |
PROJECT_NO = prj_No, |
|
616 |
}); |
|
617 |
} |
|
618 |
|
|
611 |
using (DeepView_Entity _entity = new DeepView_Entity(ConnectStringBuilder.DeepViewConnectionString().ToString())) |
|
612 |
{ |
|
619 | 613 |
_entity.AddToCONVERTER_DOC(new CONVERTER_DOC |
620 | 614 |
{ |
621 |
ID = _id, |
|
615 |
ID = _id.ToString(),
|
|
622 | 616 |
CREATE_DATETIME = DateTime.Now, |
623 | 617 |
DOCUMENT_URL = document_Url, |
624 | 618 |
PROJECT_NO = prj_No, |
625 |
DOCUMENT_ID = _doc_id,
|
|
619 |
DOCUMENT_ID = document_Id,
|
|
626 | 620 |
}); |
621 |
_entity.AddToDOCUMENT_ITEM(new DOCUMENT_ITEM |
|
622 |
{ |
|
623 |
ID = shortGuid(), |
|
624 |
REVISION = rev_No, |
|
625 |
DOCUMENT_NO = document_No, |
|
626 |
DOCUMENT_NAME = document_Name, |
|
627 |
GROUP_NO = group_No, |
|
628 |
ORIGINAL_FILE = document_Url, |
|
629 |
DOCUMENT_ID = document_Id, |
|
630 |
PROJECT_NO = prj_No, |
|
631 |
}); |
|
632 |
|
|
627 | 633 |
_entity.SaveChanges(); |
628 | 634 |
} |
629 |
|
|
630 |
if (Properties.Settings.Default.MARKUS_V3_PROJECTS.Split(',').Contains(prj_No)) |
|
635 |
try |
|
631 | 636 |
{ |
632 |
try |
|
633 |
{ |
|
634 |
System.Net.WebClient client = new System.Net.WebClient(); |
|
635 |
var convertResult = client.DownloadString($"{Properties.Settings.Default.MARKUS_V3_ADDRESS}/Rest/ConvertAdd?ProjectNo={prj_No}&DocumentID={_id}"); |
|
637 |
System.Net.WebClient client = new System.Net.WebClient(); |
|
638 |
var convertResult = client.DownloadString($"{Properties.Settings.Default.MARKUS_V3_ADDRESS}/Rest/ConvertAdd?ProjectNo={prj_No}&DocumentID={_id}"); |
|
636 | 639 |
|
637 |
JObject jObject = JObject.Parse(convertResult, new JsonLoadSettings()); |
|
638 |
result = jObject["ConvertAddResult"].ToString(); |
|
639 |
} |
|
640 |
catch (Exception ex) |
|
641 |
{ |
|
642 |
logger.Error("Conversion Web Service SendKcom Error", ex); |
|
643 |
result = $"Markus V3 Connect Error {ex.Message}"; |
|
644 |
} |
|
640 |
JObject jObject = JObject.Parse(convertResult, new JsonLoadSettings()); |
|
641 |
result = jObject["ConvertAddResult"].ToString(); |
|
645 | 642 |
} |
646 |
else
|
|
643 |
catch (Exception ex)
|
|
647 | 644 |
{ |
648 |
var convertResult = remObj.SetConverterPDF(prj_No, _id); |
|
649 |
|
|
650 |
if (convertResult.Exception != null) |
|
651 |
{ |
|
652 |
result = false.ToString(); |
|
653 |
} |
|
654 |
else |
|
655 |
{ |
|
656 |
result = true.ToString(); |
|
657 |
} |
|
645 |
logger.Error("Conversion Web Service SendKcom Error", ex); |
|
646 |
result = $"Markus V3 Connect Error {ex.Message}"; |
|
658 | 647 |
} |
659 |
|
|
648 |
return result; |
|
660 | 649 |
} |
661 |
|
|
662 |
return result; |
|
663 |
} |
|
650 |
} |
|
664 | 651 |
|
665 | 652 |
private string ManualSendKcom(string rev_No, string document_No, string document_Name, string group_No, string prj_No, string document_Id, string document_Url) |
666 | 653 |
{ |
내보내기 Unified diff