Parcourir la Source

工单调整,上传图片

zhengbingbing il y a 8 ans
Parent
commit
5ce9f99840

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Configs/system.config

24
   <!-- 设置微信appsecret -->
24
   <!-- 设置微信appsecret -->
25
   <add key="WechatAppsecret" value="3e42313935a4d6dc8b450172b8be2765" />
25
   <add key="WechatAppsecret" value="3e42313935a4d6dc8b450172b8be2765" />
26
   <!-- 微信支付分配的商户号 -->
26
   <!-- 微信支付分配的商户号 -->
27
-  <add key="WechatMchid" value=""/>
27
+  <add key="WechatMchid" value="1493808312"/>
28
   <add key="WechatKey" value=""/>
28
   <add key="WechatKey" value=""/>
29
   <!-- 商户证书物理位置 -->
29
   <!-- 商户证书物理位置 -->
30
   <add key="WechatPath" value=""/>
30
   <add key="WechatPath" value=""/>

+ 4 - 6
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs

515
                 //string reamount = RequestString.GetFormString("reamount");//奖励金额
515
                 //string reamount = RequestString.GetFormString("reamount");//奖励金额
516
                 //string retime = RequestString.GetFormString("retime");//奖励时间
516
                 //string retime = RequestString.GetFormString("retime");//奖励时间
517
                 int unitid = RequestString.GetInt("unitid", 0);//交办单位
517
                 int unitid = RequestString.GetInt("unitid", 0);//交办单位
518
+                int isaudit = RequestString.GetInt("isaudit", 0);//0未审核,1无效,2有效
518
                 #endregion
519
                 #endregion
519
                 #endregion
520
                 #endregion
520
 
521
 
557
                         model.IsTimeOut = 0;
558
                         model.IsTimeOut = 0;
558
                         model.IsUserSend = 0;
559
                         model.IsUserSend = 0;
559
                         model.IsAdminSend = 0;
560
                         model.IsAdminSend = 0;
561
+                        model.IsAudit = isaudit;//0未审核,1无效,2有效
562
+
560
                         if (source.Trim() == "1")
563
                         if (source.Trim() == "1")
561
                             model.Source = "手工制单";
564
                             model.Source = "手工制单";
562
                         else if (source.Trim() == "2")
565
                         else if (source.Trim() == "2")
587
                             }
590
                             }
588
                         }
591
                         }
589
                         #endregion
592
                         #endregion
590
-
591
-                        //Model.T_Sys_UserAccount us = new BLL.T_Sys_UserAccount().GetModel(zrid);
592
-                        //if (us != null)
593
-                        //{
594
-                        //    model.ResponUser = us.F_UserCode;
595
-                        //}
593
+                        
596
                         #region 工单超时
594
                         #region 工单超时
597
                         Model.T_Wo_WorkOrderTimeOut to = new BLL.T_Wo_WorkOrderTimeOut().GetModel(type);
595
                         Model.T_Wo_WorkOrderTimeOut to = new BLL.T_Wo_WorkOrderTimeOut().GetModel(type);
598
                         if (to != null)
596
                         if (to != null)

+ 89 - 59
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/weixin/WxLoginController.cs

105
             string strusercode = HttpUtility.UrlDecode(RequestString.GetQueryString("usercode"));//创建人工号
105
             string strusercode = HttpUtility.UrlDecode(RequestString.GetQueryString("usercode"));//创建人工号
106
             string source = HttpUtility.UrlDecode(RequestString.GetQueryString("source"));//工单来源
106
             string source = HttpUtility.UrlDecode(RequestString.GetQueryString("source"));//工单来源
107
             string infotype = HttpUtility.UrlDecode(RequestString.GetQueryString("infotype"));//信息分类
107
             string infotype = HttpUtility.UrlDecode(RequestString.GetQueryString("infotype"));//信息分类
108
-            
108
+
109
 
109
 
110
             string strpageindex = RequestString.GetQueryString("page");
110
             string strpageindex = RequestString.GetQueryString("page");
111
             int pageindex = 1;
111
             int pageindex = 1;
145
             {
145
             {
146
                 sql += " and InfoTypeID = " + infotype + " ";
146
                 sql += " and InfoTypeID = " + infotype + " ";
147
             }
147
             }
