|
|
@@ -105,7 +105,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
105
|
105
|
string strusercode = HttpUtility.UrlDecode(RequestString.GetQueryString("usercode"));//创建人工号
|
|
106
|
106
|
string source = HttpUtility.UrlDecode(RequestString.GetQueryString("source"));//工单来源
|
|
107
|
107
|
string infotype = HttpUtility.UrlDecode(RequestString.GetQueryString("infotype"));//信息分类
|
|
108
|
|
-
|
|
|
108
|
+
|
|
109
|
109
|
|
|
110
|
110
|
string strpageindex = RequestString.GetQueryString("page");
|
|
111
|
111
|
int pageindex = 1;
|
|
|
@@ -145,7 +145,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
145
|
145
|
{
|
|
146
|
146
|
sql += " and InfoTypeID = " + infotype + " ";
|
|
147
|
147
|
}
|
|
148
|
|
-
|
|
|
148
|
+
|
|
149
|
149
|
if (source.Trim() != "" && source != "undefined")
|
|
150
|
150
|
{
|
|
151
|
151
|
sql += " and Source = '" + source + "' ";
|
|
|
@@ -208,36 +208,9 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
208
|
208
|
string content = RequestString.GetFormString("content");
|
|
209
|
209
|
string files = RequestString.GetFormString("files");
|
|
210
|
210
|
int type = RequestString.GetInt("type", 3);//默认为3投诉建议
|
|
211
|
|
-
|
|
|
211
|
+
|
|
212
|
212
|
string stropenid = HttpUtility.UrlDecode(RequestString.GetFormString("openid"));
|
|
213
|
213
|
var wxuser = new BLL.T_Sys_Users().GetModelList(" F_OpenId='" + stropenid.Trim() + "' and F_Type=1 ").FirstOrDefault();
|
|
214
|
|
- string fileids = "";
|
|
215
|
|
- #region 上传附件
|
|
216
|
|
- //HttpFileCollection files = RequestString.GetFiles();
|
|
217
|
|
- //if (files.Count > 0)
|
|
218
|
|
- //{
|
|
219
|
|
- // List<Model.T_Sys_Accessories> acs = new List<Model.T_Sys_Accessories>();
|
|
220
|
|
- // string path = "/Upload/Files/" + DateTime.Now.ToString("yyyy/MM/dd") + "/";
|
|
221
|
|
- // for (int i = 0; i < files.Count; i++)
|
|
222
|
|
- // {
|
|
223
|
|
- // HttpPostedFile file = files[i];
|
|
224
|
|
- // FileUp fu = new FileUp();
|
|
225
|
|
-
|
|
226
|
|
- // string name = fu.Upload(file, path);
|
|
227
|
|
-
|
|
228
|
|
- // Model.T_Sys_Accessories model_T_Sys_Accessories = new Model.T_Sys_Accessories();
|
|
229
|
|
- // model_T_Sys_Accessories.F_AddTime = DateTime.Now;//上传时间
|
|
230
|
|
- // model_T_Sys_Accessories.F_FileName = name;//附件名称
|
|
231
|
|
- // model_T_Sys_Accessories.F_FileType = System.IO.Path.GetExtension(file.FileName);//附件类型
|
|
232
|
|
- // model_T_Sys_Accessories.F_FileUrl = path + name;//附件地址
|
|
233
|
|
- // model_T_Sys_Accessories.F_Size = file.ContentLength;
|
|
234
|
|
- // int id = new BLL.T_Sys_Accessories().Add(model_T_Sys_Accessories);
|
|
235
|
|
- // model_T_Sys_Accessories.F_FileId = id;
|
|
236
|
|
- // acs.Add(model_T_Sys_Accessories);
|
|
237
|
|
- // fileids += id.ToString() + ",";
|
|
238
|
|
- // }
|
|
239
|
|
- //}
|
|
240
|
|
- #endregion
|
|
241
|
214
|
|
|
242
|
215
|
workorder.WorkOrderController wo = new workorder.WorkOrderController();
|
|
243
|
216
|
string workorderid = wo.AddWorkOrders(type, cusname, cusphone, content, files);
|
|
|
@@ -256,6 +229,38 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
256
|
229
|
}
|
|
257
|
230
|
|
|
258
|
231
|
}
|
|
|
232
|
+
|
|
|
233
|
+ /// <summary>
|
|
|
234
|
+ /// 处理工单
|
|
|
235
|
+ /// </summary>
|
|
|
236
|
+ /// <returns></returns>
|
|
|
237
|
+ [WechatActionFilter]
|
|
|
238
|
+ public ActionResult DealWorkOrder()
|
|
|
239
|
+ {
|
|
|
240
|
+ DataTable dt = new DataTable();
|
|
|
241
|
+ string orderid = RequestString.GetFormString("orderid");
|
|
|
242
|
+ string clcont = HttpUtility.UrlDecode(RequestString.GetFormString("clcont"));
|
|
|
243
|
+
|
|
|
244
|
+ int isaudit = RequestString.GetFormInt("isaudit", 0);
|
|
|
245
|
+ int infotypeid = RequestString.GetFormInt("infotypeid", 0);
|
|
|
246
|
+ int unitid = RequestString.GetFormInt("unitid", 0);
|
|
|
247
|
+
|
|
|
248
|
+ string stropenid = HttpUtility.UrlDecode(RequestString.GetFormString("openid"));
|
|
|
249
|
+
|
|
|
250
|
+ workorder.WorkOrderController wo = new workorder.WorkOrderController();
|
|
|
251
|
+ bool res = wo.DealWorkOrders(orderid, clcont, stropenid, isaudit, infotypeid, unitid);
|
|
|
252
|
+
|
|
|
253
|
+ if (res)
|
|
|
254
|
+ {
|
|
|
255
|
+ return Error("操作失败");
|
|
|
256
|
+ }
|
|
|
257
|
+ else
|
|
|
258
|
+ {
|
|
|
259
|
+ return Success("操作成功");
|
|
|
260
|
+ }
|
|
|
261
|
+
|
|
|
262
|
+ }
|
|
|
263
|
+
|
|
259
|
264
|
/// <summary>
|
|
260
|
265
|
/// 获取工单详情
|
|
261
|
266
|
/// </summary>
|
|
|
@@ -276,11 +281,10 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
276
|
281
|
var dt = DbHelperSQL.Query(sql).Tables[0];
|
|
277
|
282
|
if (dt.Rows.Count > 0)
|
|
278
|
283
|
{
|
|
279
|
|
- var configly = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayLeaveVoice' ").FirstOrDefault();
|
|
280
|
284
|
var config = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
|
|
281
|
285
|
var configfj = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
|
|
282
|
286
|
|
|
283
|
|
-
|
|
|
287
|
+
|
|
284
|
288
|
if (configfj != null)
|
|
285
|
289
|
{
|
|
286
|
290
|
dt = BindFileData(dt, configfj.F_ParamValue);
|
|
|
@@ -289,24 +293,15 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
289
|
293
|
string gcsql = "select *,dbo.GetUserName(F_CreateUser) as UserName "
|
|
290
|
294
|
+ "from T_Wo_Operation where F_IsDelete=0 and F_WorkOrderId ='" + dt.Rows[0]["WorkOrderId"] + "'";
|
|
291
|
295
|
var gcdt = DbHelperSQL.Query(gcsql).Tables[0];
|
|
292
|
|
- gcdt.Columns.Add("File", typeof(object));
|
|
293
|
|
- gcdt.Columns.Add("FilePath", typeof(string));
|
|
294
|
|
- if (configfj != null || configly != null || config != null)
|
|
|
296
|
+
|
|
|
297
|
+ dt.Columns.Add("FilePath", typeof(string));
|
|
|
298
|
+ if (configfj != null || config != null)
|
|
295
|
299
|
{
|
|
296
|
|
- foreach (DataRow bldr in gcdt.Rows)
|
|
|
300
|
+ foreach (DataRow bldr in dt.Rows)
|
|
297
|
301
|
{
|
|
298
|
|
- if (bldr["F_File"] != null && bldr["F_File"].ToString() != "" && configfj != null)
|
|
299
|
|
- {
|
|
300
|
|
- bldr["File"] = GetFileData(bldr["F_File"].ToString(), configfj.F_ParamValue);
|
|
301
|
|
- }
|
|
302
|
|
-
|
|
303
|
|
- if (bldr["F_LeaveRecordId"] != null && configly != null)
|
|
304
|
|
- {
|
|
305
|
|
- bldr["FilePath"] = GetLeavePath(bldr["F_LeaveRecordId"].ToString(), config.F_ParamValue);
|
|
306
|
|
- }
|
|
307
|
|
- else if (bldr["F_CallRecordId"] != null && config != null)
|
|
|
302
|
+ if (bldr["CallID"] != null && config != null)
|
|
308
|
303
|
{
|
|
309
|
|
- bldr["FilePath"] = GetCallPath(bldr["F_CallRecordId"].ToString(), config.F_ParamValue);
|
|
|
304
|
+ bldr["FilePath"] = GetCallPath(bldr["CallID"].ToString(), config.F_ParamValue);
|
|
310
|
305
|
}
|
|
311
|
306
|
}
|
|
312
|
307
|
}
|
|
|
@@ -329,7 +324,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
329
|
324
|
}
|
|
330
|
325
|
|
|
331
|
326
|
}
|
|
332
|
|
-
|
|
|
327
|
+
|
|
333
|
328
|
#endregion
|
|
334
|
329
|
|
|
335
|
330
|
#region 获取下拉框
|
|
|
@@ -356,7 +351,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
356
|
351
|
var dt = DbHelperSQL.Query(sql).Tables[0];
|
|
357
|
352
|
return Success("列表加载成功", dt);
|
|
358
|
353
|
}
|
|
359
|
|
-
|
|
|
354
|
+
|
|
360
|
355
|
#endregion
|
|
361
|
356
|
|
|
362
|
357
|
#region 附件和语音文件
|
|
|
@@ -389,7 +384,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
389
|
384
|
public string GetCallPath(string cid, string prefix)
|
|
390
|
385
|
{
|
|
391
|
386
|
string path = string.Empty;
|
|
392
|
|
- var luyin = new BLL.T_Call_CallRecords().GetModelList(" CallRecordsId='" + cid + "' ").FirstOrDefault();
|
|
|
387
|
+ var luyin = new BLL.T_Call_CallRecords().GetModelList(" callid='" + cid + "' ").FirstOrDefault();
|
|
393
|
388
|
if (luyin != null)
|
|
394
|
389
|
{
|
|
395
|
390
|
if (!string.IsNullOrEmpty(luyin.FilePath))
|
|
|
@@ -431,9 +426,9 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
431
|
426
|
dt.Columns.Add("File", typeof(object));
|
|
432
|
427
|
foreach (DataRow dr in dt.Rows)
|
|
433
|
428
|
{
|
|
434
|
|
- if (dr["F_File"] != null && dr["F_File"].ToString() != "")
|
|
|
429
|
+ if (dr["Files"] != null && dr["Files"].ToString() != "")
|
|
435
|
430
|
{
|
|
436
|
|
- dr["File"] = GetFileData(dr["F_File"].ToString(), prefix);
|
|
|
431
|
+ dr["File"] = GetFileData(dr["Files"].ToString(), prefix);
|
|
437
|
432
|
}
|
|
438
|
433
|
}
|
|
439
|
434
|
return dt;
|
|
|
@@ -446,7 +441,12 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
446
|
441
|
public ActionResult UpdateFile()
|
|
447
|
442
|
{
|
|
448
|
443
|
//string stropenid = HttpUtility.UrlDecode(RequestString.GetFormString("openid"));
|
|
449
|
|
- string fileurl = HttpUtility.UrlDecode(RequestString.GetFormString("fileurl"));
|
|
|
444
|
+ //byte[] filesss = HttpUtility.UrlDecodeToBytes(RequestString.GetFormString("filesss"));
|
|
|
445
|
+ string filess = HttpUtility.UrlDecode(RequestString.GetFormString("filesss"));
|
|
|
446
|
+ Error(filess);
|
|
|
447
|
+
|
|
|
448
|
+ byte[] filesss = Convert.FromBase64String(filess.Split(',')[1]);
|
|
|
449
|
+ //string fileurl = HttpUtility.UrlDecode(RequestString.GetFormString("fileurl"));
|
|
450
|
450
|
string filename = HttpUtility.UrlDecode(RequestString.GetFormString("filename"));
|
|
451
|
451
|
string filesize = HttpUtility.UrlDecode(RequestString.GetFormString("filesize"));
|
|
452
|
452
|
string filetype = HttpUtility.UrlDecode(RequestString.GetFormString("filetype"));
|
|
|
@@ -454,16 +454,18 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
454
|
454
|
FileUp fu = new FileUp();
|
|
455
|
455
|
string path = "/Upload/Files/" + DateTime.Now.ToString("yyyy/MM/dd") + "/";
|
|
456
|
456
|
#region
|
|
457
|
|
- if (fileurl.Trim() != "" && fileurl != "undefined")
|
|
|
457
|
+ if (filesss.Length > 0)
|
|
458
|
458
|
{
|
|
459
|
|
- byte[] by = fu.GetBinaryFile(fileurl);
|
|
|
459
|
+ //byte[] by = fu.GetBinaryFile(fileurl);
|
|
460
|
460
|
|
|
461
|
|
- fu.SaveFile(by, path, filename, filetype);
|
|
|
461
|
+ string newfilename = DateTime.Now.ToString("yyyyMMddHHmmssmsfff") + "_" + filename;
|
|
|
462
|
+
|
|
|
463
|
+ fu.SaveFile(filesss, path, newfilename, filetype);
|
|
462
|
464
|
Model.T_Sys_Accessories model_T_Sys_Accessories = new Model.T_Sys_Accessories();
|
|
463
|
465
|
model_T_Sys_Accessories.F_AddTime = DateTime.Now;//上传时间
|
|
464
|
|
- model_T_Sys_Accessories.F_FileName = filename;//附件名称
|
|
|
466
|
+ model_T_Sys_Accessories.F_FileName = newfilename;//附件名称
|
|
465
|
467
|
model_T_Sys_Accessories.F_FileType = filetype;//附件类型
|
|
466
|
|
- model_T_Sys_Accessories.F_FileUrl = path + filename;//附件地址
|
|
|
468
|
+ model_T_Sys_Accessories.F_FileUrl = path + newfilename;//附件地址
|
|
467
|
469
|
model_T_Sys_Accessories.F_Size = long.Parse(filesize);
|
|
468
|
470
|
//model_T_Sys_Accessories.F_UserCode = stropenid;//上传人
|
|
469
|
471
|
int id = new BLL.T_Sys_Accessories().Add(model_T_Sys_Accessories);
|
|
|
@@ -486,7 +488,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
486
|
488
|
//if (files.Count > 0)
|
|
487
|
489
|
//{
|
|
488
|
490
|
// List<Model.T_Sys_Accessories> acs = new List<Model.T_Sys_Accessories>();
|
|
489
|
|
-
|
|
|
491
|
+
|
|
490
|
492
|
// for (int i = 0; i < files.Count; i++)
|
|
491
|
493
|
// {
|
|
492
|
494
|
|
|
|
@@ -513,5 +515,33 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
513
|
515
|
#endregion
|
|
514
|
516
|
}
|
|
515
|
517
|
#endregion
|
|
|
518
|
+
|
|
|
519
|
+ #region
|
|
|
520
|
+ public ActionResult UpLoadProcess(string id, HttpPostedFileBase file)
|
|
|
521
|
+ {
|
|
|
522
|
+ try
|
|
|
523
|
+ {
|
|
|
524
|
+ string filePathName = string.Empty;
|
|
|
525
|
+ string path = "/Upload/Files/" + DateTime.Now.ToString("yyyy/MM/dd") + "/";
|
|
|
526
|
+ string localPath = Path.Combine(HttpRuntime.AppDomainAppPath, path);
|
|
|
527
|
+ if (Request.Files.Count == 0)
|
|
|
528
|
+ {
|
|
|
529
|
+ return Json(new { jsonrpc = 2.0, error = new { code = 102, message = "保存失败" }, id = "id" });
|
|
|
530
|
+ }
|
|
|
531
|
+ string ex = Path.GetExtension(file.FileName);
|
|
|
532
|
+ filePathName = DateTime.Now.ToString("yyyyMMddHHmmssmsfff") + "_" + Guid.NewGuid().ToString("N") + ex;
|
|
|
533
|
+ if (!System.IO.Directory.Exists(localPath))
|
|
|
534
|
+ {
|
|
|
535
|
+ System.IO.Directory.CreateDirectory(localPath);
|
|
|
536
|
+ }
|
|
|
537
|
+ file.SaveAs(Path.Combine(localPath, filePathName));
|
|
|
538
|
+ return Success("上传成功", path + filePathName);
|
|
|
539
|
+ }
|
|
|
540
|
+ catch (Exception ex)
|
|
|
541
|
+ {
|
|
|
542
|
+ return Error(ex.Message);
|
|
|
543
|
+ }
|
|
|
544
|
+ }
|
|
|
545
|
+ #endregion
|
|
516
|
546
|
}
|
|
517
|
547
|
}
|