1550076451 лет назад: 2
Родитель
Сommit
b1facfb764

+ 5 - 5
RMYY_CallCenter_Api.Dal/T_Sys_GongDan.cs

@@ -53,7 +53,7 @@ namespace RMYY_CallCenter_Api.Dal
53 53
                      new SqlParameter("@F_TimeOut", SqlDbType.Float,8),
54 54
                         new SqlParameter("@F_RepairTimeLimit", SqlDbType.Float,8),
55 55
                           new SqlParameter("@F_Identification", SqlDbType.VarChar,50),
56
-new SqlParameter("@F_AutoDept", SqlDbType.Int,4),
56
+new SqlParameter("@F_AutoDept", SqlDbType.NVarChar,500),
57 57
 new SqlParameter("@F_CanReplayCount", SqlDbType.Int,4),
58 58
 new SqlParameter("@F_CanUrgeCount", SqlDbType.Int,4),
59 59
 
@@ -126,7 +126,7 @@ new SqlParameter("@F_CanUrgeCount", SqlDbType.Int,4),
126 126
                         new SqlParameter("@F_RepairTimeLimit", SqlDbType.Float,8),
127 127
                        new SqlParameter("@F_Identification", SqlDbType.VarChar,50),
128 128
                     new SqlParameter("@F_ImgUrl", SqlDbType.VarChar,200),
129
-new SqlParameter("@F_AutoDept", SqlDbType.Int,4),
129
+new SqlParameter("@F_AutoDept", SqlDbType.NVarChar,500),
130 130
 new SqlParameter("@F_CanReplayCount", SqlDbType.Int,4),
131 131
 new SqlParameter("@F_IsDelete", SqlDbType.Int,4),
132 132
 new SqlParameter("@F_CanUrgeCount", SqlDbType.Int,4),
@@ -318,11 +318,11 @@ new SqlParameter("@F_CanUrgeCount", SqlDbType.Int,4),
318 318
                 {
319 319
                     model.F_TypeId = int.Parse(row["F_TypeId"].ToString());
320 320
                 }
321
-                if (row["F_AutoDept"] != null && row["F_AutoDept"].ToString() != "")
321
+                if (row["F_AutoDept"] != null)
322 322
                 {
323
-                    model.F_AutoDept = int.Parse(row["F_AutoDept"].ToString());
323
+                    model.F_AutoDept = row["F_AutoDept"].ToString();
324 324
                 }
325
-               
325
+
326 326
                 if (row["F_ImgUrl"] != null)
