Kaynağa Gözat

外呼导入

duhongyu 5 yıl önce
ebeveyn
işleme
f08b2a712d

+ 23 - 12
代码/TVShoppingCallCenter_ZLJ/Controllers/AutoDial/OutboundTaskController.cs

136
                 {
136
                 {
137
                     foreach (var it in task)
137
                     foreach (var it in task)
138
                     {
138
                     {
139
-                        if (model.F_Tel.Length >= 11)
139
+                        if (input.F_Tel.Length >= 11)
140
                         {
140
                         {
141
-                            it.number = await CallOutprefix(model.F_Tel);
141
+                            it.number = await CallOutprefix(input.F_Tel);
142
                         }
142
                         }
143
                         else
143
                         else
144
-                            it.number = model.F_Tel;
144
+                            it.number = input.F_Tel;
145
 
145
 
146
                         var taskres = await _taskrepository.Update(it);
146
                         var taskres = await _taskrepository.Update(it);
147
                     }
147
                     }
514
                   
514
                   
515
                    // model.F_LastCallid = it.F_LastCallid;
515
                    // model.F_LastCallid = it.F_LastCallid;
516
                     model.F_Tel = dr["外呼号码"].ToString();
516
                     model.F_Tel = dr["外呼号码"].ToString();
517
-                    model.F_IsDelete = 0;
518
-                    int b = await _sys_autodialrepository.Add(model);
519
-                    if (b <= 0)
517
+                    var call = _sys_autodialrepository.GetListALL(x => x.F_Tel == dr["外呼号码"].ToString() && x.F_ISOutbound == 0 &&
518
+                   x.F_IsDelete == 0).Result;
519
+                    if (call!=null && call.Count ()>0)
520
                     {
520
                     {
521
-                        if (!string.IsNullOrEmpty(errmsg))
522
-                        {
523
-                            errmsg = errmsg + "\r\n第" + index + "行导入失败!";
524
-                        }
525
-                        else
521
+                        errmsg = errmsg + "\r\n第" + index + "行导入失败!该已存在外呼任务中";
522
+                    }
523
+                    else
524
+                    {
525
+                        model.F_IsDelete = 0;
526
+                        int b = await _sys_autodialrepository.Add(model);
527
+                        if (b <= 0)
526
                         {
528
                         {
527
-                            errmsg = "第" + index + "行导入失败!";
529
+                            if (!string.IsNullOrEmpty(errmsg))
530
+                            {
531
+                                errmsg = errmsg + "\r\n第" + index + "行导入失败!";
532
+                            }
533
+                            else
534
+                            {
535
+                                errmsg = "第" + index + "行导入失败!";
536
+                            }
528
                         }
537
                         }
529
                     }
538
                     }
539
+                  
540
+                   
530
                     index++;
541
                     index++;
531
 
542
 
532
                 }
543
                 }