148
-            
148
+
149
             if (source.Trim() != "" && source != "undefined")
149
             if (source.Trim() != "" && source != "undefined")
150
             {
150
             {
151
                 sql += " and Source = '" + source + "' ";
151
                 sql += " and Source = '" + source + "' ";
208
             string content = RequestString.GetFormString("content");
208
             string content = RequestString.GetFormString("content");
209
             string files = RequestString.GetFormString("files");
209
             string files = RequestString.GetFormString("files");
210
             int type = RequestString.GetInt("type", 3);//默认为3投诉建议
210
             int type = RequestString.GetInt("type", 3);//默认为3投诉建议
211
-            
211
+
212
             string stropenid = HttpUtility.UrlDecode(RequestString.GetFormString("openid"));
212
             string stropenid = HttpUtility.UrlDecode(RequestString.GetFormString("openid"));
213
             var wxuser = new BLL.T_Sys_Users().GetModelList(" F_OpenId='" + stropenid.Trim() + "'  and F_Type=1 ").FirstOrDefault();
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
             workorder.WorkOrderController wo = new workorder.WorkOrderController();
215
             workorder.WorkOrderController wo = new workorder.WorkOrderController();
243
             string workorderid = wo.AddWorkOrders(type, cusname, cusphone, content, files);
216
             string workorderid = wo.AddWorkOrders(type, cusname, cusphone, content, files);
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
         /// <summary>
264
         /// <summary>
260
         ///  获取工单详情
265
         ///  获取工单详情
261
         /// </summary>
266
         /// </summary>
276
                 var dt = DbHelperSQL.Query(sql).Tables[0];
281
                 var dt = DbHelperSQL.Query(sql).Tables[0];
277
                 if (dt.Rows.Count > 0)
282
                 if (dt.Rows.Count > 0)
278
                 {
283
                 {
279
-                    var configly = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayLeaveVoice' ").FirstOrDefault();
280
                     var config = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
284
                     var config = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
281
                     var configfj = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
285
                     var configfj = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
282
 
286
 
283
-                    
287
+
284
                     if (configfj != null)
288
                     if (configfj != null)
285
                     {
289
                     {
286
                         dt = BindFileData(dt, configfj.F_ParamValue);
290
                         dt = BindFileData(dt, configfj.F_ParamValue);
289
                     string gcsql = "select *,dbo.GetUserName(F_CreateUser) as UserName "
293
                     string gcsql = "select *,dbo.GetUserName(F_CreateUser) as UserName "
290
                                         + "from T_Wo_Operation where F_IsDelete=0 and F_WorkOrderId ='" + dt.Rows[0]["WorkOrderId"] + "'";
294
                                         + "from T_Wo_Operation where F_IsDelete=0 and F_WorkOrderId ='" + dt.Rows[0]["WorkOrderId"] + "'";
291
                     var gcdt = DbHelperSQL.Query(gcsql).Tables[0];
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
             }
324
             }
330
 
325
 
331
         }
326
         }
332
-        
327
+
333
         #endregion
328
         #endregion
334
 
329
 
335
         #region 获取下拉框
330
         #region 获取下拉框
356
             var dt = DbHelperSQL.Query(sql).Tables[0];
351
             var dt = DbHelperSQL.Query(sql).Tables[0];
357
             return Success("列表加载成功", dt);
352
             return Success("列表加载成功", dt);
358
         }
353
         }
359
-        
354
+
360
         #endregion
355
         #endregion
361
 
356
 
362
         #region 附件和语音文件
357
         #region 附件和语音文件
389
         public string GetCallPath(string cid, string prefix)
384
         public string GetCallPath(string cid, string prefix)
