From 94ed0d75cd4aa090fa8421af6609066682028943 Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期五, 02 八月 2024 19:08:36 +0800 Subject: [PATCH] 修改日志文件 --- WebApi/众毅调度/ZyProjectHelper.cs | 31 ++++++++++++------------------- 1 files changed, 12 insertions(+), 19 deletions(-) diff --git "a/WebApi/\344\274\227\346\257\205\350\260\203\345\272\246/ZyProjectHelper.cs" "b/WebApi/\344\274\227\346\257\205\350\260\203\345\272\246/ZyProjectHelper.cs" index 0a73a42..f0dd5fe 100644 --- "a/WebApi/\344\274\227\346\257\205\350\260\203\345\272\246/ZyProjectHelper.cs" +++ "b/WebApi/\344\274\227\346\257\205\350\260\203\345\272\246/ZyProjectHelper.cs" @@ -1,26 +1,23 @@ -锘� -using IStation.Model; +锘縰sing IStation.Model; using IStation.ZyDto; using Microsoft.Ajax.Utilities; using System; using System.Collections.Generic; using System.Linq; -using System.Net.WebSockets; +using System.Net.WebSockets; using System.Text; using System.Threading; -using System.Threading.Tasks; +using System.Threading.Tasks; namespace IStation { /// <summary> /// 璋冨害鏂规(浼楁瘏) - /// </summary> + /// </summary> internal class ZyProjectHelper { // static string _url_prj = "ws://192.168.201.17:8001"; public static string _url_prj = "ws://192.168.3.152:8001"; - - /// <summary> /// 鎻愪氦璋冨害椤圭洰 @@ -40,7 +37,7 @@ return "currentViewPrj is null"; } IStation.ZyDto.SubmitPrj dto_prj = new ZyDto.SubmitPrj(); - + if (string.IsNullOrEmpty(currentViewPrj.ID)) { var time = DateTime.Now; @@ -49,7 +46,7 @@ dto_prj.schemeID = currentViewPrj.ID; dto_prj.Day = currentViewPrj.StartTime.ToString("yyyy-MM-dd"); - dto_prj.StartTime = currentViewPrj.StartTime.ToString("yyyy-MM-dd HH:mm:ss"); + dto_prj.StartTime = currentViewPrj.StartTime.ToString("yyyy-MM-dd HH:mm:ss"); dto_prj.EndTime = currentViewPrj.EndTime.ToString("yyyy-MM-dd HH:mm:ss"); dto_prj.FlowTotalIn = Math.Round(currentViewPrj.SumFlow, 0); @@ -82,7 +79,7 @@ try { List<byte> outputBytes = new List<byte>();//鍏ㄩ儴娑堟伅瀹瑰櫒 - var buffer = new byte[1024 * 4];//缂撳啿鍖� + var buffer = new byte[1024 * 4];//缂撳啿鍖� var result = await ws.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None); //鐩戝惉Socket淇℃伅 while (!result.CloseStatus.HasValue) //鏄惁鍏抽棴 { @@ -108,11 +105,10 @@ } // result = await ws.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None);//缁х画鐩戝惉Socket淇℃伅 } - } catch (Exception ex) { - IStation.LogHelper.WriteError("Error:101", ex); + IStation.LogHelper.Error("Error:101", ex); return "ex:" + ex.Message; } finally @@ -124,7 +120,7 @@ } catch (Exception ex) { - IStation.LogHelper.WriteError("Error:111", ex); + IStation.LogHelper.Error("Error:111", ex); // return "ex:" + ex.Message; } ws.Abort(); @@ -132,7 +128,6 @@ } return null; } - /// <summary> /// 鎻愪氦璋冨害椤圭洰 @@ -194,7 +189,7 @@ try { List<byte> outputBytes = new List<byte>();//鍏ㄩ儴娑堟伅瀹瑰櫒 - var buffer = new byte[1024 * 4];//缂撳啿鍖� + var buffer = new byte[1024 * 4];//缂撳啿鍖� var result = await ws.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None); //鐩戝惉Socket淇℃伅 while (!result.CloseStatus.HasValue) //鏄惁鍏抽棴 { @@ -220,11 +215,10 @@ } // result = await ws.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None);//缁х画鐩戝惉Socket淇℃伅 } - } catch (Exception ex) { - IStation.LogHelper.WriteError("Error:101", ex); + IStation.LogHelper.Error("Error:101", ex); return "ex:" + ex.Message; } finally @@ -236,7 +230,7 @@ } catch (Exception ex) { - IStation.LogHelper.WriteError("Error:111", ex); + IStation.LogHelper.Error("Error:111", ex); // return "ex:" + ex.Message; } ws.Abort(); @@ -244,6 +238,5 @@ } return null; } - } } \ No newline at end of file -- Gitblit v1.9.3