Przeglądaj źródła

修改来电弹屏创建工单接口 客户基本信息表中无客户时要增加客户基本信息

machenyang 8 lat temu
rodzic
commit
df6072993c

+ 31 - 11
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs

@@ -1,5 +1,6 @@
1 1
 using CallCenter.Utility;
2 2
 using CallCenterApi.Common;
3
+using CallCenterApi.DB;
3 4
 using CallCenterApi.Interface.Controllers.Base;
4 5
 using System;
5 6
 using System.Collections.Generic;
@@ -502,16 +503,18 @@ namespace CallCenterApi.Interface.Controllers.tel
502 503
                         string callCustomer = RequestString.GetFormString("callCustomer");
503 504
                         //电话
504 505
                         string tel = RequestString.GetFormString("tel");
506
+                        //来电所在省份
507
+                        string prov = RequestString.GetFormString("province");
505 508
                         //来电单位
506 509
                         string lddep = RequestString.GetFormString("lddep");
507 510
                         //反馈单位
508 511
                         string fkdep = RequestString.GetFormString("fkdep");
509 512
                         //工单来源
510
-                        int gdly = RequestString.GetInt("gdlx", 0);
513
+                        int gdly = RequestString.GetFormInt("gdlx", 0);
511 514
                         //工单类型
512
-                        int gdlx = RequestString.GetInt("gdlx", 0);
515
+                        int gdlx = RequestString.GetFormInt("gdlx", 0);
513 516
                         //工单状态
514
-                        int gdzt = RequestString.GetInt("gdzt", 0);
517
+                        int gdzt = RequestString.GetFormInt("gdzt", 0);
515 518
                         //反馈内容
516 519
                         string fkcont = RequestString.GetFormString("fkcont");
517 520
                         //快递信息
@@ -543,7 +546,7 @@ namespace CallCenterApi.Interface.Controllers.tel
543 546
                         model.Province = note2;
544 547
                         //备注三
545 548
                         model.City = note3;
546
-                        //默认为待指派
549
+                        //默认为未处理
547 550
                         model.State = 0;
548 551
                         model.IsDel = 0;
549 552
                         model.IsReturn = 0;
@@ -553,12 +556,12 @@ namespace CallCenterApi.Interface.Controllers.tel
553 556
                         model.IsTimeOut = 0;
554 557
                         model.IsUserSend = 0;
555 558
                         model.IsAdminSend = 0;
556
-
557
-                        Model.T_Wo_WorkOrderTimeOut to = new BLL.T_Wo_WorkOrderTimeOut().GetModel(gdlx);
558
-                        if (to != null)
559
-                        {
560
-                            model.LimitTime = to.MainTime;
561
-                        }
559
+                        ////原——将新增的工单插入待指派表中
560
+                        //Model.T_Wo_WorkOrderTimeOut to = new BLL.T_Wo_WorkOrderTimeOut().GetModel(gdlx);
561
+                        //if (to != null)
562
+                        //{
563
+                        //    model.LimitTime = to.MainTime;
564
+                        //}
562 565
 
563 566
                         model.CreateUser = ua.F_UserCode;
564 567
                         model.CreateTime = DateTime.Now;
@@ -646,7 +649,24 @@ namespace CallCenterApi.Interface.Controllers.tel
646 649
                                     new BLL.T_Call_CallRecords().Update(rec);
647 650
                                 }
648 651
                             }
649
-                            res = Success("新增成功!");
652
+                            //如果客户不存在,需要同时添加到客户基础信息表中
653
+                            Model.T_Cus_CustomerBase userModel = new BLL.T_Cus_CustomerBase().GetModel(tel);
654
+                            if (userModel == null)
655
+                            {
656
+                                int cusid = new BLL.T_Cus_CustomerBase().Add(new Model.T_Cus_CustomerBase()
657
+                                {
658
+                                    F_CustomerName = callCustomer,
659
+                                    F_Mobile = tel,
660
+                                    F_CreateBy = userId,
661
+                                    F_CreatedOn = DateTime.Now,
662
+                                    F_DeleteFlag = 0,
663
+                                    F_Province = prov,
664
+                                    F_CustomerIndustry = lddep,
665
+                                    F_RelationShipClass = fkdep
666
+                                });
667
+                                if (cusid > 0)
668
+                                    res = Success("新增成功!");
669
+                            }
650 670
                         }
651 671
                         else
652 672
                         {