1550076451 3 gadi atpakaļ
vecāks
revīzija
c5c5cb82ea

+ 20 - 6
CallCenterApi/CallCenterApi.DAL/T_Bus_AssignedInfo.cs

@@ -37,9 +37,9 @@ namespace CallCenterApi.DAL
37 37
         {
38 38
             StringBuilder strSql = new StringBuilder();
39 39
             strSql.Append("insert into T_Bus_AssignedInfo(");
40
-            strSql.Append("F_WorkOrderId,F_MainDeptId,F_OtherDeptIds,F_AssignedOpinion,F_Remark,F_CreateUser,F_CreateTime,F_IsSure,F_State,F_SureTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_SureUser,F_FeedbackTime,F_LimitTime,F_IsOverdue,F_IsSatisfie,F_IsReload,F_ReloadUser,F_ReloadTime,F_File,F_IsNotice,F_NoticeUser,F_NoticeTime,F_IsNext,F_NextUser,F_NextTime,F_IsPerform,F_TimeResp,F_IsStandard,F_StandardIDS)");
40
+            strSql.Append("F_WorkOrderId,F_MainDeptId,F_OtherDeptIds,F_AssignedOpinion,F_Remark,F_CreateUser,F_CreateTime,F_IsSure,F_State,F_SureTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_SureUser,F_FeedbackTime,F_LimitTime,F_IsOverdue,F_IsSatisfie,F_IsReload,F_ReloadUser,F_ReloadTime,F_File,F_IsNotice,F_NoticeUser,F_NoticeTime,F_IsNext,F_NextUser,F_NextTime,F_IsPerform,F_TimeResp,F_IsStandard,F_StandardIDS,F_GroupStatistics)");
41 41
             strSql.Append(" values (");
42
-            strSql.Append("@F_WorkOrderId,@F_MainDeptId,@F_OtherDeptIds,@F_AssignedOpinion,@F_Remark,@F_CreateUser,@F_CreateTime,@F_IsSure,@F_State,@F_SureTime,@F_IsDelete,@F_DeleteUser,@F_DeleteTime,@F_SureUser,@F_FeedbackTime,@F_LimitTime,@F_IsOverdue,@F_IsSatisfie,@F_IsReload,@F_ReloadUser,@F_ReloadTime,@F_File,@F_IsNotice,@F_NoticeUser,@F_NoticeTime,@F_IsNext,@F_NextUser,@F_NextTime,@F_IsPerform,@F_TimeResp,@F_IsStandard,@F_StandardIDS)");
42
+            strSql.Append("@F_WorkOrderId,@F_MainDeptId,@F_OtherDeptIds,@F_AssignedOpinion,@F_Remark,@F_CreateUser,@F_CreateTime,@F_IsSure,@F_State,@F_SureTime,@F_IsDelete,@F_DeleteUser,@F_DeleteTime,@F_SureUser,@F_FeedbackTime,@F_LimitTime,@F_IsOverdue,@F_IsSatisfie,@F_IsReload,@F_ReloadUser,@F_ReloadTime,@F_File,@F_IsNotice,@F_NoticeUser,@F_NoticeTime,@F_IsNext,@F_NextUser,@F_NextTime,@F_IsPerform,@F_TimeResp,@F_IsStandard,@F_StandardIDS,@F_GroupStatistics)");
43 43
             strSql.Append(";select @@IDENTITY");
44 44
             SqlParameter[] parameters = {
45 45
                     new SqlParameter("@F_WorkOrderId", SqlDbType.NVarChar,50),
@@ -74,6 +74,8 @@ namespace CallCenterApi.DAL
74 74
                 new SqlParameter("@F_TimeResp", SqlDbType.DateTime),
75 75
                 new SqlParameter("@F_IsStandard", SqlDbType.Int,4),
76 76
                 new SqlParameter("@F_StandardIDS", SqlDbType.NVarChar,200),
77
+                new SqlParameter("@F_GroupStatistics", SqlDbType.NVarChar,-1),
78
+                
77 79
             };
78 80
             parameters[0].Value = model.F_WorkOrderId;
79 81
             parameters[1].Value = model.F_MainDeptId;
@@ -106,7 +108,9 @@ namespace CallCenterApi.DAL
106 108
             parameters[28].Value = model.F_IsPerform;
107 109
             parameters[29].Value = model.F_TimeResp;
108 110
             parameters[30].Value = model.F_IsStandard;
109
-            parameters[31].Value = model.F_StandardIDS; 
111
+            parameters[31].Value = model.F_StandardIDS;
112
+            parameters[32].Value = model.F_GroupStatistics;
113
+            
110 114
             object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
111 115
             if (obj == null)
112 116
             {
@@ -155,7 +159,9 @@ namespace CallCenterApi.DAL
155 159
             strSql.Append("F_IsPerform=@F_IsPerform, ");
156 160
             strSql.Append("F_TimeResp=@F_TimeResp, ");
157 161
             strSql.Append("F_IsStandard=@F_IsStandard,");
158
-            strSql.Append("F_StandardIDS=@F_StandardIDS "); 
162
+            strSql.Append("F_StandardIDS=@F_StandardIDS, ");
163
+            strSql.Append("F_GroupStatistics=@F_GroupStatistics ");
164
+            
159 165
             strSql.Append(" where F_Id=@F_Id");
160 166
             SqlParameter[] parameters = {
161 167
                     new SqlParameter("@F_WorkOrderId", SqlDbType.NVarChar,50),
@@ -190,6 +196,8 @@ namespace CallCenterApi.DAL
190 196
                     new SqlParameter("@F_TimeResp", SqlDbType.DateTime),
191 197
                     new SqlParameter("@F_IsStandard", SqlDbType.Int,4),
192 198
                 new SqlParameter("@F_StandardIDS", SqlDbType.NVarChar,200),
199
+                 new SqlParameter("@F_GroupStatistics", SqlDbType.NVarChar,-1),
200
+                
193 201
                     new SqlParameter("@F_Id", SqlDbType.Int,4)};
194 202
             parameters[0].Value = model.F_WorkOrderId;
195 203
             parameters[1].Value = model.F_MainDeptId;
@@ -223,7 +231,9 @@ namespace CallCenterApi.DAL
223 231
             parameters[29].Value = model.F_TimeResp;
224 232
             parameters[30].Value = model.F_IsStandard;
225 233
             parameters[31].Value = model.F_StandardIDS;
226
-            parameters[32].Value = model.F_Id;
234
+            parameters[32].Value = model.F_GroupStatistics;
235
+            
236
+            parameters[33].Value = model.F_Id;
227 237
 
228 238
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
229 239
             if (rows > 0)
@@ -446,7 +456,11 @@ namespace CallCenterApi.DAL
446 456
                 {
447 457
                     model.F_StandardIDS = row["F_StandardIDS"].ToString();
448 458
                 }
449
-
459
+                if (row["F_GroupStatistics"] != null)
460
+                {
461
+                    model.F_GroupStatistics = row["F_GroupStatistics"].ToString();
462
+                }
463
+                
450 464
             }
451 465
             return model;
452 466
         }

