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

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

machenyang лет назад: 8
Родитель
Сommit
df6072993c

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

1
 using CallCenter.Utility;
1
 using CallCenter.Utility;
2
 using CallCenterApi.Common;
2
 using CallCenterApi.Common;
3
+using CallCenterApi.DB;
3
 using CallCenterApi.Interface.Controllers.Base;
4
 using CallCenterApi.Interface.Controllers.Base;
4
 using System;
5
 using System;
5
 using System.Collections.Generic;
6
 using System.Collections.Generic;
502
                         string callCustomer = RequestString.GetFormString("callCustomer");
503
                         string callCustomer = RequestString.GetFormString("callCustomer");
503
                         //电话
504
                         //电话
504
                         string tel = RequestString.GetFormString("tel");
505
                         string tel = RequestString.GetFormString("tel");
506
+                        //来电所在省份
507
+                        string prov = RequestString.GetFormString("province");
505
                         //来电单位
508
                         //来电单位
506
                         string lddep = RequestString.GetFormString("lddep");
509
                         string lddep = RequestString.GetFormString("lddep");
507
                         //反馈单位
510
                         //反馈单位
508
                         string fkdep = RequestString.GetFormString("fkdep");
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
                         string fkcont = RequestString.GetFormString("fkcont");
519
                         string fkcont = RequestString.GetFormString("fkcont");
517
                         //快递信息
520
                         //快递信息
543
                         model.Province = note2;
546
                         model.Province = note2;
544
                         //备注三
547
                         //备注三
545
                         model.City = note3;
548
                         model.City = note3;
546
-                        //默认为待指派
549
+                        //默认为未处理
547
                         model.State = 0;
550
                         model.State = 0;
548
                         model.IsDel = 0;
551
                         model.IsDel = 0;
549
                         model.IsReturn = 0;
552
                         model.IsReturn = 0;
553
                         model.IsTimeOut = 0;
556
                         model.IsTimeOut = 0;
554
                         model.IsUserSend = 0;
557
                         model.IsUserSend = 0;
555
                         model.IsAdminSend = 0;
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
                         model.CreateUser = ua.F_UserCode;
566
                         model.CreateUser = ua.F_UserCode;
564
                         model.CreateTime = DateTime.Now;
567
                         model.CreateTime = DateTime.Now;
646
                                     new BLL.T_Call_CallRecords().Update(rec);
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
                         else
671
                         else
652
                         {
672
                         {