zhoufan %!s(int64=4) %!d(string=hace) años
padre
commit
c399c99cbe

+ 26 - 11
codegit/CallCenterApi/CallCenterApi.DAL/T_Call_CallRecords.cs

@@ -14,6 +14,8 @@ namespace CallCenterApi.DAL
14 14
     /// </summary>
15 15
     public partial class T_Call_CallRecords
16 16
     {
17
+        private static readonly object Global_Lock = new object();
18
+
17 19
         public T_Call_CallRecords()
18 20
         { }
19 21
         #region  BasicMethod
@@ -773,12 +775,22 @@ namespace CallCenterApi.DAL
773 775
             parameters[3].Value = model.ExtNumber;
774 776
             parameters[4].Value = model.CallId;
775 777
             parameters[5].Value = model.DealType;
776
-            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
777
-            if (rows > 0)
778
+            try
778 779
             {
779
-                return true;
780
+                lock (DAL.T_Call_CallRecords.Global_Lock)
781
+                {
782
+                    int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
783
+                    if (rows > 0)
784
+                    {
785
+                        return true;
786
+                    }
787
+                    else
788
+                    {
789
+                        return false;
790
+                    }
791
+                }
780 792
             }
781
-            else
793
+            catch
782 794
             {
783 795
                 return false;
784 796
             }
@@ -808,14 +820,17 @@ namespace CallCenterApi.DAL
808 820
             parameters[0].Value = model.CallId;
809 821
             parameters[1].Value = model.CallState;
810 822
             parameters[2].Value = model.DealType;
811
-            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
812
-            if (rows > 0)
813
-            {
814
-                return true;
815
-            }
816
-            else
823
+            lock (DAL.T_Call_CallRecords.Global_Lock)
817 824
             {
818
-                return false;
825
+                int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
826
+                if (rows > 0)
827
+                {
828
+                    return true;
829
+                }
830
+                else
831
+                {
832
+                    return false;
833
+                }
819 834
             }
820 835
         }
821 836
 

+ 2 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj

@@ -125,7 +125,7 @@
125 125
     <Reference Include="System.Xml.Linq" />
126 126
     <Reference Include="TopSdk, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
127 127
       <SpecificVersion>False</SpecificVersion>
128
-      <HintPath>bin\TopSdk.dll</HintPath>
128
+      <HintPath>Lib\TopSdk.dll</HintPath>
129 129
     </Reference>
130 130
   </ItemGroup>
131 131
   <ItemGroup>
@@ -155,6 +155,7 @@
155 155
     <Content Include="Global.asax" />
156 156
     <Content Include="Lib\Senparc.Weixin.dll" />
157 157
     <Content Include="Lib\Senparc.Weixin.MP.dll" />
158
+    <Content Include="Lib\TopSdk.dll" />
158 159
     <Content Include="Txt\dirtywords.txt" />
159 160
     <Content Include="Web.config">
160 161
       <SubType>Designer</SubType>

+ 24 - 21
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs

@@ -463,7 +463,8 @@ namespace CallCenterApi.Interface.Controllers.tel
463 463
             {
464 464
 
465 465
                 string strid = RequestString.GetFormString("callid");
466
-                bool bl = new BLL.T_Call_CallRecords().UpdateCallInHookTelRecord(strid);
466
+                //bool bl = new BLL.T_Call_CallRecords().UpdateCallInHookTelRecord(strid);
467
+                bool bl = true;
467 468
                 if (bl)
468 469
                 {
469 470
                     res = Success("更新挂机状态成功");
@@ -487,27 +488,29 @@ namespace CallCenterApi.Interface.Controllers.tel
487 488
             if (Request.IsAuthenticated)
488 489
             {
489 490
 
490
-                Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
491
-                model.CallId = RequestString.GetFormString("callid");
492
-                model.CallState = 1;
493
-                model.DealType = 6;
494
-                model.FilePath = RequestString.GetFormString("path");
495
-                bool bl = new BLL.T_Call_CallRecords().UpdateCallInPathTelRecord(model);
496
-                if (bl)
497
-                {
498
-                    Model.T_Call_CallRecords vmodel = new BLL.T_Call_CallRecords().GetModelByCallId(model.CallId);
499
-                    string type = vmodel.OperateType.ToString();
500
-                    if (type == "7")
501
-                    {
502
-                        new BLL.T_Call_TaskTelNum().UpdateYJ(Convert.ToInt32(vmodel.OperateObject.ToString()), 1);
503
-                    }
491
+                //Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
492
+                //model.CallId = RequestString.GetFormString("callid");
493
+                //model.CallState = 1;
494
+                //model.DealType = 6;
495
+                //model.FilePath = RequestString.GetFormString("path");
496
+                //bool bl = new BLL.T_Call_CallRecords().UpdateCallInPathTelRecord(model);
497
+                //if (bl)
498
+                //{
499
+                //    Model.T_Call_CallRecords vmodel = new BLL.T_Call_CallRecords().GetModelByCallId(model.CallId);
500
+                //    string type = vmodel.OperateType.ToString();
501
+                //    if (type == "7")
502
+                //    {
503
+                //        new BLL.T_Call_TaskTelNum().UpdateYJ(Convert.ToInt32(vmodel.OperateObject.ToString()), 1);
504
+                //    }
505
+
506
+                //    res = Success("更新挂机状态成功");
507
+                //}
508
+                //else
509
+                //{
510
+                //    res = Success("更新挂机状态失败");
511
+                //}
504 512
 
505
-                    res = Success("更新挂机状态成功");
506
-                }
507
-                else
508
-                {
509
-                    res = Success("更新挂机状态失败");
510
-                }
513
+                res = Success("更新挂机状态成功");
511 514
 
512 515
             }
513 516
             return res;