프로젝트

일반

사용자정보

개정판 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/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);

내보내기 Unified diff

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