|
|
@@ -74,13 +74,64 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
74
|
74
|
switch (state)
|
|
75
|
75
|
{
|
|
76
|
76
|
case 0://待指派的
|
|
77
|
|
- if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "JDYPTZX" )
|
|
|
77
|
+ if (ro.F_RoleCode == "GC" )
|
|
78
|
78
|
{
|
|
79
|
|
- sql += $" and F_DealBy like '%" + ua.F_UserCode + "%'";
|
|
|
79
|
+ sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
|
|
80
|
80
|
}
|
|
|
81
|
+ else if (ro.F_RoleCode == "JDYPTZX"|| ro.F_RoleCode == "JDYBZZX")
|
|
|
82
|
+ {
|
|
|
83
|
+ uwhere="";
|
|
|
84
|
+ }
|
|
|
85
|
+ #region 获取部门工单列表
|
|
|
86
|
+ else if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL" || ro.F_RoleCode == "ZG")
|
|
|
87
|
+ {
|
|
|
88
|
+ string detpid = "";
|
|
|
89
|
+ var deparmentlist = new List<Model.T_Sys_Department>();
|
|
|
90
|
+ Model.T_Sys_Department dModel = departmentBLL.GetModel(ua.F_DeptId);
|
|
|
91
|
+ if (dModel != null)
|
|
|
92
|
+ {
|
|
|
93
|
+ if (dModel.F_Layer == 1)
|
|
|
94
|
+ {
|
|
|
95
|
+ deparmentlist = new BLL.T_Sys_Department().GetModelList(" F_State=1 and F_Layer=" + 2 + " and F_ParentId=" + dModel.F_DeptId);
|
|
|
96
|
+ if (deparmentlist.Count > 0)
|
|
|
97
|
+ {
|
|
|
98
|
+ foreach (var it in deparmentlist)
|
|
|
99
|
+ {
|
|
|
100
|
+ if (detpid != "")
|
|
|
101
|
+ {
|
|
|
102
|
+ detpid += "," + it.F_DeptId;
|
|
|
103
|
+ }
|
|
|
104
|
+ else
|
|
|
105
|
+ {
|
|
|
106
|
+ detpid = "" + it.F_DeptId; ;
|
|
|
107
|
+ }
|
|
|
108
|
+ }
|
|
|
109
|
+ }
|
|
|
110
|
+ }
|
|
|
111
|
+ else
|
|
|
112
|
+ {
|
|
|
113
|
+ detpid = ua.F_DeptId.ToString();
|
|
|
114
|
+ }
|
|
|
115
|
+ if (GetDeptWorkOrderID(detpid, "" + (int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.reassign + "") != "")
|
|
|
116
|
+ {
|
|
|
117
|
+ sql += $" and T_Wo_WorkOrder.F_ID in ( " + GetDeptWorkOrderID(detpid, "" + (int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.reassign + "") + ") "; ;
|
|
|
118
|
+ }
|
|
|
119
|
+ else
|
|
|
120
|
+ {
|
|
|
121
|
+
|
|
|
122
|
+ return Success("暂无工单"); ;
|
|
|
123
|
+ }
|
|
|
124
|
+
|
|
|
125
|
+ }
|
|
|
126
|
+ else
|
|
|
127
|
+ {
|
|
|
128
|
+ return Error("加载失败");
|
|
|
129
|
+ }
|
|
|
130
|
+ }
|
|
|
131
|
+ #endregion
|
|
81
|
132
|
else
|
|
82
|
133
|
{
|
|
83
|
|
- uwhere = "";
|
|
|
134
|
+ sql += $" and F_CreateBy like '%" + ua.F_UserCode + "%'";;
|
|
84
|
135
|
}
|
|
85
|
136
|
sql += $" and F_State in(" + (int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.reassign +")"+ " " + uwhere;
|
|
86
|
137
|
// sql += "and T_Wo_WorkOrder.F_ID in (" + GetBackWorkOrderID(ua.F_UserCode) + ") ";
|
|
|
@@ -106,6 +157,84 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
106
|
157
|
case 3://我参与的
|
|
107
|
158
|
sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
|
|
108
|
159
|
break;
|
|
|
160
|
+ case 4://待回访
|
|
|
161
|
+ if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX")
|
|
|
162
|
+ {
|
|
|
163
|
+ uwhere = "";
|
|
|
164
|
+ }
|
|
|
165
|
+ else
|
|
|
166
|
+ {
|
|
|
167
|
+ return Success("无操作权限"); ;
|
|
|
168
|
+ }
|
|
|
169
|
+ sql += $" and F_State=" + (int)EnumWorkOrderState.finish + " and F_IsVisit = '" +"1" +"' "+ uwhere; ;
|
|
|
170
|
+ break;
|
|
|
171
|
+ case 6://已回访
|
|
|
172
|
+ if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX")
|
|
|
173
|
+ {
|
|
|
174
|
+ sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
|
|
|
175
|
+ }
|
|
|
176
|
+ else if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL" || ro.F_RoleCode == "ZG")
|
|
|
177
|
+ {
|
|
|
178
|
+ string detpid = "";
|
|
|
179
|
+ var deparmentlist = new List<Model.T_Sys_Department>();
|
|
|
180
|
+ Model.T_Sys_Department dModel = departmentBLL.GetModel(ua.F_DeptId);
|
|
|
181
|
+ if (dModel != null)
|
|
|
182
|
+ {
|
|
|
183
|
+ if (dModel.F_Layer == 1)
|
|
|
184
|
+ {
|
|
|
185
|
+ deparmentlist = new BLL.T_Sys_Department().GetModelList(" F_State=1 and F_Layer=" + 2 + " and F_ParentId=" + dModel.F_DeptId);
|
|
|
186
|
+ if (deparmentlist.Count > 0)
|
|
|
187
|
+ {
|
|
|
188
|
+ foreach (var it in deparmentlist)
|
|
|
189
|
+ {
|
|
|
190
|
+ if (detpid != "")
|
|
|
191
|
+ {
|
|
|
192
|
+ detpid += "," + it.F_DeptId;
|
|
|
193
|
+ }
|
|
|
194
|
+ else
|
|
|
195
|
+ {
|
|
|
196
|
+ detpid = "" + it.F_DeptId; ;
|
|
|
197
|
+ }
|
|
|
198
|
+ }
|
|
|
199
|
+ }
|
|
|
200
|
+ }
|
|
|
201
|
+ else
|
|
|
202
|
+ {
|
|
|
203
|
+ detpid = ua.F_DeptId.ToString();
|
|
|
204
|
+ }
|
|
|
205
|
+ if (GetDeptWorkOrderID(detpid, "" + (int)EnumWorkOrderState.evaluate + "") != "")
|
|
|
206
|
+ {
|
|
|
207
|
+ sql += $" and T_Wo_WorkOrder.F_ID in ( " + GetDeptWorkOrderID(detpid, "" + (int)EnumWorkOrderState.evaluate + "") + ") "; ;
|
|
|
208
|
+ }
|
|
|
209
|
+ else
|
|
|
210
|
+ {
|
|
|
211
|
+
|
|
|
212
|
+ return Success("暂无工单"); ;
|
|
|
213
|
+ }
|
|
|
214
|
+
|
|
|
215
|
+ }
|
|
|
216
|
+ else
|
|
|
217
|
+ {
|
|
|
218
|
+ return Error("加载失败");
|
|
|
219
|
+ }
|
|
|
220
|
+ }
|
|
|
221
|
+ else
|
|
|
222
|
+ {
|
|
|
223
|
+ return Success("无操作权限"); ;
|
|
|
224
|
+ }
|
|
|
225
|
+ sql += $" and F_State=" + (int)EnumWorkOrderState.evaluate ;
|
|
|
226
|
+ break;
|
|
|
227
|
+ case 7://待完结
|
|
|
228
|
+ if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX")
|
|
|
229
|
+ {
|
|
|
230
|
+ uwhere = ""; ;
|
|
|
231
|
+ }
|
|
|
232
|
+ else
|
|
|
233
|
+ {
|
|
|
234
|
+ return Success("无操作权限"); ;
|
|
|
235
|
+ }
|
|
|
236
|
+ sql += $" and F_State=" + (int)EnumWorkOrderState.finish + " and F_IsVisit = '" + "0" + "' "; ;
|
|
|
237
|
+ break;
|
|
109
|
238
|
}
|
|
110
|
239
|
#endregion
|
|
111
|
240
|
int recordCount = 0;
|
|
|
@@ -148,99 +277,30 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
148
|
277
|
return Error("无操作权限!");
|
|
149
|
278
|
}
|
|
150
|
279
|
#region
|
|
151
|
|
- // if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "YWY" )
|
|
152
|
|
- // {
|
|
153
|
|
-
|
|
154
|
|
- // if (modlelist.Count >0)
|
|
155
|
|
- // {
|
|
156
|
|
- // foreach (var it in modlelist)
|
|
157
|
|
- // {
|
|
158
|
|
- // var itemlast = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.deal + " and F_WoID='" + it.F_ID + "' order by F_CreateTime desc").FirstOrDefault();
|
|
159
|
|
- // if (itemlast != null)
|
|
160
|
|
-
|
|
161
|
|
- // if (it.F_DealBy == ua.F_UserCode)
|
|
162
|
|
- // {
|
|
163
|
|
- // list.Add(it);
|
|
164
|
|
- // total++;
|
|
165
|
|
- // }
|
|
166
|
|
- // }
|
|
167
|
|
- // }
|
|
168
|
|
-
|
|
169
|
|
- // }
|
|
170
|
|
- //else if (ro.F_RoleCode == "BLRY" || ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL" || ro.F_RoleCode == "ZG")
|
|
171
|
|
- // {
|
|
172
|
|
- // List<int> detpid = new List<int>();
|
|
173
|
|
- // var deparmentlist = new List<Model.T_Sys_Department>();
|
|
174
|
|
- // Model.T_Sys_Department dModel = departmentBLL.GetModel(ua.F_DeptId);
|
|
175
|
|
- // if (dModel != null)
|
|
176
|
|
- // {
|
|
177
|
|
-
|
|
178
|
|
- // if (dModel.F_Layer == 1)
|
|
179
|
|
- // {
|
|
180
|
|
- // deparmentlist = new BLL.T_Sys_Department().GetModelList(" F_State=1 and F_Layer=" + 2 + " and F_ParentId=" + dModel.F_DeptId);
|
|
181
|
|
- // if (deparmentlist.Count > 0)
|
|
182
|
|
- // {
|
|
183
|
|
- // foreach (var it in deparmentlist)
|
|
184
|
|
- // {
|
|
185
|
|
- // detpid.Add(it.F_DeptId);
|
|
186
|
|
-
|
|
187
|
|
- // }
|
|
188
|
|
- // }
|
|
189
|
|
- // }
|
|
190
|
|
- // detpid.Add(dModel.F_DeptId);
|
|
191
|
|
- // var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' " + " ");
|
|
192
|
|
- // if (itemlast.Count > 0)
|
|
193
|
|
- // {
|
|
194
|
|
- // foreach (var it in itemlast)
|
|
195
|
|
- // {
|
|
196
|
|
- // for (int i = 0; i < detpid.Count; i++)
|
|
197
|
|
- // {
|
|
198
|
|
- // if (it.F_NextDept == detpid[i])
|
|
199
|
|
- // {
|
|
200
|
|
- // woid.Add(it.F_WoID);
|
|
201
|
|
- // }
|
|
202
|
|
- // }
|
|
203
|
|
- // }
|
|
204
|
|
- // }
|
|
205
|
|
- // if (modlelist.Count >0 && woid.Count > 0)
|
|
206
|
|
- // {
|
|
207
|
|
- // foreach (var it in modlelist)
|
|
208
|
|
- // {
|
|
209
|
|
- // for (int i = 0; i < woid.Count; i++)
|
|
210
|
|
- // {
|
|
211
|
|
- // if (it.F_ID == woid[i])
|
|
212
|
|
- // {
|
|
213
|
|
- // list.Add(it);
|
|
214
|
|
- // total++;
|
|
215
|
|
- // }
|
|
216
|
|
- // }
|
|
217
|
|
- // }
|
|
218
|
|
- // }
|
|
219
|
|
-
|
|
220
|
|
- // }
|
|
221
|
|
- // else
|
|
222
|
|
- // {
|
|
223
|
|
- // return Error("加载失败");
|
|
224
|
|
- // }
|
|
225
|
|
- // }
|
|
226
|
|
- // else if (ro.F_RoleCode == "QTJS")
|
|
227
|
|
- // {
|
|
228
|
|
- // return Error("无操作权限!");
|
|
229
|
|
- // }
|
|
230
|
|
- // else
|
|
231
|
|
- // {
|
|
232
|
|
- // if (modlelist.Count > 0 )
|
|
233
|
|
- // {
|
|
234
|
|
- // foreach (var it in modlelist)
|
|
235
|
|
- // {
|
|
236
|
|
- // list.Add(it);
|
|
237
|
|
- // total++;
|
|
238
|
|
- // }
|
|
239
|
|
- // }
|
|
240
|
|
- // }
|
|
241
|
280
|
#endregion
|
|
242
|
281
|
|
|
243
|
282
|
}
|
|
|
283
|
+ public ActionResult ExportVisitList(string []ids)
|
|
|
284
|
+ {
|
|
|
285
|
+ int userId = CurrentUser.UserData.F_UserId;
|
|
|
286
|
+ if (userId != 0)
|
|
|
287
|
+ {
|
|
|
288
|
+ DataTable dt = new DataTable();
|
|
|
289
|
+ string sql = $" and F_IsDelete=0";
|
|
|
290
|
+ sql += " and T_Wo_WorkOrder.F_ID in ( " + ids + ")) ";
|
|
|
291
|
+ NPOIHelper npoi = new NPOIHelper();
|
|
|
292
|
+ if (npoi.ExportToExcel("工单列表", dt) == "")
|
|
|
293
|
+ {
|
|
|
294
|
+ return Success("导出成功");
|
|
|
295
|
+ }
|
|
|
296
|
+ else
|
|
|
297
|
+ {
|
|
|
298
|
+ return Error("导出失败");
|
|
|
299
|
+
|
|
|
300
|
+ }
|
|
|
301
|
+ }
|
|
|
302
|
+ return Error("无操作权限");
|
|
|
303
|
+ }
|
|
244
|
304
|
/// <summary>
|
|
245
|
305
|
/// 获取异常
|
|
246
|
306
|
/// </summary>
|
|
|
@@ -283,20 +343,47 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
283
|
343
|
|
|
284
|
344
|
return str;
|
|
285
|
345
|
}
|
|
|
346
|
+
|
|
286
|
347
|
/// <summary>
|
|
287
|
348
|
/// 根据部门获取工单号
|
|
288
|
349
|
/// </summary>
|
|
289
|
350
|
/// <returns></returns>
|
|
290
|
|
- public string GetDeptWorkOrderID(string user)
|
|
|
351
|
+ public string GetDeptWorkOrderID(string user,string F_ItemType)
|
|
291
|
352
|
{
|
|
|
353
|
+ string sql = " ";
|
|
|
354
|
+ string ua = "";
|
|
|
355
|
+ DataTable dt = new DataTable();
|
|
|
356
|
+ if (user != "")
|
|
|
357
|
+ {
|
|
|
358
|
+ sql += " and F_DeptId in ( "+ user + ") ";
|
|
|
359
|
+ }
|
|
|
360
|
+ int recordCount;
|
|
|
361
|
+ dt = BLL.PagerBLL.GetListPager(
|
|
|
362
|
+ "T_Sys_UserAccount",
|
|
|
363
|
+ "F_UserId",
|
|
|
364
|
+ "*",
|
|
|
365
|
+ sql,
|
|
|
366
|
+ "ORDER BY F_UserId desc",
|
|
|
367
|
+ 10000,
|
|
|
368
|
+ 1,
|
|
|
369
|
+ true,
|
|
|
370
|
+ out recordCount);
|
|
|
371
|
+ List<Model.UserAccount> modelList = new BLL.UserAccount().DataTableToList(dt);
|
|
|
372
|
+ if (modelList!=null )
|
|
|
373
|
+ {
|
|
|
374
|
+ foreach (var it in modelList)
|
|
|
375
|
+ {
|
|
|
376
|
+ if (ua != "")
|
|
|
377
|
+ ua += "," + it.F_UserCode;
|
|
|
378
|
+ else
|
|
|
379
|
+ ua += it.F_UserCode;
|
|
|
380
|
+ }
|
|
|
381
|
+ }
|
|
292
|
382
|
string str = string.Empty;
|
|
293
|
|
-
|
|
294
|
|
- str = "select F_WoID from T_Wo_WorkOrderItem_New where F_ItemType in(" + (int)EnumItemType.deal + "," + (int)EnumItemType.urge + ")"
|
|
295
|
|
- + " and "
|
|
296
|
|
- + "F_WoState in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.receive + "," +
|
|
297
|
|
- (int)EnumWorkOrderState.assign + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ")"+ " and "
|
|
298
|
|
- + "F_NextDept in(" + user+ ")"
|
|
299
|
|
- + " and isnull(F_IsUsed,'0')='0' ";
|
|
|
383
|
+ str = "select F_WoID from T_Wo_WorkOrderItem_New where F_OptType in(" + F_ItemType + ")"
|
|
|
384
|
+ + " and "
|
|
|
385
|
+ + "F_CreateUser in(" + ua + ")"
|
|
|
386
|
+ ;
|
|
300
|
387
|
|
|
301
|
388
|
return str;
|
|
302
|
389
|
}
|
|
|
@@ -434,7 +521,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
434
|
521
|
#region 筛选条件
|
|
435
|
522
|
if (type > 0 && type < 5)//工单类型
|
|
436
|
523
|
sql += $" and F_Type=" + type;
|
|
437
|
|
- if (state >= 0)//工单状态
|
|
|
524
|
+ if (state >= 0)//
|
|
438
|
525
|
sql += $" and F_State=" + state;
|
|
439
|
526
|
if (source > 0)//工单来源
|
|
440
|
527
|
sql += $" and F_Source=" + source;
|
|
|
@@ -499,15 +586,37 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
499
|
586
|
{
|
|
500
|
587
|
detpid = ua.F_DeptId.ToString();
|
|
501
|
588
|
}
|
|
502
|
|
- if (GetDeptWorkOrderID(detpid) != "")
|
|
|
589
|
+ if (state>=0)
|
|
503
|
590
|
{
|
|
504
|
|
- sql += $" and T_Wo_WorkOrder.F_ID in ( " + GetDeptWorkOrderID(detpid) + ") ";
|
|
|
591
|
+ if (GetDeptWorkOrderID(detpid,""+state+"" ) != "")
|
|
|
592
|
+ {
|
|
|
593
|
+
|
|
|
594
|
+ sql += $" and T_Wo_WorkOrder.F_ID in ( " + GetDeptWorkOrderID(detpid, "" + state + "") + ") ";
|
|
|
595
|
+ }
|
|
|
596
|
+ else
|
|
|
597
|
+ {
|
|
|
598
|
+
|
|
|
599
|
+ return Success("暂无工单"); ;
|
|
|
600
|
+ }
|
|
505
|
601
|
}
|
|
506
|
602
|
else
|
|
507
|
603
|
{
|
|
|
604
|
+ if (GetDeptWorkOrderID(detpid, "" + (int)EnumWorkOrderState.neworder + ", " + (int)EnumWorkOrderState.assign + "," +
|
|
|
605
|
+ (int)EnumWorkOrderState.receive + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback+ "," + (int)EnumWorkOrderState.finish
|
|
|
606
|
+ + "," + (int)EnumWorkOrderState.evaluate+"") != "")
|
|
|
607
|
+ {
|
|
508
|
608
|
|
|
509
|
|
- return Success("暂无工单"); ;
|
|
|
609
|
+ sql += $" and T_Wo_WorkOrder.F_ID in ( " + GetDeptWorkOrderID(detpid, "" + (int)EnumWorkOrderState.neworder + ", " + (int)EnumWorkOrderState.assign + "," +
|
|
|
610
|
+ (int)EnumWorkOrderState.receive + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + "," + (int)EnumWorkOrderState.finish
|
|
|
611
|
+ + "," + (int)EnumWorkOrderState.evaluate + "") + ") ";
|
|
|
612
|
+ }
|
|
|
613
|
+ else
|
|
|
614
|
+ {
|
|
|
615
|
+
|
|
|
616
|
+ return Success("暂无工单"); ;
|
|
|
617
|
+ }
|
|
510
|
618
|
}
|
|
|
619
|
+
|
|
511
|
620
|
}
|
|
512
|
621
|
else
|
|
513
|
622
|
{
|
|
|
@@ -632,9 +741,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
632
|
741
|
{
|
|
633
|
742
|
detpid = ua.F_DeptId.ToString ();
|
|
634
|
743
|
}
|
|
635
|
|
- if (GetDeptWorkOrderID(detpid) != "")
|
|
|
744
|
+ if (GetDeptWorkOrderID(detpid, "" + (int)EnumWorkOrderState.dealing + ", " + (int)EnumWorkOrderState.receive + "," +
|
|
|
745
|
+ (int)EnumWorkOrderState.assign + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + "") != "")
|
|
636
|
746
|
{
|
|
637
|
|
- sql += $" and T_Wo_WorkOrder.F_ID in ( " + GetDeptWorkOrderID(detpid) + ") "; ;
|
|
|
747
|
+ sql += $" and T_Wo_WorkOrder.F_ID in ( " + GetDeptWorkOrderID(detpid, "" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.receive + "," +
|
|
|
748
|
+ (int)EnumWorkOrderState.assign + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + "") + ") "; ;
|
|
638
|
749
|
}
|
|
639
|
750
|
else
|
|
640
|
751
|
{
|
|
|
@@ -1079,8 +1190,35 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1079
|
1190
|
#region 添加验证判断
|
|
1080
|
1191
|
if (!(input.F_Type> 0 && input.F_Type < 5))
|
|
1081
|
1192
|
return Error("工单类型错误!");
|
|
1082
|
|
- if (input .F_State ==2&&!vaBatchNumber(input .F_BatchNumber ))
|
|
|
1193
|
+ if (!string.IsNullOrEmpty(input.F_BatchNumber) && !vaBatchNumber(input.F_BatchNumber))
|
|
|
1194
|
+ {
|
|
1083
|
1195
|
return Error("请输入正确的工单批次号!");
|
|
|
1196
|
+ }
|
|
|
1197
|
+ else
|
|
|
1198
|
+ {
|
|
|
1199
|
+ if (!string.IsNullOrEmpty(input.F_BatchNumber))
|
|
|
1200
|
+ {
|
|
|
1201
|
+ var prono = input.F_BatchNumber.Substring(0, 6);
|
|
|
1202
|
+ try
|
|
|
1203
|
+ {
|
|
|
1204
|
+ var pronos = DateTime.ParseExact(prono, "yyMMdd", null).ToString("yyyy-MM-dd");
|
|
|
1205
|
+ var protime = Convert.ToDateTime(pronos);
|
|
|
1206
|
+ if (DateTime.Parse(pronos) > DateTime.Now)
|
|
|
1207
|
+ {
|
|
|
1208
|
+ return Error("工单批次号错误,生产日期不能大于当前时间!");
|
|
|
1209
|
+ }
|
|
|
1210
|
+
|
|
|
1211
|
+ }
|
|
|
1212
|
+ catch
|
|
|
1213
|
+ {
|
|
|
1214
|
+ return Error("工单批次号错误,日期格式错误!");
|
|
|
1215
|
+ }
|
|
|
1216
|
+ }
|
|
|
1217
|
+ }
|
|
|
1218
|
+ if (input.F_CustomerID > 0 && !valcode(input.F_CustomerID.ToString(), 10))
|
|
|
1219
|
+ return Error("客户编号为10为纯数字!");
|
|
|
1220
|
+ if (input.F_MaterialID > 0 && !valcode(input.F_CustomerID.ToString(), 11))
|
|
|
1221
|
+ return Error("物料编码为11为纯数字!");
|
|
1084
|
1222
|
#endregion
|
|
1085
|
1223
|
var model = new Model.T_Wo_WorkOrder();
|
|
1086
|
1224
|
#region 保存客户基本信息
|
|
|
@@ -1096,6 +1234,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1096
|
1234
|
{
|
|
1097
|
1235
|
deptname = deptmodel.F_DeptName + "-";
|
|
1098
|
1236
|
}
|
|
|
1237
|
+ DataTable dt = new DataTable();
|
|
|
1238
|
+ dt = new BLL.T_Wo_WorkOrder().GetList(1, "", "F_ID desc").Tables[0];
|
|
|
1239
|
+ List<Model.T_Wo_WorkOrder> modlelist = new BLL.T_Wo_WorkOrder().DataTableToList(dt);
|
|
|
1240
|
+ 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);
|
|
1099
|
1241
|
return Success("添加成功!");
|
|
1100
|
1242
|
|
|
1101
|
1243
|
}
|
|
|
@@ -1178,26 +1320,35 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1178
|
1320
|
return Error("参数错误!");
|
|
1179
|
1321
|
if (!(input.F_Type> 0 && input.F_Type < 5))
|
|
1180
|
1322
|
return Error("工单类型错误!");
|
|
1181
|
|
- if (input.F_State== 2 && !vaBatchNumber(input.F_BatchNumber))
|
|
|
1323
|
+ if (!string.IsNullOrEmpty(input.F_BatchNumber) && !vaBatchNumber(input.F_BatchNumber))
|
|
|
1324
|
+ {
|
|
1182
|
1325
|
return Error("请输入正确的工单批次号!");
|
|
1183
|
|
- if (input.F_Type == 1 || input.F_Type == 3)
|
|
|
1326
|
+ }
|
|
|
1327
|
+ else
|
|
1184
|
1328
|
{
|
|
1185
|
|
- if (input.F_CustomerID > 0)
|
|
|
1329
|
+ if (!string.IsNullOrEmpty(input.F_BatchNumber))
|
|
1186
|
1330
|
{
|
|
1187
|
|
- if (!valcode(input.F_CustomerID.ToString(), 10))
|
|
|
1331
|
+ var prono = input.F_BatchNumber.Substring(0, 6);
|
|
|
1332
|
+ try
|
|
1188
|
1333
|
{
|
|
1189
|
|
- return Error("客户编号为10为纯数字!");
|
|
|
1334
|
+ var pronos = DateTime.ParseExact(prono, "yyMMdd", null).ToString("yyyy-MM-dd");
|
|
|
1335
|
+ var protime = Convert.ToDateTime(pronos);
|
|
|
1336
|
+ if (DateTime.Parse(pronos) > DateTime.Now)
|
|
|
1337
|
+ {
|
|
|
1338
|
+ return Error("工单批次号错误,生产日期不能大于当前时间!");
|
|
|
1339
|
+ }
|
|
|
1340
|
+
|
|
1190
|
1341
|
}
|
|
1191
|
|
- }
|
|
1192
|
|
- if (input.F_MaterialID > 0)
|
|
1193
|
|
- {
|
|
1194
|
|
- if (!valcode(input.F_MaterialID.ToString(), 11))
|
|
|
1342
|
+ catch
|
|
1195
|
1343
|
{
|
|
1196
|
|
- return Error("物料编码为11为纯数字!");
|
|
|
1344
|
+ return Error("工单批次号错误,日期格式错误!");
|
|
1197
|
1345
|
}
|
|
1198
|
1346
|
}
|
|
1199
|
|
-
|
|
1200
|
1347
|
}
|
|
|
1348
|
+ if (input.F_CustomerID > 0 && !valcode(input.F_CustomerID.ToString(), 10))
|
|
|
1349
|
+ return Error("客户编号为10为纯数字!");
|
|
|
1350
|
+ if (input.F_MaterialID > 0 && !valcode(input.F_CustomerID.ToString(), 11))
|
|
|
1351
|
+ return Error("物料编码为11为纯数字!");
|
|
1201
|
1352
|
#endregion
|
|
1202
|
1353
|
var model = workOrder.GetModel(input.F_ID);
|
|
1203
|
1354
|
#region 保存客户基本信息
|
|
|
@@ -1232,9 +1383,23 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1232
|
1383
|
private bool vaBatchNumber(string code)
|
|
1233
|
1384
|
{
|
|
1234
|
1385
|
var res = false;
|
|
1235
|
|
- //11位数字
|
|
1236
|
1386
|
if (code.Length == 15)
|
|
1237
|
|
- res = true;
|
|
|
1387
|
+ {
|
|
|
1388
|
+ char chr = code[12];
|
|
|
1389
|
+ if (chr > 'A' && chr < 'Z')
|
|
|
1390
|
+ {
|
|
|
1391
|
+ string code1= code.Substring(0, 12);
|
|
|
1392
|
+ string code2 = code.Substring(15 - 2, 2);
|
|
|
1393
|
+ if (Regex.IsMatch(code1, @"^\d{12}$") && Regex.IsMatch(code2, @"^\d{2}$"))
|
|
|
1394
|
+ res = true;
|
|
|
1395
|
+ }
|
|
|
1396
|
+ else
|
|
|
1397
|
+ {
|
|
|
1398
|
+ res = false;
|
|
|
1399
|
+ }
|
|
|
1400
|
+
|
|
|
1401
|
+
|
|
|
1402
|
+ }
|
|
1238
|
1403
|
return res;
|
|
1239
|
1404
|
}
|
|
1240
|
1405
|
/// <summary>
|
|
|
@@ -1248,7 +1413,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1248
|
1413
|
res = true;
|
|
1249
|
1414
|
return res;
|
|
1250
|
1415
|
}
|
|
1251
|
|
-
|
|
|
1416
|
+
|
|
1252
|
1417
|
/// <summary>
|
|
1253
|
1418
|
/// 根据model返回CustomerBaseNewInput对象
|
|
1254
|
1419
|
/// </summary>
|
|
|
@@ -1450,6 +1615,15 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1450
|
1615
|
model.F_ZL_CJ_IsRecord = model1[i].F_ZL_CJ_IsRecord;//质量管理科-抽检-未备案、已备案
|
|
1451
|
1616
|
model.F_IsVisit = model1[i].F_IsVisit;//质量管理科-抽检-未备案、已备案
|
|
1452
|
1617
|
model.RemainingTime = TimeToOver(model1[i].F_ID);
|
|
|
1618
|
+
|
|
|
1619
|
+ model.F_VisitOn = model1[i].F_VisitOn;//回访时间
|
|
|
1620
|
+ model.F_VisitBy = model1[i].F_VisitBy;//回访人
|
|
|
1621
|
+ model.F_VisitResult = model1[i].F_VisitResult;//回访结果:非常满意、满意、一般、不满意
|
|
|
1622
|
+ model.F_VisitReason = model1[i].F_VisitReason;// 回访不满意原因
|
|
|
1623
|
+ model.F_Callresults = model1[i].F_Callresults;//呼叫结果
|
|
|
1624
|
+
|
|
|
1625
|
+
|
|
|
1626
|
+
|
|
1453
|
1627
|
model.F_IsOver = model1[i].F_IsOver;
|
|
1454
|
1628
|
|
|
1455
|
1629
|
if (userId >0)
|
|
|
@@ -1793,8 +1967,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1793
|
1967
|
}
|
|
1794
|
1968
|
else
|
|
1795
|
1969
|
{
|
|
1796
|
|
- var deptmodel = departmentBLL.GetModel(clbm);
|
|
1797
|
|
- if (deptmodel != null)
|
|
|
1970
|
+ var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
|
|
|
1971
|
+ if (deptmodel != null)
|
|
1798
|
1972
|
{
|
|
1799
|
1973
|
if (modlelist != null&& modlelist.Count >0)
|
|
1800
|
1974
|
{
|
|
|
@@ -1857,7 +2031,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1857
|
2031
|
|
|
1858
|
2032
|
if (modlelist[0] != null&& modlelist.Count >0)
|
|
1859
|
2033
|
{
|
|
1860
|
|
- var res = AssignWO(ua, modlelist[0], input, cont, clbm, clid, overtime, sms);
|
|
|
2034
|
+ var res = AssignWO(ua, modlelist[0], inputs, cont, clbm, clid, overtime, sms);
|
|
1861
|
2035
|
if (res)
|
|
1862
|
2036
|
return Success("转派成功");
|
|
1863
|
2037
|
else
|
|
|
@@ -1905,7 +2079,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1905
|
2079
|
}
|
|
1906
|
2080
|
else
|
|
1907
|
2081
|
{
|
|
1908
|
|
- var deptmodel = departmentBLL.GetModel(clbm);
|
|
|
2082
|
+ var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
|
|
1909
|
2083
|
if (deptmodel != null)
|
|
1910
|
2084
|
{
|
|
1911
|
2085
|
if (model != null)
|
|
|
@@ -2155,6 +2329,64 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
2155
|
2329
|
return Error("无操作权限");
|
|
2156
|
2330
|
}
|
|
2157
|
2331
|
/// <summary>
|
|
|
2332
|
+ /// 工单回访
|
|
|
2333
|
+ /// </summary>
|
|
|
2334
|
+ /// <param name="input"></param>
|
|
|
2335
|
+ /// <returns></returns>
|
|
|
2336
|
+ [Authority]
|
|
|
2337
|
+ public ActionResult ReturnvisitOrder(long orderid, string cont, string reason, string call )
|
|
|
2338
|
+ {
|
|
|
2339
|
+ int userId = CurrentUser.UserData.F_UserId;
|
|
|
2340
|
+ if (userId != 0)
|
|
|
2341
|
+ {
|
|
|
2342
|
+ Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
|
|
|
2343
|
+ if (ua != null)
|
|
|
2344
|
+ {
|
|
|
2345
|
+ Model.T_Wo_WorkOrder model = workOrder.GetModel(orderid);
|
|
|
2346
|
+ //验证信息
|
|
|
2347
|
+ if (model != null)
|
|
|
2348
|
+ {
|
|
|
2349
|
+ var res = Retu(ua, model, cont, reason, call);
|
|
|
2350
|
+ if (res)
|
|
|
2351
|
+ return Success("回访成功");
|
|
|
2352
|
+ else
|
|
|
2353
|
+ return Error("回访失败!");
|
|
|
2354
|
+ }
|
|
|
2355
|
+ return Error("工单不存在");
|
|
|
2356
|
+ }
|
|
|
2357
|
+ }
|
|
|
2358
|
+ return Error("无操作权限");
|
|
|
2359
|
+ }
|
|
|
2360
|
+ /// <summary>
|
|
|
2361
|
+ /// 工单完结
|
|
|
2362
|
+ /// </summary>
|
|
|
2363
|
+ /// <param name="input"></param>
|
|
|
2364
|
+ /// <returns></returns>
|
|
|
2365
|
+ [Authority]
|
|
|
2366
|
+ public ActionResult EndOrder(long orderid, int isover=0 )
|
|
|
2367
|
+ {
|
|
|
2368
|
+ int userId = CurrentUser.UserData.F_UserId;
|
|
|
2369
|
+ if (userId != 0)
|
|
|
2370
|
+ {
|
|
|
2371
|
+ Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
|
|
|
2372
|
+ if (ua != null)
|
|
|
2373
|
+ {
|
|
|
2374
|
+ Model.T_Wo_WorkOrder model = workOrder.GetModel(orderid);
|
|
|
2375
|
+ //验证信息
|
|
|
2376
|
+ if (model != null)
|
|
|
2377
|
+ {
|
|
|
2378
|
+ var res = Overorder(ua, model, isover);
|
|
|
2379
|
+ if (res)
|
|
|
2380
|
+ return Success("完结成功");
|
|
|
2381
|
+ else
|
|
|
2382
|
+ return Error("完结失败!");
|
|
|
2383
|
+ }
|
|
|
2384
|
+ return Error("工单不存在");
|
|
|
2385
|
+ }
|
|
|
2386
|
+ }
|
|
|
2387
|
+ return Error("无操作权限");
|
|
|
2388
|
+ }
|
|
|
2389
|
+ /// <summary>
|
|
2158
|
2390
|
///延期工单
|
|
2159
|
2391
|
/// </summary>
|
|
2160
|
2392
|
/// <returns></returns>
|
|
|
@@ -2301,9 +2533,6 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
2301
|
2533
|
|
|
2302
|
2534
|
return true;
|
|
2303
|
2535
|
}
|
|
2304
|
|
-
|
|
2305
|
|
-
|
|
2306
|
|
-
|
|
2307
|
2536
|
/// <summary>
|
|
2308
|
2537
|
/// 退回工单
|
|
2309
|
2538
|
/// </summary>
|
|
|
@@ -2378,6 +2607,135 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
2378
|
2607
|
#endregion
|
|
2379
|
2608
|
}
|
|
2380
|
2609
|
/// <summary>
|
|
|
2610
|
+ /// 回访工单
|
|
|
2611
|
+ /// </summary>
|
|
|
2612
|
+ public bool Retu(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, string cont,string reason, string call)
|
|
|
2613
|
+ {
|
|
|
2614
|
+ #region 工单处理
|
|
|
2615
|
+ int overtime = 0, sms = 0;
|
|
|
2616
|
+ var itemlasts = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.visit + " and F_WoID=" + model.F_ID + " ");
|
|
|
2617
|
+ if (itemlasts.Count > 0)
|
|
|
2618
|
+ {
|
|
|
2619
|
+ foreach (var it in itemlasts)
|
|
|
2620
|
+ {
|
|
|
2621
|
+ if (it.F_WoState == 1)
|
|
|
2622
|
+ {
|
|
|
2623
|
+ overtime = int.Parse(it.F_LimitTime);
|
|
|
2624
|
+ sms = int.Parse(it.F_IsSMS.ToString());
|
|
|
2625
|
+ }
|
|
|
2626
|
+ }
|
|
|
2627
|
+ }
|
|
|
2628
|
+ var opt = "回访";
|
|
|
2629
|
+ int optbut = (int)EnumItemOpt.visit;
|
|
|
2630
|
+ int wostate = (int)EnumWorkOrderState.evaluate;
|
|
|
2631
|
+ #region 读取当前登录人部门
|
|
|
2632
|
+ string deptname = "";
|
|
|
2633
|
+ var deptmodel = departmentBLL.GetModel(nowUser.F_DeptId);
|
|
|
2634
|
+ if (deptmodel != null)
|
|
|
2635
|
+ {
|
|
|
2636
|
+ deptname = deptmodel.F_DeptName + "-";
|
|
|
2637
|
+ }
|
|
|
2638
|
+ #endregion
|
|
|
2639
|
+ var content = deptname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + opt + "工单:回访结果:" + cont+" , " + "工单:呼叫结果:" + call;
|
|
|
2640
|
+
|
|
|
2641
|
+ var touser = "";
|
|
|
2642
|
+ 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();
|
|
|
2643
|
+ if (itemlast != null)
|
|
|
2644
|
+ touser = itemlast.F_CreateUser;
|
|
|
2645
|
+ var itemid = AddLog((int)model.F_ID, wostate, content, (int)EnumItemType.deal, optbut, touser, 0, nowUser, overtime, sms);
|
|
|
2646
|
+ if (itemid > 0)
|
|
|
2647
|
+ {
|
|
|
2648
|
+ #region 处理工单
|
|
|
2649
|
+ model.F_VisitOn = DateTime .Now ;
|
|
|
2650
|
+ model.F_VisitResult = cont ;
|
|
|
2651
|
+ model.F_VisitReason = reason;
|
|
|
2652
|
+ model.F_Callresults = call ;
|
|
|
2653
|
+ workOrder.Update(model);
|
|
|
2654
|
+ #endregion
|
|
|
2655
|
+ #region 推送消息
|
|
|
2656
|
+ #region 向上一级操作人员推送消息
|
|
|
2657
|
+ if (!string.IsNullOrWhiteSpace(touser) && touser != nowUser.F_UserCode)
|
|
|
2658
|
+ {//排除上一级指派人是自己
|
|
|
2659
|
+ sendsysmsg(model, nowUser, touser, (int)itemid, opt);
|
|
|
2660
|
+ var lastUser = sysUserAccountBll.GetModel(touser);
|
|
|
2661
|
+ if (lastUser != null && !string.IsNullOrEmpty(lastUser.F_WxOpenId))
|
|
|
2662
|
+ sendwxmsg(model, lastUser.F_WxOpenId, nowUser, opt);
|
|
|
2663
|
+ }
|
|
|
2664
|
+ #endregion
|
|
|
2665
|
+ #endregion
|
|
|
2666
|
+ return true;
|
|
|
2667
|
+ }
|
|
|
2668
|
+ else
|
|
|
2669
|
+ return false;
|
|
|
2670
|
+ #endregion
|
|
|
2671
|
+ }
|
|
|
2672
|
+ /// <summary>
|
|
|
2673
|
+ /// 完结工单
|
|
|
2674
|
+ /// </summary>
|
|
|
2675
|
+ public bool Overorder(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model,int isOver=0)
|
|
|
2676
|
+ {
|
|
|
2677
|
+ #region 工单处理
|
|
|
2678
|
+ int overtime = 0, sms = 0;
|
|
|
2679
|
+ var itemlasts = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.visit + " and F_WoID=" + model.F_ID + " ");
|
|
|
2680
|
+ if (itemlasts.Count > 0)
|
|
|
2681
|
+ {
|
|
|
2682
|
+ foreach (var it in itemlasts)
|
|
|
2683
|
+ {
|
|
|
2684
|
+ if (it.F_WoState == 1)
|
|
|
2685
|
+ {
|
|
|
2686
|
+ overtime = int.Parse(it.F_LimitTime);
|
|
|
2687
|
+ sms = int.Parse(it.F_IsSMS.ToString());
|
|
|
2688
|
+ }
|
|
|
2689
|
+ }
|
|
|
2690
|
+ }
|
|
|
2691
|
+ var opt = "完结";
|
|
|
2692
|
+ int optbut = (int)EnumItemOpt.end;
|
|
|
2693
|
+ int wostate = (int)EnumWorkOrderState.evaluate;
|
|
|
2694
|
+ if (isOver==0)
|
|
|
2695
|
+ {
|
|
|
2696
|
+ wostate = (int)EnumWorkOrderState.finish;
|
|
|
2697
|
+ }
|
|
|
2698
|
+
|
|
|
2699
|
+ #region 读取当前登录人部门
|
|
|
2700
|
+ string deptname = "";
|
|
|
2701
|
+ var deptmodel = departmentBLL.GetModel(nowUser.F_DeptId);
|
|
|
2702
|
+ if (deptmodel != null)
|
|
|
2703
|
+ {
|
|
|
2704
|
+ deptname = deptmodel.F_DeptName + "-";
|
|
|
2705
|
+ }
|
|
|
2706
|
+ #endregion
|
|
|
2707
|
+ var content = deptname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + opt + "完结工单";
|
|
|
2708
|
+
|
|
|
2709
|
+ var touser = "";
|
|
|
2710
|
+ 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();
|
|
|
2711
|
+ if (itemlast != null)
|
|
|
2712
|
+ touser = itemlast.F_CreateUser;
|
|
|
2713
|
+ var itemid = AddLog((int)model.F_ID, wostate, content, (int)EnumItemType.deal, optbut, touser, 0, nowUser, overtime, sms);
|
|
|
2714
|
+ if (itemid > 0)
|
|
|
2715
|
+ {
|
|
|
2716
|
+ #region 处理工单
|
|
|
2717
|
+ model.F_VisitOn = DateTime.Now;
|
|
|
2718
|
+
|
|
|
2719
|
+ workOrder.Update(model);
|
|
|
2720
|
+ #endregion
|
|
|
2721
|
+ #region 推送消息
|
|
|
2722
|
+ #region 向上一级操作人员推送消息
|
|
|
2723
|
+ if (!string.IsNullOrWhiteSpace(touser) && touser != nowUser.F_UserCode)
|
|
|
2724
|
+ {//排除上一级指派人是自己
|
|
|
2725
|
+ sendsysmsg(model, nowUser, touser, (int)itemid, opt);
|
|
|
2726
|
+ var lastUser = sysUserAccountBll.GetModel(touser);
|
|
|
2727
|
+ if (lastUser != null && !string.IsNullOrEmpty(lastUser.F_WxOpenId))
|
|
|
2728
|
+ sendwxmsg(model, lastUser.F_WxOpenId, nowUser, opt);
|
|
|
2729
|
+ }
|
|
|
2730
|
+ #endregion
|
|
|
2731
|
+ #endregion
|
|
|
2732
|
+ return true;
|
|
|
2733
|
+ }
|
|
|
2734
|
+ else
|
|
|
2735
|
+ return false;
|
|
|
2736
|
+ #endregion
|
|
|
2737
|
+ }
|
|
|
2738
|
+ /// <summary>
|
|
2381
|
2739
|
/// 处理工单
|
|
2382
|
2740
|
/// </summary>
|
|
2383
|
2741
|
public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont,int isover = 0,string uncont="")
|
|
|
@@ -2559,25 +2917,44 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
2559
|
2917
|
private Model.T_Wo_WorkOrder InToworkModel(Model.T_Wo_WorkOrder model, WorkOrderNewInput input)
|
|
2560
|
2918
|
|
|
2561
|
2919
|
{
|
|
|
2920
|
+ if (!string .IsNullOrEmpty (input.F_SC_ProductBase))
|
|
2562
|
2921
|
model.F_SC_ProductBase = input.F_SC_ProductBase;//市场管理科-生产基地(新乡、新疆、九江、东北、贴牌、无法确定)
|
|
2563
|
|
- model.F_SC_PreliminaryOpinion = input.F_SC_PreliminaryOpinion;// 市场管理科-初审意见:退货、换货、补偿、自行处理
|
|
2564
|
|
- model.F_SC_QualityMonth = input.F_SC_QualityMonth;//市场管理科-超出质保期限(算法:工单创建日期-生产日期,生产日期根据生产批次号获取,单位:月)
|
|
2565
|
|
- model.F_SC_CJ_SpotResult = input.F_SC_CJ_SpotResult;/// 市场管理科-抽检-抽检结果(视同合格、合格、不合格、复检后合格、未送检)
|
|
2566
|
|
- model.F_SC_CJ_SelfResult = input.F_SC_CJ_SelfResult;//市场管理科-抽检-自检结果
|
|
2567
|
|
- model.F_SC_CJ_ApprovalNo = input.F_SC_CJ_ApprovalNo;// 市场管理科-抽检-对应审批工作流单号
|
|
2568
|
|
- model.F_SC_CJ_ReturnAccount = input.F_SC_CJ_ReturnAccount;//市场管理科-抽检-确认返账金额(元)
|
|
2569
|
|
- model.F_ZL_QualityEventLevel = input.F_ZL_QualityEventLevel;// 质量管理科-质量事件等级(未遂、一般、较大、重大)
|
|
2570
|
|
- model.F_ZL_ClaimAmount = input.F_ZL_ClaimAmount;//质量管理科-索赔金额(单位元,对应责任单位)
|
|
2571
|
|
- model.F_ZL_ResponsibleUnit = input.F_ZL_ResponsibleUnit;//质量管理科-责任单位(需列出,可选多个)
|
|
2572
|
|
- model.F_ZL_ApprovalOpinions = input.F_ZL_ApprovalOpinions;// 质量管理科-审批意见(同意、不同意,若选择不同意,增加输入框输入补充内容)
|
|
2573
|
|
- model.F_ZL_ApprovalDisagree = input.F_ZL_ApprovalDisagree;// 质量管理科-审批不同意意见
|
|
2574
|
|
- model.F_ZL_CompensationMethod =input.F_ZL_CompensationMethod;//质量管理科-补偿方式(实物、钱款【单位元】,若选择钱款,增加输入框输入补充内容)
|
|
2575
|
|
- model.F_ZL_CompensationMoney = input.F_ZL_CompensationMoney;// 质量管理科-补偿钱款
|
|
2576
|
|
- model.F_ZL_CResponsibleUnits = input.F_ZL_CResponsibleUnits;//质量管理科-对应责任单位(生产、研发、农化、物流、质量管理科,销售内勤)
|
|
2577
|
|
- model.F_ZL_Fquantity = input.F_ZL_Fquantity;// 质量管理科-确认实收数量(吨)
|
|
2578
|
|
- model.F_ZL_ImprovementRequirements = input.F_ZL_ImprovementRequirements;//质量管理科-改进要求
|
|
2579
|
|
- model.F_ZL_CApprovalNo = input.F_ZL_CApprovalNo;//质量管理科-对应审批工作流单号
|
|
2580
|
|
- model.F_ZL_CJ_IsRecord = input.F_ZL_CJ_IsRecord;//质量管理科-抽检-未备案、已备案
|
|
|
2922
|
+ if (!string.IsNullOrEmpty(input.F_SC_PreliminaryOpinion))
|
|
|
2923
|
+ model.F_SC_PreliminaryOpinion = input.F_SC_PreliminaryOpinion;// 市场管理科-初审意见:退货、换货、补偿、自行处理
|
|
|
2924
|
+ if (!string.IsNullOrEmpty(input.F_SC_QualityMonth))
|
|
|
2925
|
+ model.F_SC_QualityMonth = input.F_SC_QualityMonth;//市场管理科-超出质保期限(算法:工单创建日期-生产日期,生产日期根据生产批次号获取,单位:月)
|
|
|
2926
|
+ if (!string.IsNullOrEmpty(input.F_SC_CJ_SpotResult))
|
|
|
2927
|
+ model.F_SC_CJ_SpotResult = input.F_SC_CJ_SpotResult;/// 市场管理科-抽检-抽检结果(视同合格、合格、不合格、复检后合格、未送检)
|
|
|
2928
|
+ if (!string.IsNullOrEmpty(input.F_SC_CJ_SelfResult))
|
|
|
2929
|
+ model.F_SC_CJ_SelfResult = input.F_SC_CJ_SelfResult;//市场管理科-抽检-自检结果
|
|
|
2930
|
+ if (!string.IsNullOrEmpty(input.F_SC_CJ_ApprovalNo))
|
|
|
2931
|
+ model.F_SC_CJ_ApprovalNo = input.F_SC_CJ_ApprovalNo;// 市场管理科-抽检-对应审批工作流单号
|
|
|
2932
|
+ if (!string.IsNullOrEmpty(input.F_SC_CJ_ReturnAccount))
|
|
|
2933
|
+ model.F_SC_CJ_ReturnAccount = input.F_SC_CJ_ReturnAccount;//市场管理科-抽检-确认返账金额(元)
|
|
|
2934
|
+ if (!string.IsNullOrEmpty(input.F_ZL_QualityEventLevel))
|
|
|
2935
|
+ model.F_ZL_QualityEventLevel = input.F_ZL_QualityEventLevel;// 质量管理科-质量事件等级(未遂、一般、较大、重大)
|
|
|
2936
|
+ if (!string.IsNullOrEmpty(input.F_ZL_ClaimAmount))
|
|
|
2937
|
+ model.F_ZL_ClaimAmount = input.F_ZL_ClaimAmount;//质量管理科-索赔金额(单位元,对应责任单位)
|
|
|
2938
|
+ if (!string.IsNullOrEmpty(input.F_ZL_ResponsibleUnit))
|
|
|
2939
|
+ model.F_ZL_ResponsibleUnit = input.F_ZL_ResponsibleUnit;//质量管理科-责任单位(需列出,可选多个)
|
|
|
2940
|
+ if (!string.IsNullOrEmpty(input.F_ZL_ApprovalOpinions))
|
|
|
2941
|
+ model.F_ZL_ApprovalOpinions = input.F_ZL_ApprovalOpinions;// 质量管理科-审批意见(同意、不同意,若选择不同意,增加输入框输入补充内容)
|
|
|
2942
|
+ if (!string.IsNullOrEmpty(input.F_ZL_ApprovalDisagree))
|
|
|
2943
|
+ model.F_ZL_ApprovalDisagree = input.F_ZL_ApprovalDisagree;// 质量管理科-审批不同意意见
|
|
|
2944
|
+ if (!string.IsNullOrEmpty(input.F_ZL_CompensationMethod))
|
|
|
2945
|
+ model.F_ZL_CompensationMethod =input.F_ZL_CompensationMethod;//质量管理科-补偿方式(实物、钱款【单位元】,若选择钱款,增加输入框输入补充内容)
|
|
|
2946
|
+ if (!string.IsNullOrEmpty(input.F_ZL_CompensationMoney))
|
|
|
2947
|
+ model.F_ZL_CompensationMoney = input.F_ZL_CompensationMoney;// 质量管理科-补偿钱款
|
|
|
2948
|
+ if (!string.IsNullOrEmpty(input.F_ZL_CResponsibleUnits))
|
|
|
2949
|
+ model.F_ZL_CResponsibleUnits = input.F_ZL_CResponsibleUnits;//质量管理科-对应责任单位(生产、研发、农化、物流、质量管理科,销售内勤)
|
|
|
2950
|
+ if (!string.IsNullOrEmpty(input.F_ZL_Fquantity))
|
|
|
2951
|
+ model.F_ZL_Fquantity = input.F_ZL_Fquantity;// 质量管理科-确认实收数量(吨)
|
|
|
2952
|
+ if (!string.IsNullOrEmpty(input.F_ZL_ImprovementRequirements))
|
|
|
2953
|
+ model.F_ZL_ImprovementRequirements = input.F_ZL_ImprovementRequirements;//质量管理科-改进要求
|
|
|
2954
|
+ if (!string.IsNullOrEmpty(input.F_ZL_CApprovalNo))
|
|
|
2955
|
+ model.F_ZL_CApprovalNo = input.F_ZL_CApprovalNo;//质量管理科-对应审批工作流单号
|
|
|
2956
|
+ if (!string.IsNullOrEmpty(input.F_ZL_CJ_IsRecord))
|
|
|
2957
|
+ model.F_ZL_CJ_IsRecord = input.F_ZL_CJ_IsRecord;//质量管理科-抽检-未备案、已备案
|
|
2581
|
2958
|
if (input .F_IsVisit !=null )
|
|
2582
|
2959
|
{
|
|
2583
|
2960
|
model.F_IsVisit = input.F_IsVisit;
|