프로젝트

일반

사용자정보

개정판 285635d3

ID285635d34640179ecc77391116bcc804f6fb6eef
상위 a6e5055d
하위 86bff326

김태성이(가) 약 5년 전에 추가함

markus api의 Member 가져오는 Entity를 모두 쿼리로 변경

Change-Id: I028e1983be064366fdb95282874f9c2c7bc3901f

차이점 보기:

INI/MARKUS_HyoSung_Debug.ini
3 3
[External]
4 4
IP=10.11.252.3:8975
5 5
[BaseClientAddress]
6
URL=http://10.11.252.3:8975
6
URL=http://localhost:8080
7 7
[HubAddress]
8 8
URL=http://10.11.252.3:8975/
9 9
[UpdateVer64]
KCOM/Events/Implementation/TopMenuEvent.cs
457 457

  
458 458
            markupinfo = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetPrintDocItemList(App.ViewInfo.ProjectNO, App.ViewInfo.DocumentItemID, ViewerDataModel.Instance._markupInfoList.ToList());
459 459

  
460
            if (markupinfo.Count() > 0)
460
            if (markupinfo?.Count() > 0)
461 461
            {
462 462
                Logger.sendResLog("GetPrintDocItemList", "TRUE", 1);
463 463
            }
KCOM_API/Properties/PublishProfiles/FolderProfile.pubxml.user
10 10
  </PropertyGroup>
11 11
  <ItemGroup>
12 12
    <File Include="bin/CommonLib.dll">
13
      <publishTime>03/09/2020 11:07:52</publishTime>
13
      <publishTime>03/09/2020 11:28:50</publishTime>
14 14
    </File>
15 15
    <File Include="bin/CommonLib.pdb">
16
      <publishTime>03/09/2020 11:07:52</publishTime>
16
      <publishTime>03/09/2020 11:28:50</publishTime>
17 17
    </File>
18 18
    <File Include="bin/CompareLib.dll">
19 19
      <publishTime>03/27/2018 10:07:16</publishTime>
......
52 52
      <publishTime>09/19/2015 15:28:04</publishTime>
53 53
    </File>
54 54
    <File Include="bin/IFinalPDF.dll">
55
      <publishTime>03/09/2020 11:07:52</publishTime>
55
      <publishTime>03/09/2020 11:28:50</publishTime>
56 56
    </File>
57 57
    <File Include="bin/IFinalPDF.pdb">
58
      <publishTime>03/09/2020 11:07:52</publishTime>
58
      <publishTime>03/09/2020 11:28:50</publishTime>
59 59
    </File>
60 60
    <File Include="bin/IKCOM.dll">
61
      <publishTime>03/09/2020 11:07:54</publishTime>
61
      <publishTime>03/09/2020 11:28:53</publishTime>
62 62
    </File>
63 63
    <File Include="bin/IKCOM.pdb">
64
      <publishTime>03/09/2020 11:07:54</publishTime>
64
      <publishTime>03/09/2020 11:28:53</publishTime>
65 65
    </File>
66 66
    <File Include="bin/it/ZedGraph.resources.dll">
67 67
      <publishTime>09/19/2015 15:28:04</publishTime>
......
70 70
      <publishTime>09/19/2015 15:28:04</publishTime>
71 71
    </File>
72 72
    <File Include="bin/KCOMDataModel.dll">
73
      <publishTime>03/09/2020 11:07:52</publishTime>
73
      <publishTime>03/09/2020 11:28:51</publishTime>
74 74
    </File>
75 75
    <File Include="bin/KCOMDataModel.dll.config">
76 76
      <publishTime>07/10/2019 14:11:36</publishTime>
77 77
    </File>
78 78
    <File Include="bin/KCOMDataModel.pdb">
79
      <publishTime>03/09/2020 11:07:52</publishTime>
79
      <publishTime>03/09/2020 11:28:51</publishTime>
80 80
    </File>
81 81
    <File Include="bin/KCOM_API.dll">
82
      <publishTime>03/09/2020 11:09:14</publishTime>
82
      <publishTime>03/10/2020 10:53:51</publishTime>
83 83
    </File>
84 84
    <File Include="bin/KCOM_API.pdb">
85
      <publishTime>03/09/2020 11:09:14</publishTime>
85
      <publishTime>03/10/2020 10:53:51</publishTime>
