프로젝트

일반

사용자정보

개정판 3bde451b

ID3bde451b422200cd73fd780e9fdbaa7768afaead
상위 7b095cc3
하위 504c5aa1, 2c634aed

semi 이(가) 약 5년 전에 추가함

FINALPDF와 CONVERT_DOC 저장 프로시저로 변경

Change-Id: I832b4103112d7b9968f573688378b779a9df2db8

차이점 보기:

ConvertService/ServiceBase/Markus.Service.DataBase/ConvertDatabase.cs
77 77
        /// <summary>
78 78
        /// 상단 그리드 선택된 Status에 따라 DB에서 값 가져온다.
79 79
        /// </summary>
80
        public IEnumerable<Interface.ConvertItem> GetConvertProjects(int status,string ProjectNumberFilter, string UniqueKeyFilter, string Docuemnt_NameFilter, string Service_IDFilter, string Docuemnt_NOFilter, int? ReconverterFilter
80
        public IEnumerable<Interface.ConvertItem> GetConvertProjects(int status,string ProjectNumberFilter, string UniqueKeyFilter, string Document_NameFilter, string Service_IDFilter, string Docuemnt_NOFilter, int? ReconverterFilter
81 81
            , string RevisionFilter)
82 82
        {
83 83
            List<Interface.ConvertItem> convertItems = new List<Interface.ConvertItem>();
......
88 88
                        //
89 89
                        (
90 90
                         items.PROJECT_NO.Contains(ProjectNumberFilter)
91
                         || subpet.DOCUMENT_NAME.Contains(Docuemnt_NameFilter)
91
                         || subpet.DOCUMENT_NAME.Contains(Document_NameFilter)
92 92
                         || items.SERVICE_ID.Contains(Service_IDFilter)
93 93
                         || subpet.ID.Contains(UniqueKeyFilter)
94 94
                         || subpet.DOCUMENT_NO.Contains(Docuemnt_NOFilter)
......
167 167

  
168 168
        }
169 169

  
170
       
170
        /// <summary>Final PDF
171
        /// 상단 그리드 선택된 Status에 따라 DB에서 값 가져온다.
172
        /// </summary>
173
        public IEnumerable<Interface.ConvertItem> GetFinalPDFProjects(int status, string ProjectNumberFilter, string DocumentIDFIlter, string MarkupInfo_IDFilter, string DOCINFO_IDFilter, string Document_NameFilter,
174
            string Docuemnt_NOFilter, string CreateUser_IDFilter)
175
        {
176
            var MarkupInfo_IDFilter_Int = 0;
177
            if (MarkupInfo_IDFilter != null)
178
            {
179
                MarkupInfo_IDFilter_Int = int.Parse(MarkupInfo_IDFilter);
180
            }
181

  
182
            List<Interface.ConvertItem> convertItems = new List<Interface.ConvertItem>();
183
            var query = from items in entities.FINAL_PDF
184
                        join documents in entities.DOCUMENT_ITEM on items.DOCUMENT_ID equals documents.DOCUMENT_ID into GroupItems
185
                        from subpet in GroupItems.DefaultIfEmpty()
186
                        where items.STATUS == status &&
187
                        //
188
                        (
189
                         items.PROJECT_NO.Contains(ProjectNumberFilter)
190
                         || subpet.DOCUMENT_ID.Contains(DocumentIDFIlter)
191
                         || items.MARKUPINFO_ID == MarkupInfo_IDFilter_Int
192
                         || items.DOCINFO_ID.Contains(DOCINFO_IDFilter)
193
                         || subpet.DOCUMENT_NAME.Contains(Document_NameFilter)
194
                         || subpet.DOCUMENT_NO.Contains(Docuemnt_NOFilter)
195
                         || items.CREATE_USER_ID.Contains(CreateUser_IDFilter)
196
                         )
197
                        //
198
                        orderby items.CREATE_DATETIME descending
199
                        select new
200
                        {
201
                            ID = items.ID,
202
                            PROJECT_NO = items.PROJECT_NO,
203
                            DOCINFO_ID = items.DOCINFO_ID,
204
                            MARKUPINFO_ID = items.MARKUPINFO_ID,
205
                            CREATE_USER_ID = items.CREATE_USER_ID,
206
                            CREATE_DATETIME = items.CREATE_DATETIME,
207
                            STATUS = items.STATUS,
208
                            TOTAL_PAGE = items.TOTAL_PAGE,
209
                            CURRENT_PAGE = items.CURRENT_PAGE,
210
                            EXCEPTION = items.EXCEPTION,
211
                            END_DATETIME = items.END_DATETIME,
212
                            START_DATETIME = items.START_DATETIME,
213
                            DOCUMENT_ID = items.DOCUMENT_ID,
214
                            DOCUMENT_URL = subpet.ORIGINAL_FILE,
215

  
216
                            REVISION = subpet.REVISION,
217
                            GROUP_NO = subpet.GROUP_NO,
218
                            RESULT_FILE = subpet.RESULT_FILE,
219
                            RESULT = subpet.RESULT,
220

  
221

  
222
                            DOCUMENT_NO = subpet.DOCUMENT_NO,
223
                            DOCUMENT_NAME = subpet.DOCUMENT_NAME
224
                        };
225

  
226
            if (query.Count() > 0)//세미
227
            {
228
                foreach (var item in query)
229
                {
230
                    Interface.ConvertItem convertitem = new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL)
231
                    {
232
                        ConvertID = item.ID,
233
                        DocInfo_ID = item.DOCINFO_ID,
234
                        MarkupInfo_ID = item.MARKUPINFO_ID.ToString(),
235
                        Create_User_ID = item.CREATE_USER_ID,
236
                        CreateTime = item.CREATE_DATETIME,
237
                        ConvertState = (StatusCodeType)item.STATUS,
238
                        TotalPage = item.TOTAL_PAGE,
239
                        CurrentPageNo = item.CURRENT_PAGE,
240
                        Exception = item.EXCEPTION,
241
                        EndTime = (DateTime)item.END_DATETIME,
242
                        StartTime = (DateTime)item.START_DATETIME,
243
                        DocumnetNo = item.DOCUMENT_NO,
244
                        DocumnetName = item.DOCUMENT_NAME,
245
                        GroupNo = item.GROUP_NO,
246
                        Revision = item.REVISION,
247

  
248
                        ConvertPath = GetConvertPath(item.PROJECT_NO, item.DOCUMENT_ID),
249
                        MarkusLink = "kcom://" + Markus.Service.DataBase.Extensions.MarkusAPI.CreateMarkusParam(item.PROJECT_NO, item.DOCUMENT_ID, "doftech")
250
                    };
251
                   
252
                    convertItems.Add(convertitem);
253
                }
254
            }
255
            return convertItems;
256

  
257
        }
258

  
259

  
171 260
        public IEnumerable<Interface.ConvertItem> GetConvertProjects(int status)
172 261
        {
173 262
            List<Interface.ConvertItem> convertItems = new List<Interface.ConvertItem>();
......
194 283
                            REVISION = subpet.REVISION,
195 284
                            DOCUMENT_NO = subpet.DOCUMENT_NO,
196 285
                            DOCUMENT_NAME = subpet.DOCUMENT_NAME,
197
                            GROUP_NO = subpet.GROUP_NO,
286
                            GROUP_NO = subpet.GROUP_NO
198 287
                        };
199 288

  
200 289
            if (query.Count() > 0)//세미
......
221 310
                        GroupNo = item.GROUP_NO,
222 311
                        DocumentID = item.DOCUMENT_ID,
223 312

  
313

  
224 314
                        MarkusLink = "kcom://" + Markus.Service.DataBase.Extensions.MarkusAPI.CreateMarkusParam(item.PROJECT_NO, item.DOCUMENT_ID, "doftech")
225 315
                    };
