1550076451 1 год назад
Родитель
Сommit
680c290147

+ 66 - 66
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

92
             {
92
             {
93
                 Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
93
                 Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
94
                 Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
94
                 Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
95
-                string sql = $"  F_IsDelete=0";
96
-                sql += "and F_Duplicate!=5";
95
+                string sql = $"  c.F_IsDelete=0";
96
+                sql += "and c.F_Duplicate!=5";
97
                 string where = "";
97
                 string where = "";
98
                 bool duplica = false;
98
                 bool duplica = false;
99
                 DataTable dt = new DataTable();
99
                 DataTable dt = new DataTable();
101
                 if (type > 0 )//工单类型
101
                 if (type > 0 )//工单类型
102
                 {
102
                 {
103
                     if (type == 1)
103
                     if (type == 1)
104
-                        sql += $" and (F_Type=" + type + "or ( F_Duplicate in(1)and F_Type!=2 and F_Type < 5 ))";
104
+                        sql += $" and (c.F_Type=" + type + "or ( F_Duplicate in(1)and c.F_Type!=2 and c.F_Type < 5 ))";
105
                     else if (type == 2)
105
                     else if (type == 2)
106
-                        sql += $" and (F_Type=" + type + "or (F_Duplicate!=1 and F_Duplicate!=4 and F_Type=3))";
106
+                        sql += $" and (c.F_Type=" + type + "or (F_Duplicate!=1 and F_Duplicate!=4 and c.F_Type=3))";
107
                     else if (type == 4)
107
                     else if (type == 4)
108
-                        sql += $" and (F_Type=" + 4 + "or (F_Duplicate in(4)and F_Type=3))";
108
+                        sql += $" and (c.F_Type=" + 4 + "or (F_Duplicate in(4)and c.F_Type=3))";
109
                     else
109
                     else
110
-                        sql += $" and F_Type=" + type;
110
+                        sql += $" and c.F_Type=" + type;
111
                 }
111
                 }
112
 
112
 
113
                 #endregion
113
                 #endregion
114
                 if (!string .IsNullOrEmpty (ywy ))
114
                 if (!string .IsNullOrEmpty (ywy ))
115
                 {
115
                 {
116
-                    sql += "AND F_Notifications ='" + ywy + "'";
116
+                    sql += "AND c.F_Notifications ='" + ywy + "'";
117
                 }
117
                 }
118
                 if (!string .IsNullOrEmpty (producttypes))
118
                 if (!string .IsNullOrEmpty (producttypes))
119
                 {
119
                 {
120
-                    sql += $" and F_ProductTypes='{producttypes}'";
120
+                    sql += $" and c.F_ProductTypes='{producttypes}'";
121
                 }
121
                 }
122
 
122
 
123
                 if (!string.IsNullOrEmpty(complaintType))
123
                 if (!string.IsNullOrEmpty(complaintType))
124
                 {
124
                 {
125
-                    sql += $" and F_ComplaintType='{complaintType}'";
125
+                    sql += $" and c.F_ComplaintType='{complaintType}'";
126
                 }
126
                 }
127
                 
127
                 
128
 
128
 
129
 
129
 
130
                 if (CJ == 1)
130
                 if (CJ == 1)
131
                 {
131
                 {
132
-                    sql += $" and (F_Type=" + 4 + "or (F_Duplicate in(4)and F_Type=3))";
132
+                    sql += $" and (c.F_Type=" + 4 + "or (F_Duplicate in(4)and c.F_Type=3))";
133
                     if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "ZG")
133
                     if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "ZG")
134
                     {
134
                     {
135
-                        sql += "AND F_Notifications ='" + ua.F_UserCode + "'";
135
+                        sql += "AND c.F_Notifications ='" + ua.F_UserCode + "'";
136
                     }
136
                     }
137
                     else if (ro.F_RoleCode == "BSCJL")
137
                     else if (ro.F_RoleCode == "BSCJL")
138
                     {
138
                     {
139
-                        sql += "AND F_Office =" + ua.F_DeptId;
139
+                        sql += "AND c.F_Office =" + ua.F_DeptId;
140
                     }
140
                     }
141
                     else if (ro.F_RoleCode == "ZR" || ro.F_RoleCode == "BBZY" || ro.F_RoleCode == "CJZY" || ro.F_RoleCode == "JCRY" || ro.F_RoleCode == "XTGLY" || ro.F_RoleCode == "CLZY")
141
                     else if (ro.F_RoleCode == "ZR" || ro.F_RoleCode == "BBZY" || ro.F_RoleCode == "CJZY" || ro.F_RoleCode == "JCRY" || ro.F_RoleCode == "XTGLY" || ro.F_RoleCode == "CLZY")
142
                     {
142
                     {
150
                     {
150
                     {
151
                         if (state != 11)
151
                         if (state != 11)
152
                         {
152
                         {
153
-                            sql += $" and (F_Type=" + 2 + "or (F_Duplicate!=1 and F_Duplicate!=4  and F_Type=3)or F_Type>4 )";
153
+                            sql += $" and (c.F_Type=" + 2 + "or (F_Duplicate!=1 and F_Duplicate!=4  and c.F_Type=3)or c.F_Type>4 )";
154
                         }
154
                         }
155
                     }
155
                     }
156
                   
156
                   
158
                        
158
                        
159
                 
159
                 
160
                 if (source > 0)//工单来源
160
                 if (source > 0)//工单来源
161
-                    sql += $" and F_Source=" + source;
161
+                    sql += $" and c.F_Source=" + source;
162
                 if (!string .IsNullOrEmpty (officename))
162
                 if (!string .IsNullOrEmpty (officename))
163
                 {
163
                 {
164
                     var dept = new BLL.T_Sys_Department().GetModelList("F_DeptName like '%" + officename + "%'").FirstOrDefault ();
164
                     var dept = new BLL.T_Sys_Department().GetModelList("F_DeptName like '%" + officename + "%'").FirstOrDefault ();
165
                     if (dept!=null )
165
                     if (dept!=null )
166
-                     sql += $" and F_Office ='"+ dept.F_DeptId +"'";
166
+                     sql += $" and c.F_Office ='" + dept.F_DeptId +"'";
167
                 }
167
                 }
168
                 if (!string.IsNullOrEmpty(area) && !string.IsNullOrEmpty(office))
168
                 if (!string.IsNullOrEmpty(area) && !string.IsNullOrEmpty(office))
169
                 {
169
                 {
170
-                        sql += $" and (F_Area in(" + area + ") or  F_Office in(" + office + "))";
170
+                        sql += $" and (c.F_Area in(" + area + ") or  c.F_Office in(" + office + "))";
171
                 }
171
                 }
172
                  else  if (!string.IsNullOrEmpty(area) )//大区
172
                  else  if (!string.IsNullOrEmpty(area) )//大区
173
-                    sql += $" and F_Area in(" + area+")";
173
+                    sql += $" and c.F_Area in(" + area+")";
174
                 else   if (!string.IsNullOrEmpty(office))//办事处
174
                 else   if (!string.IsNullOrEmpty(office))//办事处
175
-                    sql += $" and F_Office in(" + office+")";
175
+                    sql += $" and c.F_Office in(" + office+")";
176
                 if (duplicate >= 0)
176
                 if (duplicate >= 0)
177
-                    sql += $" and F_Type=" + 3 + "and   F_Duplicate!=1";
177
+                    sql += $" and c.F_Type=" + 3 + "and   F_Duplicate!=1";
178
                if (!string.IsNullOrEmpty(productType))//产品代码
178
                if (!string.IsNullOrEmpty(productType))//产品代码
179
-                    sql += $" and F_ProductType = '" + productType.Trim() + "'";
179
+                    sql += $" and c.F_ProductType = '" + productType.Trim() + "'";
180
                 if (!string.IsNullOrEmpty(productDate))//生产日期
180
                 if (!string.IsNullOrEmpty(productDate))//生产日期
181
-                    sql += $" and F_ProductDate = '" + productDate.Trim() + "'";
181
+                    sql += $" and c.F_ProductDate = '" + productDate.Trim() + "'";
182
                 if (!string.IsNullOrEmpty(batchNumber))//产品编码
182
                 if (!string.IsNullOrEmpty(batchNumber))//产品编码
183
-                    sql += $" and F_BatchNumber like '%" + batchNumber.Trim() + "%'";
183
+                    sql += $" and c.F_BatchNumber like '%" + batchNumber.Trim() + "%'";
184
                 if (reminder==0)
184
                 if (reminder==0)
185
                 {
185
                 {
186
-                    sql += $" and F_DealType ='1' ";
186
+                    sql += $" and c.F_DealType ='1' ";
187
                 }
187
                 }
188
                 else if (reminder > 0)
188
                 else if (reminder > 0)
189
                 {
189
                 {
190
-                    sql += $" and   F_DealType is null ";
190
+                    sql += $" and   c.F_DealType is null ";
191
                 }
191
                 }
192
                 if (isreductions > 0)
192
                 if (isreductions > 0)
193
                 {
193
                 {
194
-                    sql += $" and (F_IsReduction !='2' or  F_IsReduction is null )";
194
+                    sql += $" and (c.F_IsReduction !='2' or c. F_IsReduction is null )";
195
                 }
195
                 }
196
                 else
196
                 else
197
                 {
197
                 {
198
-                    sql += $" and (F_IsReduction !='1'  or  F_IsReduction is null ) ";
198
+                    sql += $" and (c.F_IsReduction !='1'  or  c.F_IsReduction is null ) ";
199
                 }
199
                 }
200
              
200
              
201
 
201
 
202
                 if (incomplete== 0)
202
                 if (incomplete== 0)
203
                 {
203
                 {
204
                     
204
                     
205
-                 sql += $" and F_DealState ='1' ";
205
+                 sql += $" and c.F_DealState ='1' ";
206
 
206
 
207
                 }
207
                 }
208
                 else  if (incomplete > 0)
208
                 else  if (incomplete > 0)
209
                 {
209
                 {
210
-                    sql += $" and   F_DealState is null ";
210
+                    sql += $" and   c.F_DealState is null ";
211
                 }
211
                 }
212
                 if (isdealfile==0)
212
                 if (isdealfile==0)
213
                 {
213
                 {
214
-                    sql += $" and (F_DealFile is null or F_DealFile = '') ";
214
+                    sql += $" and (c.F_DealFile is null or c.F_DealFile = '') ";
215
 
215
 
216
                 }
216
                 }
217
                else  if (isdealfile > 0)
217
                else  if (isdealfile > 0)
218
                 {
218
                 {
219
-                    sql += $" and F_DealFile is not null and F_DealFile != '' ";
219
+                    sql += $" and c.F_DealFile is not null and c.F_DealFile != '' ";
220
                 }
220
                 }
221
                 if (!string.IsNullOrEmpty(manufacturer))//生产厂家
221
                 if (!string.IsNullOrEmpty(manufacturer))//生产厂家
222
                 {
222
                 {
252
                             msg = msg + "," + "'" + it + "'";
252
                             msg = msg + "," + "'" + it + "'";
253
                         }
253
                         }
254
                     }
254
                     }
255
-                    sql += $" and F_ProblemCode  in (" + msg + ")";
255
+                    sql += $" and c.F_ProblemCode  in (" + msg + ")";
256
                 }
256
                 }
