|
|
@@ -15,6 +15,9 @@ namespace CallCenterApi.Interface.Controllers.MedicalFollowup
|
|
15
|
15
|
//private readonly BLL.T_Call_OutTaskTelNum otnBLL = new BLL.T_Call_OutTaskTelNum();
|
|
16
|
16
|
private readonly BLL.T_Call_OutAnswers ansBLL = new BLL.T_Call_OutAnswers();
|
|
17
|
17
|
private readonly BLL.T_Med_FollowUp mfBLL = new BLL.T_Med_FollowUp();
|
|
|
18
|
+ private readonly BLL.T_Ask_Question questionBLL = new BLL.T_Ask_Question();
|
|
|
19
|
+ private readonly BLL.T_Ask_QuestionItems questionItemBLL = new BLL.T_Ask_QuestionItems();
|
|
|
20
|
+ private readonly BLL.T_Ask_PagerInfo pagerInfoBLL = new BLL.T_Ask_PagerInfo();
|
|
18
|
21
|
|
|
19
|
22
|
// GET: FollowUp
|
|
20
|
23
|
public ActionResult Index()
|
|
|
@@ -54,6 +57,8 @@ namespace CallCenterApi.Interface.Controllers.MedicalFollowup
|
|
54
|
57
|
string strsfend = HttpUtility.UrlDecode(RequestString.GetQueryString("sfend"));
|
|
55
|
58
|
//仅二级随访未完成
|
|
56
|
59
|
string strejwwc = HttpUtility.UrlDecode(RequestString.GetQueryString("secondlevel"));
|
|
|
60
|
+ //满意度
|
|
|
61
|
+ string strsatisfy = HttpUtility.UrlDecode(RequestString.GetQueryString("satisfied"));
|
|
57
|
62
|
|
|
58
|
63
|
string strpageindex = RequestString.GetQueryString("page");
|
|
59
|
64
|
int pageindex = 1;
|
|
|
@@ -124,6 +129,10 @@ namespace CallCenterApi.Interface.Controllers.MedicalFollowup
|
|
124
|
129
|
{
|
|
125
|
130
|
sql += " and F_State = 2 ";//随访完成状态
|
|
126
|
131
|
}
|
|
|
132
|
+ if (strsatisfy.Trim() != "" && strsatisfy != "undefined")
|
|
|
133
|
+ {
|
|
|
134
|
+ sql += " and F_Satisfied = '"+strsatisfy +"' ";//随访完成状态
|
|
|
135
|
+ }
|
|
127
|
136
|
|
|
128
|
137
|
if (strpageindex.Trim() != "")
|
|
129
|
138
|
{
|
|
|
@@ -173,8 +182,9 @@ namespace CallCenterApi.Interface.Controllers.MedicalFollowup
|
|
173
|
182
|
/// <param name="address">地址</param>
|
|
174
|
183
|
/// <returns></returns>
|
|
175
|
184
|
public ActionResult Answers(int taskid, int custelid, string[] ans, int hjjgid,
|
|
176
|
|
- string name, string phone, string address, int countryid = 0)
|
|
|
185
|
+ string name, string phone, string address,string advise, string satisfied,string praise,string criticism,int pagerid, int countryid = 0)
|
|
177
|
186
|
{
|
|
|
187
|
+ taskid = 0;
|
|
178
|
188
|
int cc = 0;
|
|
179
|
189
|
if (custelid > 0)
|
|
180
|
190
|
{
|
|
|
@@ -242,22 +252,12 @@ namespace CallCenterApi.Interface.Controllers.MedicalFollowup
|
|
242
|
252
|
var hjconfig = new BLL.T_Sys_DictionaryValue().GetModel(hjjgid);
|
|
243
|
253
|
if (hjconfig != null)
|
|
244
|
254
|
otnModel.F_SFResult = hjconfig.F_Name;
|
|
245
|
|
- //otnModel.F_YHFKId = yhfkid;
|
|
246
|
|
- //var fkconfig = new BLL.T_Sys_DictionaryValue().GetModel(yhfkid);
|
|
247
|
|
- //if (fkconfig != null)
|
|
248
|
|
- // otnModel.F_YHFKName = fkconfig.F_Name;
|
|
249
|
|
- otnModel.ExpandVchField2 = phone;
|
|
250
|
|
- otnModel.ExpandVchField3 = address;
|
|
251
|
|
- var fkconfig = new BLL.T_Sys_DictionaryValue().GetModel(countryid);
|
|
252
|
|
- if (fkconfig != null)
|
|
253
|
|
- otnModel.ExpandVchField4 = fkconfig.F_Name;
|
|
254
|
|
- otnModel.ExpandIntField1 = countryid;//乡镇
|
|
255
|
|
- otnModel.ExpandDatField1 = DateTime.Now;//调查时间
|
|
256
|
|
- otnModel.F_AskRes = askqids;
|
|
257
|
|
- otnModel.F_AskInfo = ansids;
|
|
258
|
|
- otnModel.F_CusID = cusid;
|
|
259
|
|
- otnModel.F_CusName = name;
|
|
260
|
|
- otnBLL.Update(otnModel);
|
|
|
255
|
+ otnModel.F_SFPerson = CurrentUser.UserData.F_UserCode;
|
|
|
256
|
+ otnModel.F_SFDate = DateTime.Now;
|
|
|
257
|
+ otnModel.F_Advise = advise;
|
|
|
258
|
+ otnModel.F_Satisfied = satisfied;
|
|
|
259
|
+ otnModel.F_PagerID = pagerid;
|
|
|
260
|
+ mfBLL.Update(otnModel);
|
|
261
|
261
|
//planrecord(otnModel);
|
|
262
|
262
|
#endregion
|
|
263
|
263
|
}
|
|
|
@@ -266,12 +266,13 @@ namespace CallCenterApi.Interface.Controllers.MedicalFollowup
|
|
266
|
266
|
{
|
|
267
|
267
|
if (cc == ans.Length)
|
|
268
|
268
|
{
|
|
269
|
|
- return Success("问卷答案提交成功!taskid=" + taskid + ",custelid=" + custelid + ",操作人:" + CurrentUser.UserData.F_UserCode);
|
|
|
269
|
+ //return Success("问卷答案提交成功!taskid=" + taskid + ",custelid=" + custelid + ",操作人:" + CurrentUser.UserData.F_UserCode);
|
|
|
270
|
+ return Success("问卷答案提交成功!custelid=" + custelid + ",操作人:" + CurrentUser.UserData.F_UserCode);
|
|
270
|
271
|
}
|
|
271
|
272
|
else
|
|
272
|
273
|
{
|
|
273
|
274
|
ansBLL.DeleteByTelid(custelid, taskid);
|
|
274
|
|
- return Error("问卷答案提交失败!taskid=" + taskid + ",custelid=" + custelid + ",操作人:" + CurrentUser.UserData.F_UserCode);
|
|
|
275
|
+ return Error("问卷答案提交失败!custelid=" + custelid + ",操作人:" + CurrentUser.UserData.F_UserCode);
|
|
275
|
276
|
}
|
|
276
|
277
|
}
|
|
277
|
278
|
else
|
|
|
@@ -281,5 +282,113 @@ namespace CallCenterApi.Interface.Controllers.MedicalFollowup
|
|
281
|
282
|
|
|
282
|
283
|
}
|
|
283
|
284
|
#endregion
|
|
|
285
|
+
|
|
|
286
|
+ #region 导出
|
|
|
287
|
+
|
|
|
288
|
+ #endregion
|
|
|
289
|
+
|
|
|
290
|
+ #region 获取随访结果详情
|
|
|
291
|
+ //获取任务结果详情
|
|
|
292
|
+ public ActionResult GetTaskTelInfo(int id = 0)
|
|
|
293
|
+ {
|
|
|
294
|
+ if (id <= 0)
|
|
|
295
|
+ return Error("参数不正确");
|
|
|
296
|
+ var model = mfBLL.GetModel(id);
|
|
|
297
|
+
|
|
|
298
|
+ var paperid = 0;
|
|
|
299
|
+ if (model != null)
|
|
|
300
|
+ {
|
|
|
301
|
+ var taskmodel = new Model.T_Med_FollowUp();
|
|
|
302
|
+ #region 绑定任务和客户信息
|
|
|
303
|
+
|
|
|
304
|
+ taskmodel.F_Id = model.F_Id;//号码id
|
|
|
305
|
+ //taskmodel.F_TaskId = model.F_TaskId.Value;//任务id
|
|
|
306
|
+ //taskmodel.F_HJJGId = model.F_HJJGId != null ? model.F_HJJGId.Value : 0;//呼叫结果id
|
|
|
307
|
+ taskmodel.F_Satisfied = model.F_Satisfied;
|
|
|
308
|
+ taskmodel.F_SFResult = model.F_SFResult;
|
|
|
309
|
+ if (!string.IsNullOrWhiteSpace(model.F_Name))
|
|
|
310
|
+ taskmodel.F_Name = model.F_Name;//客户姓名
|
|
|
311
|
+ if (!string.IsNullOrWhiteSpace(model.F_Phone))
|
|
|
312
|
+ taskmodel.F_Phone = model.F_Phone;//号码
|
|
|
313
|
+
|
|
|
314
|
+ if (!string.IsNullOrWhiteSpace(model.F_Addr))
|
|
|
315
|
+ taskmodel.F_Addr = model.F_Addr;//住址
|
|
|
316
|
+ #endregion
|
|
|
317
|
+
|
|
|
318
|
+ var anslist = ansBLL.GetModelList(" F_CusTelID=" + id + " ");//ansBLL.GetModelList(" F_TaskID=" + model.F_TaskId.Value + " and F_CusTelID=" + id + " ");
|
|
|
319
|
+ //var tmodel = otBLL.GetModel(model.F_TaskId.Value);
|
|
|
320
|
+ //if (tmodel != null)
|
|
|
321
|
+ //{
|
|
|
322
|
+ paperid = model .F_PagerID;
|
|
|
323
|
+ #region 获取问卷试题信息以及答案
|
|
|
324
|
+ var pmodel = pagerInfoBLL.GetModel(paperid);
|
|
|
325
|
+ var qlist = questionBLL.GetModelList(" F_DeleteFlag=0 and F_QuestionId in (select F_QuestionId from T_Ask_PagerItems where F_PagerId=" + paperid + ") order by F_QuestionId ");
|
|
|
326
|
+ var qilist = questionItemBLL.GetModelList(" F_QuestionId in (select F_QuestionId from T_Ask_PagerItems where F_PagerId=" + paperid + ") order by F_ItemId ");
|
|
|
327
|
+ var newmodel = new
|
|
|
328
|
+ {
|
|
|
329
|
+ F_Title = pmodel.F_Title,
|
|
|
330
|
+ F_Remark = pmodel.F_Remark,
|
|
|
331
|
+ F_StartText = pmodel.F_StartText,
|
|
|
332
|
+ F_EndText = pmodel.F_EndText,
|
|
|
333
|
+ F_Questions = qlist.Select(q =>
|
|
|
334
|
+ {
|
|
|
335
|
+ var answers = "";
|
|
|
336
|
+ var qalist = anslist.Where(al => al.F_QID.Value == q.F_QuestionId).ToList<Model.T_Call_OutAnswers>();
|
|
|
337
|
+ if (qalist.Count > 0)
|
|
|
338
|
+ {
|
|
|
339
|
+ if (q.F_Type > 1)
|
|
|
340
|
+ {
|
|
|
341
|
+ foreach (var item in qalist)
|
|
|
342
|
+ {
|
|
|
343
|
+ answers += item.F_QIID + "|";
|
|
|
344
|
+ }
|
|
|
345
|
+ }
|
|
|
346
|
+ else
|
|
|
347
|
+ {
|
|
|
348
|
+ answers = qalist[0].F_Answer;
|
|
|
349
|
+ }
|
|
|
350
|
+ }
|
|
|
351
|
+ return new
|
|
|
352
|
+ {
|
|
|
353
|
+ quesid = q.F_QuestionId,
|
|
|
354
|
+ questitle = q.F_Title,
|
|
|
355
|
+ questype = q.F_Type,
|
|
|
356
|
+ quescontent = q.F_Content,
|
|
|
357
|
+ quesremark = q.F_Remark,
|
|
|
358
|
+ quesanswers = answers.Trim('|'),
|
|
|
359
|
+ quesitems = qilist.Where(qq => qq.F_QuestionId == q.F_QuestionId).Select(qi =>
|
|
|
360
|
+ {
|
|
|
361
|
+ return new
|
|
|
362
|
+ {
|
|
|
363
|
+ itemid = qi.F_ItemId,
|
|
|
364
|
+ itemname = qi.F_ItemName,
|
|
|
365
|
+ itemremark = qi.F_Remark,
|
|
|
366
|
+ };
|
|
|
367
|
+ })
|
|
|
368
|
+ };
|
|
|
369
|
+ })
|
|
|
370
|
+ };
|
|
|
371
|
+ #endregion
|
|
|
372
|
+
|
|
|
373
|
+
|
|
|
374
|
+ //taskmodel.F_TaskName = tmodel.F_TaskName;//任务名称
|
|
|
375
|
+ //taskmodel.F_TaskRemark = tmodel.F_TaskRemark;//任务备注
|
|
|
376
|
+
|
|
|
377
|
+ var objy = new
|
|
|
378
|
+ {
|
|
|
379
|
+ taskModel = taskmodel,
|
|
|
380
|
+ paperModel = newmodel
|
|
|
381
|
+ };
|
|
|
382
|
+ return Success("获取详情成功", objy);
|
|
|
383
|
+ //}
|
|
|
384
|
+ }
|
|
|
385
|
+ return Error("获取详情失败");
|
|
|
386
|
+ }
|
|
|
387
|
+ #endregion
|
|
|
388
|
+
|
|
|
389
|
+
|
|
|
390
|
+ #region 科室随访率统计
|
|
|
391
|
+
|
|
|
392
|
+ #endregion
|
|
284
|
393
|
}
|
|
285
|
394
|
}
|