Просмотр исходного кода

添加获取随访列表接口

mengjie лет назад: 6
Родитель
Сommit
21b6505e7f

+ 132 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/MedicalFollowup/FollowUpController.cs

@@ -1,5 +1,6 @@
1 1
 using CallCenter.Utility;
2 2
 using CallCenterApi.DB;
3
+using CallCenterApi.Interface.Controllers.Base;
3 4
 using System;
4 5
 using System.Collections.Generic;
5 6
 using System.Data;
@@ -9,14 +10,19 @@ using System.Web.Mvc;
9 10
 
10 11
 namespace CallCenterApi.Interface.Controllers.MedicalFollowup
11 12
 {
12
-    public class FollowUpController : Controller
13
+    public class FollowUpController : BaseController
13 14
     {
15
+        //private readonly BLL.T_Call_OutTaskTelNum otnBLL = new BLL.T_Call_OutTaskTelNum();
16
+        private readonly BLL.T_Call_OutAnswers ansBLL = new BLL.T_Call_OutAnswers();
17
+        private readonly BLL.T_Med_FollowUp mfBLL = new BLL.T_Med_FollowUp();
18
+
14 19
         // GET: FollowUp
15 20
         public ActionResult Index()
16 21
         {
17 22
             return View();
18 23
         }
19 24
 
25
+        #region 获取随访列表
20 26
         /// <summary>
21 27
         /// 获取随访列表
22 28
         /// </summary>
@@ -150,5 +156,130 @@ namespace CallCenterApi.Interface.Controllers.MedicalFollowup
150 156
 
151 157
             return Content(obj.ToJson());
152 158
         }
159
+        #endregion
160
+
161
+        #region 问卷回答
162
+        /// <summary>
163
+        /// 
164
+        /// </summary>
165
+        /// <param name="taskid">任务ID</param>
166
+        /// <param name="custelid">客户电话ID</param>
167
+        /// <param name="ans">答案,数组形式["15_20_单选选项内容","17_25|36|58_复选选项内容1|选项内容2|选项内容3","30_0_问答题"]</param>
168
+        /// <param name="hjjgid">呼叫结果</param>
169
+        /// <param name="telphone">电话号码</param>
170
+        /// <param name="name">姓名</param>
171
+        /// <param name="phone">固定号码</param>
172
+        /// <param name="countryid">乡镇id</param>
173
+        /// <param name="address">地址</param>
174
+        /// <returns></returns>
175
+        public ActionResult Answers(int taskid, int custelid, string[] ans, int hjjgid,
176
+            string name, string phone, string address, int countryid = 0)
177
+        {
178
+            int cc = 0;
179
+            if (custelid > 0)
180
+            {
181
+                var otnModel = mfBLL.GetModel(custelid);
182
+                if (otnModel != null)
183
+                {
184
+                    //物业系统,客户档案信息是存储业主信息的,外呼不需要存储
185
+                    //int cusid = saveCus(otnModel.F_Phone, name, phone, countryid, address);
186
+                    int cusid = 0;
187
+
188
+                    #region 保存答案
189
+                    var ansModel = new Model.T_Call_OutAnswers();
190
+                    string askqids = "";
191
+                    string ansids = "";
192
+                    if (ans != null)
193
+                    {
194
+                        //先删除 后添加
195
+                        ansBLL.DeleteByTelid(custelid, taskid);
196
+
197
+                        ansModel.F_TaskID = taskid;
198
+                        ansModel.F_CusTelID = custelid;
199
+                        ansModel.F_CusID = cusid;
200
+                        ansModel.F_OptBy = CurrentUser.UserData.F_UserId;
201
+                        ansModel.F_OptByName = CurrentUser.UserData.F_UserName;
202
+                        ansModel.F_OptOn = DateTime.Now;
203
+                        ansModel.F_Expand1 = countryid.ToString();
204
+                        ansModel.F_Expand3 = DateTime.Now.ToString("yyyyMMddHHmmssfff");
205
+                        #region 循环保存
206
+                        foreach (var item in ans)
207
+                        {
208
+                            var nn = 0;
209
+                            var ii = item.Split('_');
210
+                            ansModel.F_QID = int.Parse(ii[0]);
211
+
212
+                            askqids += ii[0] + ",";
213
+                            ansids += ii[1] + ",";
214
+
215
+                            if (ii[1].IndexOf('|') > 0)
216
+                            {
217
+                                var iii = ii[1].Trim('|').Split('|');
218
+                                var iia = ii[2].Trim('|').Split('|');
219
+                                for (int i = 0; i < iii.Length; i++)
220
+                                {
221
+                                    ansModel.F_QIID = int.Parse(iii[i]);
222
+                                    ansModel.F_Answer = iia[i];
223
+                                    if (ansBLL.Add(ansModel) > 0)
224
+                                        nn++;
225
+                                }
226
+                                if (nn == iii.Length)
227
+                                    cc++;
228
+                            }
229
+                            else
230
+                            {
231
+                                ansModel.F_QIID = int.Parse(ii[1]);
232
+                                ansModel.F_Answer = ii[2];
233
+                                if (ansBLL.Add(ansModel) > 0)
234
+                                    cc++;
235
+                            }
236
+                        }
237
+                        #endregion
238
+                    }
239
+                    #endregion
240
+                    #region  保存日志
241
+                    //otnModel.F_HJJGId = hjjgid;
242
+                    var hjconfig = new BLL.T_Sys_DictionaryValue().GetModel(hjjgid);
243
+                    if (hjconfig != null)
244
+                        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);
261
+                    //planrecord(otnModel);
262
+                    #endregion
263
+                }
264
+            }
265
+            if (ans != null)
266
+            {
267
+                if (cc == ans.Length)
268
+                {
269
+                    return Success("问卷答案提交成功!taskid=" + taskid + ",custelid=" + custelid + ",操作人:" + CurrentUser.UserData.F_UserCode);
270
+                }
271
+                else
272
+                {
273
+                    ansBLL.DeleteByTelid(custelid, taskid);
274
+                    return Error("问卷答案提交失败!taskid=" + taskid + ",custelid=" + custelid + ",操作人:" + CurrentUser.UserData.F_UserCode);
275
+                }
276
+            }
277
+            else
278
+            {
279
+                return Error("没有问卷答案提交");
280
+            }
281
+
282
+        }
283
+        #endregion
153 284
     }
