프로젝트

일반

사용자정보

개정판 18dfb92e

ID18dfb92e5480a505aee41214c8444340d33efa4c
상위 1137be84
하위 b3b3ae03, f09d5acb

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

issue #000: Conversion wcf daelim branch

Change-Id: I6f120acf5fc5ac52069070c0a4770ed5ef63be28

차이점 보기:

ConvertService/ServiceBase/ConvertionWebService/Conversion.asmx.cs
154 154
                    {
155 155
                        group_No = "0";
156 156
                    }
157
                    if (!prj_No.Equals("150128"))
157
                    if (!document_Url.Contains("http%3a%2f%2f"))
158 158
                    {
159
                        //Omsk 는 웹서비스 호출 시 인코딩
160
                        //Omsk 제외는 Markus 에서 인코딩
161
                        if(!document_Url.Contains("http%3a%2f%2f"))
162
                        {
163
                            document_Url = Base64Decode(document_Url);
164
                            document_Url = HttpUtility.UrlEncodeUnicode(document_Url);
165
                        }
159
                        document_Url = Base64Decode(document_Url);
160
                        document_Url = HttpUtility.UrlEncodeUnicode(document_Url);
166 161
                    }
162
                    document_Name = Base64DecodeFromStr(document_Name);
167 163
                    var doc = _entity.DOCUMENT_ITEM.Where(d => d.ID == document_Id).FirstOrDefault();
168 164
                    if (doc != null)
169 165
                    {
......
326 322
            }
327 323
            return _result;
328 324
        }
325
        public string Base64DecodeFromStr(string data)
326
        {
327
            try
328
            {
329
                System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
330
                System.Text.Decoder utf8Decode = encoder.GetDecoder();
331

  
332
                byte[] todecode_byte = Convert.FromBase64String(data);
333

  
334
                int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
335

  
336
                char[] decoded_char = new char[charCount];
337

  
338
                utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);
339

  
340
                string result = new String(decoded_char);
341

  
342
                return result;
343
            }
344
            catch (Exception)
345
            {
346
                return data;
347
            }
348
        }
329 349
        public string Base64Decode(string data)
330 350
        {
331 351
            try
......
368 388
                using (DeepView_Entity deepViewEntity = new DeepView_Entity(ConnectStringBuilder.DeepViewConnectionString().ToString()))
369 389
                {
370 390
                    var doc = deepViewEntity.DOCUMENT_ITEM.Where(data => data.ID == EnsembleId).FirstOrDefault();
371
                    if(!string.IsNullOrEmpty(slipLink))
391
                    if(!string.IsNullOrEmpty(SlipNo))
372 392
                        doc.GROUP_NO = SlipNo;
373 393
                    if(!string.IsNullOrEmpty(slipLink))
374 394
                    {
375 395
                        if (!slipLink.Contains("http://"))
376 396
                            slipLink = Base64Decode(slipLink);
377
                        throw new Exception("doc.ENSEMBLEINFO_URL not support");
378
                        //doc.ENSEMBLEINFO_URL = slipLink;
397
                        //throw new Exception("doc.ENSEMBLEINFO_URL not support");
398
                        doc.ENSEMBLEINFO_URL = slipLink;
379 399
                    }
380 400
                    
381 401
                    deepViewEntity.SaveChanges();
......
443 463
            }
444 464
            return _result;
445 465
        }
466

  
467
        [WebMethod]
468
        public string UpdatePDFUrl(string EnsembleId, string original_url, string result_url)
469
        {
470
            string _result = null;
471
            try
472
            {
473
                using (DeepView_Entity deepViewEntity = new DeepView_Entity(ConnectStringBuilder.DeepViewConnectionString().ToString()))
474
                {
475
                    var doc = deepViewEntity.DOCUMENT_ITEM.Where(data => data.ID == EnsembleId).FirstOrDefault();
476
                    
477
                    if (!string.IsNullOrEmpty(original_url))
478
                    {
479
                        string url = original_url;
480
                        url = Base64Decode(url);
481
                        url = HttpUtility.UrlEncodeUnicode(url);
482
                        doc.ORIGINAL_FILE = url;
483
                    }
484
                    if (!string.IsNullOrEmpty(result_url))
485
                    {
486
                        doc.RESULT_FILE = result_url;
487
                    }                    
488
                    deepViewEntity.SaveChanges();
489
                    _result = true.ToString();
490
                }
491
            }
492
            catch (Exception ex)
493
            {
494
                logger.Error("Conversion Web Service UpdateVP Error", ex);
495
                _result = ex.Message.ToString();
496
            }
497
            return _result;
498
        }
499

  
500
        [WebMethod]
501
        public string DeleteVP(string id)
502
        {
503
            string _result = null;
504
            try
505
            {
506
                using (DeepView_Entity deepViewEntity = new DeepView_Entity(ConnectStringBuilder.DeepViewConnectionString().ToString()))
507
                {
508
                    var doc = deepViewEntity.DOCUMENT_ITEM.Where(data => data.ID == id).FirstOrDefault();
509

  
510
                    if (doc != null)
511
                    {
512
                        deepViewEntity.DeleteObject(doc);
513
                        deepViewEntity.SaveChanges();
514
                        _result = true.ToString();
515
                    }
516
                    else
517
                        _result = "document not found.";
518
                }
519
            }
520
            catch (Exception ex)
521
            {
522
                logger.Error("Conversion Web Service DeleteVP Error", ex);
523
                _result = ex.Message.ToString();
524
            }
525
            return _result;
526
        }
527

  
446 528
        [WebMethod]
447 529
        public string CoverConvert(string prj_No, string _id)
448 530
        {
......
497 579
                    {
498 580
                        group_No = "0";
499 581
                    }
500
                    if (!prj_No.Equals("150128"))
582
                    if (!document_Url.Contains("http%3a%2f%2f"))
501 583
                    {
502
                        //Omsk 는 웹서비스 호출 시 인코딩
503
                        //Omsk 제외는 Markus 에서 인코딩
504
                        if (!document_Url.Contains("http%3a%2f%2f"))
505
                        {
506
                            document_Url = Base64Decode(document_Url);
507
                            document_Url = HttpUtility.UrlEncodeUnicode(document_Url);
508
                        }
584
                        document_Url = Base64Decode(document_Url);
585
                        document_Url = HttpUtility.UrlEncodeUnicode(document_Url);
509 586
                    }
587
                    document_Name = Base64DecodeFromStr(document_Name);
510 588
                    var doc = _entity.DOCUMENT_ITEM.Where(d => d.ID == document_Id).FirstOrDefault();
511 589
                    if(doc != null)
512 590
                    {
ConvertService/ServiceBase/ConvertionWebService/ConvertionWebService.csproj
59 59
    </Reference>
60 60
    <Reference Include="DeepViewDataModel, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
61 61
      <SpecificVersion>False</SpecificVersion>
62
      <HintPath>..\Old_lib\DeepViewDataModel.dll</HintPath>
62
      <HintPath>..\Old_lib\daelim\DeepViewDataModel.dll</HintPath>
63 63
    </Reference>
64 64
    <Reference Include="GemBox.Spreadsheet, Version=39.3.30.1215, Culture=neutral, PublicKeyToken=b1b72c69714d4847, processorArchitecture=MSIL">
65 65
      <HintPath>..\packages\GemBox.Spreadsheet.39.3.30.1215\lib\net30\GemBox.Spreadsheet.dll</HintPath>

내보내기 Unified diff

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