+ 129 - 5
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/knowledge/KnowledgeController.cs

@@ -1,4 +1,5 @@
1 1
 using CallCenter.Utility;
2
+using CallCenterApi.DB;
2 3
 using CallCenterApi.Interface.Controllers.Base;
3 4
 using System;
4 5
 using System.Collections.Generic;
@@ -69,6 +70,10 @@ namespace CallCenterApi.Interface.Controllers.knowledge
69 70
             {
70 71
                 sql += "and   F_CreateBy in( select F_UserId from T_Sys_UserAccount where F_DeptId ='" + deptid + "')";
71 72
             }
73
+            if (User .F_RoleCode =="WLDW")
74
+            {
75
+                sql += "and   F_CreateBy in( select F_UserId from T_Sys_UserAccount where F_DeptId ='" + User .F_DeptId  + "')";
76
+            }
72 77
             if (strpageindex.Trim() != "")
73 78
             {                    
74 79
                 pageindex = Convert.ToInt32(strpageindex);
@@ -363,15 +368,15 @@ namespace CallCenterApi.Interface.Controllers.knowledge
363 368
         }
364 369
         [Authority]
365 370
         //扣除分值
366
-        public ActionResult DeductInfo(int infoid=0,int score=0,string reason="")
371
+        public ActionResult DeductInfo(int infoid = 0, int score = 0, string reason = "")
367 372
         {
368
-            if (User .F_RoleCode =="GLY")
373
+            if (User.F_RoleCode == "GLY")
369 374
             {
370 375
                 if (infoid <= 0)
371 376
                     return Error("请选择知识库");
372 377
                 if (score > 0)
373 378
                     return Error("扣除分值不能大于0");
374
-                if (string .IsNullOrEmpty (reason))
379
+                if (string.IsNullOrEmpty(reason))
375 380
                     return Error("请输入扣分原因");
376 381
                 Model.T_RepositoryInformation dModel = infoBLL.GetModel(infoid);
377 382
                 if (dModel.F_Score == null)
@@ -380,11 +385,11 @@ namespace CallCenterApi.Interface.Controllers.knowledge
380 385
                     dModel.F_Score = dModel.F_Score + score;
381 386
                 dModel.F_Reason = reason;
382 387
                 dModel.F_Description = User.F_UserCode;
383
-               
388
+
384 389
                 if (infoBLL.Update(dModel))
385 390
                 {
386 391
                     int logid = addLog(dModel, 4);
387
-                
392
+
388 393
                     return Success("扣分成功");
389 394
                 }
390 395
                 else
@@ -396,6 +401,109 @@ namespace CallCenterApi.Interface.Controllers.knowledge
396 401
             {
397 402
                 return Error("权限不足");
398 403
             }
404
+
405
+
406
+        }
407
+
408
+
409
+        public ActionResult GetExamineScore( int deptid = 0)
410
+        {
411
+            string strstarttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
412
+            string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
413
+            DataTable dt = new DataTable();
414
+            string strpageindex = RequestString.GetQueryString("page");
415
+            int pageindex = 1;
416
+            string strpagesize = RequestString.GetQueryString("pagesize");
417
+            int pagesize = 10;
418
+            string sql = "";
419
+             if (deptid > 0)
420
+            {
421
+                sql += "and F_Deptid= '" + deptid + "'";
422
+            }
423
+            if (strstarttime.Trim() != "" && strstarttime != "undefined")
424
+            {
425
+                sql += " and F_CreateTime >=  '" + strstarttime + "'";
426
+            }
427
+            if (strendtime.Trim() != "" && strendtime != "undefined")
428
+            {
429
+                sql += " and F_CreateTime <=  '" + strendtime + "'";
430
+            }
431
+           
432
+            if (strpageindex.Trim() != "")
433
+            {
434
+                pageindex = Convert.ToInt32(strpageindex);
435
+            }
436
+
437
+            if (strpagesize.Trim() != "")
438
+            {
439
+                pagesize = Convert.ToInt32(strpagesize);
440
+            }
441
+            int recordCount = 0;
442
+            dt = BLL.PagerBLL.GetListPager(
443
+                "T_Sys_ExamineScore  a ",
444
+                "F_ID",
445
+                "*,dbo.GetDeptName(a.F_Deptid) DeptName",
446
+                sql,
447
+                "ORDER BY F_ID desc",
448
+                pagesize,
449
+                pageindex,
450
+                true,
451
+                out recordCount);
452
+
453
+            var obj = new
454
+            {
455
+                rows = dt,
456
+                total = recordCount
457
+            };
458
+            return Content(obj.ToJson());
459
+
460
+        }
461
+
462
+        [Authority]
463
+        //扣除分值
464
+        public ActionResult ExamineScore(string  item,int deptid=0,int score=0,string reason="")
465
+        {
466
+                   if (deptid<=0)
467
+                return Error("请选择部门");
468
+            if (string .IsNullOrEmpty (item))
469
+                    return Error("请选择加减分项");
470
+
471
+
472
+            string strSql = string.Format(@"INSERT INTO T_Sys_ExamineScore
473
+( [F_Item] ,[F_Score],[F_Reason] ,[F_Deptid],[F_CreateTime],[F_Month]  ,[F_CreateUser]) 
474
+                   values   ('{0}','{1}','{2}','{3}','{4}','{5}','{6}') ;select @@IDENTITY ",
475
+                  item, score, reason, deptid, DateTime .Now , DateTime.Now.ToString ("yyyyMM"), 
476
+                   User .F_UserCode );
477
+            int rows = DbHelperSQL.ExecuteSql (strSql);
478
+            if (rows > 0)
479
+            {
480
+                int logid = 0;
481
+                Model.T_RepositoryLog logModel = new Model.T_RepositoryLog();
482
+                logModel.F_Action = 4;
483
+                logModel.F_Description = item;
484
+                logModel.F_Title = item;
485
+                if (score > 0)
486
+                    logModel.F_Content = User.F_UserCode + "加分" + Math.Abs((float)score) +
487
+                        ",加分原因:" + reason;
488
+                else
489
+                    logModel.F_Content = User.F_UserCode + "扣分" + Math.Abs((float)score) +
490
+                         ",扣分原因:" + reason;
491
+                logModel.F_Expand2 = item;
492
+                var dapt = new BLL.T_Sys_Department().GetModel(deptid);
493
+                if (dapt != null)
494
+                {
495
+                    logModel.F_KeyWords = dapt.F_DeptName;
496
+                    logModel.F_Expand1 = dapt.F_DeptId.ToString();
497
+                }
498
+                logModel.F_CreateBy = User.F_UserId;
499
+                logModel.F_CreateOn = DateTime.Now;
500
+                logid = new BLL.T_RepositoryLog().Add(logModel);
501
+                return Success ("添加成功");
502
+
503
+            }
504
+            else
505
+                return Error("添加失败");
506
+               
399 507
           
400 508
 
401 509
         }
@@ -679,6 +787,22 @@ namespace CallCenterApi.Interface.Controllers.knowledge
679 787
                         }
