Kaynağa Gözat

调整分配任务,只能分配启动中的任务
调整外呼报表
调整微信问卷

zhengbingbing 7 yıl önce
ebeveyn
işleme
2097d31250

+ 9 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/CallOutPlanController.cs

@@ -572,10 +572,18 @@ namespace CallCenterApi.Interface.Controllers.callout
572 572
             StringBuilder sb = new StringBuilder();
573 573
 
574 574
             sb.Append(" and F_FPState=0 and F_DeleteFlag=0 ");
575
+            var sql = "";
575 576
             if (!string.IsNullOrWhiteSpace(key))
576 577
             {
577
-                sb.Append(" and F_Taskid in (select F_TaskID from T_Call_OutTask where F_TaskName like '%" + key + "%' or F_TaskRemark like '%" + key + "%' and F_IsStart=1 and F_DeleteFlag=0 ) ");
578
+                sql += " and F_Phone='" + key + "' or  F_TaskName like '%" + key + "%' or F_TaskRemark like '%" + key + "%'";
578 579
             }
580
+            sb.Append(" and F_Taskid in (select F_TaskID from T_Call_OutTask where  F_IsStart=1 and F_DeleteFlag=0 " + sql + " ) ");
581
+            #region 20180612 zhengbingbing 需要调整部分语句必须执行
582
+            //if (!string.IsNullOrWhiteSpace(key))
583
+            //{
584
+            //    sb.Append(" and F_Taskid in (select F_TaskID from T_Call_OutTask where F_TaskName like '%" + key + "%' or F_TaskRemark like '%" + key + "%' and F_IsStart=1 and F_DeleteFlag=0 ) ");
585
+            //}
586
+            #endregion
579 587
             int userid = CurrentUser.UserData.F_UserId;
580 588
             string username = CurrentUser.UserData.F_UserName;
581 589
             #region 按数量平均分配

+ 12 - 9
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/PagerAnswerWXController.cs

@@ -154,7 +154,7 @@ namespace CallCenterApi.Interface.Controllers.callout
154 154
         /// <param name="address"></param>
155 155
         /// <returns></returns>
156 156
         public bool AnswersWX(string telphone, string openid, string[] ans,
157
-            string name, string phone, int countryid, string address)
157
+            string name, string phone, string countryid, string address)
158 158
         {
159 159
             int cc = 0;int telid = 0;string dateflag = DateTime.Now.ToString("yyyyMMddHHmmssfff");
160 160
             if (!string.IsNullOrWhiteSpace(telphone))
@@ -164,10 +164,13 @@ namespace CallCenterApi.Interface.Controllers.callout
164 164
                 otnModel.F_TelPhone = telphone;
165 165
                 otnModel.F_Phone = phone;
166 166
                 otnModel.F_CusName = name;
167
-                otnModel.F_CountryId = countryid;
168
-                var countryconfig = new BLL.T_Sys_DictionaryValue().GetModel(countryid);
169
-                if (countryconfig != null)
170
-                    otnModel.F_Country = countryconfig.F_Name;
167
+                if (!string.IsNullOrWhiteSpace(countryid.Trim()))
168
+                {
169
+                    otnModel.F_CountryId = int.Parse(countryid.Trim());
170
+                    var countryconfig = new BLL.T_Sys_DictionaryValue().GetModel(otnModel.F_CountryId.Value);
171
+                    if (countryconfig != null)
172
+                        otnModel.F_Country = countryconfig.F_Name;
173
+                }
171 174
                 otnModel.F_Address = address;
172 175
                 otnModel.F_Openid = openid;
173 176
                 otnModel.F_PagerId = 2;
@@ -231,11 +234,11 @@ namespace CallCenterApi.Interface.Controllers.callout
231 234
                     #endregion
232 235
                     #region  保存日志
233 236
 
234
-                    otnModel.F_AskRes = askqids;
235
-                    otnModel.F_AskInfo = ansids;
236
-                    otnwxBLL.Update(otnModel);
237
+                    //otnModel.F_AskRes = askqids;
238
+                    //otnModel.F_AskInfo = ansids;
239
+                    //otnwxBLL.Update(otnModel);
237 240
 
238
-                    planrecord(otnModel);
241
+                    //planrecord(otnModel);
239 242
                     #endregion
240 243
                 }
241 244
             }

+ 44 - 46
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/CallOutReportController.cs

@@ -311,7 +311,7 @@ namespace CallCenterApi.Interface.Controllers.report
311 311
         DataTable dtCol = new DataTable();
312 312
         int columnsnum = 1;//左边留一空列,用于显示查询条件答案
313 313
         //获取表头
