|
|
@@ -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;
|
|
|
@@ -75,7 +76,7 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
75
|
76
|
#region 获取分类信息
|
|
76
|
77
|
dt.Columns.Add("CategoryId", typeof(string)); //分类id
|
|
77
|
78
|
dt.Columns.Add("CategoryName", typeof(string)); //分类名称
|
|
78
|
|
- dt.Columns.Add("isfavorites", typeof(string)); //是否收藏0未收藏,1收藏
|
|
|
79
|
+ dt.Columns.Add("favoritesid", typeof(string)); //是否收藏0未收藏,>0收藏
|
|
79
|
80
|
var list = bllcategory.DataTableToList(bllcategory.GetList(" 1=1 ").Tables[0]);
|
|
80
|
81
|
var listFavorites = bllfavorites.DataTableToList(bllfavorites.GetList($" 1=1 and UserId = {userid} ").Tables[0]);
|
|
81
|
82
|
foreach (DataRow dr in dt.Rows)
|
|
|
@@ -87,11 +88,11 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
87
|
88
|
dr["CategoryName"] = modelcategory.F_CategoryName;
|
|
88
|
89
|
}
|
|
89
|
90
|
//添加是否收藏
|
|
90
|
|
- dr["isfavorites"] = 0;
|
|
|
91
|
+ dr["favoritesid"] = 0;
|
|
91
|
92
|
var modeFavorites = listFavorites.FirstOrDefault(x => x.F_RepositoryId == Convert.ToInt32(dr["F_RepositoryId"].ToString()));
|
|
92
|
93
|
if (modeFavorites != null)
|
|
93
|
94
|
{
|
|
94
|
|
- dr["isfavorites"] = 1;
|
|
|
95
|
+ dr["favoritesid"] = modeFavorites.Id;
|
|
95
|
96
|
}
|
|
96
|
97
|
}
|
|
97
|
98
|
#endregion
|
|
|
@@ -270,6 +271,81 @@ namespace CallCenterApi.Interface.Controllers.knowledge
|
|
270
|
271
|
return Content(obj.ToJson());
|
|
271
|
272
|
}
|
|
272
|
273
|
|
|
|
274
|
+ /// <summary>
|
|
|
275
|
+ /// 获取审核列表 修改前修改后对比
|
|
|
276
|
+ /// </summary>
|
|
|
277
|
+ /// <param name="auditid">id</param>
|
|
|
278
|
+ /// <returns></returns>
|
|
|
279
|
+ public ActionResult GetAuditCompareInfo(int auditid = 0, int ispass = 0)
|
|
|
280
|
+ {
|
|
|
281
|
+ DataTable dt = new DataTable();
|
|
|
282
|
+
|
|
|
283
|
+ string sql = ""; string sqlLog = "";
|
|
|
284
|
+ sql += " and isnull(F_ISPass,0)=" + ispass;
|
|
|
285
|
+ if (ispass == 0)
|
|
|
286
|
+ sql += " and F_RepositoryId in (select F_RepositoryId from T_RepositoryInformation where F_ISSubmitAudit=1)";
|
|
|
287
|
+
|
|
|
288
|
+ string sqllist = $"SELECT * FROM dbo.T_RepositoryAudit WHERE 1=1 {sql} "
|
|
|
289
|
+ + " ORDER BY F_AuditId desc ";
|
|
|
290
|
+ dt = DbHelperSQL.Query(sqllist).Tables[0];
|
|
|
291
|
+ List<Model.T_RepositoryAudit> auditList = new BLL.T_RepositoryAudit().DataTableToList(dt);
|
|
|
292
|
+ var model = auditList.SingleOrDefault(x => x.F_AuditId == auditid);
|
|
|
293
|
+
|
|
|
294
|
+ List<Model.T_RepositoryLog> logList = new BLL.T_RepositoryLog().GetModelList(" 1=1 " + sqlLog);
|
|
|
295
|
+ var listcategory = bllcategory.DataTableToList(bllcategory.GetList(" 1=1 ").Tables[0]);
|
|
|
296
|
+ if (model != null)
|
|
|
297
|
+ {
|
|
|
298
|
+ var preContent = ""; var afterContent = "";
|
|
|
299
|
+ var predis = ""; var afterdis = "";
|
|
|
300
|
+ var title = ""; var ptitle = ""; var atitle = "";
|
|
|
301
|
+ int categoryid = 0, aftercategoryid = 0;
|
|
|
302
|
+ if (model.F_PreLogID != null)
|
|
|
303
|
+ {
|
|
|
304
|
+ Model.T_RepositoryLog logModel = logList.Where(y => y.F_LogId == model.F_PreLogID.Value).FirstOrDefault();
|
|
|
305
|
+ if (logModel != null)
|
|
|
306
|
+ {
|
|
|
307
|
+ preContent = logModel.F_Content;
|
|
|
308
|
+ predis = logModel.F_Description;
|
|
|
309
|
+ ptitle = logModel.F_Title;
|
|
|
310
|
+ categoryid = logModel.F_IntExpand1 ?? 0;
|
|
|
311
|
+ }
|
|
|
312
|
+ }
|
|
|
313
|
+ if (model.F_AfterLogID != null)
|
|
|
314
|
+ {
|
|
|
315
|
+ Model.T_RepositoryLog logModel = logList.Where(y => y.F_LogId == model.F_AfterLogID.Value).FirstOrDefault();
|
|
|
316
|
+ if (logModel != null)
|
|
|
317
|
+ {
|
|
|
318
|
+ afterContent = logModel.F_Content;
|
|
|
319
|
+ afterdis = logModel.F_Description;
|
|
|
320
|
+ atitle = logModel.F_Title;
|
|
|
321
|
+ aftercategoryid = logModel.F_IntExpand1 ?? 0;
|
|
|
322
|
+ }
|
|
|
323
|
+ }
|
|
|
324
|
+ //分类
|
|
|
325
|
+ var modelcategory= listcategory.FirstOrDefault(x=>x.F_CategoryId == model.)
|
|
|
326
|
+ //if (ptitle != "")
|
|
|
327
|
+ //{ title = ptitle; }
|
|
|
328
|
+ //else { title = atitle; }
|
|
|
329
|
+ var obj = new
|
|
|
330
|
+ {
|
|
|
331
|
+ F_AuditId = model.F_AuditId,
|
|
|
332
|
+ F_Action = model.F_Action,
|
|
|
333
|
+ F_CategoryId = categoryid,
|
|
|
334
|
+ F_Title = ptitle,
|
|
|
335
|
+ F_PreContent = preContent,
|
|
|
336
|
+ F_PreDescription = predis,
|
|
|
337
|
+ F_AfterCategoryId = aftercategoryid,
|
|
|
338
|
+ F_AfterTitle = atitle,
|
|
|
339
|
+ F_AfterContent = afterContent,
|
|
|
340
|
+ F_AfterDescription = afterdis,
|
|
|
341
|
+ F_ISPass = model.F_ISPass,
|
|
|
342
|
+ F_AuditRemark = model.F_AuditRemark
|
|
|
343
|
+ };
|
|
|
344
|
+ return Success("获取成功", obj);
|
|
|
345
|
+ }
|
|
|
346
|
+ return Error("获取失败");
|
|
|
347
|
+ }
|
|
|
348
|
+
|
|
273
|
349
|
[Authority]
|
|
274
|
350
|
//添加知识库
|
|
275
|
351
|
public ActionResult AddInfo(string title, string con, string pid, int issub)
|