From 1c637ea862816ae6fa53945fa0327b95c79aa18b Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期五, 22 八月 2025 16:20:27 +0800
Subject: [PATCH] 增强 WMS IP 地址处理逻辑的健壮性在 `TaskService.cs` 文件中,添加了对 `result` 是否为 `null` 的检查,以确保在反序列化之前 `result` 是有效的。同时,调整了对 `content.Data` 的检查逻辑,确保在 `content.Data` 不为空的情况下,才会进一步检查其值是否为 "NG"。如果是 "NG",则设置 `task.Remark` 为 "NG"。这些更改提高了代码的健壮性,避免了潜在的空引用异常。
---
CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json | 73 +++++++++++++-----------------------
1 files changed, 26 insertions(+), 47 deletions(-)
diff --git a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
index ce41d01..b98eb24 100644
--- a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
+++ b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
@@ -1,26 +1,4 @@
{
-<<<<<<< HEAD
- "Logging": {
- "LogLevel": {
- "Default": "Information",
- "Microsoft.AspNetCore": "Warning"
- }
- },
- "AllowedHosts": "*",
- "urls": "http://*:5000",
- "MainDB": "DB_WIDESEA", //褰撳墠椤圭洰鐨勪富搴擄紝鎵�瀵瑰簲鐨勮繛鎺ュ瓧绗︿覆鐨凟nabled蹇呴』涓簍rue
- //杩炴帴瀛楃涓�
- "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
- "ConnectionStringWCS": "Data Source=.;Initial Catalog=WIDESEAWCS_BaiBu;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
- //璺ㄥ煙
- "Cors": {
- "PolicyName": "CorsIpAccess", //绛栫暐鍚嶇О
- "EnableAllIPs": true, //褰撲负true鏃讹紝寮�鏀炬墍鏈塈P鍧囧彲璁块棶銆�
- // 鏀寔澶氫釜鍩熷悕绔彛锛屾敞鎰忕鍙e彿鍚庝笉瑕佸甫/鏂滄潌锛氭瘮濡俵ocalhost:8000/锛屾槸閿欑殑
- // 娉ㄦ剰锛宧ttp://127.0.0.1:1818 鍜� http://localhost:1818 鏄笉涓�鏍风殑
- "IPs": "http://127.0.0.1:8080,http://localhost:8080,http://127.0.0.1:8081,http://localhost:8081"
- },
-=======
"Logging": {
"LogLevel": {
"Default": "Information",
@@ -31,8 +9,10 @@
"urls": "http://*:5000",
"MainDB": "DB_WIDESEA", //褰撳墠椤圭洰鐨勪富搴擄紝鎵�瀵瑰簲鐨勮繛鎺ュ瓧绗︿覆鐨凟nabled蹇呴』涓簍rue
//杩炴帴瀛楃涓�
- "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WMSDB_BB3F;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
- "ConnectionStringWCS": "Data Source=.;Initial Catalog=WIDESEA_WCSDB_BB3F;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
+ "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WMSDB3F;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
+ "ConnectionStringWCS": "Data Source=.;Initial Catalog=WIDESEA_WCSDB3F;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
+ //"ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
+ //"ConnectionStringWCS": "Data Source=.;Initial Catalog=WIDESEA_WCSDB_BB3F;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
//璺ㄥ煙
"Cors": {
"PolicyName": "CorsIpAccess", //绛栫暐鍚嶇О
@@ -41,31 +21,30 @@
// 娉ㄦ剰锛宧ttp://127.0.0.1:1818 鍜� http://localhost:1818 鏄笉涓�鏍风殑
"IPs": "http://127.0.0.1:8080,http://localhost:8080,http://127.0.0.1:8081,http://localhost:8081"
},
->>>>>>> c2aaf06dab8a627948ee2e5574fe4598f8d1638f
- //缂撳瓨璁剧疆
- "CacheSettings": {
- "UseRedis": false, //鍚敤redis
- "RedisSettings": {
- "Address": "127.0.0.1:6379", //鍦板潃
- "Password": "123456", //Redis鏈嶅姟瀵嗙爜
- "Db": 9, //榛樿搴�
- "ClearRedis": true //鏄惁姣忔鍚姩閮芥竻闄edis缂撳瓨
- }
- },
+ //缂撳瓨璁剧疆
+ "CacheSettings": {
+ "UseRedis": false, //鍚敤redis
+ "RedisSettings": {
+ "Address": "127.0.0.1:6379", //鍦板潃
+ "Password": "123456", //Redis鏈嶅姟瀵嗙爜
+ "Db": 9, //榛樿搴�
+ "ClearRedis": true //鏄惁姣忔鍚姩閮芥竻闄edis缂撳瓨
+ }
+ },
- "ApiName": "WIDESEA",
- "ExpMinutes": 120,
+ "ApiName": "WIDESEA",
+ "ExpMinutes": 120,
- // 闇�瑕佺Щ搴撶殑琛�
- "TransfertRows": "1,4,5,8",
+ // 闇�瑕佺Щ搴撶殑琛�
+ "TransfertRows": "1,4,5,8",
- // 鍏佽鍑哄簱鐨勭紪鐮�
- "OutBoundMateriel": [
- //{
- // "MaterielCode": "CC01050001348",
- // "ProductionLine": "ZJ-8",
- // "ProcessCode": "CH001"
- //}
- ]
+ // 鍏佽鍑哄簱鐨勭紪鐮�
+ "OutBoundMateriel": [
+ //{
+ // "MaterielCode": "CC01050001348",
+ // "ProductionLine": "ZJ-8",
+ // "ProcessCode": "CH001"
+ //}
+ ]
}
--
Gitblit v1.9.3