257
                    
257
                    
258
                 if (!string.IsNullOrEmpty(notifications))//通知人
258
                 if (!string.IsNullOrEmpty(notifications))//通知人
259
-                    sql += $" and F_Notifications = '" + notifications.Trim() + "'";
259
+                    sql += $" and c.F_Notifications = '" + notifications.Trim() + "'";
260
                 if (!string.IsNullOrEmpty(productName))//产品名称
260
                 if (!string.IsNullOrEmpty(productName))//产品名称
261
-                    sql += $" and F_ProductName like '%" + productName.Trim() + "%'";
261
+                    sql += $" and c.F_ProductName like '%" + productName.Trim() + "%'";
262
                 
262
                 
263
                 if (!string.IsNullOrEmpty(dealTimely))//重要级别
263
                 if (!string.IsNullOrEmpty(dealTimely))//重要级别
264
                 {
264
                 {
285
                     sql += " and datediff(day,c.F_CreateTime,'" + DateTime.Now.ToString("yyyy-MM-dd") + "')>=0   ";
285
                     sql += " and datediff(day,c.F_CreateTime,'" + DateTime.Now.ToString("yyyy-MM-dd") + "')>=0   ";
286
                 }
286
                 }
287
                 if (IsReduction>-1)
287
                 if (IsReduction>-1)