390
         {
385
         {
391
             string path = string.Empty;
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
             if (luyin != null)
388
             if (luyin != null)
394
             {
389
             {
395
                 if (!string.IsNullOrEmpty(luyin.FilePath))
390
                 if (!string.IsNullOrEmpty(luyin.FilePath))
431
             dt.Columns.Add("File", typeof(object));
426
             dt.Columns.Add("File", typeof(object));
432
             foreach (DataRow dr in dt.Rows)
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
             return dt;
434
             return dt;
446
         public ActionResult UpdateFile()
441
         public ActionResult UpdateFile()
447
         {
442
         {
448
             //string stropenid = HttpUtility.UrlDecode(RequestString.GetFormString("openid"));
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
             string filename = HttpUtility.UrlDecode(RequestString.GetFormString("filename"));
450
             string filename = HttpUtility.UrlDecode(RequestString.GetFormString("filename"));
451
             string filesize = HttpUtility.UrlDecode(RequestString.GetFormString("filesize"));
451
             string filesize = HttpUtility.UrlDecode(RequestString.GetFormString("filesize"));
452
             string filetype = HttpUtility.UrlDecode(RequestString.GetFormString("filetype"));
452
             string filetype = HttpUtility.UrlDecode(RequestString.GetFormString("filetype"));
454
             FileUp fu = new FileUp();
454
             FileUp fu = new FileUp();
455
             string path = "/Upload/Files/" + DateTime.Now.ToString("yyyy/MM/dd") + "/";
455
             string path = "/Upload/Files/" + DateTime.Now.ToString("yyyy/MM/dd") + "/";
456
             #region
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
                 Model.T_Sys_Accessories model_T_Sys_Accessories = new Model.T_Sys_Accessories();
464
                 Model.T_Sys_Accessories model_T_Sys_Accessories = new Model.T_Sys_Accessories();
463
                 model_T_Sys_Accessories.F_AddTime = DateTime.Now;//上传时间
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
                 model_T_Sys_Accessories.F_FileType = filetype;//附件类型
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
                 model_T_Sys_Accessories.F_Size = long.Parse(filesize);
469
                 model_T_Sys_Accessories.F_Size = long.Parse(filesize);
468
                 //model_T_Sys_Accessories.F_UserCode = stropenid;//上传人  
470
                 //model_T_Sys_Accessories.F_UserCode = stropenid;//上传人  
469
                 int id = new BLL.T_Sys_Accessories().Add(model_T_Sys_Accessories);
471
                 int id = new BLL.T_Sys_Accessories().Add(model_T_Sys_Accessories);
486
             //if (files.Count > 0)
488
             //if (files.Count > 0)
487
             //{
489
             //{
488
             //    List<Model.T_Sys_Accessories> acs = new List<Model.T_Sys_Accessories>();
490
             //    List<Model.T_Sys_Accessories> acs = new List<Model.T_Sys_Accessories>();
489
-                
491
+
490
             //    for (int i = 0; i < files.Count; i++)
492
             //    for (int i = 0; i < files.Count; i++)
491
             //    {
493
             //    {
492
 
494
 
513
             #endregion
515
             #endregion
514
         }
516
         }
515
         #endregion
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
 }

+ 166 - 23
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

154
                         switch (strltype)
154
                         switch (strltype)
155
                         {
155
                         {
156
                             case "0"://待指派的
156
                             case "0"://待指派的
157
-                                sql += " and State ='0' and CreateUser= '" + ua.F_UserCode + "' ";
157
+                                //sql += " and State ='0' and CreateUser= '" + ua.F_UserCode + "' ";
158
+                                sql += " and State ='0'  ";
158
                                 break;
159
                                 break;
159
                             case "1"://待接单的
160
                             case "1"://待接单的
160
                                 sql += " and State ='1' and WorkOrderID in ( '" + GetDJDWorkOrderID(ua.F_UserCode) + "') ";
161
                                 sql += " and State ='1' and WorkOrderID in ( '" + GetDJDWorkOrderID(ua.F_UserCode) + "') ";
375
         {
376
         {
376
             string str = string.Empty;
377
             string str = string.Empty;
377
 
378
 
378
-            var list = new BLL.T_Wo_WorkOrderItem().GetModelList(" IsDel=0 and Type=1 and (state='1' and SureUser='" + user + "')  ").Select(p => p.WorkOrderID).Distinct();
379
+            var list = new BLL.T_Wo_WorkOrderItem().GetModelList(" IsDel=0 and Type=1 and (state='1' and ','+ToUser+',' like '%," + user + ",%')    ").Select(p => p.WorkOrderID).Distinct();
379
 
380
 
380
             foreach (var l in list)
381
             foreach (var l in list)
381
             {
382
             {
436
 
437
 
437
                     var data = DbHelperSQL.Query(sql).Tables[0];
438
                     var data = DbHelperSQL.Query(sql).Tables[0];
438
                     var item = DbHelperSQL.Query(sqlitem).Tables[0];
439
                     var item = DbHelperSQL.Query(sqlitem).Tables[0];
440
+
441
+                    var configfj = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
442
+                    if (configfj != null)
443
+                    {
444
+                        data = BindFileData(data, configfj.F_ParamValue);
445
+                    }
446
+
439
                     var obj = new
447
                     var obj = new
440
                     {
448
                     {
441
                         data = data,
449
                         data = data,
455
             }
463
             }
456
             return res;
464
             return res;
457
         }
465
         }
466
+        #region 绑定附件信息
467
+        /// <summary>
468
+        /// 获取附件数据
469
+        /// </summary>
470
+        /// <param name="ids">附件id,多个用英文逗号,隔开</param>
471
+        /// <param name="prefix">前缀</param>
472
+        /// <returns></returns>
473
+        public DataTable GetFileData(string ids, string prefix)
474
+        {
475
+            DataTable dt = DbHelperSQL.Query("select * from T_Sys_Accessories where F_FileId in (" + ids + ")").Tables[0];
476
+
477
+            foreach (DataRow dr in dt.Rows)
478
+            {
479
+                dr["F_FileUrl"] = prefix + dr["F_FileUrl"].ToString();
480
+            }
481
+
482
+            return dt;
483
+        }
484
+
485
+        /// <summary>
486
+        /// 绑定附件信息
487
+        /// </summary>
488
+        /// <param name="dt"></param>
489
+        /// <param name="prefix"></param>
490
+        /// <returns></returns>
491
+        public DataTable BindFileData(DataTable dt, string prefix)
492
+        {
493
+            dt.Columns.Add("File", typeof(object));
494
+            foreach (DataRow dr in dt.Rows)
495
+            {
496
+                if (dr["Files"] != null && dr["Files"].ToString() != "")
497
+                {
498
+                    dr["File"] = GetFileData(dr["Files"].ToString(), prefix);
499
+                }
500
+            }
501
+            return dt;
502
+        }
503
+        #endregion
458
 
504
 
459
         /// <summary>
505
         /// <summary>
460
         /// 添加/修改工单信息
506
         /// 添加/修改工单信息
492
                         #region 新增字段
538
                         #region 新增字段
493
                         int infotypeid = RequestString.GetInt("infotypeid", 0);//信息分类
539
                         int infotypeid = RequestString.GetInt("infotypeid", 0);//信息分类
494
                         int unitid = RequestString.GetInt("unitid", 0);//交办单位
540
                         int unitid = RequestString.GetInt("unitid", 0);//交办单位
541
+                        int isaudit = RequestString.GetInt("isaudit", 0);//0未审核,1无效,2有效
495
                         #endregion
542
                         #endregion
496
 
543
 
497
                         Model.T_Wo_WorkOrder model = new Model.T_Wo_WorkOrder();
544
                         Model.T_Wo_WorkOrder model = new Model.T_Wo_WorkOrder();
522
                         model.IsTimeOut = 0;
569
                         model.IsTimeOut = 0;
523
                         model.IsUserSend = 0;
570
                         model.IsUserSend = 0;
524
                         model.IsAdminSend = 0;
571
                         model.IsAdminSend = 0;
525
-                        model.IsAudit = 0;//0未审核,1无效,2有效
572
+                        model.IsAudit = isaudit;//0未审核,1无效,2有效
526
 
573
 
527
                         #region 新增字段
574
                         #region 新增字段
528
                         model.InfoTypeID = infotypeid;
575
                         model.InfoTypeID = infotypeid;
659
             return res;
706
             return res;
660
         }
707
         }
661
 
708
 
709
+        //微信添加工单
662
         public string AddWorkOrders(int type, string tskh, string tsdh, string cont, string file)
710
         public string AddWorkOrders(int type, string tskh, string tsdh, string cont, string file)
663
         {
711
         {
664
             string workorderid = string.Empty;
712
             string workorderid = string.Empty;
714
             Model.T_Wo_Operation oper = new Model.T_Wo_Operation();
762
             Model.T_Wo_Operation oper = new Model.T_Wo_Operation();
715
             oper.F_WorkOrderId = model.WorkOrderID;
763
             oper.F_WorkOrderId = model.WorkOrderID;
716
             oper.F_State = model.State;
764
             oper.F_State = model.State;
765
+            oper.F_CallRecordId = model.CallID != null ? int.Parse(model.CallID) : 0;
766
+            oper.F_File = model.Files;
717
 
767
 
718
             string userinfo = "由 " + model.Source;
768
             string userinfo = "由 " + model.Source;
719
             if (model.State == 0)
769
             if (model.State == 0)
806
                         string cont = RequestString.GetFormString("cont");
856
                         string cont = RequestString.GetFormString("cont");
807
                         int clbm = RequestString.GetInt("clbm", 0);
857
                         int clbm = RequestString.GetInt("clbm", 0);
808
                         int clid = RequestString.GetInt("clid", 0);
858
                         int clid = RequestString.GetInt("clid", 0);
859
+                        int isaudit = RequestString.GetInt("isaudit", 0);//0未审核,1无效,2有效
809
                         #region 新增字段
860
                         #region 新增字段
810
-                        int isyx = RequestString.GetInt("isyx", 0);//是否有效
811
                         int infotypeid = RequestString.GetInt("infotypeid", 0);//信息分类
861
                         int infotypeid = RequestString.GetInt("infotypeid", 0);//信息分类
812
                         int isreward = RequestString.GetInt("isreward", 0);//上报奖励
862
                         int isreward = RequestString.GetInt("isreward", 0);//上报奖励
813
                         string reamount = RequestString.GetFormString("reamount");//奖励金额
863
                         string reamount = RequestString.GetFormString("reamount");//奖励金额
819
                         Model.T_Wo_WorkOrder model = new BLL.T_Wo_WorkOrder().GetModelList(" WorkOrderID='" + orderid + "'").FirstOrDefault();
869
                         Model.T_Wo_WorkOrder model = new BLL.T_Wo_WorkOrder().GetModelList(" WorkOrderID='" + orderid + "'").FirstOrDefault();
820
                         if (model != null)
870
                         if (model != null)
821
                         {
871
                         {
872
+                            
822
                             #region 获取处理人工号
873
                             #region 获取处理人工号
823
                             string struser = string.Empty;
874
                             string struser = string.Empty;
824
                             if (clbm != 0)
875
                             if (clbm != 0)
852
                             #endregion
903
                             #endregion
853
 
904
 
854
                             #region 新增字段
905
                             #region 新增字段
855
-                            model.IsAudit = isyx;//0未审核,1无效,2有效
906
+                            model.IsAudit = isaudit;//0未审核,1无效,2有效
856
                             model.InfoTypeID = infotypeid;
907
                             model.InfoTypeID = infotypeid;
857
                             if (infotypeid != 0)
908
                             if (infotypeid != 0)
858
                             {
909
                             {
882
                                 , model.UnitID.Value, model.Unit);
933
                                 , model.UnitID.Value, model.Unit);
883
                             if (n > 0)
934
                             if (n > 0)
884
                             {
935
                             {
936
+                                #region 消息通知
885
                                 Model.T_Wo_WorkOrderItem item = new BLL.T_Wo_WorkOrderItem().GetModelList(" WorkOrderID='" + orderid + "' and Type=1 ").OrderByDescending(p => p.CreateTime).FirstOrDefault();
937
                                 Model.T_Wo_WorkOrderItem item = new BLL.T_Wo_WorkOrderItem().GetModelList(" WorkOrderID='" + orderid + "' and Type=1 ").OrderByDescending(p => p.CreateTime).FirstOrDefault();
886
 
938
 
887
                                 string strmsg = string.Empty;
939
                                 string strmsg = string.Empty;
893
                                 {
945
                                 {
894
                                     strmsg = ua.F_UserName + "完结了工单,单号:" + model.WorkOrderID;
946
                                     strmsg = ua.F_UserName + "完结了工单,单号:" + model.WorkOrderID;
895
                                 }
947
                                 }
896
-                                
948
+                                #region 消息表
949
+                                foreach (string ur in item.ToUser.Split(','))
950
+                                {
951
+                                    Model.T_Msg_List msg = new Model.T_Msg_List();
952
+                                    msg.Type = 1;
953
+                                    msg.ToUser = ur;
954
+                                    msg.ToID = Int32.Parse(item.ID.ToString());
955
+                                    msg.Detail = strmsg;
956
+                                    msg.State = 0;
957
+                                    msg.IsDel = 0;
958
+                                    msg.CreateUser = ua.F_UserCode;
959
+                                    msg.CreateDate = DateTime.Now;
960
+
961
+                                    new BLL.T_Msg_List().Add(msg);
962
+                                }
963
+                                #endregion
964
+                                #endregion
897
                                 #region 插入操作记录
965
                                 #region 插入操作记录
898
                                 Model.T_Wo_Operation oper = new Model.T_Wo_Operation();
966
                                 Model.T_Wo_Operation oper = new Model.T_Wo_Operation();
899
                                 oper.F_WorkOrderId = model.WorkOrderID;
967
                                 oper.F_WorkOrderId = model.WorkOrderID;
918
                                 new BLL.T_Wo_Operation().Add(oper);
986
                                 new BLL.T_Wo_Operation().Add(oper);
919
                                 #endregion
987
                                 #endregion
920
 
988
 
921
-                                #region 消息表
922
-                                foreach (string ur in item.ToUser.Split(','))
923
-                                {
924
-                                    Model.T_Msg_List msg = new Model.T_Msg_List();
925
-                                    msg.Type = 1;
926
-                                    msg.ToUser = ur;
927
-                                    msg.ToID = Int32.Parse(item.ID.ToString());
928
-                                    msg.Detail = strmsg;
929
-                                    msg.State = 0;
930
-                                    msg.IsDel = 0;
931
-                                    msg.CreateUser = ua.F_UserCode;
932
-                                    msg.CreateDate = DateTime.Now;
933
-
934
-                                    new BLL.T_Msg_List().Add(msg);
935
-                                }
936
-                                #endregion
989
+                                
937
                                 res = Success("处理成功");
990
                                 res = Success("处理成功");
938
                             }
991
                             }
939
                             
992
                             
945
             return res;
998
             return res;
946
         }
999
         }
947
 
1000
 
1001
+        //微信处理工单
1002
+        public bool DealWorkOrders(string orderid,string cont,string openid,int isaudit,int infotypeid,int unitid)
1003
+        {
1004
+            bool res = false;
1005
+            Model.T_Wo_WorkOrder model = new BLL.T_Wo_WorkOrder().GetModelList(" WorkOrderID='" + orderid + "'").FirstOrDefault();
1006
+            if (model != null)
1007
+            {
1008
+                if (openid != "")
1009
+                {
1010
+                    Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModelList(" F_WxOpenId='" + openid + "'").FirstOrDefault();
1011
+                    if (ua != null)
1012
+                    {
1013
+
1014
+                        #region 新增字段
1015
+                        model.IsAudit = isaudit;//0未审核,1无效,2有效
1016
+                        model.InfoTypeID = infotypeid;//信息分类
1017
+                        if (infotypeid != 0)
1018
+                        {
1019
+                            Model.T_Sys_DictionaryValue dicVModel = dictionaryValueBLL.GetModel(infotypeid);
1020
+                            if (dicVModel != null)
1021
+                            {
1022
+                                model.InfoType = dicVModel.F_Name;
1023
+                            }
1024
+                        }
1025
+                        model.ISReward = 0;
1026
+                        model.UnitID = unitid;//交办单位
1027
+                        if (unitid != 0)
1028
+                        {
1029
+                            Model.T_Sys_DictionaryValue dicVModel = dictionaryValueBLL.GetModel(unitid);
1030
+                            if (dicVModel != null)
1031
+                            {
1032
+                                model.Unit = dicVModel.F_Name;
1033
+                            }
1034
+                        }
1035
+                        #endregion
1036
+
1037
+                        int n = new BLL.T_Wo_WorkOrder().DealWorkOrder(orderid, 1, cont, ua.F_DeptId, ua.F_UserCode, ua.F_UserCode
1038
+                            , model.IsAudit.Value, model.InfoType, model.InfoTypeID.Value
1039
+                            , model.ISReward.Value, model.RewardAmount, model.RewardTime
1040
+                            , model.UnitID.Value, model.Unit);
1041
+                        if (n > 0)
1042
+                        {
1043
+                            #region 消息通知
1044
+                            Model.T_Wo_WorkOrderItem item = new BLL.T_Wo_WorkOrderItem().GetModelList(" WorkOrderID='" + orderid + "' and Type=1 ").OrderByDescending(p => p.CreateTime).FirstOrDefault();
1045
+
1046
+                            string strmsg = string.Empty;
1047
+                            strmsg = ua.F_UserName + "通过微信完结了工单,单号:" + model.WorkOrderID;
1048
+                            #region 消息表
1049
+                            foreach (string ur in item.ToUser.Split(','))
1050
+                            {
1051
+                                Model.T_Msg_List msg = new Model.T_Msg_List();
1052
+                                msg.Type = 1;
1053
+                                msg.ToUser = ur;
1054
+                                msg.ToID = Int32.Parse(item.ID.ToString());
1055
+                                msg.Detail = strmsg;
1056
+                                msg.State = 0;
1057
+                                msg.IsDel = 0;
1058
+                                msg.CreateUser = ua.F_UserCode;
1059
+                                msg.CreateDate = DateTime.Now;
1060
+
1061
+                                new BLL.T_Msg_List().Add(msg);
1062
+                            }
1063
+                            #endregion
1064
+                            #endregion
1065
+
1066
+                            #region 插入操作记录
1067
+                            Model.T_Wo_Operation oper = new Model.T_Wo_Operation();
1068
+                            oper.F_WorkOrderId = model.WorkOrderID;
1069
+                            oper.F_State = model.State;
1070
+                            oper.F_CallRecordId = model.CallID != null ? int.Parse(model.CallID) : 0;
1071
+                            oper.F_File = model.Files;
1072
+
1073
+                            string userinfo = ua.depname + "-" + ua.F_UserName + "(" + ua.F_UserCode + ")";
1074
+
1075
+                            oper.F_Message = userinfo + "通过微信完结了工单,单号:" + model.WorkOrderID;
1076
+
1077
+                            oper.F_CreateUser = ua.F_UserCode;
1078
+                            oper.F_CreateTime = DateTime.Now;
1079
+                            oper.F_IsDelete = 0;
1080
+
1081
+                            new BLL.T_Wo_Operation().Add(oper);
1082
+                            #endregion
1083
+                            res = true;
1084
+                        }
1085
+                    }
1086
+                }
1087
+            }
1088
+            return res;
1089
+        }
1090
+
948
         /// <summary>
1091
         /// <summary>
949
         /// 确认工单
1092
         /// 确认工单
950
         /// </summary>
1093
         /// </summary>
2045
         }
2188
         }
2046
 
2189
 
2047
         //获取奖励记录
2190
         //获取奖励记录
2048
-        public ActionResult GetList(string woid)
2191
+        public ActionResult GetAMList(string woid)
2049
         {
2192
         {
2050
             ActionResult res = NoToken("未知错误,请重新登录");
2193
             ActionResult res = NoToken("未知错误,请重新登录");
2051
             if (Request.IsAuthenticated)
2194
             if (Request.IsAuthenticated)

+ 6 - 0
codegit/CallCenterCommon/CallCenter.Utility/FileUp.cs

119
         public void SaveFile(byte[] binData, string SavePath, string fileName, string fileType)
119
         public void SaveFile(byte[] binData, string SavePath, string fileName, string fileType)
120
         {
120
         {
121
             FileStream fileStream = null;
121
             FileStream fileStream = null;
122
+            
122
             MemoryStream m = new MemoryStream(binData);
123
             MemoryStream m = new MemoryStream(binData);
123
             try
124
             try
124
             {
125
             {
129
                 }
130
                 }
130
                 string File = savePath + fileName;//+ fileType;
131
                 string File = savePath + fileName;//+ fileType;
131
                 fileStream = new FileStream(File, FileMode.Create);
132
                 fileStream = new FileStream(File, FileMode.Create);
133
+                
132
                 m.WriteTo(fileStream);
134
                 m.WriteTo(fileStream);
135
+                m.Flush();
133
             }
136
             }
134
             finally
137
             finally
135
             {
138
             {
139
+                fileStream.Dispose();
140
+                m.Dispose();
141
+
136
                 m.Close();
142
                 m.Close();
137
                 fileStream.Close();
143
                 fileStream.Close();
138
             }
144
             }