개정판 abaa85b4
issue #1022 wcf 수정 및 final service 직접 접근 수정.
Change-Id: Iab45b6919293bf86848d3e5fa9768fae3f794410
KCOM_API/ServiceDeepView.svc.cs | ||
---|---|---|
2632 | 2632 |
GROUP_ID = data.GROUP_ID, |
2633 | 2633 |
SYMBOL_ID = data.SYMBOL_ID, |
2634 | 2634 |
DATA = data.DATA, |
2635 |
DATA_TYPE = data.DATA_TYPE |
|
2635 |
DATA_TYPE = data.DATA_TYPE, |
|
2636 |
MARKUPINFO_VERSION_ID = data.MARKUPINFO_VERSION_ID, |
|
2637 |
PAGENUMBER = data.PAGENUMBER |
|
2636 | 2638 |
}; |
2637 | 2639 |
results.Add(d); |
2638 | 2640 |
} |
... | ... | |
2673 | 2675 |
return markupInfo; |
2674 | 2676 |
} |
2675 | 2677 |
[OperationContract] |
2678 |
[ServiceKnownType(typeof(FINAL_PDF))] |
|
2679 |
public List<FINAL_PDF> FinalPDF_GetFinalPDFs(string final_id) |
|
2680 |
{ |
|
2681 |
List<FINAL_PDF> results = new List<FINAL_PDF>(); |
|
2682 |
|
|
2683 |
try |
|
2684 |
{ |
|
2685 |
using (KCOMEntities _entity = new KCOMEntities(ConnectStringBuilder.KCOMConnectionString().ToString())) |
|
2686 |
{ |
|
2687 |
var finalList = _entity.FINAL_PDF.Where(final => final.ID == final_id).ToList(); |
|
2688 |
foreach(var final in finalList) |
|
2689 |
{ |
|
2690 |
FINAL_PDF pdf = new FINAL_PDF() |
|
2691 |
{ |
|
2692 |
ID = final.ID, |
|
2693 |
DOCINFO_ID = final.DOCINFO_ID, |
|
2694 |
DOCUMENT_ID = final.DOCUMENT_ID, |
|
2695 |
STATUS = final.STATUS, |
|
2696 |
CURRENT_PAGE = final.CURRENT_PAGE, |
|
2697 |
CREATE_DATETIME = final.CREATE_DATETIME, |
|
2698 |
START_DATETIME = final.START_DATETIME, |
|
2699 |
END_DATETIME = final.END_DATETIME, |
|
2700 |
EXCEPTION = final.EXCEPTION, |
|
2701 |
PROJECT_NO = final.PROJECT_NO, |
|
2702 |
TOTAL_PAGE = final.TOTAL_PAGE, |
|
2703 |
MARKUPINFO_ID = final.MARKUPINFO_ID, |
|
2704 |
CREATE_USER_ID = final.CREATE_USER_ID |
|
2705 |
}; |
|
2706 |
results.Add(pdf); |
|
2707 |
} |
|
2708 |
} |
|
2709 |
} |
|
2710 |
catch (Exception) |
|
2711 |
{ |
|
2712 |
throw; |
|
2713 |
} |
|
2714 |
return results; |
|
2715 |
} |
|
2716 |
[OperationContract] |
|
2676 | 2717 |
[ServiceKnownType(typeof(DOCPAGE))] |
2677 | 2718 |
public List<DOCPAGE> FinalPDF_GetDocpage(string project_no, string docinfo_id) |
2678 | 2719 |
{ |
... | ... | |
2703 | 2744 |
} |
2704 | 2745 |
return results; |
2705 | 2746 |
} |
2747 |
[OperationContract] |
|
2748 |
public bool FinalPDF_SetFinalPDFStatus(string final_id, FinalStatus status) |
|
2749 |
{ |
|
2750 |
bool result = false; |
|
2751 |
|
|
2752 |
try |
|
2753 |
{ |
|
2754 |
using (KCOMEntities _entity = new KCOMEntities(ConnectStringBuilder.KCOMConnectionString().ToString())) |
|
2755 |
{ |
|
2756 |
var tmp = _entity.FINAL_PDF.Where(x => x.ID == final_id).FirstOrDefault(); |
|
2757 |
if(tmp != null) |
|
2758 |
{ |
|
2759 |
switch(status) |
|
2760 |
{ |
|
2761 |
case FinalStatus.Create: |
|
2762 |
tmp.START_DATETIME = DateTime.Now; |
|
2763 |
break; |
|
2764 |
case FinalStatus.Success: |
|
2765 |
tmp.END_DATETIME = DateTime.Now; |
|
2766 |
tmp.EXCEPTION = string.Empty; |
|
2767 |
break; |
|
2768 |
} |
|
2769 |
tmp.STATUS = (int)status; |
|
2770 |
_entity.SaveChanges(); |
|
2771 |
result = true; |
|
2772 |
} |
|
2773 |
} |
|
2774 |
} |
|
2775 |
catch (Exception) |
|
2776 |
{ |
|
2777 |
throw; |
|
2778 |
} |
|
2779 |
return result; |
|
2780 |
} |
|
2781 |
|
|
2782 |
[OperationContract] |
|
2783 |
public bool FinalPDF_SetCurrentPage(string final_id, int currentpage) |
|
2784 |
{ |
|
2785 |
bool result = false; |
|
2786 |
|
|
2787 |
try |
|
2788 |
{ |
|
2789 |
using (KCOMEntities _entity = new KCOMEntities(ConnectStringBuilder.KCOMConnectionString().ToString())) |
|
2790 |
{ |
|
2791 |
var tmp = _entity.FINAL_PDF.Where(x => x.ID == final_id).FirstOrDefault(); |
|
2792 |
if (tmp != null) |
|
2793 |
{ |
|
2794 |
tmp.CURRENT_PAGE = currentpage; |
|
2795 |
_entity.SaveChanges(); |
|
2796 |
result = true; |
|
2797 |
} |
|
2798 |
} |
|
2799 |
} |
|
2800 |
catch (Exception) |
|
2801 |
{ |
|
2802 |
throw; |
|
2803 |
} |
|
2804 |
return result; |
|
2805 |
} |
|
2806 |
[OperationContract] |
|
2807 |
public bool FinalPDF_SetError(string final_id, string msg) |
|
2808 |
{ |
|
2809 |
bool result = false; |
|
2810 |
|
|
2811 |
try |
|
2812 |
{ |
|
2813 |
using (KCOMEntities _entity = new KCOMEntities(ConnectStringBuilder.KCOMConnectionString().ToString())) |
|
2814 |
{ |
|
2815 |
var tmp = _entity.FINAL_PDF.Where(x => x.ID == final_id).FirstOrDefault(); |
|
2816 |
if (tmp != null) |
|
2817 |
{ |
|
2818 |
tmp.STATUS = (int)FinalStatus.Error; |
|
2819 |
tmp.EXCEPTION = DateTime.Now.ToShortDateString() + " " + msg; |
|
2820 |
_entity.SaveChanges(); |
|
2821 |
result = true; |
|
2822 |
} |
|
2823 |
} |
|
2824 |
} |
|
2825 |
catch (Exception) |
|
2826 |
{ |
|
2827 |
throw; |
|
2828 |
} |
|
2829 |
return result; |
|
2830 |
} |
|
2831 |
|
|
2832 |
[OperationContract] |
|
2833 |
public bool FinalPDF_SetFinalResultPath(string project_no, string document_id, string url) |
|
2834 |
{ |
|
2835 |
bool result = false; |
|
2836 |
|
|
2837 |
try |
|
2838 |
{ |
|
2839 |
using (CIEntities _entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(project_no).ToString())) |
|
2840 |
{ |
|
2841 |
var item = _entity.DOCUMENT_ITEM.Where(d => d.DOCUMENT_ID == document_id).FirstOrDefault(); |
|
2842 |
if (item != null) |
|
2843 |
{ |
|
2844 |
item.RESULT_FILE = url; |
|
2845 |
_entity.SaveChanges(); |
|
2846 |
result = true; |
|
2847 |
} |
|
2848 |
} |
|
2849 |
} |
|
2850 |
catch (Exception) |
|
2851 |
{ |
|
2852 |
throw; |
|
2853 |
} |
|
2854 |
return result; |
|
2855 |
} |
|
2856 |
[OperationContract] |
|
2857 |
[ServiceKnownType(typeof(MEMBER))] |
|
2858 |
public MEMBER FinalPDF_GetCommentMember(string project_no, string markupdata_id) |
|
2859 |
{ |
|
2860 |
MEMBER member = null; |
|
2861 |
try |
|
2862 |
{ |
|
2863 |
using (CIEntities _entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(project_no).ToString())) |
|
2864 |
{ |
|
2865 |
var data = _entity.MARKUP_DATA.Where(x => x.ID == markupdata_id).FirstOrDefault(); |
|
2866 |
string user_id = data.MARKUP_INFO_VERSION.MARKUP_INFO.USER_ID; |
|
2867 |
var person = _entity.MEMBER.Where(p => p.ID == user_id).FirstOrDefault(); |
|
2868 |
if(person != null) |
|
2869 |
{ |
|
2870 |
member = new MEMBER() |
|
2871 |
{ |
|
2872 |
ID = user_id, |
|
2873 |
NAME = person.NAME, |
|
2874 |
DEPARTMENT = person.DEPARTMENT |
|
2875 |
}; |
|
2876 |
} |
|
2877 |
} |
|
2878 |
} |
|
2879 |
catch (Exception) |
|
2880 |
{ |
|
2881 |
throw; |
|
2882 |
} |
|
2883 |
return member; |
|
2884 |
} |
|
2885 |
|
|
2886 |
[OperationContract] |
|
2887 |
[ServiceKnownType(typeof(PROPERTIES))] |
|
2888 |
public List<PROPERTIES> FinalPDF_GetProperties(string project_no) |
|
2889 |
{ |
|
2890 |
List<PROPERTIES> results = new List<PROPERTIES>(); |
|
2891 |
try |
|
2892 |
{ |
|
2893 |
using (KCOMEntities _entity = new KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString())) |
|
2894 |
{ |
|
2895 |
var _items = _entity.PROPERTIES.Where(x => x.PROPERTY == project_no).ToList(); |
|
2896 |
foreach(var item in _items) |
|
2897 |
{ |
|
2898 |
PROPERTIES pROPERTIES = new PROPERTIES() |
|
2899 |
{ |
|
2900 |
ID = item.ID, |
|
2901 |
PROPERTY = item.PROPERTY, |
|
2902 |
TYPE = item.TYPE, |
|
2903 |
VALUE = item.VALUE |
|
2904 |
}; |
|
2905 |
results.Add(pROPERTIES); |
|
2906 |
} |
|
2907 |
} |
|
2908 |
|
|
2909 |
} |
|
2910 |
catch (Exception) |
|
2911 |
{ |
|
2912 |
throw; |
|
2913 |
} |
|
2914 |
return results; |
|
2915 |
} |
|
2706 | 2916 |
#endregion |
2707 | 2917 |
} |
2708 | 2918 |
} |
내보내기 Unified diff