|
|
@@ -21,6 +21,7 @@ namespace CallCenterApi.Interface.Controllers
|
|
21
|
21
|
public class ConversationController : BaseController
|
|
22
|
22
|
{
|
|
23
|
23
|
BLL.T_Con_Conversation bll = new BLL.T_Con_Conversation();
|
|
|
24
|
+ BLL.T_Sys_Department bll_Dep = new BLL.T_Sys_Department();
|
|
24
|
25
|
/// <summary>
|
|
25
|
26
|
/// 获取内外线列表
|
|
26
|
27
|
/// </summary>
|
|
|
@@ -36,11 +37,11 @@ namespace CallCenterApi.Interface.Controllers
|
|
36
|
37
|
string keyword = RequestString.GetQueryString("keyword");
|
|
37
|
38
|
//电话
|
|
38
|
39
|
string strtel = RequestString.GetQueryString("tel");
|
|
39
|
|
- ////部门
|
|
40
|
|
- string department = RequestString.GetQueryString("department");
|
|
41
|
|
- ////科室
|
|
42
|
|
- string section = RequestString.GetQueryString("section");
|
|
43
|
|
- ////医师
|
|
|
40
|
+ //部门id
|
|
|
41
|
+ int department = RequestString.GetInt("department", 0);
|
|
|
42
|
+ //科室id
|
|
|
43
|
+ int section = RequestString.GetInt("section", 0);
|
|
|
44
|
+ //医师
|
|
44
|
45
|
string physician = RequestString.GetQueryString("physician");
|
|
45
|
46
|
string stringtype = RequestString.GetQueryString("type");
|
|
46
|
47
|
int type = 0;
|
|
|
@@ -51,23 +52,23 @@ namespace CallCenterApi.Interface.Controllers
|
|
51
|
52
|
|
|
52
|
53
|
if (keyword.Trim() != "" && keyword != "undefined")
|
|
53
|
54
|
{
|
|
54
|
|
- sql += $" and (F_Telephone like '%" + keyword.Trim() + "%' or F_Department like '%" + keyword.Trim() + "%'or F_Section like '%" + keyword.Trim() + "%' or F_Physician like '%" + keyword.Trim() + "%' or F_Title like '%" + keyword.Trim() + "%') ";
|
|
|
55
|
+ sql += $" and (F_Telephone like '%" + keyword.Trim() + "%' or F_Physician like '%" + keyword.Trim() + "%' or F_Title like '%" + keyword.Trim() + "%') ";
|
|
55
|
56
|
}
|
|
56
|
57
|
if (strtel.Trim() != "" && strtel != "undefined")
|
|
57
|
58
|
{
|
|
58
|
|
- sql += "and F_Telephone=" + strtel;
|
|
|
59
|
+ sql += " and F_Telephone=" + strtel;
|
|
59
|
60
|
}
|
|
60
|
|
- if (department.Trim() != "" && department != "undefined")
|
|
|
61
|
+ if (department > 0)
|
|
61
|
62
|
{
|
|
62
|
|
- sql += "and F_Department=" + department;
|
|
|
63
|
+ sql += " and F_Department=" + department;
|
|
63
|
64
|
}
|
|
64
|
|
- if (section.Trim() != "" && section != "undefined")
|
|
|
65
|
+ if (section > 0)
|
|
65
|
66
|
{
|
|
66
|
|
- sql += "and F_Section=" + section;
|
|
|
67
|
+ sql += " and F_Section=" + section;
|
|
67
|
68
|
}
|
|
68
|
69
|
if (physician.Trim() != "" && physician != "undefined")
|
|
69
|
70
|
{
|
|
70
|
|
- sql += "and F_Physician=" + physician;
|
|
|
71
|
+ sql += " and F_Physician=" + physician;
|
|
71
|
72
|
}
|
|
72
|
73
|
if (strpageindex.Trim() != "")
|
|
73
|
74
|
{
|
|
|
@@ -80,25 +81,25 @@ namespace CallCenterApi.Interface.Controllers
|
|
80
|
81
|
if (stringtype .Trim() != "")
|
|
81
|
82
|
{
|
|
82
|
83
|
type = Convert.ToInt32(stringtype);
|
|
83
|
|
- sql += "and F_Type=" + type;
|
|
|
84
|
+ sql += " and F_Type=" + type;
|
|
84
|
85
|
}
|
|
85
|
86
|
int recordCount = 0;
|
|
86
|
87
|
dt = BLL.PagerBLL.GetListPager(
|
|
87
|
88
|
"T_Con_Conversation",
|
|
88
|
89
|
"T_Con_Conversation.ID",
|
|
89
|
|
- "*",
|
|
|
90
|
+ "*,(SELECT F_DeptName FROM dbo.T_Sys_Department WHERE F_DeptId = dbo.T_Con_Conversation.F_Department) AS Department_Name,(SELECT F_DeptName FROM dbo.T_Sys_Department WHERE F_DeptId = dbo.T_Con_Conversation.F_Section) AS Section_Name ",
|
|
90
|
91
|
sql,
|
|
91
|
92
|
"ORDER BY T_Con_Conversation.ID desc",
|
|
92
|
93
|
pagesize,
|
|
93
|
94
|
pageindex,
|
|
94
|
95
|
true,
|
|
95
|
96
|
out recordCount);
|
|
96
|
|
- List<Model.T_Con_Conversation> modlelist = new BLL.T_Con_Conversation().DataTableToList(dt);
|
|
|
97
|
+ //List<Model.T_Con_Conversation> modlelist = new BLL.T_Con_Conversation().DataTableToList(dt);
|
|
97
|
98
|
var obj = new
|
|
98
|
99
|
{
|
|
99
|
100
|
state = "success",
|
|
100
|
101
|
message = "成功",
|
|
101
|
|
- rows = modlelist,
|
|
|
102
|
+ rows = dt,
|
|
102
|
103
|
total = recordCount
|
|
103
|
104
|
};
|
|
104
|
105
|
res = Content(obj.ToJson());
|
|
|
@@ -142,8 +143,8 @@ namespace CallCenterApi.Interface.Controllers
|
|
142
|
143
|
{
|
|
143
|
144
|
public int ID { get; set; }
|
|
144
|
145
|
public int F_Type { get; set; }// 1内线2外线
|
|
145
|
|
- public string F_Department { get; set; }// 部门
|
|
146
|
|
- public string F_Section { get; set; }//科室
|
|
|
146
|
+ public int F_Department { get; set; }// 部门
|
|
|
147
|
+ public int F_Section { get; set; }//科室
|
|
147
|
148
|
public string F_Telephone { get; set; }//电话
|
|
148
|
149
|
public string F_Physician { get; set; }//医师
|
|
149
|
150
|
public string F_Title { get; set; }//职称
|
|
|
@@ -168,6 +169,13 @@ namespace CallCenterApi.Interface.Controllers
|
|
168
|
169
|
/// <returns></returns>
|
|
169
|
170
|
public ActionResult Add(Conversation input)
|
|
170
|
171
|
{
|
|
|
172
|
+ #region 获取部门id by 科室id
|
|
|
173
|
+ var model_Dep = new Model.T_Sys_Department();
|
|
|
174
|
+ int dep_Sectionid = input.F_Section;
|
|
|
175
|
+ if (dep_Sectionid > 0)
|
|
|
176
|
+ model_Dep = bll_Dep.GetModel(dep_Sectionid);
|
|
|
177
|
+ #endregion
|
|
|
178
|
+
|
|
171
|
179
|
#region 添加验证判断
|
|
172
|
180
|
if (string.IsNullOrEmpty(input.F_Telephone))
|
|
173
|
181
|
return Error("电话不能为空!");
|
|
|
@@ -178,8 +186,8 @@ namespace CallCenterApi.Interface.Controllers
|
|
178
|
186
|
#endregion
|
|
179
|
187
|
var model = new Model.T_Con_Conversation();
|
|
180
|
188
|
model.F_Type = input.F_Type; //1内线2外线
|
|
181
|
|
- model.F_Department = input.F_Department; //部门
|
|
182
|
|
- model.F_Section = input.F_Section; // 科室
|
|
|
189
|
+ model.F_Department = model_Dep != null ? model_Dep.F_ParentId : input.F_Department; //部门id
|
|
|
190
|
+ model.F_Section = input.F_Section; // 科室id
|
|
183
|
191
|
model.F_Telephone = input.F_Telephone; // 电话
|
|
184
|
192
|
model.F_Physician = input.F_Physician; //医师
|
|
185
|
193
|
model.F_Title = input.F_Title;//职称
|
|
|
@@ -198,6 +206,13 @@ namespace CallCenterApi.Interface.Controllers
|
|
198
|
206
|
{
|
|
199
|
207
|
int userId = CurrentUser.UserData.F_UserId;
|
|
200
|
208
|
|
|
|
209
|
+ #region 获取部门id by 科室id
|
|
|
210
|
+ var model_Dep = new Model.T_Sys_Department();
|
|
|
211
|
+ int dep_Sectionid = input.F_Section;
|
|
|
212
|
+ if(dep_Sectionid > 0)
|
|
|
213
|
+ model_Dep = bll_Dep.GetModel(dep_Sectionid);
|
|
|
214
|
+ #endregion
|
|
|
215
|
+
|
|
201
|
216
|
#region 添加验证判断
|
|
202
|
217
|
if (input.ID <= 0)
|
|
203
|
218
|
return Error("参数错误!");
|
|
|
@@ -206,10 +221,10 @@ namespace CallCenterApi.Interface.Controllers
|
|
206
|
221
|
if (input.F_Type <= 0)
|
|
207
|
222
|
return Error("请选择电话类别");
|
|
208
|
223
|
#endregion
|
|
209
|
|
- var model = bll.GetModel(input.ID );
|
|
|
224
|
+ var model = bll.GetModel(input.ID);
|
|
210
|
225
|
model.F_Type = input.F_Type; //1内线2外线
|
|
211
|
|
- model.F_Department = input.F_Department; //部门
|
|
212
|
|
- model.F_Section = input.F_Section; // 科室
|
|
|
226
|
+ model.F_Department = model_Dep != null ? model_Dep.F_ParentId : input.F_Department; //部门id
|
|
|
227
|
+ model.F_Section = input.F_Section; // 科室id
|
|
213
|
228
|
model.F_Telephone = input.F_Telephone; // 电话
|
|
214
|
229
|
model.F_Physician = input.F_Physician; //医师
|
|
215
|
230
|
model.F_Title = input.F_Title;//职称
|
|
|
@@ -320,6 +335,9 @@ namespace CallCenterApi.Interface.Controllers
|
|
320
|
335
|
dModel.F_IsDelete = 0;
|
|
321
|
336
|
dModel.F_FileId = fid;
|
|
322
|
337
|
dModel.F_Type = type ;
|
|
|
338
|
+
|
|
|
339
|
+ //获取之前所有客户档案信息
|
|
|
340
|
+ var list_Dep = bll_Dep.DataTableToList(bll_Dep.GetList(" 1=1 and F_DeleteFlag = 0 ").Tables[0]).ToList();
|
|
323
|
341
|
foreach (DataRow dr in dt.Rows)
|
|
324
|
342
|
{
|
|
325
|
343
|
|
|
|
@@ -329,8 +347,10 @@ namespace CallCenterApi.Interface.Controllers
|
|
329
|
347
|
{
|
|
330
|
348
|
if (!getunphone(0, dr["电话"].ToString()))
|
|
331
|
349
|
{
|
|
332
|
|
- dModel.F_Department = dr["部门"].ToString();
|
|
333
|
|
- dModel.F_Section = dr["科室"].ToString();
|
|
|
350
|
+ var model_Dept = list_Dep.SingleOrDefault(x => x.F_DeptName.Equals(dr["部门"].ToString()));
|
|
|
351
|
+ var model_Sec = list_Dep.SingleOrDefault(x => x.F_DeptName.Equals(dr["科室"].ToString()));
|
|
|
352
|
+ dModel.F_Department = model_Dept != null ? model_Dept.F_DeptId : 0; //dr["部门"].ToString();
|
|
|
353
|
+ dModel.F_Section = model_Sec != null ? model_Sec.F_DeptId : 0; //dr["科室"].ToString();
|
|
334
|
354
|
dModel.F_Telephone = dr["电话"].ToString();
|
|
335
|
355
|
|
|
336
|
356
|
if (type == 2)
|