314
-        public ActionResult GetColumnList(string TaskID, string quesid)
314
+        public ActionResult GetColumnList(string TaskID, string quesid1, string quesid2)
315 315
         {
316 316
             columnsnum = 1;
317 317
             arlist.Clear();
@@ -326,59 +326,56 @@ namespace CallCenterApi.Interface.Controllers.report
326 326
             //if (!string.IsNullOrWhiteSpace(quesid))
327 327
             //    sqlques = "F_QuestionId=" + quesid;
328 328
             #endregion
329
-            
330
-            var queslist = questionBLL.GetModelList(sqlques);
331
-            if (queslist.Count > 0)
329
+
330
+            var quesmodel = questionBLL.GetModel(int.Parse(quesid2));
331
+            if (quesmodel != null)
332 332
             {
333
-                foreach (var itemquestion in queslist)
333
+                DataRow dr = dtCol.NewRow();
334
+                dr["wenti"] = quesmodel.F_Title;
335
+                #region 第一列
336
+                //根据问题ID查询问题项
337
+                var dsitem = questionItemBLL.GetModelList(" isnull(F_QuestionId,'') = '" + quesid1 + "' ");
338
+                if (dsitem.Count > 0)
334 339
                 {
335
-                    DataRow dr = dtCol.NewRow();
336
-                    dr["wenti"] = itemquestion.F_Title;
337
-                    if (itemquestion.F_QuestionId.ToString().Equals(quesid))
340
+                    foreach (var itemqi in dsitem)
338 341
                     {
339
-                        //根据问题ID查询问题项
340
-                        var dsi = questionItemBLL.GetModelList(" isnull(F_QuestionId,'') = '" + itemquestion.F_QuestionId + "' ");
341
-                        if (dsi.Count > 0)
342
-                        {
343
-                            foreach (var itemqi in dsi)
344
-                            {
345
-                                arlist.Add(itemqi.F_ItemName);
346
-                                columnsnum++;
347
-                            }
348
-                            dr["fenxiangshu"] = dsi.Count;
349
-                        }
342
+                        arlist.Add(itemqi.F_ItemName);
343
+                        columnsnum++;
350 344
                     }
351
-                    else
345
+                    dr["fenxiangshu"] = dsitem.Count;
346
+                }
347
+                #endregion
348
+                dr["wentiid"] = quesmodel.F_QuestionId;
349
+                dtCol.Rows.Add(dr);
350
+                #region 横向表头
351
+                //根据问题ID查询问题项
352
+                var dsi2 = questionItemBLL.GetModelList(" isnull(F_QuestionId,'') = '" + quesid2 + "' ");
353
+                if (dsi2.Count > 0)
354
+                {
355
+                    foreach (var itemqi in dsi2)
352 356
                     {
353
-                        //根据问题ID查询问题项
354
-                        var dsi = questionItemBLL.GetModelList(" isnull(F_QuestionId,'') = '" + itemquestion.F_QuestionId + "' ");
355
-                        if (dsi.Count > 0)
356
-                        {
357
-                            foreach (var itemqi in dsi)
358
-                            {
359
-                                checklist.Add(itemqi.F_ItemName);
360
-                            }
361
-                        }
357
+                        checklist.Add(itemqi.F_ItemName);
362 358
                     }
363
-                    dr["wentiid"] = quesid;
364
-                    dtCol.Rows.Add(dr);
359
+                    checklist.Add("总计"); //增加总计
365 360
                 }
361
+                #endregion
366 362
             }
367 363
 
368 364
             return Success("获取外呼问题报表表头成功", dtCol);
369 365
         }
370 366
 
371 367
         //获取数据