86 86
    </File>
87 87
    <File Include="bin/Leadtools.Codecs.Cmp.dll">
88 88
      <publishTime>06/29/2017 11:38:22</publishTime>
......
190 190
      <publishTime>07/10/2019 14:11:36</publishTime>
191 191
    </File>
192 192
    <File Include="Web.config">
193
      <publishTime>03/09/2020 11:09:14</publishTime>
193
      <publishTime>03/10/2020 10:53:51</publishTime>
194 194
    </File>
195 195
  </ItemGroup>
196 196
</Project>
KCOM_API/ServiceDeepView.svc.cs
890 890
            List<MEMBER> _result = new List<MEMBER>();
891 891

  
892 892
            string sCIConnString = ConfigurationManager.ConnectionStrings["CIConnectionString"].ConnectionString;
893

  
893 894
            using (CIEntities entity = new CIEntities(sCIConnString))
894 895
            {
895
                var _UserList = from member in entity.MEMBER
896
                                where member.ID == UserID
897
                                select member;
898
                _result = _UserList.ToList();
896
                _result = GetMemberQuery(entity, UserID);
899 897
            }
900 898
            //GC.Collect(2);
901 899
            return _result;
......
2092 2090
                string sCIConnString = ConfigurationManager.ConnectionStrings["CIConnectionString"].ConnectionString;
2093 2091
                using (CIEntities Entity = new CIEntities(sCIConnString))
