|
|
@@ -52,7 +52,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
52
|
52
|
if (source > 0)//工单来源
|
|
53
|
53
|
{
|
|
54
|
54
|
if (source==1)
|
|
55
|
|
- sql += $" and F_Source in (1,'')";
|
|
|
55
|
+ sql += $"( and F_Source in (1,'') or F_Source is null)";
|
|
56
|
56
|
else
|
|
57
|
57
|
sql += $" and F_Source='" + source + "'";
|
|
58
|
58
|
}
|
|
|
@@ -79,11 +79,19 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
79
|
79
|
if (!string.IsNullOrWhiteSpace(createby))//创建人
|
|
80
|
80
|
{
|
|
81
|
81
|
string F_WorkNumber = "";
|
|
|
82
|
+
|
|
82
|
83
|
Model.T_Sys_UserAccount user = sysUserAccountBll.GetworkModel(createby);
|
|
|
84
|
+
|
|
83
|
85
|
if (user != null)
|
|
84
|
86
|
{
|
|
85
|
87
|
F_WorkNumber = user.F_UserCode;
|
|
86
|
88
|
}
|
|
|
89
|
+ else
|
|
|
90
|
+ {
|
|
|
91
|
+ Model.T_Sys_UserAccount userer = sysUserAccountBll.GetName (createby);
|
|
|
92
|
+ if (userer!=null )
|
|
|
93
|
+ F_WorkNumber = user.F_UserCode;
|
|
|
94
|
+ }
|
|
87
|
95
|
if (!string.IsNullOrEmpty(F_WorkNumber))
|
|
88
|
96
|
{
|
|
89
|
97
|
sql += $"and F_CreateBy in(" + createby + "," + F_WorkNumber + ") ";
|
|
|
@@ -1410,30 +1418,36 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1410
|
1418
|
dapt = deptmodel1.F_ParentId;
|
|
1411
|
1419
|
deptname = deptmodel1.F_DeptName;
|
|
1412
|
1420
|
}
|
|
|
1421
|
+ int isbl = 0;
|
|
1413
|
1422
|
if (dapt != 0)
|
|
1414
|
1423
|
{
|
|
1415
|
1424
|
if (dapt == 11)
|
|
1416
|
1425
|
{
|
|
|
1426
|
+ isbl = 1;
|
|
1417
|
1427
|
nextda = 37;
|
|
1418
|
1428
|
opt = "流转市场管理科";
|
|
1419
|
1429
|
}
|
|
1420
|
1430
|
else if (dapt == 14)
|
|
1421
|
1431
|
{
|
|
|
1432
|
+ isbl = 1;
|
|
1422
|
1433
|
nextda = 57;
|
|
1423
|
1434
|
opt = "流转营销管理处";
|
|
1424
|
1435
|
}
|
|
1425
|
1436
|
else if (dapt == 15)
|
|
1426
|
1437
|
{
|
|
|
1438
|
+ isbl = 1;
|
|
1427
|
1439
|
nextda = 74;
|
|
1428
|
1440
|
opt = "流转策划推广";
|
|
1429
|
1441
|
}
|
|
1430
|
1442
|
else if (dapt == 16)
|
|
1431
|
1443
|
{
|
|
|
1444
|
+ isbl = 1;
|
|
1432
|
1445
|
nextda = 88;
|
|
1433
|
1446
|
opt = "流转销售部";
|
|
1434
|
1447
|
}
|
|
1435
|
1448
|
else if (ua.F_DeptId==17|| ua.F_DeptId == 18 || ua.F_DeptId == 19 || ua.F_DeptId == 20 || ua.F_DeptId == 21)
|
|
1436
|
1449
|
{
|
|
|
1450
|
+ isbl = 1;
|
|
1437
|
1451
|
nextda = ua.F_DeptId;
|
|
1438
|
1452
|
opt = "流转"+ deptname;
|
|
1439
|
1453
|
}
|
|
|
@@ -1454,7 +1468,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1454
|
1468
|
}
|
|
1455
|
1469
|
if (nextda != 0)
|
|
1456
|
1470
|
{
|
|
1457
|
|
- var res = AssignWO(ua, model, Input[0], cont, "", nextda, 0, model .F_limit , sms, 0, 0, 0, time.ToString());
|
|
|
1471
|
+ var res = AssignWO(ua, model, Input[0], cont, "", nextda, 0, model .F_limit , sms, 0, 0, 0, time.ToString(), isbl);
|
|
1458
|
1472
|
return res;
|
|
1459
|
1473
|
}
|
|
1460
|
1474
|
else
|
|
|
@@ -2767,7 +2781,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
2767
|
2781
|
return Error("查询失败");
|
|
2768
|
2782
|
}
|
|
2769
|
2783
|
string sql = $" and F_IsDelete=0";
|
|
2770
|
|
- sql += "and F_Type !=3";
|
|
|
2784
|
+ // sql += "and F_Type !=3";
|
|
2771
|
2785
|
DataTable dt = new DataTable();
|
|
2772
|
2786
|
#region 筛选条件
|
|
2773
|
2787
|
if (type > 0 && type < 5)//工单类型
|
|
|
@@ -3392,7 +3406,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3392
|
3406
|
private bool Refresh()
|
|
3393
|
3407
|
{
|
|
3394
|
3408
|
int type = 0;
|
|
3395
|
|
- var modlelist = workOrder .GetModelList(" F_Type != 3 and F_IsDelete=0" + "and F_IsOver=0" + " and F_State in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.receive + "," +
|
|
|
3409
|
+ var modlelist = workOrder .GetModelList(" F_IsDelete=0" + "and F_IsOver=0" + " and F_State in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.receive + "," +
|
|
3396
|
3410
|
(int)EnumWorkOrderState.assign + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + "," + (int)EnumWorkOrderState.finish + ")");
|
|
3397
|
3411
|
if (modlelist.Count >0)
|
|
3398
|
3412
|
{
|
|
|
@@ -3655,6 +3669,14 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3655
|
3669
|
return Error("工单类型错误!");
|
|
3656
|
3670
|
if(string .IsNullOrEmpty (input.F_CusName))
|
|
3657
|
3671
|
return Error("请输入客户姓名!");
|
|
|
3672
|
+ if (input.F_Type == 2)
|
|
|
3673
|
+ {
|
|
|
3674
|
+ if (string.IsNullOrEmpty(input.F_SalesBase))
|
|
|
3675
|
+ return Error("请输入基地!");
|
|
|
3676
|
+ if (string.IsNullOrEmpty(input.F_QuestionType))
|
|
|
3677
|
+ return Error("请选择问题类别!");
|
|
|
3678
|
+ }
|
|
|
3679
|
+
|
|
3658
|
3680
|
if (string.IsNullOrEmpty(input.F_CusPhone))
|
|
3659
|
3681
|
return Error("请输入客户电话!");
|
|
3660
|
3682
|
if (!string.IsNullOrEmpty(input.F_BatchNumber) && !vaBatchNumber(input.F_BatchNumber.Trim ()))
|
|
|
@@ -3686,18 +3708,27 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3686
|
3708
|
|
|
3687
|
3709
|
if (!string.IsNullOrEmpty (input.F_MaterialID) && !valcode(input.F_MaterialID.ToString(), 11))
|
|
3688
|
3710
|
return Error("物料编码为11为纯数字!");
|
|
3689
|
|
- //if (input.F_Type == 2 || input.F_Type == 3)
|
|
3690
|
|
- //{
|
|
3691
|
|
- // if (string.IsNullOrEmpty(input.F_CustomerID))
|
|
3692
|
|
- // {
|
|
3693
|
|
- // if (string.IsNullOrEmpty(input.F_LegalPhone))
|
|
3694
|
|
- // return Error("请输入客户电话");
|
|
3695
|
|
- // if (getunphone(0, input.F_LegalPhone))
|
|
3696
|
|
- // return Error("已存在该客户请勿重复添加");
|
|
3697
|
|
- // }
|
|
3698
|
|
- //}
|
|
|
3711
|
+ if (!string.IsNullOrEmpty(input.F_CustomerID))
|
|
|
3712
|
+ {
|
|
|
3713
|
+ var Customer = cusbll.GetModel(input.F_CustomerID.Trim());
|
|
|
3714
|
+ if (Customer == null)
|
|
|
3715
|
+ return Error("无此客户编码!");
|
|
|
3716
|
+ }
|
|
|
3717
|
+ if (!string.IsNullOrWhiteSpace(input.F_MaterialID))
|
|
|
3718
|
+ {
|
|
|
3719
|
+ var Customer = mmBLL.GetModel(input.F_MaterialID.Trim());
|
|
|
3720
|
+ if (Customer == null)
|
|
|
3721
|
+ return Error("无此物料编码!");
|
|
|
3722
|
+ }
|
|
|
3723
|
+ if (input.F_Type == 3)
|
|
|
3724
|
+ {
|
|
|
3725
|
+ if (string.IsNullOrEmpty(input.F_Files))
|
|
|
3726
|
+ return Error("请上传抽检单");
|
|
|
3727
|
+ if (string.IsNullOrEmpty(input.F_CJ_Time.ToString()))
|
|
|
3728
|
+ return Error("请选择抽检时间");
|
|
|
3729
|
+ }
|
|
3699
|
3730
|
|
|
3700
|
|
- var model = new Model.T_Wo_WorkOrder();
|
|
|
3731
|
+ var model = new Model.T_Wo_WorkOrder();
|
|
3701
|
3732
|
#region 保存客户基本信息
|
|
3702
|
3733
|
Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
|
|
3703
|
3734
|
model = inputtoobj(model, input, 2);
|
|
|
@@ -3782,7 +3813,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3782
|
3813
|
}
|
|
3783
|
3814
|
if (nextda != 0)
|
|
3784
|
3815
|
{
|
|
3785
|
|
- var res = AssignWO(ua, modlelist, input, opt, "", nextda, 0, 0, 0);
|
|
|
3816
|
+ var res = AssignWO(ua, modlelist, input, opt, "", nextda, 0, 0, 0,0,0,0,"",1);
|
|
3786
|
3817
|
if (res)
|
|
3787
|
3818
|
return Success("添加成功");
|
|
3788
|
3819
|
else
|
|
|
@@ -3957,6 +3988,14 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3957
|
3988
|
return Error("请输入客户姓名!");
|
|
3958
|
3989
|
if (string.IsNullOrEmpty(input.F_CusPhone))
|
|
3959
|
3990
|
return Error("请输入客户电话!");
|
|
|
3991
|
+ if (input.F_Type == 2)
|
|
|
3992
|
+ {
|
|
|
3993
|
+ if (string.IsNullOrEmpty(input.F_SalesBase))
|
|
|
3994
|
+ return Error("请输入基地!");
|
|
|
3995
|
+ if (string.IsNullOrEmpty(input.F_QuestionType))
|
|
|
3996
|
+ return Error("请选择问题类别!");
|
|
|
3997
|
+ }
|
|
|
3998
|
+
|
|
3960
|
3999
|
if (!string.IsNullOrEmpty(input.F_BatchNumber) && !vaBatchNumber(input.F_BatchNumber.Trim()))
|
|
3961
|
4000
|
{
|
|
3962
|
4001
|
return Error("请输入正确的生产批次号!");
|
|
|
@@ -4009,7 +4048,18 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4009
|
4048
|
{
|
|
4010
|
4049
|
return Error("此工单已处理不能修改!");
|
|
4011
|
4050
|
}
|
|
4012
|
|
-
|
|
|
4051
|
+ if (!string.IsNullOrEmpty(input.F_CustomerID))
|
|
|
4052
|
+ {
|
|
|
4053
|
+ var Customer = cusbll.GetModel(input.F_CustomerID.Trim());
|
|
|
4054
|
+ if (Customer == null)
|
|
|
4055
|
+ return Error("无此客户编码!");
|
|
|
4056
|
+ }
|
|
|
4057
|
+ if (!string.IsNullOrWhiteSpace(input.F_MaterialID))
|
|
|
4058
|
+ {
|
|
|
4059
|
+ var Customer = mmBLL.GetModel(input.F_MaterialID.Trim());
|
|
|
4060
|
+ if (Customer == null)
|
|
|
4061
|
+ return Error("无此物料编码!");
|
|
|
4062
|
+ }
|
|
4013
|
4063
|
#region 保存客户基本信息
|
|
4014
|
4064
|
model = inputtoobj(model, input,1);
|
|
4015
|
4065
|
#endregion
|
|
|
@@ -4089,7 +4139,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4089
|
4139
|
}
|
|
4090
|
4140
|
if (nextda != 0)
|
|
4091
|
4141
|
{
|
|
4092
|
|
- var res = AssignWO(ua, model, input, opt, "", nextda, 0, model.F_limit, 0);
|
|
|
4142
|
+ var res = AssignWO(ua, model, input, opt, "", nextda, 0, model.F_limit, 0,0,0,0,"",1);
|
|
4093
|
4143
|
if (res)
|
|
4094
|
4144
|
return Success("保存成功");
|
|
4095
|
4145
|
else
|
|
|
@@ -4219,7 +4269,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4219
|
4269
|
model.F_AddressFull = cuModel.F_AddressFull;
|
|
4220
|
4270
|
model.F_Brands = cuModel.F_Brands;
|
|
4221
|
4271
|
model.F_Channel = cuModel.F_Channel;
|
|
4222
|
|
- model.F_Channel = cuModel.F_CompanyName;
|
|
|
4272
|
+ model.F_CompanyName = cuModel.F_CompanyName;
|
|
4223
|
4273
|
model.F_IsRunXLX = cuModel.F_IsRunXLX;
|
|
4224
|
4274
|
model.F_AnnualSales = cuModel.F_AnnualSales;
|
|
4225
|
4275
|
model.F_Formula = cuModel.F_Formula;
|
|
|
@@ -4771,9 +4821,20 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4771
|
4821
|
}
|
|
4772
|
4822
|
return true;
|
|
4773
|
4823
|
}
|
|
4774
|
|
-
|
|
4775
|
4824
|
|
|
4776
|
|
-
|
|
|
4825
|
+ private bool IsCustomerBaseNew(WorkOrderNewInput input)
|
|
|
4826
|
+ {
|
|
|
4827
|
+ bool n = false;
|
|
|
4828
|
+ if (!string.IsNullOrEmpty(input.F_CustomerID) || !string.IsNullOrEmpty(input.F_CompanyName)
|
|
|
4829
|
+ || !string.IsNullOrEmpty(input.F_AreaName) || !string.IsNullOrEmpty(input.F_BranchName)
|
|
|
4830
|
+ || !string.IsNullOrEmpty(input.F_Salesman) || !string.IsNullOrEmpty(input.F_SalesPhone)
|
|
|
4831
|
+ || !string.IsNullOrEmpty(input.F_Brands))
|
|
|
4832
|
+ {
|
|
|
4833
|
+ n = true;
|
|
|
4834
|
+ }
|
|
|
4835
|
+ return n;
|
|
|
4836
|
+ }
|
|
|
4837
|
+
|
|
4777
|
4838
|
/// <summary>
|
|
4778
|
4839
|
/// 根据传入的对象和input的内容返回对象(添加修改使用)
|
|
4779
|
4840
|
/// </summary>
|
|
|
@@ -4815,8 +4876,6 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4815
|
4876
|
Customer.F_Salesman = input.F_Salesman;
|
|
4816
|
4877
|
if (!string.IsNullOrEmpty(input.F_SalesPhone))
|
|
4817
|
4878
|
Customer.F_SalesPhone = input.F_SalesPhone;
|
|
4818
|
|
-
|
|
4819
|
|
-
|
|
4820
|
4879
|
if (!string.IsNullOrEmpty(input.F_Brands))
|
|
4821
|
4880
|
Customer.F_SalesPhone = input.F_Brands;
|
|
4822
|
4881
|
if (!string.IsNullOrEmpty(input.F_AreaName))
|
|
|
@@ -4846,10 +4905,40 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4846
|
4905
|
}
|
|
4847
|
4906
|
Customer.F_BranchID = pdModel.F_DeptId.ToString();
|
|
4848
|
4907
|
}
|
|
4849
|
|
-
|
|
4850
|
|
- cusbll.Update(Customer);
|
|
|
4908
|
+ if (!string.IsNullOrEmpty(input.F_CompanyName))
|
|
|
4909
|
+ Customer.F_CompanyName = input.F_CompanyName;
|
|
|
4910
|
+ cusbll.Update(Customer);
|
|
|
4911
|
+ }
|
|
|
4912
|
+ else
|
|
|
4913
|
+ {
|
|
|
4914
|
+ if (IsCustomerBaseNew(input))
|
|
|
4915
|
+ {
|
|
|
4916
|
+
|
|
|
4917
|
+ if (string.IsNullOrEmpty(input.F_CustomerID ))
|
|
|
4918
|
+ {
|
|
|
4919
|
+ int i = 0;
|
|
|
4920
|
+ while (true)
|
|
|
4921
|
+ {
|
|
|
4922
|
+ if (!getunique(0, GetCusCode(i)))
|
|
|
4923
|
+ {
|
|
|
4924
|
+ input.F_CustomerID = GetCusCode(i);
|
|
|
4925
|
+ break;
|
|
|
4926
|
+ }
|
|
|
4927
|
+ else
|
|
|
4928
|
+ {
|
|
|
4929
|
+ i++;
|
|
|
4930
|
+ }
|
|
|
4931
|
+ }
|
|
|
4932
|
+ }
|
|
|
4933
|
+ var CustomerBaseNewmodel = new Model.T_Cus_CustomerBaseNew();
|
|
|
4934
|
+ CustomerBaseNewmodel.F_CustomerCode = input.F_CustomerID;
|
|
|
4935
|
+ CustomerBaseNewmodel.F_CreateBy = usercode;
|
|
|
4936
|
+ CustomerBaseNewmodel.F_CreateOn = DateTime.Now;
|
|
|
4937
|
+ CustomerBaseNewmodel.F_IsDelete = 0;
|
|
|
4938
|
+
|
|
|
4939
|
+ cusbll .Add(inputtooCustomer(CustomerBaseNewmodel, input));
|
|
|
4940
|
+ }
|
|
4851
|
4941
|
}
|
|
4852
|
|
-
|
|
4853
|
4942
|
}
|
|
4854
|
4943
|
else
|
|
4855
|
4944
|
{
|
|
|
@@ -4862,9 +4951,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4862
|
4951
|
Customer.F_SalesPhone = input.F_SalesPhone;
|
|
4863
|
4952
|
if (!string.IsNullOrEmpty(input.F_Brands))
|
|
4864
|
4953
|
Customer.F_Brands = input.F_Brands;
|
|
|
4954
|
+ if (!string.IsNullOrEmpty(input.F_CompanyName))
|
|
|
4955
|
+ Customer.F_CompanyName = input.F_CompanyName.Trim();
|
|
4865
|
4956
|
if (!string.IsNullOrEmpty(input.F_AreaName))
|
|
4866
|
4957
|
{
|
|
4867
|
|
- Model.T_Sys_Department pdModel = new T_Sys_Department();
|
|
|
4958
|
+ Model.T_Sys_Department pdModel = new Model.T_Sys_Department();
|
|
4868
|
4959
|
try
|
|
4869
|
4960
|
{
|
|
4870
|
4961
|
pdModel = departmentBLL.GetModel(int.Parse(input.F_AreaName));
|
|
|
@@ -4879,7 +4970,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4879
|
4970
|
if (!string.IsNullOrEmpty(input.F_BranchName))
|
|
4880
|
4971
|
{
|
|
4881
|
4972
|
{
|
|
4882
|
|
- Model.T_Sys_Department pdModel = new T_Sys_Department();
|
|
|
4973
|
+ Model.T_Sys_Department pdModel = new Model . T_Sys_Department();
|
|
4883
|
4974
|
try
|
|
4884
|
4975
|
{
|
|
4885
|
4976
|
pdModel = departmentBLL.GetModel(int.Parse(input.F_BranchName));
|
|
|
@@ -4891,8 +4982,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4891
|
4982
|
Customer.F_BranchID = pdModel.F_DeptId.ToString();
|
|
4892
|
4983
|
}
|
|
4893
|
4984
|
}
|
|
4894
|
|
-
|
|
4895
|
|
- cusbll.Update(Customer);
|
|
|
4985
|
+ if (!string.IsNullOrEmpty(input.F_CompanyName))
|
|
|
4986
|
+ Customer.F_CompanyName = input.F_CompanyName;
|
|
|
4987
|
+ cusbll.Update(Customer);
|
|
4896
|
4988
|
}
|
|
4897
|
4989
|
}
|
|
4898
|
4990
|
}
|
|
|
@@ -4911,7 +5003,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4911
|
5003
|
model.F_Description = input.F_Description;//问题描述
|
|
4912
|
5004
|
model.F_ZX_Area = input.F_ZX_Area;// 大区
|
|
4913
|
5005
|
model.F_ZX_Branch = input.F_ZX_Branch;//分公司
|
|
4914
|
|
- model.F_Files = model.F_Files;//附件上传ids
|
|
|
5006
|
+
|
|
|
5007
|
+
|
|
4915
|
5008
|
model.F_Brand = input.F_WorkerBrand;//工单品牌
|
|
4916
|
5009
|
model.F_DealType = model.F_DealType;//处理方式:当即办理、电话转接、网络转办(点选)
|
|
4917
|
5010
|
#endregion
|
|
|
@@ -4931,7 +5024,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4931
|
5024
|
#region 咨询类
|
|
4932
|
5025
|
// model.F_ZX_ProName = input.F_ZX_ProName;//咨询-产品名称:三聚氰胺、甲醇、液氨、二甲醚、糠醇、其他
|
|
4933
|
5026
|
model.F_ZX_Quantity = input.F_ZX_Quantity;// 咨询-问题数量(吨)
|
|
4934
|
|
-
|
|
|
5027
|
+ if (!string.IsNullOrEmpty(input.F_Files))
|
|
|
5028
|
+ model.F_Files = input.F_Files;//附件上传ids
|
|
|
5029
|
+ else
|
|
|
5030
|
+ model.F_Files = model.F_Files;//附件上传ids
|
|
4935
|
5031
|
#endregion
|
|
4936
|
5032
|
#region 抽检类
|
|
4937
|
5033
|
model.F_CJ_Time = input.F_CJ_Time;// 抽检-抽检时间
|
|
|
@@ -4952,7 +5048,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4952
|
5048
|
model.F_SC_QualityMonth = new WorkOrderController().GetProTime(input.F_BatchNumber, DateTime.Now).ToString();
|
|
4953
|
5049
|
}
|
|
4954
|
5050
|
}
|
|
4955
|
|
-
|
|
|
5051
|
+
|
|
4956
|
5052
|
if (type ==1)
|
|
4957
|
5053
|
{
|
|
4958
|
5054
|
model.F_State = model.F_State;//工单状态
|
|
|
@@ -4960,6 +5056,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4960
|
5056
|
model.F_CreateBy = model.F_CreateBy;//添加人
|
|
4961
|
5057
|
model.F_UpdateBy = usercode;//修改人工号
|
|
4962
|
5058
|
model.F_UpdateOn = DateTime .Now ;//修改人工号
|
|
|
5059
|
+
|
|
4963
|
5060
|
if (input.F_UpdateCount!=null )
|
|
4964
|
5061
|
{
|
|
4965
|
5062
|
model.F_UpdateCount = model.F_UpdateCount + 1;//修改次数
|
|
|
@@ -5082,21 +5179,38 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
5082
|
5179
|
return Error("请输入客户姓名!");
|
|
5083
|
5180
|
if (string.IsNullOrEmpty(input.F_CusPhone))
|
|
5084
|
5181
|
return Error("请输入客户电话!");
|
|
|
5182
|
+ if (input.F_Type == 2)
|
|
|
5183
|
+ {
|
|
|
5184
|
+ if (string.IsNullOrEmpty(input.F_SalesBase))
|
|
|
5185
|
+ return Error("请输入基地!");
|
|
|
5186
|
+ if (string.IsNullOrEmpty(input.F_QuestionType))
|
|
|
5187
|
+ return Error("请选择问题类别!");
|
|
|
5188
|
+ }
|
|
|
5189
|
+
|
|
5085
|
5190
|
if (!string.IsNullOrEmpty(input.F_CustomerID) && !valcode(input.F_CustomerID.ToString(), 10))
|
|
5086
|
5191
|
return Error("客户编号为10为纯数字!");
|
|
5087
|
5192
|
|
|
5088
|
5193
|
if (!string.IsNullOrEmpty(input.F_MaterialID) && !valcode(input.F_MaterialID.ToString(), 11))
|
|
5089
|
5194
|
return Error("物料编码为11为纯数字!");
|
|
5090
|
|
- //if (input.F_Type == 2 || input.F_Type == 3)
|
|
5091
|
|
- //{
|
|
5092
|
|
- // if (string.IsNullOrEmpty(input.F_CustomerID))
|
|
5093
|
|
- // {
|
|
5094
|
|
- // if (string.IsNullOrEmpty(input.F_LegalPhone))
|
|
5095
|
|
- // return Error("请输入客户电话");
|
|
5096
|
|
- // if (getunphone(0, input.F_LegalPhone))
|
|
5097
|
|
- // return Error("已存在该客户请勿重复添加");
|
|
5098
|
|
- // }
|
|
5099
|
|
- //}
|
|
|
5195
|
+ if (!string.IsNullOrEmpty(input.F_CustomerID))
|
|
|
5196
|
+ {
|
|
|
5197
|
+ var Customer = cusbll .GetModel(input.F_CustomerID.Trim());
|
|
|
5198
|
+ if (Customer == null)
|
|
|
5199
|
+ return Error("无此客户编码!");
|
|
|
5200
|
+ }
|
|
|
5201
|
+ if (!string.IsNullOrWhiteSpace(input.F_MaterialID))
|
|
|
5202
|
+ {
|
|
|
5203
|
+ var Customer = mmBLL.GetModel(input.F_MaterialID.Trim());
|
|
|
5204
|
+ if (Customer == null)
|
|
|
5205
|
+ return Error("无此物料编码!");
|
|
|
5206
|
+ }
|
|
|
5207
|
+ if (input.F_Type == 3)
|
|
|
5208
|
+ {
|
|
|
5209
|
+ if (string.IsNullOrEmpty(input.F_Files))
|
|
|
5210
|
+ return Error("请上传抽检单");
|
|
|
5211
|
+ if (string.IsNullOrEmpty(input.F_CJ_Time.ToString()))
|
|
|
5212
|
+ return Error("请选择抽检时间");
|
|
|
5213
|
+ }
|
|
5100
|
5214
|
#endregion
|
|
5101
|
5215
|
var model = new Model.T_Wo_WorkOrder();
|
|
5102
|
5216
|
#region 保存客户基本信息
|
|
|
@@ -5306,10 +5420,40 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
5306
|
5420
|
{
|
|
5307
|
5421
|
deptid = touser.F_DeptId;
|
|
5308
|
5422
|
}
|
|
5309
|
|
-
|
|
|
5423
|
+ string smscont = "";
|
|
|
5424
|
+
|
|
|
5425
|
+
|
|
5310
|
5426
|
var itemid = AddLog((int)model.F_ID, 3, content, (int)EnumItemType.deal, 4, creatuser, deptid, nowUser, model.F_limit, sms);
|
|
5311
|
5427
|
if (itemid > 0)
|
|
5312
|
5428
|
{
|
|
|
5429
|
+ if (model.F_Type == "1")
|
|
|
5430
|
+ {
|
|
|
5431
|
+ smscont = "咨询";
|
|
|
5432
|
+ }
|
|
|
5433
|
+ else if (model.F_Type == "2")
|
|
|
5434
|
+ {
|
|
|
5435
|
+ smscont = "投诉";
|
|
|
5436
|
+ }
|
|
|
5437
|
+ else if (model.F_Type == "3")
|
|
|
5438
|
+ {
|
|
|
5439
|
+ smscont = "抽检";
|
|
|
5440
|
+ }
|
|
|
5441
|
+ else
|
|
|
5442
|
+ {
|
|
|
5443
|
+ smscont = "建议";
|
|
|
5444
|
+ }
|
|
|
5445
|
+ string[] mag = { smscont };
|
|
|
5446
|
+ string smsmsg = "您好,您有一条新的" + smscont + "工单,请及时接单处理!";
|
|
|
5447
|
+ if (touser!=null )
|
|
|
5448
|
+ {
|
|
|
5449
|
+ if (!string .IsNullOrEmpty (touser.F_Mobile) )
|
|
|
5450
|
+ {
|
|
|
5451
|
+
|
|
|
5452
|
+ SmsSingleSenderResult result = new SMSController().SMSSingleshot(445305, mag, touser.F_Mobile.Trim());
|
|
|
5453
|
+ bool n = new SMSController().AddSmS(touser.F_Mobile.Trim(), smsmsg, nowUser.F_UserId);
|
|
|
5454
|
+ }
|
|
|
5455
|
+ }
|
|
|
5456
|
+
|
|
5313
|
5457
|
#region 处理工单
|
|
5314
|
5458
|
model.F_State = 2;
|
|
5315
|
5459
|
workOrder.Update(model);
|
|
|
@@ -5363,26 +5507,45 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
5363
|
5507
|
}
|
|
5364
|
5508
|
}
|
|
5365
|
5509
|
}
|
|
|
5510
|
+
|
|
5366
|
5511
|
if (string.IsNullOrEmpty(input.F_CusName))
|
|
5367
|
5512
|
return Error("请输入客户姓名!");
|
|
5368
|
5513
|
if (string.IsNullOrEmpty(input.F_CusPhone))
|
|
5369
|
5514
|
return Error("请输入客户电话!");
|
|
|
5515
|
+ if (input.F_Type == 2)
|
|
|
5516
|
+ {
|
|
|
5517
|
+ if (string.IsNullOrEmpty(input.F_SalesBase))
|
|
|
5518
|
+ return Error("请输入基地!");
|
|
|
5519
|
+ if (string.IsNullOrEmpty(input.F_QuestionType))
|
|
|
5520
|
+ return Error("请选择问题类别!");
|
|
|
5521
|
+ }
|
|
|
5522
|
+
|
|
5370
|
5523
|
#endregion
|
|
5371
|
5524
|
if (!string.IsNullOrEmpty(input.F_CustomerID) && !valcode(input.F_CustomerID.ToString(), 10))
|
|
5372
|
5525
|
return Error("客户编号为10为纯数字!");
|
|
5373
|
5526
|
|
|
5374
|
5527
|
if (!string.IsNullOrEmpty(input.F_MaterialID) && !valcode(input.F_MaterialID.ToString(), 11))
|
|
5375
|
5528
|
return Error("物料编码为11为纯数字!");
|
|
5376
|
|
- //if (input.F_Type == 2 || input.F_Type == 3)
|
|
5377
|
|
- //{
|
|
5378
|
|
- // if (string.IsNullOrEmpty(input.F_CustomerID))
|
|
5379
|
|
- // {
|
|
5380
|
|
- // if (string.IsNullOrEmpty(input.F_LegalPhone))
|
|
5381
|
|
- // return Error("请输入客户电话");
|
|
5382
|
|
- // if (getunphone(0, input.F_LegalPhone))
|
|
5383
|
|
- // return Error("已存在该客户请勿重复添加");
|
|
5384
|
|
- // }
|
|
5385
|
|
- //}
|
|
|
5529
|
+ if (!string.IsNullOrEmpty(input.F_CustomerID))
|
|
|
5530
|
+ {
|
|
|
5531
|
+ var Customer = cusbll.GetModel(input.F_CustomerID.Trim());
|
|
|
5532
|
+ if (Customer == null)
|
|
|
5533
|
+ return Error("无此客户编码!");
|
|
|
5534
|
+ }
|
|
|
5535
|
+ if (!string.IsNullOrWhiteSpace(input.F_MaterialID))
|
|
|
5536
|
+ {
|
|
|
5537
|
+ var Customer = mmBLL.GetModel(input.F_MaterialID.Trim());
|
|
|
5538
|
+ if (Customer == null)
|
|
|
5539
|
+ return Error("无此物料编码!");
|
|
|
5540
|
+ }
|
|
|
5541
|
+ if (input.F_Type == 3)
|
|
|
5542
|
+ {
|
|
|
5543
|
+ if (string.IsNullOrEmpty(input.F_Files))
|
|
|
5544
|
+ return Error("请上传抽检单");
|
|
|
5545
|
+ if (string.IsNullOrEmpty(input.F_CJ_Time.ToString()))
|
|
|
5546
|
+ return Error("请选择抽检时间");
|
|
|
5547
|
+ }
|
|
|
5548
|
+
|
|
5386
|
5549
|
var model = new Model.T_Wo_WorkOrder();
|
|
5387
|
5550
|
#region 保存客户基本信息
|
|
5388
|
5551
|
model = inputtoobj(model, input, 2);
|
|
|
@@ -5658,6 +5821,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
5658
|
5821
|
int userId = CurrentUser.UserData.F_UserId;
|
|
5659
|
5822
|
if (userId != 0)
|
|
5660
|
5823
|
{
|
|
|
5824
|
+ if (string.IsNullOrEmpty(cont))
|
|
|
5825
|
+ return Error("请输入处理内容");
|
|
5661
|
5826
|
Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
|
|
5662
|
5827
|
WorkOrderNewInput input = new WorkOrderNewInput();
|
|
5663
|
5828
|
if (ua != null)
|
|
|
@@ -6118,6 +6283,34 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
6118
|
6283
|
var itemid = AddLog((int)model.F_ID , wostate, content, (int)EnumItemType.deal, optbut, touser, deptid, nowUser, model .F_limit ,sms );
|
|
6119
|
6284
|
if (itemid > 0)
|
|
6120
|
6285
|
{
|
|
|
6286
|
+ string smscont = "";
|
|
|
6287
|
+ if (model.F_Type == "1")
|
|
|
6288
|
+ {
|
|
|
6289
|
+ smscont = "咨询";
|
|
|
6290
|
+ }
|
|
|
6291
|
+ else if (model.F_Type == "2")
|
|
|
6292
|
+ {
|
|
|
6293
|
+ smscont = "投诉";
|
|
|
6294
|
+ }
|
|
|
6295
|
+ else if (model.F_Type == "3")
|
|
|
6296
|
+ {
|
|
|
6297
|
+ smscont = "抽检";
|
|
|
6298
|
+ }
|
|
|
6299
|
+ else
|
|
|
6300
|
+ {
|
|
|
6301
|
+ smscont = "建议";
|
|
|
6302
|
+ }
|
|
|
6303
|
+ string[] mag = { smscont };
|
|
|
6304
|
+ string smsmsg = "您好,您有一条新的" + smscont + "工单,请及时接单处理!";
|
|
|
6305
|
+ var tousermodel = new BLL.T_Sys_UserAccount().GetModel(touser);
|
|
|
6306
|
+ if (tousermodel != null)
|
|
|
6307
|
+ {
|
|
|
6308
|
+ if (!string .IsNullOrEmpty (tousermodel.F_Mobile))
|
|
|
6309
|
+ {
|
|
|
6310
|
+ SmsSingleSenderResult result = new SMSController().SMSSingleshot(445305, mag, tousermodel.F_Mobile.Trim());
|
|
|
6311
|
+ bool n = new SMSController().AddSmS(tousermodel.F_Mobile.Trim(), smsmsg, nowUser.F_UserId);
|
|
|
6312
|
+ }
|
|
|
6313
|
+ }
|
|
6121
|
6314
|
#region 处理工单
|
|
6122
|
6315
|
if (deptid==2)
|
|
6123
|
6316
|
{
|
|
|
@@ -6539,7 +6732,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
6539
|
6732
|
/// <summary>
|
|
6540
|
6733
|
/// 转派工单
|
|
6541
|
6734
|
/// </summary>
|
|
6542
|
|
- public bool AssignWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, string F_Files, int clbm = 0, int clid = 0, int overtime = 0, int sms = 0, int isApprovalp = 0, int hclbm = 0, int hclid = 0, string creat = "")
|
|
|
6735
|
+ public bool AssignWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, string F_Files, int clbm = 0, int clid = 0, int overtime = 0, int sms = 0, int isApprovalp = 0, int hclbm = 0, int hclid = 0, string creat = "",int isbl=0)
|
|
6543
|
6736
|
{
|
|
6544
|
6737
|
string smscont = "";
|
|
6545
|
6738
|
if (model.F_Type == "1")
|
|
|
@@ -6576,7 +6769,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
6576
|
6769
|
tousername = clus.F_UserName + "(" + clus.F_WorkNumber + ")";
|
|
6577
|
6770
|
if (sms != 0)
|
|
6578
|
6771
|
{
|
|
6579
|
|
- if (!string .IsNullOrEmpty (clus.F_Mobile.Trim ()))
|
|
|
6772
|
+ if (!string .IsNullOrEmpty (clus.F_Mobile))
|
|
6580
|
6773
|
{
|
|
6581
|
6774
|
|
|
6582
|
6775
|
SmsSingleSenderResult result = new SMSController().SMSSingleshot(445305, mag, clus.F_Mobile.Trim());
|
|
|
@@ -6591,7 +6784,12 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
6591
|
6784
|
{
|
|
6592
|
6785
|
string users = string.Empty;
|
|
6593
|
6786
|
deptid = clbm;
|
|
6594
|
|
- var list = sysUserAccountBll.GetModelList(" F_DeptId='" + clbm + "'");
|
|
|
6787
|
+ string sql = "";
|
|
|
6788
|
+ if (isbl > 0)
|
|
|
6789
|
+ {
|
|
|
6790
|
+ sql = " and F_RoleId=59";
|
|
|
6791
|
+ }
|
|
|
6792
|
+ var list = sysUserAccountBll.GetModelList(" F_DeptId='" + clbm + "'"+ sql);
|
|
6595
|
6793
|
foreach (var l in list)
|
|
6596
|
6794
|
{
|
|
6597
|
6795
|
if (string.IsNullOrEmpty(users))
|