|
|
@@ -98,39 +98,47 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
98
|
98
|
#endregion
|
|
99
|
99
|
#region 部门角色
|
|
100
|
100
|
//部门角色(-1管理员,1接待部,2案场经理、项目负责人,3销售部总经理、物业部总经理、工程总经理、设计总经理,4区域客服,5业主(客户档案))
|
|
101
|
|
- if (user.F_RoleId == 17 || user.F_RoleId == 57)
|
|
|
101
|
+ if (user.F_RoleId == 17 )
|
|
102
|
102
|
{
|
|
103
|
103
|
//-1管理员
|
|
104
|
104
|
UserType = -1;
|
|
105
|
105
|
}
|
|
106
|
106
|
else
|
|
107
|
107
|
{
|
|
108
|
|
- UserType = 0;
|
|
|
108
|
+ if (user.F_RoleId == 58|| user.F_RoleId == 60 || user.F_RoleId == 62)
|
|
|
109
|
+ {
|
|
|
110
|
+ UserType = 0;
|
|
|
111
|
+ }
|
|
|
112
|
+ else
|
|
|
113
|
+ {
|
|
|
114
|
+ UserType = 1;
|
|
|
115
|
+ }
|
|
|
116
|
+
|
|
109
|
117
|
#region
|
|
110
|
118
|
////部门操作权限:1接待部,2办理人员,3区域客服,4监管
|
|
111
|
|
- //if (modelDep.F_Type == 1)
|
|
|
119
|
+ //IF (MODELDEP.F_TYPE == 1)
|
|
112
|
120
|
//{
|
|
113
|
121
|
// //1--接待部
|
|
114
|
|
- // UserType = 1;
|
|
|
122
|
+ // USERTYPE = 1;
|
|
115
|
123
|
//}
|
|
116
|
|
- //else if (modelDep.F_Type == 2)
|
|
|
124
|
+ //ELSE IF (MODELDEP.F_TYPE == 2)
|
|
117
|
125
|
//{
|
|
118
|
126
|
// //2--办理人员
|
|
119
|
|
- // UserType = 2;
|
|
|
127
|
+ // USERTYPE = 2;
|
|
120
|
128
|
//}
|
|
121
|
|
- //else if (modelDep.F_Type == 3)
|
|
|
129
|
+ //ELSE IF (MODELDEP.F_TYPE == 3)
|
|
122
|
130
|
//{
|
|
123
|
131
|
// //3--区域客服
|
|
124
|
|
- // UserType = 3;
|
|
|
132
|
+ // USERTYPE = 3;
|
|
125
|
133
|
//}
|
|
126
|
|
- //else if (modelDep.F_Type == 4)
|
|
|
134
|
+ //ELSE IF (MODELDEP.F_TYPE == 4)
|
|
127
|
135
|
//{
|
|
128
|
136
|
// //4--监管
|
|
129
|
|
- // UserType = 4;
|
|
|
137
|
+ // USERTYPE = 4;
|
|
130
|
138
|
//}
|
|
131
|
|
- //else
|
|
|
139
|
+ //ELSE
|
|
132
|
140
|
//{
|
|
133
|
|
- // UserType = 0;
|
|
|
141
|
+ // USERTYPE = 0;
|
|
134
|
142
|
//}
|
|
135
|
143
|
#endregion
|
|
136
|
144
|
}
|
|
|
@@ -143,7 +151,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
143
|
151
|
rolecode=rolecode,
|
|
144
|
152
|
};
|
|
145
|
153
|
|
|
146
|
|
- if (userAccountBLL.Update(user))
|
|
|
154
|
+ if (userAccountBLL.Update(user))
|
|
147
|
155
|
return Success("绑定成功", obj);
|
|
148
|
156
|
else
|
|
149
|
157
|
return Error("绑定失败");
|
|
|
@@ -434,6 +442,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
434
|
442
|
/// <summary>
|
|
435
|
443
|
///综合查询列表
|
|
436
|
444
|
/// </summary>
|
|
|
445
|
+ [WechatActionFilter]
|
|
437
|
446
|
public ActionResult GetList(string OpenId, string code, string cusname, string keywords, string cusphone, string companyname, string province, string city,
|
|
438
|
447
|
string country, string township, string category, string salebase, string touser, int source = 0, int state = -1,int status=-1, int type = 0, int pageindex = 1, int pagesize = 10)
|
|
439
|
448
|
{
|
|
|
@@ -448,8 +457,6 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
448
|
457
|
#region 筛选条件
|
|
449
|
458
|
if (type > 0 && type < 5)//工单类型
|
|
450
|
459
|
sql += $" and F_Type=" + type;
|
|
451
|
|
- if (state >= 0)//工单状态
|
|
452
|
|
- sql += $" and F_State=" + state;
|
|
453
|
460
|
if (source > 0)//工单来源
|
|
454
|
461
|
sql += $" and F_Source=" + source;
|
|
455
|
462
|
if (!string.IsNullOrWhiteSpace(touser))//参与人
|
|
|
@@ -478,16 +485,23 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
478
|
485
|
sql += $" and F_IncidentCountry like '%" + country.Trim() + "%'";
|
|
479
|
486
|
if (!string.IsNullOrWhiteSpace(province))//乡
|
|
480
|
487
|
sql += $" and F_IncidentTownship like '%" + township.Trim() + "%'";
|
|
481
|
|
- sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
|
|
|
488
|
+ // sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
|
|
482
|
489
|
Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
|
|
483
|
|
- switch (status)
|
|
|
490
|
+ switch (state)
|
|
484
|
491
|
{
|
|
485
|
492
|
case 0://待审批
|
|
486
|
493
|
string uwhere = "";
|
|
487
|
494
|
|
|
488
|
495
|
if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL")
|
|
489
|
496
|
{
|
|
490
|
|
- sql += $" and T_Wo_WorkOrder.F_ID in ( " + GetApprovalOrderID(ua,OpenId, ro.F_RoleCode) + ") "; ;
|
|
|
497
|
+ if (GetApprovalOrderID(ua, OpenId, ro.F_RoleCode)!="")
|
|
|
498
|
+ {
|
|
|
499
|
+ sql += $" and T_Wo_WorkOrder.F_ID in ( " + GetApprovalOrderID(ua, OpenId, ro.F_RoleCode) + ") "; ;
|
|
|
500
|
+ }
|
|
|
501
|
+ else
|
|
|
502
|
+ {
|
|
|
503
|
+ return Success("暂无工单"); ;
|
|
|
504
|
+ }
|
|
491
|
505
|
}
|
|
492
|
506
|
else
|
|
493
|
507
|
{
|
|
|
@@ -530,7 +544,6 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
530
|
544
|
}
|
|
531
|
545
|
else
|
|
532
|
546
|
{
|
|
533
|
|
-
|
|
534
|
547
|
return Success("暂无工单"); ;
|
|
535
|
548
|
}
|
|
536
|
549
|
break;
|
|
|
@@ -541,7 +554,15 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
541
|
554
|
sql += " and F_State =" + (int)EnumWorkOrderState.finish + " and F_DealBy = '" + ua.F_UserCode + "' ";
|
|
542
|
555
|
break;
|
|
543
|
556
|
case 3://我参与的
|
|
544
|
|
- sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
|
|
|
557
|
+ if (GetCYWorkOrderID(ua.F_UserCode)!="")
|
|
|
558
|
+ {
|
|
|
559
|
+ sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
|
|
|
560
|
+ }
|
|
|
561
|
+ else
|
|
|
562
|
+ {
|
|
|
563
|
+ return Error("暂无工单");
|
|
|
564
|
+ }
|
|
|
565
|
+
|
|
545
|
566
|
break;
|
|
546
|
567
|
case 6://待回访
|
|
547
|
568
|
if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX")
|
|
|
@@ -557,7 +578,14 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
557
|
578
|
case 7://已回访
|
|
558
|
579
|
if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX")
|
|
559
|
580
|
{
|
|
560
|
|
- sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
|
|
|
581
|
+ if (GetCYWorkOrderID(ua.F_UserCode)!="")
|
|
|
582
|
+ {
|
|
|
583
|
+ sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
|
|
|
584
|
+ }
|
|
|
585
|
+ else
|
|
|
586
|
+ {
|
|
|
587
|
+ return Success("暂无工单"); ;
|
|
|
588
|
+ }
|
|
561
|
589
|
}
|
|
562
|
590
|
else if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL" || ro.F_RoleCode == "ZG")
|
|
563
|
591
|
{
|
|
|
@@ -621,6 +649,17 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
621
|
649
|
}
|
|
622
|
650
|
sql += $" and F_State=" + (int)EnumWorkOrderState.finish + " and F_IsVisit = '" + "0" + "' "; ;
|
|
623
|
651
|
break;
|
|
|
652
|
+ case 9://待接单
|
|
|
653
|
+ if (GetDJDWorkOrderID(ua.F_UserCode) != "")
|
|
|
654
|
+ {
|
|
|
655
|
+ sql += $" and F_State=" + (int)EnumWorkOrderState.assign + $" and T_Wo_WorkOrder.F_ID in ( " + GetDJDWorkOrderID(ua.F_UserCode) + ") "; ;
|
|
|
656
|
+ }
|
|
|
657
|
+ else
|
|
|
658
|
+ {
|
|
|
659
|
+
|
|
|
660
|
+ return Success("暂无工单"); ;
|
|
|
661
|
+ }
|
|
|
662
|
+ break;
|
|
624
|
663
|
}
|
|
625
|
664
|
#endregion
|
|
626
|
665
|
int recordCount = 0;
|
|
|
@@ -790,18 +829,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
790
|
829
|
#region 获取接收人
|
|
791
|
830
|
string deptname = "";
|
|
792
|
831
|
string deptmodelsname = "";
|
|
793
|
|
- var user = GetUser(OpenId);
|
|
794
|
|
- var deptmodel = departmentBLL.GetModel(user.F_DeptId);
|
|
795
|
|
- var deptmodels = departmentBLL.GetModel(nowUser.F_DeptId);
|
|
796
|
|
- int wostate=0;
|
|
797
|
|
- if (deptmodel != null)
|
|
798
|
|
- {
|
|
799
|
|
- deptname = deptmodel.F_DeptName + "-";
|
|
800
|
|
- }
|
|
801
|
|
- if (deptmodels != null)
|
|
802
|
|
- {
|
|
803
|
|
- deptmodelsname = deptmodels.F_DeptName + "-";
|
|
804
|
|
- }
|
|
|
832
|
+ int wostate = 0;
|
|
805
|
833
|
var toussers = "";
|
|
806
|
834
|
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();
|
|
807
|
835
|
if (itemlast != null)
|
|
|
@@ -811,6 +839,18 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
811
|
839
|
{
|
|
812
|
840
|
if (GetUser(OpenId) != null)
|
|
813
|
841
|
{
|
|
|
842
|
+ var user = GetUser(OpenId);
|
|
|
843
|
+ var deptmodel = departmentBLL.GetModel(user.F_DeptId);
|
|
|
844
|
+ var deptmodels = departmentBLL.GetModel(nowUser.F_DeptId);
|
|
|
845
|
+ if (deptmodel != null)
|
|
|
846
|
+ {
|
|
|
847
|
+ deptname = deptmodel.F_DeptName + "-";
|
|
|
848
|
+ }
|
|
|
849
|
+ if (deptmodels != null)
|
|
|
850
|
+ {
|
|
|
851
|
+ deptmodelsname = deptmodels.F_DeptName + "-";
|
|
|
852
|
+ }
|
|
|
853
|
+
|
|
814
|
854
|
wostate = 0;
|
|
815
|
855
|
if (AuditState == 0)
|
|
816
|
856
|
{
|
|
|
@@ -939,7 +979,60 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
939
|
979
|
var res = AssignWO(ua, model, Input[0], "大区经理未审批流转市场管理科", 37, 0, 0, 0,0,0,0, time.ToString());
|
|
940
|
980
|
return res;
|
|
941
|
981
|
}
|
|
|
982
|
+ /// <summary>
|
|
|
983
|
+ /// 查询工单详情
|
|
|
984
|
+ /// </summary>
|
|
|
985
|
+ [WechatActionFilter]
|
|
|
986
|
+ public ActionResult GetDetails(string OpenId,int id)
|
|
|
987
|
+ {
|
|
|
988
|
+ if (!string.IsNullOrEmpty(OpenId))
|
|
|
989
|
+ {
|
|
|
990
|
+ var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + OpenId + "'").FirstOrDefault();
|
|
|
991
|
+
|
|
|
992
|
+ string sql = "";
|
|
|
993
|
+ if (id > 0)
|
|
|
994
|
+ {
|
|
|
995
|
+ sql += $" ( F_ID like '%" + id + "%' ) ";
|
|
|
996
|
+ }
|
|
|
997
|
+ else
|
|
|
998
|
+ return Error("请输入正确的id");
|
|
|
999
|
+ var list = new List<Model.T_Wo_WorkOrder>();
|
|
|
1000
|
+ if (!string.IsNullOrWhiteSpace(sql))
|
|
|
1001
|
+ {
|
|
|
1002
|
+ sql += " and F_IsDelete=0";
|
|
|
1003
|
+ list = woBLL .GetModelList(sql);
|
|
|
1004
|
+ }
|
|
|
1005
|
+ var itemlasts = itembll.GetModelList(" F_WoID=" + +id + " ");
|
|
942
|
1006
|
|
|
|
1007
|
+ if (list.Count > 0)
|
|
|
1008
|
+ {
|
|
|
1009
|
+ List<WorkOrderNewInput> Input = modeltooip(list,ua );
|
|
|
1010
|
+ if (Input != null)
|
|
|
1011
|
+ {
|
|
|
1012
|
+ var obj = new
|
|
|
1013
|
+ {
|
|
|
1014
|
+ state = "success",
|
|
|
1015
|
+ message = "成功",
|
|
|
1016
|
+ rows = Input,
|
|
|
1017
|
+ total = itemlasts,
|
|
|
1018
|
+ };
|
|
|
1019
|
+
|
|
|
1020
|
+ return Content(obj.ToJson());
|
|
|
1021
|
+ }
|
|
|
1022
|
+ else
|
|
|
1023
|
+ {
|
|
|
1024
|
+ return Error("没有查询到此工单");
|
|
|
1025
|
+ }
|
|
|
1026
|
+ }
|
|
|
1027
|
+ else
|
|
|
1028
|
+ return Error("没有查询到此工单");
|
|
|
1029
|
+
|
|
|
1030
|
+ }
|
|
|
1031
|
+ else
|
|
|
1032
|
+ {
|
|
|
1033
|
+ return Error("无操作权限!");
|
|
|
1034
|
+ }
|
|
|
1035
|
+ }
|
|
943
|
1036
|
public string GetID(string str,long id)
|
|
944
|
1037
|
{
|
|
945
|
1038
|
if (str != "")
|
|
|
@@ -995,9 +1088,9 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
995
|
1088
|
|
|
996
|
1089
|
string str = string.Empty;
|
|
997
|
1090
|
#region 查询自己名下未审批的工单列表
|
|
998
|
|
- var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType=" + (int)EnumItemOpt.audit + " and ("
|
|
999
|
|
- + "(F_WoState in(" + (int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.reassign + ") and F_NextUser='" + ua.F_UserCode + "') "
|
|
1000
|
|
- + ")" + " ");
|
|
|
1091
|
+ var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType=" + (int)EnumItemOpt.audit + " and "
|
|
|
1092
|
+ + "F_WoState in(" + (int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.reassign + ") and F_NextUser='" + ua.F_UserCode + "' "
|
|
|
1093
|
+ + "" + " ");
|
|
1001
|
1094
|
|
|
1002
|
1095
|
foreach (var it in itemlast)
|
|
1003
|
1096
|
{
|
|
|
@@ -1010,8 +1103,9 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1010
|
1103
|
}
|
|
1011
|
1104
|
else
|
|
1012
|
1105
|
{
|
|
1013
|
|
- GetID(str, it.F_WoID);
|
|
|
1106
|
+ str = GetID(str, it.F_WoID);
|
|
1014
|
1107
|
}
|
|
|
1108
|
+
|
|
1015
|
1109
|
}
|
|
1016
|
1110
|
else
|
|
1017
|
1111
|
{
|
|
|
@@ -1041,16 +1135,16 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1041
|
1135
|
}
|
|
1042
|
1136
|
else
|
|
1043
|
1137
|
{
|
|
1044
|
|
- GetID(str, it.F_WoID);
|
|
|
1138
|
+ str = GetID(str, it.F_WoID);
|
|
1045
|
1139
|
}
|
|
1046
|
1140
|
}
|
|
1047
|
1141
|
}
|
|
1048
|
1142
|
#endregion
|
|
1049
|
1143
|
if (F_RoleCode == "DQJL")
|
|
1050
|
1144
|
{
|
|
1051
|
|
- var itemlasts = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType=" + (int)EnumItemOpt.audit + " and ("
|
|
1052
|
|
- + "(F_WoState in(" + (int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.reassign + ") and F_NextUser in ( " + GetDeptment(ua) + ") "
|
|
1053
|
|
- + ")" + " ");
|
|
|
1145
|
+ var itemlasts = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType=" + (int)EnumItemOpt.audit + " and "
|
|
|
1146
|
+ + "F_WoState in(" + (int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.reassign + ") and F_NextUser in ( " + GetDeptment(ua) + ") "
|
|
|
1147
|
+ + "" + " ");
|
|
1054
|
1148
|
foreach (var it in itemlasts)
|
|
1055
|
1149
|
{
|
|
1056
|
1150
|
float hours = (DateTime.Now - DateTime.Parse(it.F_CreateTime.ToString())).Hours;
|
|
|
@@ -1078,7 +1172,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1078
|
1172
|
AddLog(model.F_ID, model.F_State.Value, deptname + ua.F_UserName + "(" + ua.F_UserCode + ")" + "待审批", (int)EnumItemType.audit, (int)EnumItemOpt.audit, ua.F_UserCode, ua.F_DeptId, ua, 0, 0);
|
|
1079
|
1173
|
if (hours < 48)
|
|
1080
|
1174
|
{
|
|
1081
|
|
- GetID(str, it.F_WoID);
|
|
|
1175
|
+ str = GetID(str, it.F_WoID);
|
|
1082
|
1176
|
}
|
|
1083
|
1177
|
else
|
|
1084
|
1178
|
{
|
|
|
@@ -1148,7 +1242,21 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1148
|
1242
|
}
|
|
1149
|
1243
|
model.F_Salesman = cuModel.F_Salesman;
|
|
1150
|
1244
|
model.F_SalesPhone = cuModel.F_SalesPhone;
|
|
|
1245
|
+ model.F_Legal = cuModel.F_Legal;
|
|
|
1246
|
+ model.F_LegalPhone = cuModel.F_LegalPhone;
|
|
|
1247
|
+ model.F_AddressProvince = cuModel.F_AddressProvince;
|
|
|
1248
|
+ model.F_AddressCity = cuModel.F_AddressCity;
|
|
|
1249
|
+ model.F_AddressCountry = cuModel.F_AddressCountry;
|
|
|
1250
|
+ model.F_AddressTownship = cuModel.F_AddressTownship;
|
|
|
1251
|
+ model.F_AddressFull = cuModel.F_AddressFull;
|
|
1151
|
1252
|
model.F_Brands = cuModel.F_Brands;
|
|
|
1253
|
+ model.F_Channel = cuModel.F_Channel;
|
|
|
1254
|
+ model.F_IsRunXLX = cuModel.F_IsRunXLX;
|
|
|
1255
|
+ model.F_AnnualSales = cuModel.F_AnnualSales;
|
|
|
1256
|
+ model.F_Formula = cuModel.F_Formula;
|
|
|
1257
|
+ model.F_RaiseCrops = cuModel.F_RaiseCrops;
|
|
|
1258
|
+ model.F_PlantingArea = cuModel.F_PlantingArea;
|
|
|
1259
|
+ model.F_FertilizerBrand = cuModel.F_FertilizerBrand;
|
|
1152
|
1260
|
}
|
|
1153
|
1261
|
}
|
|
1154
|
1262
|
if (!valcode(model1[i].F_MaterialID.ToString(), 11))
|
|
|
@@ -1317,18 +1425,31 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1317
|
1425
|
model.F_IsVisit = model1[i].F_IsVisit;//质量管理科-抽检-未备案、已备案
|
|
1318
|
1426
|
model.F_IsAudit = model1[i].F_IsAudit;//是否审核
|
|
1319
|
1427
|
model.F_Highopinions = model1[i].F_Highopinions ;//高层处理意见
|
|
1320
|
|
- if (model1[i].F_AuditState == 0)
|
|
1321
|
|
- {
|
|
1322
|
|
- model.F_AuditState = "同意上报";
|
|
1323
|
|
- }
|
|
1324
|
|
- else if (model1[i].F_AuditState == 1)
|
|
|
1428
|
+ model.F_CreateOn = model1[i].F_CreateOn; ;//添加时间
|
|
|
1429
|
+ model.F_CreateBy = model1[i].F_CreateBy; ;//添加人
|
|
|
1430
|
+ model.F_UpdateBy = model1[i].F_UpdateBy;//修改人工号
|
|
|
1431
|
+ model.F_UpdateOn = model1[i].F_UpdateOn; ;//修改人工号
|
|
|
1432
|
+
|
|
|
1433
|
+ if (model1[i].F_IsAudit==1)
|
|
1325
|
1434
|
{
|
|
1326
|
|
- model.F_AuditState = "驳回修订";
|
|
|
1435
|
+ if (model1[i].F_AuditState == 0)
|
|
|
1436
|
+ {
|
|
|
1437
|
+ model.F_AuditState = "同意上报";
|
|
|
1438
|
+ }
|
|
|
1439
|
+ else if (model1[i].F_AuditState == 1)
|
|
|
1440
|
+ {
|
|
|
1441
|
+ model.F_AuditState = "驳回修订";
|
|
|
1442
|
+ }
|
|
|
1443
|
+ else
|
|
|
1444
|
+ {
|
|
|
1445
|
+ model.F_AuditState = "强制结案";
|
|
|
1446
|
+ }
|
|
1327
|
1447
|
}
|
|
1328
|
|
- else
|
|
|
1448
|
+ else
|
|
1329
|
1449
|
{
|
|
1330
|
|
- model.F_AuditState = "强制结案";
|
|
|
1450
|
+ model.F_AuditState = "";
|
|
1331
|
1451
|
}
|
|
|
1452
|
+
|
|
1332
|
1453
|
model.F_AuditBy = model1[i].F_AuditBy;//审核人
|
|
1333
|
1454
|
model.F_AuditOn = model1[i].F_AuditOn;//审核时间
|
|
1334
|
1455
|
model.F_AuditCont = model1[i].F_AuditCont;//审核内容
|
|
|
@@ -1341,6 +1462,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1341
|
1462
|
model.F_DeptName = deptmodel.F_DeptName;
|
|
1342
|
1463
|
}
|
|
1343
|
1464
|
#endregion
|
|
|
1465
|
+ Input.Add(model);
|
|
1344
|
1466
|
}
|
|
1345
|
1467
|
return Input;
|
|
1346
|
1468
|
}
|
|
|
@@ -1497,6 +1619,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1497
|
1619
|
/// </summary>
|
|
1498
|
1620
|
/// <param name="OpenId"></param>
|
|
1499
|
1621
|
/// <returns></returns>
|
|
|
1622
|
+ [WechatActionFilter]
|
|
1500
|
1623
|
public ActionResult GetDpment(string OpenId)
|
|
1501
|
1624
|
{
|
|
1502
|
1625
|
if (!string.IsNullOrEmpty(OpenId))
|
|
|
@@ -1604,9 +1727,13 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1604
|
1727
|
/// <summary>
|
|
1605
|
1728
|
/// 根据传入的对象和input的内容返回对象(添加修改使用)
|
|
1606
|
1729
|
/// </summary>
|
|
1607
|
|
- private Model.T_Wo_WorkOrder inputtoobj(Model.T_Wo_WorkOrder model, WorkOrderNewInput input, int type)
|
|
|
1730
|
+ private Model.T_Wo_WorkOrder inputtoobj(Model.T_Sys_UserAccount ua ,Model.T_Wo_WorkOrder model, WorkOrderNewInput input, int type)
|
|
1608
|
1731
|
{
|
|
1609
|
|
- string usercode = CurrentUser.UserData.F_UserCode;
|
|
|
1732
|
+ string usercode = "";
|
|
|
1733
|
+ if (ua !=null )
|
|
|
1734
|
+ {
|
|
|
1735
|
+ usercode = ua.F_UserCode;
|
|
|
1736
|
+ }
|
|
1610
|
1737
|
var newmodel = model;
|
|
1611
|
1738
|
if (input.F_ID != 0)
|
|
1612
|
1739
|
model.F_ID = input.F_ID;
|
|
|
@@ -1715,6 +1842,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1715
|
1842
|
/// 添加工单
|
|
1716
|
1843
|
/// </summary>
|
|
1717
|
1844
|
/// <returns></returns>
|
|
|
1845
|
+ [WechatActionFilter]
|
|
1718
|
1846
|
public ActionResult Add(WorkOrderNewInput input,float overtime = 0, int sms = 0)
|
|
1719
|
1847
|
{
|
|
1720
|
1848
|
|
|
|
@@ -1723,12 +1851,13 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1723
|
1851
|
var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + input.F_WxOpenId + "'").FirstOrDefault();
|
|
1724
|
1852
|
// string usercode = CurrentUser.UserData.F_UserCode;
|
|
1725
|
1853
|
// Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
|
|
1726
|
|
- if (ua != null)
|
|
|
1854
|
+ if (ua == null&&input .F_Source !=3)
|
|
1727
|
1855
|
{
|
|
1728
|
|
- #region 添加验证判断
|
|
|
1856
|
+ return Error("无操作权限!");
|
|
|
1857
|
+ }
|
|
1729
|
1858
|
if (!string.IsNullOrEmpty(input.F_BatchNumber) && !vaBatchNumber(input.F_BatchNumber))
|
|
1730
|
1859
|
{
|
|
1731
|
|
- return Error("请输入正确的工单批次号!");
|
|
|
1860
|
+ return Error("请输入正确的生产批次号!");
|
|
1732
|
1861
|
}
|
|
1733
|
1862
|
else
|
|
1734
|
1863
|
{
|
|
|
@@ -1741,13 +1870,13 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1741
|
1870
|
var protime = Convert.ToDateTime(pronos);
|
|
1742
|
1871
|
if (DateTime.Parse(pronos) > DateTime.Now)
|
|
1743
|
1872
|
{
|
|
1744
|
|
- return Error("工单批次号错误,生产日期不能大于当前时间!");
|
|
|
1873
|
+ return Error("生产批次号错误,生产日期不能大于当前时间!");
|
|
1745
|
1874
|
}
|
|
1746
|
1875
|
|
|
1747
|
1876
|
}
|
|
1748
|
1877
|
catch
|
|
1749
|
1878
|
{
|
|
1750
|
|
- return Error("工单批次号错误,日期格式错误!");
|
|
|
1879
|
+ return Error("生产批次号错误,日期格式错误!");
|
|
1751
|
1880
|
}
|
|
1752
|
1881
|
}
|
|
1753
|
1882
|
}
|
|
|
@@ -1755,10 +1884,10 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1755
|
1884
|
return Error("客户编号为10为纯数字!");
|
|
1756
|
1885
|
if (input.F_MaterialID > 0 && !valcode(input.F_CustomerID.ToString(), 11))
|
|
1757
|
1886
|
return Error("物料编码为11为纯数字!");
|
|
1758
|
|
- #endregion
|
|
|
1887
|
+
|
|
1759
|
1888
|
var model = new Model.T_Wo_WorkOrder();
|
|
1760
|
1889
|
#region 保存客户基本信息
|
|
1761
|
|
- model = inputtoobj(model, input, 2);
|
|
|
1890
|
+ model = inputtoobj(ua,model, input, 2);
|
|
1762
|
1891
|
|
|
1763
|
1892
|
#endregion
|
|
1764
|
1893
|
long n = woBLL.Add(model);
|
|
|
@@ -1770,44 +1899,40 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1770
|
1899
|
List<Model.T_Wo_WorkOrder> modlelist = new BLL.T_Wo_WorkOrder().DataTableToList(dt);
|
|
1771
|
1900
|
if (modlelist!=null && modlelist.Count >0)
|
|
1772
|
1901
|
{
|
|
1773
|
|
- if (GetUser (input.F_WxOpenId)!=null )
|
|
|
1902
|
+ if (ua !=null )
|
|
|
1903
|
+ {
|
|
|
1904
|
+ if (GetUser(input.F_WxOpenId) != null)
|
|
1774
|
1905
|
{
|
|
1775
|
1906
|
var user = GetUser(input.F_WxOpenId);
|
|
1776
|
1907
|
string deptname = "";
|
|
1777
|
1908
|
var deptmodel = departmentBLL.GetModel(user.F_DeptId);
|
|
1778
|
1909
|
if (deptmodel != null)
|
|
1779
|
|
- {
|
|
|
1910
|
+ {
|
|
1780
|
1911
|
deptname = deptmodel.F_DeptName + "-";
|
|
1781
|
1912
|
}
|
|
1782
|
|
- AddLog(modlelist[0].F_ID, modlelist[0].F_State.Value, deptname + user.F_UserName + "(" + user.F_UserCode + ")" + "待审批", (int)EnumItemType.audit, (int)EnumItemOpt.audit, user.F_UserCode , user.F_DeptId , user, 0, 0);
|
|
|
1913
|
+ AddLog(modlelist[0].F_ID, modlelist[0].F_State.Value, deptname + user.F_UserName + "(" + user.F_UserCode + ")" + "待审批", (int)EnumItemType.audit, (int)EnumItemOpt.audit, user.F_UserCode, user.F_DeptId, user, 0, 0);
|
|
1783
|
1914
|
}
|
|
1784
|
1915
|
else
|
|
1785
|
1916
|
{
|
|
1786
|
|
- Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
|
|
1787
|
|
- if (ro.F_RoleCode == "DQJL")
|
|
1788
|
|
- {
|
|
1789
|
|
- var res = AssignWO(ua, model, input, "流转市场管理科", 37, 0, overtime, sms);
|
|
1790
|
|
- if (res)
|
|
1791
|
|
- return Success("添加成功");
|
|
1792
|
|
- else
|
|
1793
|
|
- return Error("市场管理科接收失败!");
|
|
1794
|
|
- }
|
|
|
1917
|
+ var res = AssignWO(ua, model, input, "流转市场管理科", 37, 0, overtime, sms);
|
|
|
1918
|
+ if (res)
|
|
|
1919
|
+ return Success("添加成功");
|
|
1795
|
1920
|
else
|
|
1796
|
|
- {
|
|
1797
|
|
- return Error("工单流转失败,请确认登录账号!");
|
|
1798
|
|
- }
|
|
|
1921
|
+ return Error("市场管理科接收失败!");
|
|
1799
|
1922
|
}
|
|
1800
|
1923
|
}
|
|
|
1924
|
+ else
|
|
|
1925
|
+ {
|
|
|
1926
|
+ return Success("添加成功");
|
|
|
1927
|
+ }
|
|
|
1928
|
+
|
|
|
1929
|
+ }
|
|
1801
|
1930
|
#endregion
|
|
1802
|
1931
|
return Success("添加成功!");
|
|
1803
|
1932
|
}
|
|
1804
|
1933
|
else
|
|
1805
|
1934
|
return Error("添加失败!");
|
|
1806
|
|
- }
|
|
1807
|
|
- else
|
|
1808
|
|
- {
|
|
1809
|
|
- return Error("无操作权限!");
|
|
1810
|
|
- }
|
|
|
1935
|
+
|
|
1811
|
1936
|
|
|
1812
|
1937
|
}
|
|
1813
|
1938
|
else
|
|
|
@@ -1877,6 +2002,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
1877
|
2002
|
/// </summary>
|
|
1878
|
2003
|
/// <returns></returns>
|
|
1879
|
2004
|
[Authority]
|
|
|
2005
|
+ [WechatActionFilter]
|
|
1880
|
2006
|
public ActionResult AssignWorkOrder(string OpenId, long orderid, string cont, WorkOrdeDeptment deptment, int isvisit = 1,
|
|
1881
|
2007
|
float overtime = 0, int sms = 0, int clbm = 0, int clid = 0,int isApprovalp=0, int hclbm = 0, int hclid = 0)
|
|
1882
|
2008
|
{
|
|
|
@@ -2108,6 +2234,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2108
|
2234
|
/// <summary>
|
|
2109
|
2235
|
/// 查询超时工单列表
|
|
2110
|
2236
|
/// </summary>
|
|
|
2237
|
+ [WechatActionFilter]
|
|
2111
|
2238
|
public ActionResult GetOvertime(string OpenId, string code, string keywords, string cusname, string cusphone, string companyname, string province, string city,
|
|
2112
|
2239
|
string country, string township, string touser, int source = 0, int type = 0, int pageindex = 1, int pagesize = 10)
|
|
2113
|
2240
|
{
|
|
|
@@ -2245,6 +2372,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2245
|
2372
|
/// 获取催办工单列表
|
|
2246
|
2373
|
/// </summary>
|
|
2247
|
2374
|
/// <returns></returns>
|
|
|
2375
|
+ [WechatActionFilter]
|
|
2248
|
2376
|
public ActionResult GetUrgeList(string OpenId,string code, string cusname, string keywords, string cusphone, string companyname, string province, string city,
|
|
2249
|
2377
|
string country, string township, string touser, int source = -1, int type = 0, int state = -1, int pageindex = 1, int pagesize = 10)
|
|
2250
|
2378
|
{
|
|
|
@@ -2448,6 +2576,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2448
|
2576
|
/// </summary>
|
|
2449
|
2577
|
/// <returns></returns>
|
|
2450
|
2578
|
[Authority]
|
|
|
2579
|
+ [WechatActionFilter]
|
|
2451
|
2580
|
public ActionResult SureWorkOrder(long orderid, string OpenId)
|
|
2452
|
2581
|
{
|
|
2453
|
2582
|
if (!string.IsNullOrEmpty(OpenId))
|
|
|
@@ -2479,6 +2608,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2479
|
2608
|
/// <param name="input"></param>
|
|
2480
|
2609
|
/// <returns></returns>
|
|
2481
|
2610
|
[Authority]
|
|
|
2611
|
+ [WechatActionFilter]
|
|
2482
|
2612
|
public ActionResult HigApprovalOrder(string OpenId, long orderid,string cont)
|
|
2483
|
2613
|
{
|
|
2484
|
2614
|
if (!string.IsNullOrEmpty(OpenId))
|
|
|
@@ -2574,7 +2704,8 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2574
|
2704
|
/// </summary>
|
|
2575
|
2705
|
/// <returns></returns>
|
|
2576
|
2706
|
[Authority]
|
|
2577
|
|
- public ActionResult DealWorkOrder(string OpenId,long orderid, string cont, WorkOrdeDeptment deptment,
|
|
|
2707
|
+ [WechatActionFilter]
|
|
|
2708
|
+ public ActionResult DealWorkOrder(string OpenId,long orderid, string cont, WorkOrdeDeptment deptment, string dealType,
|
|
2578
|
2709
|
string uncont = "",
|
|
2579
|
2710
|
int isvisit = 1, int isover = 0)
|
|
2580
|
2711
|
{
|
|
|
@@ -2647,7 +2778,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2647
|
2778
|
}
|
|
2648
|
2779
|
if (model != null)
|
|
2649
|
2780
|
{
|
|
2650
|
|
- var res = DealWO(ua, model, input, cont, isover, uncont);
|
|
|
2781
|
+ var res = DealWO(ua, model, input, cont, isover, dealType, uncont);
|
|
2651
|
2782
|
if (res)
|
|
2652
|
2783
|
return Success("处理成功");
|
|
2653
|
2784
|
else
|
|
|
@@ -2665,6 +2796,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2665
|
2796
|
/// <param name="input"></param>
|
|
2666
|
2797
|
/// <returns></returns>
|
|
2667
|
2798
|
[Authority]
|
|
|
2799
|
+ [WechatActionFilter]
|
|
2668
|
2800
|
public ActionResult BackWorkOrder(string OpenId,long orderid, string cont, int type = 0)
|
|
2669
|
2801
|
{//办理人员和监管可以退回工单
|
|
2670
|
2802
|
if (!string.IsNullOrEmpty(OpenId))
|
|
|
@@ -2695,6 +2827,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2695
|
2827
|
/// <param name="input"></param>
|
|
2696
|
2828
|
/// <returns></returns>
|
|
2697
|
2829
|
[Authority]
|
|
|
2830
|
+ [WechatActionFilter]
|
|
2698
|
2831
|
public ActionResult ReturnvisitOrder(string OpenId, long orderid, string cont, string reason, string call, int isover = 0)
|
|
2699
|
2832
|
{
|
|
2700
|
2833
|
if (!string.IsNullOrEmpty(OpenId))
|
|
|
@@ -2723,6 +2856,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2723
|
2856
|
/// <param name="input"></param>
|
|
2724
|
2857
|
/// <returns></returns>
|
|
2725
|
2858
|
[Authority]
|
|
|
2859
|
+ [WechatActionFilter]
|
|
2726
|
2860
|
public ActionResult EndOrder(string OpenId,long orderid, int isover = 0)
|
|
2727
|
2861
|
{
|
|
2728
|
2862
|
if (!string.IsNullOrEmpty(OpenId))
|
|
|
@@ -2750,6 +2884,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2750
|
2884
|
/// </summary>
|
|
2751
|
2885
|
/// <returns></returns>
|
|
2752
|
2886
|
[Authority]
|
|
|
2887
|
+ [WechatActionFilter]
|
|
2753
|
2888
|
public ActionResult DelayWorkOrder(string OpenId,long orderid, string cont, float limit = 0)
|
|
2754
|
2889
|
{
|
|
2755
|
2890
|
if (!string.IsNullOrEmpty(OpenId))
|
|
|
@@ -2777,6 +2912,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
2777
|
2912
|
/// 催办工单
|
|
2778
|
2913
|
/// </summary>
|
|
2779
|
2914
|
/// <returns></returns>
|
|
|
2915
|
+ [WechatActionFilter]
|
|
2780
|
2916
|
public ActionResult AddWorkOrderRemind(string OpenId,long orderid, string cont)
|
|
2781
|
2917
|
{
|
|
2782
|
2918
|
if (!string.IsNullOrEmpty(OpenId))
|
|
|
@@ -3099,7 +3235,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
3099
|
3235
|
/// <summary>
|
|
3100
|
3236
|
/// 处理工单
|
|
3101
|
3237
|
/// </summary>
|
|
3102
|
|
- public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, int isover = 0, string uncont = "")
|
|
|
3238
|
+ public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, int isover = 0, string dealType = "", string uncont = "")
|
|
3103
|
3239
|
{
|
|
3104
|
3240
|
#region 工单处理
|
|
3105
|
3241
|
int overtime = 0, sms = 0;
|
|
|
@@ -3150,7 +3286,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
3150
|
3286
|
{
|
|
3151
|
3287
|
#region 处理工单
|
|
3152
|
3288
|
model.F_State = wostate;
|
|
3153
|
|
-
|
|
|
3289
|
+ model.F_DealType = dealType;
|
|
3154
|
3290
|
//处理内容
|
|
3155
|
3291
|
if (!string.IsNullOrEmpty(cont))
|
|
3156
|
3292
|
model.F_DealContent += cont + ";";
|
|
|
@@ -3251,6 +3387,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
3251
|
3387
|
/// 修改工单
|
|
3252
|
3388
|
/// </summary>
|
|
3253
|
3389
|
/// <returns></returns>
|
|
|
3390
|
+ [WechatActionFilter]
|
|
3254
|
3391
|
public ActionResult Update(WorkOrderNewInput input)
|
|
3255
|
3392
|
{
|
|
3256
|
3393
|
var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + input.F_WxOpenId + "'").FirstOrDefault();
|
|
|
@@ -3263,7 +3400,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
3263
|
3400
|
return Error("工单类型错误!");
|
|
3264
|
3401
|
if (!string.IsNullOrEmpty(input.F_BatchNumber) && !vaBatchNumber(input.F_BatchNumber))
|
|
3265
|
3402
|
{
|
|
3266
|
|
- return Error("请输入正确的工单批次号!");
|
|
|
3403
|
+ return Error("请输入正确的生产批次号!");
|
|
3267
|
3404
|
}
|
|
3268
|
3405
|
else
|
|
3269
|
3406
|
{
|
|
|
@@ -3276,13 +3413,13 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
3276
|
3413
|
var protime = Convert.ToDateTime(pronos);
|
|
3277
|
3414
|
if (DateTime.Parse(pronos) > DateTime.Now)
|
|
3278
|
3415
|
{
|
|
3279
|
|
- return Error("工单批次号错误,生产日期不能大于当前时间!");
|
|
|
3416
|
+ return Error("生产批次号错误,生产日期不能大于当前时间!");
|
|
3280
|
3417
|
}
|
|
3281
|
3418
|
|
|
3282
|
3419
|
}
|
|
3283
|
3420
|
catch
|
|
3284
|
3421
|
{
|
|
3285
|
|
- return Error("工单批次号错误,日期格式错误!");
|
|
|
3422
|
+ return Error("生产批次号错误,日期格式错误!");
|
|
3286
|
3423
|
}
|
|
3287
|
3424
|
}
|
|
3288
|
3425
|
}
|
|
|
@@ -3293,7 +3430,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
3293
|
3430
|
#endregion
|
|
3294
|
3431
|
var model = woBLL.GetModel(input.F_ID);
|
|
3295
|
3432
|
#region 保存客户基本信息
|
|
3296
|
|
- model = inputtoobj(model, input, 1);
|
|
|
3433
|
+ model = inputtoobj(ua,model, input, 1);
|
|
3297
|
3434
|
#endregion
|
|
3298
|
3435
|
bool n = woBLL.Update(model);
|
|
3299
|
3436
|
if (n)
|