226 316
                    convertItems.Add(convertitem);
......
247 337
        /// 상단 그리드에서 선택된 RealDataSelect
248 338
        /// 용도: 중앙그리드 Items Update
249 339
        /// </summary>
340

  
341

  
342
        public IEnumerable<Interface.ConvertItem> GetConvertFinalPDFProjects(System.Collections.ObjectModel.ObservableCollection<Interface.ConvertItem> selectedConvert)
343
        {
344
            List<Interface.ConvertItem> StatusKeep = new List<Interface.ConvertItem>();
345

  
346
            List<Interface.ConvertItem> convertItems = new List<Interface.ConvertItem>();
347

  
348
            foreach (var selectedConvertItem in selectedConvert)
349
            {
350
                var query = from items in entities.FINAL_PDF //세미
351
                            join documents in entities.DOCUMENT_ITEM on items.DOCUMENT_ID equals documents.DOCUMENT_ID into GroupItems
352
                            from subpet in GroupItems.DefaultIfEmpty()
353
                            where items.PROJECT_NO == selectedConvertItem.ProjectNumber && items.ID == selectedConvertItem.ConvertID
354
                            select new
355
                            {
356
                                ID = items.ID,
357
                                PROJECT_NO = items.PROJECT_NO,
358
                                DOCINFO_ID = items.DOCINFO_ID,
359
                                MARKUPINFO_ID = items.MARKUPINFO_ID,
360
                                CREATE_USER_ID = items.CREATE_USER_ID,
361
                                CREATE_DATETIME = items.CREATE_DATETIME,
362
                                STATUS = items.STATUS,
363
                                TOTAL_PAGE = items.TOTAL_PAGE,
364
                                CURRENT_PAGE = items.CURRENT_PAGE,
365
                                EXCEPTION = items.EXCEPTION,
366
                                END_DATETIME = items.END_DATETIME,
367
                                START_DATETIME = items.START_DATETIME,
368
                                DOCUMENT_ID = items.DOCUMENT_ID,
369

  
370
                                DOCUMENT_URL = subpet.ORIGINAL_FILE,
371
                                DOCUMENT_NO = subpet.DOCUMENT_NO,
372
                                DOCUMENT_NAME = subpet.DOCUMENT_NAME
373
                            };
374

  
375

  
376
                if (query.Count() > 0)//세미
377
                {
378
                    foreach (var item in query)
379
                    {
380
                        Interface.ConvertItem convertitem = new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL)
381
                        {
382

  
383
                            DocInfo_ID = item.DOCINFO_ID,
384
                            MarkupInfo_ID = item.MARKUPINFO_ID.ToString(),
385
                            Create_User_ID = item.CREATE_USER_ID,
386
                            CreateTime = item.CREATE_DATETIME,
387
                            ConvertState = (StatusCodeType)item.STATUS,
388
                            TotalPage = item.TOTAL_PAGE,
389
                            CurrentPageNo = item.CURRENT_PAGE,
390
                            Exception = item.EXCEPTION,
391
                            EndTime = (DateTime)item.END_DATETIME,
392
                            StartTime = (DateTime)item.START_DATETIME,
393
                            DocumnetNo = item.DOCUMENT_NO,
394
                            DocumnetName = item.DOCUMENT_NAME,
395

  
396
                            ConvertPath = GetConvertPath(item.PROJECT_NO, item.DOCUMENT_ID),
397
                            MarkusLink = "kcom://" + Markus.Service.DataBase.Extensions.MarkusAPI.CreateMarkusParam(item.PROJECT_NO, item.DOCUMENT_ID, "doftech")
398
                        };
399

  
400
                        StatusKeep.Add(convertitem);
401

  
402
                    }
403
                }
404
            }
