|
|
@@ -154,7 +154,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
154
|
154
|
DataTable dt = new DataTable();
|
|
155
|
155
|
Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
|
|
156
|
156
|
Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
|
|
157
|
|
- int DTJ = 0, DFP = 0, DCL = 0, CLZ = 0, YWJ = 0, THDTJ = 0, THDFP = 0, YJGD = 0, EJGD = 0, SJGD = 0, CJSL=0,ZX=0;
|
|
|
157
|
+ int DTJ = 0, DFP = 0, DCL = 0, CLZ = 0, YWJ = 0, THDTJ = 0, THDFP = 0, YJGD = 0, EJGD = 0, SJGD = 0, CJSL=0,ZX=0,
|
|
|
158
|
+ DSH=0;
|
|
158
|
159
|
string where = $" and (F_Type=" + 2 + "or (F_Duplicate!=1 and F_Duplicate!=4 and F_Type=3) or F_Type>4 )";
|
|
159
|
160
|
if (ro.F_RoleCode == "DS")//电商角色
|
|
160
|
161
|
{
|
|
|
@@ -358,6 +359,26 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
358
|
359
|
}
|
|
359
|
360
|
ZX = int.Parse(DbHelperSQL.GetSingle($"select COUNT(1) from T_Bus_WorkOrder WITH(NOLOCK) where {sql} ").ToString());//待处理
|
|
360
|
361
|
break;
|
|
|
362
|
+ case 12://待审核
|
|
|
363
|
+ sql = "";
|
|
|
364
|
+ sql += $" F_IsDelete=0";
|
|
|
365
|
+ sql += "AND F_Duplicate !=5" + where;
|
|
|
366
|
+ sql += "AND F_State=11";
|
|
|
367
|
+ sql += RetuSql(ro, 0, ua);
|
|
|
368
|
+ if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "ZG")
|
|
|
369
|
+ {
|
|
|
370
|
+ sql += "AND F_Notifications ='" + ua.F_UserCode + "'";
|
|
|
371
|
+ }
|
|
|
372
|
+
|
|
|
373
|
+ if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBTZX")
|
|
|
374
|
+ sql += "AND F_CreateUser=" + ua.F_UserCode;
|
|
|
375
|
+ if (ro.F_RoleCode == "QTJS")
|
|
|
376
|
+ {
|
|
|
377
|
+ YWJ = 0;
|
|
|
378
|
+ break;
|
|
|
379
|
+ }
|
|
|
380
|
+ DSH = int.Parse(DbHelperSQL.GetSingle($"select COUNT(1) from T_Bus_WorkOrder WITH(NOLOCK) where {sql} ").ToString());//待处理
|
|
|
381
|
+ break;
|
|
361
|
382
|
|
|
362
|
383
|
}
|
|
363
|
384
|
|
|
|
@@ -377,7 +398,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
377
|
398
|
EJGD = EJGD,
|
|
378
|
399
|
SJGD = SJGD,
|
|
379
|
400
|
CJSL= CJSL,
|
|
380
|
|
- ZX= ZX
|
|
|
401
|
+ ZX= ZX,
|
|
|
402
|
+ DSH= DSH
|
|
381
|
403
|
};
|
|
382
|
404
|
return Content(obj.ToJson()); ;
|
|
383
|
405
|
}
|
|
|
@@ -692,6 +714,19 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
692
|
714
|
if (ro.F_RoleCode == "QTJS")
|
|
693
|
715
|
return Error("无操作权限");
|
|
694
|
716
|
break;
|
|
|
717
|
+ case 12://已完结
|
|
|
718
|
+ sql += "AND F_State=11";
|
|
|
719
|
+ sql += RetuSql(ro, see, ua);
|
|
|
720
|
+
|
|
|
721
|
+ if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "ZG")
|
|
|
722
|
+ {
|
|
|
723
|
+ sql += "AND F_Notifications ='" + ua.F_UserCode + "'";
|
|
|
724
|
+ }
|
|
|
725
|
+ // if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBTZX")
|
|
|
726
|
+ // sql += "AND F_CreateUser=" + ua.F_UserCode;
|
|
|
727
|
+ if (ro.F_RoleCode == "QTJS")
|
|
|
728
|
+ return Error("无操作权限");
|
|
|
729
|
+ break;
|
|
695
|
730
|
}
|
|
696
|
731
|
}
|
|
697
|
732
|
else
|
|
|
@@ -948,7 +983,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
948
|
983
|
var buttons = ButtonGroup.GetButtons(model.F_State.ToString (), ro.F_RoleCode );
|
|
949
|
984
|
if (ro.F_RoleCode== "CLZY")
|
|
950
|
985
|
{
|
|
951
|
|
- if (model.F_State==1 || model.F_State == 10 || model.F_State == 3 || model.F_State == 5 || model.F_State == 4)
|
|
|
986
|
+ if (model.F_State==1 || model.F_State == 3 || model.F_State == 5 || model.F_State == 4)
|
|
952
|
987
|
{
|
|
953
|
988
|
buttons.Add(ButtonGroup.goback());
|
|
954
|
989
|
}
|
|
|
@@ -1598,6 +1633,42 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1598
|
1633
|
return NoToken("未知错误,请重新登录");
|
|
1599
|
1634
|
}
|
|
1600
|
1635
|
/// <summary>
|
|
|
1636
|
+ /// 审核工单
|
|
|
1637
|
+ /// </summary>
|
|
|
1638
|
+ /// <returns></returns>
|
|
|
1639
|
+ [Authority]
|
|
|
1640
|
+ public ActionResult ReviewWorkOrder(int id, string cont, int state = 0)
|
|
|
1641
|
+ {
|
|
|
1642
|
+ if (Request.IsAuthenticated)
|
|
|
1643
|
+ {
|
|
|
1644
|
+ if (state < 1)
|
|
|
1645
|
+ {
|
|
|
1646
|
+ return Error("请选择审核结果");
|
|
|
1647
|
+ }
|
|
|
1648
|
+ int userId = CurrentUser.UserData.F_UserId;
|
|
|
1649
|
+ if (userId != 0)
|
|
|
1650
|
+ {
|
|
|
1651
|
+ Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
|
|
|
1652
|
+ if (ua != null)
|
|
|
1653
|
+ {
|
|
|
1654
|
+ Model.T_Bus_WorkOrder model = workorderBLL.GetModel(id);
|
|
|
1655
|
+ if (model != null)
|
|
|
1656
|
+ {
|
|
|
1657
|
+ var res = Review(ua, model, cont, state);
|
|
|
1658
|
+ if (res)
|
|
|
1659
|
+ return Success("审核成功");
|
|
|
1660
|
+ else
|
|
|
1661
|
+ return Error("审核失败!");
|
|
|
1662
|
+ }
|
|
|
1663
|
+ else
|
|
|
1664
|
+ return Error("工单不存在!");
|
|
|
1665
|
+ }
|
|
|
1666
|
+ }
|
|
|
1667
|
+ return Error("无操作权限!");
|
|
|
1668
|
+ }
|
|
|
1669
|
+ return NoToken("未知错误,请重新登录");
|
|
|
1670
|
+ }
|
|
|
1671
|
+ /// <summary>
|
|
1601
|
1672
|
/// 催单
|
|
1602
|
1673
|
/// </summary>
|
|
1603
|
1674
|
/// <param name="orderid"></param>
|
|
|
@@ -1908,8 +1979,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1908
|
1979
|
{
|
|
1909
|
1980
|
|
|
1910
|
1981
|
opt = "处理完结";
|
|
1911
|
|
- optbut = 10;
|
|
1912
|
|
- wostate =10;
|
|
|
1982
|
+ optbut = 11;
|
|
|
1983
|
+ wostate =11;
|
|
1913
|
1984
|
model.F_DealUser = nowUser.F_UserCode;
|
|
1914
|
1985
|
model.F_DealTime = DateTime.Now;
|
|
1915
|
1986
|
}
|
|
|
@@ -1994,6 +2065,73 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1994
|
2065
|
return false;
|
|
1995
|
2066
|
#endregion
|
|
1996
|
2067
|
}
|
|
|
2068
|
+ /// <summary>
|
|
|
2069
|
+ /// 审核工单
|
|
|
2070
|
+ /// </summary>
|
|
|
2071
|
+ public bool Review(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, int state = 0)
|
|
|
2072
|
+ {
|
|
|
2073
|
+ #region 工单处理
|
|
|
2074
|
+ string creatuser = "";
|
|
|
2075
|
+ var opt = "审核通过";
|
|
|
2076
|
+ int optbut = 10;
|
|
|
2077
|
+ int wostate = 10;
|
|
|
2078
|
+ string touser = "";
|
|
|
2079
|
+ int deptid = 0;
|
|
|
2080
|
+ if (state == 2)
|
|
|
2081
|
+ {
|
|
|
2082
|
+ opt = "审核拒绝";
|
|
|
2083
|
+ optbut = 5;
|
|
|
2084
|
+ wostate = 5;
|
|
|
2085
|
+ var itemlast = itembll.GetModelList(" F_ItemType=" + 1 + " and F_WoID=" + model.F_Id + "and F_WoState=3 order by F_ID desc ").FirstOrDefault(); ;
|
|
|
2086
|
+ if (itemlast != null)
|
|
|
2087
|
+ {
|
|
|
2088
|
+ creatuser = itemlast.F_CreateUser;
|
|
|
2089
|
+ }
|
|
|
2090
|
+
|
|
|
2091
|
+ touser = nowUser.F_UserCode;
|
|
|
2092
|
+ deptid = nowUser.F_DeptId;
|
|
|
2093
|
+ }
|
|
|
2094
|
+ int F_Largeareaid = 0, F_Officeid = 0;
|
|
|
2095
|
+ #region 读取当前登录人部门
|
|
|
2096
|
+ string deptname = "";
|
|
|
2097
|
+ var deptmodel = departmentBLL.GetModel(nowUser.F_DeptId);
|
|
|
2098
|
+ if (deptmodel != null)
|
|
|
2099
|
+ {
|
|
|
2100
|
+ deptname = deptmodel.F_DeptName + "-";
|
|
|
2101
|
+ }
|
|
|
2102
|
+ #endregion
|
|
|
2103
|
+ var optcont = "";
|
|
|
2104
|
+ if (!string.IsNullOrEmpty(cont))
|
|
|
2105
|
+ optcont = ",审核意见:" + cont;
|
|
|
2106
|
+ var content = deptname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + opt + "工单" + optcont;
|
|
|
2107
|
+ var itemid = AddLog(model.F_Id, wostate, content, 1, optbut, touser, deptid, nowUser);
|
|
|
2108
|
+ if (itemid > 0)
|
|
|
2109
|
+ {
|
|
|
2110
|
+ #region 处理工单
|
|
|
2111
|
+ if (state == 2)
|
|
|
2112
|
+ {
|
|
|
2113
|
+ model.F_Officeid = F_Officeid;
|
|
|
2114
|
+ model.F_Largeareaid = F_Largeareaid;
|
|
|
2115
|
+ model.F_Notifications = creatuser;//通知人
|
|
|
2116
|
+ if (wostate == 5)
|
|
|
2117
|
+ {
|
|
|
2118
|
+ if (model.F_TobeallocatedTime == null)
|
|
|
2119
|
+ model.F_TobeallocatedTime = DateTime.Now;
|
|
|
2120
|
+ }
|
|
|
2121
|
+ if (!string.IsNullOrEmpty(model.F_Returnnote))
|
|
|
2122
|
+ model.F_Returnnote += "," + cont;
|
|
|
2123
|
+ else
|
|
|
2124
|
+ model.F_Returnnote += cont;
|
|
|
2125
|
+ }
|
|
|
2126
|
+ model.F_State = wostate;
|
|
|
2127
|
+ workorderBLL.Update(model);
|
|
|
2128
|
+ #endregion
|
|
|
2129
|
+ return true;
|
|
|
2130
|
+ }
|
|
|
2131
|
+ else
|
|
|
2132
|
+ return false;
|
|
|
2133
|
+ #endregion
|
|
|
2134
|
+ }
|
|
1997
|
2135
|
|
|
1998
|
2136
|
/// <summary>
|
|
1999
|
2137
|
/// 转派工单
|
|
|
@@ -2099,22 +2237,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
2099
|
2237
|
{
|
|
2100
|
2238
|
|
|
2101
|
2239
|
Model.T_Wo_WorkOrderItem_New itemModel = new Model.T_Wo_WorkOrderItem_New();
|
|
2102
|
|
- #region
|
|
2103
|
|
- //处理当前工单的记录之前的记录过期
|
|
2104
|
|
- var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_ItemType=" + itemtype + " and F_WoID=" + woid + " ");
|
|
2105
|
|
- if (F_IsUsed==0)
|
|
2106
|
|
- {
|
|
2107
|
|
-
|
|
2108
|
|
- if (itemlast.Count > 0)
|
|
2109
|
|
- {
|
|
2110
|
|
- foreach (var it in itemlast)
|
|
2111
|
|
- {
|
|
2112
|
|
- it.F_IsUsed = 1;
|
|
2113
|
|
- itembll.Update(it);
|
|
2114
|
|
- }
|
|
2115
|
|
- }
|
|
2116
|
|
- }
|
|
2117
|
|
- #endregion
|
|
|
2240
|
+
|
|
2118
|
2241
|
itemModel.F_WoID = woid;
|
|
2119
|
2242
|
itemModel.F_WoState = wostate;
|
|
2120
|
2243
|
itemModel.F_ItemType = itemtype;
|
|
|
@@ -2129,6 +2252,29 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
2129
|
2252
|
itemModel.F_CreateUser = nowUser.F_UserCode;
|
|
2130
|
2253
|
|
|
2131
|
2254
|
var res = itembll.Add(itemModel);
|
|
|
2255
|
+ if(res>0)
|
|
|
2256
|
+ {
|
|
|
2257
|
+ #region
|
|
|
2258
|
+ //处理当前工单的记录之前的记录过期
|
|
|
2259
|
+ var itemlast = itembll.GetModelList(" " +
|
|
|
2260
|
+ "isnull(F_IsUsed,'0')='0' and F_ItemType=" + itemtype + " and F_WoID=" + woid + " " +
|
|
|
2261
|
+ " and F_ID < '"+ res + "'");
|
|
|
2262
|
+ if (F_IsUsed == 0)
|
|
|
2263
|
+ {
|
|
|
2264
|
+
|
|
|
2265
|
+ if (itemlast.Count > 0)
|
|
|
2266
|
+ {
|
|
|
2267
|
+ foreach (var it in itemlast)
|
|
|
2268
|
+ {
|
|
|
2269
|
+ it.F_IsUsed = 1;
|
|
|
2270
|
+ itembll.Update(it);
|
|
|
2271
|
+ }
|
|
|
2272
|
+ }
|
|
|
2273
|
+ }
|
|
|
2274
|
+ #endregion
|
|
|
2275
|
+ }
|
|
|
2276
|
+
|
|
|
2277
|
+
|
|
2132
|
2278
|
return res;
|
|
2133
|
2279
|
}
|
|
2134
|
2280
|
}
|