ソースを参照

工单调整提交

zhengbingbing 8 年 前
コミット
efec2683c5

+ 21 - 8
codegit/CallCenterApi/CallCenterAPI.WechatSDK/WxHelper.cs

@@ -28,6 +28,7 @@ namespace CallCenterAPI.WechatSDK
28 28
         public static string WechatMchid;
29 29
         public static string WechatKey;
30 30
         public static string WechatPath;
31
+        public static string WechatClientIp;
31 32
 
32 33
         public static string CommonToken;//Common的Token
33 34
         public static DateTime GetCommonTokenDate;//获取CommonToken的时间
@@ -40,6 +41,7 @@ namespace CallCenterAPI.WechatSDK
40 41
             WechatMchid= Configs.GetValue("WechatMchid");
41 42
             WechatKey = Configs.GetValue("WechatKey");
42 43
             WechatPath = Configs.GetValue("WechatPath");
44
+            WechatClientIp = Configs.GetValue("WechatClientIp");
43 45
         }
44 46
 
45 47
         /// <summary>
@@ -49,7 +51,6 @@ namespace CallCenterAPI.WechatSDK
49 51
         /// <returns></returns>
50 52
         public static WxLoginDto GetOpenId(WxLoginDto wxLoginDto)
51 53
         {
52
-
53 54
             if (string.IsNullOrWhiteSpace(wxLoginDto.Code))
54 55
             {
55 56
                 var url = OAuthApi.GetAuthorizeUrl(AppId, wxLoginDto.RedirectUrl, "qwertyuidfghjkl", OAuthScope.snsapi_base);
@@ -246,10 +247,11 @@ namespace CallCenterAPI.WechatSDK
246 247
         #endregion
247 248
 
248 249
         #region 企业向用户发红包
249
-        public static bool TenPay(decimal amount,string clientip,string openid)
250
+        public static bool TenPay(decimal amount,string openid)
250 251
         {
251 252
             #region 发送红包
252 253
             bool fals = false;   //记录发送红包是否成功
254
+            string msg = "";
253 255
             string xmlResult = null;  //现金红包接口返回的xml
254 256
             string certPath = null;  //证书在服务器的物理位置
255 257
             string data = null;  //调用现金红包接口需要的数据
@@ -260,11 +262,11 @@ namespace CallCenterAPI.WechatSDK
260 262
                 //初始化
261 263
                 packageReqHandler.Init();
262 264
                 string nonceStr = TenPayV3Util.GetNoncestr();  //时间戳
263
-                string sign = packageReqHandler.CreateMd5Sign("key", WechatKey);
265
+                
264 266
                 //设置package订单参数
265 267
                 
266 268
                 packageReqHandler.SetParameter("nonce_str", nonceStr);    //随机字符串,不长于32位
267
-                packageReqHandler.SetParameter("sign", sign); //签名:生成签名方式查看签名算法
269
+                
268 270
 
269 271
                 var r = new Random(Guid.NewGuid().GetHashCode());//随机数
270 272
                 var dd = DateTime.Now.ToString("yyyymmdd");//日期yyyymmdd
@@ -278,10 +280,12 @@ namespace CallCenterAPI.WechatSDK
278 280
                 packageReqHandler.SetParameter("total_num", "1");//红包发放总人数
279 281
 
280 282
                 packageReqHandler.SetParameter("wishing", "测试红包");  //红包祝福语
281
-                packageReqHandler.SetParameter("client_ip", clientip);//Ip地址
283
+                packageReqHandler.SetParameter("client_ip", WechatClientIp);//Ip地址
282 284
                 packageReqHandler.SetParameter("act_name", "测试红包");  //活动名称
283 285
                 packageReqHandler.SetParameter("remark", "测试红包");  //备注
284 286
 
287
+                string sign = packageReqHandler.CreateMd5Sign("key", WechatKey);
288
+                packageReqHandler.SetParameter("sign", sign); //签名:生成签名方式查看签名算法
285 289
 
286 290
                 data = packageReqHandler.ParseXML();
287 291
                 certPath = WechatPath;
@@ -295,10 +299,19 @@ namespace CallCenterAPI.WechatSDK
295 299
                     {
296 300
                         fals = true;
297 301
                     }
302
+                    else
303
+                    {
304
+                        msg = res.Element("xml").Element("err_code_des").Value; 
305
+                    }
306
+                }
307
+                else
308
+                {
309
+                    msg = res.Element("xml").Element("return_msg").Value;
298 310
                 }
299 311
             }
300 312
             catch (Exception exception)
301 313
             {
314
+                msg = exception.Message;
302 315
             }
303 316
             #endregion
304 317
             return fals;
@@ -314,11 +327,11 @@ namespace CallCenterAPI.WechatSDK
314 327
         /// <returns></returns>
315 328
         public static string Sendredpack(string data, string certPassword, string certPath, int timeOut = Config.TIME_OUT)
316 329
         {
317
-            var urlFormat = "https://api.mch.weixin.qq.com/mmpaymkttransfers/hbpreorder";
318
-            string cert = certPath;
330
+            var urlFormat = "https://api.mch.weixin.qq.com/mmpaymkttransfers/sendredpack";
331
+            string cert = HttpContext.Current.Request.PhysicalApplicationPath+ certPath;
319 332
 
320 333
             ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
321
-            X509Certificate2 cer = new X509Certificate2(cert, certPassword, X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.MachineKeySet);
334
+            X509Certificate2 cer = new X509Certificate2(cert, certPassword);
322 335
 
323 336
             var formDataBytes = data == null ? new byte[0] : Encoding.UTF8.GetBytes(data);
324 337
             MemoryStream ms = new MemoryStream();

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.DAL/T_Sys_UserAccount.cs

@@ -402,7 +402,7 @@ namespace CallCenterApi.DAL
402 402
             strSql.Append("select  top 1 * from T_Sys_UserAccount ");
403 403
             strSql.Append(" where F_WxOpenId=@F_WxOpenId");
404 404
             SqlParameter[] parameters = {
405
-                    new SqlParameter("@F_WxOpenId", SqlDbType.Int,4)
405
+                    new SqlParameter("@F_WxOpenId", SqlDbType.VarChar,300)
406 406
             };
407 407
             parameters[0].Value = openid;
408 408
 

+ 30 - 19
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs

@@ -534,7 +534,7 @@ namespace CallCenterApi.Interface.Controllers.tel
534 534
                     if (ua != null)
535 535
                     {
536 536
                         Model.T_Wo_WorkOrder model = new Model.T_Wo_WorkOrder();
537
-                        model.WorkOrderID = DateTime.Now.ToString("yyyyMMddHHmmssfff");//工单编号
537
+                        model.WorkOrderID = DateTime.Now.ToString("yyyyMMddHHmmssmsfff");//工单编号
538 538
                         model.CallID = callid;
539 539
                         model.Customer = tskh;
540 540
                         model.CustomerID = khid;
@@ -638,11 +638,22 @@ namespace CallCenterApi.Interface.Controllers.tel
638 638
                             {
639 639
                                 item.LimitTime = to.ItemTime;
640 640
                             }
641
-
641
+                            if (item.ToUser != "")
642
+                            {
643
+                                item.SureUser = ua.F_UserCode;
644
+                                item.State = 1;
645
+                                item.SureTime = DateTime.Now;
646
+                                item.IsStart = 1;
647
+                            }
648
+                            else
649
+                            {
650
+                                item.State = 0;
651
+                                item.IsStart = 0;
652
+                            }
642 653
                             item.Detail = clcont;
643 654
                             item.IsLast = 0;
644
-                            item.State = 0;
645
-                            item.IsStart = 0;
655
+                            //item.State = 0;
656
+                            //item.IsStart = 0;
646 657
                             item.IsTimeOut = 0;
647 658
                             item.IsDel = 0;
648 659
                             item.CreateUser = ua.F_UserCode;
@@ -655,20 +666,20 @@ namespace CallCenterApi.Interface.Controllers.tel
655 666
                                 model.AppointTime = DateTime.Now;
656 667
 
657 668
                                 #region 消息表
658
-                                foreach (string ur in item.ToUser.Split(','))
659
-                                {
660
-                                    Model.T_Msg_List msg = new Model.T_Msg_List();
661
-                                    msg.Type = 1;
662
-                                    msg.ToUser = ur;
663
-                                    msg.ToID = Int32.Parse(itemid.ToString());
664
-                                    msg.Detail = ua.F_UserName + "给你指派了工单,单号:" + model.WorkOrderID;
665
-                                    msg.State = 0;
666
-                                    msg.IsDel = 0;
667
-                                    msg.CreateUser = ua.F_UserCode;
668
-                                    msg.CreateDate = DateTime.Now;
669
-
670
-                                    new BLL.T_Msg_List().Add(msg);
671
-                                }
669
+                                //foreach (string ur in item.ToUser.Split(','))
670
+                                //{
671
+                                //    Model.T_Msg_List msg = new Model.T_Msg_List();
672
+                                //    msg.Type = 1;
673
+                                //    msg.ToUser = ur;
674
+                                //    msg.ToID = Int32.Parse(itemid.ToString());
675
+                                //    msg.Detail = ua.F_UserName + "给你指派了工单,单号:" + model.WorkOrderID;
676
+                                //    msg.State = 0;
677
+                                //    msg.IsDel = 0;
678
+                                //    msg.CreateUser = ua.F_UserCode;
679
+                                //    msg.CreateDate = DateTime.Now;
680
+
681
+                                //    new BLL.T_Msg_List().Add(msg);
682
+                                //}
672 683
                                 #endregion
673 684
                             }
674 685
                         }
@@ -677,7 +688,7 @@ namespace CallCenterApi.Interface.Controllers.tel
677 688
                         Model.T_Wo_Operation oper = new Model.T_Wo_Operation();
678 689
                         oper.F_WorkOrderId = model.WorkOrderID;
679 690
                         oper.F_State = model.State;
680
-                        oper.F_CallRecordId = model.CallID != null ? int.Parse(model.CallID) : 0;
691
+                        oper.F_CallRecordId = model.CallID != "" ? int.Parse(model.CallID) : 0;
681 692
                         oper.F_File = model.Files;
682 693
 
683 694
                         string userinfo = ua.depname + "-" + ua.F_UserName + "(" + ua.F_UserCode + ")";

+ 14 - 5
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/weixin/WxLoginController.cs

@@ -60,9 +60,10 @@ namespace CallCenterApi.Interface.Controllers.weixin
60 60
         public ActionResult GetOpenId(WxLoginDto wld)
61 61
         {
62 62
             wld.RedirectUrl = RequestString.GetUrlReferrer();
63
-
63
+            
64 64
             if (string.IsNullOrEmpty(wld.OpenId))
65 65
             {
66
+                
66 67
                 var temp = WxHelper.GetOpenId(wld);
67 68
                 if (string.IsNullOrWhiteSpace(temp.OpenId))
68 69
                 {
@@ -109,10 +110,10 @@ namespace CallCenterApi.Interface.Controllers.weixin
109 110
         public ActionResult GetList()
110 111
         {
111 112
             DataTable dt = new DataTable();
112
-            //string sql = " and F_IsDelete=0 ";
113
+            //string sql = " and IsDel=0 ";
113 114
 
114 115
             string stropenid = HttpUtility.UrlDecode(RequestString.GetQueryString("openid"));
115
-            string strstate = HttpUtility.UrlDecode(RequestString.GetQueryString("state"));//状态
116
+            string strstate = HttpUtility.UrlDecode(RequestString.GetQueryString("state"));//状态 0待处理 1已处理
116 117
             string strname = HttpUtility.UrlDecode(RequestString.GetQueryString("name"));//联系人
117 118
             string strtel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));//联系电话
118 119
             string strkey = HttpUtility.UrlDecode(RequestString.GetQueryString("key"));//关键字
@@ -132,11 +133,19 @@ namespace CallCenterApi.Interface.Controllers.weixin
132 133
             #region sql 语句相关处理
133 134
             //根据openid获取所有工单号
134 135
             var wxuser = new BLL.T_Sys_Users().GetModelList(" F_OpenId='" + stropenid.Trim() + "' and F_Type=1 ").FirstOrDefault();
135
-            string sql = " and id in (select distinct F_WorkOrderID from T_WO_UserWorkOrder where F_UserId='" + wxuser.F_Id + "') ";
136
+            string sql = " and IsDel=0 and id in (select distinct F_WorkOrderID from T_WO_UserWorkOrder where F_UserId='" + wxuser.F_Id + "') ";
136 137
 
137 138
             if (strstate.Trim() != "" && strstate != "undefined")
138 139
             {
139
-                sql += " and State = '" + strstate.Trim() + "' ";
140
+                if (strstate.Trim() == "0")
141
+                {
142
+                    sql += " and State in(0,1) ";
143
+                }
144
+                else
145
+                {
146
+                    sql += " and State =2 ";
147
+                }
148
+                //sql += " and State = '" + strstate.Trim() + "' ";
140 149
             }
141 150
             if (strworkid.Trim() != "" && strworkid != "undefined")
142 151
             {

File diff suppressed because it is too large
+ 523 - 505
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs


+ 1 - 0
codegit/CallCenterCommon/CallCenter.Utility/RequestHandler.cs

@@ -116,6 +116,7 @@ namespace CallCenter.Utility
116 116
 
117 117
             return sign;
118 118
         }
119
+        
119 120
 
120 121
         /// <summary>
121 122
         /// 输出XML