288
-                    sql += " and F_IsReduction ="+ IsReduction;
288
+                    sql += " and c.F_IsReduction =" + IsReduction;
289
                 if (!string.IsNullOrEmpty(duplicatetime))
289
                 if (!string.IsNullOrEmpty(duplicatetime))
290
                 {
290
                 {
291
                     
291
                     
292
                     duplica = true;
292
                     duplica = true;
293
-                    sql += $" and F_Type=" + 3;
294
-                    where += " and datediff(day,c.F_CreateTime,'" + duplicatetime + "')<=0 ";
293
+                    sql += $" and c.F_Type=" + 3;
294
+                    where += " and datediff(day,n.F_CreateTime,'" + duplicatetime + "')<=0 ";
295
                 }
295
                 }
296
                 if (!string.IsNullOrEmpty(endduplicatetime))
296
                 if (!string.IsNullOrEmpty(endduplicatetime))
297
                 {
297
                 {
298
                     duplica = true;
298
                     duplica = true;
299
-                    sql += $" and F_Type=" + 3;
300
-                    where += " and datediff(day,c.F_CreateTime,'" + endduplicatetime + "')>=0   ";
299
+                    sql += $" and c.F_Type=" + 3;
300
+                    where += " and datediff(day,n.F_CreateTime,'" + endduplicatetime + "')>=0   ";
301
                 }
301
                 }
