|
|
@@ -20,7 +20,7 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
20
|
20
|
private BLL.T_Sys_RoleInfo rolebll = new BLL.T_Sys_RoleInfo();
|
|
21
|
21
|
|
|
22
|
22
|
// 获取知识库列表
|
|
23
|
|
- public ActionResult GetList(string title, string content,string keywords, string pid,int deptid=0)
|
|
|
23
|
+ public ActionResult GetList(string title, string content,string keywords, string pid,int deptid=0,int deptids=0)
|
|
24
|
24
|
{
|
|
25
|
25
|
string issub = RequestString.GetQueryString("issub");
|
|
26
|
26
|
string ispass = RequestString.GetQueryString("ispass");
|
|
|
@@ -71,7 +71,12 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
71
|
71
|
|
|
72
|
72
|
if (deptid >0)
|
|
73
|
73
|
{
|
|
74
|
|
- sql += "and F_CreateBy in( select F_UserId from T_Sys_UserAccount where F_DeptId ='" + deptid + "')";
|
|
|
74
|
+ sql += "and F_CreateBy in( select F_UserId from T_Sys_UserAccount where F_DeptId ='" + deptid + "')";
|
|
|
75
|
+ }
|
|
|
76
|
+ if (deptids > 0)
|
|
|
77
|
+ {
|
|
|
78
|
+ sql += $" and F_DeptId='{deptids}'";
|
|
|
79
|
+ // sql += "and F_CreateBy in( select F_UserId from T_Sys_UserAccount where F_DeptId ='" + deptid + "')";
|
|
75
|
80
|
}
|
|
76
|
81
|
if (User .F_RoleCode =="WLDW")
|
|
77
|
82
|
{
|
|
|
@@ -99,7 +104,7 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
99
|
104
|
"T_RepositoryInformation a",
|
|
100
|
105
|
"F_RepositoryId",
|
|
101
|
106
|
"*,(select F_CategoryName from T_RepositoryCategory where F_CategoryId =a.F_CategoryId )as CategoryName" +
|
|
102
|
|
- ",dbo.GetDeptName(CONVERT (int ,(select F_DeptId from T_Sys_UserAccount where F_UserId = a.F_CreateBy)) ) DeptName ",
|
|
|
107
|
+ ",dbo.GetDeptName(CONVERT (int ,(select F_DeptId from T_Sys_UserAccount where F_UserId = a.F_CreateBy)) ) DeptName,dbo.GetDeptName(F_DeptId) DeptNames ",
|
|
103
|
108
|
sql,
|
|
104
|
109
|
"ORDER BY F_RepositoryId desc",
|
|
105
|
110
|
pagesize,
|
|
|
@@ -239,7 +244,7 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
239
|
244
|
}
|
|
240
|
245
|
int recordCount = 0;
|
|
241
|
246
|
dt = BLL.PagerBLL.GetListPager(
|
|
242
|
|
- "T_RepositoryAudit",
|
|
|
247
|
+ "T_RepositoryAudit a ",
|
|
243
|
248
|
"F_AuditId",
|
|
244
|
249
|
"*",
|
|
245
|
250
|
sql,
|
|
|
@@ -256,7 +261,9 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
256
|
261
|
{
|
|
257
|
262
|
var preContent = ""; var afterContent = "";
|
|
258
|
263
|
var predis = ""; var afterdis = "";
|
|
259
|
|
- var title = ""; var ptitle = ""; var atitle = "";
|
|
|
264
|
+ var title = ""; var ptitle = ""; var atitle = "";string deptname = "";
|
|
|
265
|
+ string CategoryName = "";
|
|
|
266
|
+
|
|
260
|
267
|
if (x.F_PreLogID != null)
|
|
261
|
268
|
{
|
|
262
|
269
|
Model.T_RepositoryLog logModel = logList.Where(y => y.F_LogId == x.F_PreLogID.Value).FirstOrDefault();
|
|
|
@@ -265,6 +272,19 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
265
|
272
|
preContent = logModel.F_Content;
|
|
266
|
273
|
predis = logModel.F_Description;
|
|
267
|
274
|
ptitle = logModel.F_Title;
|
|
|
275
|
+ if (logModel.F_DeptId >0)
|
|
|
276
|
+ {
|
|
|
277
|
+ var dept = new BLL.T_Sys_Department().GetModel(logModel.F_DeptId.Value);
|
|
|
278
|
+ if (dept != null)
|
|
|
279
|
+ deptname = dept.F_DeptName;
|
|
|
280
|
+ }
|
|
|
281
|
+ if (logModel.F_IntExpand1 > 0)
|
|
|
282
|
+ {
|
|
|
283
|
+ var Category = new BLL.T_RepositoryCategory().GetModel(logModel.F_IntExpand1.Value);
|
|
|
284
|
+ if (Category != null)
|
|
|
285
|
+ CategoryName = Category.F_CategoryName ;
|
|
|
286
|
+ }
|
|
|
287
|
+
|
|
268
|
288
|
}
|
|
269
|
289
|
}
|
|
270
|
290
|
if (x.F_AfterLogID != null)
|
|
|
@@ -275,6 +295,18 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
275
|
295
|
afterContent = logModel.F_Content;
|
|
276
|
296
|
afterdis = logModel.F_Description;
|
|
277
|
297
|
atitle = logModel.F_Title;
|
|
|
298
|
+ if (logModel.F_DeptId > 0)
|
|
|
299
|
+ {
|
|
|
300
|
+ var dept = new BLL.T_Sys_Department().GetModel(logModel.F_DeptId.Value);
|
|
|
301
|
+ if (dept != null)
|
|
|
302
|
+ deptname = dept.F_DeptName;
|
|
|
303
|
+ }
|
|
|
304
|
+ if (logModel.F_IntExpand1 > 0)
|
|
|
305
|
+ {
|
|
|
306
|
+ var Category = new BLL.T_RepositoryCategory().GetModel(logModel.F_IntExpand1.Value);
|
|
|
307
|
+ if (Category != null)
|
|
|
308
|
+ CategoryName = Category.F_CategoryName;
|
|
|
309
|
+ }
|
|
278
|
310
|
}
|
|
279
|
311
|
}
|
|
280
|
312
|
if (ptitle != "")
|
|
|
@@ -291,7 +323,9 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
291
|
323
|
F_AfterDescription = afterdis,
|
|
292
|
324
|
F_ISPass = x.F_ISPass,
|
|
293
|
325
|
F_AuditRemark = x.F_AuditRemark,
|
|
294
|
|
-
|
|
|
326
|
+ DeptName= deptname,
|
|
|
327
|
+ CategoryName= CategoryName
|
|
|
328
|
+
|
|
295
|
329
|
};
|
|
296
|
330
|
}),
|
|
297
|
331
|
total = recordCount
|
|
|
@@ -530,7 +564,7 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
530
|
564
|
|
|
531
|
565
|
[Authority]
|
|
532
|
566
|
//添加知识库
|
|
533
|
|
- public ActionResult AddInfo(string title, string con, string pid,string key, int issub=1, int keyid = 0,int demandsid=0)
|
|
|
567
|
+ public ActionResult AddInfo(string title, string con, string pid,string key, int deptid = 0, int issub=1, int keyid = 0,int demandsid=0)
|
|
534
|
568
|
{
|
|
535
|
569
|
Model.T_RepositoryInformation dModel = new Model.T_RepositoryInformation();
|
|
536
|
570
|
if (string.IsNullOrEmpty(title))
|
|
|
@@ -541,7 +575,14 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
541
|
575
|
dModel.F_Title = title.Trim();
|
|
542
|
576
|
dModel.F_Content = WebHelper.UrlDecode(con.Trim());
|
|
543
|
577
|
dModel.F_CategoryId = int.Parse(pid);
|
|
|
578
|
+ dModel.F_DeptId = deptid;
|
|
|
579
|
+
|
|
544
|
580
|
dModel.F_Description = WebHelper.NoHtml(WebHelper.UrlDecode(con.Trim()));
|
|
|
581
|
+ if (User.F_RoleCode=="GLY")
|
|
|
582
|
+ {
|
|
|
583
|
+ dModel.F_ISPass = 1;
|
|
|
584
|
+ }
|
|
|
585
|
+ else
|
|
545
|
586
|
dModel.F_ISPass = 0;
|
|
546
|
587
|
dModel.F_ISSubmitAudit = issub;
|
|
547
|
588
|
dModel.F_CreateOn = DateTime.Now;
|
|
|
@@ -569,8 +610,26 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
569
|
610
|
}
|
|
570
|
611
|
dModel.F_RepositoryId = b;
|
|
571
|
612
|
int logid = addLog(dModel, 1);
|
|
572
|
|
- int auditid = addaudit(b, 1, null, logid);
|
|
573
|
|
- new BLL.T_RepositoryInformation().UpdateAuditID(b, auditid);
|
|
|
613
|
+ if (User.F_RoleCode != "GLY")
|
|
|
614
|
+ {
|
|
|
615
|
+ int auditid = addaudit(b, 1, null, logid);
|
|
|
616
|
+ new BLL.T_RepositoryInformation().UpdateAuditID(b, auditid);
|
|
|
617
|
+
|
|
|
618
|
+
|
|
|
619
|
+ }
|
|
|
620
|
+ else
|
|
|
621
|
+ {
|
|
|
622
|
+ Task.Run(() =>
|
|
|
623
|
+ {
|
|
|
624
|
+ WebClient web = new WebClient();
|
|
|
625
|
+ web.Encoding = Encoding.UTF8;
|
|
|
626
|
+ string Dataurl = web.DownloadString(FrontUrl + "Affairs/kinfo_add?id=" + b);
|
|
|
627
|
+
|
|
|
628
|
+ }).ContinueWith(p =>
|
|
|
629
|
+ {
|
|
|
630
|
+ System.Diagnostics.Debug.WriteLine(DateTime.Now);
|
|
|
631
|
+ });
|
|
|
632
|
+ }
|
|
574
|
633
|
return Success("添加成功");
|
|
575
|
634
|
}
|
|
576
|
635
|
else
|
|
|
@@ -581,7 +640,7 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
581
|
640
|
}
|
|
582
|
641
|
[Authority]
|
|
583
|
642
|
//编辑知识库
|
|
584
|
|
- public ActionResult EditInfo(string infoid, string title, string con, string pid,string key, int? issub, int keyid = 0)
|
|
|
643
|
+ public ActionResult EditInfo(string infoid, string title, string con, string pid,string key, int? issub,int deptid=0, int keyid = 0)
|
|
585
|
644
|
{
|
|
586
|
645
|
Model.T_RepositoryInformation dModel = infoBLL.GetModel(int.Parse(infoid.Trim()));
|
|
587
|
646
|
if (dModel != null)
|
|
|
@@ -607,28 +666,32 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
607
|
666
|
{
|
|
608
|
667
|
dModel.F_ISSubmitAudit = issub;
|
|
609
|
668
|
}
|
|
|
669
|
+ if (deptid>0)
|
|
|
670
|
+ dModel.F_DeptId = deptid;
|
|
610
|
671
|
dModel.F_KeyWords = key;
|
|
611
|
|
-
|
|
612
|
|
- Model.T_RepositoryAudit audModel = new Model.T_RepositoryAudit();
|
|
613
|
|
- if (dModel.F_AuditID != null)
|
|
614
|
|
- audModel = new BLL.T_RepositoryAudit().GetModel(dModel.F_AuditID.Value);
|
|
615
|
672
|
|
|
616
|
|
- int logid = addLog(dModel, 2);
|
|
617
|
|
- if (logid > 0)
|
|
618
|
|
- {
|
|
619
|
|
- string content = $"{User.F_UserName}({User.F_UserCode })编辑知识库{ dModel.F_Title }";
|
|
620
|
|
- string Operation = OperationLogController
|
|
621
|
|
- .AddOperationList(content, User.F_UserCode, Common.DTRequest.GetIP(), 1, 4594, dModel.F_RepositoryId);
|
|
|
673
|
+ Model.T_RepositoryAudit audModel = new Model.T_RepositoryAudit();
|
|
|
674
|
+ if (dModel.F_AuditID != null)
|
|
|
675
|
+ audModel = new BLL.T_RepositoryAudit().GetModel(dModel.F_AuditID.Value);
|
|
622
|
676
|
|
|
623
|
|
- int auditid = addaudit(int.Parse(infoid.Trim()), 2, audModel.F_AfterLogID, logid);
|
|
624
|
|
- new BLL.T_RepositoryInformation().UpdateAuditID(int.Parse(infoid.Trim()), auditid);
|
|
625
|
|
- infoBLL.UpdateSubAudit(int.Parse(infoid.Trim()), 1);
|
|
626
|
|
- return Success("保存成功");
|
|
627
|
|
- }
|
|
628
|
|
- else
|
|
629
|
|
- {
|
|
630
|
|
- return Success("保存失败");
|
|
631
|
|
- }
|
|
|
677
|
+ int logid = addLog(dModel, 2);
|
|
|
678
|
+ if (logid > 0)
|
|
|
679
|
+ {
|
|
|
680
|
+ string content = $"{User.F_UserName}({User.F_UserCode })编辑知识库{ dModel.F_Title }";
|
|
|
681
|
+ string Operation = OperationLogController
|
|
|
682
|
+ .AddOperationList(content, User.F_UserCode, Common.DTRequest.GetIP(), 1, 4594, dModel.F_RepositoryId);
|
|
|
683
|
+
|
|
|
684
|
+ int auditid = addaudit(int.Parse(infoid.Trim()), 2, audModel.F_AfterLogID, logid);
|
|
|
685
|
+ new BLL.T_RepositoryInformation().UpdateAuditID(int.Parse(infoid.Trim()), auditid);
|
|
|
686
|
+ infoBLL.UpdateSubAudit(int.Parse(infoid.Trim()), 1);
|
|
|
687
|
+ return Success("保存成功");
|
|
|
688
|
+ }
|
|
|
689
|
+ else
|
|
|
690
|
+ {
|
|
|
691
|
+ return Success("保存失败");
|
|
|
692
|
+ }
|
|
|
693
|
+
|
|
|
694
|
+
|
|
632
|
695
|
}
|
|
633
|
696
|
else
|
|
634
|
697
|
{
|
|
|
@@ -647,22 +710,37 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
647
|
710
|
Model.T_RepositoryInformation dModel = infoBLL.GetModel(int.Parse(str.Trim()));
|
|
648
|
711
|
if (dModel != null)
|
|
649
|
712
|
{
|
|
650
|
|
- Model.T_RepositoryAudit audModel = new Model.T_RepositoryAudit();
|
|
651
|
|
- if (dModel.F_AuditID != null)
|
|
652
|
|
- audModel = new BLL.T_RepositoryAudit().GetModel(dModel.F_AuditID.Value);
|
|
|
713
|
+ if (User .F_RoleCode =="GLY")
|
|
|
714
|
+ {
|
|
|
715
|
+ if ( infoBLL.Delete(dModel.F_RepositoryId))
|
|
|
716
|
+ {
|
|
|
717
|
+ string content = $"{User.F_UserName}({User.F_UserCode })删除知识库{ dModel.F_Title }";
|
|
|
718
|
+ string Operation = OperationLogController
|
|
|
719
|
+ .AddOperationList(content, User.F_UserCode, Common.DTRequest.GetIP(), 2, 4594, dModel.F_RepositoryId);
|
|
|
720
|
+ c++;
|
|
|
721
|
+ }
|
|
653
|
722
|
|
|
654
|
|
- int logid = addLog(dModel, 3);
|
|
655
|
|
- if (logid > 0)
|
|
|
723
|
+ }
|
|
|
724
|
+ else
|
|
656
|
725
|
{
|
|
657
|
|
- string content = $"{User.F_UserName}({User.F_UserCode })删除知识库{ dModel.F_Title }";
|
|
658
|
|
- string Operation = OperationLogController
|
|
659
|
|
- .AddOperationList(content, User.F_UserCode, Common.DTRequest.GetIP(), 2, 4594, dModel.F_RepositoryId);
|
|
660
|
|
-
|
|
661
|
|
- int auditid = addaudit(int.Parse(str.Trim()), 3, audModel.F_AfterLogID, logid);
|
|
662
|
|
- infoBLL.UpdateSubAudit(int.Parse(str.Trim()), 1);
|
|
663
|
|
- infoBLL.UpdateAuditID(int.Parse(str.Trim()), auditid);
|
|
664
|
|
- c++;
|
|
|
726
|
+ Model.T_RepositoryAudit audModel = new Model.T_RepositoryAudit();
|
|
|
727
|
+ if (dModel.F_AuditID != null)
|
|
|
728
|
+ audModel = new BLL.T_RepositoryAudit().GetModel(dModel.F_AuditID.Value);
|
|
|
729
|
+
|
|
|
730
|
+ int logid = addLog(dModel, 3);
|
|
|
731
|
+ if (logid > 0)
|
|
|
732
|
+ {
|
|
|
733
|
+ string content = $"{User.F_UserName}({User.F_UserCode })删除知识库{ dModel.F_Title }";
|
|
|
734
|
+ string Operation = OperationLogController
|
|
|
735
|
+ .AddOperationList(content, User.F_UserCode, Common.DTRequest.GetIP(), 2, 4594, dModel.F_RepositoryId);
|
|
|
736
|
+
|
|
|
737
|
+ int auditid = addaudit(int.Parse(str.Trim()), 3, audModel.F_AfterLogID, logid);
|
|
|
738
|
+ infoBLL.UpdateSubAudit(int.Parse(str.Trim()), 1);
|
|
|
739
|
+ infoBLL.UpdateAuditID(int.Parse(str.Trim()), auditid);
|
|
|
740
|
+ c++;
|
|
|
741
|
+ }
|
|
665
|
742
|
}
|
|
|
743
|
+
|
|
666
|
744
|
}
|
|
667
|
745
|
}
|
|
668
|
746
|
if (c == ids.Length)
|
|
|
@@ -768,6 +846,8 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
768
|
846
|
infoModel.F_Content = logModel.F_Content;
|
|
769
|
847
|
infoModel.F_ISPass = ispass;
|
|
770
|
848
|
infoModel.F_KeyWords = logModel.F_KeyWords;
|
|
|
849
|
+ infoModel.F_DeptId = logModel.F_DeptId;
|
|
|
850
|
+
|
|
771
|
851
|
infoModel.F_Key = logModel.F_IntExpand2;
|
|
772
|
852
|
string content = $"{User.F_UserName}({User.F_UserCode })审核通过了知识库{ infoModel.F_Title }修改";
|
|
773
|
853
|
string Operation = OperationLogController
|
|
|
@@ -835,8 +915,8 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
835
|
915
|
logModel.F_Action = action;
|
|
836
|
916
|
logModel.F_Description = rmodel.F_Description;
|
|
837
|
917
|
logModel.F_IntExpand1 = rmodel.F_CategoryId;
|
|
838
|
|
-
|
|
839
|
|
- if(action==4)
|
|
|
918
|
+ logModel.F_DeptId = rmodel.F_DeptId;
|
|
|
919
|
+ if (action==4)
|
|
840
|
920
|
{
|
|
841
|
921
|
logModel.F_Title = rmodel.F_Title;
|
|
842
|
922
|
logModel.F_Content = User.F_UserCode +"扣分"+Math .Abs ((float )rmodel.F_Score )+
|