From f978872b6de4e7e20d992a2ee7cda902c11347b9 Mon Sep 17 00:00:00 2001 From: kazelee <1847801760@qq.com> Date: 星期一, 30 六月 2025 15:31:56 +0800 Subject: [PATCH] 优化配置文件读取逻辑,将ERP反馈接口写入配置文件中配置 --- .vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/52b1bf39-572c-4392-9ec9-d2acb98174ba.vsidx | 0 Program.cs | 7 + wms/LocationHelper.cs | 2 /dev/null | 10 -- api/ErpController.cs | 1 core/Monitor.cs | 2 config/config.json | 25 +++--- .vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/1fcb0d14-51a5-4d39-abcb-a3412b32d895.vsidx | 0 core/WCSCore.cs | 4 HH.WCS.Mobox3.DSZSH.csproj | 2 .vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/02c9955a-b11d-4346-b51b-88bd67310ee5.vsidx | 0 config/config.comment.json | 108 +++++++++++++------------- util/Settings.cs | 25 ++++- api/ApiHelper.cs | 22 ++++- .vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/a24f5716-1832-4d56-a0d6-fdd4886a51ea.vsidx | 0 15 files changed, 107 insertions(+), 101 deletions(-) diff --git a/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/02c9955a-b11d-4346-b51b-88bd67310ee5.vsidx b/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/02c9955a-b11d-4346-b51b-88bd67310ee5.vsidx new file mode 100644 index 0000000..760d49f --- /dev/null +++ b/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/02c9955a-b11d-4346-b51b-88bd67310ee5.vsidx Binary files differ diff --git a/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/1fcb0d14-51a5-4d39-abcb-a3412b32d895.vsidx b/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/1fcb0d14-51a5-4d39-abcb-a3412b32d895.vsidx new file mode 100644 index 0000000..7a3c480 --- /dev/null +++ b/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/1fcb0d14-51a5-4d39-abcb-a3412b32d895.vsidx Binary files differ diff --git a/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/334f7960-776b-4009-822a-0655d70b3d13.vsidx b/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/334f7960-776b-4009-822a-0655d70b3d13.vsidx deleted file mode 100644 index e6299ef..0000000 --- a/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/334f7960-776b-4009-822a-0655d70b3d13.vsidx +++ /dev/null Binary files differ diff --git a/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/41345d82-13c1-4c64-a4e0-a6fa1d398c60.vsidx b/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/41345d82-13c1-4c64-a4e0-a6fa1d398c60.vsidx deleted file mode 100644 index c0fdf02..0000000 --- a/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/41345d82-13c1-4c64-a4e0-a6fa1d398c60.vsidx +++ /dev/null Binary files differ diff --git a/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/52b1bf39-572c-4392-9ec9-d2acb98174ba.vsidx b/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/52b1bf39-572c-4392-9ec9-d2acb98174ba.vsidx new file mode 100644 index 0000000..bc4511b --- /dev/null +++ b/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/52b1bf39-572c-4392-9ec9-d2acb98174ba.vsidx Binary files differ diff --git a/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/582aed91-b4b2-4db8-856f-14042adcf757.vsidx b/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/582aed91-b4b2-4db8-856f-14042adcf757.vsidx deleted file mode 100644 index bd47b09..0000000 --- a/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/582aed91-b4b2-4db8-856f-14042adcf757.vsidx +++ /dev/null Binary files differ diff --git a/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/a24f5716-1832-4d56-a0d6-fdd4886a51ea.vsidx b/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/a24f5716-1832-4d56-a0d6-fdd4886a51ea.vsidx new file mode 100644 index 0000000..e90e839 --- /dev/null +++ b/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/a24f5716-1832-4d56-a0d6-fdd4886a51ea.vsidx Binary files differ diff --git a/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/d8091da7-1660-402d-a5cf-dce290dff156.vsidx b/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/d8091da7-1660-402d-a5cf-dce290dff156.vsidx deleted file mode 100644 index cda934b..0000000 --- a/.vs/HH.WCS.Mobox3.DSZSH/FileContentIndex/d8091da7-1660-402d-a5cf-dce290dff156.vsidx +++ /dev/null Binary files differ diff --git a/HH.WCS.Mobox3.DSZSH.csproj b/HH.WCS.Mobox3.DSZSH.csproj index ee0537c..f0ef227 100644 --- a/HH.WCS.Mobox3.DSZSH.csproj +++ b/HH.WCS.Mobox3.DSZSH.csproj @@ -241,7 +241,6 @@ <Compile Include="models\TN_Record_Table.cs" /> <Compile Include="models\TN_RelocationList_Detail.cs" /> <Compile Include="models\TN_Relocation_List.cs" /> - <Compile Include="models\TN_Shipping_Order.cs" /> <Compile Include="models\TN_SpotCheck_Detail.cs" /> <Compile Include="models\TN_Spot_Check.cs" /> <Compile Include="process\TaskProcess.cs" /> @@ -272,7 +271,6 @@ <Compile Include="dispatch\HostToAGV.cs" /> <Compile Include="util\LogHelper.cs" /> <Compile Include="wms\ContainerHelper.cs" /> - <Compile Include="wms\InfoBuilder.cs" /> <Compile Include="wms\LocationHelper.cs" /> <Compile Include="wms\SYSHelper.cs" /> <Compile Include="Program.cs" /> diff --git a/Program.cs b/Program.cs index 8bb92d5..4447e8b 100644 --- a/Program.cs +++ b/Program.cs @@ -72,9 +72,10 @@ /// </summary> private static void StartTcp() { - var tcpServerIP = Settings.TcpServerIp; - var tcpServerPort = Settings.TcpServerPort; - new TcpServer(tcpServerIP, tcpServerPort); + //var tcpServerIP = Settings.TcpServerIp; + //var tcpServerPort = Settings.TcpServerPort; + //new TcpServer(tcpServerIP, tcpServerPort); + //var res = TcpClientHelper.Init(tcpServerIP, tcpServerPort); //var res = TcpClientHelper.Init(tcpServerIP, 8550); //LogHelper.Info($"TcpClient杩炴帴" + (res ? "鎴愬姛" : "澶辫触")); diff --git a/api/ApiHelper.cs b/api/ApiHelper.cs index 94913f5..a61f780 100644 --- a/api/ApiHelper.cs +++ b/api/ApiHelper.cs @@ -34,8 +34,6 @@ var startAreas = taskInfo.StartAreas; var endAreas = taskInfo.EndAreas; - var log = $"API锛歿taskName}锛�; - try { if (model.Num <= 0) { info = $"鐗╂枡鏁伴噺'{model.Num}'涓嶅悎娉曪細鐗╂枡鏁伴噺搴旇澶т簬0"; @@ -51,7 +49,12 @@ return NewSimpleResult(1, info); } - var startLoc = LocationHelper.GetLocQuery(db, 0, startAreas, model.StartLoc).First(); + var startLoc = db.Queryable<TN_Location>() + .Where(l => l.S_CODE == model.StartLoc) + .Where(l => startAreas.Contains(l.S_AREA_CODE)) + .Where(l => l.N_LOCK_STATE == 0 && l.S_LOCK_STATE == "鏃� && l.C_ENABLE == "Y") + .Where(l => l.N_CURRENT_NUM == 0) + .First(); if (startLoc == null) { info = $"锛氭病鏈夋壘鍒拌捣鐐硅揣浣�{model.StartLoc}'锛佽姹傦細鏈笂閿併�鏁伴噺=0銆佽揣鍖哄睘浜嶽{string.Join(", ", startAreas)}]"; @@ -67,7 +70,11 @@ S_CNTR_TYPE = "濂借繍绠�, }; - var endLoc = LocationHelper.GetLocQuery(db, 0, endAreas).OrderBy(l => new { l.N_LAYER }).First(); + var endLoc = db.Queryable<TN_Location>() + .Where(l => startAreas.Contains(l.S_AREA_CODE)) + .Where(l => l.N_LOCK_STATE == 0 && l.S_LOCK_STATE == "鏃� && l.C_ENABLE == "Y") + .Where(l => l.N_CURRENT_NUM == 0) + .OrderBy(l => new { l.N_LAYER }).First(); if (endLoc == null) { info = $"娌℃湁鎵惧埌鍚堥�鐨勭粓鐐硅揣浣嶏紝闇�婊¤冻锛氭湭涓婇攣銆佸綋鍓嶅鍣ㄦ暟閲�0"; @@ -729,11 +736,14 @@ TN_Location endLoc = null; if (locCntrRel.S_CNTR_TYPE == "鎵樼洏") { endAreas = taskInfo.EndAreas_Pallet; - endLoc = LocationHelper.GetLocQuery(db, 0, endAreas).First(); + endLoc = db.Queryable<TN_Location>() + .Where(l => startAreas.Contains(l.S_AREA_CODE)) + .Where(l => l.N_LOCK_STATE == 0 && l.S_LOCK_STATE == "鏃� && l.C_ENABLE == "Y") + .Where(l => l.N_CURRENT_NUM == 0).First(); } else if (locCntrRel.S_CNTR_TYPE == "濂借繍绠�) { endAreas = taskInfo.EndAreas_Goodpack; - endLoc = LocationHelper.GetLocQuery(db, 0, endAreas).First(); + endLoc = db.Queryable<TN_Location>().Where(l => startAreas.Contains(l.S_AREA_CODE)).Where(l => l.N_LOCK_STATE == 0 && l.S_LOCK_STATE == "鏃� && l.C_ENABLE == "Y").Where(l => l.N_CURRENT_NUM == 0).First(); } else { return NewSimpleResult(-1, $"鎵樼洏绫诲瀷{locCntrRel.S_CNTR_TYPE}涓嶅悎娉曪細鎵樼洏鍙穥locCntrRel.S_CNTR_CODE}"); diff --git a/api/ErpController.cs b/api/ErpController.cs index aa4c212..2a887d0 100644 --- a/api/ErpController.cs +++ b/api/ErpController.cs @@ -24,6 +24,5 @@ return ApiHelper.ErpSendOutboundPlan(model); } - } } \ No newline at end of file diff --git a/config/config.comment.json b/config/config.comment.json index 2f0c4da..cc18744 100644 --- a/config/config.comment.json +++ b/config/config.comment.json @@ -1,81 +1,83 @@ { - "WebApiUrl": "http://127.0.0.1:8901", // 鍚庡彴鎺ュ彛璁块棶鍦板潃 - "NdcApiUrl": "http://127.0.0.1:5201/api/order/", // NDC鎺ュ彛鍦板潃 + "WebApiUrl": "http://127.0.0.1:8901", // 鍚庡彴鏈嶅姟鎺ュ彛鍦板潃 + "NdcApiUrl": "http://127.0.0.1:5201/api/order/", // NDC AGV鎺ュ彛鍦板潃 "ErpApiUrl": "http://127.0.0.1:8901/api/", // ERP鎺ュ彛鍦板潃 - "SqlServer": "Data Source=192.168.1.87;Initial Catalog=AMS_OIMobox;User ID=sa;Password=123456;", // 鏁版嵁搴撻厤缃湴鍧�- "TcpServerIp": "127.0.0.1", - "TcpServerPort": 8085, - "TaskInfo": [ // 浠诲姟璧风偣缁堢偣閰嶇疆锛堜笉鑳芥敼鍙樹换鍔$殑鐩稿浣嶇疆锛�+ "ErpRoute": { + "CreateTaskReturn": "CreateTaskReturn", // 鏍规嵁ERP涓嬪彂鍑哄簱璁″垝锛屽垱寤轰换鍔″悗鍙嶉ERP鐨勬帴鍙�+ "PickUpReturn": "PickUpReturn" // 鏍规嵁ERP涓嬪彂鍑哄簱璁″垝锛孉GV鍙栬揣鍚庡弽棣圗RP鐨勬帴鍙�+ }, + "SqlServer": "Data Source=192.168.1.87;Initial Catalog=AMS_OIMobox;User ID=sa;Password=123456;", // 鏁版嵁搴撻厤缃�+ "TaskInfos": [ // 浠诲姟淇℃伅锛堝悕绉般�璧风偣璐у尯銆佺粓鐐硅揣鍖猴級 { - "TaskName": "濂借繍绠�婊$涓嬬嚎鍏ュ簱", // 浠诲姟鍚嶇О - "StartAreas": [ "MXCZQ" ], // 璧风偣璐у尯锛氭弧绠卞瓨鏀惧尯 - "EndAreas": [ "MXHJQ" ] // 缁堢偣璐у尯锛氭弧绠辫揣鏋跺尯 + "TaskName": "婊℃墭涓嬬嚎鍏ュ簱", // 浠诲姟鍚嶇О锛堝彲浠ユ洿鏀癸紝浣嗗悇浠诲姟鐩稿浣嶇疆涓嶈兘鏇存敼锛�+ "StartAreas": [ "BZQ" ], // 璧风偣璐у尯缂栧彿锛氬寘瑁呭尯 + "EndAreas": [ "MTHJQ" ] // 缁堢偣璐у尯缂栧彿锛氭弧鎵樿揣鏋跺尯 }, { - "TaskName": "濂借繍绠�绌虹涓婄嚎", - "StartAreas": [ "KXHJQ" ], // 绌虹璐ф灦鍖�- "EndAreas": [ "KXCZQ" ] // 绌虹鎿嶄綔鍖�- }, - { - "TaskName": "濂借繍绠�绌虹鍏ュ簱", - "StartAreas": [ "KXJBQ1", "KXJBQ2" ], // 绌虹鍏ュ簱鎺ラ┏鍖�/2 - "EndAreas": [ "KXHJQ" ] // 绌虹璐ф灦鍖�+ "TaskName": "婊$涓嬬嚎鍏ュ簱", + "StartAreas": [ "MXCZQ" ], // 婊$鎿嶄綔鍖�+ "EndAreas": [ "MXHJQ" ] // 婊$璐ф灦鍖� }, { "TaskName": "鎴愬搧鑳跺嚭搴�, - "StartAreas": [ "MTHJQ", "MXHJQ", "HCBHQ", "QCBHQ" ], - "EndAreas": [ "HCCKQ", "QCCKQ" ] + "StartAreas": [ "MTHJQ", "MXHJQ", "HCBHQ", "QCBHQ" ], // 婊℃墭璐ф灦鍖恒�婊$璐ф灦鍖恒�鐏溅澶囪揣鍖恒�姹借溅澶囪揣鍖�+ "EndAreas": [ "HCCKQ", "QCCKQ" ] // 鐏溅鍑哄簱鍖恒�姹借溅鍑哄簱鍖� }, { - "TaskName": "鎵樼洏-婊℃墭涓嬬嚎鍏ュ簱", - "StartAreas": [], - "EndAreas": [ "MTHJQ" ] + "TaskName": "绌烘墭涓婄嚎鍑哄簱", + "StartAreas": [ "KTCFQ" ], // 绌烘墭瀛樻斁鍖�+ "EndAreas": [ "BZQ" ] // 鍖呰鍖� }, { - "TaskName": "鎵樼洏-绌烘墭涓婄嚎", - "StartAreas": [], - "EndAreas": [] + "TaskName": "绌虹涓婄嚎鍑哄簱", + "StartAreas": [ "KXHJQ" ], // 婊$璐ф灦鍖�+ "EndAreas": [ "KXCZQ" ] // 绌虹鎿嶄綔鍖� }, { - "TaskName": "鎵樼洏-绌烘墭鍏ュ簱", - "StartAreas": [ "KTJBQ" ], // 绌烘墭鎺ラ┏鍖�+ "TaskName": "绌烘墭鍏ュ簱", + "StartAreas": [ "KTJBQ" ], // 绌烘墭鍏ュ簱鎺ラ┏鍖� "EndAreas": [ "KTCFQ" ] // 绌烘墭瀛樻斁鍖� }, { - "TaskName": "鎶芥-鍑哄簱", + "TaskName": "绌虹鍏ュ簱", + "StartAreas": [ "KXJBQ1", "KXJBQ2" ], // 绌虹鍏ュ簱鎺ラ┏鍖�銆� + "EndAreas": [ "KXHJQ" ] // 绌虹璐ф灦鍖�+ }, + { + "TaskName": "鎶芥鍑哄簱", "StartAreas": [ "MTHJQ", "MXHJQ" ], // 婊℃墭璐ф灦鍖恒�婊$璐ф灦鍖� "EndAreas": [ "CJQ" ] // 鎶芥鍖� }, { - "TaskName": "鎶芥-鍚堟牸鍥炲簱", + "TaskName": "鎶芥鍚堟牸鍥炲簱", "StartAreas": [ "CJQ" ], // 鎶芥鍖�- "EndAreas": [] + "EndAreas_Pallet": [ "MTHJQ" ], // 缁堢偣璐у尯锛堟墭鐩橈級锛氭弧鎵樿揣鏋跺尯 + "EndAreas_Goodpack": [ "MXHJQ" ] // 缁堢偣璐у尯锛堝ソ杩愮锛夛細婊$璐ф灦鍖� }, { - "TaskName": "鎶芥-涓嶅悎鏍肩Щ搴�, - "StartAreas": [ "CJQ" ], - "EndAreas": [] + "TaskName": "鎶芥涓嶅悎鏍肩Щ搴�, + "StartAreas": [ "CJQ" ], // 鎶芥鍖�+ "EndAreas": [ "CJYCQ" ] // 鎶芥寮傚父鍖� }, { - "TaskName": "绉诲簱", - "StartAreas": [], - "EndAreas": [] + "TaskName": "灏炬枡鍥炲簱", + "StartAreas": [ "HCCKQ", "QCCKQ" ], // 鐏溅鍑哄簱鍖�+ "EndAreas_Pallet": [ "MTHJQ" ], // 婊℃墭璐ф灦鍖�+ "EndAreas_Goodpack": [ "MXHJQ" ] // 婊$璐ф灦鍖� }, { - "TaskName": "灏剧鍥炲簱", - "StartAreas": [ "HCCKQ", "QCCKQ" ], // 鐏溅鍑哄簱鍖恒�姹借溅鍑哄簱鍖�- "EndAreas": [] + "TaskName": "绉诲簱" } ], - "ProductionLines": [ + "ProductionLines": [ // 浜х嚎淇℃伅锛堝緟瀹氾紝鏍规嵁鍚庨潰闇�眰鍐嶆洿鏀癸級 { - "Id": "1", - "Name": "鎵樼洏浜х嚎1", - "PlcIp": "127.0.0.1", - "PlcPort": 502, - "SlaveId": 1, - "OnLoc": [ "CX11" ], - "OffLoc": [ "CX12" ] + "Id": "1", // 浜х嚎缂栧彿 + "Name": "鎵樼洏浜х嚎1", // 浜х嚎鍚嶇О + "PlcIp": "127.0.0.1", // 浜х嚎IP + "PlcPort": 502, // 浜х嚎绔彛 + "SlaveId": 1, // 浜х嚎modbus slave id锛堟牴鎹疄闄呮儏鍐碉級 + "OnLoc": [ "BZQ-1-1" ], // 涓婄嚎璐т綅 + "OffLoc": [ "BZQ-1-2" ] // 涓嬬嚎璐т綅 }, { "Id": "2", @@ -83,26 +85,22 @@ "PlcIp": "127.0.0.1", "PlcPort": 503, "SlaveId": 2, - "OnLoc": [ "CX21" ], - "OffLoc": [ "CX22" ] + "OnLoc": [ "BZQ-2-1" ], + "OffLoc": [ "BZQ-2-2" ] }, { "Id": "3", "Name": "濂借繍绠变骇绾�", "PlcIp": "127.0.0.1", "PlcPort": 504, - "SlaveId": 3, - "OnLoc": [ "CX31" ], - "OffLoc": [ "CX32" ] + "SlaveId": 3 }, { "Id": "4", "Name": "濂借繍绠变骇绾�", "PlcIp": "127.0.0.1", "PlcPort": 505, - "SlaveId": 4, - "OnLoc": [ "CX41" ], - "OffLoc": [ "CX42" ] + "SlaveId": 4 } ] } \ No newline at end of file diff --git a/config/config.json b/config/config.json index f3fdc6c..5b00f2f 100644 --- a/config/config.json +++ b/config/config.json @@ -2,17 +2,20 @@ "WebApiUrl": "http://127.0.0.1:8901", "NdcApiUrl": "http://127.0.0.1:5201/api/order/", "ErpApiUrl": "http://127.0.0.1:8901/api/", + "TcpServerPort": 6000, + "ErpRoute": { + "CreateTaskReturn": "CreateTaskReturn", + "PickUpReturn": "PickUpReturn" + }, "SqlServer": "Data Source=192.168.1.87;Initial Catalog=AMS_OIMobox;User ID=sa;Password=123456;", - "TcpServerIp": "127.0.0.1", - "TcpServerPort": 8085, "TaskInfos": [ { - "TaskName": "婊℃墭涓嬬嚎鍏ュ簱锛堟墭鐩橈級", + "TaskName": "婊℃墭涓嬬嚎鍏ュ簱", "StartAreas": [ "BZQ" ], "EndAreas": [ "MTHJQ" ] }, { - "TaskName": "婊$涓嬬嚎鍏ュ簱锛堝ソ杩愮锛�, + "TaskName": "婊$涓嬬嚎鍏ュ簱", "StartAreas": [ "MXCZQ" ], "EndAreas": [ "MXHJQ" ] }, @@ -75,7 +78,7 @@ "PlcPort": 502, "SlaveId": 1, "OnLoc": [ "BZQ-1-1" ], - "OffLoc": [ "BZQ12" ] + "OffLoc": [ "BZQ-1-2" ] }, { "Id": "2", @@ -83,26 +86,22 @@ "PlcIp": "127.0.0.1", "PlcPort": 503, "SlaveId": 2, - "OnLoc": [ "CX21" ], - "OffLoc": [ "CX22" ] + "OnLoc": [ "BZQ-2-1" ], + "OffLoc": [ "BZQ-2-2" ] }, { "Id": "3", "Name": "濂借繍绠变骇绾�", "PlcIp": "127.0.0.1", "PlcPort": 504, - "SlaveId": 3, - "OnLoc": [], - "OffLoc": [ "CX32" ] + "SlaveId": 3 }, { "Id": "4", "Name": "濂借繍绠变骇绾�", "PlcIp": "127.0.0.1", "PlcPort": 505, - "SlaveId": 4, - "OnLoc": [], - "OffLoc": [ "CX42" ] + "SlaveId": 4 } ] } \ No newline at end of file diff --git a/core/Monitor.cs b/core/Monitor.cs index dfadc6e..0a93748 100644 --- a/core/Monitor.cs +++ b/core/Monitor.cs @@ -571,7 +571,7 @@ model.ph = cgDetail.S_BATCH_NO; var jsonInfo = JsonConvert.SerializeObject(model); - var result = httpH.WebPost(Settings.ErpApiUrl + "CreateTaskReturn", jsonInfo); + var result = httpH.WebPost(Settings.ErpApiUrl + Settings.ErpRoute.CreateTaskReturn, jsonInfo); LogHelper.InfoApi($"鍒涘缓浠诲姟瀹屾垚鍙嶉ERP鎺ュ彛锛岀粨鏋�{result}锛岃皟鐢ㄥ弬鏁帮細", model); diff --git a/core/WCSCore.cs b/core/WCSCore.cs index 72fe0ce..ab8fbe7 100644 --- a/core/WCSCore.cs +++ b/core/WCSCore.cs @@ -425,7 +425,7 @@ model.hwzt = "宸插嚭搴�; var jsonInfo = JsonConvert.SerializeObject(model); - var result = httpH.WebPost(Settings.ErpApiUrl + "PickUpReturn", jsonInfo); + var result = httpH.WebPost(Settings.ErpApiUrl + Settings.ErpRoute.PickUpReturn, jsonInfo); LogHelper.InfoApi($"鍙栬揣瀹屾垚鍙嶉ERP鎺ュ彛锛岀粨鏋�{result}锛岃皟鐢ㄥ弬鏁帮細", model); @@ -464,7 +464,7 @@ // TCP 闈炶疆璇㈡柟寮�妯℃嫙浜х嚎涓嬬嚎鐨勫皾璇� public static void StartServer() { - var ListenPort = 6000; + var ListenPort = Settings.TcpServerPort; TcpListener listener = new TcpListener(IPAddress.Any, ListenPort); listener.Start(); Console.WriteLine($"鍚庡彴鏈嶅姟宸插惎鍔紝鐩戝惉绔彛 {ListenPort}..."); diff --git a/models/TN_Shipping_Order.cs b/models/TN_Shipping_Order.cs deleted file mode 100644 index 72f72d0..0000000 --- a/models/TN_Shipping_Order.cs +++ /dev/null @@ -1,11 +0,0 @@ -锘縰sing System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HH.WCS.Mobox3.DSZSH.models { - public class TN_Shipping_Order : BaseModel { - - } -} diff --git a/util/Settings.cs b/util/Settings.cs index 9a653c9..946c47c 100644 --- a/util/Settings.cs +++ b/util/Settings.cs @@ -13,9 +13,13 @@ public static string WebApiUrl { get; set; } public static string NdcApiUrl { get; set; } public static string ErpApiUrl { get; set; } // ERP 鍙嶉鎺ュ彛URL - public static string SqlServer { get; set; } - public static string TcpServerIp { get; set; } + public static int TcpServerPort { get; set; } + public static Config.ErpRoute ErpRoute { get; set; } + + public static string SqlServer { get; set; } + //public static string TcpServerIp { get; set; } + //public static int TcpServerPort { get; set; } public static List<Config.ProductionLine> ProductionLines { get; set; } = new List<Config.ProductionLine>(); public static List<Config.TaskInfo> TaskInfos { get; set; } = new List<Config.TaskInfo> { }; @@ -42,13 +46,16 @@ WebApiUrl = root.WebApiUrl; NdcApiUrl = root.NdcApiUrl; ErpApiUrl = root.ErpApiUrl; + ErpRoute = root.ErpRoute; + TcpServerPort= root.TcpServerPort; SqlServer = root.SqlServer; - TcpServerIp = root.TcpServerIp; - TcpServerPort = root.TcpServerPort; + //TcpServerIp = root.TcpServerIp; + //TcpServerPort = root.TcpServerPort; ProductionLines = root.ProductionLines; TaskInfos = root.TaskInfos; for (var i = 0; i < ProductionLines.Count; i++) { + if (ProductionLines[i].OnLoc == null) continue; foreach (var onLoc in ProductionLines[i].OnLoc) { LocProdIdMap.Add(onLoc, int.Parse(ProductionLines[i].Id)); } @@ -85,8 +92,12 @@ // [Convert JSON to C# Classes Online - Json2CSharp Toolkit](https://json2csharp.com/) public class Config { - // Root myDeserializedClass = JsonConvert.DeserializeObject<Root>(myJsonResponse); + public class ErpRoute { + public string CreateTaskReturn { get; set; } + public string PickUpReturn { get; set; } + } + public class ProductionLine { public string Id { get; set; } public string Name { get; set; } @@ -101,9 +112,9 @@ public string WebApiUrl { get; set; } public string NdcApiUrl { get; set; } public string ErpApiUrl { get; set; } - public string SqlServer { get; set; } - public string TcpServerIp { get; set; } public int TcpServerPort { get; set; } + public ErpRoute ErpRoute { get; set; } + public string SqlServer { get; set; } public List<TaskInfo> TaskInfos { get; set; } public List<ProductionLine> ProductionLines { get; set; } } diff --git a/wms/InfoBuilder.cs b/wms/InfoBuilder.cs deleted file mode 100644 index e5ef789..0000000 --- a/wms/InfoBuilder.cs +++ /dev/null @@ -1,10 +0,0 @@ -锘縰sing System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HH.WCS.Mobox3.DSZSH.wms { - internal class InfoBuilder { - } -} diff --git a/wms/LocationHelper.cs b/wms/LocationHelper.cs index 114534d..67fcff2 100644 --- a/wms/LocationHelper.cs +++ b/wms/LocationHelper.cs @@ -181,7 +181,7 @@ } /// <summary> - /// + /// 鏋勫缓璐т綅鏌ヨ琛ㄨ揪寮忥細褰撳墠鏁伴噺銆佽揣鍖恒�鍚嶇О /// </summary> /// <param name="db"></param> /// <param name="nCurrentNum"></param> -- Gitblit v1.9.1