From 24fd3e64d49d386bed242cdbfbf91fc875a7425e Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期六, 14 三月 2026 10:28:09 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/RuiShengZhiNeng/GaoPuLiTiKu
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/KLSTaskExtend.cs | 5 +
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskExtend.cs | 6 +-
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/TrackloginfoService.cs | 1
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json | 76 ++++++++++++------------
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/GALAXIS/GALAXISTaskInfo.cs | 2
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs | 68 ++++++++++++++++++++--
项目资料/虚拟机账号密码/登录方式.docx | 0
7 files changed, 107 insertions(+), 51 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/TrackloginfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/TrackloginfoService.cs"
index 45c1f1c..a5b1345 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/TrackloginfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/TrackloginfoService.cs"
@@ -47,6 +47,7 @@
//tracklog_content = JsonConvert.SerializeObject(entity),
tracklog_content = entity is string strEntity ? strEntity : JsonConvert.SerializeObject(entity),//濡傛灉entity鏄瓧绗︿覆绫诲瀷锛屽垯鐩存帴浣跨敤锛屽惁鍒欏簭鍒楀寲涓篔SON瀛楃涓�
tracklog_createtime = DateTime.Now,
+ Creater = "system",
tracklog_type = content.Status ? "鎴愬姛" : "澶辫触",
tracklog_code = content.Status ? logCode : ("4" + logCode),
tracklog_des = description,
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/GALAXIS/GALAXISTaskInfo.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/GALAXIS/GALAXISTaskInfo.cs"
index 4b3940b..dfbfa9e 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/GALAXIS/GALAXISTaskInfo.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/GALAXIS/GALAXISTaskInfo.cs"
@@ -13,7 +13,7 @@
{
public string groupId { get; set; }
public string msgTime { get; set; }
- public List<GALAXISTask> tasks { get; set; }
+ public List<GALAXISTask> tasks { get; set; }=new List<GALAXISTask>();
}
public class GALAXISTask
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json"
index 2ac621f..90ff819 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json"
@@ -1,40 +1,40 @@
{
- "urls": "http://*:9291", //web鏈嶅姟绔彛锛屽鏋滅敤IIS閮ㄧ讲锛屾妸杩欎釜鍘绘帀
- "Logging": {
- "LogLevel": {
- "Default": "Information",
- "Microsoft.AspNetCore": "Warning"
- }
- },
- "dics": "deviceType,devicePlcType,jobAssembly,jobClassName,deviceStatus,taskType,taskState,inOutType",
- "AllowedHosts": "*",
- "ConnectionStringsEncryption": false,
- "MainDB": "DB_WIDESEA", //褰撳墠椤圭洰鐨勪富搴擄紝鎵�瀵瑰簲鐨勮繛鎺ュ瓧绗︿覆鐨凟nabled蹇呴』涓簍rue
- //1.MySql
- //2.SqlServer
- //3.Sqlite
- //4.Oracle
- //5.PostgreSQL
- "DBType": "SqlServer",
- //杩炴帴瀛楃涓�
- "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWCS_GP;User ID=sa;Password=P@ssw0rd;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"
- },
- "ApiLogIgnore": "", //璁板綍鏃ュ織鏃讹紝蹇界暐鐨凙PI鍚嶇О锛屽涓敤閫楀彿鍒嗛殧锛岄厤缃殑涓嶈褰曞埌鏁版嵁搴撲腑
- "ApiName": "WIDESEAWCS",
- "ExpMinutes": 120,
- "QuartzJobAutoStart": true,
- "DBSeedEnable": false,
- "QuartzDBSeedEnable": false,
- "LogDeubgEnable": true, //鏄惁璁板綍璋冭瘯鏃ュ織
- "PrintSql": false, //鎵撳嵃SQL璇彞
- "LogAOPEnable": true, //鏄惁璁板綍AOP鏃ュ織
- "WebSocketEnable": true, //鏄惁寮�鍚疻ebSocket鏈嶅姟
- "WebSocketPort": 9296 //WebSocket鏈嶅姟绔彛
+ "urls": "http://*:9291", //web鏈嶅姟绔彛锛屽鏋滅敤IIS閮ㄧ讲锛屾妸杩欎釜鍘绘帀
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ },
+ "dics": "deviceType,devicePlcType,jobAssembly,jobClassName,deviceStatus,taskType,taskState,inOutType,TaskStatusEnum,TaskTypeEnum",
+ "AllowedHosts": "*",
+ "ConnectionStringsEncryption": false,
+ "MainDB": "DB_WIDESEA", //褰撳墠椤圭洰鐨勪富搴擄紝鎵�瀵瑰簲鐨勮繛鎺ュ瓧绗︿覆鐨凟nabled蹇呴』涓簍rue
+ //1.MySql
+ //2.SqlServer
+ //3.Sqlite
+ //4.Oracle
+ //5.PostgreSQL
+ "DBType": "SqlServer",
+ //杩炴帴瀛楃涓�
+ "ConnectionString": "Data Source=172.16.161.20;Initial Catalog=WIDESEAWCS_GP;User ID=sa;Password=P@ssw0rd;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"
+ },
+ "ApiLogIgnore": "", //璁板綍鏃ュ織鏃讹紝蹇界暐鐨凙PI鍚嶇О锛屽涓敤閫楀彿鍒嗛殧锛岄厤缃殑涓嶈褰曞埌鏁版嵁搴撲腑
+ "ApiName": "WIDESEAWCS",
+ "ExpMinutes": 120,
+ "QuartzJobAutoStart": true,
+ "DBSeedEnable": false,
+ "QuartzDBSeedEnable": false,
+ "LogDeubgEnable": true, //鏄惁璁板綍璋冭瘯鏃ュ織
+ "PrintSql": false, //鎵撳嵃SQL璇彞
+ "LogAOPEnable": true, //鏄惁璁板綍AOP鏃ュ織
+ "WebSocketEnable": true, //鏄惁寮�鍚疻ebSocket鏈嶅姟
+ "WebSocketPort": 9296 //WebSocket鏈嶅姟绔彛
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs"
index a94fe87..1b24246 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs"
@@ -10,6 +10,9 @@
using WIDESEAWCS_Common.LocationEnum;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.TaskEnum;
+using WIDESEAWCS_DTO;
+using WIDESEAWCS_ITaskInfoService;
+using WIDESEAWCS_Core.Helper;
namespace WIDESEAWCS_TaskInfoService
{
@@ -26,12 +29,12 @@
WebResponseContent content = new WebResponseContent();
try
{
- int containerType = taskDTO.containerCode.Contains("LLM") ? LocationTypeEnum.LargePallet.ObjToInt() : LocationTypeEnum.SmallPallet.ObjToInt();
+ int containerType = taskDTO.containerCode.Contains("LLM") ? (int)LocationTypeEnum.LargePallet : (int)LocationTypeEnum.SmallPallet;
#region 鐐瑰埌鐐�
if (!string.IsNullOrEmpty(taskDTO.toLocationCode))
{
var LocationInfo = _kLSLocationInfoService.Repository.QueryFirst(x => x.LocationCode == taskDTO.toLocationCode) ?? throw new Exception($"鏈壘鍒扮粓鐐硅揣浣嶃�恵taskDTO.toLocationCode}銆�");
- if (LocationInfo.LocationStatus != LocationStatusEnum.Free.ObjToInt()) throw new Exception($"缁堢偣璐т綅銆恵taskDTO.toLocationCode}銆戣揣浣嶇姸鎬佷笉涓虹┖璐т綅");
+ if (LocationInfo.LocationStatus != (int)LocationStatusEnum.Free) throw new Exception($"缁堢偣璐т綅銆恵taskDTO.toLocationCode}銆戣揣浣嶇姸鎬佷笉涓虹┖璐т綅");
}
#endregion
//鑾峰彇璐т綅淇℃伅
@@ -44,7 +47,7 @@
Grade = taskDTO.taskPriority,
PalletCode = taskDTO.containerCode,
Roadway = kLSLocationInfo.RoadwayNo,
- TaskState = TaskStatusEnum.New.ObjToInt(),
+ TaskState = (int)TaskStatusEnum.New,
TaskType = taskType,
SourceAddress = taskDTO.fromLocationCode,
CurrentAddress = taskDTO.fromLocationCode,
@@ -52,7 +55,12 @@
TargetAddress = kLSLocationInfo.LocationCode,
Creater = "WMS",
};
- kLSLocationInfo.LocationStatus = LocationStatusEnum.InLock.ObjToInt();
+ kLSLocationInfo.LocationStatus = (int)LocationStatusEnum.InLock;
+ #region 涓嬪彂鍑箰澹换鍔�
+ content = SendKLSTask(dt_Task);
+ if (!content.Status) throw new Exception(content.Message);
+ dt_Task.TaskState = (int)TaskStatusEnum.Execut;
+ #endregion
try
{
Db.Ado.BeginTran();
@@ -94,7 +102,7 @@
try
{
Dt_KLSLocationInfo? kLSLocationInfo = _kLSLocationInfoService.Repository.QueryFirst(x => x.LocationCode == taskDTO.fromLocationCode) ?? throw new Exception($"鏈壘鍒拌捣鐐瑰簱浣嶃�恵taskDTO.fromLocationCode}銆戯紒");
- if (kLSLocationInfo.LocationStatus != LocationStatusEnum.InStock.ObjToInt()) throw new Exception($"璧风偣搴撲綅銆恵taskDTO.fromLocationCode}銆戝綋鍓嶅簱浣嶇姸鎬佷笉鍙嚭搴擄紒");
+ if (kLSLocationInfo.LocationStatus != (int)LocationStatusEnum.InStock) throw new Exception($"璧风偣搴撲綅銆恵taskDTO.fromLocationCode}銆戝綋鍓嶅簱浣嶇姸鎬佷笉鍙嚭搴擄紒");
Dt_Task dt_Task = new()
{
TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
@@ -103,7 +111,7 @@
Grade = taskDTO.taskPriority,
PalletCode = taskDTO.containerCode,
Roadway = kLSLocationInfo.RoadwayNo,
- TaskState = TaskStatusEnum.New.ObjToInt(),
+ TaskState = (int)TaskStatusEnum.New,
TaskType = taskType,
SourceAddress = taskDTO.fromLocationCode,
CurrentAddress = taskDTO.fromLocationCode,
@@ -111,7 +119,12 @@
TargetAddress = taskDTO.toLocationCode,
Creater = "WMS",
};
- kLSLocationInfo.LocationStatus = LocationStatusEnum.OutLock.ObjToInt();
+ kLSLocationInfo.LocationStatus = (int)LocationStatusEnum.OutLock;
+ #region 涓嬪彂鍑箰澹换鍔�
+ content = SendKLSTask(dt_Task);
+ if (!content.Status) throw new Exception(content.Message);
+ dt_Task.TaskState = (int)TaskStatusEnum.Execut;
+ #endregion
try
{
Db.Ado.BeginTran();
@@ -142,6 +155,47 @@
}
#endregion
+ #region 涓嬪彂鍑箰澹换鍔�
+ public WebResponseContent SendKLSTask(Dt_Task task)
+ {
+ WebResponseContent content = new WebResponseContent();
+ GALAXISTaskInfo gALAXISTaskInfo = new();
+ GALAXISReturn agvContent = new();
+ try
+ {
+ gALAXISTaskInfo.groupId = DateTime.Now.ToString("yyMMddHHmmss") + task.TaskNum;
+ gALAXISTaskInfo.msgTime = DateTime.Now.ToString();
+ GALAXISTask gALAXISTask = new GALAXISTask()
+ {
+ taskId = task.WMSTaskNum,
+ taskType = task.TaskType == (int)TaskTypeEnum.MLInbound ? 0 : 1,
+ barCode = task.PalletCode,
+ endNode = task.TargetAddress,
+ startNode = task.SourceAddress,
+ priorityCode = task.Grade
+ };
+ gALAXISTaskInfo.tasks.Add(gALAXISTask);
+ Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(GALAXISTaskInfo)) ?? throw new Exception("鏈壘鍒板嚡涔愬+AGV浠诲姟涓嬪彂鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
+ string response = HttpHelper.Post(apiInfo.ApiAddress, gALAXISTaskInfo.Serialize());
+ agvContent = response.DeserializeObject<GALAXISReturn>();
+ content.OK(data: agvContent);
+ if (agvContent.success)
+ {
+ if (agvContent.data.returnStatus != 0) throw new Exception(agvContent.data.returnInfo);
+ }
+ }
+ catch (Exception ex)
+ {
+ content.Error(ex.Message);
+ }
+ finally
+ {
+ _trackloginfoService.AddTrackLog(gALAXISTaskInfo, content, "涓嬪彂鍑箰澹獳GV浠诲姟", "", agvContent.data.returnInfo);
+ }
+ return content;
+ }
+ #endregion
+
#region 5 璺ㄦゼ灞傝繍杈撲换鍔″垱寤�
public WebResponseContent CarryTask(TaskDTO taskDTO, int taskType)
{
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/KLSTaskExtend.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/KLSTaskExtend.cs"
index f461b56..fc66763 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/KLSTaskExtend.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/KLSTaskExtend.cs"
@@ -21,6 +21,7 @@
{
WebResponseContent content = new WebResponseContent(); // 鍒涘缓鍝嶅簲瀵硅薄
GALAXISTaskInfo gALAXISTaskInfo = new();
+ GALAXISReturn agvContent = new();
try
{
gALAXISTaskInfo.groupId = DateTime.Now.ToString("yyMMddHHmmss");
@@ -41,7 +42,7 @@
}
Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(GALAXISTaskInfo)) ?? throw new Exception("鏈壘鍒板嚡涔愬+AGV浠诲姟涓嬪彂鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
string response = HttpHelper.Post(apiInfo.ApiAddress, gALAXISTaskInfo.Serialize());
- GALAXISReturn agvContent = response.DeserializeObject<GALAXISReturn>();
+ agvContent = response.DeserializeObject<GALAXISReturn>();
content.OK(data: agvContent);
if (agvContent.success)
{
@@ -61,7 +62,7 @@
}
finally
{
- _trackloginfoService.AddTrackLog(gALAXISTaskInfo, content, "涓嬪彂鍑箰澹獳GV浠诲姟","","");
+ _trackloginfoService.AddTrackLog(gALAXISTaskInfo, content, "涓嬪彂鍑箰澹獳GV浠诲姟", "", agvContent.data.returnInfo);
//dt_trackloginfoService.Instance.AddTrackLog(outTaskInfo, content, "鎺ユ敹瀹囪埅WMS鍑哄簱浠诲姟涓嬪彂", "", $"{msg},鍙樻洿缁撴灉:{content.Status}");
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskExtend.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskExtend.cs"
index fee347e..05caf76 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskExtend.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskExtend.cs"
@@ -26,12 +26,12 @@
if (newTasks.Count > 0)
{
#region 鏌ユ壘鍑箰澹换鍔�
- var Tasks = newTasks.Where(x => x.TaskType == (int)TaskTypeEnum.MLInbound || x.TaskType == (int)TaskTypeEnum.MLOutbound).OrderByDescending(x => x.Grade).ToList();
- if (Tasks.Count > 0) SendGALAXISTask(Tasks);
+ //var Tasks = newTasks.Where(x => x.TaskType == (int)TaskTypeEnum.MLInbound || x.TaskType == (int)TaskTypeEnum.MLOutbound).OrderByDescending(x => x.Grade).ToList();
+ //if (Tasks.Count > 0) SendGALAXISTask(Tasks);
#endregion
#region 鏌ユ壘RGV浠诲姟
- Tasks = newTasks.Where(x => x.TaskType == (int)TaskTypeEnum.CPInbound).OrderByDescending(x => x.Grade).ToList();
+ var Tasks = newTasks.Where(x => x.TaskType == (int)TaskTypeEnum.CPInbound).OrderByDescending(x => x.Grade).ToList();
if (Tasks.Count > 0) SendRGVNewInTask(Tasks);
Tasks = newTasks.Where(x => x.TaskType == (int)TaskTypeEnum.CPOutbound).OrderByDescending(x => x.Grade).ToList();
if (Tasks.Count > 0) IsMoveTask(Tasks);
diff --git "a/\351\241\271\347\233\256\350\265\204\346\226\231/\350\231\232\346\213\237\346\234\272\350\264\246\345\217\267\345\257\206\347\240\201/\347\231\273\345\275\225\346\226\271\345\274\217.docx" "b/\351\241\271\347\233\256\350\265\204\346\226\231/\350\231\232\346\213\237\346\234\272\350\264\246\345\217\267\345\257\206\347\240\201/\347\231\273\345\275\225\346\226\271\345\274\217.docx"
new file mode 100644
index 0000000..66e4a5c
--- /dev/null
+++ "b/\351\241\271\347\233\256\350\265\204\346\226\231/\350\231\232\346\213\237\346\234\272\350\264\246\345\217\267\345\257\206\347\240\201/\347\231\273\345\275\225\346\226\271\345\274\217.docx"
Binary files differ
--
Gitblit v1.9.3