1550076451 2 years ago
parent
commit
769613cfa4

+ 61 - 8
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/AffairsController.cs

1733
             public string TROWGUID { set; get; }
1733
             public string TROWGUID { set; get; }
1734
             public string SIGN_NAME { set; get; }
1734
             public string SIGN_NAME { set; get; }
1735
         }
1735
         }
1736
+        public ActionResult case_sign(string workorderid)
1737
+        {
1738
+            Model.T_Bus_WorkOrder modelT_Bus_WorkOrder = workorderBLL.GetModel(workorderid);
1739
+            if (modelT_Bus_WorkOrder != null)
1740
+            {
1741
+                var affairs = affairsBll.GetModel(modelT_Bus_WorkOrder.F_WorkOrderId);
1742
+                receive_case_sign paras = new receive_case_sign();
1743
+                paras.TROWGUID = affairs.TROWGUID;
1744
+                paras.SIGN_NAME = "审核员";
1745
+                Dictionary<string, object> keyValuePairs = new Dictionary<string, object>();
1746
+                try
1747
+                {
1748
+                    string jsonParam = "paras=" + paras.ToJson() + "&message=签收工单&url=http://59.227.93.14:9000/share/fwgdqsjk&WorkOrderId=" + modelT_Bus_WorkOrder.F_WorkOrderId;
1749
+                    var responseString = HttpMethods.HttpPost(FrontUrl + "/Affairs/receive_Push", jsonParam);
1750
+                    bendiack jo = JsonConvert.DeserializeObject<bendiack>(responseString);
1751
+                    if (jo.state != "success")
1752
+                    {
1753
+                        if (!jo.message.Contains("该任务单已签收"))
1754
+                        {
1755
+                            keyValuePairs.Add("F_Administrative", "2");
1756
+                            LogFactory.GetLogger("签收").Error(jo.message);
1757
+                            return Error("签收失败");
1758
+                        }
1759
+                        else
1760
+                        {
1761
+                            keyValuePairs.Add("F_Administrative", "0");
1762
+                        }
1763
+
1764
+                    }
1736
 
1765
 
1766
+                }
1767
+                catch (Exception e)
1768
+                {
1769
+                    keyValuePairs.Add("F_Administrative", "2");
1770
+                    LogFactory.GetLogger("签收").Error(e.Message);
1771
+                }
1772
+                bool n = workorderBLL.UpdateWorkOrder(modelT_Bus_WorkOrder.F_Id, keyValuePairs);
1773
+                return Success("");
1774
+            }
1775
+            else
1776
+                return Error("");
1777
+        }
1737
         /// <summary>
1778
         /// <summary>
1738
         /// 提交签收工单
1779
         /// 提交签收工单
1739
         /// </summary>
1780
         /// </summary>
1758
                                 receive_case_sign paras = new receive_case_sign();
1799
                                 receive_case_sign paras = new receive_case_sign();
1759
                                 paras.TROWGUID = affairs.TROWGUID;
1800
                                 paras.TROWGUID = affairs.TROWGUID;
1760
                                 paras.SIGN_NAME = User.F_UserName;
1801
                                 paras.SIGN_NAME = User.F_UserName;
1761
-
1802
+                                Dictionary<string, object> keyValuePairs = new Dictionary<string, object>();
1762
                                 try
1803
                                 try
1763
                                 {
1804
                                 {
1764
 
1805
 
1768
                                     if (jo.state != "success")
1809
                                     if (jo.state != "success")
1769
                                     {
1810
                                     {
1770
                                         if (!jo.message.Contains("该任务单已签收"))
1811
                                         if (!jo.message.Contains("该任务单已签收"))
1812
+                                        {
1813
+                                            keyValuePairs.Add("F_Administrative", "2");
1814
+                                            LogFactory.GetLogger("签收").Error(jo.message);
1771
                                             return Error("签收失败");
1815
                                             return Error("签收失败");
1816
+                                        }
1817
+                                       
1772
                                     }
1818
                                     }
1773
 
1819
 
1774
                                 }
1820
                                 }
1782
 
1828
 
1783
                                 if (modelT_Bus_WorkOrder.F_WorkState == (int)EnumWorkState.neworder || modelT_Bus_WorkOrder.F_WorkState == (int)EnumWorkState.audit)
1829
                                 if (modelT_Bus_WorkOrder.F_WorkState == (int)EnumWorkState.neworder || modelT_Bus_WorkOrder.F_WorkState == (int)EnumWorkState.audit)