680 788
 
681 789
                     }
790
+                    else if (rmodel.F_CreateBy!=null&&rmodel.F_CreateBy>0)
791
+                    {
792
+                        var user = new BLL.T_Sys_UserAccount().GetModel(rmodel.F_CreateBy.Value);
793
+                        if (user !=null )
794
+                        {
795
+                            if (user .F_RoleId ==2  )
796
+                            {
797
+                                var dapt = new BLL.T_Sys_Department().GetModel(user.F_DeptId );
798
+                                if (dapt != null)
799
+                                {
800
+                                    logModel.F_KeyWords = dapt.F_DeptName;
801
+                                    logModel.F_Expand1 = dapt.F_DeptId.ToString();
802
+                                }
803
+                            }
804
+                        }
805
+                    }
682 806
                 }
683 807
                 catch
684 808
                 {

+ 9 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -13238,6 +13238,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
13238 13238
                 string workorderid = RequestString.GetFormString("workorderid");
13239 13239
                 int nexttype = RequestString.GetInt("nexttype", 0);//审核通过1审核不通过2审核通过转办
13240 13240
                 int statistics = RequestString.GetInt("statistics", 0);//是否进行退回统计0否1是
13241
+                int groupstatistics = RequestString.GetInt("groupstatistics", 0);
13242
+
13241 13243
                 string cbreason = RequestString.GetFormString("cbreason");//重办原因
13242 13244
                 int issms = RequestString.GetInt("issms", 0);//是否发送短信
13243 13245
                 Model.T_Bus_WorkOrder modelT_Bus_WorkOrder = workorderBLL.GetModel(workorderid);
@@ -13342,6 +13344,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
13342 13344
                                                     modelT_Bus_AssignedInfo.F_IsPerform = 2;
13343 13345
                                                 else
13344 13346
                                                     modelT_Bus_AssignedInfo.F_IsPerform = 3;
13347
+                                                if (groupstatistics>0)
13348
+                                                modelT_Bus_AssignedInfo.F_GroupStatistics = groupstatistics.ToString ();
13349
+
13350
+
13345 13351
                                                 new BLL.T_Bus_AssignedInfo().Update(modelT_Bus_AssignedInfo);
13346 13352
                                             }
