프로젝트

일반

사용자정보

개정판 9eb27750

ID9eb27750abd373b68dff524b48a9eabb6c5a2303
상위 ec338a60
하위 1258d746

송근호이(가) 5년 이상 전에 추가함

issue #000 로그뷰에서 retry 함수를 호출 할 때, 검색된 데이터 전체를 컨버팅 하기 위해서 startDate, endDate, isAllDocuments 을 Interface 클래스인 pRetryDocument에 Property로 추가하였음.
ConvertAPIController내의 /api/project/GetConvertDocument 함수에서는 DOCUMENT_ITEM를 가져올때 무조건 FirstOrDefault().DOCUMENT_ID 로 되어있어서 DocumentID이 없을 경우 Exception 떨어져서 변경.

Change-Id: I606963b4e56f2cea85d057d727380876a20f5e53

차이점 보기:

MarkusLogview/IKCOM/Interface.cs
76 76
    {
77 77
        public string projectNO { get; set; }
78 78
        public string[] documentID { get; set; }
79
        
79
        public bool isAllDocuments { get; set; }
80
        public DateTime startDate { get; set; }
81
        public DateTime endDate { get; set; }
80 82
    }
81 83

  
82 84

  
MarkusLogview/MARKUS_LOGVIEW/Controllers/ConvertAPIController.cs
73 73

  
74 74
                            limitList.ForEach(ret =>
75 75
                            {
76
                                tableData.Add(new TableData_Convert()
76
                                try
77 77
                                {
78
                                    ID = ret.ID,
79
                                    DeleteDocument = "<input type=\"checkbox\" name=\"deleteDocument[]\" value=\"" + ret.DOCUMENT_ID + "\" />",
80
                                    OpenMarkusURL = "<a href=\"kcom://" + CommonController.CreateMarkusParam(ret.PROJECT_NO, ret.DOCUMENT_ID, token) + "\">open</a>",
81
                                    DocumentID = ret.DOCUMENT_ID,
82
                                    InterfaceID = ent.DOCUMENT_ITEM.Where(d =>d.DOCUMENT_ID == ret.DOCUMENT_ID).FirstOrDefault().ID,
83
                                    CurrentPage = ret.CURRENT_PAGE,
84
                                    TotalPage = ret.TOTAL_PAGE,
85
                                    CreateDate = ret.CREATE_DATETIME,
86
                                    StartDateTime = ret.START_DATETIME,
87
                                    EndDateTime = ret.END_DATETIME,
88
                                    ConvertTime = null,
89
                                    Status = CommonController.GetStatusName(ret.STATUS),
90
                                    DocumentURL = "<a href=\"" + ret.DOCUMENT_URL + "\" target=\"_blank\">PDF</a>",
91
                                });
78
                                    string deleteDocument = "<input type=\"checkbox\" name=\"deleteDocument[]\" value=\"" + ret.DOCUMENT_ID + "\" />";
79
                                    string openMarkusURL = "<a href=\"kcom://" + CommonController.CreateMarkusParam(ret.PROJECT_NO, ret.DOCUMENT_ID, token) + "\">open</a>";
80
                                    string interfaceID = string.Empty;
81
                                    string documentURL = string.Empty;
82
                                    string message = string.Empty;
83
                                    var dOCUMENT_ITEMs = ent.DOCUMENT_ITEM.Where(d => d.DOCUMENT_ID == ret.DOCUMENT_ID).FirstOrDefault();
84

  
85
                                    if (dOCUMENT_ITEMs != null) {
86
                                        interfaceID = dOCUMENT_ITEMs.DOCUMENT_ID;
87
                                    }
88
                                    else {
89
                                        message = string.Format("{0}의 DOCUMENT_ITEM이 존재하지 않습니다.", ret.DOCUMENT_ID);
90
                                    }
91

  
92
                                    string status = CommonController.GetStatusName(ret.STATUS);
93

  
94
                                    if (ret.DOCUMENT_URL != null) {
95
                                        documentURL = "<a href=\"" + ret.DOCUMENT_URL + "\" target=\"_blank\">PDF</a>";
96
                                    }
97

  
98
                                    tableData.Add(new TableData_Convert()
99
                                    {
100
                                        ID = ret.ID,
101
                                        DeleteDocument = deleteDocument,
102
                                        OpenMarkusURL = openMarkusURL,
103
                                        DocumentID = ret.DOCUMENT_ID,
104
                                        InterfaceID = interfaceID,
105
                                        CurrentPage = ret.CURRENT_PAGE,
106
                                        TotalPage = ret.TOTAL_PAGE,
107
                                        CreateDate = ret.CREATE_DATETIME,
108
                                        StartDateTime = ret.START_DATETIME,
109
                                        EndDateTime = ret.END_DATETIME,
110
                                        ConvertTime = null,
111
                                        Status = status,
112
                                        DocumentURL = documentURL,
113
                                        Message = message
114
                                    });
92 115

  
116
                                }
117
                                catch (Exception ex)
118
                                {
119

  
120
                                    throw ex;
121
                                }
93 122
                            });
