Browse Source

微信bug调整

zhengbingbing 7 years ago
parent
commit
aa8296d983

+ 11 - 8
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/PagerAnswerWXController.cs

@@ -154,7 +154,7 @@ namespace CallCenterApi.Interface.Controllers.callout
154 154
         /// <param name="address"></param>
155 155
         /// <returns></returns>
156 156
         public bool AnswersWX(string telphone, string openid, string[] ans,
157
-            string name, string phone, string countryid, string address)
157
+            string name, string phone, string countryid, string address,Model.T_Sys_Users users)
158 158
         {
159 159
             int cc = 0;int telid = 0;string dateflag = DateTime.Now.ToString("yyyyMMddHHmmssfff");
160 160
             if (!string.IsNullOrWhiteSpace(telphone))
@@ -173,7 +173,7 @@ namespace CallCenterApi.Interface.Controllers.callout
173 173
                 }
174 174
                 otnModel.F_Address = address;
175 175
                 otnModel.F_Openid = openid;
176
-                otnModel.F_PagerId = 2;
176
+                otnModel.F_PagerId = int.Parse(Configs.GetValue("WXPagerID")); ;
177 177
                 otnModel.F_DeleteFlag = 0;
178 178
 
179 179
                 otnModel.F_CusID = 0;
@@ -192,8 +192,11 @@ namespace CallCenterApi.Interface.Controllers.callout
192 192
                     ansModel.F_PagerID = otnModel.F_PagerId;
193 193
                     ansModel.F_CusID = 0;
194 194
                     ansModel.F_CusTelID = telid;
195
-                    ansModel.F_OptBy = CurrentUser.UserData.F_UserId;
196
-                    ansModel.F_OptByName = CurrentUser.UserData.F_UserName;
195
+                    if (users != null)
196
+                    {
197
+                        ansModel.F_OptBy = users.F_Id;
198
+                        ansModel.F_OptByOpenid = users.F_OpenId;
199
+                    }
197 200
                     ansModel.F_OptOn = DateTime.Now;
198 201
                     ansModel.F_Expand1 = countryid.ToString();
199 202
                     ansModel.F_Expand3 = dateflag;
@@ -234,11 +237,11 @@ namespace CallCenterApi.Interface.Controllers.callout
234 237
                     #endregion
235 238
                     #region  保存日志
236 239
 
237
-                    //otnModel.F_AskRes = askqids;
238
-                    //otnModel.F_AskInfo = ansids;
239
-                    //otnwxBLL.Update(otnModel);
240
+                    otnModel.F_AskRes = askqids;
241
+                    otnModel.F_AskInfo = ansids;
242
+                    otnwxBLL.Update(otnModel);
240 243
 
241
-                    //planrecord(otnModel);
244
+                    planrecord(otnModel);
242 245
                     #endregion
243 246
                 }
244 247
             }

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

@@ -373,11 +373,12 @@ namespace CallCenterApi.Interface.Controllers.weixin
373 373
         [WechatActionFilter]
374 374
         public ActionResult GetPagers()
375 375
         {
376
-            var model = pagerInfoBLL.GetModel(8);
376
+            int pagerid = int.Parse(Configs.GetValue("WXPagerID"));
377
+            var model = pagerInfoBLL.GetModel(pagerid);
377 378
             if (model != null)
378 379
             {
379
-                var qlist = questionBLL.GetModelList(" F_DeleteFlag=0 and F_QuestionId in (select F_QuestionId from T_Ask_PagerItems where F_PagerId=8)  order by F_QuestionId ");
380
-                var qilist = questionItemBLL.GetModelList(" F_QuestionId in (select F_QuestionId from T_Ask_PagerItems where F_PagerId=8)  order by F_ItemId ");
380
+                var qlist = questionBLL.GetModelList(" F_DeleteFlag=0 and F_QuestionId in (select F_QuestionId from T_Ask_PagerItems where F_PagerId=" + pagerid + ")  order by F_QuestionId ");
381
+                var qilist = questionItemBLL.GetModelList(" F_QuestionId in (select F_QuestionId from T_Ask_PagerItems where F_PagerId=" + pagerid + ")  order by F_ItemId ");
381 382
 
382 383
                 var newmodel = new
383 384
                 {
@@ -420,29 +421,22 @@ namespace CallCenterApi.Interface.Controllers.weixin
420 421
         public ActionResult AddPagers(string openid, string[] ans, string cusname,
421 422
             string telphone,string phone,string countryid,string address)
422 423
         {
423
-            var wxuser = new BLL.T_Sys_Users().GetModelList(" F_OpenId='" + openid + "'  and F_Type=1 ").FirstOrDefault();
424
-            bool res = new callout.PagerAnswerWXController().AnswersWX(telphone, openid, ans, cusname, phone, countryid, address);
425
-
426
-            string msg = "";
427 424
             if (ans != null)
428 425
             {
429
-                foreach (var item in ans)
426
+                var wxuser = new BLL.T_Sys_Users().GetModelList(" F_OpenId='" + openid + "'  and F_Type=1 ").FirstOrDefault();
427
+                bool res = new callout.PagerAnswerWXController().AnswersWX(telphone, openid, ans, cusname, phone, countryid, address, wxuser);
428
+
429
+                if (res)
430 430
                 {
431
-                    msg += item + ";**;";
431
+                    return Success("问卷提交成功");
432
+                }
433
+                else
434
+                {
435
+                    return Error("问卷提交失败,请稍后重试");
432 436
                 }
433 437
             }
434 438
             else
435
-            {
436
-                msg = "ans为空";
437
-            }
438
-            if (res)
439
-            {
440
-                return Success("问卷提交成功:::" + msg);
441
-            }
442
-            else
443
-            {
444
-                return Error("问卷提交失败:::" + msg);
445
-            }
439
+                return Error("问卷为空,无法正常提交");
446 440
         }
447 441
         #endregion
448 442