|
|
@@ -109,6 +109,14 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
109
|
109
|
{
|
|
110
|
110
|
UserType = 0;
|
|
111
|
111
|
}
|
|
|
112
|
+ else if (user.F_RoleId == 61)
|
|
|
113
|
+ {
|
|
|
114
|
+ UserType = 2;
|
|
|
115
|
+ }
|
|
|
116
|
+ else if (user.F_RoleId == 59)
|
|
|
117
|
+ {
|
|
|
118
|
+ UserType = 3;
|
|
|
119
|
+ }
|
|
112
|
120
|
else
|
|
113
|
121
|
{
|
|
114
|
122
|
UserType = 1;
|
|
|
@@ -507,18 +515,27 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
507
|
515
|
{
|
|
508
|
516
|
uwhere = sql += $" and F_CreateBy like '%" + ua.F_UserCode + "%'";
|
|
509
|
517
|
}
|
|
510
|
|
- sql += $" and F_State in(" + (int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.reassign + ")" + " " + uwhere;
|
|
|
518
|
+ sql += $" and F_State in(" + (int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ","+(int)EnumWorkOrderState.reassign+ ")" + " " + uwhere;
|
|
511
|
519
|
// sql += "and T_Wo_WorkOrder.F_ID in (" + GetBackWorkOrderID(ua.F_UserCode) + ") ";
|
|
512
|
520
|
break;
|
|
513
|
521
|
case 1://已审核
|
|
514
|
522
|
if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL")
|
|
515
|
523
|
{
|
|
516
|
|
- sql += $" and T_Wo_WorkOrder.F_ID in ( " + GetApprovedOrderID ( ua .F_UserCode ) + ") "; ;
|
|
|
524
|
+ if (GetApprovedOrderID(ua.F_UserCode)!="")
|
|
|
525
|
+ {
|
|
|
526
|
+ sql += $" and F_ID in ( " + GetApprovedOrderID(ua.F_UserCode) + ") "; ;
|
|
|
527
|
+ }
|
|
|
528
|
+ else
|
|
|
529
|
+ {
|
|
|
530
|
+ return Error("暂无工单");
|
|
|
531
|
+ }
|
|
|
532
|
+
|
|
517
|
533
|
}
|
|
518
|
534
|
else
|
|
519
|
535
|
{
|
|
520
|
536
|
sql += $" and F_CreateBy like '%" + ua.F_UserCode + "%'";
|
|
521
|
|
- sql += $" and T_Wo_WorkOrder.F_ID in ( " + GetApprovedOrderID() + ") "; ;
|
|
|
537
|
+
|
|
|
538
|
+ sql += $" and F_ID in ( " + GetApprovedOrderID() + ") "; ;
|
|
522
|
539
|
}
|
|
523
|
540
|
sql += $" and F_State in(" + (int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.reassign + ")" + " " ;
|
|
524
|
541
|
|
|
|
@@ -652,7 +669,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
652
|
669
|
case 9://待接单
|
|
653
|
670
|
if (GetDJDWorkOrderID(ua.F_UserCode) != "")
|
|
654
|
671
|
{
|
|
655
|
|
- sql += $" and F_State=" + (int)EnumWorkOrderState.assign + $" and T_Wo_WorkOrder.F_ID in ( " + GetDJDWorkOrderID(ua.F_UserCode) + ") "; ;
|
|
|
672
|
+ sql += $" and F_State in(" + (int)EnumWorkOrderState.assign+ "," + (int)EnumWorkOrderState.reassign+ "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ")"+ $" and T_Wo_WorkOrder.F_ID in ( " + GetDJDWorkOrderID(ua.F_UserCode) + ") "; ;
|
|
656
|
673
|
}
|
|
657
|
674
|
else
|
|
658
|
675
|
{
|
|
|
@@ -819,8 +836,38 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
819
|
836
|
return Error("OpenId不能为空");
|
|
820
|
837
|
}
|
|
821
|
838
|
/// <summary>
|
|
|
839
|
+ /// 填写超时原因
|
|
|
840
|
+ /// </summary>
|
|
|
841
|
+ /// <param name="input"></param>
|
|
|
842
|
+ /// <returns></returns>
|
|
|
843
|
+ [WechatActionFilter]
|
|
|
844
|
+ public ActionResult Reasontimeout(string OpenId, long orderid, string cont)
|
|
|
845
|
+ {
|
|
|
846
|
+ if (!string.IsNullOrEmpty(OpenId))
|
|
|
847
|
+ {
|
|
|
848
|
+ var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + OpenId + "'").FirstOrDefault();
|
|
|
849
|
+ if (ua != null)
|
|
|
850
|
+ {
|
|
|
851
|
+ Model.T_Wo_WorkOrder model = woBLL .GetModel(orderid);
|
|
|
852
|
+ //验证信息
|
|
|
853
|
+ if (model != null)
|
|
|
854
|
+ {
|
|
|
855
|
+ model.F_Reasontimeout = cont;
|
|
|
856
|
+ bool n = woBLL.Update(model);
|
|
|
857
|
+ if (n)
|
|
|
858
|
+ return Success("填写成功");
|
|
|
859
|
+ else
|
|
|
860
|
+ return Error("填写失败!");
|
|
|
861
|
+ }
|
|
|
862
|
+ return Error("工单不存在");
|
|
|
863
|
+ }
|
|
|
864
|
+ }
|
|
|
865
|
+ return Error("无操作权限");
|
|
|
866
|
+ }
|
|
|
867
|
+ /// <summary>
|
|
822
|
868
|
/// 审核工单
|
|
823
|
869
|
/// </summary>
|
|
|
870
|
+ [WechatActionFilter]
|
|
824
|
871
|
public bool Approval(string OpenId, long orderid, string AuditCont, Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model,float overtime = 0, int sms = 0,int IsAudit = 0, int AuditState = 0)
|
|
825
|
872
|
{
|
|
826
|
873
|
bool res=true ;
|
|
|
@@ -1088,8 +1135,8 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1088
|
1135
|
|
|
1089
|
1136
|
string str = string.Empty;
|
|
1090
|
1137
|
#region 查询自己名下未审批的工单列表
|
|
1091
|
|
- var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType=" + (int)EnumItemOpt.audit + " and "
|
|
1092
|
|
- + "F_WoState in(" + (int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.reassign + ") and F_NextUser='" + ua.F_UserCode + "' "
|
|
|
1138
|
+ var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType in(" + (int)EnumItemOpt.audit +","+(int)EnumItemOpt.reback + "," + (int)EnumItemOpt.abreback + ")"+ " and "
|
|
|
1139
|
+ + "F_WoState in(" + (int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.reassign + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ") and F_NextUser='" + ua.F_UserCode + "' "
|
|
1093
|
1140
|
+ "" + " ");
|
|
1094
|
1141
|
|
|
1095
|
1142
|
foreach (var it in itemlast)
|
|
|
@@ -1142,8 +1189,8 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1142
|
1189
|
#endregion
|
|
1143
|
1190
|
if (F_RoleCode == "DQJL")
|
|
1144
|
1191
|
{
|
|
1145
|
|
- var itemlasts = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType=" + (int)EnumItemOpt.audit + " and "
|
|
1146
|
|
- + "F_WoState in(" + (int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.reassign + ") and F_NextUser in ( " + GetDeptment(ua) + ") "
|
|
|
1192
|
+ var itemlasts = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType in(" + (int)EnumItemOpt.audit + "," + (int)EnumItemOpt.reback + "," + (int)EnumItemOpt.abreback+")" + " and "
|
|
|
1193
|
+ + "F_WoState in(" + (int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.reassign + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ") and F_NextUser in ( " + GetDeptment(ua) + ") "
|
|
1147
|
1194
|
+ "" + " ");
|
|
1148
|
1195
|
foreach (var it in itemlasts)
|
|
1149
|
1196
|
{
|
|
|
@@ -1194,8 +1241,8 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1194
|
1241
|
{
|
|
1195
|
1242
|
string str = string.Empty;
|
|
1196
|
1243
|
|
|
1197
|
|
- str = "select F_WoID from T_Wo_WorkOrderItem_New where and F_OptType=" + (int)EnumItemOpt.reaudit
|
|
1198
|
|
- + "and F_CreateUser='" + user + "' "//
|
|
|
1244
|
+ str = "select F_WoID from T_Wo_WorkOrderItem_New where F_OptType=" + (int)EnumItemOpt.reaudit
|
|
|
1245
|
+ + " and F_CreateUser=" + user + " "//
|
|
1199
|
1246
|
;
|
|
1200
|
1247
|
return str;
|
|
1201
|
1248
|
}
|
|
|
@@ -1208,7 +1255,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1208
|
1255
|
{
|
|
1209
|
1256
|
string str = string.Empty;
|
|
1210
|
1257
|
|
|
1211
|
|
- str = "select F_WoID from T_Wo_WorkOrderItem_New where and F_OptType=" + (int)EnumItemOpt.reaudit
|
|
|
1258
|
+ str = "select F_WoID from T_Wo_WorkOrderItem_New where F_OptType=" + (int)EnumItemOpt.reaudit
|
|
1212
|
1259
|
//
|
|
1213
|
1260
|
;
|
|
1214
|
1261
|
return str;
|
|
|
@@ -1453,9 +1500,16 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1453
|
1500
|
model.F_AuditBy = model1[i].F_AuditBy;//审核人
|
|
1454
|
1501
|
model.F_AuditOn = model1[i].F_AuditOn;//审核时间
|
|
1455
|
1502
|
model.F_AuditCont = model1[i].F_AuditCont;//审核内容
|
|
1456
|
|
- model.RemainingTime = TimeToOver(model1[i].F_ID);
|
|
1457
|
|
- model.F_IsOver = model1[i].F_IsOver;
|
|
1458
|
|
- var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
|
|
|
1503
|
+ model.RemainingTime = TimeToOver(model1[i].F_ID, model1[i].F_limit );
|
|
|
1504
|
+ if (TimeToOver(model1[i].F_ID, model1[i].F_limit ) < 0)
|
|
|
1505
|
+ {
|
|
|
1506
|
+ model.F_IsOver = 1;
|
|
|
1507
|
+ }
|
|
|
1508
|
+ else
|
|
|
1509
|
+ {
|
|
|
1510
|
+ model.F_IsOver = model1[i].F_IsOver;
|
|
|
1511
|
+ }
|
|
|
1512
|
+ var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
|
|
1459
|
1513
|
if (deptmodel != null)
|
|
1460
|
1514
|
{
|
|
1461
|
1515
|
model.F_Deptid = deptmodel.F_DeptId;
|
|
|
@@ -1476,11 +1530,10 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1476
|
1530
|
/// </summary>
|
|
1477
|
1531
|
/// <param name="id"></param>
|
|
1478
|
1532
|
/// <returns></returns>
|
|
1479
|
|
- private float TimeToOver(int id)
|
|
|
1533
|
+ private float TimeToOver(int id,int limit)
|
|
1480
|
1534
|
{
|
|
1481
|
1535
|
var itemlasts = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.deal + " and F_WoID=" + id + " ");
|
|
1482
|
1536
|
string time1 = "", time2 = ""; int x = 0, y = 0;
|
|
1483
|
|
- float time = 0;
|
|
1484
|
1537
|
if (itemlasts.Count > 0)
|
|
1485
|
1538
|
{
|
|
1486
|
1539
|
for (int i = 0; i < itemlasts.Count; i++)
|
|
|
@@ -1491,7 +1544,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1491
|
1544
|
{
|
|
1492
|
1545
|
x = i;
|
|
1493
|
1546
|
time1 = itemlasts[i].F_CreateTime.ToString();
|
|
1494
|
|
- time = float.Parse(itemlasts[i].F_LimitTime);
|
|
|
1547
|
+
|
|
1495
|
1548
|
}
|
|
1496
|
1549
|
if (itemlasts[i].F_WoState == 10)
|
|
1497
|
1550
|
{
|
|
|
@@ -1507,13 +1560,13 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1507
|
1560
|
if (x > y)
|
|
1508
|
1561
|
{
|
|
1509
|
1562
|
float a = (DateTime.Parse(time2) - DateTime.Parse(time1)).Hours;
|
|
1510
|
|
- float b = time - a;
|
|
|
1563
|
+ float b = limit - a;
|
|
1511
|
1564
|
return b;
|
|
1512
|
1565
|
}
|
|
1513
|
1566
|
else
|
|
1514
|
1567
|
{
|
|
1515
|
1568
|
float a = (DateTime.Now - DateTime.Parse(time1)).Hours;
|
|
1516
|
|
- float b = time - a;
|
|
|
1569
|
+ float b = limit - a;
|
|
1517
|
1570
|
return b;
|
|
1518
|
1571
|
}
|
|
1519
|
1572
|
}
|
|
|
@@ -1525,7 +1578,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1525
|
1578
|
else if (time1 != "")
|
|
1526
|
1579
|
{
|
|
1527
|
1580
|
float a = (DateTime.Now - DateTime.Parse(time1)).Hours;
|
|
1528
|
|
- float b = time - a;
|
|
|
1581
|
+ float b = limit - a;
|
|
1529
|
1582
|
return b;
|
|
1530
|
1583
|
}
|
|
1531
|
1584
|
else
|
|
|
@@ -1799,23 +1852,25 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1799
|
1852
|
|
|
1800
|
1853
|
if (type == 1)
|
|
1801
|
1854
|
{
|
|
1802
|
|
- model.F_State = input.F_State;//工单状态
|
|
1803
|
|
- model.F_CreateOn = input.F_CreateOn;//添加时间
|
|
1804
|
|
- model.F_CreateBy = input.F_CreateBy;//添加人
|
|
|
1855
|
+ model.F_State = model.F_State;//工单状态
|
|
|
1856
|
+ model.F_CreateOn = model.F_CreateOn;//添加时间
|
|
|
1857
|
+ model.F_CreateBy = model.F_CreateBy;//添加人
|
|
1805
|
1858
|
model.F_UpdateBy = usercode;//修改人工号
|
|
1806
|
1859
|
model.F_UpdateOn = DateTime.Now;//修改人工号
|
|
1807
|
1860
|
if (input.F_UpdateCount != null)
|
|
1808
|
1861
|
{
|
|
1809
|
|
- model.F_UpdateCount = input.F_UpdateCount + 1;//修改次数
|
|
|
1862
|
+ model.F_UpdateCount = model.F_UpdateCount + 1;//修改次数
|
|
1810
|
1863
|
}
|
|
1811
|
1864
|
else
|
|
1812
|
1865
|
{
|
|
1813
|
1866
|
model.F_UpdateCount = 1;//修改次数
|
|
1814
|
1867
|
}
|
|
|
1868
|
+ model.F_limit = model.F_limit;
|
|
1815
|
1869
|
}
|
|
1816
|
1870
|
else
|
|
1817
|
1871
|
{
|
|
1818
|
|
- model.F_State = (int)EnumWorkOrderState.neworder;
|
|
|
1872
|
+ model.F_limit = 0;
|
|
|
1873
|
+ model.F_State = (int)EnumWorkOrderState.neworder;
|
|
1819
|
1874
|
model.F_CreateBy = usercode;
|
|
1820
|
1875
|
model.F_CreateOn = DateTime.Now;
|
|
1821
|
1876
|
}
|
|
|
@@ -1843,7 +1898,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1843
|
1898
|
/// </summary>
|
|
1844
|
1899
|
/// <returns></returns>
|
|
1845
|
1900
|
[WechatActionFilter]
|
|
1846
|
|
- public ActionResult Add(WorkOrderNewInput input,float overtime = 0, int sms = 0)
|
|
|
1901
|
+ public ActionResult Add(WorkOrderNewInput input,int overtime = 0, int sms = 0)
|
|
1847
|
1902
|
{
|
|
1848
|
1903
|
|
|
1849
|
1904
|
if (!string.IsNullOrEmpty (input.F_WxOpenId ))
|
|
|
@@ -1888,7 +1943,10 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1888
|
1943
|
var model = new Model.T_Wo_WorkOrder();
|
|
1889
|
1944
|
#region 保存客户基本信息
|
|
1890
|
1945
|
model = inputtoobj(ua,model, input, 2);
|
|
1891
|
|
-
|
|
|
1946
|
+ if (model .F_Source =="3")
|
|
|
1947
|
+ {
|
|
|
1948
|
+ model.F_State =(int)EnumWorkOrderState.customers;
|
|
|
1949
|
+ }
|
|
1892
|
1950
|
#endregion
|
|
1893
|
1951
|
long n = woBLL.Add(model);
|
|
1894
|
1952
|
if (n > 0)
|
|
|
@@ -2001,10 +2059,9 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2001
|
2059
|
/// <param name="clid">指派人</param>
|
|
2002
|
2060
|
/// </summary>
|
|
2003
|
2061
|
/// <returns></returns>
|
|
2004
|
|
- [Authority]
|
|
2005
|
2062
|
[WechatActionFilter]
|
|
2006
|
2063
|
public ActionResult AssignWorkOrder(string OpenId, long orderid, string cont, WorkOrdeDeptment deptment, int isvisit = 1,
|
|
2007
|
|
- float overtime = 0, int sms = 0, int clbm = 0, int clid = 0,int isApprovalp=0, int hclbm = 0, int hclid = 0)
|
|
|
2064
|
+ int overtime = 0, int sms = 0, int clbm = 0, int clid = 0,int isApprovalp=0, int hclbm = 0, int hclid = 0)
|
|
2008
|
2065
|
{
|
|
2009
|
2066
|
|
|
2010
|
2067
|
if (!string.IsNullOrEmpty(OpenId))
|
|
|
@@ -2105,7 +2162,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2105
|
2162
|
/// <summary>
|
|
2106
|
2163
|
/// 转派工单
|
|
2107
|
2164
|
/// </summary>
|
|
2108
|
|
- public bool AssignWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, int clbm = 0, int clid = 0, float overtime = 0, int sms = 0, int isApprovalp = 0,int hclbm = 0, int hclid = 0, string creat = "")
|
|
|
2165
|
+ public bool AssignWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, int clbm = 0, int clid = 0, int overtime = 0, int sms = 0, int isApprovalp = 0,int hclbm = 0, int hclid = 0, string creat = "")
|
|
2109
|
2166
|
{
|
|
2110
|
2167
|
string touser = ""; string tousername = "";
|
|
2111
|
2168
|
#region 获取接收人
|
|
|
@@ -2189,6 +2246,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2189
|
2246
|
//工单完结要更新工单的状态
|
|
2190
|
2247
|
// model.F_DealBy = touser;
|
|
2191
|
2248
|
model.F_State = wostate;
|
|
|
2249
|
+ model.F_limit = overtime;
|
|
2192
|
2250
|
//处理内容
|
|
2193
|
2251
|
if (!string.IsNullOrEmpty(cont))
|
|
2194
|
2252
|
model.F_DealContent += cont + ";";
|
|
|
@@ -2368,100 +2426,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2368
|
2426
|
return Error("无操作权限!");
|
|
2369
|
2427
|
}
|
|
2370
|
2428
|
}
|
|
2371
|
|
- /// <summary>
|
|
2372
|
|
- /// 获取催办工单列表
|
|
2373
|
|
- /// </summary>
|
|
2374
|
|
- /// <returns></returns>
|
|
2375
|
|
- [WechatActionFilter]
|
|
2376
|
|
- public ActionResult GetUrgeList(string OpenId,string code, string cusname, string keywords, string cusphone, string companyname, string province, string city,
|
|
2377
|
|
- string country, string township, string touser, int source = -1, int type = 0, int state = -1, int pageindex = 1, int pagesize = 10)
|
|
2378
|
|
- {
|
|
2379
|
|
-
|
|
2380
|
|
- if (!string.IsNullOrEmpty(OpenId))
|
|
2381
|
|
- {
|
|
2382
|
|
- var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + OpenId + "'").FirstOrDefault();
|
|
2383
|
|
- string sql = " and F_IsDelete=0 and F_State != " + (int)EnumWorkOrderState.finish;
|
|
2384
|
|
-
|
|
2385
|
|
- DataTable dt = new DataTable();
|
|
2386
|
|
- #region 筛选条件
|
|
2387
|
|
- if (type > 0 && type < 5)//工单类型
|
|
2388
|
|
- sql += $" and F_Type=" + type;
|
|
2389
|
|
- if (state >= 0)//工单状态
|
|
2390
|
|
- sql += $" and F_State=" + state;
|
|
2391
|
|
- if (source >= 0)//工单状态
|
|
2392
|
|
- sql += $" and F_Source=" + source;
|
|
2393
|
|
- if (!string.IsNullOrWhiteSpace(touser))//参与人
|
|
2394
|
|
- sql += $" and F_DealBy like '%" + touser.Trim() + "%'";
|
|
2395
|
|
- if (!string.IsNullOrWhiteSpace(code))//工单编号
|
|
2396
|
|
- sql += $" and F_WorkOrderCode like '%" + code.Trim() + "%'";
|
|
2397
|
|
- if (!string.IsNullOrWhiteSpace(cusname))//客户姓名
|
|
2398
|
|
- sql += $" and F_CusName like '%" + cusname.Trim() + "%'";
|
|
2399
|
|
- if (!string.IsNullOrWhiteSpace(keywords))//关键字搜索
|
|
2400
|
|
- sql += $" and F_WorkOrderCode like '%" + keywords.Trim() + "%' or F_CusName like '%" + keywords.Trim() + "%'or F_CusPhone like '%" + keywords.Trim() + "%' ";
|
|
2401
|
|
- if (!string.IsNullOrWhiteSpace(cusphone))//客户电话
|
|
2402
|
|
- sql += $" and F_CusPhone like '%" + cusphone.Trim() + "%'";
|
|
2403
|
|
- if (!string.IsNullOrWhiteSpace(companyname))//公司名称
|
|
2404
|
|
- sql += $" and F_CompanyName like '%" + companyname.Trim() + "%'";
|
|
2405
|
|
- if (!string.IsNullOrWhiteSpace(province))//省
|
|
2406
|
|
- sql += $" and F_IncidentProvince like '%" + province.Trim() + "%'";
|
|
2407
|
|
- if (!string.IsNullOrWhiteSpace(province))//市
|
|
2408
|
|
- sql += $" and F_IncidentCity like '%" + city.Trim() + "%'";
|
|
2409
|
|
- if (!string.IsNullOrWhiteSpace(province))//县
|
|
2410
|
|
- sql += $" and F_IncidentCountry like '%" + country.Trim() + "%'";
|
|
2411
|
|
- if (!string.IsNullOrWhiteSpace(province))//乡
|
|
2412
|
|
- sql += $" and F_IncidentTownship like '%" + township.Trim() + "%'";
|
|
2413
|
|
- #endregion
|
|
2414
|
|
- int recordCount = 0;
|
|
2415
|
|
- if (!string.IsNullOrWhiteSpace(sql))
|
|
2416
|
|
- {
|
|
2417
|
|
-
|
|
2418
|
|
- dt = BLL.PagerBLL.GetListPager(
|
|
2419
|
|
- "T_Wo_WorkOrder",
|
|
2420
|
|
- "F_ID",
|
|
2421
|
|
- "*",
|
|
2422
|
|
- sql,
|
|
2423
|
|
- "ORDER BY T_Wo_WorkOrder.F_ID desc",
|
|
2424
|
|
- pagesize,
|
|
2425
|
|
- pageindex,
|
|
2426
|
|
- true,
|
|
2427
|
|
- out recordCount);
|
|
2428
|
|
- dt.Columns.Add("CBCount", typeof(int));
|
|
2429
|
|
- foreach (DataRow dr in dt.Rows)
|
|
2430
|
|
- {
|
|
2431
|
|
- var list = itembll.GetList(" F_WoID ='" + dr["ID"].ToString() + "' and F_ItemType=" + (int)EnumItemType.urge).Tables[0];
|
|
2432
|
|
- dr["CBCount"] = list.Rows.Count;
|
|
2433
|
|
- }
|
|
2434
|
|
- List<Model.T_Wo_WorkOrder> modlelist = new BLL.T_Wo_WorkOrder().DataTableToList(dt);
|
|
2435
|
|
- List<WorkOrderNewInput> Input = modeltooip(modlelist,ua );
|
|
2436
|
|
- if (Input != null)
|
|
2437
|
|
- {
|
|
2438
|
|
- var obj = new
|
|
2439
|
|
- {
|
|
2440
|
|
- state = "success",
|
|
2441
|
|
- message = "成功",
|
|
2442
|
|
- rows = Input,
|
|
2443
|
|
- total = recordCount
|
|
2444
|
|
- };
|
|
2445
|
|
- return Content(obj.ToJson());
|
|
2446
|
|
- }
|
|
2447
|
|
- else
|
|
2448
|
|
- {
|
|
2449
|
|
- return Success("暂无工单"); ;
|
|
2450
|
|
- }
|
|
2451
|
|
-
|
|
2452
|
|
- }
|
|
2453
|
|
- else
|
|
2454
|
|
- {
|
|
2455
|
|
- return Success("暂无工单"); ;
|
|
2456
|
|
- }
|
|
2457
|
|
- }
|
|
2458
|
|
- else
|
|
2459
|
|
- {
|
|
2460
|
|
- return Error("无操作权限!");
|
|
2461
|
|
- }
|
|
2462
|
|
-
|
|
2463
|
|
- }
|
|
2464
|
|
- /// <summary>
|
|
|
2429
|
+
|
|
2465
|
2430
|
/// 是否超时
|
|
2466
|
2431
|
/// </summary>
|
|
2467
|
2432
|
/// <param name="id"></param>
|
|
|
@@ -2535,47 +2500,12 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2535
|
2500
|
}
|
|
2536
|
2501
|
return true;
|
|
2537
|
2502
|
}
|
|
2538
|
|
- /// <summary>
|
|
2539
|
|
- /// 更新工单
|
|
2540
|
|
- /// </summary>
|
|
2541
|
|
- private bool Refresh()
|
|
2542
|
|
- {
|
|
2543
|
|
- int type = 0;
|
|
2544
|
|
- var modlelist = woBLL .GetModelList(" F_IsDelete=0" + " and F_State in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.receive + "," +
|
|
2545
|
|
- (int)EnumWorkOrderState.assign + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ")");
|
|
2546
|
|
- if (modlelist.Count > 0)
|
|
2547
|
|
- {
|
|
2548
|
|
- foreach (var it in modlelist)
|
|
2549
|
|
- {
|
|
2550
|
|
-
|
|
2551
|
|
- if (TimeforOver(it.F_ID))
|
|
2552
|
|
- {
|
|
2553
|
|
- type = 0;
|
|
2554
|
|
- }
|
|
2555
|
|
- else
|
|
2556
|
|
- {
|
|
2557
|
|
- type = 1;
|
|
2558
|
|
- }
|
|
2559
|
|
- if (type != it.F_IsOver)
|
|
2560
|
|
- {
|
|
2561
|
|
- it.F_IsOver = type;
|
|
2562
|
|
- bool n = woBLL .Update(it);
|
|
2563
|
|
- if (!n)
|
|
2564
|
|
- {
|
|
2565
|
|
- return false;
|
|
2566
|
|
- }
|
|
2567
|
|
- }
|
|
2568
|
|
- }
|
|
2569
|
|
-
|
|
2570
|
|
- }
|
|
2571
|
|
- return true;
|
|
2572
|
|
-
|
|
2573
|
|
- }
|
|
|
2503
|
+
|
|
2574
|
2504
|
/// <summary>
|
|
2575
|
2505
|
/// 接单 - 确认工单
|
|
2576
|
2506
|
/// </summary>
|
|
2577
|
2507
|
/// <returns></returns>
|
|
2578
|
|
- [Authority]
|
|
|
2508
|
+
|
|
2579
|
2509
|
[WechatActionFilter]
|
|
2580
|
2510
|
public ActionResult SureWorkOrder(long orderid, string OpenId)
|
|
2581
|
2511
|
{
|
|
|
@@ -2607,7 +2537,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2607
|
2537
|
/// </summary>
|
|
2608
|
2538
|
/// <param name="input"></param>
|
|
2609
|
2539
|
/// <returns></returns>
|
|
2610
|
|
- [Authority]
|
|
|
2540
|
+
|
|
2611
|
2541
|
[WechatActionFilter]
|
|
2612
|
2542
|
public ActionResult HigApprovalOrder(string OpenId, long orderid,string cont)
|
|
2613
|
2543
|
{
|
|
|
@@ -2703,11 +2633,11 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2703
|
2633
|
/// 工单处理
|
|
2704
|
2634
|
/// </summary>
|
|
2705
|
2635
|
/// <returns></returns>
|
|
2706
|
|
- [Authority]
|
|
|
2636
|
+
|
|
2707
|
2637
|
[WechatActionFilter]
|
|
2708
|
2638
|
public ActionResult DealWorkOrder(string OpenId,long orderid, string cont, WorkOrdeDeptment deptment, string dealType,
|
|
2709
|
|
- string uncont = "",
|
|
2710
|
|
- int isvisit = 1, int isover = 0)
|
|
|
2639
|
+ string uncont = "",
|
|
|
2640
|
+ int isvisit = 1, int isover = 0)
|
|
2711
|
2641
|
{
|
|
2712
|
2642
|
if (!string.IsNullOrEmpty(OpenId))
|
|
2713
|
2643
|
{
|
|
|
@@ -2791,99 +2721,77 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2791
|
2721
|
return Error("无操作权限!");
|
|
2792
|
2722
|
}
|
|
2793
|
2723
|
/// <summary>
|
|
2794
|
|
- /// 退回工单
|
|
|
2724
|
+ /// 更新工单
|
|
2795
|
2725
|
/// </summary>
|
|
2796
|
|
- /// <param name="input"></param>
|
|
2797
|
|
- /// <returns></returns>
|
|
2798
|
|
- [Authority]
|
|
2799
|
|
- [WechatActionFilter]
|
|
2800
|
|
- public ActionResult BackWorkOrder(string OpenId,long orderid, string cont, int type = 0)
|
|
2801
|
|
- {//办理人员和监管可以退回工单
|
|
2802
|
|
- if (!string.IsNullOrEmpty(OpenId))
|
|
|
2726
|
+ private bool Refresh()
|
|
|
2727
|
+ {
|
|
|
2728
|
+ int type = 0;
|
|
|
2729
|
+ var modlelist = woBLL .GetModelList(" F_IsDelete=0" + "and F_IsOver=0" + " and F_State in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.receive + "," +
|
|
|
2730
|
+ (int)EnumWorkOrderState.assign + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ")");
|
|
|
2731
|
+ if (modlelist.Count > 0)
|
|
2803
|
2732
|
{
|
|
2804
|
|
- var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + OpenId + "'").FirstOrDefault();
|
|
2805
|
|
- //河南心连心化学工业集团股份有限公司-系统维护管理员(8000)指派工单给 李波(80324),张绍申(80325),杜爱国(80326),说明:无
|
|
2806
|
|
-
|
|
2807
|
|
- if (ua != null)
|
|
|
2733
|
+ foreach (var it in modlelist)
|
|
2808
|
2734
|
{
|
|
2809
|
|
- Model.T_Wo_WorkOrder model = woBLL .GetModel(orderid);
|
|
2810
|
|
- //验证信息
|
|
2811
|
|
- if (model != null)
|
|
|
2735
|
+
|
|
|
2736
|
+ if (TimeforOver(it.F_ID))
|
|
2812
|
2737
|
{
|
|
2813
|
|
- var res = BackWO(ua, model, cont, type);
|
|
2814
|
|
- if (res)
|
|
2815
|
|
- return Success("退回成功");
|
|
2816
|
|
- else
|
|
2817
|
|
- return Error("退回失败!");
|
|
|
2738
|
+ type = 0;
|
|
2818
|
2739
|
}
|
|
2819
|
|
- return Error("工单不存在");
|
|
2820
|
|
- }
|
|
2821
|
|
- }
|
|
2822
|
|
- return Error("无操作权限");
|
|
2823
|
|
- }
|
|
2824
|
|
- /// <summary>
|
|
2825
|
|
- /// 工单回访
|
|
2826
|
|
- /// </summary>
|
|
2827
|
|
- /// <param name="input"></param>
|
|
2828
|
|
- /// <returns></returns>
|
|
2829
|
|
- [Authority]
|
|
2830
|
|
- [WechatActionFilter]
|
|
2831
|
|
- public ActionResult ReturnvisitOrder(string OpenId, long orderid, string cont, string reason, string call, int isover = 0)
|
|
2832
|
|
- {
|
|
2833
|
|
- if (!string.IsNullOrEmpty(OpenId))
|
|
2834
|
|
- {
|
|
2835
|
|
- var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + OpenId + "'").FirstOrDefault();
|
|
2836
|
|
- if (ua != null)
|
|
2837
|
|
- {
|
|
2838
|
|
- Model.T_Wo_WorkOrder model = woBLL .GetModel(orderid);
|
|
2839
|
|
- //验证信息
|
|
2840
|
|
- if (model != null)
|
|
|
2740
|
+ else
|
|
2841
|
2741
|
{
|
|
2842
|
|
- var res = Retu(ua, model, cont, reason, call,isover );
|
|
2843
|
|
- if (res)
|
|
2844
|
|
- return Success("回访成功");
|
|
2845
|
|
- else
|
|
2846
|
|
- return Error("回访失败!");
|
|
|
2742
|
+ type = 1;
|
|
|
2743
|
+ }
|
|
|
2744
|
+ if (type != it.F_IsOver)
|
|
|
2745
|
+ {
|
|
|
2746
|
+ it.F_IsOver = type;
|
|
|
2747
|
+ bool n = woBLL.Update(it);
|
|
|
2748
|
+ if (!n)
|
|
|
2749
|
+ {
|
|
|
2750
|
+ return false;
|
|
|
2751
|
+ }
|
|
2847
|
2752
|
}
|
|
2848
|
|
- return Error("工单不存在");
|
|
2849
|
2753
|
}
|
|
|
2754
|
+
|
|
2850
|
2755
|
}
|
|
2851
|
|
- return Error("无操作权限");
|
|
|
2756
|
+ return true;
|
|
|
2757
|
+
|
|
2852
|
2758
|
}
|
|
2853
|
2759
|
/// <summary>
|
|
2854
|
|
- /// 工单完结
|
|
|
2760
|
+ /// 退回工单
|
|
2855
|
2761
|
/// </summary>
|
|
2856
|
2762
|
/// <param name="input"></param>
|
|
2857
|
2763
|
/// <returns></returns>
|
|
2858
|
|
- [Authority]
|
|
|
2764
|
+
|
|
2859
|
2765
|
[WechatActionFilter]
|
|
2860
|
|
- public ActionResult EndOrder(string OpenId,long orderid, int isover = 0)
|
|
2861
|
|
- {
|
|
|
2766
|
+ public ActionResult BackWorkOrder(string OpenId,long orderid, string cont, int type = 0)
|
|
|
2767
|
+ {//办理人员和监管可以退回工单
|
|
2862
|
2768
|
if (!string.IsNullOrEmpty(OpenId))
|
|
2863
|
2769
|
{
|
|
2864
|
2770
|
var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + OpenId + "'").FirstOrDefault();
|
|
|
2771
|
+ //河南心连心化学工业集团股份有限公司-系统维护管理员(8000)指派工单给 李波(80324),张绍申(80325),杜爱国(80326),说明:无
|
|
|
2772
|
+
|
|
2865
|
2773
|
if (ua != null)
|
|
2866
|
2774
|
{
|
|
2867
|
2775
|
Model.T_Wo_WorkOrder model = woBLL .GetModel(orderid);
|
|
2868
|
2776
|
//验证信息
|
|
2869
|
2777
|
if (model != null)
|
|
2870
|
2778
|
{
|
|
2871
|
|
- var res = Overorder(ua, model, isover);
|
|
|
2779
|
+ var res = BackWO(ua, model, cont, type);
|
|
2872
|
2780
|
if (res)
|
|
2873
|
|
- return Success("完结成功");
|
|
|
2781
|
+ return Success("退回成功");
|
|
2874
|
2782
|
else
|
|
2875
|
|
- return Error("完结失败!");
|
|
|
2783
|
+ return Error("退回失败!");
|
|
2876
|
2784
|
}
|
|
2877
|
2785
|
return Error("工单不存在");
|
|
2878
|
2786
|
}
|
|
2879
|
2787
|
}
|
|
2880
|
2788
|
return Error("无操作权限");
|
|
2881
|
2789
|
}
|
|
|
2790
|
+
|
|
2882
|
2791
|
/// <summary>
|
|
2883
|
|
- ///延期工单
|
|
|
2792
|
+ ///申请延期
|
|
2884
|
2793
|
/// </summary>
|
|
2885
|
2794
|
/// <returns></returns>
|
|
2886
|
|
- [Authority]
|
|
2887
|
2795
|
[WechatActionFilter]
|
|
2888
|
2796
|
public ActionResult DelayWorkOrder(string OpenId,long orderid, string cont, float limit = 0)
|
|
2889
|
2797
|
{
|
|
|
@@ -2909,87 +2817,12 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2909
|
2817
|
|
|
2910
|
2818
|
}
|
|
2911
|
2819
|
/// <summary>
|
|
2912
|
|
- /// 催办工单
|
|
2913
|
|
- /// </summary>
|
|
2914
|
|
- /// <returns></returns>
|
|
2915
|
|
- [WechatActionFilter]
|
|
2916
|
|
- public ActionResult AddWorkOrderRemind(string OpenId,long orderid, string cont)
|
|
2917
|
|
- {
|
|
2918
|
|
- if (!string.IsNullOrEmpty(OpenId))
|
|
2919
|
|
- {
|
|
2920
|
|
- var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + OpenId + "'").FirstOrDefault();
|
|
2921
|
|
- if (ua != null)
|
|
2922
|
|
- {
|
|
2923
|
|
- Model.T_Wo_WorkOrder model = woBLL .GetModel(orderid);
|
|
2924
|
|
- if (model != null)
|
|
2925
|
|
- {
|
|
2926
|
|
- var res = RemindWO(ua, model, cont);
|
|
2927
|
|
- if (res)
|
|
2928
|
|
- return Success("催办成功!");
|
|
2929
|
|
- else
|
|
2930
|
|
- return Error("操作失败!");
|
|
2931
|
|
- }
|
|
2932
|
|
- return Error("工单不存在!");
|
|
2933
|
|
- }
|
|
2934
|
|
- }
|
|
2935
|
|
- return Error("无操作权限!");
|
|
2936
|
|
- }
|
|
2937
|
|
- /// <summary>
|
|
2938
|
|
- /// 催办工单
|
|
2939
|
|
- /// </summary>
|
|
2940
|
|
- public bool RemindWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, string cont)
|
|
2941
|
|
- {
|
|
2942
|
|
- var itemlast = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.deal + " and F_WoID='" + model.F_ID + "' and F_IsUsed=0 order by F_CreateTime desc").FirstOrDefault();
|
|
2943
|
|
- #region 接收人
|
|
2944
|
|
- int todept = 0; string touser = "";
|
|
2945
|
|
- if (itemlast != null)
|
|
2946
|
|
- {
|
|
2947
|
|
- touser = itemlast.F_NextUser;
|
|
2948
|
|
- todept = itemlast.F_NextDept.Value;
|
|
2949
|
|
- if (string.IsNullOrWhiteSpace(touser))
|
|
2950
|
|
- touser = itemlast.F_CreateUser;
|
|
2951
|
|
- #region 读取被催办人部门
|
|
2952
|
|
- if (todept == 0 && !string.IsNullOrWhiteSpace(touser))
|
|
2953
|
|
- {
|
|
2954
|
|
- var tomodel = userAccountBLL .GetModel(touser);
|
|
2955
|
|
- if (tomodel != null)
|
|
2956
|
|
- todept = tomodel.F_DeptId;
|
|
2957
|
|
- }
|
|
2958
|
|
- #endregion
|
|
2959
|
|
- #region 读取当前登录人部门
|
|
2960
|
|
- string deptname = "";
|
|
2961
|
|
- var deptmodel = departmentBLL.GetModel(nowUser.F_DeptId);
|
|
2962
|
|
- if (deptmodel != null)
|
|
2963
|
|
- {
|
|
2964
|
|
- deptname = deptmodel.F_DeptName + "-";
|
|
2965
|
|
- }
|
|
2966
|
|
- #endregion
|
|
2967
|
|
- var content = deptname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")催办工单,催办说明:" + cont;
|
|
2968
|
|
- long itemid = AddLog(model.F_ID, model.F_State.Value, content, (int)EnumItemType.urge, (int)EnumItemOpt.urge, touser, todept, nowUser, int.Parse(itemlast.F_LimitTime), int.Parse(itemlast.F_IsSMS.ToString()));
|
|
2969
|
|
- if (itemid > 0)
|
|
2970
|
|
- {
|
|
2971
|
|
- if (!string.IsNullOrWhiteSpace(touser))
|
|
2972
|
|
- {
|
|
2973
|
|
- sendsysmsg(model, nowUser, touser, Int32.Parse(itemid.ToString()), "催办");
|
|
2974
|
|
- var tousers = userAccountBLL .GetModel(touser);
|
|
2975
|
|
- if (tousers != null && !string.IsNullOrWhiteSpace(tousers.F_WxOpenId))
|
|
2976
|
|
- {
|
|
2977
|
|
- sendwxmsg(model, tousers.F_WxOpenId, nowUser, "催办");
|
|
2978
|
|
- }
|
|
2979
|
|
- }
|
|
2980
|
|
- return true;
|
|
2981
|
|
- }
|
|
2982
|
|
- }
|
|
2983
|
|
- return false;
|
|
2984
|
|
- #endregion
|
|
2985
|
|
- }
|
|
2986
|
|
- /// <summary>
|
|
2987
|
|
- /// 延期工单
|
|
|
2820
|
+ /// 申请延期
|
|
2988
|
2821
|
/// </summary>
|
|
2989
|
2822
|
public bool DeWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, string cont, float limit)
|
|
2990
|
2823
|
{
|
|
2991
|
2824
|
#region 工单处理
|
|
2992
|
|
- int sms = 0; int wostate = 0; int optbut = 0; float time = 0;
|
|
|
2825
|
+ int sms = 0; int wostate = 0;
|
|
2993
|
2826
|
var itemlasts = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.deal + " and F_WoID=" + model.F_ID + " ");
|
|
2994
|
2827
|
if (itemlasts.Count > 0)
|
|
2995
|
2828
|
{
|
|
|
@@ -2998,13 +2831,13 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2998
|
2831
|
if (it.F_WoState == 1)
|
|
2999
|
2832
|
{
|
|
3000
|
2833
|
sms = int.Parse(it.F_IsSMS.ToString());
|
|
3001
|
|
- time = float.Parse(it.F_LimitTime);
|
|
3002
|
2834
|
}
|
|
3003
|
2835
|
itembll.Update(it);
|
|
3004
|
2836
|
wostate = int.Parse(it.F_WoState.ToString());
|
|
3005
|
|
- optbut = int.Parse(it.F_OptType.ToString());
|
|
|
2837
|
+
|
|
3006
|
2838
|
}
|
|
3007
|
2839
|
}
|
|
|
2840
|
+ int optbut = (int)EnumItemOpt.Delay;
|
|
3008
|
2841
|
#region 读取当前登录人部门
|
|
3009
|
2842
|
string deptname = "";
|
|
3010
|
2843
|
var deptmodel = departmentBLL.GetModel(nowUser.F_DeptId);
|
|
|
@@ -3019,7 +2852,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
3019
|
2852
|
var itemlast = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.deal + " and F_WoID='" + model.F_ID + "' and F_NextUser='" + nowUser.F_UserCode + "' order by F_CreateTime desc").FirstOrDefault();
|
|
3020
|
2853
|
if (itemlast != null)
|
|
3021
|
2854
|
touser = itemlast.F_CreateUser;
|
|
3022
|
|
- var itemid = AddLog((int)model.F_ID, wostate, content, (int)EnumItemType.deal, optbut, touser, 0, nowUser, limit + time, sms);
|
|
|
2855
|
+ var itemid = AddLog((int)model.F_ID, wostate, content, (int)EnumItemType.deal, optbut, touser, 0, nowUser, limit + model .F_limit , sms);
|
|
3023
|
2856
|
|
|
3024
|
2857
|
#endregion
|
|
3025
|
2858
|
|
|
|
@@ -3031,7 +2864,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
3031
|
2864
|
public bool BackWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, string cont, int type)
|
|
3032
|
2865
|
{
|
|
3033
|
2866
|
#region 工单处理
|
|
3034
|
|
- int overtime = 0, sms = 0;
|
|
|
2867
|
+ int sms = 0;
|
|
3035
|
2868
|
var itemlasts = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.deal + " and F_WoID=" + model.F_ID + " ");
|
|
3036
|
2869
|
if (itemlasts.Count > 0)
|
|
3037
|
2870
|
{
|
|
|
@@ -3039,7 +2872,6 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
3039
|
2872
|
{
|
|
3040
|
2873
|
if (it.F_WoState == 1)
|
|
3041
|
2874
|
{
|
|
3042
|
|
- overtime = int.Parse(it.F_LimitTime);
|
|
3043
|
2875
|
sms = int.Parse(it.F_IsSMS.ToString());
|
|
3044
|
2876
|
}
|
|
3045
|
2877
|
}
|
|
|
@@ -3067,7 +2899,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
3067
|
2899
|
var itemlast = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.deal + " and F_WoID='" + model.F_ID + "' and F_NextUser='" + nowUser.F_UserCode + "' order by F_CreateTime desc").FirstOrDefault();
|
|
3068
|
2900
|
if (itemlast != null)
|
|
3069
|
2901
|
touser = itemlast.F_CreateUser;
|
|
3070
|
|
- var itemid = AddLog((int)model.F_ID, wostate, content, (int)EnumItemType.deal, optbut, touser, 0, nowUser, overtime, sms);
|
|
|
2902
|
+ var itemid = AddLog((int)model.F_ID, wostate, content, (int)EnumItemType.deal, optbut, touser, 0, nowUser, model .F_limit , sms);
|
|
3071
|
2903
|
if (itemid > 0)
|
|
3072
|
2904
|
{
|
|
3073
|
2905
|
#region 处理工单
|
|
|
@@ -3099,146 +2931,12 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
3099
|
2931
|
#endregion
|
|
3100
|
2932
|
}
|
|
3101
|
2933
|
/// <summary>
|
|
3102
|
|
- /// 回访工单
|
|
3103
|
|
- /// </summary>
|
|
3104
|
|
- public bool Retu(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, string cont, string reason, string call, int isover = 0)
|
|
3105
|
|
- {
|
|
3106
|
|
- #region 工单处理
|
|
3107
|
|
- int overtime = 0, sms = 0;
|
|
3108
|
|
- var itemlasts = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.visit + " and F_WoID=" + model.F_ID + " ");
|
|
3109
|
|
- if (itemlasts.Count > 0)
|
|
3110
|
|
- {
|
|
3111
|
|
- foreach (var it in itemlasts)
|
|
3112
|
|
- {
|
|
3113
|
|
- if (it.F_WoState == 1)
|
|
3114
|
|
- {
|
|
3115
|
|
- overtime = int.Parse(it.F_LimitTime);
|
|
3116
|
|
- sms = int.Parse(it.F_IsSMS.ToString());
|
|
3117
|
|
- }
|
|
3118
|
|
- }
|
|
3119
|
|
- }
|
|
3120
|
|
- var opt = "回访";
|
|
3121
|
|
- int optbut = (int)EnumItemOpt.visit;
|
|
3122
|
|
- int wostate = (int)EnumWorkOrderState.evaluate;
|
|
3123
|
|
- if (isover == 0)
|
|
3124
|
|
- {
|
|
3125
|
|
- wostate = (int)EnumWorkOrderState.finish;
|
|
3126
|
|
- }
|
|
3127
|
|
- #region 读取当前登录人部门
|
|
3128
|
|
- string deptname = "";
|
|
3129
|
|
- var deptmodel = departmentBLL.GetModel(nowUser.F_DeptId);
|
|
3130
|
|
- if (deptmodel != null)
|
|
3131
|
|
- {
|
|
3132
|
|
- deptname = deptmodel.F_DeptName + "-";
|
|
3133
|
|
- }
|
|
3134
|
|
- #endregion
|
|
3135
|
|
- var content = deptname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + opt + "工单:回访结果:" + cont + " , " + "工单:呼叫结果:" + call;
|
|
3136
|
|
-
|
|
3137
|
|
- var touser = "";
|
|
3138
|
|
- var itemlast = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.deal + " and F_WoID='" + model.F_ID + "' and F_NextUser='" + nowUser.F_UserCode + "' order by F_CreateTime desc").FirstOrDefault();
|
|
3139
|
|
- if (itemlast != null)
|
|
3140
|
|
- touser = itemlast.F_CreateUser;
|
|
3141
|
|
- var itemid = AddLog((int)model.F_ID, wostate, content, (int)EnumItemType.evaluate, optbut, touser, 0, nowUser, overtime, sms);
|
|
3142
|
|
- if (itemid > 0)
|
|
3143
|
|
- {
|
|
3144
|
|
- #region 处理工单
|
|
3145
|
|
- model.F_State = wostate ;
|
|
3146
|
|
- model.F_VisitOn = DateTime.Now;
|
|
3147
|
|
- model.F_VisitResult = cont;
|
|
3148
|
|
- model.F_VisitReason = reason;
|
|
3149
|
|
- model.F_Callresults = call;
|
|
3150
|
|
- woBLL .Update(model);
|
|
3151
|
|
- #endregion
|
|
3152
|
|
- #region 推送消息
|
|
3153
|
|
- #region 向上一级操作人员推送消息
|
|
3154
|
|
- if (!string.IsNullOrWhiteSpace(touser) && touser != nowUser.F_UserCode)
|
|
3155
|
|
- {//排除上一级指派人是自己
|
|
3156
|
|
- sendsysmsg(model, nowUser, touser, (int)itemid, opt);
|
|
3157
|
|
- var lastUser = userAccountBLL .GetModel(touser);
|
|
3158
|
|
- if (lastUser != null && !string.IsNullOrEmpty(lastUser.F_WxOpenId))
|
|
3159
|
|
- sendwxmsg(model, lastUser.F_WxOpenId, nowUser, opt);
|
|
3160
|
|
- }
|
|
3161
|
|
- #endregion
|
|
3162
|
|
- #endregion
|
|
3163
|
|
- return true;
|
|
3164
|
|
- }
|
|
3165
|
|
- else
|
|
3166
|
|
- return false;
|
|
3167
|
|
- #endregion
|
|
3168
|
|
- }
|
|
3169
|
|
- /// <summary>
|
|
3170
|
|
- /// 完结工单
|
|
3171
|
|
- /// </summary>
|
|
3172
|
|
- public bool Overorder(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, int isOver = 0)
|
|
3173
|
|
- {
|
|
3174
|
|
- #region 工单处理
|
|
3175
|
|
- int overtime = 0, sms = 0;
|
|
3176
|
|
- var itemlasts = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.visit + " and F_WoID=" + model.F_ID + " ");
|
|
3177
|
|
- if (itemlasts.Count > 0)
|
|
3178
|
|
- {
|
|
3179
|
|
- foreach (var it in itemlasts)
|
|
3180
|
|
- {
|
|
3181
|
|
- if (it.F_WoState == 1)
|
|
3182
|
|
- {
|
|
3183
|
|
- overtime = int.Parse(it.F_LimitTime);
|
|
3184
|
|
- sms = int.Parse(it.F_IsSMS.ToString());
|
|
3185
|
|
- }
|
|
3186
|
|
- }
|
|
3187
|
|
- }
|
|
3188
|
|
- var opt = "完结";
|
|
3189
|
|
- int optbut = (int)EnumItemOpt.end;
|
|
3190
|
|
- int wostate = (int)EnumWorkOrderState.evaluate;
|
|
3191
|
|
- if (isOver == 0)
|
|
3192
|
|
- {
|
|
3193
|
|
- wostate = (int)EnumWorkOrderState.finish;
|
|
3194
|
|
- }
|
|
3195
|
|
-
|
|
3196
|
|
- #region 读取当前登录人部门
|
|
3197
|
|
- string deptname = "";
|
|
3198
|
|
- var deptmodel = departmentBLL.GetModel(nowUser.F_DeptId);
|
|
3199
|
|
- if (deptmodel != null)
|
|
3200
|
|
- {
|
|
3201
|
|
- deptname = deptmodel.F_DeptName + "-";
|
|
3202
|
|
- }
|
|
3203
|
|
- #endregion
|
|
3204
|
|
- var content = deptname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + opt + "完结工单";
|
|
3205
|
|
-
|
|
3206
|
|
- var touser = "";
|
|
3207
|
|
- var itemlast = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.deal + " and F_WoID='" + model.F_ID + "' and F_NextUser='" + nowUser.F_UserCode + "' order by F_CreateTime desc").FirstOrDefault();
|
|
3208
|
|
- if (itemlast != null)
|
|
3209
|
|
- touser = itemlast.F_CreateUser;
|
|
3210
|
|
- var itemid = AddLog((int)model.F_ID, wostate, content, (int)EnumItemType.deal, optbut, touser, 0, nowUser, overtime, sms);
|
|
3211
|
|
- if (itemid > 0)
|
|
3212
|
|
- {
|
|
3213
|
|
- #region 处理工单
|
|
3214
|
|
- model.F_VisitOn = DateTime.Now;
|
|
3215
|
|
- model.F_State = wostate;
|
|
3216
|
|
- woBLL .Update(model);
|
|
3217
|
|
- #endregion
|
|
3218
|
|
- #region 推送消息
|
|
3219
|
|
- #region 向上一级操作人员推送消息
|
|
3220
|
|
- if (!string.IsNullOrWhiteSpace(touser) && touser != nowUser.F_UserCode)
|
|
3221
|
|
- {//排除上一级指派人是自己
|
|
3222
|
|
- sendsysmsg(model, nowUser, touser, (int)itemid, opt);
|
|
3223
|
|
- var lastUser = userAccountBLL .GetModel(touser);
|
|
3224
|
|
- if (lastUser != null && !string.IsNullOrEmpty(lastUser.F_WxOpenId))
|
|
3225
|
|
- sendwxmsg(model, lastUser.F_WxOpenId, nowUser, opt);
|
|
3226
|
|
- }
|
|
3227
|
|
- #endregion
|
|
3228
|
|
- #endregion
|
|
3229
|
|
- return true;
|
|
3230
|
|
- }
|
|
3231
|
|
- else
|
|
3232
|
|
- return false;
|
|
3233
|
|
- #endregion
|
|
3234
|
|
- }
|
|
3235
|
|
- /// <summary>
|
|
3236
|
2934
|
/// 处理工单
|
|
3237
|
2935
|
/// </summary>
|
|
3238
|
2936
|
public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, int isover = 0, string dealType = "", string uncont = "")
|
|
3239
|
2937
|
{
|
|
3240
|
2938
|
#region 工单处理
|
|
3241
|
|
- int overtime = 0, sms = 0;
|
|
|
2939
|
+ int sms = 0;
|
|
3242
|
2940
|
var itemlasts = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.deal + " and F_WoID=" + model.F_ID + " ");
|
|
3243
|
2941
|
if (itemlasts.Count > 0)
|
|
3244
|
2942
|
{
|
|
|
@@ -3246,7 +2944,6 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
3246
|
2944
|
{
|
|
3247
|
2945
|
if (it.F_WoState == 1)
|
|
3248
|
2946
|
{
|
|
3249
|
|
- overtime = int.Parse(it.F_LimitTime);
|
|
3250
|
2947
|
sms = int.Parse(it.F_IsSMS.ToString());
|
|
3251
|
2948
|
}
|
|
3252
|
2949
|
}
|
|
|
@@ -3281,7 +2978,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
3281
|
2978
|
if (!string.IsNullOrEmpty(cont))
|
|
3282
|
2979
|
optcont = ",处理内容:" + cont;
|
|
3283
|
2980
|
var content = deptname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + opt + "工单" + optcont;
|
|
3284
|
|
- var itemid = AddLog(model.F_ID, wostate, content, (int)EnumItemType.deal, optbut, "", 0, nowUser, overtime, sms);
|
|
|
2981
|
+ var itemid = AddLog(model.F_ID, wostate, content, (int)EnumItemType.deal, optbut, "", 0, nowUser, model .F_limit , sms);
|
|
3285
|
2982
|
if (itemid > 0)
|
|
3286
|
2983
|
{
|
|
3287
|
2984
|
#region 处理工单
|
|
|
@@ -3290,6 +2987,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
3290
|
2987
|
//处理内容
|
|
3291
|
2988
|
if (!string.IsNullOrEmpty(cont))
|
|
3292
|
2989
|
model.F_DealContent += cont + ";";
|
|
|
2990
|
+ model.F_DealTime = DateTime.Now;
|
|
3293
|
2991
|
InToworkModel(model, input);
|
|
3294
|
2992
|
woBLL .Update(model);
|
|
3295
|
2993
|
#endregion
|