|
|
@@ -775,6 +775,8 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
775
|
775
|
/// <summary>
|
|
776
|
776
|
///工单列表
|
|
777
|
777
|
/// </summary>
|
|
|
778
|
+ ///
|
|
|
779
|
+
|
|
778
|
780
|
public ActionResult GetList(string handler,string description,string OpenId, string code, string cusname, string keywords, string cusphone, string companyname, string province, string city,string createby,string createtel,
|
|
779
|
781
|
string country, string township, string category, string salebase, string touser, int source = 0, int state = -1, int status = -1, int type = 0,int condition=-1, int pageindex = 1, int pagesize = 10)
|
|
780
|
782
|
{
|
|
|
@@ -1294,6 +1296,8 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1294
|
1296
|
return Success("暂无工单"); ;
|
|
1295
|
1297
|
}
|
|
1296
|
1298
|
}
|
|
|
1299
|
+
|
|
|
1300
|
+
|
|
1297
|
1301
|
public string GetDeptUserCode(int deptid)
|
|
1298
|
1302
|
{
|
|
1299
|
1303
|
string deptuser = string.Empty;
|
|
|
@@ -1946,6 +1950,9 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1946
|
1950
|
Model.T_Wo_WorkOrder model = woBLL.GetModel(orderid);
|
|
1947
|
1951
|
if (model != null)
|
|
1948
|
1952
|
{
|
|
|
1953
|
+ var itemlast = itembll.GetModelList(" F_WoID='" + model.F_ID + "' order by F_ID desc").FirstOrDefault();
|
|
|
1954
|
+ if (itemlast!=null )
|
|
|
1955
|
+ sms = (int)itemlast.F_IsSMS;
|
|
1949
|
1956
|
var res = Approval(OpenId, orderid, AuditCont, ua, model, overtime, sms, IsAudit, AuditState);
|
|
1950
|
1957
|
if (res)
|
|
1951
|
1958
|
return Success("审核成功");
|
|
|
@@ -1991,7 +1998,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1991
|
1998
|
/// 审核工单
|
|
1992
|
1999
|
/// </summary>
|
|
1993
|
2000
|
[WechatActionFilter]
|
|
1994
|
|
- 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)
|
|
|
2001
|
+ public bool Approval(string OpenId, long orderid, string AuditCont, Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, float overtime = 0, int sms = -1, int IsAudit = 0, int AuditState = 0)
|
|
1995
|
2002
|
{
|
|
1996
|
2003
|
bool res = true;
|
|
1997
|
2004
|
string touser = ""; string tousername = "";
|
|
|
@@ -2019,7 +2026,20 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2019
|
2026
|
}
|
|
2020
|
2027
|
var itemlast = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.audit + " and F_CreateUser!=" + user.F_UserCode + " and F_OptType=" + (int)EnumItemOpt.audit + " and F_WoID='" + model.F_ID + "' and F_NextUser='" + nowUser.F_UserCode + "' order by F_ID desc").FirstOrDefault();
|
|
2021
|
2028
|
if (itemlast != null)
|
|
|
2029
|
+ {
|
|
2022
|
2030
|
toussers = itemlast.F_CreateUser;
|
|
|
2031
|
+ if (sms == -1)
|
|
|
2032
|
+ {
|
|
|
2033
|
+ sms = (int)itemlast.F_IsSMS;
|
|
|
2034
|
+ }
|
|
|
2035
|
+ }
|
|
|
2036
|
+ else
|
|
|
2037
|
+ {
|
|
|
2038
|
+ if (sms == -1)
|
|
|
2039
|
+ {
|
|
|
2040
|
+ sms = 0;
|
|
|
2041
|
+ }
|
|
|
2042
|
+ }
|
|
2023
|
2043
|
wostate = 16;
|
|
2024
|
2044
|
if (AuditState == 0)
|
|
2025
|
2045
|
{
|
|
|
@@ -2028,6 +2048,14 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2028
|
2048
|
var uaid = AddLog(model.F_ID, model.F_State.Value, deptname + user.F_UserName + "(" + user.F_WorkNumber + ")" + "待审批", (int)EnumItemType.audit, (int)EnumItemOpt.audit, user.F_UserCode, user.F_DeptId, nowUser, overtime, sms);
|
|
2029
|
2049
|
if (userid <= 0 || uaid <= 0)
|
|
2030
|
2050
|
res = false;
|
|
|
2051
|
+ else
|
|
|
2052
|
+ {
|
|
|
2053
|
+ if (sms ==1&& !string .IsNullOrEmpty(user .F_Mobile ))
|
|
|
2054
|
+ {
|
|
|
2055
|
+ SendSms(model.F_Type, user.F_Mobile, nowUser.F_UserId);
|
|
|
2056
|
+ }
|
|
|
2057
|
+ }
|
|
|
2058
|
+
|
|
2031
|
2059
|
}
|
|
2032
|
2060
|
else if (AuditState == 1)
|
|
2033
|
2061
|
{
|
|
|
@@ -2052,7 +2080,22 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2052
|
2080
|
{
|
|
2053
|
2081
|
var itemlast = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.audit + " and F_OptType=" + (int)EnumItemOpt.audit + " and F_WoID='" + model.F_ID + "' and F_NextUser='" + nowUser.F_UserCode + "' order by F_ID desc").FirstOrDefault();
|
|
2054
|
2082
|
if (itemlast != null)
|
|
|
2083
|
+ {
|
|
2055
|
2084
|
toussers = itemlast.F_CreateUser;
|
|
|
2085
|
+ if (sms == -1)
|
|
|
2086
|
+ {
|
|
|
2087
|
+ sms = (int)itemlast.F_IsSMS;
|
|
|
2088
|
+ }
|
|
|
2089
|
+ }
|
|
|
2090
|
+ else
|
|
|
2091
|
+ {
|
|
|
2092
|
+ if (sms == -1)
|
|
|
2093
|
+ {
|
|
|
2094
|
+ sms = 0;
|
|
|
2095
|
+ }
|
|
|
2096
|
+ }
|
|
|
2097
|
+
|
|
|
2098
|
+
|
|
2056
|
2099
|
if (AuditState == 0)
|
|
2057
|
2100
|
{
|
|
2058
|
2101
|
opt = "同意上报";
|
|
|
@@ -2068,6 +2111,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2068
|
2111
|
var userid = AddLog(model.F_ID, model.F_State.Value, deptmodelsname + nowUser.F_UserName + "(" + nowUser.F_WorkNumber + ")" + "工单审批:驳回修订" + AuditCont, (int)EnumItemType.audit, (int)EnumItemOpt.reback, toussers, 0, nowUser, overtime, sms);
|
|
2069
|
2112
|
if (userid <= 0)
|
|
2070
|
2113
|
res = false;
|
|
|
2114
|
+
|
|
2071
|
2115
|
wostate = 16;
|
|
2072
|
2116
|
}
|
|
2073
|
2117
|
else
|
|
|
@@ -2103,28 +2147,12 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2103
|
2147
|
if (nowUser.F_UserCode != model.F_CreateBy)
|
|
2104
|
2148
|
{
|
|
2105
|
2149
|
sendsysmsg(model, nowUser, model.F_CreateBy, (int)model.F_ID, opt);//
|
|
2106
|
|
- // var createmodel = userAccountBLL.GetModel(model.F_CreateBy); //
|
|
2107
|
|
- // if (createmodel != null)
|
|
2108
|
|
- // {
|
|
2109
|
|
- // if (!string.IsNullOrEmpty(createmodel.F_WxOpenId))
|
|
2110
|
|
- // {
|
|
2111
|
|
- // sendwxmsg(model, createmodel.F_WxOpenId, nowUser, opt);
|
|
2112
|
|
- // }
|
|
2113
|
|
- // }
|
|
2114
|
2150
|
}
|
|
2115
|
2151
|
|
|
2116
|
2152
|
#region 向下一级操作人员推送消息
|
|
2117
|
2153
|
if (!string.IsNullOrWhiteSpace(touser))
|
|
2118
|
2154
|
{
|
|
2119
|
2155
|
sendsysmsg(model, nowUser, touser, (int)model.F_ID, opt);//
|
|
2120
|
|
- // var modelUser2 = userAccountBLL.GetModel(touser); //
|
|
2121
|
|
- // if (modelUser2 != null)
|
|
2122
|
|
- // {
|
|
2123
|
|
- // if (!string.IsNullOrEmpty(modelUser2.F_WxOpenId))
|
|
2124
|
|
- // {
|
|
2125
|
|
- // sendwxmsg(model, modelUser2.F_WxOpenId, nowUser, opt);
|
|
2126
|
|
- // }
|
|
2127
|
|
- // }
|
|
2128
|
2156
|
}
|
|
2129
|
2157
|
#endregion 向下一级操作人员推送消息
|
|
2130
|
2158
|
}
|
|
|
@@ -2132,6 +2160,32 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2132
|
2160
|
return false;
|
|
2133
|
2161
|
return true;
|
|
2134
|
2162
|
}
|
|
|
2163
|
+ public bool SendSms(string type,string F_Mobile,int userid)
|
|
|
2164
|
+ {
|
|
|
2165
|
+ string smscont = "";
|
|
|
2166
|
+ if (type == "1")
|
|
|
2167
|
+ {
|
|
|
2168
|
+ smscont = "咨询";
|
|
|
2169
|
+ }
|
|
|
2170
|
+ else if (type == "2")
|
|
|
2171
|
+ {
|
|
|
2172
|
+ smscont = "投诉";
|
|
|
2173
|
+ }
|
|
|
2174
|
+ else if (type == "3")
|
|
|
2175
|
+ {
|
|
|
2176
|
+ smscont = "抽检";
|
|
|
2177
|
+ }
|
|
|
2178
|
+ else
|
|
|
2179
|
+ {
|
|
|
2180
|
+ smscont = "建议";
|
|
|
2181
|
+ }
|
|
|
2182
|
+ string[] mag = { smscont };
|
|
|
2183
|
+ string smsmsg = "您好,您有一条新的" + smscont + "工单,请及时接单处理!";
|
|
|
2184
|
+ SmsSingleSenderResult result = new SMSController().SMSSingleshot(445305, mag, F_Mobile.Trim());
|
|
|
2185
|
+ bool n = new SMSController().AddSmS(F_Mobile.Trim(), smsmsg, userid);
|
|
|
2186
|
+ return n;
|
|
|
2187
|
+
|
|
|
2188
|
+ }
|
|
2135
|
2189
|
/// <summary>
|
|
2136
|
2190
|
/// 大区经理未审批流转市场管理科
|
|
2137
|
2191
|
/// </summary>
|
|
|
@@ -3931,6 +3985,10 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
3931
|
3985
|
}
|
|
3932
|
3986
|
AddLog(modlelist.F_ID, 0, deptname1 + ua.F_UserName + "(" + ua.F_WorkNumber + ")" + "创建工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, user.F_UserCode, user.F_DeptId, ua, overtime, sms );
|
|
3933
|
3987
|
AddLog(modlelist.F_ID, modlelist.F_State.Value, deptname + user.F_UserName + "(" + user.F_WorkNumber + ")" + "待审批", (int)EnumItemType.audit, (int)EnumItemOpt.audit, user.F_UserCode, user.F_DeptId, ua, overtime, sms);
|
|
|
3988
|
+ if (sms == 1 && !string.IsNullOrEmpty(user.F_Mobile))
|
|
|
3989
|
+ {
|
|
|
3990
|
+ SendSms(model.F_Type, user.F_Mobile, ua.F_UserId);
|
|
|
3991
|
+ }
|
|
3934
|
3992
|
}
|
|
3935
|
3993
|
else
|
|
3936
|
3994
|
{
|
|
|
@@ -4086,7 +4144,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
4086
|
4144
|
/// <returns></returns>
|
|
4087
|
4145
|
[WechatActionFilter]
|
|
4088
|
4146
|
public ActionResult AssignWorkOrder(string OpenId, long orderid, string cont, WorkOrdeDeptment deptment, string F_Files, int isvisit = 1,
|
|
4089
|
|
- int overtime = 0, int sms = 0, int clbm = 0, int clid = 0, int isApprovalp = 0, int hclbm = 0, int hclid = 0)
|
|
|
4147
|
+ int overtime = 0, int sms = -1, int clbm = 0, int clid = 0, int isApprovalp = 0, int hclbm = 0, int hclid = 0)
|
|
4090
|
4148
|
{
|
|
4091
|
4149
|
|
|
4092
|
4150
|
if (!string.IsNullOrEmpty(OpenId))
|
|
|
@@ -4102,7 +4160,11 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
4102
|
4160
|
return Error("非接单人不可操作工单");
|
|
4103
|
4161
|
}
|
|
4104
|
4162
|
}
|
|
4105
|
|
-
|
|
|
4163
|
+ if (sms ==-1)
|
|
|
4164
|
+ {
|
|
|
4165
|
+ var itemlast = itembll.GetModelList(" F_WoID='" + model.F_ID + "' order by F_ID desc").FirstOrDefault();
|
|
|
4166
|
+ sms = (int)itemlast.F_IsSMS;
|
|
|
4167
|
+ }
|
|
4106
|
4168
|
WorkOrderNewInput input = new WorkOrderNewInput();
|
|
4107
|
4169
|
|
|
4108
|
4170
|
if (ua != null)
|
|
|
@@ -5272,14 +5334,18 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
5272
|
5334
|
if (nowUser.F_UserCode != model.F_CreateBy)
|
|
5273
|
5335
|
{
|
|
5274
|
5336
|
sendsysmsg(model, nowUser, model.F_CreateBy, (int)model.F_ID, opt);//推送系统消息
|
|
5275
|
|
- // var createmodel = userAccountBLL.GetModel(model.F_CreateBy); //被指派人
|
|
5276
|
|
- /// if (createmodel != null)
|
|
5277
|
|
- // {
|
|
5278
|
|
- // if (!string.IsNullOrEmpty(createmodel.F_WxOpenId))
|
|
5279
|
|
- // {
|
|
5280
|
|
- // sendwxmsg(model, createmodel.F_WxOpenId, nowUser, opt);
|
|
5281
|
|
- // }
|
|
5282
|
|
- // }
|
|
|
5337
|
+ if (model.F_State == (int)EnumWorkOrderState.finish)
|
|
|
5338
|
+ {
|
|
|
5339
|
+ var createmodel = userAccountBLL.GetModel(model.F_CreateBy); //被指派人
|
|
|
5340
|
+ if (createmodel != null)
|
|
|
5341
|
+ {
|
|
|
5342
|
+ if (!string.IsNullOrEmpty(createmodel.F_WxOpenId))
|
|
|
5343
|
+ {
|
|
|
5344
|
+ sendwxmsg(model, createmodel.F_WxOpenId, nowUser, "工单完结");
|
|
|
5345
|
+ }
|
|
|
5346
|
+ }
|
|
|
5347
|
+ }
|
|
|
5348
|
+
|
|
5283
|
5349
|
}
|
|
5284
|
5350
|
#endregion
|
|
5285
|
5351
|
#region 向上一级操作人员推送消息
|
|
|
@@ -5489,6 +5555,10 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
5489
|
5555
|
var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
|
|
5490
|
5556
|
|
|
5491
|
5557
|
AddLog(input.F_ID, model.F_State.Value, deptname1 + user.F_UserName + "(" + user.F_WorkNumber + ")" + "待审批", (int)EnumItemType.audit, (int)EnumItemOpt.audit, user.F_UserCode, user.F_DeptId, ua, overtime, sms);
|
|
|
5558
|
+ if (sms == 1 && !string.IsNullOrEmpty(user.F_Mobile))
|
|
|
5559
|
+ {
|
|
|
5560
|
+ SendSms(model.F_Type, user.F_Mobile, ua.F_UserId);
|
|
|
5561
|
+ }
|
|
5492
|
5562
|
}
|
|
5493
|
5563
|
else
|
|
5494
|
5564
|
{
|