302
                     if (!string.IsNullOrEmpty(keywords))
302
                     if (!string.IsNullOrEmpty(keywords))
303
                     {
303
                     {
308
                      
308
                      
309
                     }
309
                     }
310
                         else
310
                         else
311
-                        sql += $"  and (F_CusPhone like '%" + keywords.Trim() + "%' or F_QualityProblem like '%" + keywords.Trim() + "%'or F_Samplingtype like '%" + keywords.Trim() + "%'or F_Salesroom like '%" + keywords.Trim() 
312
-                            + "%'or F_Samplingproducts like '%" + keywords.Trim() + "%'or F_Factories like '%" 
313
-                            + keywords.Trim() + "%'or c.F_DealResult like '%" + keywords.Trim() + "%'or F_AddRess like '%" 
314
-                            + keywords.Trim() + "%'or c.F_Remark like '%" + keywords.Trim() + "%'or F_Content like '%" + keywords.Trim() + "%' ) ";
311
+                        sql += $"  and (c.F_CusPhone like '%" + keywords.Trim() + "%' or c.F_QualityProblem like '%" + keywords.Trim() + "%'or F_Samplingtype like '%" + keywords.Trim() + "%'or F_Salesroom like '%" + keywords.Trim() 
312
+                            + "%'or c.F_Samplingproducts like '%" + keywords.Trim() + "%'or c.F_Factories like '%"
313
+                            + keywords.Trim() + "%'or c.F_DealResult like '%" + keywords.Trim() + "%'or c.F_AddRess like '%"
314
+                            + keywords.Trim() + "%'or c.F_Remark like '%" + keywords.Trim() + "%'or c.F_Content like '%" + keywords.Trim() + "%' ) ";
315
                 }