154 285
 }

+ 32 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Med_FollowUp.cs

@@ -41,6 +41,10 @@ namespace CallCenterApi.Model
41 41
         private string _f_zdmc;
42 42
         private decimal  _f_totalcosts;
43 43
         private DateTime _f_sfdate;
44
+        private string _f_sfperson;
45
+        private string _f_sfresult;
46
+        private string _f_satisfied;
47
+        private string _f_advise;
44 48
         /// <summary>
45 49
         /// id
46 50
         /// </summary>
@@ -246,5 +250,33 @@ namespace CallCenterApi.Model
246 250
             set { _f_sfdate = value; }
247 251
             get { return _f_sfdate; }
248 252
         }
253
+
254
+        //随访人
255
+        /// <summary>
256
+        /// 随访人
257
+        /// </summary>
258
+        public string F_SFPerson
259
+        {
260
+            set { _f_sfperson = value; }
261
+            get { return _f_sfperson; }
262
+        }
263
+        //随访结果
264
+        public string F_SFResult
265
+        {
266
+            set { _f_sfresult = value; }
267
+            get { return _f_sfresult; }
268
+        }
269
+        //满意度
270
+        public string F_Satisfied
271
+        {
272
+            set { _f_satisfied = value; }
273
+            get { return _f_satisfied; }
274
+        }
275
+        //意见或建议
276
+        public string F_Advise
277
+        {
278
+            set { _f_advise = value; }
279
+            get { return _f_advise; }
280
+        }
249 281
     }
250 282
 }