|
|
@@ -1012,7 +1012,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1012
|
1012
|
{
|
|
1013
|
1013
|
opt = "同意上报";
|
|
1014
|
1014
|
var userid = AddLog(model.F_ID, model.F_State.Value, deptmodelsname + nowUser.F_UserName + "(" + nowUser.F_WorkNumber + ")" + "工单审批:同意上报" + AuditCont, (int)EnumItemType.audit, (int)EnumItemOpt.reaudit, "", 0, nowUser, overtime, sms);
|
|
1015
|
|
- res = GetDaQucirCulation(nowUser, DateTime.Now.ToString(), model.F_ID, true);
|
|
|
1015
|
+ res = GetDaQucirCulation(AuditCont,nowUser, DateTime.Now.ToString(), model.F_ID, true);
|
|
1016
|
1016
|
if (userid <= 0 || !res)
|
|
1017
|
1017
|
res = false;
|
|
1018
|
1018
|
wostate = 1;
|
|
|
@@ -1125,7 +1125,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1125
|
1125
|
/// <param name="ua"></param>
|
|
1126
|
1126
|
/// <param name="time"></param>
|
|
1127
|
1127
|
/// <param name="id"></param>
|
|
1128
|
|
- public bool GetDaQucirCulation(Model.T_Sys_UserAccount ua, string time, long id, bool istrue)
|
|
|
1128
|
+ public bool GetDaQucirCulation(string AuditCont, Model.T_Sys_UserAccount ua, string time, long id, bool istrue)
|
|
1129
|
1129
|
{
|
|
1130
|
1130
|
DateTime times = DateTime.Parse(time).AddHours(24);
|
|
1131
|
1131
|
Model.T_Wo_WorkOrder model = workOrder .GetModel(id);
|
|
|
@@ -1133,18 +1133,52 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1133
|
1133
|
modeLlist.Add(model);
|
|
1134
|
1134
|
List<WorkOrderNewInput> Input = modeltooip(modeLlist);
|
|
1135
|
1135
|
string cont = "";
|
|
|
1136
|
+ int dapt = 0, nextda = 0; string opt = "";
|
|
|
1137
|
+ var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
|
|
|
1138
|
+ if (deptmodel1 != null)
|
|
|
1139
|
+ {
|
|
|
1140
|
+ dapt = deptmodel1.F_ParentId;
|
|
|
1141
|
+ }
|
|
|
1142
|
+ if (dapt != 0)
|
|
|
1143
|
+ {
|
|
|
1144
|
+ if (dapt == 11)
|
|
|
1145
|
+ {
|
|
|
1146
|
+ nextda = 37;
|
|
|
1147
|
+ opt = "流转市场管理科";
|
|
|
1148
|
+ }
|
|
|
1149
|
+ else if (dapt == 14)
|
|
|
1150
|
+ {
|
|
|
1151
|
+ nextda = 57;
|
|
|
1152
|
+ opt = "流转营销管理处";
|
|
|
1153
|
+ }
|
|
|
1154
|
+ else if (dapt == 15)
|
|
|
1155
|
+ {
|
|
|
1156
|
+ nextda = 74;
|
|
|
1157
|
+ opt = "流转策划推广";
|
|
|
1158
|
+ }
|
|
|
1159
|
+ else if (dapt == 16)
|
|
|
1160
|
+ {
|
|
|
1161
|
+ nextda = 88;
|
|
|
1162
|
+ opt = "流转销售部";
|
|
|
1163
|
+ }
|
|
|
1164
|
+ }
|
|
1136
|
1165
|
if (istrue)
|
|
1137
|
1166
|
{
|
|
1138
|
|
- cont = "大区经理已审批流转市场管理科";
|
|
|
1167
|
+ cont = "大区经理已审批:"+ AuditCont+"," + opt;
|
|
1139
|
1168
|
}
|
|
1140
|
1169
|
else
|
|
1141
|
1170
|
{
|
|
1142
|
|
- cont = "大区经理未审批流转市场管理科";
|
|
|
1171
|
+ cont = "大区经理未审批" + opt;
|
|
|
1172
|
+ }
|
|
|
1173
|
+ if (nextda != 0)
|
|
|
1174
|
+ {
|
|
|
1175
|
+ var res = AssignWO(ua, model, Input[0], cont, "", nextda, 0, 0, 0, 0, 0, 0, time.ToString());
|
|
|
1176
|
+ return res;
|
|
|
1177
|
+ }
|
|
|
1178
|
+ else
|
|
|
1179
|
+ {
|
|
|
1180
|
+ return false;
|
|
1143
|
1181
|
}
|
|
1144
|
|
- var res = AssignWO(ua, model, Input[0], cont,"", 37, 0, 0, 0, 0, 0, 0, time.ToString());
|
|
1145
|
|
-
|
|
1146
|
|
-
|
|
1147
|
|
- return res;
|
|
1148
|
1182
|
}
|
|
1149
|
1183
|
/// <summary>
|
|
1150
|
1184
|
/// 获取待审批的工单
|
|
|
@@ -1167,7 +1201,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1167
|
1201
|
{
|
|
1168
|
1202
|
if (hours >= 24)
|
|
1169
|
1203
|
{
|
|
1170
|
|
- GetDaQucirCulation(ua, it.F_CreateTime.ToString(), it.F_WoID, false);
|
|
|
1204
|
+ GetDaQucirCulation("",ua, it.F_CreateTime.ToString(), it.F_WoID, false);
|
|
1171
|
1205
|
}
|
|
1172
|
1206
|
else
|
|
1173
|
1207
|
{
|
|
|
@@ -1199,7 +1233,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1199
|
1233
|
}
|
|
1200
|
1234
|
else if (hours >= 48)
|
|
1201
|
1235
|
{
|
|
1202
|
|
- GetDaQucirCulation(user, it.F_CreateTime.ToString(), it.F_WoID, false);
|
|
|
1236
|
+ GetDaQucirCulation("",user, it.F_CreateTime.ToString(), it.F_WoID, false);
|
|
1203
|
1237
|
}
|
|
1204
|
1238
|
else
|
|
1205
|
1239
|
{
|
|
|
@@ -1245,7 +1279,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1245
|
1279
|
}
|
|
1246
|
1280
|
else
|
|
1247
|
1281
|
{
|
|
1248
|
|
- GetDaQucirCulation(ua, time.ToString(), it.F_WoID, false);
|
|
|
1282
|
+ GetDaQucirCulation("",ua, time.ToString(), it.F_WoID, false);
|
|
1249
|
1283
|
}
|
|
1250
|
1284
|
}
|
|
1251
|
1285
|
}
|
|
|
@@ -3267,12 +3301,50 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3267
|
3301
|
}
|
|
3268
|
3302
|
else
|
|
3269
|
3303
|
{
|
|
3270
|
|
- AddLog(modlelist.F_ID, 0, deptname + ua.F_UserName + "(" + ua.F_WorkNumber + ")" + "创建工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, "", 0, ua, 0, 0);
|
|
3271
|
|
- var res = AssignWO(ua, modlelist, input, "流转市场管理科","", 37, 0, 0, 0);
|
|
|
3304
|
+
|
|
|
3305
|
+ int dapt = 0, nextda = 0;
|
|
|
3306
|
+ var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
|
|
|
3307
|
+ if (deptmodel1 != null)
|
|
|
3308
|
+ {
|
|
|
3309
|
+ dapt = deptmodel1.F_ParentId;
|
|
|
3310
|
+ }
|
|
|
3311
|
+ AddLog(modlelist.F_ID, 0, deptname + ua.F_UserName + "(" + ua.F_WorkNumber + ")" + "创建工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, "", 0, ua, 0, 0);
|
|
|
3312
|
+ string opt = "";
|
|
|
3313
|
+ if (dapt != 0)
|
|
|
3314
|
+ {
|
|
|
3315
|
+ if (dapt == 11)
|
|
|
3316
|
+ {
|
|
|
3317
|
+ nextda = 37;
|
|
|
3318
|
+ opt = "流转市场管理科";
|
|
|
3319
|
+ }
|
|
|
3320
|
+ else if (dapt == 14)
|
|
|
3321
|
+ {
|
|
|
3322
|
+ nextda = 57;
|
|
|
3323
|
+ opt = "流转营销管理处";
|
|
|
3324
|
+ }
|
|
|
3325
|
+ else if (dapt == 15)
|
|
|
3326
|
+ {
|
|
|
3327
|
+ nextda = 74;
|
|
|
3328
|
+ opt = "流转策划推广";
|
|
|
3329
|
+ }
|
|
|
3330
|
+ else if (dapt == 16)
|
|
|
3331
|
+ {
|
|
|
3332
|
+ nextda = 88;
|
|
|
3333
|
+ opt = "流转销售部";
|
|
|
3334
|
+ }
|
|
|
3335
|
+ }
|
|
|
3336
|
+ if (nextda != 0)
|
|
|
3337
|
+ {
|
|
|
3338
|
+ var res = AssignWO(ua, modlelist, input, opt, "", nextda, 0, 0, 0);
|
|
3272
|
3339
|
if (res)
|
|
3273
|
3340
|
return Success("添加成功");
|
|
3274
|
3341
|
else
|
|
3275
|
|
- return Error("市场管理科接收失败!");
|
|
|
3342
|
+ return Error("流转失败!");
|
|
|
3343
|
+ }
|
|
|
3344
|
+ else
|
|
|
3345
|
+ {
|
|
|
3346
|
+ return Error("流转失败!");
|
|
|
3347
|
+ }
|
|
3276
|
3348
|
}
|
|
3277
|
3349
|
}
|
|
3278
|
3350
|
else
|
|
|
@@ -3438,13 +3510,13 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3438
|
3510
|
#region 添加验证判断
|
|
3439
|
3511
|
if (input.F_ID <= 0)
|
|
3440
|
3512
|
return Error("参数错误!");
|
|
3441
|
|
- if (!(input.F_Type> 0 && input.F_Type < 5))
|
|
|
3513
|
+ if (!(input.F_Type > 0 && input.F_Type < 5))
|
|
3442
|
3514
|
return Error("工单类型错误!");
|
|
3443
|
3515
|
if (string.IsNullOrEmpty(input.F_CusName))
|
|
3444
|
3516
|
return Error("请输入客户姓名!");
|
|
3445
|
3517
|
if (string.IsNullOrEmpty(input.F_CusPhone))
|
|
3446
|
3518
|
return Error("请输入客户电话!");
|
|
3447
|
|
- if (!string.IsNullOrEmpty(input.F_BatchNumber) && !vaBatchNumber(input.F_BatchNumber.Trim ()))
|
|
|
3519
|
+ if (!string.IsNullOrEmpty(input.F_BatchNumber) && !vaBatchNumber(input.F_BatchNumber.Trim()))
|
|
3448
|
3520
|
{
|
|
3449
|
3521
|
return Error("请输入正确的生产批次号!");
|
|
3450
|
3522
|
}
|
|
|
@@ -3471,37 +3543,32 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3471
|
3543
|
}
|
|
3472
|
3544
|
if (!string.IsNullOrEmpty(input.F_CustomerID) && !valcode(input.F_CustomerID.ToString(), 10))
|
|
3473
|
3545
|
return Error("客户编号为10为纯数字!");
|
|
3474
|
|
- if (!string.IsNullOrEmpty (input.F_MaterialID) && !valcode(input.F_MaterialID, 11))
|
|
|
3546
|
+ if (!string.IsNullOrEmpty(input.F_MaterialID) && !valcode(input.F_MaterialID, 11))
|
|
3475
|
3547
|
return Error("物料编码为11为纯数字!");
|
|
3476
|
3548
|
#endregion
|
|
3477
|
3549
|
var model = workOrder.GetModel(input.F_ID);
|
|
3478
|
3550
|
if (model == null)
|
|
3479
|
3551
|
return Error("查询不到此工单!");
|
|
3480
|
|
- if(ro !=null )
|
|
|
3552
|
+ if (ro != null)
|
|
3481
|
3553
|
{
|
|
3482
|
|
- if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" )
|
|
|
3554
|
+ if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX")
|
|
3483
|
3555
|
{
|
|
3484
|
|
- if (model .F_CreateBy !=ua.F_UserCode )
|
|
|
3556
|
+ if (model.F_CreateBy != ua.F_UserCode)
|
|
3485
|
3557
|
{
|
|
3486
|
3558
|
return Error("非创建人不能修改工单!");
|
|
3487
|
3559
|
}
|
|
3488
|
|
-
|
|
|
3560
|
+
|
|
3489
|
3561
|
}
|
|
3490
|
3562
|
}
|
|
3491
|
|
- if (model.F_State != 3 && model.F_State != 12)
|
|
|
3563
|
+ if (model.F_State == 2)
|
|
3492
|
3564
|
{
|
|
3493
|
|
- var itemlast = itembll.GetModelList(" F_WoID=" + input.F_ID + " ");
|
|
3494
|
|
- if (itemlast.Count > 0)
|
|
3495
|
|
- {
|
|
3496
|
|
- foreach (var it in itemlast)
|
|
3497
|
|
- {
|
|
3498
|
|
- if (it.F_WoState == 2)
|
|
3499
|
|
- {
|
|
3500
|
|
- return Error("此工单已进入处理流程不能修改!");
|
|
3501
|
|
- }
|
|
3502
|
|
- }
|
|
3503
|
|
- }
|
|
|
3565
|
+ return Error("此工单已接单不能修改!");
|
|
3504
|
3566
|
}
|
|
|
3567
|
+ else if (model.F_State == 11|| model.F_State == 10)
|
|
|
3568
|
+ {
|
|
|
3569
|
+ return Error("此工单已处理不能修改!");
|
|
|
3570
|
+ }
|
|
|
3571
|
+
|
|
3505
|
3572
|
#region 保存客户基本信息
|
|
3506
|
3573
|
model = inputtoobj(model, input,1);
|
|
3507
|
3574
|
#endregion
|
|
|
@@ -3538,16 +3605,48 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3538
|
3605
|
else
|
|
3539
|
3606
|
{
|
|
3540
|
3607
|
string deptname1 = "";
|
|
|
3608
|
+ int dapt = 0, nextda = 0; string opt = "";
|
|
3541
|
3609
|
var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
|
|
3542
|
3610
|
if (deptmodel1 != null)
|
|
3543
|
3611
|
{
|
|
3544
|
3612
|
deptname1 = deptmodel1.F_DeptName + "-";
|
|
|
3613
|
+ dapt = deptmodel1.F_ParentId;
|
|
|
3614
|
+ }
|
|
|
3615
|
+ if (dapt != 0)
|
|
|
3616
|
+ {
|
|
|
3617
|
+ if (dapt == 11)
|
|
|
3618
|
+ {
|
|
|
3619
|
+ nextda = 37;
|
|
|
3620
|
+ opt = "流转市场管理科";
|
|
|
3621
|
+ }
|
|
|
3622
|
+ else if (dapt == 14)
|
|
|
3623
|
+ {
|
|
|
3624
|
+ nextda = 57;
|
|
|
3625
|
+ opt = "流转营销管理处";
|
|
|
3626
|
+ }
|
|
|
3627
|
+ else if (dapt == 15)
|
|
|
3628
|
+ {
|
|
|
3629
|
+ nextda = 74;
|
|
|
3630
|
+ opt = "流转策划推广";
|
|
|
3631
|
+ }
|
|
|
3632
|
+ else if (dapt == 16)
|
|
|
3633
|
+ {
|
|
|
3634
|
+ nextda = 88;
|
|
|
3635
|
+ opt = "流转销售部";
|
|
|
3636
|
+ }
|
|
|
3637
|
+ }
|
|
|
3638
|
+ if (nextda != 0)
|
|
|
3639
|
+ {
|
|
|
3640
|
+ var res = AssignWO(ua, model, input, opt, "", nextda, 0, model.F_limit, 0);
|
|
|
3641
|
+ if (res)
|
|
|
3642
|
+ return Success("保存成功");
|
|
|
3643
|
+ else
|
|
|
3644
|
+ return Error("流转失败!");
|
|
3545
|
3645
|
}
|
|
3546
|
|
- var res = AssignWO(ua, model, input, "流转市场管理科","", 37, 0, model.F_limit, 0);
|
|
3547
|
|
- if (res)
|
|
3548
|
|
- return Success("保存成功");
|
|
3549
|
3646
|
else
|
|
3550
|
|
- return Error("市场管理科接收失败!");
|
|
|
3647
|
+ {
|
|
|
3648
|
+ return Error("流转失败!");
|
|
|
3649
|
+ }
|
|
3551
|
3650
|
}
|
|
3552
|
3651
|
}
|
|
3553
|
3652
|
}
|
|
|
@@ -3904,15 +4003,15 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3904
|
4003
|
model.F_IsAudit = model1[i].F_IsAudit;//是否审核
|
|
3905
|
4004
|
model.F_Highopinions = model1[i].F_Highopinions;//高层处理意见
|
|
3906
|
4005
|
model.F_CreateOn = model1[i].F_CreateOn; ;//添加时间
|
|
3907
|
|
- model.F_CreateBy = model1[i].F_CreateBy; ;//添加人
|
|
|
4006
|
+
|
|
3908
|
4007
|
if (!string .IsNullOrEmpty (model1[i].F_CreateBy))
|
|
3909
|
4008
|
{
|
|
3910
|
4009
|
Model.T_Sys_UserAccount creatname = sysUserAccountBll.GetModel(model1[i].F_CreateBy);
|
|
3911
|
4010
|
if (creatname!=null )
|
|
3912
|
4011
|
{
|
|
|
4012
|
+ model.F_CreateBy = creatname.F_WorkNumber; ;//添加人
|
|
3913
|
4013
|
model.F_CreateName = creatname.F_UserName ; ;//添加人
|
|
3914
|
4014
|
}
|
|
3915
|
|
-
|
|
3916
|
4015
|
}
|
|
3917
|
4016
|
model.F_UpdateBy = model1[i].F_UpdateBy;//修改人工号
|
|
3918
|
4017
|
model.F_UpdateOn = model1[i].F_UpdateOn; ;//修改人工号
|
|
|
@@ -5096,7 +5195,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
5096
|
5195
|
if (ua != null)
|
|
5097
|
5196
|
{
|
|
5098
|
5197
|
Model.T_Wo_WorkOrder model = workOrder .GetModel(orderid);
|
|
5099
|
|
- //验证信息
|
|
|
5198
|
+ //验证信息
|
|
5100
|
5199
|
if (model != null)
|
|
5101
|
5200
|
{
|
|
5102
|
5201
|
var res = BackWO(ua, model, cont, type);
|
|
|
@@ -5975,7 +6074,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
5975
|
6074
|
string strmsg = string.Empty;
|
|
5976
|
6075
|
strmsg = nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + "操作" + opt + "工单";
|
|
5977
|
6076
|
Model.T_Msg_List msg = new Model.T_Msg_List();
|
|
5978
|
|
- msg.Type = (int)Model.MSGType.workorder;//处理
|
|
|
6077
|
+ msg.Type = (int)Model.MSGType.Handle;//处理
|
|
5979
|
6078
|
msg.ToUser = touser;
|
|
5980
|
6079
|
msg.ToID = toid;
|
|
5981
|
6080
|
msg.Detail = strmsg;
|