315
                 }
316
                 
316
                 
317
                 if (!string.IsNullOrWhiteSpace(code))//工单编号
317
                 if (!string.IsNullOrWhiteSpace(code))//工单编号
318
-                    sql += $" and F_WorkOrderId like '%" + code.Trim() + "%'";
318
+                    sql += $" and c.F_WorkOrderId like '%" + code.Trim() + "%'";
319
                
319
                
320
                 string uwhere = " ";
320
                 string uwhere = " ";
321
                 if (state > -1)
321
                 if (state > -1)
326
                         case 0://待提交
326
                         case 0://待提交
327
                             if (ro.F_RoleCode == "XTGLY" || ro.F_RoleCode == "JCRY" || ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBTZX" || ro.F_RoleCode == "ZR")
327
                             if (ro.F_RoleCode == "XTGLY" || ro.F_RoleCode == "JCRY" || ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBTZX" || ro.F_RoleCode == "ZR")
328
                             {
328
                             {
329
-                                sql += " AND F_State in(0)";
329
+                                sql += " AND c.F_State in(0)";
330
                             }
330
                             }
331
                             else if (ro.F_RoleCode == "CLZY")
331
                             else if (ro.F_RoleCode == "CLZY")
332
                             {
332
                             {
333
                                 if (see == 0)
333
                                 if (see == 0)
334
-                                    sql += "AND F_State in(0)";
334
+                                    sql += "AND c.F_State in(0)";
335
                                 else
335
                                 else
336
                                     return Success("暂无工单");
336
                                     return Success("暂无工单");
337
                             }
337
                             }
339
                                 return Error("无操作权限");
339
                                 return Error("无操作权限");
340
                             break;
340
                             break;
341
                         case 1://待分派
341
                         case 1://待分派
342
-                            sql += "AND F_State in(1)";
342
+                            sql += "AND c.F_State in(1)";
343
                             sql += RetuSql(ro, see, ua);
343
                             sql += RetuSql(ro, see, ua);
344
                             if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "QTJS" || ro.F_RoleCode == "ZG")
344
                             if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "QTJS" || ro.F_RoleCode == "ZG")
345
                                 return Error("无操作权限");
345
                                 return Error("无操作权限");
346
                             break;
346
                             break;
347
                         case 3://待处理
347
                         case 3://待处理
348
-                            sql += "AND F_State=3";
348
+                            sql += "AND c.F_State=3";
349
                             sql += RetuSql(ro, see, ua);
349
                             sql += RetuSql(ro, see, ua);
350
                             if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "ZG")
350
                             if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "ZG")
351
                             {
351
                             {
355
                                 return Error("无操作权限");
355
                                 return Error("无操作权限");
356
                             break;
356
                             break;
357
                         case 4://处理中
357
                         case 4://处理中
358
-                            sql += "AND F_State=4";
358
+                            sql += "AND c.F_State=4";
359
                             sql += RetuSql(ro, see, ua);
359
                             sql += RetuSql(ro, see, ua);
360
                             if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "ZG")
360
                             if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "ZG")
361
                             {
361
                             {
365
                                 return Error("无操作权限");
365
                                 return Error("无操作权限");
366
                             break;
366
                             break;
367
                         case 5://退回待分派
367
                         case 5://退回待分派
368
-                            sql += "AND F_State=5";
368
+                            sql += "AND c.F_State=5";
369
                             sql += RetuSql(ro, see, ua);
369
                             sql += RetuSql(ro, see, ua);
370
                             if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "QTJS" || ro.F_RoleCode == "ZG")
370
                             if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "QTJS" || ro.F_RoleCode == "ZG")
