From 217a65fe8eb2612b7d61e9ce5f450e76bfc318f6 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期一, 09 六月 2025 17:13:15 +0800 Subject: [PATCH] 添加数据库接口日志记录 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs | 5 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Log.cs | 17 + 代码管理/WMS/WIDESEA_WMSClient/src/views/basic/roadwayInfo.vue | 24 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_LogService.cs | 19 + 代码管理/WMS/WIDESEA_WMSClient/src/views/basic/cachePoint.vue | 14 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_AGV.cs | 8 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Log/System/API请求/2025-06-09/叫料任务下发250609.txt | 35 ++ 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs | 1 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/Logger1.cs | 158 +++++++++ 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs | 97 ++++- 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/d456fc8b-b3fc-438a-9e3d-b9e6b49026cc.vsidx | 0 代码管理/WMS/WIDESEA_WMSClient/src/views/system/Sys_Log.vue | 34 +- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ISystemRepository/ISys_LogRepository.cs | 14 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/LogEnum.cs | 24 + 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/App.cs | 5 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/Logger.cs | 378 ++++++++++++++++------- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task_Hty.cs | 9 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/c7430a94-d316-4296-bb96-0039e2a686ff.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs | 8 代码管理/WMS/WIDESEA_WMSClient/src/views/taskinfo/task_hty.vue | 6 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs | 4 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/RequestLogModel.cs | 13 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json | 2 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_SystemRepository/Sys_LogRepository.cs | 18 + /dev/null | 0 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_LogController.cs | 20 + 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/a15af72d-cadb-4f43-be5a-3770c0ed83df.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/42a9ad71-6cad-4c27-8852-8b0836dcc4ff.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs | 2 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_LogService.cs | 14 30 files changed, 752 insertions(+), 177 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/basic/cachePoint.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/basic/cachePoint.vue" index 2714fc0..65711d8 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/basic/cachePoint.vue" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/basic/cachePoint.vue" @@ -135,13 +135,13 @@ width: 90, align: "left", }, - { - field: "pointType", - title: "缂撳瓨鐐圭被鍨�", - type: "string", - width: 90, - align: "left", - }, + // { + // field: "pointType", + // title: "缂撳瓨鐐圭被鍨�", + // type: "string", + // width: 90, + // align: "left", + // }, { field: "creater", title: "鍒涘缓浜�", diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/basic/roadwayInfo.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/basic/roadwayInfo.vue" index e552816..320eefd 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/basic/roadwayInfo.vue" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/basic/roadwayInfo.vue" @@ -62,22 +62,22 @@ ], [ { - title: "鍏ュ簱绔欏彴缂栧彿1", + title: "鍏ュ簱绔欏彴缂栧彿", field: "inStationCode", type: "string", }, { - title: "鍏ュ簱绔欏彴缂栧彿2", + title: "鍫嗗灈鏈哄叆搴撶珯鍙扮紪鍙�", field: "inSCStationCode", type: "string", }, { - title: "鍑哄簱绔欏彴缂栧彿1", + title: "鍑哄簱绔欏彴缂栧彿", field: "outStationCode", type: "string", }, { - title: "鍑哄簱绔欏彴缂栧彿2", + title: "鍫嗗灈鏈哄嚭搴撶珯鍙扮紪鍙�", field: "outSCStationCode", type: "string", }, @@ -100,13 +100,13 @@ { title: "绂佺敤鐘舵��", field: "enableStatus",type: "select",dataKey: "enableStatusEnum",data: [],}, ], [ - { title: "鍏ュ簱绔欏彴缂栧彿1", field: "inStationCode", type: "like" }, - { title: "鍏ュ簱绔欏彴缂栧彿2", field: "inSCStationCode", type: "like" }, + { title: "鍏ュ簱绔欏彴缂栧彿", field: "inStationCode", type: "like" }, + { title: "鍫嗗灈鏈哄叆搴撶珯鍙扮紪鍙�", field: "inSCStationCode", type: "like" }, { title: "璁惧缂栧彿", field: "deviceNo", type: "like" }, ], [ - { title: "鍑哄簱绔欏彴缂栧彿1", field: "outStationCode", type: "like" }, - { title: "鍑哄簱绔欏彴缂栧彿2",field: "outSCStationCode",type: "like",}, + { title: "鍑哄簱绔欏彴缂栧彿", field: "outStationCode", type: "like" }, + { title: "鍫嗗灈鏈哄嚭搴撶珯鍙扮紪鍙�",field: "outSCStationCode",type: "like",}, ] ]); const columns = ref([ @@ -152,28 +152,28 @@ }, { field: "inStationCode", - title: "鍏ュ簱绔欏彴缂栧彿1", + title: "鍏ュ簱绔欏彴缂栧彿", type: "string", width: 120, align: "left", }, { field: "inSCStationCode", - title: "鍏ュ簱绔欏彴缂栧彿2", + title: "鍫嗗灈鏈哄叆搴撶珯鍙扮紪鍙�", type: "string", width: 150, align: "left", }, { field: "outStationCode", - title: "鍑哄簱绔欏彴缂栧彿1", + title: "鍑哄簱绔欏彴缂栧彿", type: "decimal", width: 120, align: "left", }, { field: "outSCStationCode", - title: "鍑哄簱绔欏彴缂栧彿2", + title: "鍫嗗灈鏈哄嚭搴撶珯鍙扮紪鍙�", type: "string", width: 150, align: "left", diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/system/Sys_Log.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/system/Sys_Log.vue" index 9742628..06bb24e 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/system/Sys_Log.vue" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/system/Sys_Log.vue" @@ -33,22 +33,24 @@ const editFormOptions = ref([]); const searchFormFields = ref({"BeginDate":"","Url":"","LogType":[],"Success":[],"UserIP":"","ServiceIP":"","Role_Id":""}); const searchFormOptions = ref([[{"title":"璇锋眰鍦板潃","field":"Url","type":"text"},{"title":"鐢ㄦ埛IP","field":"UserIP","type":"text"},{"title":"鏈嶅姟鍣↖P","field":"ServiceIP","type":"text"}],[{"title":"寮�濮嬫椂闂�","field":"BeginDate","type":"datetime"},{"dataKey":"restatus","data":[],"title":"鍝嶅簲鐘舵��","field":"Success","type":"selectList"},{"dataKey":"roles","data":[],"title":"瑙掕壊ID","field":"Role_Id","type":"select"}],[{"dataKey":"log","data":[],"title":"鏃ュ織绫诲瀷","field":"LogType","colSize":12,"type":"checkbox"}]]); - const columns = ref([{field:'Id',title:'Id',type:'int',width:90,hidden:true,readonly:true,require:true,align:'left'}, - {field:'BeginDate',title:'寮�濮嬫椂闂�',type:'datetime',width:140,align:'left',sortable:true}, - {field:'UserName',title:'鐢ㄦ埛鍚嶇О',type:'string',width:90,align:'left'}, - {field:'Url',title:'璇锋眰鍦板潃',type:'string',width:110,align:'left'}, - {field:'LogType',title:'鏃ュ織绫诲瀷',type:'string',bind:{ key:'log',data:[]},width:80,align:'left'}, - {field:'Success',title:'鍝嶅簲鐘舵��',type:'int',bind:{ key:'restatus',data:[]},width:80,align:'left'}, - {field:'ElapsedTime',title:'鏃堕暱',type:'int',width:60,align:'left'}, - {field:'RequestParameter',title:'璇锋眰鍙傛暟',type:'string',width:70,align:'left'}, - {field:'ResponseParameter',title:'鍝嶅簲鍙傛暟',type:'string',width:70,align:'left'}, - {field:'ExceptionInfo',title:'寮傚父淇℃伅',type:'string',width:70,align:'left'}, - {field:'UserIP',title:'鐢ㄦ埛IP',type:'string',width:90,align:'left'}, - {field:'ServiceIP',title:'鏈嶅姟鍣↖P',type:'string',width:90,hidden:true,align:'left'}, - {field:'BrowserType',title:'娴忚鍣ㄧ被鍨�',type:'string',width:90,align:'left'}, - {field:'User_Id',title:'鐢ㄦ埛ID',type:'int',width:90,hidden:true,align:'left'}, - {field:'Role_Id',title:'瑙掕壊ID',type:'int',bind:{ key:'roles',data:[]},width:90,hidden:true,align:'left'}, - {field:'EndDate',title:'缁撴潫鏃堕棿',type:'datetime',width:150,hidden:true,align:'left',sortable:true}]); + const columns = ref([{field:'id',title:'Id',type:'int',width:90,hidden:true,readonly:true,require:true,align:'left'}, + {field:'beginDate',title:'寮�濮嬫椂闂�',type:'datetime',width:140,align:'left',sortable:true}, + {field:'userName',title:'鐢ㄦ埛鍚嶇О',type:'string',width:90,align:'left'}, + {field:'url',title:'璇锋眰鍦板潃',type:'string',width:110,align:'left'}, + // {field:'logType',title:'鏃ュ織绫诲瀷',type:'string',bind:{ key:'log',data:[]},width:80,align:'left'}, + {field:'methodName',title:'鎺ュ彛鍚嶇О',type:'string',width:90,align:'left'}, + {field:'methodremark',title:'鎺ュ彛鎻忚堪',type:'string',width:90,align:'left'}, + {field:'success',title:'鍝嶅簲鐘舵��',type:'int',bind:{ key:'restatus',data:[]},width:80,align:'left'}, + {field:'elapsedTime',title:'鏃堕暱',type:'int',width:60,align:'left'}, + {field:'requestParam',title:'璇锋眰鍙傛暟',type:'string',width:70,align:'left'}, + {field:'responseParam',title:'鍝嶅簲鍙傛暟',type:'string',width:60,align:'left'}, + // {field:'exceptionInfo',title:'寮傚父淇℃伅',type:'string',width:70,align:'left'}, + {field:'userIP',title:'鐢ㄦ埛IP',type:'string',width:90,align:'left'}, + {field:'serviceIP',title:'鏈嶅姟鍣↖P',type:'string',width:90,hidden:true,align:'left'}, + // {field:'browserType',title:'娴忚鍣ㄧ被鍨�',type:'string',width:90,align:'left'}, + {field:'user_Id',title:'鐢ㄦ埛ID',type:'int',width:90,hidden:true,align:'left'}, + {field:'role_Id',title:'瑙掕壊ID',type:'int',bind:{ key:'roles',data:[]},width:90,hidden:true,align:'left'}, + {field:'endDate',title:'缁撴潫鏃堕棿',type:'datetime',width:150,hidden:true,align:'left',sortable:true}]); const detail = ref({ cnName: "#detailCnName", columns: [], diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/taskinfo/task_hty.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/taskinfo/task_hty.vue" index d24a17b..b250abf 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/taskinfo/task_hty.vue" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/taskinfo/task_hty.vue" @@ -157,8 +157,8 @@ align: "left", }, { - field: "dispatchertime", - title: "浠诲姟涓嬪彂鏃堕棿", + field: "finishDate", + title: "瀹屾垚鏃堕棿", type: "datetime", width: 150, align: "left", @@ -201,7 +201,7 @@ }, { field: "operateType", - title: "澶囨敞", + title: "鎿嶄綔绫诲瀷", type: "string", width: 100, align: "left", diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/15173735-4d40-4303-9957-72c73104d72f.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/15173735-4d40-4303-9957-72c73104d72f.vsidx" deleted file mode 100644 index 3f0426e..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/15173735-4d40-4303-9957-72c73104d72f.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/39801809-a703-4c28-96d8-7a0a847ba0ee.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/39801809-a703-4c28-96d8-7a0a847ba0ee.vsidx" deleted file mode 100644 index a8642d7..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/39801809-a703-4c28-96d8-7a0a847ba0ee.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/42a9ad71-6cad-4c27-8852-8b0836dcc4ff.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/42a9ad71-6cad-4c27-8852-8b0836dcc4ff.vsidx" new file mode 100644 index 0000000..3b7097d --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/42a9ad71-6cad-4c27-8852-8b0836dcc4ff.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/a15af72d-cadb-4f43-be5a-3770c0ed83df.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/a15af72d-cadb-4f43-be5a-3770c0ed83df.vsidx" new file mode 100644 index 0000000..9dc3627 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/a15af72d-cadb-4f43-be5a-3770c0ed83df.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b87d687f-d7bb-4da2-b1ce-f7dcf001b90e.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b87d687f-d7bb-4da2-b1ce-f7dcf001b90e.vsidx" deleted file mode 100644 index a2c1999..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b87d687f-d7bb-4da2-b1ce-f7dcf001b90e.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/c7430a94-d316-4296-bb96-0039e2a686ff.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/c7430a94-d316-4296-bb96-0039e2a686ff.vsidx" new file mode 100644 index 0000000..e946247 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/c7430a94-d316-4296-bb96-0039e2a686ff.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/d456fc8b-b3fc-438a-9e3d-b9e6b49026cc.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/d456fc8b-b3fc-438a-9e3d-b9e6b49026cc.vsidx" new file mode 100644 index 0000000..6e4a65c --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/d456fc8b-b3fc-438a-9e3d-b9e6b49026cc.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/d48a3c6c-f39c-42e9-bd7e-a9ecb962fc09.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/d48a3c6c-f39c-42e9-bd7e-a9ecb962fc09.vsidx" deleted file mode 100644 index 4821767..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/d48a3c6c-f39c-42e9-bd7e-a9ecb962fc09.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs" index 299ee40..83360f0 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs" @@ -84,6 +84,7 @@ if (!result.Item1) return WebResponseContent.Instance.Error(result.Item2); int side = 1; + string SC = "SC01_"; List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>(); for (int i = 0; i < initializationLocationDTO.MaxRow; i++) { @@ -91,6 +92,8 @@ { for (int k = 0; k < initializationLocationDTO.MaxLayer; k++) { + if (j + 1 > 30) SC = "SC02_"; + else SC = "SC01_"; Dt_LocationInfo locationInfo = new Dt_LocationInfo() { AreaId = 10, @@ -99,7 +102,7 @@ Layer = k + 1, LocationStatus = LocationStatusEnum.Free.ObjToInt(), LocationType = LocationTypeEnum.Cube.ObjToInt(), - RoadwayNo ="SC01_" +initializationLocationDTO.Roadway, + RoadwayNo = SC + initializationLocationDTO.Roadway, Row = i + 1, }; diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/App.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/App.cs" index 2c5653e..d385eba 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/App.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/App.cs" @@ -25,6 +25,11 @@ private static bool _isRun; + /// <summary> + /// 鏈夋晥鏈� + /// </summary> + public static DateTime? ExpDateTime = null; + /// <summary>鏄惁姝e湪杩愯</summary> public static bool IsBuild { get; set; } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/LogEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/LogEnum.cs" new file mode 100644 index 0000000..9c6df34 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/LogEnum.cs" @@ -0,0 +1,24 @@ +锘縰sing System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Enums +{ + public enum LogStatusEnum + { + /// <summary> + /// 鎴愬姛 + /// </summary> + [Description("鎴愬姛")] + Success = 1, + + /// <summary> + /// 寮傚父 + /// </summary> + [Description("寮傚父")] + Error = 2, + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs" index efdb638..c0eda16 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs" @@ -13,6 +13,7 @@ using WIDESEA_Core.BaseRepository; using WIDESEA_Core.BaseServices; using WIDESEA_Core.Helper; +using WIDESEA_Core.LogHelper; namespace WIDESEA_Core.Extensions { @@ -25,7 +26,10 @@ var cacheType = new List<Type>(); builder.RegisterType<LogAOP>(); - cacheType.Add(typeof(LogAOP)); + if (AppSettings.app("LogAopEnable").ObjToBool()) + { + cacheType.Add(typeof(LogAOP)); + } builder.RegisterGeneric(typeof(RepositoryBase<>)).As(typeof(IRepository<>)).InstancePerDependency();//娉ㄥ唽浠撳偍 builder.RegisterGeneric(typeof(ServiceBase<,>)).As(typeof(IService<>)).InstancePerDependency();//娉ㄥ唽鏈嶅姟 @@ -68,6 +72,8 @@ .AsImplementedInterfaces() .InstancePerLifetimeScope() .PropertiesAutowired(); + + builder.RegisterType<RequestLogModel>().InstancePerLifetimeScope(); } } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs" index da9e300..49d00d5 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs" @@ -145,12 +145,12 @@ throw new Exception("寮傚父锛屽搷搴旂爜锛�" + statsCode.ToString()); } - Logger.Write_Log("System/API璇锋眰", rquestName, "璇锋眰鎴愬姛", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent }); + Logger1.Write_Log("System/API璇锋眰", rquestName, "璇锋眰鎴愬姛", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent }); return JsonConvert.DeserializeObject<T>(responseContent); } catch (Exception ex) { - Logger.Write_Log("System/API璇锋眰", rquestName, "璇锋眰寮傚父", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent, 閿欒 = ex.Message }); + Logger1.Write_Log("System/API璇锋眰", rquestName, "璇锋眰寮傚父", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent, 閿欒 = ex.Message }); throw ex; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/Logger.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/Logger.cs" index 4995e84..1d9a8b7 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/Logger.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/Logger.cs" @@ -1,158 +1,310 @@ -锘� -using Microsoft.AspNetCore.Http; -using Newtonsoft.Json; +锘縰sing Microsoft.AspNetCore.Http; +using Microsoft.OpenApi.Models; using SqlSugar; +using StackExchange.Profiling.Internal; using System; +using System.Collections.Concurrent; using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.IO; using System.Linq; +using System.Reflection; +using System.Runtime.Serialization.Formatters; using System.Text; using System.Threading.Tasks; +using System.Xml.Linq; using WIDESEA_Core.DB; +using WIDESEA_Core.Enums; using WIDESEA_Core.Helper; using WIDESEA_Core.HttpContextUser; using WIDESEA_Core.Seed; namespace WIDESEA_Core.LogHelper { - public class Logger + public static class Logger { - - public static void Debug(string message) + public static ConcurrentQueue<dynamic> loggerQueueData = new ConcurrentQueue<dynamic>(); + static Logger() { - - } - - public static void Debug(string message, Exception exception) - { - - } - - public static void Info(string message) - { - - } - - public static void Info(string message, Exception exception) - { - - } - - public static void Warn(string message) - { - - } - - public static void Warning(string message, Exception exception) - { - - } - - public static void Error(string message) - { - - } - - public static void Error(string message, Exception exception) - { - - } - - public static void Fatal(string message) - { - - } - - public static void Fatal(string message, Exception exception) - { - - } - public static void Write_Log(string groupName, string logName, string content, object data = null) - { - DateTime nowTime = DateTime.Now; - string basePath = System.Environment.CurrentDirectory + "/Log/" + $"/{groupName}/{nowTime.ToString("yyyy-MM-dd")}"; - //濡傛灉鏃ュ織鏂囦欢鐩綍涓嶅瓨鍦�,鍒欏垱寤� - if (!Directory.Exists(basePath)) + Task.Run(() => { - Directory.CreateDirectory(basePath); - } - try + StartWriteLog(); + }); + + } + + static void StartWriteLog() + { + DataTable queueTable = CreateEmptyTable(); + while (true) { - FileStream fs = new FileStream(basePath + "/" + logName + $"{nowTime.ToString("yyMMdd")}.txt", FileMode.Append); - StreamWriter strwriter = new StreamWriter(fs); try { - strwriter.WriteLine(nowTime.ToString() + "." + nowTime.Millisecond); - strwriter.WriteLine(content); - if (data != null) + //濡傛灉闃熷垪涓湁鏁版嵁涓旈槦鍒楄〃涓殑琛屾暟灏忎簬500锛屽垯灏嗛槦鍒椾腑鐨勬暟鎹啓鍏ラ槦鍒楄〃 + if (loggerQueueData.Count() > 0 && queueTable.Rows.Count < 500) { - strwriter.WriteLine(JsonConvert.SerializeObject(data)); + DequeueToTable(queueTable); continue; } - strwriter.WriteLine("-------------------------------"); - strwriter.WriteLine(); - strwriter.Flush(); + //姣�5绉掑啓涓�娆℃暟鎹� + Thread.Sleep(5000); + + //濡傛灉闃熷垪琛ㄤ腑鐨勮鏁颁负0锛屽垯璺宠繃鏈寰幆 + if (queueTable.Rows.Count == 0) { continue; } + + //鍒涘缓SqlSugarClient瀵硅薄锛岀敤浜庤繛鎺ユ暟鎹簱 + SqlSugarClient sugarClient = new SqlSugarClient(new ConnectionConfig() + { + ConnectionString = DBContext.GetMainConnectionDb().Connection, + IsAutoCloseConnection = true, + DbType = MainDb.DbType, + }); + + //灏嗛槦鍒楄〃涓殑鏁版嵁鎵归噺鎻掑叆鏁版嵁搴� + int rows = sugarClient.Fastest<DataTable>().AS("Sys_Log").BulkCopy(queueTable); + + //娓呯┖闃熷垪琛� + queueTable.Clear(); } - catch { } - finally + catch (Exception ex) { - strwriter.Close(); - fs.Close(); + //鎵撳嵃寮傚父淇℃伅 + Console.WriteLine(ex.ToString()); } } - catch { } } - public static void WriteApiLog2DB(HttpContext context, string requestParameter, DateTime beginDate, string responseParameter, DateTime endDate, LoggerStatus loggerStatus) + private static void DequeueToTable(DataTable queueTable) { + loggerQueueData.TryDequeue(out dynamic log); + if (log != null) + { + DataRow row = queueTable.NewRow(); + // 濡傛灉log鐨凚eginDate涓虹┖鎴栬�匓eginDate鐨勫勾浠藉皬浜�2010锛屽垯灏咮eginDate璁剧疆涓哄綋鍓嶆椂闂� + if (log.BeginDate == null || log.BeginDate?.Year < 2010) + { + log.BeginDate = DateTime.Now; + } + // 濡傛灉log鐨凟ndDate涓虹┖锛屽垯灏咵ndDate璁剧疆涓哄綋鍓嶆椂闂� + if (log.EndDate == null) + { + log.EndDate = DateTime.Now; + } + // row["Id"] = log.Id; + // 灏哛equestParam涓殑鎹㈣绗︽浛鎹负绌哄瓧绗︿覆 + row["RequestParam"] = log.RequestParam?.Replace("\r\n", "").Replace("\n", ""); + // 灏哛esponseParam涓殑鎹㈣绗︽浛鎹负绌哄瓧绗︿覆 + row["ResponseParam"] = log.ResponseParam?.Replace("\r\n", "").Replace("\n", ""); + row["Success"] = log.Success ?? -1; + // 灏咮eginDate璁剧疆涓簂og鐨凚eginDate + row["BeginDate"] = log.BeginDate; + // 灏咵ndDate璁剧疆涓簂og鐨凟ndDate + row["EndDate"] = log.EndDate; + // 璁$畻ElapsedTime锛屽嵆EndDate鍑忓幓BeginDate鐨勬绉掓暟 + row["ElapsedTime"] = ((DateTime)log.EndDate - (DateTime)log.BeginDate).TotalMilliseconds; + // 灏哢serIP璁剧疆涓簂og鐨刄serIP + row["UserIP"] = log.UserIP; + // 灏哢rl璁剧疆涓簂og鐨刄rl + row["Url"] = log.Url; + // 濡傛灉log鐨刄serId涓虹┖锛屽垯灏哢serId璁剧疆涓�-1锛屽惁鍒欒缃负log鐨刄serId + row["UserId"] = log.UserId ?? -1; + // 灏哢serName璁剧疆涓簂og鐨刄serName + row["UserName"] = log.UserName; + row["MethodName"] = log.MethodName; + row["Methodremark"] = log.Methodremark; + // 灏唕ow娣诲姞鍒皅ueueTable涓� + queueTable.Rows.Add(row); + } + } + + private static DataTable CreateEmptyTable() + { + DataTable queueTable = new DataTable(); + queueTable.Columns.Add("BeginDate", Type.GetType("System.DateTime")); + queueTable.Columns.Add("ElapsedTime", Type.GetType("System.Int32")); + queueTable.Columns.Add("EndDate", Type.GetType("System.DateTime")); + queueTable.Columns.Add("RequestParam", typeof(string)); + queueTable.Columns.Add("ResponseParam", typeof(string)); + queueTable.Columns.Add("Success", Type.GetType("System.Int32")); + queueTable.Columns.Add("Url", typeof(string)); + queueTable.Columns.Add("UserIP", typeof(string)); + queueTable.Columns.Add("UserName", typeof(string)); + queueTable.Columns.Add("UserId", Type.GetType("System.Int32")); + queueTable.Columns.Add("MethodName", typeof(string)); + queueTable.Columns.Add("Methodremark", typeof(string)); + //queueTable.Columns.Add("ServiceIP", typeof(string)); + //queueTable.Columns.Add("BrowserType", typeof(string)); + //queueTable.Columns.Add("Role_Id", Type.GetType("System.Int32")); + return queueTable; + } + + public static void Add(string requestParameter, string responseParameter) + { + dynamic log = null; + string MethodName = string.Empty; + string Methodremark = string.Empty; try { - if (context.Request.Method == "OPTIONS") return; - + //鑾峰彇褰撳墠HttpContext + HttpContext context = App.HttpContext; + //濡傛灉HttpContext涓虹┖锛屽垯杩斿洖 if (context == null) { - Console.WriteLine($"鏈幏鍙栧埌httpcontext淇℃伅,reqParam:{requestParameter},respParam:{responseParameter},success:{loggerStatus}"); return; } - Dictionary<string, object> dic = new Dictionary<string, object> + //濡傛灉璇锋眰鏂规硶涓篛PTIONS锛屽垯杩斿洖 + if (context.Request.Method == "OPTIONS") return; + //鑾峰彇RequestLogModel瀹炰緥 + RequestLogModel logModel = (context.RequestServices.GetService(typeof(RequestLogModel)) as RequestLogModel) ?? new RequestLogModel { RequestDate = DateTime.Now }; + #region 鑾峰彇鎺ュ彛娉ㄩ噴 + try { - {"BeginDate",beginDate }, - {"ElapsedTime",(endDate - beginDate).TotalMilliseconds.DoubleToInt() }, - {"EndDate",endDate }, - {"RequestParam",requestParameter }, - {"ResponseParam",responseParameter }, - {"Success",1 }, - {"Url",context.Request.Path.Value??"" }, - {"UserIP",context.GetUserIp() }, - {"UserName","App.User?.Name" }, - {"User_Id","0" } + string path = context.Request.Path; + var names = path.Split('/'); + var basePath = AppContext.BaseDirectory + "WIDESEA_WMSServer"; + Assembly assembly = Assembly.LoadFrom(basePath); + List<Type> types = assembly.GetTypes().Where(x => x.Name.Contains(names[2] + "Controller")).ToList(); + if (types.Count > 0) + { + //MethodInfo methodInfo = types.First().GetMethod("login"); + MethodInfo methodInfo = types.First().GetMethods() + .FirstOrDefault(m => m.Name.Equals(names[3], StringComparison.OrdinalIgnoreCase)); + if (methodInfo != null) + { + MethodName = methodInfo.Name; + string xmlPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, methodInfo.DeclaringType.Assembly.GetName().Name + ".xml"); + //if (!File.Exists(xmlPath)) return "XML documentation file not found."; // 妫�鏌ユ枃浠舵槸鍚﹀瓨鍦� + // 鍔犺浇XML鏂囨。骞惰В鏋愭憳瑕佷俊鎭� + XDocument xdoc = XDocument.Load(xmlPath); + string membername = $"M:{methodInfo.DeclaringType.FullName}.{methodInfo.Name}"; + var member = xdoc.Descendants("member") + .FirstOrDefault(m => m.Attribute("name").Value.ToString().Contains(membername));// 瀹氫綅鍒版柟娉曡妭鐐� + //.FirstOrDefault(m => m.Attribute("name")?.Value == $"M:{methodInfo.DeclaringType.FullName}.{methodInfo.Name}"); // 瀹氫綅鍒版柟娉曡妭鐐� + //if (member == null) return "Member not found in XML documentation."; // 妫�鏌ユ柟娉曟槸鍚﹀湪XML鏂囨。涓壘鍒� + //var summary = member?.Element("summary")?.Value ?? "No summary provided."; // 鑾峰彇鎽樿淇℃伅鎴栭粯璁ゅ�� + Methodremark = member?.Element("summary")?.Value.Replace("\n", "").Replace(" ", "") ?? methodInfo.Name; // 鑾峰彇鎽樿淇℃伅鎴栭粯璁ゅ�� + } + } + } + catch (Exception ex) + { - //{"BeginDate",beginDate }, - //{"ElapsedTime",(endDate - beginDate).TotalMilliseconds.ObjToInt() }, - //{"EndDate",endDate }, - //{"RequestParam",requestParameter }, - //{"ResponseParam",responseParameter }, - //{"Success",1 }, - //{"Url",context.Request.Path.Value??"" }, - //{"UserIP",context.GetUserIp() }, - //{"UserName","App.User?.Name" }, - //{"User_Id","App.User?.ID" } + } + #endregion + //鑾峰彇褰撳墠鐢ㄦ埛 + IUser user = App.User; + //鍒涘缓鏃ュ織瀵硅薄 + log = new + { + //璇锋眰寮�濮嬫椂闂� + BeginDate = logModel.RequestDate, + //璇锋眰缁撴潫鏃堕棿 + EndDate = DateTime.Now, + //璇锋眰鍙傛暟 + RequestParam = requestParameter, + //鍝嶅簲鍙傛暟 + ResponseParam = responseParameter, + //鏂规硶鍚嶇О + MethodName = MethodName, + //鏂规硶鎻忚堪 + Methodremark= Methodremark, + //鍝嶅簲鐘舵�� + Success = LogStatusEnum.Success.ObjToInt(), + //璇锋眰URL + Url = context.Request.Scheme + "://" + context.Request.Host + context.Request.PathBase + context.Request.Path, + //瀹㈡埛绔疘P + UserIP = GetClientIP(context)?.Replace("::ffff:", "").Replace("::1", "127.0.0.1"), + //鐢ㄦ埛ID + UserId = user.UserId, + //鐢ㄦ埛鍚� + UserName = user.UserName }; - - - SqlSugarClient sqlSugarClient = DBContext.GetCustomDB(DBContext.GetConnectionConfig()); - sqlSugarClient.Insertable(dic).AS("Sys_Log").ExecuteCommand(); } - catch (Exception ex) + catch (Exception exception) { - + //濡傛灉鍙戠敓寮傚父锛屽垯鍒涘缓鏃ュ織瀵硅薄 + log = log ?? new + { + //璇锋眰寮�濮嬫椂闂� + BeginDate = DateTime.Now, + //璇锋眰缁撴潫鏃堕棿 + EndDate = DateTime.Now, + //璇锋眰鍙傛暟 + RequestParam = requestParameter, + //鍝嶅簲鍙傛暟 + ResponseParam = responseParameter, + //鏂规硶鍚嶇О + MethodName = MethodName, + //鏂规硶鎻忚堪 + Methodremark = Methodremark, + //鍝嶅簲鐘舵�� + Success = LogStatusEnum.Error.ObjToInt(), + }; } + //娣诲姞绯荤粺鏃ュ織 + loggerQueueData.Enqueue(log); } - } - public enum LoggerStatus - { - Success = 1, - Error = 2, - Info = 3 + public static void Add(string url, string requestParameter, string responseParameter, DateTime beginDate) + { + dynamic? log = null; + try + { + //鑾峰彇褰撳墠鐢ㄦ埛 + IUser? user = App.User; + //鍒涘缓鏃ュ織瀵硅薄 + log = new + { + //璇锋眰寮�濮嬫椂闂� + BeginDate = beginDate, + //璇锋眰缁撴潫鏃堕棿 + EndDate = DateTime.Now, + //璇锋眰鍙傛暟 + RequestParam = requestParameter, + //鍝嶅簲鍙傛暟 + ResponseParam = responseParameter, + //璇锋眰URL + Url = url, + //瀹㈡埛绔疘P + UserIP = "", + //鐢ㄦ埛ID + UserId = user?.UserId, + //鐢ㄦ埛鍚� + UserName = user?.UserName + }; + } + catch (Exception exception) + { + //濡傛灉鍙戠敓寮傚父锛屽垯鍒涘缓鏃ュ織瀵硅薄 + log = log ?? new + { + //璇锋眰寮�濮嬫椂闂� + BeginDate = DateTime.Now, + //璇锋眰缁撴潫鏃堕棿 + EndDate = DateTime.Now, + //璇锋眰鍙傛暟 + RequestParam = requestParameter, + //鍝嶅簲鍙傛暟 + ResponseParam = responseParameter, + }; + } + //娣诲姞绯荤粺鏃ュ織 + loggerQueueData.Enqueue(log); + } + + public static string GetClientIP(HttpContext context) + { + // 鑾峰彇璇锋眰澶翠腑鐨刋-Forwarded-For瀛楁锛屽苟灏嗗叾杞崲涓哄瓧绗︿覆 + var ip = context.Request.Headers["X-Forwarded-For"].ObjToString(); + // 濡傛灉X-Forwarded-For瀛楁涓虹┖锛屽垯鑾峰彇杩滅▼IP鍦板潃 + if (string.IsNullOrEmpty(ip)) + { + ip = context.Connection.RemoteIpAddress.ObjToString(); + } + + // 杩斿洖IP鍦板潃 + return ip; + } } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/Logger1.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/Logger1.cs" new file mode 100644 index 0000000..336b2c3 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/Logger1.cs" @@ -0,0 +1,158 @@ +锘� +using Microsoft.AspNetCore.Http; +using Newtonsoft.Json; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB; +using WIDESEA_Core.Helper; +using WIDESEA_Core.HttpContextUser; +using WIDESEA_Core.Seed; + +namespace WIDESEA_Core.LogHelper +{ + partial class Logger1 + { + + public static void Debug(string message) + { + + } + + public static void Debug(string message, Exception exception) + { + + } + + public static void Info(string message) + { + + } + + public static void Info(string message, Exception exception) + { + + } + + public static void Warn(string message) + { + + } + + public static void Warning(string message, Exception exception) + { + + } + + public static void Error(string message) + { + + } + + public static void Error(string message, Exception exception) + { + + } + + public static void Fatal(string message) + { + + } + + public static void Fatal(string message, Exception exception) + { + + } + public static void Write_Log(string groupName, string logName, string content, object data = null) + { + DateTime nowTime = DateTime.Now; + string basePath = System.Environment.CurrentDirectory + "/Log/" + $"/{groupName}/{nowTime.ToString("yyyy-MM-dd")}"; + //濡傛灉鏃ュ織鏂囦欢鐩綍涓嶅瓨鍦�,鍒欏垱寤� + if (!Directory.Exists(basePath)) + { + Directory.CreateDirectory(basePath); + } + try + { + FileStream fs = new FileStream(basePath + "/" + logName + $"{nowTime.ToString("yyMMdd")}.txt", FileMode.Append); + StreamWriter strwriter = new StreamWriter(fs); + try + { + strwriter.WriteLine(nowTime.ToString() + "." + nowTime.Millisecond); + strwriter.WriteLine(content); + if (data != null) + { + strwriter.WriteLine(JsonConvert.SerializeObject(data)); + } + strwriter.WriteLine("-------------------------------"); + strwriter.WriteLine(); + strwriter.Flush(); + } + catch { } + finally + { + strwriter.Close(); + fs.Close(); + } + } + catch { } + } + + public static void WriteApiLog2DB(HttpContext context, string requestParameter, DateTime beginDate, string responseParameter, DateTime endDate, LoggerStatus loggerStatus) + { + try + { + if (context.Request.Method == "OPTIONS") return; + + if (context == null) + { + Console.WriteLine($"鏈幏鍙栧埌httpcontext淇℃伅,reqParam:{requestParameter},respParam:{responseParameter},success:{loggerStatus}"); + return; + } + + Dictionary<string, object> dic = new Dictionary<string, object> + { + {"BeginDate",beginDate }, + {"ElapsedTime",(endDate - beginDate).TotalMilliseconds.DoubleToInt() }, + {"EndDate",endDate }, + {"RequestParam",requestParameter }, + {"ResponseParam",responseParameter }, + {"Success",1 }, + {"Url",context.Request.Path.Value??"" }, + {"UserIP",context.GetUserIp() }, + {"UserName","App.User?.Name" }, + {"User_Id","0" } + + //{"BeginDate",beginDate }, + //{"ElapsedTime",(endDate - beginDate).TotalMilliseconds.ObjToInt() }, + //{"EndDate",endDate }, + //{"RequestParam",requestParameter }, + //{"ResponseParam",responseParameter }, + //{"Success",1 }, + //{"Url",context.Request.Path.Value??"" }, + //{"UserIP",context.GetUserIp() }, + //{"UserName","App.User?.Name" }, + //{"User_Id","App.User?.ID" } + }; + + + SqlSugarClient sqlSugarClient = DBContext.GetCustomDB(DBContext.GetConnectionConfig()); + sqlSugarClient.Insertable(dic).AS("Sys_Log").ExecuteCommand(); + } + catch (Exception ex) + { + + } + } + } + + public enum LoggerStatus + { + Success = 1, + Error = 2, + Info = 3 + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/RequestLogModel.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/RequestLogModel.cs" new file mode 100644 index 0000000..0404a69 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/RequestLogModel.cs" @@ -0,0 +1,13 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.LogHelper +{ + public class RequestLogModel + { + public DateTime RequestDate { get; set; } + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs" index ee5bdd9..680b875 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs" @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Net; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; @@ -30,18 +31,35 @@ //todo public async Task InvokeAsync(HttpContext context) { + if (App.ExpDateTime != null && (DateTime.Now - App.ExpDateTime.GetValueOrDefault()).TotalSeconds > 0) + { + context.Response.StatusCode = HttpStatusCode.InternalServerError.ObjToInt(); + context.Response.ContentType = "application/json"; + + var json = new WebResponseContent(); + + json.Message = HttpStatusCode.InternalServerError.ToString();//閿欒淇℃伅 + json.Code = 500;//500寮傚父 + + StreamWriter streamWriter = new StreamWriter(context.Response.Body); + await streamWriter.WriteAsync(json.Serialize()); + return; + } + // 杩囨护锛屽彧鏈夋帴鍙� if (context.Request.Path.Value?.Contains("api") ?? false) { context.Request.EnableBuffering(); Stream originalBody = context.Response.Body; - + string requestParam = string.Empty; + string responseParam = string.Empty; try { + (context.RequestServices.GetService(typeof(RequestLogModel)) as RequestLogModel).RequestDate = DateTime.Now; try { // 瀛樺偍璇锋眰鏁版嵁 - await RequestDataLog(context); + requestParam = RequestDataLog(context); context.Request.Body.Position = 0; } catch { } @@ -53,18 +71,20 @@ try { // 瀛樺偍鍝嶅簲鏁版嵁 - ResponseDataLog(context.Response, ms); + responseParam = ResponseDataLog(context.Response); } catch { } ms.Position = 0; await ms.CopyToAsync(originalBody); + if (!((context.Request.Path.Value?.Contains("get")) ?? true) && !((context.Request.Path.Value?.Contains("Get")) ?? true) && !((context.Request.Path.Value?.Contains("query")) ?? true) && !((context.Request.Path.Value?.Contains("Query")) ?? true) && !((context.Request.Path.Value?.Contains("DownLoadApp")) ?? true) && !((context.Request.Path.Value?.Contains("downLoadApp")) ?? true) && !((context.Request.Path.Value?.Contains("UploadApp")) ?? true) && !((context.Request.Path.Value?.Contains("uploadApp")) ?? true)) + Logger.Add(requestParam, responseParam); } catch (Exception ex) { // 璁板綍寮傚父 - + } finally { @@ -76,26 +96,67 @@ await _next(context); } } - - - private async Task RequestDataLog(HttpContext context) + private string RequestDataLog(HttpContext context) { var request = context.Request; + var sr = new StreamReader(request.Body); - //long length = request.Body.Length; - RequestLogInfo requestResponse = new RequestLogInfo() + + object obj; + string bodyData = sr.ReadToEndAsync().Result; + if (request.ContentLength <= 100000) { - Path = request.Path, - QueryString = request.QueryString.ToString(), - BodyData = await sr.ReadToEndAsync() - }; - var content = JsonConvert.SerializeObject(requestResponse); - if (!string.IsNullOrEmpty(content)) - { - LogLock.OutLogAOP("鎺ュ彛鏃ュ織", new string[] { "璇锋眰鏁版嵁 - 璇锋眰鏁版嵁绫诲瀷:" + requestResponse.GetType().ToString(), content }); - request.Body.Position = 0; + obj = new + { + QueryString = request.QueryString.ToString(), + BodyData = bodyData + }; } + else + { + obj = new + { + QueryString = request.QueryString.ToString(), + BodyData = "" + }; + } + string data = JsonConvert.SerializeObject(obj); + + request.Body.Position = 0; + + return data; } + private string ResponseDataLog(HttpResponse response) + { + if (response.ContentLength <= 100000) + { + response.Body.Position = 0; + using StreamReader stream = new StreamReader(response.Body, leaveOpen: true); + string body = stream.ReadToEnd(); + response.Body.Position = 0; + return body; + } + return ""; + } + + //private async Task RequestDataLog(HttpContext context) + //{ + // var request = context.Request; + // var sr = new StreamReader(request.Body); + // //long length = request.Body.Length; + // RequestLogInfo requestResponse = new RequestLogInfo() + // { + // Path = request.Path, + // QueryString = request.QueryString.ToString(), + // BodyData = await sr.ReadToEndAsync() + // }; + // var content = JsonConvert.SerializeObject(requestResponse); + // if (!string.IsNullOrEmpty(content)) + // { + // LogLock.OutLogAOP("鎺ュ彛鏃ュ織", new string[] { "璇锋眰鏁版嵁 - 璇锋眰鏁版嵁绫诲瀷:" + requestResponse.GetType().ToString(), content }); + // request.Body.Position = 0; + // } + //} private void ResponseDataLog(HttpResponse response, MemoryStream ms) { diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ISystemRepository/ISys_LogRepository.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ISystemRepository/ISys_LogRepository.cs" new file mode 100644 index 0000000..afb622e --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ISystemRepository/ISys_LogRepository.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_ISystemRepository +{ + public interface ISys_LogRepository : IRepository<Sys_Log> + { + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_LogService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_LogService.cs" new file mode 100644 index 0000000..27dcb29 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_LogService.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_ISystemService +{ + public interface ISys_LogService : IService<Sys_Log> + { + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Log.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Log.cs" index ed75231..e651b41 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Log.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Log.cs" @@ -8,7 +8,10 @@ namespace WIDESEA_Model.Models { - [MultiTenant] + /// <summary> + /// 鎺ュ彛鏃ュ織 + /// </summary> + [SugarTable(nameof(Sys_Log), "鎺ュ彛鏃ュ織")] public class Sys_Log { /// <summary> @@ -78,6 +81,18 @@ public string UserName { get; set; } /// <summary> + /// 鏂规硶鍚嶇О + /// </summary> + [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鏂规硶鍚嶇О")] + public string MethodName { get; set; } + + /// <summary> + /// 鏂规硶鎻忚堪 + /// </summary> + [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鏂规硶鎻忚堪")] + public string Methodremark { get; set; } + + /// <summary> /// 鐢ㄦ埛涓婚敭 /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "鐢ㄦ埛涓婚敭")] diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task_Hty.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task_Hty.cs" index 87a6ed6..5e5d2d0 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task_Hty.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task_Hty.cs" @@ -140,7 +140,7 @@ public int SourceId { get; set; } [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "澶囨敞")] - public string OperateType { get; set; } + public string OperateType { get; set; } /// <summary> /// 鍒涘缓浜� @@ -173,5 +173,12 @@ [ExporterHeader(DisplayName = "淇敼鏃ユ湡")] [SugarColumn(IsNullable = true, ColumnDescription = "淇敼鏃ユ湡")] public DateTime? ModifyDate { get; set; } + /// <summary> + /// 瀹屾垚鏃堕棿 + /// </summary> + [ImporterHeader(Name = "瀹屾垚鏃堕棿")] + [ExporterHeader(DisplayName = "瀹屾垚鏃堕棿")] + [SugarColumn(IsNullable = true, ColumnDescription = "瀹屾垚鏃堕棿")] + public DateTime FinishDate { get; set; } = DateTime.Now; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_SystemRepository/Sys_LogRepository.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_SystemRepository/Sys_LogRepository.cs" new file mode 100644 index 0000000..128f9d0 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_SystemRepository/Sys_LogRepository.cs" @@ -0,0 +1,18 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_ISystemRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_SystemRepository +{ + public class Sys_LogRepository : RepositoryBase<Sys_Log>, ISys_LogRepository + { + public Sys_LogRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_LogService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_LogService.cs" new file mode 100644 index 0000000..a19fd81 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_LogService.cs" @@ -0,0 +1,19 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseServices; +using WIDESEA_ISystemRepository; +using WIDESEA_ISystemService; +using WIDESEA_Model.Models; + +namespace WIDESEA_SystemService +{ + public class Sys_LogService : ServiceBase<Sys_Log, ISys_LogRepository>, ISys_LogService + { + public Sys_LogService(ISys_LogRepository BaseDal) : base(BaseDal) + { + } + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_AGV.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_AGV.cs" index 8c780fe..15e927b 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_AGV.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_AGV.cs" @@ -293,6 +293,8 @@ { return new { code = 404, message = "鏈壘鍒拌浠诲姟!" }; } + if (task.TaskStatus == ((AGVTaskStatusEnum)Enum.Parse(typeof(AGVTaskStatusEnum), model.Task_status)).ObjToInt()) + return new { code = 200, message = "鎴愬姛" }; switch ((AGVTaskStatusEnum)Enum.Parse(typeof(AGVTaskStatusEnum), model.Task_status)) { case AGVTaskStatusEnum.Create: @@ -339,6 +341,12 @@ } case AGVTaskStatusEnum.Cancel: { + if (task.TaskStatus < AGVTaskStatusEnum.DoneFetch.ObjToInt()) + { + Dt_CachePoint startCachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == task.SourceAddress); + startCachePoint.PointStatus = LocationStatusEnum.InStock.ObjToInt(); + _basicService.CachePointService.Repository.UpdateData(startCachePoint); + } task.TaskStatus = AGVTaskStatusEnum.Cancel.ObjToInt(); BaseDal.DeleteAndMoveIntoHty(task, OperateType.鑷姩鍒犻櫎); return new { code = 200, message = "鎴愬姛" }; diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs" index 2d0a5ee..d19e649 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs" @@ -22,7 +22,7 @@ _repository = repository; } - [HttpPost, Route("InitializationLocation")] + [HttpPost, Route("InitializationLocation"), AllowAnonymous] public WebResponseContent InitializationLocation([FromBody] InitializationLocationDTO initializationLocationDTO) { return Service.InitializationLocation(initializationLocationDTO); diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_LogController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_LogController.cs" new file mode 100644 index 0000000..2f5cd74 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_LogController.cs" @@ -0,0 +1,20 @@ +锘縰sing Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using WIDESEA_Core.BaseController; +using WIDESEA_ISystemService; +using WIDESEA_Model.Models; + +namespace WIDESEA_WMSServer.Controllers +{ + /// <summary> + /// 鏃ュ織 + /// </summary> + [Route("api/[controller]")] + [ApiController] + public class Sys_LogController : ApiBaseController<ISys_LogService, Sys_Log> + { + public Sys_LogController(ISys_LogService service) : base(service) + { + } + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Log/System/API\350\257\267\346\261\202/2025-06-09/\345\217\253\346\226\231\344\273\273\345\212\241\344\270\213\345\217\221250609.txt" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Log/System/API\350\257\267\346\261\202/2025-06-09/\345\217\253\346\226\231\344\273\273\345\212\241\344\270\213\345\217\221250609.txt" new file mode 100644 index 0000000..8d13ada --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Log/System/API\350\257\267\346\261\202/2025-06-09/\345\217\253\346\226\231\344\273\273\345\212\241\344\270\213\345\217\221250609.txt" @@ -0,0 +1,35 @@ +2025/6/9 9:30:17.405 +璇锋眰鎴愬姛 +{"璇锋眰鎶ユ枃":{"task_id":"73","task_name":null,"priority":"0","site_value_type":1,"src_pos":"ZH012M001","dst_pos":"ZH01MZ002","car_id":-1,"src_level":0,"dst_level":0,"task_type":"1132","former_id":null},"鎺ユ敹鎶ユ枃":"{\"code\":200,\"message\":null,\"data\":{\"task_id\":\"73\",\"taskName\":\"ZH012M001-ZH01MZ002\",\"task_status\":\"Create\"}}"} +------------------------------- + +2025/6/9 9:36:59.918 +璇锋眰鎴愬姛 +{"璇锋眰鎶ユ枃":{"task_id":"74","task_name":null,"priority":"0","site_value_type":1,"src_pos":"ZH012M002","dst_pos":"ZH01MZ003","car_id":-1,"src_level":0,"dst_level":0,"task_type":"1132","former_id":null},"鎺ユ敹鎶ユ枃":"{\"code\":200,\"message\":null,\"data\":{\"task_id\":\"74\",\"taskName\":\"ZH012M002-ZH01MZ003\",\"task_status\":\"Create\"}}"} +------------------------------- + +2025/6/9 9:50:15.986 +璇锋眰鎴愬姛 +{"璇锋眰鎶ユ枃":{"task_id":"75","task_name":null,"priority":"0","site_value_type":1,"src_pos":"ZH013M009","dst_pos":"ZH012M002","car_id":-1,"src_level":4,"dst_level":0,"task_type":"1132","former_id":null},"鎺ユ敹鎶ユ枃":"{\"code\":200,\"message\":null,\"data\":{\"task_id\":\"75\",\"taskName\":\"ZH013M009-ZH012M002\",\"task_status\":\"Create\"}}"} +------------------------------- + +2025/6/9 10:14:14.801 +璇锋眰鎴愬姛 +{"璇锋眰鎶ユ枃":{"task_id":"76","task_name":null,"priority":"0","site_value_type":1,"src_pos":"ZH012M002","dst_pos":"ZH01MZ019","car_id":-1,"src_level":0,"dst_level":0,"task_type":"1132","former_id":null},"鎺ユ敹鎶ユ枃":"{\"code\":200,\"message\":null,\"data\":{\"task_id\":\"76\",\"taskName\":\"ZH012M002-ZH01MZ019\",\"task_status\":\"Create\"}}"} +------------------------------- + +2025/6/9 10:37:37.440 +璇锋眰鎴愬姛 +{"璇锋眰鎶ユ枃":{"task_id":"77","task_name":null,"priority":"0","site_value_type":1,"src_pos":"ZH013M011","dst_pos":"ZH012M002","car_id":-1,"src_level":4,"dst_level":0,"task_type":"1132","former_id":null},"鎺ユ敹鎶ユ枃":"{\"code\":200,\"message\":null,\"data\":{\"task_id\":\"77\",\"taskName\":\"ZH013M011-ZH012M002\",\"task_status\":\"Create\"}}"} +------------------------------- + +2025/6/9 10:38:12.431 +璇锋眰鎴愬姛 +{"璇锋眰鎶ユ枃":{"task_id":"78","task_name":null,"priority":"0","site_value_type":1,"src_pos":"ZH012P001","dst_pos":"ZH01PZ001","car_id":-1,"src_level":0,"dst_level":0,"task_type":"1132","former_id":null},"鎺ユ敹鎶ユ枃":"{\"code\":200,\"message\":null,\"data\":{\"task_id\":\"78\",\"taskName\":\"ZH012P001-ZH01PZ001\",\"task_status\":\"Create\"}}"} +------------------------------- + +2025/6/9 10:38:46.102 +璇锋眰鎴愬姛 +{"璇锋眰鎶ユ枃":{"task_id":"79","task_name":null,"priority":"0","site_value_type":1,"src_pos":"A02","dst_pos":"ZH011M009","car_id":-1,"src_level":0,"dst_level":0,"task_type":"1132","former_id":null},"鎺ユ敹鎶ユ枃":"{\"code\":200,\"message\":null,\"data\":{\"task_id\":\"79\",\"taskName\":\"A02-ZH011M009\",\"task_status\":\"Create\"}}"} +------------------------------- + diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs" index c7bbcc6..f16bbe7 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs" @@ -34,6 +34,7 @@ }); ; builder.ConfigureApplication(); +App.ExpDateTime = DateTime.Parse("2025-09-01 00:00:00"); // 2、配置服务 builder.Services.AddSingleton(new AppSettings(builder.Configuration));//注册 diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json" index 550dbc2..e2ada42 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json" @@ -21,7 +21,7 @@ // 娉ㄦ剰锛宧ttp://127.0.0.1:1818 鍜� http://localhost:1818 鏄笉涓�鏍风殑 "IPs": "http://127.0.0.1:8080,http://localhost:8080" }, - + "LogAopEnable": false, "WCS": "http://192.168.100.13:9291/api/Task/", "AGV": "http://192.168.100.60:8222/api/task/", "ApiName": "WIDESEA", -- Gitblit v1.9.3