405
            return StatusKeep;
406
        }
407

  
408

  
250 409
        public IEnumerable<Interface.ConvertItem> GetConvertProjects(System.Collections.ObjectModel.ObservableCollection<Interface.ConvertItem> selectedConvert)
251 410
        {
252 411
            List<Interface.ConvertItem> StatusKeep = new List<Interface.ConvertItem>();
......
323 482
        /// 상단 그리드에서 선택된 Convert 버튼 
324 483
        /// 용도: 중앙 그리드로 Convert된 row 값 저장 하기 위해서 입니다.
325 484
        /// </summary>
485

  
486
        public IEnumerable<Interface.ConvertItem> GetConvertFinalPDFProjects(Markus.Service.Interface.ConvertItem selectedConvert)
487
        {
488
            List<Interface.ConvertItem> StatusKeep = new List<Interface.ConvertItem>();
489

  
490

  
491
            System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
492

  
493
            stopwatch.Start();
494

  
495

  
496
            List<Interface.ConvertItem> convertItems = new List<Interface.ConvertItem>();//디비 다 조인 후 조건 비교 후 그리드 출력
497
            var query = from items in entities.FINAL_PDF //세미
498
                        join documents in entities.DOCUMENT_ITEM on items.DOCUMENT_ID equals documents.DOCUMENT_ID into GroupItems
499
                        from subpet in GroupItems.DefaultIfEmpty()
500
                        where items.PROJECT_NO == selectedConvert.ProjectNumber && items.DOCUMENT_ID == selectedConvert.DocumentID
501
                        orderby items.CREATE_DATETIME descending
502
                        select new
503
                        {
504
                            ID = items.ID,
505
                            PROJECT_NO = items.PROJECT_NO,
506
                            DOCINFO_ID = items.DOCINFO_ID,
507
                            MARKUPINFO_ID = items.MARKUPINFO_ID,
508
                            CREATE_USER_ID = items.CREATE_USER_ID,
509
                            CREATE_DATETIME = items.CREATE_DATETIME,
510
                            STATUS = items.STATUS,
511
                            TOTAL_PAGE = items.TOTAL_PAGE,
512
                            CURRENT_PAGE = items.CURRENT_PAGE,
513
                            EXCEPTION = items.EXCEPTION,
514
                            END_DATETIME = items.END_DATETIME,
515
                            START_DATETIME = items.START_DATETIME,
516
                            DOCUMENT_ID = items.DOCUMENT_ID,
517

  
518
                            DOCUMENT_URL = subpet.ORIGINAL_FILE,
519
                            DOCUMENT_NO = subpet.DOCUMENT_NO,
520
                            DOCUMENT_NAME = subpet.DOCUMENT_NAME
521
                        };
522

  
523
            if (query.Count() > 0)//세미
524
            {
525
                foreach (var item in query)
526
                {
527
                    Interface.ConvertItem convertitem = new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL)
528
                    {
529

  
530
                        DocInfo_ID = item.DOCINFO_ID,
531
                        MarkupInfo_ID = item.MARKUPINFO_ID.ToString(),
532
                        Create_User_ID = item.CREATE_USER_ID,
533
                        CreateTime = item.CREATE_DATETIME,
534
                        ConvertState = (StatusCodeType)item.STATUS,
535
                        TotalPage = item.TOTAL_PAGE,
536
                        CurrentPageNo = item.CURRENT_PAGE,
537
                        Exception = item.EXCEPTION,
538
                        EndTime = (DateTime)item.END_DATETIME,
539
                        StartTime = (DateTime)item.START_DATETIME,
540
                        DocumnetNo = item.DOCUMENT_NO,
541
                        DocumnetName = item.DOCUMENT_NAME,
542

  
543
                        ConvertPath = GetConvertPath(item.PROJECT_NO, item.DOCUMENT_ID),
544
                        MarkusLink = "kcom://" + Markus.Service.DataBase.Extensions.MarkusAPI.CreateMarkusParam(item.PROJECT_NO, item.DOCUMENT_ID, "doftech")
545
                    };
546
                    StatusKeep.Add(convertitem);
547
                }
548
            }
549
            System.Diagnostics.Debug.WriteLine(new TimeSpan(stopwatch.ElapsedTicks).ToString());
550
            return StatusKeep;
551

  
552
        }
