|
|
@@ -24,6 +24,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
24
|
24
|
BLL.T_Cus_CustomerBaseNew cusbll = new BLL.T_Cus_CustomerBaseNew();
|
|
25
|
25
|
BLL.T_Sys_Department departmentBLL = new BLL.T_Sys_Department();
|
|
26
|
26
|
BLL.T_Wo_MaterialManage mmBLL = new BLL.T_Wo_MaterialManage();
|
|
|
27
|
+ BLL.T_Wo_QuestionManage quesBLL = new BLL.T_Wo_QuestionManage();
|
|
27
|
28
|
BLL.T_Wo_WorkOrderItem_New itembll = new BLL.T_Wo_WorkOrderItem_New();
|
|
28
|
29
|
BLL.T_Wo_WorkOrder_Logs blllogs = new BLL.T_Wo_WorkOrder_Logs();
|
|
29
|
30
|
BLL.T_Sys_UserAccount sysUserAccountBll = new BLL.T_Sys_UserAccount();
|
|
|
@@ -294,7 +295,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
294
|
295
|
case 12://微信未通过工单
|
|
295
|
296
|
if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" || ro.F_RoleCode == "XTGLY")
|
|
296
|
297
|
{
|
|
297
|
|
- sql += $" and F_ID in(" + GetDelay() + ")";
|
|
|
298
|
+
|
|
298
|
299
|
}
|
|
299
|
300
|
else
|
|
300
|
301
|
{
|
|
|
@@ -856,7 +857,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
856
|
857
|
|
|
857
|
858
|
str = "select F_WoID from T_Wo_WorkOrderItem_New where F_ItemType in(" + (int)EnumItemType.deal + "," + (int)EnumItemType.audit + ")"
|
|
858
|
859
|
+ " and "
|
|
859
|
|
- + "F_OptType in(" + (int)EnumItemOpt.create + "," + (int)EnumItemOpt.abreback + "," + (int)EnumItemOpt.reback + ") and F_NextUser='" + ua.F_UserCode + "'"
|
|
|
860
|
+ + "F_OptType in(" + (int)EnumItemOpt.abreback + "," + (int)EnumItemOpt.reback + ") and F_NextUser='" + ua.F_UserCode + "'"
|
|
860
|
861
|
+ ""
|
|
861
|
862
|
+ " and isnull(F_IsUsed,'0')='0' ";
|
|
862
|
863
|
|
|
|
@@ -945,7 +946,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
945
|
946
|
else if (AuditState == 1)
|
|
946
|
947
|
{
|
|
947
|
948
|
opt = "驳回修订";
|
|
948
|
|
- var userid = AddLog(model.F_ID, model.F_State.Value, deptmodelsname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + "工单审批:驳回修订" + AuditCont, (int)EnumItemType.audit, (int)EnumItemOpt.create, toussers, 0, nowUser, overtime, sms);
|
|
|
949
|
+ var userid = AddLog(model.F_ID, model.F_State.Value, deptmodelsname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + "工单审批:驳回修订" + AuditCont, (int)EnumItemType.audit, (int)EnumItemOpt.reback, toussers, 0, nowUser, overtime, sms);
|
|
949
|
950
|
if (userid <= 0)
|
|
950
|
951
|
res = false;
|
|
951
|
952
|
}
|
|
|
@@ -976,7 +977,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
976
|
977
|
else if (AuditState == 1)
|
|
977
|
978
|
{
|
|
978
|
979
|
opt = "驳回修订";
|
|
979
|
|
- var userid = AddLog(model.F_ID, model.F_State.Value, deptmodelsname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + "工单审批:驳回修订" + AuditCont, (int)EnumItemType.audit, (int)EnumItemOpt.create, toussers, 0, nowUser, overtime, sms);
|
|
|
980
|
+ var userid = AddLog(model.F_ID, model.F_State.Value, deptmodelsname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + "工单审批:驳回修订" + AuditCont, (int)EnumItemType.audit, (int)EnumItemOpt.reback, toussers, 0, nowUser, overtime, sms);
|
|
980
|
981
|
if (userid <= 0)
|
|
981
|
982
|
res = false;
|
|
982
|
983
|
wostate = 16;
|
|
|
@@ -1231,7 +1232,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1231
|
1232
|
private string GetDelay()
|
|
1232
|
1233
|
{
|
|
1233
|
1234
|
string str = "";
|
|
1234
|
|
- str = "select F_WoID from T_Wo_WorkOrderItem_New where F_OptType=" + (int)EnumItemOpt.Delay;
|
|
|
1235
|
+ str = "select F_WoID from T_Wo_WorkOrderItem_New where F_OptType=" + (int)EnumItemOpt.Delay + "and F_ItemType = " + (int)EnumItemType.Delay;
|
|
1235
|
1236
|
return str;
|
|
1236
|
1237
|
}
|
|
1237
|
1238
|
/// <summary>
|
|
|
@@ -1344,13 +1345,16 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1344
|
1345
|
{
|
|
1345
|
1346
|
#region 工单处理
|
|
1346
|
1347
|
int sms = 0; int wostate = 0; int limit = 0;
|
|
1347
|
|
- var itemlasts = itembll.GetModelList(" F_OptType=" + (int)EnumItemOpt.Delay + " and F_WoID=" + model.F_ID + " ");
|
|
|
1348
|
+ var itemlasts = itembll.GetModelList(" F_OptType=" + (int)EnumItemOpt.Delay + "and F_ItemType = " + (int)EnumItemType.Delay + " and F_WoID=" + model.F_ID + " ");
|
|
1348
|
1349
|
if (itemlasts.Count > 0)
|
|
1349
|
1350
|
{
|
|
1350
|
1351
|
foreach (var it in itemlasts)
|
|
1351
|
1352
|
{
|
|
1352
|
1353
|
sms = int.Parse(it.F_IsSMS.ToString());
|
|
1353
|
1354
|
limit = int.Parse(it.F_LimitTime);
|
|
|
1355
|
+ it.F_ItemType = (int)EnumItemType.deal;
|
|
|
1356
|
+ it.F_OptType = (int)EnumItemOpt.deal;
|
|
|
1357
|
+ itembll.Update(it);
|
|
1354
|
1358
|
}
|
|
1355
|
1359
|
}
|
|
1356
|
1360
|
string opt = "";
|
|
|
@@ -1358,7 +1362,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1358
|
1362
|
if (isadopt == 0)
|
|
1359
|
1363
|
{
|
|
1360
|
1364
|
opt = "未通过";
|
|
1361
|
|
- optbut = (int)EnumItemOpt.Delay;
|
|
|
1365
|
+ optbut = (int)EnumItemOpt.deal;
|
|
1362
|
1366
|
limit = model.F_limit;
|
|
1363
|
1367
|
}
|
|
1364
|
1368
|
else
|
|
|
@@ -1381,7 +1385,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1381
|
1385
|
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();
|
|
1382
|
1386
|
if (itemlast != null)
|
|
1383
|
1387
|
touser = itemlast.F_CreateUser;
|
|
1384
|
|
- var itemid = AddLog((int)model.F_ID, wostate, content, (int)EnumItemType.deal, optbut, touser, 0, nowUser, limit, sms);
|
|
|
1388
|
+ var itemid = AddLog((int)model.F_ID, wostate, content, (int)EnumItemType.deal, optbut, touser, 0, nowUser, limit, sms,"",1);
|
|
1385
|
1389
|
if (itemid > 0)
|
|
1386
|
1390
|
{
|
|
1387
|
1391
|
|
|
|
@@ -1526,7 +1530,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1526
|
1530
|
{
|
|
1527
|
1531
|
DataRow drNew = dt.NewRow();
|
|
1528
|
1532
|
#region 客户
|
|
1529
|
|
- if (!valcode(it.F_CustomerID.ToString(), 10))//验证客户编码为10位纯数字
|
|
|
1533
|
+ if (valcode(it.F_CustomerID.ToString(), 10))//验证客户编码为10位纯数字
|
|
1530
|
1534
|
{
|
|
1531
|
1535
|
drNew["客户编号"] = it.F_CustomerID;//客户编码
|
|
1532
|
1536
|
Model.T_Cus_CustomerBaseNew cuModel = cusbll.GetModel(it.F_CustomerID.ToString());//通过客户编号获取客户资料
|
|
|
@@ -1563,7 +1567,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1563
|
1567
|
}
|
|
1564
|
1568
|
#endregion
|
|
1565
|
1569
|
#region 物料
|
|
1566
|
|
- if (!valcode(it.F_MaterialID.ToString(), 11))
|
|
|
1570
|
+ if (valcode(it.F_MaterialID.ToString(), 11))
|
|
1567
|
1571
|
{
|
|
1568
|
1572
|
drNew["物料编码"] = int.Parse(it.F_MaterialID);//验证物料编码为11位纯数字
|
|
1569
|
1573
|
Model.T_Wo_MaterialManage maModel = mmBLL.GetModel(it.F_MaterialID.ToString());//通过物料编码获取物料信息
|
|
|
@@ -2866,7 +2870,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
2866
|
2870
|
int userId = CurrentUser.UserData.F_UserId;
|
|
2867
|
2871
|
if (userId != 0)
|
|
2868
|
2872
|
{
|
|
2869
|
|
- string sql = " and F_IsDelete=0 and F_State != " + (int)EnumWorkOrderState.finish;
|
|
|
2873
|
+ string sql = "";
|
|
2870
|
2874
|
|
|
2871
|
2875
|
DataTable dt = new DataTable();
|
|
2872
|
2876
|
#region 筛选条件
|
|
|
@@ -3057,6 +3061,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3057
|
3061
|
#region 添加验证判断
|
|
3058
|
3062
|
if (!(input.F_Type> 0 && input.F_Type < 5))
|
|
3059
|
3063
|
return Error("工单类型错误!");
|
|
|
3064
|
+ if(string .IsNullOrEmpty (input.F_CusName))
|
|
|
3065
|
+ return Error("请输入客户姓名!");
|
|
|
3066
|
+ if (string.IsNullOrEmpty(input.F_CusPhone))
|
|
|
3067
|
+ return Error("请输入客户电话!");
|
|
3060
|
3068
|
if (!string.IsNullOrEmpty(input.F_BatchNumber) && !vaBatchNumber(input.F_BatchNumber))
|
|
3061
|
3069
|
{
|
|
3062
|
3070
|
return Error("请输入正确的生产批次号!");
|
|
|
@@ -3100,8 +3108,12 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3100
|
3108
|
|
|
3101
|
3109
|
var model = new Model.T_Wo_WorkOrder();
|
|
3102
|
3110
|
#region 保存客户基本信息
|
|
|
3111
|
+ Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
|
|
3103
|
3112
|
model = inputtoobj(model, input, 2);
|
|
3104
|
|
-
|
|
|
3113
|
+ if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL" || ro.F_RoleCode == "YWY")
|
|
|
3114
|
+ {
|
|
|
3115
|
+ model.F_State = (int)EnumWorkOrderState.audit;
|
|
|
3116
|
+ }
|
|
3105
|
3117
|
#endregion
|
|
3106
|
3118
|
long n = workOrder.Add(model);
|
|
3107
|
3119
|
if (n > 0)
|
|
|
@@ -3112,13 +3124,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3112
|
3124
|
{
|
|
3113
|
3125
|
deptname = deptmodel.F_DeptName + "-";
|
|
3114
|
3126
|
}
|
|
3115
|
|
- DataTable dt = new DataTable();
|
|
3116
|
|
- dt = new BLL.T_Wo_WorkOrder().GetList(1, "", "F_ID desc").Tables[0];
|
|
3117
|
|
- List<Model.T_Wo_WorkOrder> modlelist = new BLL.T_Wo_WorkOrder().DataTableToList(dt);
|
|
3118
|
|
-
|
|
3119
|
|
- if (ua != null)
|
|
3120
|
|
- {
|
|
3121
|
|
- Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
|
|
|
3127
|
+ Model.T_Wo_WorkOrder modlelist = new BLL.T_Wo_WorkOrder().GetModel(n);
|
|
|
3128
|
+
|
|
3122
|
3129
|
if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL" || ro.F_RoleCode == "YWY")
|
|
3123
|
3130
|
{
|
|
3124
|
3131
|
|
|
|
@@ -3132,13 +3139,13 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3132
|
3139
|
deptname1 = deptmodel1.F_DeptName + "-";
|
|
3133
|
3140
|
}
|
|
3134
|
3141
|
|
|
3135
|
|
- AddLog(modlelist[0].F_ID, 0, deptname + ua.F_UserName + "(" + ua.F_UserCode + ")" + "创建工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, user.F_UserCode, user.F_DeptId, ua, 0, 0);
|
|
3136
|
|
- AddLog(modlelist[0].F_ID, modlelist[0].F_State.Value, deptname1 + user.F_UserName + "(" + user.F_UserCode + ")" + "待审批", (int)EnumItemType.audit, (int)EnumItemOpt.audit, user.F_UserCode, user.F_DeptId, ua, 0, 0);
|
|
|
3142
|
+ AddLog(modlelist.F_ID, 0, deptname + ua.F_UserName + "(" + ua.F_UserCode + ")" + "创建工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, user.F_UserCode, user.F_DeptId, ua, 0, 0);
|
|
|
3143
|
+ AddLog(modlelist.F_ID, modlelist.F_State.Value, deptname1 + user.F_UserName + "(" + user.F_UserCode + ")" + "待审批", (int)EnumItemType.audit, (int)EnumItemOpt.audit, user.F_UserCode, user.F_DeptId, ua, 0, 0);
|
|
3137
|
3144
|
}
|
|
3138
|
3145
|
else
|
|
3139
|
3146
|
{
|
|
3140
|
|
- AddLog(modlelist[0].F_ID, 0, deptname + ua.F_UserName + "(" + ua.F_UserCode + ")" + "创建工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, "", 0, ua, 0, 0);
|
|
3141
|
|
- var res = AssignWO(ua, modlelist[0], input, "流转市场管理科", 37, 0, 0, 0);
|
|
|
3147
|
+ AddLog(modlelist.F_ID, 0, deptname + ua.F_UserName + "(" + ua.F_UserCode + ")" + "创建工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, "", 0, ua, 0, 0);
|
|
|
3148
|
+ var res = AssignWO(ua, modlelist, input, "流转市场管理科", 37, 0, 0, 0);
|
|
3142
|
3149
|
if (res)
|
|
3143
|
3150
|
return Success("添加成功");
|
|
3144
|
3151
|
else
|
|
|
@@ -3147,10 +3154,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3147
|
3154
|
}
|
|
3148
|
3155
|
else
|
|
3149
|
3156
|
{
|
|
3150
|
|
- AddLog(modlelist[0].F_ID, modlelist[0].F_State.Value, deptname + ua.F_UserName + "(" + ua.F_UserCode + ")" + "创建工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, "", 0, ua, 0, 0);
|
|
|
3157
|
+ AddLog(modlelist.F_ID, modlelist.F_State.Value, deptname + ua.F_UserName + "(" + ua.F_UserCode + ")" + "创建工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, "", 0, ua, 0, 0);
|
|
3151
|
3158
|
}
|
|
3152
|
|
-
|
|
3153
|
|
- }
|
|
3154
|
3159
|
return Success("添加成功!");
|
|
3155
|
3160
|
|
|
3156
|
3161
|
}
|
|
|
@@ -3278,6 +3283,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3278
|
3283
|
return Error("参数错误!");
|
|
3279
|
3284
|
if (!(input.F_Type> 0 && input.F_Type < 5))
|
|
3280
|
3285
|
return Error("工单类型错误!");
|
|
|
3286
|
+ if (string.IsNullOrEmpty(input.F_CusName))
|
|
|
3287
|
+ return Error("请输入客户姓名!");
|
|
|
3288
|
+ if (string.IsNullOrEmpty(input.F_CusPhone))
|
|
|
3289
|
+ return Error("请输入客户电话!");
|
|
3281
|
3290
|
if (!string.IsNullOrEmpty(input.F_BatchNumber) && !vaBatchNumber(input.F_BatchNumber))
|
|
3282
|
3291
|
{
|
|
3283
|
3292
|
return Error("请输入正确的生产批次号!");
|
|
|
@@ -3387,22 +3396,28 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3387
|
3396
|
WorkOrderNewInput model = new WorkOrderNewInput();
|
|
3388
|
3397
|
if (!string .IsNullOrEmpty(model1[i].F_CustomerID))
|
|
3389
|
3398
|
{
|
|
3390
|
|
- if (!valcode(model1[i].F_CustomerID, 10))//验证客户编码为10位纯数字
|
|
3391
|
|
- {
|
|
3392
|
|
- model.F_CustomerID = model1[i].F_CustomerID;//客户编码
|
|
|
3399
|
+ // var sql = "and F_LegalPhone ='" + model1[i ].F_CusPhone.Trim() + "'";
|
|
|
3400
|
+ // var userModel = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_IsDelete = 0 " + sql);
|
|
3393
|
3401
|
Model.T_Cus_CustomerBaseNew cuModel = cusbll.GetModel(model1[i].F_CustomerID.ToString());//通过客户编号获取客户资料
|
|
3394
|
3402
|
if (cuModel != null)
|
|
3395
|
3403
|
{
|
|
3396
|
|
- Model.T_Sys_Department pdModel = departmentBLL.GetModel(cuModel.F_AreaID);//通过公司id获取部门
|
|
|
3404
|
+ if (!string .IsNullOrEmpty (cuModel.F_AreaID))
|
|
|
3405
|
+ {
|
|
|
3406
|
+ Model.T_Sys_Department pdModel = departmentBLL.GetModel(int.Parse(cuModel.F_AreaID));//通过公司id获取部门
|
|
3397
|
3407
|
if (pdModel != null)
|
|
3398
|
3408
|
{
|
|
3399
|
3409
|
model.F_AreaName = pdModel.F_DeptName;
|
|
3400
|
3410
|
}
|
|
3401
|
|
- Model.T_Sys_Department pdModel1 = departmentBLL.GetModel(cuModel.F_BranchID);
|
|
|
3411
|
+ }
|
|
|
3412
|
+ if (!string .IsNullOrEmpty (cuModel.F_BranchID))
|
|
|
3413
|
+ {
|
|
|
3414
|
+ Model.T_Sys_Department pdModel1 = departmentBLL.GetModel(int.Parse(cuModel.F_BranchID));
|
|
3402
|
3415
|
if (pdModel1 != null)
|
|
3403
|
3416
|
{
|
|
3404
|
3417
|
model.F_BranchName = pdModel1.F_DeptName;
|
|
3405
|
3418
|
}
|
|
|
3419
|
+ }
|
|
|
3420
|
+ model.F_CustomerID = cuModel.F_CustomerCode;//客户编码
|
|
3406
|
3421
|
model.F_Salesman = cuModel.F_Salesman;
|
|
3407
|
3422
|
model.F_SalesPhone = cuModel.F_SalesPhone;
|
|
3408
|
3423
|
model.F_Legal = cuModel.F_Legal;
|
|
|
@@ -3421,10 +3436,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3421
|
3436
|
model.F_PlantingArea = cuModel.F_PlantingArea;
|
|
3422
|
3437
|
model.F_FertilizerBrand = cuModel.F_FertilizerBrand;
|
|
3423
|
3438
|
}
|
|
3424
|
|
- }
|
|
3425
|
3439
|
}
|
|
3426
|
3440
|
|
|
3427
|
|
- if (!valcode(model1[i].F_MaterialID.ToString(), 11))
|
|
|
3441
|
+ if (valcode(model1[i].F_MaterialID.ToString(), 11))
|
|
3428
|
3442
|
{
|
|
3429
|
3443
|
model.F_MaterialID = model1[i].F_MaterialID;//验证物料编码为11位纯数字
|
|
3430
|
3444
|
Model.T_Wo_MaterialManage maModel = mmBLL .GetModel(model1[i].F_MaterialID.ToString());//通过物料编码获取物料信息
|
|
|
@@ -3556,7 +3570,33 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3556
|
3570
|
model.F_Files = "0";//附件上传ids
|
|
3557
|
3571
|
model.F_DealType = model1[i].F_DealType;//处理方式:当即办理、电话转接、网络转办(点选)
|
|
3558
|
3572
|
#endregion
|
|
3559
|
|
- model.F_QuestionType = model1[i].F_QuestionType;//问题类别(投诉抽捡和咨询类别不一样)
|
|
|
3573
|
+
|
|
|
3574
|
+
|
|
|
3575
|
+ if (!string .IsNullOrEmpty (model1[i].F_QuestionType) )
|
|
|
3576
|
+ {
|
|
|
3577
|
+ try
|
|
|
3578
|
+ {
|
|
|
3579
|
+ int b = int.Parse(model1[i].F_QuestionType.Trim());
|
|
|
3580
|
+ Model.T_Wo_QuestionManage manage = quesBLL.GetModel(b);
|
|
|
3581
|
+ if (manage!=null )
|
|
|
3582
|
+ {
|
|
|
3583
|
+ model.F_QuestionType = manage.F_QuestionName;
|
|
|
3584
|
+ if (manage.F_Label == "3")
|
|
|
3585
|
+ {
|
|
|
3586
|
+ Model.T_Wo_QuestionManage Manage1 = quesBLL.GetModel(int.Parse(manage.F_ParentId.ToString()));//获取问题类别
|
|
|
3587
|
+ Model.T_Wo_QuestionManage Manage2 = quesBLL.GetModel(int.Parse(Manage1.F_ParentId.ToString()));//获取问题类别
|
|
|
3588
|
+ model.F_QuestionTypeone = Manage2.F_QuestionName;//问题类别1
|
|
|
3589
|
+ model.F_QuestionTypetwo = Manage1.F_QuestionName;//问题类别2
|
|
|
3590
|
+
|
|
|
3591
|
+ }
|
|
|
3592
|
+ }
|
|
|
3593
|
+
|
|
|
3594
|
+ }
|
|
|
3595
|
+ catch (Exception)
|
|
|
3596
|
+ {
|
|
|
3597
|
+ model.F_QuestionType = model1[i].F_QuestionType; //问题类别(投诉抽捡和咨询类别不一样)
|
|
|
3598
|
+ }
|
|
|
3599
|
+ }
|
|
3560
|
3600
|
#region 投诉类
|
|
3561
|
3601
|
model.F_BatchNumber = model1[i].F_BatchNumber;//生产批次号
|
|
3562
|
3602
|
model.F_TS_Formula = model1[i].F_TS_Formula;// 投诉-配方
|
|
|
@@ -3650,7 +3690,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3650
|
3690
|
{
|
|
3651
|
3691
|
model.F_AuditState = "";
|
|
3652
|
3692
|
}
|
|
3653
|
|
-
|
|
|
3693
|
+ model .F_limit = model1[i].F_limit ;
|
|
3654
|
3694
|
model.F_AuditBy = model1[i].F_AuditBy;//审核人
|
|
3655
|
3695
|
model.F_AuditOn = model1[i].F_AuditOn;//审核时间
|
|
3656
|
3696
|
model.F_AuditCont = model1[i].F_AuditCont;//审核内容
|
|
|
@@ -3705,7 +3745,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3705
|
3745
|
private int DelayTimelimit(int id,int limit)
|
|
3706
|
3746
|
{
|
|
3707
|
3747
|
int time = 0;
|
|
3708
|
|
- var itemlist = itembll.GetModelList("F_WoID="+ id + "and F_OptType="+ (int)EnumItemOpt.Delay);
|
|
|
3748
|
+ var itemlist = itembll.GetModelList("F_WoID="+ id + "and F_OptType="+ (int)EnumItemOpt.Delay+ "and F_ItemType = " + (int)EnumItemType.Delay);
|
|
3709
|
3749
|
foreach (var it in itemlist )
|
|
3710
|
3750
|
{
|
|
3711
|
3751
|
time = int.Parse(it.F_LimitTime) - limit;
|
|
|
@@ -3853,6 +3893,20 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3853
|
3893
|
}
|
|
3854
|
3894
|
return true;
|
|
3855
|
3895
|
}
|
|
|
3896
|
+ private bool IsMaterial(WorkOrderNewInput input)
|
|
|
3897
|
+ {
|
|
|
3898
|
+ bool n= false;
|
|
|
3899
|
+ if (!string .IsNullOrEmpty (input.F_MaterialID)&& !string.IsNullOrEmpty(input.F_MaterialName)
|
|
|
3900
|
+ && !string.IsNullOrEmpty(input.F_Model) && !string.IsNullOrEmpty(input.F_Specs)
|
|
|
3901
|
+ && !string.IsNullOrEmpty(input.F_Level1) && !string.IsNullOrEmpty(input.F_Level2)
|
|
|
3902
|
+ && !string.IsNullOrEmpty(input.F_Level3) && !string.IsNullOrEmpty(input.F_Brand)
|
|
|
3903
|
+ && !string.IsNullOrEmpty(input.F_MaterialEffect) && !string.IsNullOrEmpty(input.F_Craft)
|
|
|
3904
|
+ && !string.IsNullOrEmpty(input.F_Pipeline))
|
|
|
3905
|
+ {
|
|
|
3906
|
+ n = true;
|
|
|
3907
|
+ }
|
|
|
3908
|
+ return n;
|
|
|
3909
|
+ }
|
|
3856
|
3910
|
/// <summary>
|
|
3857
|
3911
|
/// 根据传入的对象和input的内容返回对象(添加修改使用)
|
|
3858
|
3912
|
/// </summary>
|
|
|
@@ -3861,13 +3915,15 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3861
|
3915
|
string usercode = CurrentUser.UserData.F_UserCode;
|
|
3862
|
3916
|
var newmodel = model;
|
|
3863
|
3917
|
if (input.F_ID!=0)
|
|
|
3918
|
+ {
|
|
3864
|
3919
|
model.F_ID = input.F_ID;
|
|
|
3920
|
+ model.F_WorkOrderCode = model.F_WorkOrderCode;//工单编号
|
|
|
3921
|
+ }
|
|
3865
|
3922
|
else
|
|
|
3923
|
+ {
|
|
3866
|
3924
|
model.F_ID = model.F_ID;//工单ID
|
|
3867
|
|
- if (!string.IsNullOrWhiteSpace(input.F_WorkOrderCode))
|
|
3868
|
|
- model.F_WorkOrderCode = input.F_WorkOrderCode;//工单编号
|
|
3869
|
|
- else
|
|
3870
|
3925
|
model.F_WorkOrderCode = DateTime.Now.ToString("yyyyMMddHHmmssfff"); //工单编号
|
|
|
3926
|
+ }
|
|
3871
|
3927
|
#region 基本字段
|
|
3872
|
3928
|
if (type == 2)
|
|
3873
|
3929
|
{
|
|
|
@@ -3899,7 +3955,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3899
|
3955
|
// #endregion
|
|
3900
|
3956
|
// int b = cusbll.Add(Customer);
|
|
3901
|
3957
|
// }
|
|
3902
|
|
- if (string.IsNullOrEmpty(input.F_MaterialID))
|
|
|
3958
|
+ if (string.IsNullOrEmpty(input.F_MaterialID)&& IsMaterial(input))
|
|
3903
|
3959
|
{
|
|
3904
|
3960
|
while (true)
|
|
3905
|
3961
|
{
|
|
|
@@ -4090,6 +4146,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4090
|
4146
|
return Error("工单类型错误!");
|
|
4091
|
4147
|
if (input.F_State == 2 && !vaBatchNumber(input.F_BatchNumber))
|
|
4092
|
4148
|
return Error("请输入正确的工单批次号!");
|
|
|
4149
|
+ if (string.IsNullOrEmpty(input.F_CusName))
|
|
|
4150
|
+ return Error("请输入客户姓名!");
|
|
|
4151
|
+ if (string.IsNullOrEmpty(input.F_CusPhone))
|
|
|
4152
|
+ return Error("请输入客户电话!");
|
|
4093
|
4153
|
if (!string.IsNullOrEmpty(input.F_CustomerID) && !valcode(input.F_CustomerID.ToString(), 10))
|
|
4094
|
4154
|
return Error("客户编号为10为纯数字!");
|
|
4095
|
4155
|
|
|
|
@@ -4114,22 +4174,20 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4114
|
4174
|
long n = workOrder.Add(model);
|
|
4115
|
4175
|
if (n > 0)
|
|
4116
|
4176
|
{
|
|
4117
|
|
- DataTable dt = new DataTable();
|
|
4118
|
|
- dt = new BLL.T_Wo_WorkOrder().GetList(1,"", "F_ID desc").Tables [0];
|
|
4119
|
|
- List<Model.T_Wo_WorkOrder> modlelist = new BLL.T_Wo_WorkOrder().DataTableToList(dt);
|
|
|
4177
|
+ Model.T_Wo_WorkOrder modlelist = new BLL.T_Wo_WorkOrder().GetModel(n);
|
|
4120
|
4178
|
WorkOrderNewInput inputs = new WorkOrderNewInput();
|
|
4121
|
4179
|
if (clbm == 0 && clid == 0)
|
|
4122
|
4180
|
{
|
|
4123
|
|
- return Error("请选择接收人");
|
|
|
4181
|
+ return Error("请选择接收部门");
|
|
4124
|
4182
|
}
|
|
4125
|
4183
|
else
|
|
4126
|
4184
|
{
|
|
4127
|
4185
|
var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
|
|
4128
|
4186
|
if (deptmodel != null)
|
|
4129
|
4187
|
{
|
|
4130
|
|
- if (modlelist != null&& modlelist.Count >0)
|
|
|
4188
|
+ if (modlelist != null)
|
|
4131
|
4189
|
{
|
|
4132
|
|
- if (modlelist[0].F_Type == "2")
|
|
|
4190
|
+ if (modlelist.F_Type == "2")
|
|
4133
|
4191
|
{
|
|
4134
|
4192
|
if (deptmodel.F_DeptId == 37)
|
|
4135
|
4193
|
{
|
|
|
@@ -4152,7 +4210,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4152
|
4210
|
|
|
4153
|
4211
|
}
|
|
4154
|
4212
|
}
|
|
4155
|
|
- else if (modlelist[0].F_Type == "3")
|
|
|
4213
|
+ else if (modlelist.F_Type == "3")
|
|
4156
|
4214
|
{
|
|
4157
|
4215
|
if (deptmodel.F_DeptId == 37)
|
|
4158
|
4216
|
{
|
|
|
@@ -4187,7 +4245,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4187
|
4245
|
}
|
|
4188
|
4246
|
}
|
|
4189
|
4247
|
|
|
4190
|
|
- if (modlelist[0] != null&& modlelist.Count >0)
|
|
|
4248
|
+ if (modlelist != null)
|
|
4191
|
4249
|
{
|
|
4192
|
4250
|
string deptname = "";
|
|
4193
|
4251
|
var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
|
|
|
@@ -4195,8 +4253,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4195
|
4253
|
{
|
|
4196
|
4254
|
deptname = deptmodel.F_DeptName + "-";
|
|
4197
|
4255
|
}
|
|
4198
|
|
- AddLog(modlelist[0].F_ID, modlelist[0].F_State.Value, deptname + ua.F_UserName + "(" + ua.F_UserCode + ")" + "添加工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, "", 0, ua, 0, 0);
|
|
4199
|
|
- var res = AssignWO(ua, modlelist[0], inputs, cont, clbm, clid, overtime, sms);
|
|
|
4256
|
+ AddLog(modlelist.F_ID, modlelist.F_State.Value, deptname + ua.F_UserName + "(" + ua.F_UserCode + ")" + "添加工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, "", 0, ua, 0, 0);
|
|
|
4257
|
+ var res = AssignWO(ua, modlelist, inputs, cont, clbm, clid, overtime, sms);
|
|
4200
|
4258
|
if (res)
|
|
4201
|
4259
|
return Success("转派成功");
|
|
4202
|
4260
|
else
|
|
|
@@ -4204,9 +4262,6 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4204
|
4262
|
}
|
|
4205
|
4263
|
else
|
|
4206
|
4264
|
return Error("工单不存在!");
|
|
4207
|
|
-
|
|
4208
|
|
-
|
|
4209
|
|
-
|
|
4210
|
4265
|
}
|
|
4211
|
4266
|
else
|
|
4212
|
4267
|
return Error("添加失败!");
|
|
|
@@ -4229,6 +4284,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4229
|
4284
|
return Error("工单类型错误!");
|
|
4230
|
4285
|
if (input.F_State == 2 && !vaBatchNumber(input.F_BatchNumber))
|
|
4231
|
4286
|
return Error("请输入正确的工单批次号!");
|
|
|
4287
|
+ if (string.IsNullOrEmpty(input.F_CusName))
|
|
|
4288
|
+ return Error("请输入客户姓名!");
|
|
|
4289
|
+ if (string.IsNullOrEmpty(input.F_CusPhone))
|
|
|
4290
|
+ return Error("请输入客户电话!");
|
|
4232
|
4291
|
#endregion
|
|
4233
|
4292
|
if (!string.IsNullOrEmpty(input.F_CustomerID) && !valcode(input.F_CustomerID.ToString(), 10))
|
|
4234
|
4293
|
return Error("客户编号为10为纯数字!");
|
|
|
@@ -4253,39 +4312,37 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4253
|
4312
|
long n = workOrder.Add(model);
|
|
4254
|
4313
|
if (n > 0)
|
|
4255
|
4314
|
{
|
|
4256
|
|
- DataTable dt = new DataTable();
|
|
4257
|
|
- dt = new BLL.T_Wo_WorkOrder().GetList(1, "", "F_ID desc").Tables[0];
|
|
4258
|
|
- List<Model.T_Wo_WorkOrder> modlelist = new BLL.T_Wo_WorkOrder().DataTableToList(dt);
|
|
|
4315
|
+ Model.T_Wo_WorkOrder modlelist = new BLL.T_Wo_WorkOrder().GetModel(n);
|
|
4259
|
4316
|
WorkOrderNewInput inputs = new WorkOrderNewInput();
|
|
4260
|
4317
|
|
|
4261
|
|
- modlelist[0].F_SC_ProductBase = input.F_SC_ProductBase;//市场管理科-生产基地(新乡、新疆、九江、东北、贴牌、无法确定)
|
|
4262
|
|
- modlelist[0].F_SC_PreliminaryOpinion = input.F_SC_PreliminaryOpinion;//市场管理科-初审意见:退货、换货、补偿、自行处理
|
|
4263
|
|
- modlelist[0].F_SC_CJ_SpotResult = input.F_SC_CJ_SpotResult;//市场管理科-抽检-抽检结果(视同合格、合格、不合格、复检后合格、未送检)
|
|
4264
|
|
- modlelist[0].F_SC_CJ_SelfResult = input.F_SC_CJ_SelfResult;// 市场管理科-抽检-自检结果
|
|
4265
|
|
- modlelist[0].F_SC_CJ_ApprovalNo = input.F_SC_CJ_ApprovalNo;//市场管理科-抽检-对应审批工作流单号
|
|
4266
|
|
- modlelist[0].F_SC_CJ_ReturnAccount = input.F_SC_CJ_ReturnAccount;//市场管理科-抽检-确认返账金额(元)
|
|
4267
|
|
- modlelist[0].F_ZL_QualityEventLevel = input.F_ZL_QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
|
|
4268
|
|
- modlelist[0].F_ZL_ClaimAmount = input.F_ZL_ClaimAmount;//质量管理科-索赔金额(单位元,对应责任单位)
|
|
4269
|
|
- modlelist[0].F_ZL_ResponsibleUnit = input.F_ZL_ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
|
|
4270
|
|
- modlelist[0].F_ZL_ApprovalOpinions = input.F_ZL_ApprovalOpinions;// 质量管理科-审批意见(同意、不同意,若选择不同意,增加输入框输入补充内容)
|
|
4271
|
|
- modlelist[0].F_ZL_ApprovalDisagree = input.F_ZL_ApprovalDisagree;//质量管理科-审批不同意意见
|
|
4272
|
|
- modlelist[0].F_ZL_CompensationMethod = input.F_ZL_CompensationMethod;//质量管理科-补偿方式(实物、钱款【单位元】,若选择钱款,增加输入框输入补充内容)
|
|
4273
|
|
- modlelist[0].F_ZL_CompensationMoney = input.F_ZL_CompensationMoney;// 质量管理科-补偿钱款
|
|
4274
|
|
- modlelist[0].F_ZL_CResponsibleUnits = input.F_ZL_CResponsibleUnits;//质量管理科-对应责任单位(生产、研发、农化、物流、质量管理科,销售内勤)
|
|
4275
|
|
- modlelist[0].F_ZL_Fquantity = input.F_ZL_Fquantity;//质量管理科-确认实收数量(吨)
|
|
4276
|
|
- modlelist[0].F_ZL_ImprovementRequirements = input.F_ZL_ImprovementRequirements;// 质量管理科-改进要求
|
|
4277
|
|
- modlelist[0].F_ZL_CApprovalNo = input.F_ZL_CApprovalNo;// 质量管理科-对应审批工作流单号
|
|
4278
|
|
- modlelist[0].F_ZL_CJ_IsRecord = input.F_ZL_CJ_IsRecord;// 质量管理科-抽检-未备案、已备案
|
|
4279
|
|
- modlelist[0].F_DealBy = ua.F_UserCode;// 处理人
|
|
4280
|
|
- modlelist[0].F_DealTime =DateTime .Now ;// 处理时间
|
|
4281
|
|
- modlelist[0].F_DealContent = input.F_DealContent;//完结内容
|
|
4282
|
|
- modlelist[0].F_DealType = input.F_DealType;//处理方式:当即办理、电话转接、网络转办
|
|
4283
|
|
- bool f = workOrder .Update(modlelist[0]);
|
|
|
4318
|
+ modlelist.F_SC_ProductBase = input.F_SC_ProductBase;//市场管理科-生产基地(新乡、新疆、九江、东北、贴牌、无法确定)
|
|
|
4319
|
+ modlelist.F_SC_PreliminaryOpinion = input.F_SC_PreliminaryOpinion;//市场管理科-初审意见:退货、换货、补偿、自行处理
|
|
|
4320
|
+ modlelist.F_SC_CJ_SpotResult = input.F_SC_CJ_SpotResult;//市场管理科-抽检-抽检结果(视同合格、合格、不合格、复检后合格、未送检)
|
|
|
4321
|
+ modlelist.F_SC_CJ_SelfResult = input.F_SC_CJ_SelfResult;// 市场管理科-抽检-自检结果
|
|
|
4322
|
+ modlelist.F_SC_CJ_ApprovalNo = input.F_SC_CJ_ApprovalNo;//市场管理科-抽检-对应审批工作流单号
|
|
|
4323
|
+ modlelist.F_SC_CJ_ReturnAccount = input.F_SC_CJ_ReturnAccount;//市场管理科-抽检-确认返账金额(元)
|
|
|
4324
|
+ modlelist.F_ZL_QualityEventLevel = input.F_ZL_QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
|
|
|
4325
|
+ modlelist.F_ZL_ClaimAmount = input.F_ZL_ClaimAmount;//质量管理科-索赔金额(单位元,对应责任单位)
|
|
|
4326
|
+ modlelist.F_ZL_ResponsibleUnit = input.F_ZL_ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
|
|
|
4327
|
+ modlelist.F_ZL_ApprovalOpinions = input.F_ZL_ApprovalOpinions;// 质量管理科-审批意见(同意、不同意,若选择不同意,增加输入框输入补充内容)
|
|
|
4328
|
+ modlelist.F_ZL_ApprovalDisagree = input.F_ZL_ApprovalDisagree;//质量管理科-审批不同意意见
|
|
|
4329
|
+ modlelist.F_ZL_CompensationMethod = input.F_ZL_CompensationMethod;//质量管理科-补偿方式(实物、钱款【单位元】,若选择钱款,增加输入框输入补充内容)
|
|
|
4330
|
+ modlelist.F_ZL_CompensationMoney = input.F_ZL_CompensationMoney;// 质量管理科-补偿钱款
|
|
|
4331
|
+ modlelist.F_ZL_CResponsibleUnits = input.F_ZL_CResponsibleUnits;//质量管理科-对应责任单位(生产、研发、农化、物流、质量管理科,销售内勤)
|
|
|
4332
|
+ modlelist.F_ZL_Fquantity = input.F_ZL_Fquantity;//质量管理科-确认实收数量(吨)
|
|
|
4333
|
+ modlelist.F_ZL_ImprovementRequirements = input.F_ZL_ImprovementRequirements;// 质量管理科-改进要求
|
|
|
4334
|
+ modlelist.F_ZL_CApprovalNo = input.F_ZL_CApprovalNo;// 质量管理科-对应审批工作流单号
|
|
|
4335
|
+ modlelist.F_ZL_CJ_IsRecord = input.F_ZL_CJ_IsRecord;// 质量管理科-抽检-未备案、已备案
|
|
|
4336
|
+ modlelist.F_DealBy = ua.F_UserCode;// 处理人
|
|
|
4337
|
+ modlelist.F_DealTime =DateTime .Now ;// 处理时间
|
|
|
4338
|
+ modlelist.F_DealContent = input.F_DealContent;//完结内容
|
|
|
4339
|
+ modlelist.F_DealType = input.F_DealType;//处理方式:当即办理、电话转接、网络转办
|
|
|
4340
|
+ bool f = workOrder .Update(modlelist);
|
|
4284
|
4341
|
if (!f )
|
|
4285
|
4342
|
{
|
|
4286
|
4343
|
return Error("完结失败!");
|
|
4287
|
4344
|
}
|
|
4288
|
|
- if (modlelist[0] != null && modlelist.Count > 0)
|
|
|
4345
|
+ if (modlelist != null )
|
|
4289
|
4346
|
{
|
|
4290
|
4347
|
string deptname = "";
|
|
4291
|
4348
|
var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
|
|
|
@@ -4293,16 +4350,12 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4293
|
4350
|
{
|
|
4294
|
4351
|
deptname = deptmodel.F_DeptName + "-";
|
|
4295
|
4352
|
}
|
|
4296
|
|
- AddLog(modlelist[0].F_ID, modlelist[0].F_State.Value, deptname + ua.F_UserName + "(" + ua.F_UserCode + ")" + "添加工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, "", 0, ua, 0, 0);
|
|
4297
|
|
- var res = Overorder(ua, modlelist[0], 1);
|
|
|
4353
|
+ AddLog(modlelist.F_ID, modlelist.F_State.Value, deptname + ua.F_UserName + "(" + ua.F_UserCode + ")" + "添加工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.end, "", 0, ua, 0, 0);
|
|
|
4354
|
+ var res = Overorder(ua, modlelist, 1);
|
|
4298
|
4355
|
if (res)
|
|
4299
|
4356
|
return Success("完结成功");
|
|
4300
|
|
- else
|
|
4301
|
|
- return Error("完结失败!");
|
|
4302
|
4357
|
}
|
|
4303
|
4358
|
}
|
|
4304
|
|
- else
|
|
4305
|
|
- return Error("完结失败!");
|
|
4306
|
4359
|
}
|
|
4307
|
4360
|
else
|
|
4308
|
4361
|
{
|
|
|
@@ -4334,7 +4387,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4334
|
4387
|
{
|
|
4335
|
4388
|
if (clbm == 0 && clid == 0)
|
|
4336
|
4389
|
{
|
|
4337
|
|
- return Error("请选择接收人");
|
|
|
4390
|
+ return Error("请选择接收部门");
|
|
4338
|
4391
|
}
|
|
4339
|
4392
|
else
|
|
4340
|
4393
|
{
|
|
|
@@ -4888,7 +4941,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4888
|
4941
|
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();
|
|
4889
|
4942
|
if (itemlast != null)
|
|
4890
|
4943
|
touser = itemlast.F_CreateUser;
|
|
4891
|
|
- var itemid = AddLog((int)model.F_ID, wostate, content, (int)EnumItemType.deal, optbut, touser, 0, nowUser, limit + model .F_limit , sms);
|
|
|
4944
|
+
|
|
|
4945
|
+
|
|
|
4946
|
+ var itemid = AddLog((int)model.F_ID, wostate, content, (int)EnumItemType.Delay, optbut, touser, 0, nowUser, limit + model .F_limit , sms,"",1);
|
|
4892
|
4947
|
|
|
4893
|
4948
|
#endregion
|
|
4894
|
4949
|
|