|
|
@@ -690,24 +690,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
690
|
690
|
var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + stropenid + "'").FirstOrDefault();
|
|
691
|
691
|
//获取客户档案(业主)表信息
|
|
692
|
692
|
var modelCustomer = customerBaseBLL.GetModelList(" F_WxOpenId='" + stropenid.Trim() + "'").FirstOrDefault();
|
|
693
|
|
- #region 权限限制
|
|
694
|
|
- int customerid = 0;
|
|
695
|
|
-
|
|
696
|
|
- if (ua != null)
|
|
697
|
|
- {
|
|
698
|
|
- sql += " and (CreateUser= '" + ua.F_UserCode + "' or WorkOrderID in ( '" + wo.GetCYWorkOrderID(ua.F_UserCode) + "')) ";
|
|
699
|
|
- }
|
|
700
|
|
- else if (modelCustomer != null)
|
|
701
|
|
- {
|
|
702
|
|
- customerid = modelCustomer.F_CustomerId;
|
|
703
|
|
- sql += " and CustomerID=" + customerid;
|
|
704
|
|
- }
|
|
705
|
|
- else
|
|
706
|
|
- {
|
|
707
|
|
- sql = "";
|
|
708
|
|
- }
|
|
709
|
|
- #endregion
|
|
710
|
|
-
|
|
|
693
|
+
|
|
711
|
694
|
if (!string.IsNullOrEmpty(sql))
|
|
712
|
695
|
{
|
|
713
|
696
|
sql += " and IsDel=0 ";
|
|
|
@@ -719,37 +702,49 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
719
|
702
|
|
|
720
|
703
|
if (states >= 0)
|
|
721
|
704
|
{
|
|
722
|
|
- string uwhere = " ";
|
|
723
|
|
- switch (states)
|
|
|
705
|
+ #region 权限限制
|
|
|
706
|
+ if (ua != null)
|
|
724
|
707
|
{
|
|
725
|
|
- case 0://待指派的
|
|
726
|
|
- //sql += " and State ='0' and CreateUser= '" + ua.F_UserCode + "' ";
|
|
727
|
|
- //3区域客服可以看到区域待指派工单
|
|
728
|
|
- if (ua.F_RoleId != 17)
|
|
729
|
|
- {
|
|
730
|
|
- uwhere += " and CreateUser='" + ua.F_UserCode + "' ";
|
|
731
|
|
- }
|
|
732
|
|
- sql += " and State =0 " + uwhere;
|
|
733
|
|
- break;
|
|
734
|
|
- case 1://待接单的
|
|
735
|
|
- sql += " and State =1 and WorkOrderID in ( '" + wo.GetDJDWorkOrderID(ua.F_UserCode) + "') ";
|
|
736
|
|
- break;
|
|
737
|
|
- case 2://待完成的(待处理)
|
|
738
|
|
- sql += " and State =1 and WorkOrderID in ( '" + wo.GetDWCWorkOrderID(ua.F_UserCode) + "') ";
|
|
739
|
|
- break;
|
|
740
|
|
- case 3://已完成的
|
|
741
|
|
- sql += " and State =2 and LastDealUser = '" + ua.F_UserCode + "' ";
|
|
742
|
|
- break;
|
|
743
|
|
- case 4://我参与的
|
|
744
|
|
- sql += " and (CreateUser= '" + ua.F_UserCode + "' or WorkOrderID in ( '" + wo.GetCYWorkOrderID(ua.F_UserCode) + "')) ";
|
|
745
|
|
- break;
|
|
746
|
|
- case 5://超期工单 - 设置两个月的处理时效,两个月内未解决的工单都直接汇总到这里
|
|
747
|
|
- sql += $" and DATEADD(DAY,{days},CreateTime) < GETDATE() AND State < 2 ";
|
|
748
|
|
- break;
|
|
|
708
|
+ string uwhere = " ";
|
|
|
709
|
+ switch (states)
|
|
|
710
|
+ {
|
|
|
711
|
+ case 0://待指派的
|
|
|
712
|
+ //sql += " and State ='0' and CreateUser= '" + ua.F_UserCode + "' ";
|
|
|
713
|
+ //3区域客服可以看到区域待指派工单
|
|
|
714
|
+ if (ua.F_RoleId != 17)
|
|
|
715
|
+ {
|
|
|
716
|
+ uwhere += " and CreateUser='" + ua.F_UserCode + "' ";
|
|
|
717
|
+ }
|
|
|
718
|
+ sql += " and State =0 " + uwhere;
|
|
|
719
|
+ break;
|
|
|
720
|
+ case 1://待接单的
|
|
|
721
|
+ sql += " and State =1 and WorkOrderID in ( '" + wo.GetDJDWorkOrderID(ua.F_UserCode) + "') ";
|
|
|
722
|
+ break;
|
|
|
723
|
+ case 2://待完成的(待处理)
|
|
|
724
|
+ sql += " and State =1 and WorkOrderID in ( '" + wo.GetDWCWorkOrderID(ua.F_UserCode) + "') ";
|
|
|
725
|
+ break;
|
|
|
726
|
+ case 3://已完成的
|
|
|
727
|
+ sql += " and State =2 and LastDealUser = '" + ua.F_UserCode + "' ";
|
|
|
728
|
+ break;
|
|
|
729
|
+ case 4://我参与的
|
|
|
730
|
+ sql += " and (CreateUser= '" + ua.F_UserCode + "' or WorkOrderID in ( '" + wo.GetCYWorkOrderID(ua.F_UserCode) + "')) ";
|
|
|
731
|
+ break;
|
|
|
732
|
+ case 5://超期工单 - 设置两个月的处理时效,两个月内未解决的工单都直接汇总到这里
|
|
|
733
|
+ sql += $" and DATEADD(DAY,{days},CreateTime) < GETDATE() AND State < 2 ";
|
|
|
734
|
+ break;
|
|
|
735
|
+ }
|
|
749
|
736
|
}
|
|
750
|
|
- //sql += " and State = " + states + " ";
|
|
|
737
|
+ else if (modelCustomer != null)
|
|
|
738
|
+ {
|
|
|
739
|
+ sql += " and CustomerID=" + modelCustomer.F_CustomerId;
|
|
|
740
|
+ }
|
|
|
741
|
+ else
|
|
|
742
|
+ {
|
|
|
743
|
+ sql = "";
|
|
|
744
|
+ }
|
|
|
745
|
+ #endregion
|
|
751
|
746
|
}
|
|
752
|
|
-
|
|
|
747
|
+
|
|
753
|
748
|
if (strstarttime.Trim() != "" && strstarttime != "undefined")
|
|
754
|
749
|
{
|
|
755
|
750
|
sql += " and datediff(day,CreateTime,'" + strstarttime + "')<=0 ";
|
|
|
@@ -773,7 +768,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
773
|
768
|
"WorkOrderID",
|
|
774
|
769
|
cols,
|
|
775
|
770
|
sql,
|
|
776
|
|
- "ORDER BY CreateTime DESC",
|
|
|
771
|
+ "ORDER BY CreateTime DESC,State asc",
|
|
777
|
772
|
pagesize,
|
|
778
|
773
|
pageindex,
|
|
779
|
774
|
true,
|
|
|
@@ -837,6 +832,74 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
837
|
832
|
}
|
|
838
|
833
|
return Error("查询失败");
|
|
839
|
834
|
}
|
|
|
835
|
+
|
|
|
836
|
+ /// <summary>
|
|
|
837
|
+ /// 处理工单
|
|
|
838
|
+ /// </summary>
|
|
|
839
|
+ /// <returns></returns>
|
|
|
840
|
+ [WechatActionFilter]
|
|
|
841
|
+ public ActionResult DealWorkOrder()
|
|
|
842
|
+ {
|
|
|
843
|
+ DataTable dt = new DataTable();
|
|
|
844
|
+ string orderid = RequestString.GetFormString("orderid");
|
|
|
845
|
+ int isend = RequestString.GetInt("isend", 0); //处理方式 1结束 0转派
|
|
|
846
|
+ //int ltype = RequestString.GetInt("ltype", 0); //处理方式 1结束 0转派
|
|
|
847
|
+ int clbm = RequestString.GetInt("clbm", 0); //部门id
|
|
|
848
|
+ int clid = RequestString.GetInt("clid", 0); //用户接收人id
|
|
|
849
|
+ string cont = RequestString.GetFormString("cont"); //处理内容
|
|
|
850
|
+ //string detail = RequestString.GetFormString("detail");
|
|
|
851
|
+
|
|
|
852
|
+ string stropenid = HttpUtility.UrlDecode(RequestString.GetFormString("openid"));
|
|
|
853
|
+
|
|
|
854
|
+ workorder.WorkOrderController wo = new workorder.WorkOrderController();
|
|
|
855
|
+ bool res = wo.DealWXWorkOrder(orderid, isend, clbm, clid, cont, stropenid);
|
|
|
856
|
+
|
|
|
857
|
+ if (res)
|
|
|
858
|
+ {
|
|
|
859
|
+ return Success("操作成功");
|
|
|
860
|
+ }
|
|
|
861
|
+ else
|
|
|
862
|
+ {
|
|
|
863
|
+ return Error("操作失败");
|
|
|
864
|
+ }
|
|
|
865
|
+ }
|
|
|
866
|
+
|
|
|
867
|
+ /// <summary>
|
|
|
868
|
+ /// 接单 - 确认工单
|
|
|
869
|
+ /// </summary>
|
|
|
870
|
+ /// <returns></returns>
|
|
|
871
|
+ [WechatActionFilter]
|
|
|
872
|
+ public ActionResult SureWorkOrder()
|
|
|
873
|
+ {
|
|
|
874
|
+ string stropenid = HttpUtility.UrlDecode(RequestString.GetFormString("openid"));
|
|
|
875
|
+ string orderid = RequestString.GetFormString("orderid");
|
|
|
876
|
+ if (!string.IsNullOrEmpty(stropenid))
|
|
|
877
|
+ {
|
|
|
878
|
+ var ua = new BLL.T_Sys_UserAccount().GetModelList(" F_WxOpenId='" + stropenid + "'").FirstOrDefault();
|
|
|
879
|
+ if (ua != null)
|
|
|
880
|
+ {
|
|
|
881
|
+ Model.T_Wo_WorkOrder model = new BLL.T_Wo_WorkOrder().GetModelList(" WorkOrderID='" + orderid + "'").FirstOrDefault();
|
|
|
882
|
+ if (model != null)
|
|
|
883
|
+ {
|
|
|
884
|
+ Model.T_Wo_WorkOrderItem item = new BLL.T_Wo_WorkOrderItem().GetModelList(" WorkOrderID='" + orderid + "' and isdel=0 and Type=1 ").OrderByDescending(p => p.CreateTime).FirstOrDefault();
|
|
|
885
|
+ if (item != null && item.State == 0 && ("," + item.ToUser + ",").Contains("," + ua.F_UserCode + ","))
|
|
|
886
|
+ {
|
|
|
887
|
+ item.SureUser = ua.F_UserCode;
|
|
|
888
|
+ item.State = 1;
|
|
|
889
|
+ item.SureTime = DateTime.Now;
|
|
|
890
|
+ if (new BLL.T_Wo_WorkOrderItem().Update(item))
|
|
|
891
|
+ {
|
|
|
892
|
+ return Success("接单成功!");
|
|
|
893
|
+ }
|
|
|
894
|
+ }
|
|
|
895
|
+ return Error("操作失败,工单还没有派单!");
|
|
|
896
|
+ }
|
|
|
897
|
+ }
|
|
|
898
|
+ return Error("操作失败");
|
|
|
899
|
+ }
|
|
|
900
|
+ return Error("参数错误");
|
|
|
901
|
+ }
|
|
|
902
|
+
|
|
840
|
903
|
#endregion
|
|
841
|
904
|
|
|
842
|
905
|
#region 微信工单
|
|
|
@@ -1284,12 +1347,12 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1284
|
1347
|
// string callCustomer = RequestString.GetFormString("callCustomer");
|
|
1285
|
1348
|
// //联系电话
|
|
1286
|
1349
|
// string tel = RequestString.GetFormString("tel");
|
|
1287
|
|
-
|
|
|
1350
|
+
|
|
1288
|
1351
|
// //处理部门
|
|
1289
|
1352
|
// string fkdep = RequestString.GetFormString("fkdep");
|
|
1290
|
1353
|
// //客服类类型
|
|
1291
|
1354
|
// string kfdepid = RequestString.GetFormString("kfdepid");
|
|
1292
|
|
-
|
|
|
1355
|
+
|
|
1293
|
1356
|
// //受理人 - 审核人工号
|
|
1294
|
1357
|
// string auditusercode = RequestString.GetFormString("auditusercode");
|
|
1295
|
1358
|
// //工单状态
|
|
|
@@ -1298,7 +1361,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1298
|
1361
|
// string fkcont = RequestString.GetFormString("fkcont");
|
|
1299
|
1362
|
// string callid = HttpUtility.UrlDecode(RequestString.GetFormString("callid"));
|
|
1300
|
1363
|
// string files = RequestString.GetFormString("files");
|
|
1301
|
|
-
|
|
|
1364
|
+
|
|
1302
|
1365
|
// //咨询类工单指派部门
|
|
1303
|
1366
|
// int clbm = RequestString.GetFormInt("clbm", 0);
|
|
1304
|
1367
|
// //备注
|
|
|
@@ -1373,21 +1436,21 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1373
|
1436
|
// string callCustomer = RequestString.GetFormString("callCustomer");
|
|
1374
|
1437
|
// //联系电话
|
|
1375
|
1438
|
// string tel = RequestString.GetFormString("tel");
|
|
1376
|
|
-
|
|
|
1439
|
+
|
|
1377
|
1440
|
// //处理部门
|
|
1378
|
1441
|
// string fkdep = RequestString.GetFormString("fkdep");
|
|
1379
|
1442
|
// //客服类类型
|
|
1380
|
1443
|
// string kfdepid = RequestString.GetFormString("kfdepid");
|
|
1381
|
|
-
|
|
|
1444
|
+
|
|
1382
|
1445
|
// //受理人 - 审核人工号
|
|
1383
|
1446
|
// string auditusercode = RequestString.GetFormString("auditusercode");
|
|
1384
|
1447
|
// //接待描述 - 反馈内容
|
|
1385
|
1448
|
// string fkcont = RequestString.GetFormString("fkcont");
|
|
1386
|
1449
|
// string files = RequestString.GetFormString("files");
|
|
1387
|
|
-
|
|
|
1450
|
+
|
|
1388
|
1451
|
// //备注
|
|
1389
|
1452
|
// string note = RequestString.GetFormString("note");
|
|
1390
|
|
-
|
|
|
1453
|
+
|
|
1391
|
1454
|
// string stropenid = HttpUtility.UrlDecode(RequestString.GetFormString("openid"));
|
|
1392
|
1455
|
// //var wxuser = new BLL.T_Sys_Users().GetModelList(" F_OpenId='" + stropenid.Trim() + "' and F_Type=1 ").FirstOrDefault();
|
|
1393
|
1456
|
// if (!string.IsNullOrEmpty(stropenid))
|
|
|
@@ -1408,7 +1471,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1408
|
1471
|
// model.Customer = callCustomer; //客户姓名
|
|
1409
|
1472
|
// model.CustomerTel = tel; //联系电话
|
|
1410
|
1473
|
// //model.CustomerID = customerid; //用户档案Id
|
|
1411
|
|
-
|
|
|
1474
|
+
|
|
1412
|
1475
|
// model.Source = fkdep; //处理部门 反馈单位
|
|
1413
|
1476
|
// model.CreateUserID = kfdepid; //客服类类型
|
|
1414
|
1477
|
// model.AuditUser = auditusercode; //受理人 - 审核人工号
|
|
|
@@ -1417,7 +1480,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1417
|
1480
|
// //反馈内容
|
|
1418
|
1481
|
// var detailutf8 = System.Web.HttpUtility.UrlDecode(fkcont, System.Text.Encoding.UTF8);
|
|
1419
|
1482
|
// model.Detail = detailutf8;
|
|
1420
|
|
-
|
|
|
1483
|
+
|
|
1421
|
1484
|
// if (new BLL.T_Wo_WorkOrder().Update(model))
|
|
1422
|
1485
|
// {
|
|
1423
|
1486
|
// //添加工单修改操作日志
|
|
|
@@ -1974,7 +2037,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1974
|
2037
|
// return Content(obj.ToJson());
|
|
1975
|
2038
|
//}
|
|
1976
|
2039
|
#endregion
|
|
1977
|
|
-
|
|
|
2040
|
+
|
|
1978
|
2041
|
#region 附件和语音文件
|
|
1979
|
2042
|
/// <summary>
|
|
1980
|
2043
|
/// 获取留言路径
|