2094 2092
                {
2095
                    string user_dept = Entity.MEMBER.Where(m => m.ID == _user_id).FirstOrDefault().DEPARTMENT;
2096
                    var markupInfos = Entity.MARKUP_INFO.Where(entity => entity.DOCINFO_ID == _doc_id
2097
                    && entity.PART_CONSOLIDATE == 1
2098
                    ).OrderByDescending(j => j.CREATE_TIME).ToList();
2093
                    var members = GetMemberQuery(Entity, _user_id);
2094

  
2095
                    string user_dept = "";
2096

  
2097
                    if(members.Count() > 0)
2098
                    {
2099
                        user_dept = members.First().DEPARTMENT;
2100
                    }
2101
                    
2102
                    var markupInfos = Entity.MARKUP_INFO.Where(entity => entity.DOCINFO_ID == _doc_id && entity.PART_CONSOLIDATE == 1)
2103
                                        .OrderByDescending(j => j.CREATE_TIME).ToList();
2104

  
2099 2105
                    foreach (var markupinfo in markupInfos)
2100 2106
                    {
2101
                        string markupdept = Entity.MEMBER.Where(m => m.ID == markupinfo.USER_ID).FirstOrDefault().DEPARTMENT;
2107
                        string markupdept = "";
2108

  
2109
                        var markupMembers = GetMemberQuery(Entity, markupinfo.USER_ID);
2110

  
2111
                        if (markupMembers.Count() > 0)
2112
                        {
2113
                            markupdept = markupMembers.First().DEPARTMENT;
2114
                        }
2115

  
2102 2116
                        if (user_dept == markupdept)
2103 2117
                        {
2104 2118
                            markupinfo.AVOID_CONSOLIDATE = 1;
......
2169 2183
                string sCIConnString = ConfigurationManager.ConnectionStrings["CIConnectionString"].ConnectionString;
2170 2184
                using (CIEntities Entity = new CIEntities(sCIConnString))
2171 2185
                {
2172
                    string query = "SELECT members.ID,members.NAME,members.DEPARTMENT FROM CIEntities.MEMBER as members where members.ID = @userId";
2186
                    var members = GetMemberQuery(Entity, user_id);
2173 2187

  
2174
                    var param = new[] { new System.Data.Objects.ObjectParameter("userId", user_id) };
2188
                    if(members.Count() > 0)
2189
                    {
2190
                        rstmember = members.First();
2191
                    }
2192
                }
2193
            }
2194
            catch (Exception ex)
2195
            {
2196
                return null;
2197
            }
2198
            return rstmember;
2199
        }
2175 2200

  
2176
                    System.Data.Objects.ObjectQuery<System.Data.Common.DbDataRecord> memberQuery
2177
                                  = Entity.CreateQuery<System.Data.Common.DbDataRecord>(query, param);
2201
        private  List<MEMBER> GetMemberQuery(System.Data.Objects.ObjectContext context, string UserID)
2202
        {
2203
            List<MEMBER> result = new List<MEMBER>();
2178 2204

  
2179
                    if (memberQuery.Count() > 0)
2205
            try
2206
            {
2207
                string query = "SELECT members.ID,members.NAME,members.DEPARTMENT FROM CIEntities.MEMBER as members where members.ID = @userId";
2208

  
2209
                var param = new[] { new System.Data.Objects.ObjectParameter("userId", UserID) };
2210

  
2211
                System.Data.Objects.ObjectQuery<System.Data.Common.DbDataRecord> memberQuery
2212
                              = context.CreateQuery<System.Data.Common.DbDataRecord>(query, param);
2213

  
2214
                if (memberQuery.Count() > 0)
2215
                {
2216
                    foreach (var dataRecord in memberQuery)
2180 2217
                    {
2181
                        rstmember = new MEMBER();
2218
                        MEMBER member = new MEMBER();
2219

  
2220
                        string userName = dataRecord["NAME"]?.ToString().Trim();
2221
                        string ID = dataRecord["ID"]?.ToString().Trim();
2222
                        string depatment = dataRecord["DEPARTMENT"]?.ToString().Trim();
2182 2223

  
2183
                        string userName = memberQuery.First()["NAME"]?.ToString().Trim();
2184
                        string ID = memberQuery.First()["ID"]?.ToString().Trim();
2185
                        string depatment = memberQuery.First()["DEPARTMENT"]?.ToString().Trim();
2224
                        member.NAME = userName;
2225
                        member.ID = ID;
2226
                        member.DEPARTMENT = depatment;
2186 2227

  
2187
                        rstmember.NAME = userName;
2188
                        rstmember.ID = ID;
2189
                        rstmember.DEPARTMENT = depatment;
2228
                        result.Add(member);
2190 2229
                    }
2191 2230
                }
2192 2231
            }
2193 2232
            catch (Exception ex)
2194 2233
            {
2195
                return null;
2234
                throw new Exception("GetMember(System.Data.Objects.ObjectContext context, string UserID) " , ex);
2196 2235
            }
2197
            return rstmember;
2236

  
2237
            return result;
2198 2238
        }
2199 2239

  
2200 2240
        [WebMethod]
......
2439 2479

  
2440 2480
                    foreach (MARKUP_INFO markinfo in docitem.MARKUP_INFO)
2441 2481
                    {
2442
                        var member = (from mem in Entity.MEMBER
2443
                                     where mem.ID == markinfo.USER_ID
2444
                                     select mem).First();
2482
                        var members = GetMemberQuery(Entity, markinfo.USER_ID);
2483

  
2484
                        MEMBER member = new MEMBER();
2485

  
2486
                        if (members.Count() > 0)
2487
                        {
2488
                            member = members.First();
2489
                        }
2490

  
2445 2491
                        string displaycolor = null;
2492

  
2446 2493
                        try
2447 2494
                        {
2448 2495
                            displaycolor = _markupInfoList.Where(info => info.MarkupInfoID == markinfo.ID).First().DisplayColor;
......
2482 2529
                    }
2483 2530
                }
2484 2531
            }
2485
            catch (Exception)
2532
            catch (Exception ex)
2486 2533
            {
2487 2534
                return null;
2488 2535
            }
......
2957 3004
                {
2958 3005
                    var data = _entity.MARKUP_DATA.Where(x => x.ID == markupdata_id).FirstOrDefault();
2959 3006
                    string user_id = data.MARKUP_INFO_VERSION.MARKUP_INFO.USER_ID;
2960
                    var person = _entity.MEMBER.Where(p => p.ID == user_id).FirstOrDefault();
2961
                    if(person != null)
3007

  
3008
                    var person = GetMemberQuery(_entity,user_id);
3009

  
3010
                    if(person.Count() > 0)
2962 3011
                    {
2963
                        member = new MEMBER()
2964
                        {
2965
                            ID = user_id,
2966
                            NAME = person.NAME,
2967
                            DEPARTMENT = person.DEPARTMENT
2968
                        };
3012
                        member = person.First();
2969 3013
                    }
2970 3014
                }
2971 3015
            }
......
2973 3017
            {
2974 3018
                throw;
2975 3019
            }
3020

  
2976 3021
            return member;
2977 3022
        }
2978 3023

  

내보내기 Unified diff

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