duhongyu лет назад: 6
Родитель
Сommit
44f2e6b5aa

+ 27 - 14
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/IndexController.cs

@@ -239,6 +239,9 @@ namespace CallCenterApi.Interface.Controllers
239 239
                 int userId = CurrentUser.UserData.F_UserId;
240 240
                 string usercode = CurrentUser.UserData.F_UserCode;
241 241
                 int roleid = CurrentUser.UserData.F_RoleId;
242
+                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
243
+                if (userModel == null)
244
+                    return Error("无操作权限");
242 245
                 if (userId != 0)
243 246
                 {
244 247
                     var date = DateTime.Now;
@@ -246,11 +249,17 @@ namespace CallCenterApi.Interface.Controllers
246 249
                     string strMonth = date.ToString("yyyy-MM");
247 250
 
248 251
                     string uwhere = " 1=1 ";
249
-                    if (roleid != 17)
250
-                    {
251
-                        uwhere += " and UserCode='" + usercode + "' ";
252
-                    }
253
-
252
+               
253
+                        if (roleid == 17)
254
+                        {
255
+                            if (!string.IsNullOrEmpty(userModel.groupcode))
256
+                            {
257
+                            uwhere += " and groupcode = '" + userModel.groupcode + "' ";
258
+                            }
259
+                        }
260
+                        else
261
+                        uwhere += " and UserCode='" + userModel.F_UserCode + "'";
262
+                  
254 263
                     BLL.T_Call_CallRecords bll = new BLL.T_Call_CallRecords();
255 264
                     //var dayinlist = bll.GetModelList(uwhere + " and CallType='0' and CONVERT(varchar(10),BeginTime, 23)='" + strDate + "' and CallState='1' ");
256 265
                     //var dayoutlist = bll.GetModelList(uwhere + " and CallType='1' and CONVERT(varchar(10),BeginTime, 23)='" + strDate + "' and CallState='1' ");
@@ -379,30 +388,30 @@ namespace CallCenterApi.Interface.Controllers
379 388
                         var date = DateTime.Now;//DateTime.Parse("2015-04-14"); //
380 389
                         string strDate = date.ToString("yyyy-MM-dd");
381 390
                         string strMonth = date.ToString("yyyy-MM");
382
-
391
+                       
383 392
                         //BLL.T_Wo_WorkOrderBase bll = new BLL.T_Wo_WorkOrderBase();
384 393
                         //var list1 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + strDate + "' and F_WORKORDERSTATEID in (0,8) ").Tables[0];
385 394
                         //var list2 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + strDate + "' and F_WORKORDERSTATEID in (4,5,6,7,9,12,13) ").Tables[0];
386 395
                         //var list3 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(char(7),F_CREATEDATE,20)='" + strMonth + "' and F_WORKORDERSTATEID in (0,8) ").Tables[0];
387 396
                         //var list4 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(char(7),F_CREATEDATE,20)='" + strMonth + "' and F_WORKORDERSTATEID in (4,5,6,7,9,12,13) ").Tables[0];
388 397
 
389
-                        string uwhere = " 1=1 AND CONVERT(char(7),F_CreateTime,20) = '" + strMonth + "'"; ;
390
-                        if (userModel.rolecode != "XTGLY")
398
+                        string uwhere = " 1=1 "; ;
399
+                        if (!string.IsNullOrEmpty(userModel.groupcode))
391 400
                         {
392
-                            uwhere += " and F_CreateUser='" + userModel.F_UserCode + "' ";
401
+                            uwhere += " and F_GroupCode = '" + userModel.groupcode + "' ";
393 402
                         }
394 403
 
395
-                     
404
+
396 405
                         //var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State =2 and IsDel=0 ").Tables[0];
397 406
                         //var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State in (0,1) and IsDel=0 ").Tables[0];
398 407
                         //var list3 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State =2 and IsDel=0 ").Tables[0];
399 408
                         //var list4 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State in (0,1) and IsDel=0 ").Tables[0];
400 409
 
401 410
                         BLL.T_Bus_WorkOrder bll = new BLL.T_Bus_WorkOrder();
402
-                        var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),F_CreateTime, 23)='" + strDate + "' and F_State in(10) and F_IsDelete=0 ").Tables[0];
403
-                        var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),F_CreateTime, 23)='" + strDate + "' and F_State in (1,3,4,5,6) and F_IsDelete=0 ").Tables[0];
404
-                        var list3 = bll.GetList(uwhere + " and CONVERT(char(7),F_CreateTime,20)='" + strMonth + "' and F_State in(10) and F_IsDelete=0 ").Tables[0];
405
-                        var list4 = bll.GetList(uwhere + " and CONVERT(char(7),F_CreateTime,20)='" + strMonth + "' and F_State in (1,3,4,5,6) and F_IsDelete=0 ").Tables[0];
411
+                        var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),F_CreateTime, 23)='" + strDate + "' and F_State in(1) and F_IsDelete=0 ").Tables[0];
412
+                        var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),F_CreateTime, 23)='" + strDate + "' and F_State in (0) and F_IsDelete=0 ").Tables[0];
413
+                        var list3 = bll.GetList(uwhere + " and CONVERT(char(7),F_CreateTime,20)='" + strMonth + "' and F_State in(1) and F_IsDelete=0 ").Tables[0];
414
+                        var list4 = bll.GetList(uwhere + " and CONVERT(char(7),F_CreateTime,20)='" + strMonth + "' and F_State in (0) and F_IsDelete=0 ").Tables[0];
406 415
 