371
                                 return Error("无操作权限");
371
                                 return Error("无操作权限");
372
                             break;
372
                             break;
373
                         case 6://退回待提交
373
                         case 6://退回待提交
374
-                            sql += "AND F_State=6";
374
+                            sql += "AND c.F_State=6";
375
                             sql += RetuSql(ro, see, ua);
375
                             sql += RetuSql(ro, see, ua);
376
                             if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "QTJS" || ro.F_RoleCode == "ZG")
376
                             if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "QTJS" || ro.F_RoleCode == "ZG")
377
                                 return Error("无操作权限");
377
                                 return Error("无操作权限");
378
                             break;
378
                             break;
379
                         case 7://抽检列表
379
                         case 7://抽检列表
380
-                            sql += "AND F_Duplicate=6";
380
+                            sql += "AND c.F_Duplicate=6";
381
                             if (ro.F_RoleCode == "BSCJL" || ro.F_RoleCode == "YWY"|| ro .F_RoleCode =="ZG")
381
                             if (ro.F_RoleCode == "BSCJL" || ro.F_RoleCode == "YWY"|| ro .F_RoleCode =="ZG")
382
                             {
382
                             {
383
                                 sql += "AND F_Notifications =" + ua.F_UserCode;
383
                                 sql += "AND F_Notifications =" + ua.F_UserCode;
397
                                 return Error("无操作权限");
397
                                 return Error("无操作权限");
398
                             break;
398
                             break;
399
                         case 10://已完结
399
                         case 10://已完结
400
-                            sql += "AND F_State=10";
400
+                            sql += "AND c.F_State=10";
401
                             sql += RetuSql(ro, see, ua);
401
                             sql += RetuSql(ro, see, ua);
402
                             if ( ro.F_RoleCode == "YWY" || ro.F_RoleCode == "ZG")
402
                             if ( ro.F_RoleCode == "YWY" || ro.F_RoleCode == "ZG")
403
                             {
403
                             {
408
                                 return Error("无操作权限");
408
                                 return Error("无操作权限");
409
                             break;
409
                             break;
410
                         case 11:
410
                         case 11:
411
-                            sql += $" and (F_Type=" + 1 + "or ( F_Duplicate in(1)and F_Type!=2 and F_Type < 5 ))";
411
+                            sql += $" and (c.F_Type=" + 1 + "or ( F_Duplicate in(1)and c.F_Type!=2 and c.F_Type < 5 ))";
412
                             sql += RetuSql(ro, see, ua);
412
                             sql += RetuSql(ro, see, ua);
413
                             if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "ZG")
413
                             if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "ZG")
414
-                                sql += "AND F_DealUser=" + ua.F_UserCode;
414
+                                sql += "AND c.F_DealUser=" + ua.F_UserCode;
415
                             if (ro.F_RoleCode == "QTJS")
415
                             if (ro.F_RoleCode == "QTJS")
416
                                 return Error("无操作权限");
416
                                 return Error("无操作权限");
417
                             break;
417
                             break;
426
                 if (duplica)
426
                 if (duplica)
427
                 {
427
                 {
428
                     if (GetDuplica(where) != null)
428
                     if (GetDuplica(where) != null)
429
-                        sql += "AND F_Id in(" + GetDuplica(where) + ")";
429
+                        sql += "AND c.F_Id in(" + GetDuplica(where) + ")";
430
                     else
430
                     else
431
                         return Success("暂无工单");
431
                         return Success("暂无工单");
432
                 }
432
                 }
836
                         sql += $" and (F_DealTimely= '1类问题' or F_DealTimely= 'Ⅰ级' )";
836
                         sql += $" and (F_DealTimely= '1类问题' or F_DealTimely= 'Ⅰ级' )";
837
                 }
837
                 }
838
                 if (!string.IsNullOrEmpty(starttime))
838
                 if (!string.IsNullOrEmpty(starttime))