327 327
                 {
328 328
                     model.F_ImgUrl = row["F_ImgUrl"].ToString();

+ 2 - 2
RMYY_CallCenter_Api.Model/T_Sys_GongDan.cs

@@ -21,7 +21,7 @@ namespace RMYY_CallCenter_Api.Model
21 21
         private DateTime? _f_createtime;
22 22
         private int? _f_typeid;
23 23
         private string _f_imgurl;
24
-        private int? _f_autodept;
24
+        private string _f_autodept;
25 25
         private int _f_canreplaycount = 0;
26 26
 
27 27
         private int _f_canurgecount = 0;
@@ -57,7 +57,7 @@ namespace RMYY_CallCenter_Api.Model
57 57
         /// <summary>
58 58
         /// 设置自动流转的部门
59 59
         /// </summary>
60
-        public int? F_AutoDept
60
+        public string F_AutoDept
61 61
         {
62 62
             set { _f_autodept = value; }
63 63
             get { return _f_autodept; }

+ 1 - 1
RMYY_CallCenter_Api.Utility/Tree/TreeModel.cs

@@ -55,7 +55,7 @@ namespace RMYY_CallCenter_Api.Utility
55 55
         public string location { get; set; }
56 56
         public string phone { get; set; }
57 57
         //自动流转部门
58
-        public int? autoDept { get; set; }
58
+        public string autoDept { get; set; }
59 59
         private List<TreeModel> _children;
60 60
         public List<TreeModel> children
61 61
         {

+ 1 - 1
RMYY_CallCenter_Api/Common/InvokeZD.cs

@@ -23,7 +23,7 @@ namespace RMYY_CallCenter_Api
23 23
             string url = ConfigHelper.GetValue("zdaddurl");
24 24
 
25 25
             requestHeaders.Add("userCode", $"{usercode }");
26
-            requestHeaders.Add("authorization", $"{token }");
26
+            requestHeaders.Add("Authorization", $"{token }");
27 27
             requestHeaders.Add("domainUrl", $"{domainUrl }");
28 28
 
29 29
             foreach (var item in requestHeaders)

+ 5 - 4
RMYY_CallCenter_Api/Controllers/DictionaryType/GongDanTypeController.cs

@@ -74,7 +74,7 @@ namespace RMYY_CallCenter_Api.Controllers
74 74
         /// </summary>
75 75
         /// <param name="input"></param>
76 76
         /// <returns></returns>
77
-        public ActionResult AddGongDan(T_Sys_GongDan input)
77
+        public ActionResult AddGongDan(T_Sys_GongDan input,  List<AutoDept> autodept)
78 78
         {
79 79
             T_Sys_GongDan model = new T_Sys_GongDan();
80 80
             model.F_TimeOut = input.F_TimeOut;
@@ -85,7 +85,7 @@ namespace RMYY_CallCenter_Api.Controllers
85 85
             model.F_ParentID = input.F_ParentID;
86 86
             model.F_CreateTime = DateTime.Now;
87 87
             model.F_TypeId = input.F_TypeId;
88
-            model.F_AutoDept = input.F_AutoDept;
88
+            model.F_AutoDept = autodept.ToString();
89 89
             model.F_CanReplayCount = input.F_CanReplayCount;
90 90
             //if (!string .IsNullOrEmpty (input.F_Identification))
91 91
             //{
@@ -188,7 +188,7 @@ namespace RMYY_CallCenter_Api.Controllers
188 188
         /// <param name="input"></param>
189 189
         /// <returns></returns>
190 190
         [HttpPost]
191
-        public ActionResult EditGongDan(T_Sys_GongDan input)
191
+        public ActionResult EditGongDan(T_Sys_GongDan input,List<AutoDept> autodept)
192 192
         {
193 193
             var ModuleInfo = gongdanBll.GetModel(input.F_GDId);
194 194
             if (ModuleInfo != null)
@@ -199,7 +199,7 @@ namespace RMYY_CallCenter_Api.Controllers
199 199
                 ModuleInfo.F_Sort = input.F_Sort;
200 200
                 ModuleInfo.F_TypeId = input.F_TypeId;
201 201
                 ModuleInfo.F_TimeOut = input.F_TimeOut;
202
-                ModuleInfo.F_AutoDept = input.F_AutoDept;
202
+                ModuleInfo.F_AutoDept = autodept.ToJson();
203 203
                 ModuleInfo.F_CanReplayCount = input.F_CanReplayCount;
204 204
                 ModuleInfo.F_CanUrgeCount = input.F_CanUrgeCount;
205 205
                 //if (!string.IsNullOrEmpty(input.F_Identification))
@@ -316,6 +316,7 @@ namespace RMYY_CallCenter_Api.Controllers
316 316
         [AllowAnonymous]
317 317
         public ActionResult GetBBXXList( string typename,int pid = 0, int flag = 0)
318 318
         {
319
+          
319 320
             string sql = "";
320 321
             DataTable gModel = new DataTable();
321 322
             if (flag != 0)

+ 551 - 13
RMYY_CallCenter_Api/Controllers/FaultRepairController.cs

@@ -24,8 +24,12 @@ using Newtonsoft.Json;
24 24
 using System.Configuration;
25 25
 using System.Net.Http.Headers;
26 26
 using Newtonsoft.Json.Linq;
27
+<<<<<<< .merge_file_a74564
27 28
  
28 29
 >>>>>>> .merge_file_a27384
30
+=======
31
+
32
+>>>>>>> .merge_file_a11624
29 33
 
30 34
 namespace RMYY_CallCenter_Api.Controllers
31 35
 {
@@ -620,6 +624,70 @@ namespace RMYY_CallCenter_Api.Controllers
620 624
             }
621 625
             model.F_ReplayCount = 0;
622 626
             int returnid = baseBll.Add(model);
627
+<<<<<<< .merge_file_a74564
628
+=======
629
+           
630
+            #region    如果工单是信息类工单,调接口推送到支点
631
+
632
+            int gdid = int.Parse( DbHelperSQL.GetSingle("select F_GDId from T_Sys_GongDan where F_ParentID = 3000 and F_Name = '信息类' ").ToString());
633
+    
634
+           DataTable dtcate=   DbHelperSQL.Query("select * from  dbo.GetValueId('" + gdid + "')").Tables[0];
635
+            string cate = model.F_WorkOrderCategory;           
636
+            if (dtcate.Select("F_GDId='" + cate + "'").Count() > 0)
637
+            {
638
+                try
639
+                {
640
+                    Dictionary<string, object> dic = new Dictionary<string, object>();
641
+                    dic.Add("incidentTitle", model.F_Content);//咱的项目没有标题
642
+                    dic.Add("incidentDescription", model.F_Content);
643
+                    dic.Add("departmentNo", model.F_ApplicationDept);
644
+                    dic.Add("userNo", model.F_Applicant);
645
+                    dic.Add("itilServiceName",  "");//这个不知道传啥
646
+                    
647
+                    if (!string.IsNullOrEmpty( model.F_Maintenancer))
648
+                    {
649
+                        dic.Add("resaveUserNo", model.F_Maintenancer);
650
+                    }
651
+                    if (!string.IsNullOrEmpty(model.F_DeviceEncode))
652
+                    {
653
+                        dic.Add("equipmentNumber", model.F_DeviceEncode);
654
+                    }
655
+                    if (!string.IsNullOrEmpty(model.F_File))
656
+                    {
657
+                        List<Files> filelist = new List<Files>();
658
+                       DataTable dt= GetFileData(model.F_File, fileurlpath);
659
+                        foreach (DataRow item in dt.Rows)
660
+                        {
661
+                            Files filemodel  = new Files();
662
+                            filemodel.fileExt = item["F_FileType"].ToString();
663
+                            filemodel.fileName = item["F_FileName"].ToString();
664
+                            filemodel.fileUrl = item["F_FileUrl"].ToString();
665
+                            filelist.Add(filemodel);
666
+                        }
667
+                        dic.Add("files", filelist);
668
+
669
+                    }
670
+                    
671
+                        string orderno = InvokeZD.ZDSubmitWorkOrder(dic, User.F_UserCode);
672
+                        if (!string.IsNullOrEmpty(orderno))
673
+                        {
674
+                            T_FaultRepair_Base updatemodel = baseBll.GetModel(model.F_WorkOrderCode);
675
+                            updatemodel.F_OrderNo = orderno;
676
+                            baseBll.Update(updatemodel);
677
+                        }
678
+                    
679
+                    
680
+                }
681
+                catch (Exception)
682
+                {
683
+
684
+                     
685
+                }
686
+             
687
+            }
688
+            #endregion
689
+
690
+>>>>>>> .merge_file_a11624
623 691
             if (User.F_RoleCode != "DDZX" && model.F_WorkOrderState == 0)
624 692
             {
625 693
                 //新工单提醒发给调度中心值班的人
@@ -807,14 +875,44 @@ namespace RMYY_CallCenter_Api.Controllers
807 875
                 if (string.IsNullOrEmpty(ToDept) || ToDept == "0")
808 876
                 {
809 877
                     //根据工单类别判断 是否有指派部门
810
-                    List<Model.T_Sys_GongDan> gd = gdbll.GetModelList(" F_GDId='" + model.F_WorkOrderCategory + "'");
811
-                    int deptid = listgd.First().F_AutoDept != null ? listgd.First().F_AutoDept.Value : 0;
812
-                    if (deptid == 0)
878
+                  //  List<Model.T_Sys_GongDan> gd = gdbll.GetModelList(" F_GDId='" + model.F_WorkOrderCategory + "'");
879
+
880
+                    string yqsql = " select  dbo.[GetYQByUserCode]('" + model.F_Applicant + "')";
881
+                    string yqid = DbHelperSQL.GetSingle(yqsql).ToString() ;
882
+                    if (listgd.Count>0 && !string.IsNullOrEmpty( listgd.First().F_AutoDept))
813 883
                     {
814
-                        return Error("当前工单类型没有设置指派部门,请前往设置或者选择指派部门");
884
+                         
885
+                       List<AutoDept> listautodept =listgd.First().F_AutoDept.ToList<AutoDept>();
886
+                        var modelauto = listautodept.Find(x => x.autoyq == yqid);
887
+                        if (modelauto!=null && !string.IsNullOrEmpty(modelauto.autodept))
888
+                        {                            
889
+                                ToDept = modelauto.autodept;                            
890
+                           
891
+                        }
892
+                        else
893
+                        {
894
+                            var modelauto2 = listautodept.Find(x => x.autoyq == "0");
895
+                            if (modelauto2!=null &&!string.IsNullOrEmpty(modelauto2.autodept))
896
+                            {
897
+                                ToDept = modelauto2.autodept;
898
+                            }
899
+                            else
900
+                            {
901
+                                return Error("当前工单类型没有设置指派部门,请前往设置或者选择指派部门");
902
+                            }
903
+
904
+                        }
905
+
815 906
                     }
816
-                    else
817
-                        ToDept = deptid.ToString();
907
+
908
+
909
+                    //string deptid = listgd.First().F_AutoDept != null ? listgd.First().F_AutoDept : "0";
910
+                    //if (deptid == "0")
911
+                    //{
912
+                    //    return Error("当前工单类型没有设置指派部门,请前往设置或者选择指派部门");
913
+                    //}
914
+                    //else
915
+                    //    ToDept = deptid.ToString();
818 916
                 }
819 917
 
820 918
                 if (!string.IsNullOrEmpty(ToUserCode))
@@ -1630,19 +1728,49 @@ namespace RMYY_CallCenter_Api.Controllers
1630 1728
                 //int timeout = listgd.First().F_TimeOut;
1631 1729
                 //model.F_Deadline = DateTime.Now.AddHours(timeout);
1632 1730
                 string message = "";
1633
-
1731
+                
1634 1732
                 //当工单没有选择指派部门的时候,当前工单类型shezhi指派部门,该工单默认到这个指派的部门
1635 1733
                 if (string.IsNullOrEmpty(ToDept) || ToDept == "0")
1636 1734
                 {
1637 1735
                     //根据工单类别判断 是否有指派部门
1638
-                    List<Model.T_Sys_GongDan> gd = gdbll.GetModelList(" F_GDId='" + model.F_WorkOrderCategory + "'");
1639
-                    int deptid = listgd.First().F_AutoDept != null ? listgd.First().F_AutoDept.Value : 0;
1640
-                    if (deptid == 0)
1736
+
1737
+                    string yqsql = " select  dbo.[GetYQByUserCode]('" + model.F_Applicant + "')";
1738
+                    string yqid = DbHelperSQL.GetSingle(yqsql).ToString();
1739
+                    if (listgd.Count > 0 && !string.IsNullOrEmpty(listgd.First().F_AutoDept))
1641 1740
                     {
1642
-                        return Error("当前工单类型没有设置指派部门,请前往设置或者选择指派部门");
1741
+
1742
+                        List<AutoDept> listautodept = listgd.First().F_AutoDept.ToList<AutoDept>();
1743
+                        var modelauto = listautodept.Find(x => x.autoyq == yqid);
1744
+                        if (modelauto != null && !string.IsNullOrEmpty(modelauto.autodept))
1745
+                        {
1746
+                            ToDept = modelauto.autodept;
1747
+
1748
+                        }
1749
+                        else
1750
+                        {
1751
+                            var modelauto2 = listautodept.Find(x => x.autoyq == "0");
1752
+                            if (modelauto2 != null && !string.IsNullOrEmpty(modelauto2.autodept))
1753
+                            {
1754
+                                ToDept = modelauto2.autodept;
1755
+                            }
1756
+                            else
1757
+                            {
1758
+                                return Error("当前工单类型没有设置指派部门,请前往设置或者选择指派部门");
1759
+                            }
1760
+
1761
+                        }
1762
+
1643 1763
                     }
1644
-                    else
1645
-                        ToDept = deptid.ToString();
1764
+
1765
+
1766
+                    //List<Model.T_Sys_GongDan> gd = gdbll.GetModelList(" F_GDId='" + model.F_WorkOrderCategory + "'");
1767
+                    //string deptid = listgd.First().F_AutoDept != null ? listgd.First().F_AutoDept : "0";
1768
+                    //if (deptid == "0")
1769
+                    //{
1770
+                    //    return Error("当前工单类型没有设置指派部门,请前往设置或者选择指派部门");
1771
+                    //}
1772
+                    //else
1773
+                    //    ToDept = deptid.ToString();
1646 1774
                 }
1647 1775
 
1648 1776
                 if (!string.IsNullOrEmpty(ToUserCode))
@@ -3501,7 +3629,11 @@ namespace RMYY_CallCenter_Api.Controllers
3501 3629
         /// </summary>
3502 3630
         /// <param name="timestamp"></param>
3503 3631
         /// <returns></returns>
3632
+<<<<<<< .merge_file_a74564
3504 3633
         public ActionResult AddWorkOrder(long timestamp)
3634
+=======
3635
+        public ActionResult SubmitWorkOrder(long timestamp,string filestr)
3636
+>>>>>>> .merge_file_a11624
3505 3637
         {
3506 3638
             string port_password = HttpUtility.UrlDecode(RequestString.GetQueryString("port_password"));   //加密信息(安全验证用)
3507 3639
             string uuid = HttpUtility.UrlDecode(RequestString.GetQueryString("uuid"));          //客户唯一标识(安全验证用)
@@ -3545,19 +3677,40 @@ namespace RMYY_CallCenter_Api.Controllers
3545 3677
                 ajresult.message = "安全验证未通过";
3546 3678
                 return Process();
3547 3679
             }
3680
+<<<<<<< .merge_file_a74564
3548 3681
             if (string.IsNullOrEmpty(ApplicationDeptCode))
3549 3682
             {
3550 3683
                 ajresult.state = (int)CodeStatus.必填字段为空;
3551 3684
                 ajresult.message = "科室编码不能为空";
3552 3685
                 return Process();
3553 3686
             }
3687
+=======
3688
+            //if (string.IsNullOrEmpty(ApplicationDeptid))
3689
+            //{
3690
+            //    ajresult.state = (int)CodeStatus.必填字段为空;
3691
+            //    ajresult.message = "科室编码不能为空";
3692
+            //    return Process();
3693
+            //}
3694
+>>>>>>> .merge_file_a11624
3554 3695
             if (string.IsNullOrEmpty(WorkOrderCategory))
3555 3696
             {
3556 3697
                 ajresult.state = (int)CodeStatus.必填字段为空;
3557 3698
                 ajresult.message = "工单类别不能为空";
3558 3699
                 return Process();
3559 3700
             }
3701
+<<<<<<< .merge_file_a74564
3560 3702
             Model.T_FaultRepair_Base model = new Model.T_FaultRepair_Base();      
3703
+=======
3704
+
3705
+            List<Files> files = new List<Files>();
3706
+            if (!string.IsNullOrEmpty(filestr))
3707
+            {
3708
+                files = filestr.ToList<Files>();
3709
+            }
3710
+
3711
+           
3712
+            Model.T_FaultRepair_Base model = new Model.T_FaultRepair_Base();
3713
+>>>>>>> .merge_file_a11624
3561 3714
 
3562 3715
             string sql = "select F_DeptId from T_Sys_Department where F_DeptCode='" + ApplicationDeptCode + "' ";
3563 3716
             string deptid = DbHelperSQL.GetSingle(sql).ToString();
@@ -3579,8 +3732,19 @@ namespace RMYY_CallCenter_Api.Controllers
3579 3732
             model.F_Content = Content;
3580 3733
             model.F_PlaceOfRepair = PlaceOfRepair;//报修地点       
3581 3734
 
3735
+<<<<<<< .merge_file_a74564
3582 3736
 
3583 3737
          
3738
+=======
3739
+            string strfile = "";
3740
+            //有文件
3741
+            if (files != null && files.Count > 0)
3742
+            {
3743
+                strfile = kinfo_upload(files, applicant);
3744
+                model.F_File = strfile;
3745
+            }
3746
+
3747
+>>>>>>> .merge_file_a11624
3584 3748
             model.F_WorkOrderCode = DateTime.Now.ToString("yyyyMMddHHmmssfff");//工单编号
3585 3749
             model.F_EmergencyTypes = EmergencyTypes;
3586 3750
          
@@ -3603,7 +3767,362 @@ namespace RMYY_CallCenter_Api.Controllers
3603 3767
                 AddOperatorLog(applicant + "创建报修工单", (int)EnumOperatorType.add, model.F_WorkOrderCode);
3604 3768
                 return Success("添加成功!", returnid);
3605 3769
             }
3770
+<<<<<<< .merge_file_a74564
3606 3771
              return Error("添加失败!");
3772
+=======
3773
+            return Error("添加失败!");
3774
+
3775
+        }
3776
+
3777
+        [AllowAnonymous]
3778
+        public ActionResult OperateWorkOrder(long timestamp, string filestr)
3779
+        {
3780
+            string port_password = HttpUtility.UrlDecode(RequestString.GetQueryString("port_password"));   //加密信息(安全验证用)
3781
+            string uuid = HttpUtility.UrlDecode(RequestString.GetQueryString("uuid"));          //客户唯一标识(安全验证用)
3782
+          //  string OrderNo = HttpUtility.UrlDecode(RequestString.GetQueryString("workorderid"));
3783
+           // 1交办2接单3完结
3784
+            string type = HttpUtility.UrlDecode(RequestString.GetQueryString("type"));
3785
+            //交办/接单人/处理人
3786
+            string usercode = HttpUtility.UrlDecode(RequestString.GetQueryString("usercode"));
3787
+            string ordercontent = HttpUtility.UrlDecode(RequestString.GetQueryString("Content"));
3788
+            string operatorusercode = HttpUtility.UrlDecode(RequestString.GetQueryString("operator"));
3789
+
3790
+            List<Files> files = new List<Files>();
3791
+            if (!string.IsNullOrEmpty(filestr))
3792
+            {
3793
+                files = filestr.ToList<Files>();
3794
+            }
3795
+
3796
+
3797
+            if (string.IsNullOrEmpty(operatorusercode))
3798
+            {
3799
+                operatorusercode = usercode;
3800
+            }          
3801
+
3802
+
3803
+            if (string.IsNullOrEmpty(usercode))
3804
+            {
3805
+                ajresult.state = (int)CodeStatus.必填字段为空;
3806
+                ajresult.message = "usercode不能为空";
3807
+                return Process();
3808
+            }
3809
+            if (string.IsNullOrEmpty(type))
3810
+            {
3811
+                ajresult.state = (int)CodeStatus.必填字段为空;
3812
+                ajresult.message = "类型不能为空";
3813
+                return Process();
3814
+            }
3815
+
3816
+            if (string.IsNullOrEmpty(uuid))
3817
+            {
3818
+                ajresult.state = (int)CodeStatus.ID不存在;
3819
+                ajresult.message = "客户唯一标识不能为空";
3820
+                return Process();
3821
+            }
3822
+            else if (uuid.Length > 50)
3823
+            {
3824
+                ajresult.state = (int)CodeStatus.字符串超出长度;
3825
+                ajresult.message = "客户唯一标识超出长度";
3826
+                return Process();
3827
+            }
3828
+            try
3829
+            {
3830
+                DateTime time = DateTimeConvert.FromTimetag(timestamp);
3831
+            }
3832
+            catch
3833
+            {
3834
+                var err = new
3835
+                {
3836
+                    code = "1",
3837
+                    message = "时间戳错误"
3838
+                };
3839
+                return Error(err.ToJson());
3840
+            }
3841
+            if (!ICodeValidates(uuid + timestamp, port_password))
3842
+            {
3843
+                ajresult.state = (int)CodeStatus.安全验证未通过;
3844
+                ajresult.message = "安全验证未通过";
3845
+                return Process();
3846
+            }
3847
+
3848
+            string sql = "select F_DeptId from T_Sys_UserAccount where F_UserCode='" + usercode + "'";
3849
+            string userdeptid=   DbHelperSQL.GetSingle(sql).ToString();
3850
+
3851
+            List<Model.T_FaultRepair_Base> modellist = baseBll.GetModelList("F_OrderNo ='" + uuid + "' ");
3852
+            Model.T_FaultRepair_Base model = new T_FaultRepair_Base();
3853
+            if (modellist == null || modellist.Count == 0)
3854
+            {
3855
+                ajresult.state = (int)CodeStatus.ID不存在;
3856
+                ajresult.message = "工单不存在";
3857
+                return Process();
3858
+            }
3859
+            else
3860
+            {
3861
+                model = modellist.First();
3862
+            }
3863
+
3864
+            if (type == "1")
3865
+            {
3866
+                if (model != null)
3867
+                {
3868
+                    if (model.F_WorkOrderState == (int)EnumFaultRepairWorkOrderState.receive)
3869
+                    {
3870
+                        ajresult.state = (int)CodeStatus.执行失败;
3871
+                        ajresult.message = "工单已经指派";
3872
+                        return Process();
3873
+                    }
3874
+                    model.F_AssignUser = operatorusercode;
3875
+                    model.F_AssignTime = DateTime.Now;
3876
+
3877
+                    List<Model.T_Sys_GongDan> listgd = gdbll.GetModelList(" F_GDId='" + model.F_WorkOrderCategory + "'");
3878
+                    double timeout = listgd.First().F_TimeOut;
3879
+                    model.F_Deadline = DateTime.Now.AddHours(timeout);
3880
+                    string message = "";
3881
+
3882
+                    message = "转派工单给" + GetDeptModel(userdeptid) + "部门" + GetUserModel(usercode);
3883
+                    model.F_Maintenancer = usercode;
3884
+                    model.F_MaintenanceDept = userdeptid;
3885
+                    model.F_WorkOrderState = (int)EnumFaultRepairWorkOrderState.receive;
3886
+                    model.F_UpdateTime = DateTime.Now;
3887
+                    AddOperatorLogNew(message, (int)EnumOperatorType.assign, model.F_WorkOrderCode,operatorusercode);
3888
+                    baseBll.Update(model);
3889
+
3890
+                    ajresult.state = (int)CodeStatus.SUCCESS;
3891
+                    ajresult.message = "转派成功";
3892
+                    return Process();
3893
+                   
3894
+
3895
+                }
3896
+            }
3897
+            else if (type == "2")
3898
+            {
3899
+                if (model.F_MaintenanceDept == userdeptid)
3900
+                {
3901
+                    model.F_UpdateTime = DateTime.Now;
3902
+
3903
+                    if (string.IsNullOrEmpty(model.F_Maintenancer))
3904
+                    {
3905
+                        model.F_Maintenancer = usercode;
3906
+                    }
3907
+                    model.F_AcceptTime = DateTime.Now;
3908
+                    model.F_WorkOrderState = (int)EnumFaultRepairWorkOrderState.dealing;
3909
+                    baseBll.Update(model);
3910
+                    AddOperatorLogNew("查收了工单", (int)EnumOperatorType.check, model.F_WorkOrderCode,usercode);
3911
+
3912
+
3913
+                    ajresult.state = (int)CodeStatus.SUCCESS;
3914
+                    ajresult.message = "查收成功";
3915
+                    return Process();
3916
+               
3917
+                }
3918
+                else
3919
+                {
3920
+                    ajresult.state = (int)CodeStatus.异常结果类型;
3921
+                    ajresult.message = "你没有权限查收!";
3922
+                    return Process();
3923
+
3924
+                }
3925
+            }
3926
+            else if (type == "3")
3927
+            {
3928
+                DataTable dt = new DataTable();
3929
+
3930
+
3931
+                if (model != null)
3932
+                {
3933
+                    string strfile = "";
3934
+                    //正常完成 
3935
+                    if (files!=null &&files.Count>0)
3936
+                    {
3937
+                        strfile =  kinfo_upload(files, usercode);
3938
+                    }
3939
+                        model.F_WorkOrderState = (int)EnumFaultRepairWorkOrderState.dealed;               
3940
+                        Model.T_FaultRepair_Process promodel = new Model.T_FaultRepair_Process();
3941
+                        promodel.F_Isdelete = 0;
3942
+                        promodel.F_MaintenanceDept = userdeptid;// model.F_MaintenanceDept;
3943
+                        promodel.F_Maintenancer = usercode;// model.F_Maintenancer;
3944
+                        promodel.F_ProcessingTime = DateTime.Now;
3945
+                        promodel.F_Result = ordercontent;
3946
+                        promodel.F_File = strfile;
3947
+                        promodel.F_WorkOrderCode =model.F_WorkOrderCode;
3948
+                        promodel.F_IsInvolvedEquip = 0;//0 否 1 是
3949
+                        promodel.F_FinishType = "远程"; //报修工单完工时增加处理方式:“远程”、“现场”,默认现场,另外工单详情中需要显示该字段信息
3950
+
3951
+                        promodel.F_DealType = (int)EnumFaultRepairDealType.normal;
3952
+
3953
+                        int id = dealBll.Add(promodel);
3954
+
3955
+                    if (id > 0)
3956
+                    {
3957
+                        if (model.F_IsStop != 1)
3958
+                        { model.F_Endtime = DateTime.Now; }
3959
+                        model.F_IsStop = 0;
3960
+                        baseBll.Update(model);
3961
+                        msg.AddInternalMessagesInfo("您提交的工单已处理完毕,请及时进行评价", "您提交的工单已处理完毕,请及时进行评价\n" + "工单编号:" + model.F_WorkOrderCode, model.F_Applicant, operatorusercode, EnumSmsType.repair
3962
+               , 0, model.F_WorkOrderCode);
3963
+                        AddOperatorLogNew("完结了工单", (int)EnumOperatorType.dealed, model.F_WorkOrderCode,usercode);
3964
+                        ajresult.state = (int)CodeStatus.SUCCESS;
3965
+                        ajresult.message = "处理完成";
3966
+                        return Process();
3967
+
3968
+                    }
3969
+                    else
3970
+                    {
3971
+                        ajresult.state = (int)CodeStatus.无法预测的程序错误;
3972
+                        ajresult.message = "处理失败";
3973
+                        return Process();
3974
+                    }
3975
+                }
3976
+                
3977
+                
3978
+            }
3979
+            ajresult.state = (int)CodeStatus.无法预测的程序错误;
3980
+            ajresult.message = "失败";
3981
+            return Process();
3982
+
3983
+        }
3984
+        [AllowAnonymous]
3985
+        public ActionResult RevokeWorkOrder(long timestamp,string Operator,string workorderid,string Content)
3986
+        {
3987
+            string port_password = HttpUtility.UrlDecode(RequestString.GetQueryString("port_password"));   //加密信息(安全验证用)
3988
+            string uuid = HttpUtility.UrlDecode(RequestString.GetQueryString("uuid"));          //客户唯一标识(安全验证用)
3989
+          //  string OrderNo = HttpUtility.UrlDecode(RequestString.GetQueryString("workorderid"));
3990
+
3991
+            if (string.IsNullOrEmpty(Operator))
3992
+            {
3993
+                ajresult.state = (int)CodeStatus.必填字段为空;
3994
+                ajresult.message = "操作人不能为空";
3995
+                return Process();
3996
+            }
3997
+
3998
+            if (string.IsNullOrEmpty(uuid))
3999
+            {
4000
+                ajresult.state = (int)CodeStatus.ID不存在;
4001
+                ajresult.message = "客户唯一标识不能为空";
4002
+                return Process();
4003
+            }
4004
+            else if (uuid.Length > 50)
4005
+            {
4006
+                ajresult.state = (int)CodeStatus.字符串超出长度;
4007
+                ajresult.message = "客户唯一标识超出长度";
4008
+                return Process();
4009
+            }
4010
+            try
4011
+            {
4012
+                DateTime time = DateTimeConvert.FromTimetag(timestamp);
4013
+            }
4014
+            catch
4015
+            {
4016
+                var err = new
4017
+                {
4018
+                    code = "1",
4019
+                    message = "时间戳错误"
4020
+                };
4021
+                return Error(err.ToJson());
4022
+            }
4023
+            if (!ICodeValidates(uuid + timestamp, port_password))
4024
+            {
4025
+                ajresult.state = (int)CodeStatus.安全验证未通过;
4026
+                ajresult.message = "安全验证未通过";
4027
+                return Process();
4028
+            }
4029
+
4030
+            List<Model.T_FaultRepair_Base> modellist= baseBll.GetModelList(" F_OrderNo='" + uuid + "'");
4031
+
4032
+            Model.T_FaultRepair_Base model = new T_FaultRepair_Base();
4033
+
4034
+            if (modellist!=null && modellist.Count>0)
4035
+            {
4036
+                model = modellist.First();
4037
+            }
4038
+            if (model == null)
4039
+            {
4040
+                ajresult.state = (int)CodeStatus.ID不存在;
4041
+                ajresult.message = "工单id不存在";
4042
+                return Process();
4043
+            }
4044
+            string s = "";
4045
+            if (!string.IsNullOrEmpty(Content))
4046
+            {
4047
+                s += ",撤回原因:" + Content;
4048
+            }
4049
+            model.F_WorkOrderState = (int)EnumFaultRepairWorkOrderState.revoke;
4050
+            model.F_Maintenancer = "";
4051
+            model.F_MaintenanceDept = "";
4052
+            model.F_AssignTime = null;
4053
+            model.F_AssignUser = "";
4054
+            model.F_UpdateTime = DateTime.Now;
4055
+            model.F_Deadline = null;
4056
+
4057
+            baseBll.Update(model);
4058
+
4059
+
4060
+
4061
+            AddOperatorLogNew(  "撤回了工单" + s, (int)EnumOperatorType.retract, model.F_WorkOrderCode, Operator);
4062
+            return Success("撤回操作成功");
4063
+
4064
+
4065
+
4066
+        }
4067
+
4068
+        public static bool ICodeValidates(string strParams, string ICode)
4069
+        {
4070
+            string SecurityCode = "wuyuan%#@6"; //ConfigurationManager.AppSettings["SecurityCode"];
4071
+            string pwd = Md5(SecurityCode + strParams);
4072
+            return pwd.Equals(ICode);
4073
+            //return true;
4074
+        }
4075
+        public static string Md5(string txt)
4076
+        {
4077
+            byte[] sor = Encoding.UTF8.GetBytes(txt);
4078
+            MD5 md5 = MD5.Create();
4079
+            byte[] result = md5.ComputeHash(sor);
4080
+            StringBuilder strbul = new StringBuilder(40);
4081
+            for (int i = 0; i < result.Length; i++)
4082
+            {
4083
+                //加密结果"x2"结果为32位,"x3"结果为48位,"x4"结果为64位
4084
+                strbul.Append(result[i].ToString("x2"));
4085
+            }
4086
+            return strbul.ToString().ToLower(); ;
4087
+        }
4088
+
4089
+
4090
+        public string kinfo_upload(List<Files> files,string usercode)
4091
+        {
4092
+            string returnfileids = "";
4093
+            foreach (Files item in files)
4094
+            {
4095
+                //文件下载地址
4096
+                try
4097
+                {
4098
+                    string path = "/Upload/Files/" + DateTime.Now.ToString("yyyy") + "/" + DateTime.Now.ToString("MM") + "/" + DateTime.Now.ToString("dd") + "/";
4099
+                    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(item.fileUrl);
4100
+                    HttpWebResponse response = request.GetResponse() as HttpWebResponse;
4101
+                    Stream responseStream = response.GetResponseStream();
4102
+
4103
+                    string Currentpath = Server.MapPath("..") + path;
4104
+                    // 如果不存在就创建file文件夹
4105
+                    if (!Directory.Exists(Currentpath))
4106
+                    {
4107
+                        if (Currentpath != null) Directory.CreateDirectory(Currentpath);
4108
+                    }
4109
+                    Stream stream = new FileStream(Currentpath + item.fileName, FileMode.Create);
4110
+                    byte[] bArr = new byte[1024];
4111
+                    int size = responseStream.Read(bArr, 0, bArr.Length);
4112
+                    while (size > 0)
4113
+                    {
4114
+                        stream.Write(bArr, 0, size);
4115
+                        size = responseStream.Read(bArr, 0, bArr.Length);
4116
+                    }
4117
+                    stream.Close();
4118
+                    responseStream.Close();
4119
+
4120
+                        Model.T_Sys_Accessories model_T_Sys_Accessories = new Model.T_Sys_Accessories();
4121
+                        model_T_Sys_Accessories.F_AddTime = DateTime.Now;//上传时间
4122
+                        model_T_Sys_Accessories.F_FileName = item.fileName;//附件名称
4123
+                       model_T_Sys_Accessories.F_FileType = item.fileExt; //Path.GetExtension(file.FileName);//附件类型
4124
+                        model_T_Sys_Accessories.F_FileUrl = path + item.fileName;//附件地址
4125
+>>>>>>> .merge_file_a11624
3607 4126
             
3608 4127
         }
3609 4128
              /// <summary>
@@ -3643,6 +4162,25 @@ namespace RMYY_CallCenter_Api.Controllers
3643 4162
 
3644 4163
         #endregion
3645 4164
     }
4165
+<<<<<<< .merge_file_a74564
3646 4166
 
3647 4167
      
4168
+=======
4169
+    public class Files
4170
+    {
4171
+        public string fileName { get; set; }
4172
+        public string fileExt { get; set; }
4173
+        public string fileUrl { get; set; }
4174
+    }
4175
+
4176
+    public class  AutoDept
4177
+    {
4178
+        public string  autoyq { get; set; }
4179
+        public string  autodept { get; set; }
4180
+        public string  autousercode { get; set; }
4181
+
4182
+    }
4183
+
4184
+  
4185
+>>>>>>> .merge_file_a11624
3648 4186
 }

+ 32 - 0
RMYY_CallCenter_Api/Controllers/WorkOrder/WorkCommonController.cs

@@ -435,6 +435,38 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
435 435
                 {
436 436
                     touserlist.Add(ordermodel.F_DealUser);
437 437
                 }
438
+<<<<<<< .merge_file_a52468
439
+=======
440
+            #region 申请人催单并且类型是xinxilei的工单,调用支点接口去催单
441
+
442
+                int gdid = int.Parse(DbHelperSQL.GetSingle("select F_GDId from T_Sys_GongDan where F_ParentID = 3000 and F_Name = '信息类' ").ToString());
443
+
444
+                DataTable dtcate = DbHelperSQL.Query("select * from  dbo.GetValueId('" + gdid + "')").Tables[0];
445
+                int cate = ordermodel.F_SonType;
446
+                if (dtcate.Select("F_GDId='" + cate + "'").Count() > 0)
447
+                {
448
+                    try
449
+                    {
450
+                        Dictionary<string, object> dic = new Dictionary<string, object>();
451
+                        dic.Add("incidentNo",ordermodel.F_OrderNo);
452
+                        dic.Add("userNo", User.F_UserCode);
453
+                        if (!string.IsNullOrEmpty(reason)  )
454
+                        {
455
+                            reason = "请加快处理进度";
456
+                        }
457
+                        dic.Add("urgeMessage", reason);
458
+                        
459
+                     var obj=   InvokeZD.ZDUrgeWorkOrder(dic, User.F_UserCode);
460
+                    }
461
+                    catch (Exception e)
462
+                    {
463
+                        LogHelper.Info("UrgeWorkOrder接口异常, "+ e.Message);
464
+                    }
465
+                 
466
+
467
+                }
468
+             #endregion
469
+>>>>>>> .merge_file_a72180
438 470
             }
439 471
             if (touserlist != null && touserlist.Count > 0)
440 472
             {