553

  
326 554
        public IEnumerable<Interface.ConvertItem> GetConvertProjects(Markus.Service.Interface.ConvertItem selectedConvert)
327 555
        {
328 556
            List<Interface.ConvertItem> StatusKeep = new List<Interface.ConvertItem>();
......
392 620

  
393 621
        }
394 622

  
623

  
395 624
        #endregion
396 625

  
397 626
        #region SetCleanUpItem
......
402 631
        /// <param name="ReConvert">ReConvert가 2이면 다시 Convert를 시도 안하기 때문에 기존 값으로 유지 하고 계속 시도 할수 있도록 0을 주는 경우가 있다.</param>
403 632
        /// <returns></returns>
404 633
        /// 
405
        public int SetCleanUpItem(ConvertItem _ConvertItem)
634
        public int SetCleanUpFinalPDFItem(ConvertItem _ConvertItem)
406 635
        {
407 636
            int result = 0;
408 637

  
409
            var items = entities.CONVERTER_DOC.Where(x => x.ID == _ConvertItem.ConvertID);
638
            var items = entities.FINAL_PDF.Where(x => x.ID == _ConvertItem.ConvertID);
410 639

  
411 640
            result = items.Count();
412 641

  
......
414 643
            {
415 644
                var item = items.First();
416 645

  
417
                item.RECONVERTER = item.RECONVERTER - _ConvertItem.ReConverter;
646
                //item.RECONVERTER = item.RECONVERTER - _ConvertItem.ReConverter;
418 647

  
419 648
                item.CREATE_DATETIME = DateTime.Now;
420 649
                item.STATUS = (int)StatusCodeType.None;
......
426 655
            return result;
427 656
        }
428 657

  
658
        //public int SetCleanUpItem(ConvertItem _ConvertItem)
659
        //{
660
        //    int result = 0;
661

  
662
        //    var items = entities.CONVERTER_DOC.Where(x => x.ID == _ConvertItem.ConvertID);
663

  
664
        //    result = items.Count();
665

  
666
        //    if (items.Count() > 0)
667
        //    {
668
        //        var item = items.First();
669

  
670
        //        item.RECONVERTER = item.RECONVERTER - _ConvertItem.ReConverter;
671

  
672
        //        item.CREATE_DATETIME = DateTime.Now;
673
        //        item.STATUS = (int)StatusCodeType.None;
674
        //        item.END_DATETIME = null;
675

  
676
        //        result = entities.SaveChanges();
677
        //    }
678

  
679
        //    return result;
680
        //}
681

  
429 682
        public int SetCleanUpItem(string convertID, int ReConvert)
430 683
        {
431 684
            int result = 0;
......
492 745
        /// Item 삭제
493 746
        /// </summary>
494 747
        /// <returns></returns>
748
        /// 
749

  
750
        public int RemoveFinalPDFItem(string convertID)
751
        {
752
            int result = 0;
753

  
754
            var items = entities.FINAL_PDF.Where(x => x.ID == convertID);
755

  
756
            if (items.Count() > 0)
757
            {
758
                FINAL_PDF item = items.First();
759
                entities.FINAL_PDF.Remove(item);
760

  
761
                result = entities.SaveChanges();
762
            }
763

  
764
            return result;
765
        } 
766

  
495 767
        public int RemoveItem(string convertID)
496 768
        {
497 769
            int result = 0;

내보내기 Unified diff

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