From 52ba6b195a4126df405ef453d52ba6eaab6521da Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期五, 17 四月 2026 17:37:32 +0800
Subject: [PATCH] 优化3-4楼提升机以及添加报错接口
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskExtend.cs | 35 ++++++++
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs | 6 +
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs | 43 +++++-----
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJExtend.cs | 5 +
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IHKLocationInfoService.cs | 2
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs | 2
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/HKLocationInfoService.cs | 5
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs | 10 ++
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/ApiInfoService.cs | 2
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/PLCAlarmDTO.cs | 16 ++++
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/KHAGVController.cs | 28 +++++++
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskJob.cs | 25 -----
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 32 ++++++++
13 files changed, 162 insertions(+), 49 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/ApiInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/ApiInfoService.cs"
index 57c0b3a..8582483 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/ApiInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/ApiInfoService.cs"
@@ -46,7 +46,7 @@
response = HttpHelper.Post(apiInfo.ApiAddress, requestParameters);
requestHash = ComputeHash(requestParameters);
responseHash = ComputeHash(response);
- if (apiInfo.Remark.Contains("鍥涘悜杞�"))
+ if (apiInfo.Remark.Contains("鍥涘悜绌挎杞�"))
{
FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
if (fOURBOTReturn == null) throw new Exception($"{apiInfo.Remark}鍝嶅簲鍐呭杞崲瀹炰綋澶辫触锛�");
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/HKLocationInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/HKLocationInfoService.cs"
index bca85c8..5411a91 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/HKLocationInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/HKLocationInfoService.cs"
@@ -27,10 +27,11 @@
};
public IRepository<Dt_HKLocationInfo> Repository => BaseDal;
- public Dt_HKLocationInfo? GetFreeLocationInfo(string toAreaCode)
+ public Dt_HKLocationInfo? GetFreeLocationInfo(string toAreaCode, int containerType)
{
- Dt_HKLocationInfo hKLocationInfo = BaseDal.QueryFirst(x => x.WarehouseId.ToString() == toAreaCode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt(), _emptyAssignOrderBy);
+ Dt_HKLocationInfo hKLocationInfo = BaseDal.QueryFirst(x => x.WarehouseId.ToString() == toAreaCode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == containerType, _emptyAssignOrderBy);
return hKLocationInfo;
}
+
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/PLCAlarmDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/PLCAlarmDTO.cs"
new file mode 100644
index 0000000..fac524d
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/PLCAlarmDTO.cs"
@@ -0,0 +1,16 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEAWCS_DTO.WMS
+{
+ public class PLCAlarmDTO
+ {
+ /// <summary>
+ /// 鎶ヨ淇℃伅
+ /// </summary>
+ public string errorMsg { get; set; }
+ }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IHKLocationInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IHKLocationInfoService.cs"
index 7ed2fc7..8540017 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IHKLocationInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IHKLocationInfoService.cs"
@@ -13,6 +13,6 @@
{
public IRepository<Dt_HKLocationInfo> Repository { get; }
- Dt_HKLocationInfo? GetFreeLocationInfo(string toAreaCode);
+ Dt_HKLocationInfo? GetFreeLocationInfo(string toAreaCode, int containerType);
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
index 5a40c2a..f2cf933 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
@@ -336,5 +336,11 @@
/// <returns></returns>
WebResponseContent HKDeviceAlarm(HKDeviceAalarmDTO hKDeviceAalarmDTO);
+
+ WebResponseContent PLCAlarmtoWMS(string ErrorMsg);
+
+
+
+
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/KHAGVController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/KHAGVController.cs"
index 16ac1e5..12ebb67 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/KHAGVController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/KHAGVController.cs"
@@ -3,7 +3,9 @@
using Microsoft.AspNetCore.Mvc;
using WIDESEAWCS_Common;
using WIDESEAWCS_DTO;
+using WIDESEAWCS_DTO.AGV.HIKROBOT;
using WIDESEAWCS_DTO.RGV.FOURBOT;
+using WIDESEAWCS_DTO.WMS;
using WIDESEAWCS_ITaskInfoService;
namespace WIDESEAWCS_Server.Controllers.AGV
@@ -41,5 +43,31 @@
return returnHK;
}
+
+
+ /// <summary>
+ /// 娴峰悍璁惧鎶ヨ鎺ュ彛
+ /// </summary>
+ /// <param name="taskDTOs"></param>
+ /// <returns></returns>
+ [HttpPost, Route("HKDeviceAlarm"), AllowAnonymous]
+ public HIKROBOTReturn HKDeviceAlarm([FromBody]HKDeviceAalarmDTO hKDeviceAalarmDTO)
+ {
+ HIKROBOTReturn returnHK = new HIKROBOTReturn();
+ var take = _taskService.HKDeviceAlarm(hKDeviceAalarmDTO);
+ if (take.Status)
+ {
+ returnHK.code = "SUCCESS";
+ returnHK.message = "succ";
+ }
+ else
+ {
+ returnHK.code = "404";
+ returnHK.message = take.Message;
+ }
+
+ return returnHK;
+ }
+
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs"
index 7bf7905..fa1faeb 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs"
@@ -34,6 +34,7 @@
try
{
Dt_HKLocationInfo? hKLocationInfo = null;
+ int containerType = taskDTO.containerCode.Contains("LXM") ? (int)LocationTypeEnum.LargePallet : (int)LocationTypeEnum.SmallPallet;
if (taskType == (int)TaskTypeEnum.STURR)
{
var reslut = _stationInfo.Repository.QueryFirst(x => x.StationCode == taskDTO.fromLocationCode) ?? throw new Exception($"鏈壘鍒拌捣鐐硅揣浣嶃�恵taskDTO.fromLocationCode}銆�");
@@ -47,7 +48,7 @@
#endregion
//鑾峰彇璐т綅淇℃伅
else
- hKLocationInfo = _hKLocationInfoService.GetFreeLocationInfo(taskDTO.toAreaCode) ?? throw new Exception($"鏈壘鍒扮粓鐐瑰簱鍖恒�恵taskDTO.toAreaCode}銆戝彲鐢ㄧ┖璐т綅锛�");
+ hKLocationInfo = _hKLocationInfoService.GetFreeLocationInfo(taskDTO.toAreaCode, containerType) ?? throw new Exception($"鏈壘鍒扮粓鐐瑰簱鍖恒�恵taskDTO.toAreaCode}銆戝彲鐢ㄧ┖璐т綅锛�");
if (taskType == (int)TaskTypeEnum.Q1TSJ4)
{
var device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "TSJ") as OtherDevice;
@@ -466,6 +467,11 @@
+ /// <summary>
+ /// 娴峰悍璁惧鎶ヨ
+ /// </summary>
+ /// <param name="hKDeviceAalarmDTO"></param>
+ /// <returns></returns>
public WebResponseContent HKDeviceAlarm(HKDeviceAalarmDTO hKDeviceAalarmDTO)
{
WebResponseContent content = new WebResponseContent();
@@ -485,7 +491,7 @@
extra = hKDeviceAalarmDTO.extra,
};
- string response = HttpHelper.Post(apiInfo.ApiAddress, hIKROBOTDeviceAlarm.Serialize());
+ string response = HttpHelper.Post(apiInfo.ApiAddress,hIKROBOTDeviceAlarm.Serialize());
wMSReturn = response.DeserializeObject<WMSReturn>();
if (wMSReturn.success == true && wMSReturn.message == "success")
{
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs"
index cd05af9..7f50277 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs"
@@ -102,36 +102,39 @@
//鍏ユ彁鍗囨満
if (task.TaskType == TaskTypeEnum.RK3F.ObjToInt() && task.TaskState == (int)TaskStatusEnum.CheckPalletCodeFinish)
{
- var device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "TSJ") as OtherDevice;
- if (device == null) task.ExceptionMessage = "鏈壘鍒版彁鍗囨満淇℃伅";
- else
+ if (task.CurrentAddress==task.TargetAddress)
{
- bool Work = false;
- try
+ var device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "TSJ") as OtherDevice;
+ if (device == null) task.ExceptionMessage = "鏈壘鍒版彁鍗囨満淇℃伅";
+ else
{
- if (device.IsConnected)
+ bool Work = false;
+ try
{
- int i = 0;
- while (!Work && i <= 3)
+ if (device.IsConnected)
{
- i++;
- Work = device.SetValue(HoistEnum.Inboundboxon, 1, task.TargetAddress);
- Thread.Sleep(500);
+ int i = 0;
+ while (!Work && i <= 3)
+ {
+ i++;
+ Work = device.SetValue(HoistEnum.Inboundboxon, 1, task.CurrentAddress);
+ Thread.Sleep(500);
+ }
+ }
+ if (!Work)
+ {
+ task.ExceptionMessage = $"銆恵task.CurrentAddress}銆戝啓鍏�3妤煎叆搴撶鏀惧埌浣嶅け璐�";
+ task.Remark = $"{device.DeviceCode}_Inboundboxon_{1}_{task.CurrentAddress}";
}
}
- if (!Work)
+ catch (Exception ex)
{
- task.ExceptionMessage = $"銆恵task.TargetAddress}銆戝啓鍏�3妤煎叆搴撶鏀惧埌浣嶅け璐�";
- task.Remark = $"{device.DeviceCode}_Inboundboxon_{1}_{task.TargetAddress}";
+ task.ExceptionMessage = $"銆恵task.CurrentAddress}銆戝啓鍏�3妤煎叆搴撶鏀惧埌浣嶅け璐ワ紒{ex.Message}";
+ task.Remark = $"{device.DeviceCode}_Inboundboxon_{1}_{task.CurrentAddress}";
}
}
- catch (Exception ex)
- {
- task.ExceptionMessage = $"銆恵task.TargetAddress}銆戝啓鍏�3妤煎叆搴撶鏀惧埌浣嶅け璐ワ紒{ex.Message}";
- task.Remark = $"{device.DeviceCode}_Inboundboxon_{1}_{task.TargetAddress}";
- }
+ BaseDal.UpdateData(task);
}
- BaseDal.UpdateData(task);
}
//3 鍑烘彁鍗囨満 涔嬪墠鏄疉GV_ToExecute
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index 87e298c..b039aac 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -1286,6 +1286,7 @@
{
throw new NotImplementedException();
}
+
public WebResponseContent InboundElevatorExit(string LocationCode, string containerCode)
{
WebResponseContent content = new WebResponseContent();
@@ -1868,5 +1869,36 @@
return content.Error($"鏇存柊绔欏彴鐘舵�佸け璐ワ細{ex.Message}");
}
}
+
+
+ /// <summary>
+ /// PLC鎶ヨ淇℃伅
+ /// </summary>
+ /// <param name="ErrorMsg"></param>
+ /// <returns></returns>
+ public WebResponseContent PLCAlarmtoWMS(string ErrorMsg)
+ {
+ PLCAlarmDTO PLCAlarmDTO = new PLCAlarmDTO();
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(PLCAlarmDTO)) ?? throw new Exception("鏈壘鍒癙LC鎶ヨ淇℃伅鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
+ PLCAlarmDTO.errorMsg = ErrorMsg;
+ string response = HttpHelper.Post(apiInfo.ApiAddress, PLCAlarmDTO.Serialize());
+ content.OK(data: response);
+ WMSReturn wMSReturn = response.DeserializeObject<WMSReturn>();
+ if (wMSReturn == null) throw new Exception("WMS杩斿洖缁撴灉杞崲澶辫触锛�");
+ if (!wMSReturn.success) throw new Exception(wMSReturn.message);
+ return content.OK();
+ }
+ catch (Exception ex)
+ {
+ return content.Error(ex.Message);
+ }
+ finally
+ {
+ _trackloginfoService.AddTrackLog(PLCAlarmDTO, content, "PLC鎶ヨ淇℃伅涓婃姤WMS", "", "");
+ }
+ }
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJExtend.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJExtend.cs"
index fb18f0c..334408b 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJExtend.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJExtend.cs"
@@ -207,6 +207,11 @@
RK3FTask.TargetAddress = Location.StationCode;
_taskService.UpdateData(RK3FTask);
}
+ else //鎴愬姛
+ {
+ RK3FTask.CurrentAddress = RK3FTask.TargetAddress;
+ _taskService.UpdateData(RK3FTask);
+ }
//璋冪敤娴峰悍杩涜鎵ц瀹屾垚鎺ュ彛
var result = _taskService.Hikvisiontaskscontinue(RK3FTask.WMSTaskNum, RK3FTask.NextAddress);
if (result.Status)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs"
index 1338406..abb8476 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs"
@@ -54,6 +54,8 @@
PalletNumConfirmation(device);
PalletReportingToWMS(device);
+
+ TSJAlarm(device);
}
else
{
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 a6e4358..eb0cdf2 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"
@@ -7,9 +7,12 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
+using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO;
using WIDESEAWCS_Model.Models;
+using WIDESEAWCS_QuartzJob;
+using WIDESEAWCS_QuartzJob.DTO;
namespace WIDESEAWCS_Tasks
{
@@ -44,7 +47,7 @@
//#endregion
#region 涓嬪彂娴峰悍1鍒�6妤肩殑AGV浠诲姟/涓嬪彂娴峰悍6鍒�1妤肩殑AGV浠诲姟
- Tasks = newTasks.Where(x => (x.TaskType == (int)TaskTypeEnum.Q3CK) || x.TaskType == (int)TaskTypeEnum.Q3RK||x.TaskType==(int)TaskTypeEnum.F01).OrderByDescending(x => x.Grade).ToList();
+ Tasks = newTasks.Where(x => (x.TaskType == (int)TaskTypeEnum.Q3CK) || x.TaskType == (int)TaskTypeEnum.Q3RK || x.TaskType == (int)TaskTypeEnum.F01).OrderByDescending(x => x.Grade).ToList();
if (Tasks.Count > 0) SendAGVTask(Tasks);
@@ -126,5 +129,35 @@
}
}
#endregion
+
+
+ /// <summary>
+ /// 澶勭悊鍐欏叆璁惧淇″彿寮傚父浠诲姟
+ /// </summary>
+ public void HandleTasks()
+ {
+ #region
+ var tasks = _taskService.Repository.QueryData(x => x.TaskState == TaskStatusEnum.Finish.ObjToInt() && !string.IsNullOrEmpty(x.Remark));
+ if (tasks.Count > 0)
+ {
+ List<Dt_Task> list = new List<Dt_Task>();
+ foreach (var item in tasks)
+ {
+ var infos = item.Remark.Split("_");
+ var device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == infos[0]) as OtherDevice;
+ if (device != null && device.IsConnected)
+ {
+ DeviceProDTO? devicePro = device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == infos[1] && x.DeviceChildCode == infos[3]);
+ if (devicePro != null)
+ {
+ var W = device.Communicator.WriteObj(devicePro.DeviceProAddress, devicePro.DeviceDataType, infos[2]);
+ if (W) list.Add(item);
+ }
+ }
+ }
+ _taskService.Repository.DeleteAndMoveIntoHty(list, OperateTypeEnum.鑷姩鍒犻櫎);
+ }
+ #endregion
+ }
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskJob.cs"
index 62a28f5..f3a9530 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskJob.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskJob.cs"
@@ -11,6 +11,7 @@
using System.ComponentModel;
using System.Linq;
using System.Reflection;
+using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_BasicInfoService;
@@ -61,28 +62,8 @@
SendWaitToTask();
- #region 澶勭悊鍐欏叆璁惧淇″彿寮傚父浠诲姟
- var tasks = _taskService.Repository.QueryData(x => x.TaskState == TaskStatusEnum.Finish.ObjToInt() && !string.IsNullOrEmpty(x.Remark));
- if (tasks.Count > 0)
- {
- List<Dt_Task> list = new List<Dt_Task>();
- foreach (var item in tasks)
- {
- var infos = item.Remark.Split("_");
- var device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == infos[0]) as OtherDevice;
- if (device != null && device.IsConnected)
- {
- DeviceProDTO? devicePro = device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == infos[1] && x.DeviceChildCode == infos[3]);
- if (devicePro != null)
- {
- var W = device.Communicator.WriteObj(devicePro.DeviceProAddress, devicePro.DeviceDataType, infos[2]);
- if (W) list.Add(item);
- }
- }
- }
- _taskService.Repository.DeleteAndMoveIntoHty(list, OperateTypeEnum.鑷姩鍒犻櫎);
- }
- #endregion
+ HandleTasks();
+
}
catch (Exception ex)
{
--
Gitblit v1.9.3