839
-                    sql += " and datediff(day,F_CreateTime,'" + starttime + "')<=0 ";
839
+                    sql += " and datediff(day,c.F_CreateTime,'" + starttime + "')<=0 ";
840
                 if (!string.IsNullOrEmpty(endtime))
840
                 if (!string.IsNullOrEmpty(endtime))
841
-                    sql += " and datediff(day,F_CreateTime,'" + endtime + "')>=0   ";
841
+                    sql += " and datediff(day,c.F_CreateTime,'" + endtime + "')>=0   ";
842
                 if (istime == 0)
842
                 if (istime == 0)
843
                 {
843
                 {
844
-                    sql += " and datediff(day,F_CreateTime,'" + DateTime.Now.ToString("yyyy-MM-dd") + "')<=0 ";
845
-                    sql += " and datediff(day,F_CreateTime,'" + DateTime.Now.ToString("yyyy-MM-dd") + "')>=0   ";
844
+                    sql += " and datediff(day,c.F_CreateTime,'" + DateTime.Now.ToString("yyyy-MM-dd") + "')<=0 ";
845
+                    sql += " and datediff(day,c.F_CreateTime,'" + DateTime.Now.ToString("yyyy-MM-dd") + "')>=0   ";
846
                 }
846
                 }
847
                 if (istime > 0)
847
                 if (istime > 0)
848
                 {
848
                 {
849
-                    sql += " and datediff(day,F_CreateTime,'" + DateTime.Now.ToString("yyyy-MM")
849
+                    sql += " and datediff(day,c.F_CreateTime,'" + DateTime.Now.ToString("yyyy-MM")
850
                       + "-01" + "')<=0 ";
850
                       + "-01" + "')<=0 ";
851
-                    sql += " and datediff(day,F_CreateTime,'" + DateTime.Now.ToString("yyyy-MM-dd") + "')>=0   ";
851
+                    sql += " and datediff(day,c.F_CreateTime,'" + DateTime.Now.ToString("yyyy-MM-dd") + "')>=0   ";
852
                 }
852
                 }
853
                 if (IsReduction > -1)
853
                 if (IsReduction > -1)
854
                     sql += " and F_IsReduction =" + IsReduction;
854
                     sql += " and F_IsReduction =" + IsReduction;
857
 
857
 
858
                     duplica = true;
858
                     duplica = true;
859
                     sql += $" and F_Type=" + 3;
859
                     sql += $" and F_Type=" + 3;
860
-                    where += " and datediff(day,F_CreateTime,'" + duplicatetime + "')<=0 ";
860
+                    where += " and datediff(day,n.F_CreateTime,'" + duplicatetime + "')<=0 ";
861
                 }
861
                 }
862
                 if (!string.IsNullOrEmpty(endduplicatetime))
862
                 if (!string.IsNullOrEmpty(endduplicatetime))
863
                 {
863
                 {
864
                     duplica = true;
864
                     duplica = true;
865
                     sql += $" and F_Type=" + 3;
865
                     sql += $" and F_Type=" + 3;
866
-                    where += " and datediff(day,F_CreateTime,'" + endduplicatetime + "')>=0   ";
866
+                    where += " and datediff(day,n.F_CreateTime,'" + endduplicatetime + "')>=0   ";
867
                 }
867
                 }
868
                 if (!string.IsNullOrEmpty(keywords))
868
                 if (!string.IsNullOrEmpty(keywords))