1784
                                 {
1830
                                 {
1785
-                                    Dictionary<string, object> keyValuePairs = new Dictionary<string, object>();
1831
+                                 
1786
                                     #region 保存工单信息
1832
                                     #region 保存工单信息
1787
                                     keyValuePairs.Add("F_SubmitTime", DateTime.Now);
1833
                                     keyValuePairs.Add("F_SubmitTime", DateTime.Now);
1788
                                     //  modelT_Bus_WorkOrder.F_SubmitTime = DateTime.Now;
1834
                                     //  modelT_Bus_WorkOrder.F_SubmitTime = DateTime.Now;
1858
                 string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks]) 
1904
                 string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks]) 
1859
                    values   ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", WorkOrderId, paras, DateTime.Now, jo.code, jo.message, message, jo.message, "");
1905
                    values   ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", WorkOrderId, paras, DateTime.Now, jo.code, jo.message, message, jo.message, "");
1860
                 object objres = DbHelperSQL.GetSingle(strSql);
1906
                 object objres = DbHelperSQL.GetSingle(strSql);
1861
-                return Error(message + jo.message);
1907
+                return Error( jo.message);
1862
             }
1908
             }
1863
             }
1909
             }
1864
             catch (Exception e)
1910
             catch (Exception e)
2076
                             assignBLL.Update(modelT_Bus_AssignedInfo);
2122
                             assignBLL.Update(modelT_Bus_AssignedInfo);
2077
                         }
2123
                         }
2078
 
2124
 
2079
-                        workorderBLL.UpdateWorkOrder(modelT_Bus_WorkOrder.F_Id, keyValuePairs);
2125
+                       
2080
                         #endregion
2126
                         #endregion
2081
 
2127
 
2082
                         #region 插入操作记录
2128
                         #region 插入操作记录
2113
                             var responseString = HttpMethods.HttpPost(FrontUrl+ "/Affairs/receive_Push", jsonParam);
2159
                             var responseString = HttpMethods.HttpPost(FrontUrl+ "/Affairs/receive_Push", jsonParam);
2114
                             bendiack jo = JsonConvert.DeserializeObject<bendiack>(responseString);
2160
                             bendiack jo = JsonConvert.DeserializeObject<bendiack>(responseString);
2115
                             if (jo.state != "success")
2161
                             if (jo.state != "success")
2116
-                                return Error("反馈失败");
2117
-
2162
+                            {
2163
+                                return Error(jo.message );
2164
+                            }
2118
                         }
2165
                         }
2119
                         catch
2166
                         catch
2120
                         {
2167
                         {
2121
 
2168
 
2122
                         }
2169
                         }
2170
+
2171
+                        workorderBLL.UpdateWorkOrder(modelT_Bus_WorkOrder.F_Id, keyValuePairs);
2123
                         #region 插入操作记录
2172
                         #region 插入操作记录
2124
                         Model.T_Bus_Operation oper1 = new Model.T_Bus_Operation();
2173
                         Model.T_Bus_Operation oper1 = new Model.T_Bus_Operation();
2125
                         oper1.F_WorkOrderId = modelT_Bus_WorkOrder.F_WorkOrderId;
2174
                         oper1.F_WorkOrderId = modelT_Bus_WorkOrder.F_WorkOrderId;
2382
                             delay.F_OldTime = DateTime.Parse(affairs.TBACKTIME_BF);
2431
                             delay.F_OldTime = DateTime.Parse(affairs.TBACKTIME_BF);
2383
                         }
2432
                         }
2384
 
2433
 
2434
+                        string resdate = delay.F_OldTime.Value.ToString("yyyy-MM-dd");
2435
+                        DataTable dt = DbHelperSQL.Query("select top " + newlimittime + " F_OffDate from  T_Sys_WorkOFFDays  with(nolock) where F_OffState = 1   and F_OffDate>'" + resdate + "' order by F_OffDate").Tables[0];
2436
+                        var resdatetime = dt.Rows[dt.Rows.Count - 1]["F_OffDate"].ToString();
2437
+                        resdatetime = Convert.ToDateTime(resdatetime).ToString("yyyy-MM-dd") + " " + delay.F_OldTime.Value.ToString("HH:mm:ss");
2385
 
2438
 
2386
-                        delay.F_NewTime = delay.F_OldTime.Value.AddDays(newlimittime);
2439
+                        delay.F_NewTime = Convert.ToDateTime(resdatetime);
2387
 
2440
 
2388
                         delay.F_Reason = reason;
2441
                         delay.F_Reason = reason;