407 416
                         var obj = new
408 417
                         {
@@ -588,6 +597,10 @@ namespace CallCenterApi.Interface.Controllers
588 597
                         #region 权限限制    
589 598
                         string sql = "  F_IsDelete=0 ";
590 599
                         sql += " and F_CreateUser = '" + ua.F_UserCode + "' ";
600
+                        if (!string.IsNullOrEmpty(ua.groupcode))
601
+                        {
602
+                            sql += " and F_GroupCode = '" + ua.groupcode + "' ";
603
+                        }
591 604
                         #endregion
592 605
                         #region 工单各状态下数量
593 606
                         BLL.T_Bus_WorkOrder  bll = new BLL.T_Bus_WorkOrder();

+ 18 - 18
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/quality/IndexBaseController.cs

@@ -99,11 +99,11 @@ namespace CallCenterApi.Interface.Controllers.quality
99 99
 
100 100
                 Model.T_QC_IndexBase dModel = new Model.T_QC_IndexBase();
101 101
 
102
-                if (!string.IsNullOrWhiteSpace(cid.Trim()))
102
+                if (!string.IsNullOrEmpty(cid))
103 103
                 {
104 104
                     dModel.F_CategoryId = int.Parse(cid.Trim());
105 105
                 }
106
-                if (!string.IsNullOrWhiteSpace(sort.Trim()))
106
+                if (!string.IsNullOrEmpty(sort))
107 107
                 {
108 108
                     if (double.Parse(sort.Trim()) > 100000)
109 109
                     {
@@ -112,7 +112,7 @@ namespace CallCenterApi.Interface.Controllers.quality
112 112
                     else
113 113
                         dModel.F_Sort = Convert.ToInt32(sort.Trim());
114 114
                 }
115
-                if (!string.IsNullOrWhiteSpace(score.Trim()))
115
+                if (!string.IsNullOrEmpty(score))
116 116
                 {
117 117
                     if (double .Parse (score.Trim())>100000)
118 118
                     {
@@ -121,13 +121,13 @@ namespace CallCenterApi.Interface.Controllers.quality
121 121
                     else 
122 122
                     dModel.F_Score = Convert.ToInt32(score.Trim());
123 123
                 }
124
-                if (!string.IsNullOrWhiteSpace(title.Trim()))
124
+                if (!string.IsNullOrEmpty(title))
125 125
                 {
126
-                    dModel.F_Title = WebHelper.UrlDecode(title.Trim());
126
+                    dModel.F_Title = title.Trim();
127 127
                 }
128
-                if (!string.IsNullOrWhiteSpace(remark.Trim()))
128
+                if (!string.IsNullOrEmpty(remark))
129 129
                 {
130
-                    dModel.F_Remark = WebHelper.UrlDecode(remark.Trim());
130
+                    dModel.F_Remark = remark.Trim();
131 131
                 }
132 132
 
133 133
                 dModel.F_CreateOn = DateTime.Now;
@@ -151,7 +151,7 @@ namespace CallCenterApi.Interface.Controllers.quality
151 151
         }
152 152
 
153 153
         //编辑指标
154
-        public ActionResult EditIndexBase(string id, string cid, string score, string sort, string title, string remark)
154
+        public ActionResult EditIndexBase(string id, string cid, string title, string remark,string sort, string score)
155 155
         {
156 156
 
157 157
             if (Request.IsAuthenticated)
@@ -163,35 +163,35 @@ namespace CallCenterApi.Interface.Controllers.quality
163 163
                     Model.T_QC_IndexBase dModel = dBLL.GetModel(int.Parse(id.Trim()));
164 164
                     if (dModel != null)
165 165
                     {
166
-                        if (!string.IsNullOrWhiteSpace(cid.Trim()))
166
+                        if (!string.IsNullOrEmpty (cid))
167 167
                         {
168 168
                             dModel.F_CategoryId = int.Parse(cid.Trim());
169 169
                         }
170
-                        if (!string.IsNullOrWhiteSpace(sort.Trim()))
170
+                        if (!string.IsNullOrEmpty(sort))
171 171
                         {
172 172
                             if (double.Parse(sort.Trim()) > 100000)
173 173
                             {
174 174
                                 return Error("排序过大,请重新输入");
175 175
                             }
176 176
                             else
177
-                                dModel.F_Sort = Convert.ToInt32(sort.Trim());
177
+                                dModel.F_Sort = int .Parse(sort.Trim());
178 178
                         }
179
-                        if (!string.IsNullOrWhiteSpace(score.Trim()))
179
+                        if (!string.IsNullOrEmpty(score))
180 180
                         {
181
-                            if (double.Parse(sort.Trim()) > 100000)
181
+                            if (double.Parse(score.Trim()) > 100000)
182 182
                             {
183 183
                                 return Error("分值过大,请重新输入");
184 184
                             }
185 185
                             else
186
-                                dModel.F_Score = Convert.ToInt32(score.Trim());
186
+                                dModel.F_Score = int.Parse(score.Trim());
187 187
                         }
188
-                        if (!string.IsNullOrWhiteSpace(title.Trim()))
188
+                        if (!string.IsNullOrEmpty(title))
189 189
                         {
190
-                            dModel.F_Title = WebHelper.UrlDecode(title.Trim());
190
+                            dModel.F_Title = title.Trim();
191 191
                         }
192
-                        if (!string.IsNullOrWhiteSpace(remark.Trim()))
192
+                        if (!string.IsNullOrEmpty(remark))
193 193
                         {
194
-                            dModel.F_Remark = WebHelper.UrlDecode(remark.Trim());
194
+                            dModel.F_Remark = remark.Trim();
195 195
                         }
196 196
                         bool b = dBLL.Update(dModel);
197 197
                         if (b)

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/BusinessController.cs

@@ -654,7 +654,7 @@ namespace CallCenterApi.Interface.Controllers.report
654 654
                 dicwhere += " and F_GroupCode = '" + userModel.groupcode + "' ";
655 655
             }
656 656
             string sql = " select F_Name F_Typeof,(select COUNT(1) from T_Bus_WorkOrder where " + where 
657
-                + " ) Count from dbo.T_Sys_DictionaryValue where F_DictionaryFlag='GDLX' and F_State=1 " ;
657
+                + "  and  F_Typeof =F_Name ) Count from dbo.T_Sys_DictionaryValue where F_DictionaryFlag='GDLX' and F_State=1 ";
658 658
 
659 659
             DataTable dt = DbHelperSQL.Query(sql).Tables[0];
660 660