94 123

  
95 124
                            dto.draw = filter.Draw;
......
117 146
                    }
118 147

  
119 148
                }
120
                catch (Exception)
149
                catch (Exception ex)
121 150
                {
122 151
                    dto.statusCode = 500;
123 152
                    return dto;
......
218 247
                            .Select(ret => new DocumentMessage()
219 248
                            {
220 249
                                OriginalURL = ret.ORIGINAL_FILE,
221
                                Message = convMessage
250
                                Message = (convMessage == null) ? "DocumentItemID의 " +getDocument.DocumentItemID + "의 CONVERTER_DOC가 존재하지 않습니다." 
251
                                                    :  (convMessage.Length == 0) ? "No Message" : convMessage
222 252
                            })
223 253
                            .FirstOrDefault();
224 254

  
......
591 621
                {
592 622
                    using (markusEntities ent = new markusEntities(ConnectStringBuilder.MarkusEntitiesConnectionString().ToString()))
593 623
                    {
594
                        // 웹 서비스 호출 ( 컨버팅 서비스 호출 ) 
595
                        for (int i = 0; i < doc.documentID.Count(); i++)
624
                        if (!doc.isAllDocuments)
596 625
                        {
597
                            // 선택한 도큐먼트 아이디를 통해 정보 찾기 
598
                            string targetDocumentID = doc.documentID[i].ToString();
599
                            // DOCUMENT_ITEM 에서 찾는 이유는 오리지널 파일 URL 을 찾기 위해서이다.
600
                            //var targetDocument = ent.DOCUMENT_ITEM.Where(di => di.PROJECT_NO == doc.projectNO && di.DOCUMENT_ID == targetDocumentID).FirstOrDefault();
601
                            var targetDocument = ent.CONVERTER_DOC.Where(di => di.PROJECT_NO == doc.projectNO && di.DOCUMENT_ID == targetDocumentID).FirstOrDefault();
602

  
603
                            if (targetDocument != null)
626
                            //Each Convert
627
                            for (int i = 0; i < doc.documentID.Count(); i++)
604 628
                            {
605
                                targetDocument.STATUS = (int)PDFStatus.Insert;
606
                                targetDocument.RECONVERTER = 0;
607
                                ent.SaveChanges();
608
                                //using (ConvertWebService.Conversion convertService = new ConvertWebService.Conversion())
609
                                //{
610
                                //    convertService.ConvertRun(targetDocument.REVISION, targetDocument.DOCUMENT_NO, targetDocument.DOCUMENT_NAME, targetDocument.GROUP_NO, targetDocument.PROJECT_NO, targetDocument.ID, targetDocument.ORIGINAL_FILE);
611
                                //}                                
629
                                string targetDocumentID = doc.documentID[i].ToString();
630

  
631
                                var targetDocument = ent.CONVERTER_DOC.Where(di => di.PROJECT_NO == doc.projectNO && di.DOCUMENT_ID == targetDocumentID).FirstOrDefault();
632

  
633
                                if (targetDocument != null)
634
                                {
635
                                    targetDocument.STATUS = (int)PDFStatus.Insert;
636
                                    targetDocument.RECONVERTER = 0;
637
                                    ent.SaveChanges();
638
                                    //웹 서비스 구문
639
                                    //using (ConvertWebService.Conversion convertService = new ConvertWebService.Conversion())
640
                                    //{
641
                                    //    convertService.ConvertRun(targetDocument.REVISION, targetDocument.DOCUMENT_NO, targetDocument.DOCUMENT_NAME, targetDocument.GROUP_NO, targetDocument.PROJECT_NO, targetDocument.ID, targetDocument.ORIGINAL_FILE);
642
                                    //}                                
643
                                }
644
                                else
645
                                {
646
                                    return await CommonController.NotFound<string>(resp, "Not found");
647
                                }
648

  
612 649
                            }
613
                            else
650
                        }
651
                        else
652
                        {
653
                            //All Convert
654
                            var targetDocuments = ent.CONVERTER_DOC.Where(di => di.PROJECT_NO == doc.projectNO &&
655
                                                                                    di.CREATE_DATETIME >= doc.startDate &&
656
                                                                                        di.CREATE_DATETIME <= doc.endDate);
657
                            foreach (var item in targetDocuments)
614 658
                            {
615
                                return await CommonController.NotFound<string>(resp, "Not found");
659
                                item.STATUS = (int)PDFStatus.Insert;
660
                                item.RECONVERTER = 0;
661
                                ent.SaveChanges();
616 662
                            }
617

  
618 663
                        }
619 664

  
620 665
                        return await CommonController.OK<bool>(resp, true);
MarkusLogview/MARKUS_LOGVIEW/Scripts/Common/Common.js
1587 1587
        var selectedProjectNO = $("#ProjectList").DataTable().row($('tr.selected')).data()[0];
1588 1588
        var docIdList = [];
1589 1589
        var tableData = null;
1590

  
1590
        var startDate = $("#start-date").val();
1591
        var endDate = $("#end-date").val();
1591 1592
        if (callName === "retry") {
1592 1593

  
1593 1594
            // 재요청
1594 1595
            var retryBaseURL = null;
1596

  
1595 1597
            var param = {
1596 1598
                "projectNO": null,
1597
                "documentID": []
1599
                "documentID": [],
1600
                "isAllDocuments": false,
1601
                "startDate": startDate,
1602
                "endDate": endDate
1598 1603
            };
1599 1604

  
1600 1605
            if (convertElement.length > 0) {
......
1604 1609

  
1605 1610
                param.projectNO = selectedProjectNO;
1606 1611

  
1607
                var selectedDocument = $("#ConvertList tbody input.selectedDocument:checked")
1612
                var selectedDocument = $("#ConvertList tbody input.selectedDocument:checked");
1608 1613

  
1609 1614
                if (selectedDocument.length > 0) {
1610 1615
                    $("#ConvertList tbody input.selectedDocument:checked").each(function (idx, element) {
......
1647 1652
                }
1648 1653
            }
1649 1654
            else if (convertElement.length == 0) {
1650

  
1651

  
1655
                alert("전체 컨버팅 기능은 추후 업데이트 될 예정입니다.");
1656
                return false;
1652 1657
            }else if (mergeElement.length > 0) {
1653 1658

  
1654 1659
                //retryBaseURL = '/api/retry/merge';
MarkusLogview/MarkusDataModel/DTOs/ConvertPdfDTO.cs
93 93
        public string ConvertTime { get; set; }
94 94
        public string Status { get; set; }
95 95
        public string DocumentURL { get; set; }
96
        public string Message { get; set; }
96 97
    }
97 98

  
98 99
    /// <summary>
MarkusLogview/MarkusDataModel/Properties/Settings.Designer.cs
25 25
        
26 26
        [global::System.Configuration.ApplicationScopedSettingAttribute()]
27 27
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28
        [global::System.Configuration.DefaultSettingValueAttribute("data source=172.21.101.29;database={0};user id=ProjectPortalDBConn;password=Proje" +
29
            "ctPortalDBConn")]
28
        [global::System.Configuration.DefaultSettingValueAttribute("data source=cloud.devdoftech.co.kr,7777;database={0};user id=doftech;password=dof" +
29
            "1073#")]
30 30
        public string ProjectConnectionString {
31 31
            get {
32 32
                return ((string)(this["ProjectConnectionString"]));
MarkusLogview/MarkusDataModel/Properties/Settings.settings
3 3
  <Profiles />
4 4
  <Settings>
5 5
    <Setting Name="ProjectConnectionString" Type="System.String" Scope="Application">
6
      <Value Profile="(Default)">data source=172.21.101.29;database={0};user id=ProjectPortalDBConn;password=ProjectPortalDBConn</Value>
7
    </Setting>
8
    <Setting Name="aa" Type="System.String" Scope="User">
9
      <Value Profile="(Default)" />
6
      <Value Profile="(Default)">data source=cloud.devdoftech.co.kr,7777;database={0};user id=doftech;password=dof1073#</Value>
10 7
    </Setting>
11 8
  </Settings>
12 9
</SettingsFile>

내보내기 Unified diff

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