Bladeren bron

网格化对接调整;工单不规范结果显示

zhengbingbing 5 jaren geleden
bovenliggende
commit
1699879664

File diff suppressed because it is too large
+ 607 - 302
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/ShangQiuWorkOrderController.cs


+ 10 - 4
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -4509,7 +4509,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4509 4509
                                     + "from T_Bus_SubmitSuper WITH(NOLOCK) where F_State=1 and F_IsDelete=0 and F_Type=2 and F_WorkOrderId ='" + strworkorderid + "' order by F_CreateTime";
4510 4510
                     string htsql = "select *,dbo.GetUserName(F_CreateUser) as UserName "
4511 4511
                                     + "from T_Bus_SubmitSuper WITH(NOLOCK) where F_State=1 and F_IsDelete=0 and F_Type=3 and F_WorkOrderId ='" + strworkorderid + "' order by F_CreateTime";
4512
-                    string jbsql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDeptName(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName "
4512
+                    string jbsql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDeptName(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDictionaryName(F_StandardIDS) as StandardNames  "
4513 4513
                                     + "from T_Bus_AssignedInfo WITH(NOLOCK) where F_State=1 and F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "' order by F_CreateTime";
4514 4514
                     string ejjbsql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDeptName(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName "
4515 4515
                                     + "from T_Bus_AssignedInfo_Next WITH(NOLOCK) where F_State=1 and F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "' order by F_CreateTime";
@@ -4791,7 +4791,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4791 4791
                 switch (type)
4792 4792
                 {
4793 4793
                     case 1:
4794
-                        sql = "select top 1 *,dbo.GetDeptName(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName from T_Bus_AssignedInfo WITH(NOLOCK)"; break;
4794
+                        sql = "select top 1 *,dbo.GetDeptName(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDictionaryName(F_StandardIDS) as StandardNames from T_Bus_AssignedInfo WITH(NOLOCK)"; break;
4795 4795
                     case 2: sql = "select top 1 * from T_Bus_Feedback WITH(NOLOCK)"; break;
4796 4796
                     case 3: sql = "select top 1 * from T_Bus_VisitResult WITH(NOLOCK)"; break;
4797 4797
                     case 4: sql = "select top 1 * from T_Bus_PerformDuties WITH(NOLOCK)"; break;
@@ -6788,7 +6788,13 @@ namespace CallCenterApi.Interface.Controllers.workorder
6788 6788
                             #region
6789 6789
                             if (("," + maindeptid + ",").Contains(",304,"))
6790 6790
                             {
6791
-                                rre = new ShangQiuWorkOrderController().SendToGrdding(0, workorderid, modelT_Bus_WorkOrder.F_ComTitle, modelT_Bus_WorkOrder.F_ComContent, modelT_Bus_WorkOrder.F_SourceAddress, modelT_Bus_WorkOrder.F_ConPhone, modelT_Bus_WorkOrder.F_CusName, modelT_Bus_WorkOrder.F_File, "", "", userModel.F_UserCode, modelT_Bus_WorkOrder.F_InfoType.Value).ToString();
6791
+                                var conname = modelT_Bus_WorkOrder.F_CusName; var conphone = modelT_Bus_WorkOrder.F_ConPhone;
6792
+                                if(modelT_Bus_WorkOrder.F_IsProtect==1)
6793
+                                {
6794
+                                    conphone = "保密";
6795
+                                    conname= "保密";
6796
+                                }
6797
+                                rre = new ShangQiuWorkOrderController().SendToGrdding(modelT_Bus_AssignedInfo.F_Id, workorderid, modelT_Bus_WorkOrder.F_ComTitle, modelT_Bus_WorkOrder.F_ComContent, modelT_Bus_WorkOrder.F_SourceAddress, conphone, conname, modelT_Bus_WorkOrder.F_File, userModel.F_UserCode, modelT_Bus_WorkOrder.F_InfoType.Value).ToString();
6792 6798
                             }
6793 6799
                             #endregion
6794 6800
                         }
@@ -10104,7 +10110,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
10104 10110
                             }
10105 10111
                             if (isstandard == 1)
10106 10112
                             {
10107
-                                oper.F_Message = oper.F_Message + ",办理结果出现不规范情况,请及时查看";
10113
+                                oper.F_Message = oper.F_Message + "办理结果出现不规范情况,请及时查看";
10108 10114
                             }
10109 10115
                             oper.F_CreateUser = userModel.F_UserCode;
10110 10116
                             oper.F_CreateTime = DateTime.Now;

+ 20 - 0
CallCenterCommon/CallCenter.Utility/FileUp.cs

@@ -185,5 +185,25 @@ namespace CallCenter.Utility
185 185
 
186 186
             return newName;
187 187
         }
188
+
189
+        /// <summary>
190
+        /// 根据地址获取文件扩展名
191
+        /// </summary>
192
+        /// <param name="path"></param>
193
+        /// <returns></returns>
194
+        public string GetExt(string path)
195
+        {
196
+            return Path.GetExtension(path);
197
+        }
198
+        /// <summary>
199
+        /// 根据路径获取文件名
200
+        /// </summary>
201
+        /// <param name="path"></param>
202
+        /// <returns></returns>
203
+        public string GetFileName(string path)
204
+        {
205
+            var filename = Path.GetFileName(path);
206
+             return "(" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ")" + filename;
207
+        }
188 208
     }