13347 13353
                                             if (workorderBLL.UpdateWorkOrder(modelT_Bus_WorkOrder.F_Id, keyValuePairs3))
@@ -13371,7 +13377,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
13371 13377
                                             if (statistics > 0)
13372 13378
                                             {
13373 13379
                                                 newmodelT_Bus_AssignedInfo.F_IsPerform = 1;
13380
+                                                if (groupstatistics > 0)
13381
+                                                    newmodelT_Bus_AssignedInfo.F_GroupStatistics = groupstatistics.ToString();
13374 13382
                                             }
13383
+
13375 13384
                                             newmodelT_Bus_AssignedInfo.F_MainDeptId = modelT_Bus_WorkOrder.F_MainDeptId;//主办单位id
13376 13385
                                             newmodelT_Bus_AssignedInfo.F_OtherDeptIds = "";//协办单位id
13377 13386
                                             newmodelT_Bus_AssignedInfo.F_AssignedOpinion = cbreason;//交办意见

+ 2 - 0
CallCenterApi/CallCenterApi.Model/T_Bus_AssignedInfo.cs

@@ -307,6 +307,8 @@ namespace CallCenterApi.Model
307 307
             set { _f_isstandard = value; }
308 308
             get { return _f_isstandard; }
309 309
         }
310
+
311
+        public string F_GroupStatistics { set; get; }
310 312
         #endregion Model
311 313
 
312 314
     }