프로젝트

일반

사용자정보

개정판 6c9fec59

ID6c9fec59e8373109557d1d2a038306486449bbb0
상위 b3251eea
하위 1fdcd6ff, f57623ba

김동진이(가) 5년 이상 전에 추가함

issue #1022: doc info & markup data select service add

Change-Id: I77fd616bd76835bf2ce490bf3a35a8ccb4824935

차이점 보기:

KCOM_API/ServiceDeepView.svc.cs
2541 2541

  
2542 2542
        }
2543 2543
        #endregion
2544

  
2545
        #region Final Service
2546
        [OperationContract]
2547
        [ServiceKnownType(typeof(DOCINFO))]                
2548
        public DOCINFO FinalPDF_GetDocinfo(string project_no, string docinfo_id)
2549
        {
2550
            DOCINFO docinfo = null;
2551

  
2552
            try
2553
            {
2554
                using (CIEntities _entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(project_no).ToString()))
2555
                {
2556
                    var doc = _entity.DOCINFO.Where(x => x.ID == docinfo_id).FirstOrDefault();
2557
                    if(doc != null)
2558
                    {
2559
                        docinfo = new DOCINFO()
2560
                        {
2561
                            ID = doc.ID,
2562
                            DOCUMENT_ID = doc.DOCUMENT_ID,
2563
                            PAGE_COUNT = doc.PAGE_COUNT,
2564
                            ORIGINAL_FILE = doc.ORIGINAL_FILE,
2565
                            PROJECT_NO = doc.PROJECT_NO
2566
                        };
2567
                    }                    
2568
                }
2569
            }
2570
            catch (Exception)
2571
            {
2572
                throw;
2573
            }
2574
            return docinfo;
2575
        }
2576
        [OperationContract]
2577
        [ServiceKnownType(typeof(DOCUMENT_ITEM))]
2578
        public DOCUMENT_ITEM FinalPDF_GetDocumentItem(string project_no, string document_id)
2579
        {
2580
            DOCUMENT_ITEM item = null;
2581

  
2582
            try
2583
            {
2584
                using (CIEntities _entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(project_no).ToString()))
2585
                {
2586
                    var doc = _entity.DOCUMENT_ITEM.Where(x => x.DOCUMENT_ID == document_id).FirstOrDefault();
2587
                    if(doc != null)
2588
                    {
2589
                        item = new DOCUMENT_ITEM()
2590
                        {
2591
                            ID = doc.ID,
2592
                            ORIGINAL_FILE = doc.ORIGINAL_FILE,
2593
                            PROJECT_NO = doc.PROJECT_NO,
2594
                            DOCUMENT_ID = doc.DOCUMENT_ID,
2595
                            DOCUMENT_NO = doc.DOCUMENT_NO,
2596
                            DOCUMENT_NAME = doc.DOCUMENT_NAME,
2597
                            ENSEMBLEINFO_URL = doc.ENSEMBLEINFO_URL,
2598
                            GROUP_NO = doc.GROUP_NO,
2599
                            RESULT = doc.RESULT,
2600
                            REVISION = doc.REVISION,
2601
                            RESULT_FILE = doc.RESULT_FILE
2602
                        };
2603
                    }
2604
                    
2605
                }
2606
            }
2607
            catch (Exception)
2608
            {
2609
                throw;
2610
            }
2611
            return item;
2612
        }
2613
        [OperationContract]
2614
        [ServiceKnownType(typeof(MARKUP_DATA))]
2615
        public List<MARKUP_DATA> FinalPDF_GetMarkupdata(string project_no, string docinfo_id)
2616
        {
2617
            List<MARKUP_DATA> results = new List<MARKUP_DATA>();
2618

  
2619
            try
2620
            {
2621
                using (CIEntities _entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(project_no).ToString()))
2622
                {
2623
                    var datas = _entity.MARKUP_DATA.Where(x => x.MARKUP_INFO_VERSION.MARKUP_INFO.DOCINFO_ID == docinfo_id
2624
                    && x.MARKUP_INFO_VERSION.MARKUP_INFO.CONSOLIDATE == 1
2625
                    && x.MARKUP_INFO_VERSION.MARKUP_INFO.AVOID_CONSOLIDATE == 0
2626
                    && x.MARKUP_INFO_VERSION.MARKUP_INFO.PART_CONSOLIDATE == 0).ToList();
2627
                    foreach (var data in datas)
2628
                    {
2629
                        MARKUP_DATA d = new MARKUP_DATA()
2630
                        {
2631
                            ID = data.ID,
2632
                            GROUP_ID = data.GROUP_ID,
2633
                            SYMBOL_ID = data.SYMBOL_ID,
2634
                            DATA = data.DATA,
2635
                            DATA_TYPE = data.DATA_TYPE
2636
                        };
2637
                        results.Add(d);
2638
                    }
2639
                }
2640
            }
2641
            catch (Exception)
2642
            {
2643
                throw;
2644
            }
2645
            return results;
2646
        }
2647
        [OperationContract]
2648
        [ServiceKnownType(typeof(MARKUP_INFO))]
2649
        public MARKUP_INFO FinalPDF_GetMarkupinfo(string project_no, string docinfo_id)
2650
        {
2651
            MARKUP_INFO markupInfo = null;
2652

  
2653
            try
2654
            {
2655
                using (CIEntities _entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(project_no).ToString()))
2656
                {
2657
                    var tmp = _entity.MARKUP_INFO.Where(x => x.DOCINFO_ID == docinfo_id && x.CONSOLIDATE == 1 && x.AVOID_CONSOLIDATE == 0 && x.PART_CONSOLIDATE == 0).FirstOrDefault();
2658
                    if (tmp != null)
2659
                    {
2660
                        markupInfo = new MARKUP_INFO()
2661
                        {
2662
                            ID = tmp.ID,
2663
                            DOCINFO_ID = tmp.DOCINFO_ID,
2664
                            USER_ID = tmp.USER_ID
2665
                        };
2666
                    }                    
2667
                }
2668
            }
2669
            catch (Exception)
2670
            {
2671
                throw;
2672
            }
2673
            return markupInfo;
2674
        }
2675
        [OperationContract]
2676
        [ServiceKnownType(typeof(DOCPAGE))]
2677
        public List<DOCPAGE> FinalPDF_GetDocpage(string project_no, string docinfo_id)
2678
        {
2679
            List<DOCPAGE> results = new List<DOCPAGE>();
2680

  
2681
            try
2682
            {
2683
                using (CIEntities _entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(project_no).ToString()))
2684
                {
2685
                    var pages = _entity.DOCPAGE.Where(x => x.DOCINFO_ID == docinfo_id).OrderBy(x => x.PAGE_NUMBER).ToList();
2686
                    foreach(var page in pages)
2687
                    {
2688
                        DOCPAGE p = new DOCPAGE()
2689
                        {
2690
                            PAGE_ANGLE = page.PAGE_ANGLE,
2691
                            PAGE_NUMBER = page.PAGE_NUMBER,
2692
                            PAGE_HEIGHT = page.PAGE_HEIGHT,
2693
                            PAGE_WIDTH = page.PAGE_WIDTH,
2694
                            DOCINFO_ID = page.DOCINFO_ID                            
2695
                        };
2696
                        results.Add(p);
2697
                    }                    
2698
                }
2699
            }
2700
            catch (Exception)
2701
            {
2702
                throw;
2703
            }
2704
            return results;
2705
        }
2706
        #endregion
2544 2707
    }
2545 2708
}

내보내기 Unified diff

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