2389
                         //delay.F_State = 1;
2442
                         //delay.F_State = 1;
2477
                         try
2530
                         try
2478
                         {
2531
                         {
2479
 
2532
 
2480
-                            if (User.F_RoleCode == "WLDW"||type !=0)
2533
+                            if (User.F_RoleCode != "WLDW"||type !=0)
2481
                             {
2534
                             {
2482
                                 string jsonParam = "paras=" + paras.ToJson() + "&message=申请延时&url=http://59.227.93.14:9000/share/fwgdyqsqjk&WorkOrderId=" + modelT_Bus_WorkOrder.F_WorkOrderId;
2535
                                 string jsonParam = "paras=" + paras.ToJson() + "&message=申请延时&url=http://59.227.93.14:9000/share/fwgdyqsqjk&WorkOrderId=" + modelT_Bus_WorkOrder.F_WorkOrderId;
2483
 
2536
 

+ 7 - 2
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

3050
                     }
3050
                     }
3051
 
3051
 
3052
                 }
3052
                 }
3053
-            
3053
+            int isfeedback = RequestString.GetInt("isfeedback", -1);
3054
+            if (isfeedback > -1)
3055
+            {
3056
+                sql += $" and F_Administrative='{isfeedback}'";
3057
+            }
3058
+
3054
             if (identification > -1)
3059
             if (identification > -1)
3055
             {
3060
             {
3056
                 sql += "and F_Identification='" + identification + "'";
3061
                 sql += "and F_Identification='" + identification + "'";
8536
             if (keyid != 0)
8541
             if (keyid != 0)
8537
             {
8542
             {
8538
                 sql += "and a.F_Key in(select F_ValueId  from  dbo.GetValueId(" + keyid + ")) ";
8543
                 sql += "and a.F_Key in(select F_ValueId  from  dbo.GetValueId(" + keyid + ")) ";
8539
-            }
8544
+            } 
8540
             if (comtitle.Trim() != "" && comtitle != "undefined")
8545
             if (comtitle.Trim() != "" && comtitle != "undefined")
8541
             {
8546
             {
8542
                 sql += " and F_ComTitle like '%" + comtitle + "%' ";
8547
                 sql += " and F_ComTitle like '%" + comtitle + "%' ";

+ 38 - 0
CallCenterCommon/CallCenter.QuartzService/ZhengWuDuiJie.cs

7
 using System.Data;
7
 using System.Data;
8
 using System.IO;
8
 using System.IO;
9
 using System.Linq;
9
 using System.Linq;
10
+using System.Net;
10
 using System.Text;
11
 using System.Text;
11
 using System.Threading.Tasks;
12
 using System.Threading.Tasks;
12
 
13
 
109
         {
110
         {
110
             public string code { set; get; }
111
             public string code { set; get; }
111
         }
112
         }
113
+        public void Backhaul()
114
+        {
115
+            string sql = "and  F_IsDelete = 0 and  F_Administrative in(1,2)";
116
+            DataTable dt = new DataTable();
117
+            int recordCount = 0;
118
+            dt = CallCenterApi.BLL.PagerBLL.GetListPager(
119
+              "T_Bus_WorkOrder b WITH(NOLOCK)",
120
+              "F_WorkOrderId",
121
+              "*",
122
+              sql,
123
+              "ORDER BY F_CreateTime DESC",
124
+              10000,
125
+              1,
126
+              true,
127
+              out recordCount);
128
+            var now = DateTime.Now;
129
+
130
+            if (dt != null && dt.Rows.Count > 0)
131
+            {
132
+                foreach (DataRow dr in dt.Rows)
133
+                {
134
+                    if (dr["F_Administrative"].ToString() == "1")
135
+                    {
136
+                        WebClient web = new WebClient();
137
+                        web.Encoding = Encoding.UTF8;
138
+                        string Dataurl = web.DownloadString("http://10.0.22.201:8002/Affairs/FinishWorkOrder" + $"?workorderid={dr["F_WorkOrderId"].ToString()}");
139
+
140
+                    }
141
+                    else if (dr["F_Administrative"].ToString() == "2")
142
+                    {
143
+                        WebClient web = new WebClient();
144
+                        web.Encoding = Encoding.UTF8;
145
+                        string Dataurl = web.DownloadString("http://10.0.22.201:8002/Affairs/case_sign" + $"?workorderid={dr["F_WorkOrderId"].ToString()}");
146
+                    }
147
+                }
148
+            }
149
+        }
112
 
150
 
113
     }
151
     }
114
 }
152
 }