869
                 {
869
                 {
1167
                     {
1167
                     {
1168
 
1168
 
1169
                         dt = BLL.PagerBLL.GetListPager(
1169
                         dt = BLL.PagerBLL.GetListPager(
1170
-                           "T_Bus_WorkOrder WITH(NOLOCK) ",
1170
+                           "T_Bus_WorkOrder c WITH(NOLOCK) ",
1171
                            "F_Id",
1171
                            "F_Id",
1172
                             "*",
1172
                             "*",
1173
                             sql,
1173
                             sql,
1382
     
1382
     
1383
             string[] ccc = {
1383
             string[] ccc = {
1384
                    "工单编号","大区","办事处","投诉时间","序号","姓名","地址","联系电话","产品代码",
1384
                    "工单编号","大区","办事处","投诉时间","序号","姓名","地址","联系电话","产品代码",
1385
-                  "产品名称","规格","+生产日期","产品编码","生产厂家","问题代码","质量问题","通知人"
1385
+                  "产品名称","规格","生产日期","产品编码","生产厂家","问题代码","质量问题","通知人"
1386
                   ,"接听人" ,"落实情况","处理进度","工单类别","产品类型","投诉类型","分派时间","接单时间","处理时间","备注"
1386
                   ,"接听人" ,"落实情况","处理进度","工单类别","产品类型","投诉类型","分派时间","接单时间","处理时间","备注"
1387
             };
1387
             };
1388
             return ccc; 
1388
             return ccc; 
2004
         public string GetDuplica(string time)
2004
         public string GetDuplica(string time)
2005
         {
2005
         {
2006
             string str = string.Empty;
2006
             string str = string.Empty;
2007
-            str = "select F_WoID from T_Wo_WorkOrderItem_New where   F_ItemType=" + 11 + time;
2007
+            str = "select F_WoID from T_Wo_WorkOrderItem_New n where   F_ItemType=" + 11 + time;
2008
             return str;
2008
             return str;
2009
         }
2009
         }
2010
         /// <summary>
2010
         /// <summary>

+ 8 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkorderAppController.cs

888
                 var configfj = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
888
                 var configfj = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
889
                 var FileUrl = GetFileData(model.F_DealFile .ToString(), configfj.F_ParamValue);
889
                 var FileUrl = GetFileData(model.F_DealFile .ToString(), configfj.F_ParamValue);
890
                 var buttons = ButtonGroup.GetButtons(model.F_State.ToString (), ro.F_RoleCode );
890
                 var buttons = ButtonGroup.GetButtons(model.F_State.ToString (), ro.F_RoleCode );
891
-              
892
-               
891
+                 if (ro.F_RoleCode== "CLZY")
892
+                {
893
+                    if (model.F_State==1 || model.F_State == 10 || model.F_State == 3 || model.F_State == 5 || model.F_State == 4)
894
+                    {
895
+                        buttons.Add(ButtonGroup.goback());
896
+                    }
897
+                }
898
+
893
                 if (list.Count > 0)
899
                 if (list.Count > 0)
894
                 {
900
                 {
895
                     List<WorkOrderInput> Input = modeltooip(list);
901
                     List<WorkOrderInput> Input = modeltooip(list);

+ 2 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Common/ButtonGroup.cs

88
                     else if (code == "CLZY")
88
                     else if (code == "CLZY")
89
                     {
89
                     {
90
                         buttons.Add(Remin());
90
                         buttons.Add(Remin());
91
-                      
92
-                        
91
+                       
92
+
93
                     }
93
                     }
94
                     break;
94
                     break;
95
                 case "3":
95
                 case "3":

+ 3 - 1
codegit/CallCenterCommon/CallCenter.Utility/NPOI/NPOIHelper.cs

238
                 //}
238
                 //}
239
                 return "";
239
                 return "";
240
             }
240
             }
241
-            catch
241
+            catch (Exception e)
242
             {
242
             {
243
+                LogFactory.GetLogger("导出").Error(e.ToJson());
243
                 return "导出失败!";
244
                 return "导出失败!";
244
             }
245
             }
245
         }
246
         }
1961
             }
1962
             }
1962
             catch (Exception e)
1963
             catch (Exception e)
1963
             {
1964
             {
1965
+                LogFactory.GetLogger("导出").Error(e.ToJson());
1964
                 return "导出失败!" + e.Message;
1966
                 return "导出失败!" + e.Message;
1965
             }
1967
             }
1966
         }
1968
         }