372
-        public ActionResult GetDataList(string TaskID, string quesid, string countryid, string sdate, string edate)
368
+        public ActionResult GetDataList(string TaskID, string quesid1, string quesid2, string countryid, string sdate, string edate)
373 369
         {
374 370
             int index1 = 0;
375 371
             int index2 = 0;
376
-            GetColumnList(TaskID, quesid);
372
+            GetColumnList(TaskID, quesid1, quesid2);
377 373
             int rowcount = checklist.Count + 1;//行数
378 374
 
379 375
             string[,] newdata = new string[rowcount, columnsnum];
380 376
             #region 回答问题查询条件
381 377
             string sqlans = " isnull(F_TaskID,'')='" + TaskID + "' ";
378
+            string sqlans1 = " ";
382 379
             if (!string.IsNullOrWhiteSpace(countryid))
383 380
                 sqlans += " and isnull(F_Expand1,'')='" + countryid + "' ";
384 381
             if (!string.IsNullOrWhiteSpace(sdate))
@@ -411,11 +408,13 @@ namespace CallCenterApi.Interface.Controllers.report
411 408
                 for (int m = 0; m < dtCol.Rows.Count; m++)
412 409
                 {
413 410
 
414
-                    sqlans += " and F_CusTelID IN (select F_CusTelID from T_Call_OutAnswers where F_TaskID='" + TaskID + "' AND F_QID='" + quesid + "' AND F_Answer='" + items + "') ";
411
+                    sqlans1 = sqlans;
412
+                    sqlans += " and F_CusTelID IN (select F_CusTelID from T_Call_OutAnswers where F_TaskID='" + TaskID + "' AND F_QID='" + quesid2 + "' AND F_Answer='" + items + "') and  F_QID='" + quesid1 + "' ";
413
+                    sqlans1 += " and F_CusTelID IN (select F_CusTelID from T_Call_OutAnswers where F_TaskID='" + TaskID + "' AND F_QID='" + quesid2 + "') and  F_QID='" + quesid1 + "' ";
415 414
                     //根据问题查询回答该问题的总次数
416 415
                     int totalnum = 0;
417 416
                     int num = 0;
418
-                     totalnum = ansBLL.GetRecordCount(sqlans + "  and isnull(F_QIID,'')='" + dtCol.Rows[m]["wentiid"].ToString() + "' ");
417
+                    totalnum = ansBLL.GetRecordCount(sqlans);
419 418
 
420 419
                     string fenxiangshu = dtCol.Rows[m]["fenxiangshu"].ToString();
421 420
                     int fenxiang = fenxiangshu == "" ? 0 : Convert.ToInt32(fenxiangshu);
@@ -423,20 +422,19 @@ namespace CallCenterApi.Interface.Controllers.report
423 422
                     while (n < len)
424 423
                     {
425 424
                         index2++;
426
-                        //同一问题下的分项
427
-                        num = ansBLL.GetRecordCount(sqlans + "  and isnull(F_Answer,'')='" + newdata[0, n + 1] + "' ");
428
-                        
429
-                        if (totalnum > 0)
425
+                        if (items.Equals("总计"))
430 426
                         {
431
-                            if (num > 0)
432
-                            {
433
-                                newdata[index1, index2] = (num / totalnum * 100).ToString() + "%";
434
-                            }
435
-                            else
436
-                            { newdata[index1, index2] = "0"; }
427
+                            //同一问题下的分项
428
+                            num = ansBLL.GetRecordCount(sqlans1 + "' and  F_Answer='" + newdata[0, n + 1] + "'");
429
+                            newdata[index1, index2] = num.ToString();
437 430
                         }
438 431
                         else
439
-                        { newdata[index1, index2] = "0"; }
432
+                        {
433
+                            //同一问题下的分项
434
+                            num = ansBLL.GetRecordCount(sqlans + "  and isnull(F_Answer,'')='" + newdata[0, n + 1] + "' ");
435
+
436
+                            newdata[index1, index2] = num.ToString();
437
+                        }
440 438
                         n++;
441 439
 
442 440
                     }

+ 17 - 5
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/weixin/WxLoginController.cs

@@ -290,11 +290,11 @@ namespace CallCenterApi.Interface.Controllers.weixin
290 290
 
291 291
             if (res)
292 292
             {
293
-                return Error("操作成功");
293
+                return Success("操作成功");
294 294
             }
295 295
             else
296 296
             {
297
-                return Success("操作失败");
297
+                return Error("操作失败");
298 298
             }
299 299
 
300 300
         }
@@ -421,15 +421,27 @@ namespace CallCenterApi.Interface.Controllers.weixin
421 421
             string telphone,string phone,string countryid,string address)
422 422
         {
423 423
             var wxuser = new BLL.T_Sys_Users().GetModelList(" F_OpenId='" + openid + "'  and F_Type=1 ").FirstOrDefault();
424
-            bool res = new callout.PagerAnswerWXController().AnswersWX(telphone, openid, ans, cusname, phone, int.Parse(countryid), address);
424
+            bool res = new callout.PagerAnswerWXController().AnswersWX(telphone, openid, ans, cusname, phone, countryid, address);
425 425
 
426
+            string msg = "";
427
+            if (ans != null)
428
+            {
429
+                foreach (var item in ans)
430
+                {
431
+                    msg += item + ";**;";
432
+                }
433
+            }
434
+            else
435
+            {
436
+                msg = "ans为空";
437
+            }
426 438
             if (res)
427 439
             {
428
-                return Error("问卷提交失败");
440
+                return Success("问卷提交成功:::" + msg);
429 441
             }
430 442
             else
431 443
             {
432
-                return Success("问卷提交成功");
444
+                return Error("问卷提交失败:::" + msg);
433 445
             }
434 446
         }
435 447
         #endregion