189 209
 }

+ 98 - 35
CallCenterCommon/CallCenter.Utility/ImageUpload.cs

@@ -5,6 +5,7 @@ using System.Web.UI.HtmlControls;
5 5
 using System.Drawing;
6 6
 using System.Net;
7 7
 using System.Text.RegularExpressions;
8
+using System.IO.Compression;
8 9
 
9 10
 namespace CallCenter.Utility
10 11
 {
@@ -452,11 +453,26 @@ namespace CallCenter.Utility
452 453
         /// <summary>
453 454
         /// 检查上传的文件的类型,是否允许上传。
454 455
         /// </summary>
455
-        private bool IsUploadMp(string Ext)
456
+        private bool IsUploadMp3(string Ext)
456 457
         {
457 458
             Ext = Ext.Replace(".", "");
458 459
             bool b = false;
459
-            string[] arrFileType = ("mp3;mp4").Split(';');
460
+            string[] arrFileType = ("mp3").Split(';');
461
+            foreach (string str in arrFileType)
462
+            {
463
+                if (str.ToLower() == Ext.ToLower())
464
+                {
465
+                    b = true;
466
+                    break;
467
+                }
468
+            }
469
+            return b;
470
+        }
471
+        private bool IsUploadMp4(string Ext)
472
+        {
473
+            Ext = Ext.Replace(".", "");
474
+            bool b = false;
475
+            string[] arrFileType = ("mp4").Split(';');
460 476
             foreach (string str in arrFileType)
461 477
             {
462 478
                 if (str.ToLower() == Ext.ToLower())
@@ -710,7 +726,7 @@ namespace CallCenter.Utility
710 726
         }
711 727
 
712 728
         /// <summary>
713
-        /// 图片转Base64
729
+        /// 文件转Base64
714 730
         /// </summary>
715 731
         /// <param name="ImageFileName">图片的完整路径</param>
716 732
         /// <returns></returns>
@@ -718,50 +734,91 @@ namespace CallCenter.Utility
718 734
         {
719 735
             try
720 736
             {
721
-                var img = UrlToImage(ImageFileName);
722
-                Bitmap bmp = new Bitmap(img);
723 737
 
724
-                MemoryStream ms = new MemoryStream();
725
-                bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
726
-                byte[] arr = new byte[ms.Length];
727
-                ms.Position = 0;
728
-                ms.Read(arr, 0, (int)ms.Length);
729
-                ms.Close();
730
-                return Convert.ToBase64String(arr);
738
+                WebClient mywebclient = new WebClient();
739
+                byte[] Bytes = mywebclient.DownloadData(ImageFileName);
740
+                return  Convert.ToBase64String(Bytes);
731 741
             }
732 742
             catch (Exception ex)
733 743
             {
734 744
                 return null;
735 745
             }
736 746
         }
747
+        public bool IsImg(string ext)
748
+        {
749
+            return IsUpload(ext);
750
+        }
751
+        public bool IsMp3(string ext)
752
+        {
753
+            return IsUploadMp3(ext);
754
+        }
755
+        public bool IsMp4(string ext)
756
+        {
757
+            return IsUploadMp4(ext);
758
+        }
759
+
760
+
761
+        #endregion
762
+        #region
763
+        public string CompressString(string str)
764
+        {
765
+            string compressString = "";
766
+            byte[] compressBeforeByte = System.Text.Encoding.GetEncoding("UTF-8").GetBytes(str);
767
+            byte[] compressAfterByte = Compress(compressBeforeByte);
768
+            compressString = Convert.ToBase64String(compressAfterByte);
769
+            return compressString;
770
+        }
737 771
         /// <summary>
738
-        /// URI图片转Base64
772
+        /// 压缩
739 773
         /// </summary>
740
-        /// <param name="url"></param>
774
+        /// <param name="data"></param>
741 775
         /// <returns></returns>
742
-        public Image UrlToImage(string url)
776
+        public byte[] Compress(byte[] data)
743 777
         {
744
-            WebClient mywebclient = new WebClient();
745
-            byte[] Bytes = mywebclient.DownloadData(url);
746
-            using (MemoryStream ms = new MemoryStream(Bytes))
778
+            try
747 779
             {
748
-                Image outputImg = Image.FromStream(ms);
749
-                return outputImg;
780
+                MemoryStream ms = new MemoryStream();
781
+                GZipStream zip = new GZipStream(ms, CompressionMode.Compress, true);
782
+                zip.Write(data,0, data.Length);
783
+                zip.Close();
784
+                byte[] buffer = new byte[ms.Length];
785
+                ms.Position =0 ;
786
+                ms.Read(buffer,0 , buffer.Length);
787
+                ms.Close();
788
+                return buffer;
789
+
790
+            }
791
+            catch (Exception e)
792
+            {
793
+                throw new Exception(e.Message);
750 794
             }
751 795
         }
752
-        public bool IsImg(string ext)
753
-        {
754
-            return IsUpload(ext);
755
-        }
756
-        public bool IsMp(string ext)
796
+        #endregion
797
+
798
+        #region url下载文件并保存本地
799
+        public string downloadurl(string url,string filename)
757 800
         {
758
-            return IsUploadMp(ext);
759
-        }
801
+            try
802
+            {
803
+                WebClient mywebclient = new WebClient();
804
+                byte[] Bytes = mywebclient.DownloadData(url);
760 805
 
806
+                if (!Directory.Exists(_SavePath)) Directory.CreateDirectory(_SavePath);
761 807
 
808
+                using (var fs = new FileStream(_SavePath+ filename, FileMode.Create))
809
+                {
810
+                    fs.Write(Bytes, 0, Bytes.Length);
811
+                    fs.Flush();
812
+                    return "";
813
+                }
814
+            }
815
+            catch (Exception ex)
816
+            {
817
+                return ex.Message;
818
+            }
819
+        }
762 820
         #endregion
763 821
 
764
-
765 822
         #region base64转音视频文件
766 823
         /// <summary>
767 824
         /// Base64转文件
@@ -770,15 +827,21 @@ namespace CallCenter.Utility
770 827
         /// <returns></returns>
771 828
         public bool Base64ToMP(string strbase,string filepath)//path中需要包含文件名
772 829
         {
773
-            string outPath = filepath;
774
-            var contents = Convert.FromBase64String(strbase);
775
-            using (var fs = new FileStream(outPath, FileMode.Create, FileAccess.Write))
830
+            try
776 831
             {
777
-                fs.Write(contents, 0, contents.Length);
778
-                fs.Flush();
779
-                return true;
832
+                string outPath = filepath;
833
+                var contents = Convert.FromBase64String(strbase);
834
+                using (var fs = new FileStream(outPath, FileMode.Create, FileAccess.Write))
835
+                {
836
+                    fs.Write(contents, 0, contents.Length);
837
+                    fs.Flush();
838
+                    return true;
839
+                }
840
+            }
841
+            catch(Exception ex)
842
+            {
843
+                return false;
780 844
             }
781
-            
782 845
         }
783 846
         #endregion
784 847
     }