From 821af8301009019a0f0e81a3ea2a0ae7952b5025 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期三, 28 一月 2026 11:43:30 +0800
Subject: [PATCH] 更新
---
项目代码/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs | 372 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 360 insertions(+), 12 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs"
index 4dc25f7..abcbd34 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -18,18 +18,24 @@
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using NPOI.SS.Formula.Functions;
+using NPOI.SS.UserModel;
+using NPOI.XSSF.UserModel;
+using RYB_PTL_API;
using SqlSugar;
+using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.DirectoryServices.Protocols;
using System.Linq;
using System.Net.Http.Headers;
using System.Security.Policy;
+using System.Text;
using System.Threading.Tasks;
using WIDESEA_DTO.Agv;
using WIDESEA_External.Model;
using WIDESEAWCS_BasicInfoService;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.APIEnum;
+using WIDESEAWCS_Common.Helper;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseRepository;
@@ -66,6 +72,7 @@
private readonly ILocationInfoRepository _locationInfoRepository;
private readonly ILocationInfoService _locationInfoService;
private readonly ILocationStatusChangeRecordService _locationStatusChangeRecordService;
+ private readonly IErrorInfoRepository _errorInfoRepository;
private Dictionary<string, OrderByType> _taskOrderBy = new()
{
@@ -83,7 +90,7 @@
public List<int> TaskRelocationTypes => typeof(TaskTypeEnum).GetEnumIndexList().Where(x => x >= 900 && x < 1000).ToList();
- public TaskService(ITaskRepository BaseDal, IMapper mapper, ICacheService cacheService, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IApiInfoRepository apiInfoRepository,ILocationInfoRepository locationInfoRepository,IUnitOfWorkManage unitOfWorkManage, ILocationInfoService locationInfoService,ILocationStatusChangeRecordService locationStatusChangeRecordService) : base(BaseDal)
+ public TaskService(ITaskRepository BaseDal, IMapper mapper, ICacheService cacheService, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IApiInfoRepository apiInfoRepository,ILocationInfoRepository locationInfoRepository,IUnitOfWorkManage unitOfWorkManage, ILocationInfoService locationInfoService,ILocationStatusChangeRecordService locationStatusChangeRecordService,IErrorInfoRepository errorInfoRepository) : base(BaseDal)
{
_mapper = mapper;
_cacheService = cacheService;
@@ -97,6 +104,7 @@
_unitOfWorkManage = unitOfWorkManage;
_locationInfoService = locationInfoService;
_locationStatusChangeRecordService=locationStatusChangeRecordService;
+ _errorInfoRepository = errorInfoRepository;
}
static object lock_taskReceive = new object();
/// <summary>
@@ -116,8 +124,8 @@
List<Dt_Task> taskOlds = BaseDal.QueryData(x=> taskDTO.Tasks.Select(x => x.TaskDescribe.ContainerCode).Contains(x.PalletCode));
List<Dt_LocationInfo> locationInfos = _locationInfoRepository.GetCanOut(taskDTO.Tasks.Select(x=>x.TaskDescribe.ContainerCode).ToList());
List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData();
- //涓嬪彂浠诲姟缁�
- string taskGroup= taskDTO.TaskGroupCode.IsNullOrEmpty() ? Guid.NewGuid().ToString().Replace("-","") : taskDTO.TaskGroupCode;
+ ////涓嬪彂浠诲姟缁�
+ //string taskGroup= taskDTO.TaskGroupCode.IsNullOrEmpty() ? Guid.NewGuid().ToString().Replace("-","") : taskDTO.TaskGroupCode;
foreach (var item in taskDTO.Tasks.OrderBy(x=>x.TaskDescribe.ToStationCode))
{
if (item.TaskDescribe.ToStationCode.IsNullOrEmpty()) throw new Exception($"浠诲姟{item.TaskCode}鍑哄簱鐩爣鎿嶄綔鍙颁笉鑳戒负绌�");
@@ -150,7 +158,7 @@
task.CurrentAddress = locationInfo.LocationCode;
task.NextAddress = stationManger.PickStationCode;
task.TargetAddress = stationManger.PickStationCode;
- task.GroupId = taskGroup;
+ //task.GroupId = taskGroup;
task.TaskType = TaskTypeEnum.Outbound.ObjToInt();
task.Roadway = locationInfo.RoadwayNo;
task.DeviceCode = stationManger.CraneCode;
@@ -192,6 +200,7 @@
WebResponseContent content = new WebResponseContent();
try
{
+ WriteLog.Write_Log("瀹瑰櫒鍏ュ簱鍒涘缓浠诲姟", $"杈撻�佺嚎淇℃伅", "寮�濮嬪叆搴�", $"鎵樼洏鍙穥containerFlowDTO.ContainerCode}锛岃澶噞deviceCode}");
List<Dt_LocationInfo> locationInfos = _locationInfoRepository.QueryData();
Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.PalletCode == containerFlowDTO.ContainerCode);
if (locationInfo != null) throw new Exception($"搴撲綅鏂欑鍙穥containerFlowDTO.ContainerCode}宸插瓨鍦�");
@@ -213,13 +222,14 @@
_taskExecuteDetailService.AddTaskExecuteDetail(new List<int>() { taskOld.TaskNum }, $"{oldSlotCode}鎹㈣嚦{containerFlowDTO.SlotCode}鍏ュ簱");
return content.OK();
}
- else if(taskOld != null)
+ else if (taskOld != null)
{
- throw new Exception($"鏂欑鍙穥containerFlowDTO.ContainerCode}" + (taskOld.TaskType == TaskTypeEnum.Inbound.ObjToInt() ? "鍏ュ簱AGV鎵ц涓�": "鍑哄簱AGV鎵ц涓�"));
+ throw new Exception($"鏂欑鍙穥containerFlowDTO.ContainerCode}" + (taskOld.TaskType == TaskTypeEnum.Inbound.ObjToInt() ? "鍏ュ簱AGV鎵ц涓�" : "鍑哄簱AGV鎵ц涓�"));
}
Dt_LocationInfo? noInLocation = locationInfos.FirstOrDefault(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt());
if (noInLocation == null) throw new Exception($"鍙敤璐т綅涓嶈冻!");
Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt() && x.StationDeviceCode == deviceCode);
+ WriteLog.Write_Log("瀹瑰櫒鍏ュ簱鍒涘缓浠诲姟", $"绔欏彴淇℃伅", "鏌ヨ绔欏彴", $"绔欏彴鍙穥stationManger.StationCode}锛岃澶噞stationManger.StationDeviceCode}");
//鍒涘缓浠诲姟
Dt_Task task = new Dt_Task();
task.PalletCode = containerFlowDTO.ContainerCode;
@@ -234,7 +244,8 @@
task.TaskState = TaskStatusEnum.CL_Executing.ObjToInt();
//娣诲姞浠诲姟
- BaseDal.AddData(task);
+ int taskId = BaseDal.AddData(task);
+ WriteLog.Write_Log("瀹瑰櫒鍏ュ簱鍒涘缓浠诲姟", $"浠诲姟淇℃伅", "鍒涘缓鍏ュ簱", $"浠诲姟鍙凤細{taskId},鎵樼洏缂栧彿锛歿task.PalletCode}");
if (type > 0)
{
_taskExecuteDetailService.AddTaskExecuteDetail(new List<int>() { task.TaskNum }, "鎵嬪姩鎸夐挳鍏ュ簱");
@@ -247,6 +258,7 @@
}
catch (Exception ex)
{
+ WriteLog.Write_Log("瀹瑰櫒鍏ュ簱鍒涘缓浠诲姟", $"浠诲姟", "鍒涘缓鍏ュ簱", $"澶辫触锛歿ex.Message}");
content.Error($"閿欒淇℃伅:{ex.Message}");
}
return content;
@@ -290,6 +302,95 @@
return content;
}
/// <summary>
+ /// 涓�鏈熸挱绉嶅涓嬪彂
+ /// </summary>
+ /// <returns></returns>
+ public EPLightContent Phase1PickOrderInfoRequest(List<EPLightSendDTO> lightSendDTOs)
+ {
+ EPLightContent content = new EPLightContent();
+
+ try
+ {
+ string? url = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.Phase1PickOrderInfoRequest.ToString())?.ApiAddress;
+ if (string.IsNullOrEmpty(url))
+ {
+ return content.Error("鏈壘鍒版挱绉嶅涓嬪彂鎺ュ彛锛岃妫�鏌ユ帴鍙i厤缃�");
+ }
+
+ bool allSuccess = true;
+ StringBuilder errorMessages = new StringBuilder();
+
+ foreach (EPLightSendDTO lightSendDTO in lightSendDTOs)
+ {
+ try
+ {
+ bool operationResult;
+
+ // 澶勭悊鐏厜绫诲瀷杞崲
+ if (!int.TryParse(lightSendDTO.LIGHTTYPE, out int lightType))
+ {
+ allSuccess = false;
+ errorMessages.AppendLine($"浣嶇疆 {lightSendDTO.LOCATION} 閿欒: 鏃犳晥鐨勭伅鍏夌被鍨� '{lightSendDTO.LIGHTTYPE}'");
+ continue;
+ }
+
+ // 澶勭悊鍏抽棴鐏厜璇锋眰
+ if (lightType == 2)
+ {
+ operationResult = RYB_PTL.RYB_PTL_CloseDigit5(url, lightSendDTO.LOCATION);
+ // TODO: 鍏抽棴鐏厜鍥炶皟澶勭悊
+ //List<EPLightBackDTO> lightBackDTOs = new List<EPLightBackDTO>();
+ //List<TaskBackLight> taskBackLights = lightSendDTOs.Select(x => new TaskBackLight()
+ //{
+ // TagNo = "B1",
+ // TagCode = x.LOCATION,
+ //}).ToList();
+ //content = WMSLightBack(taskBackLights);
+ }
+ // 澶勭悊鏄剧ず鐏厜璇锋眰
+ else
+ {
+ // 澶勭悊鐏厜棰滆壊杞崲
+ if (!int.TryParse(lightSendDTO.LIGHTCOLOR, out int lightColor))
+ {
+ allSuccess = false;
+ errorMessages.AppendLine($"浣嶇疆 {lightSendDTO.LOCATION} 閿欒: 鏃犳晥鐨勭伅鍏夐鑹� '{lightSendDTO.LIGHTCOLOR}'");
+ continue;
+ }
+
+ operationResult = RYB_PTL.RYB_PTL_DspDigit5(
+ url,
+
+ lightSendDTO.LOCATION,
+ lightSendDTO.QUANTITY,
+ lightType,
+ lightColor);
+ }
+ if (!operationResult)
+ {
+ allSuccess = false;
+ errorMessages.AppendLine($"浣嶇疆 {lightSendDTO.LOCATION} 鎿嶄綔澶辫触");
+ }
+ }
+
+ catch (Exception ex)
+ {
+ allSuccess = false;
+ errorMessages.AppendLine($"浣嶇疆 {lightSendDTO.LOCATION} 澶勭悊寮傚父: {ex.Message}");
+ }
+ }
+
+ return allSuccess
+ ? content.OK("鎵�鏈夋挱绉嶅涓嬪彂鎿嶄綔鎴愬姛")
+ : content.Error(errorMessages.ToString());
+ }
+ catch (Exception ex)
+ {
+ content.Error(ex.Message);
+ }
+ return content;
+ }
+ /// <summary>
/// 鎾澧欎寒鐏�
/// </summary>
/// <returns></returns>
@@ -298,7 +399,32 @@
WebResponseContent content = new WebResponseContent();
try
{
- if (taskSendLight.TagNo=="B2")
+ if (taskSendLight.TagNo == "B1")
+ {
+ List<EPLightSendDTO> lightSendDTOs = new List<EPLightSendDTO>()
+ {
+ new EPLightSendDTO
+ {
+ DOCNO = taskSendLight.DocNo,
+ TASKNO= taskSendLight.TaskNo,
+ LOCATION=taskSendLight.TagCode,
+ QUANTITY=taskSendLight.TagQunity,
+ LIGHTCOLOR=taskSendLight.Color switch
+ {
+ "Blue" => "4",
+ "Green" => "2",
+ "Red" => "1",
+ _ => throw new Exception($"鏈壘鍒伴鑹插畾涔�")
+ },
+ ORDERTYPE="1",
+ LIGHTTYPE=taskSendLight.Mode.ToString(),
+ }
+ };
+ EPLightContent pLightContent = Phase1PickOrderInfoRequest(lightSendDTOs);
+ if (pLightContent.Result != "0") throw new Exception($"{pLightContent.Msg}");
+ content.OK();
+ }
+ else if (taskSendLight.TagNo == "B2")
{
List<EPLightSendDTO> lightSendDTOs = new List<EPLightSendDTO>()
{
@@ -315,8 +441,8 @@
"Red" => "4",
_ => throw new Exception($"鏈壘鍒伴鑹插畾涔�")
},
- ORDERTYPE=taskSendLight.Mode.ToString(),
- LIGHTTYPE="1",
+ ORDERTYPE="1",
+ LIGHTTYPE=taskSendLight.Mode.ToString(),
}
};
EPLightContent pLightContent = PickOrderInfoRequest(lightSendDTOs);
@@ -327,7 +453,7 @@
{
content.OK();
}
-
+
}
catch (Exception ex)
{
@@ -687,6 +813,176 @@
return content;
}
/// <summary>
+ /// 浜哄伐鎵嬪姩鍙栨秷鎸囧畾浠诲姟
+ /// </summary>
+ /// <param name="taskNum">浠诲姟缂栧彿</param>
+ /// <returns>鎿嶄綔缁撴灉</returns>
+ public WebResponseContent ManualTaskCancellation(int taskNum)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ // 1. 鑾峰彇浠诲姟淇℃伅
+ Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
+ if (task == null)return content.Error($"浠诲姟{taskNum}涓嶅瓨鍦�");
+
+ TaskTypeGroup group = task.TaskType.GetTaskTypeGroup();
+ if (group == TaskTypeGroup.InboundGroup)// 鍏ュ簱浠诲姟鍙栨秷
+ {
+ // 鑾峰彇鐩爣璐т綅
+ Dt_LocationInfo locationInfo = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.TargetAddress);
+ if (locationInfo == null)return content.Error($"鐩爣璐т綅{task.TargetAddress}涓嶅瓨鍦�");
+ // 楠岃瘉璐т綅鐘舵��
+ if (locationInfo.LocationStatus != LocationStatusEnum.Lock.ObjToInt())
+ return content.Error($"{task.TargetAddress}璐т綅鐘舵�佸紓甯革紝鏃犳硶鍙栨秷");
+
+ // 鎭㈠璐т綅鐘舵��
+ locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); // 鎭㈠涓虹┖闂茬姸鎬�
+ locationInfo.PalletCode = ""; // 娓呯┖鎵樼洏鍙�
+ // 鏇存柊鏁版嵁搴�
+ _unitOfWorkManage.BeginTran();
+ _locationInfoRepository.UpdateData(locationInfo);
+ BaseDal.DeleteAndMoveIntoHty(task, OperateTypeEnum.浜哄伐鍒犻櫎);
+ _unitOfWorkManage.CommitTran();
+ // 璁板綍鐘舵�佸彉鏇�
+ _locationStatusChangeRecordService.AddLocationStatusChangeRecord(
+ locationInfo,
+ LocationStatusEnum.Lock,
+ LocationStatusEnum.Free,
+ LocationChangeType.InboundCancelled,
+ task.TaskNum
+ );
+ content.OK("浠诲姟鍙栨秷鎴愬姛");
+ }
+ else
+ {
+ content.Error("鍙兘鍏ュ簱浠诲姟鍙栨秷锛�");
+ }
+ }
+ catch (Exception ex)
+ {
+ _unitOfWorkManage.RollbackTran();
+ content.Error($"鍙栨秷澶辫触: {ex.Message}");
+ // 璁板綍璇︾粏閿欒
+ _taskExecuteDetailService.AddTaskExecuteDetail(
+ new Dt_Task { TaskNum = taskNum },
+ $"浠诲姟鍙栨秷寮傚父: {ex.Message}"
+ );
+ }
+ return content;
+ }
+ /// <summary>
+ /// 浠诲姟鍙栨秷
+ /// </summary>
+ /// <returns></returns>
+ public WebResponseContent TaskCancelCompleted(int taskNum)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
+ if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)//鍑哄簱浠诲姟瀹屾垚閫昏緫
+ {
+ Dt_LocationInfo locationInfo = _locationInfoRepository.QueryFirst(x => x.PalletCode == task.PalletCode);
+ if (locationInfo.LocationStatus != LocationStatusEnum.Lock.ObjToInt())
+ {
+ return content.Error($"{locationInfo.LocationCode}璐т綅鐘舵�佷笉姝g‘");
+ }
+ task.TaskState = TaskStatusEnum.Cancel.ObjToInt();
+ locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
+ _unitOfWorkManage.BeginTran();
+ _locationInfoRepository.UpdateData(locationInfo);
+ BaseDal.DeleteAndMoveIntoHty(task, App.User?.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
+ _unitOfWorkManage.CommitTran();
+ _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, LocationStatusEnum.Lock, LocationStatusEnum.InStock, LocationChangeType.InboundCompleted, task.TaskNum);
+ content.OK();
+ }
+ else
+ {
+ content.Error($"鏈壘鍒板嚭搴撲换鍔taskNum}");
+ }
+ }
+ catch (Exception ex)
+ {
+ content.Error(ex.Message);
+ }
+ return content;
+ }
+ /// <summary>
+ /// 浠诲姟鍙栨秷
+ /// </summary>
+ /// <returns></returns>
+ public WebResponseContent TaskCancel(List<TaskCancel> taskCancels)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ if (taskCancels==null || taskCancels.Count<=0)
+ {
+ return content.Error("浼犲叆涓嶈兘涓虹┖");
+ }
+ //鑾峰彇鎵�鏈夋枡绠�
+ List<Dt_Task> outTasks = BaseDal.QueryData(x=>x.TaskType==TaskTypeEnum.Outbound.ObjToInt());
+ List<Dt_Task> cancelTasks = new List<Dt_Task>();
+ List<Dt_Task> cancelTasksCompleted = new List<Dt_Task>();
+ //鍒ゆ柇鏄惁鏈変换鍔″瓨鍦�
+ foreach (var item in taskCancels)
+ {
+ Dt_Task? taskExist = outTasks.FirstOrDefault(x=>x.PalletCode== item.ContainerCode);
+ if (taskExist==null)
+ {
+ content.Message += $"{item.ContainerCode}浠诲姟涓嶅瓨鍦�";
+ continue;
+ }
+ if (taskExist.TaskState==TaskStatusEnum.AGV_TakeFinish.ObjToInt())
+ {
+ taskExist.IsCancel = 1;
+ cancelTasks.Add(taskExist);
+ }
+ else if(taskExist.TaskState == TaskStatusEnum.AGV_Executing.ObjToInt())
+ {
+ cancelTasksCompleted.Add(taskExist);
+ }
+ else
+ {
+ return content.Error($"浠诲姟鍙栨秷澶辫触{item.TaskCode}浠诲姟鐘舵�佷笉鍙彇娑堬紒");
+ }
+
+ }
+ _unitOfWorkManage.BeginTran();
+ BaseDal.UpdateData(cancelTasks);
+ foreach (var item in cancelTasksCompleted)
+ {
+ WebResponseContent responseContent = TaskCancelCompleted(item.TaskNum);
+ if (!responseContent.Status)
+ {
+ throw new Exception(responseContent.Message);
+ }
+ }
+ _unitOfWorkManage.CommitTran();
+ cancelTasks.AddRange(cancelTasksCompleted);
+ foreach (var item in cancelTasks)
+ {
+ AgvTaskCancelDTO agvTaskCancel = new AgvTaskCancelDTO()
+ {
+ RequestId= DateTime.Now.ToString("yyMMddHHmmssfff"),
+ MissionCode=item.GroupId,
+ ContainerCode=item.PalletCode,
+ Position="",
+ CancelMode= "CTU_REDIRECT_START",
+ Reason=""
+ };
+ AgvCancelTask(agvTaskCancel);
+ }
+ content.OK();
+ }
+ catch (Exception ex)
+ {
+ content.Error(ex.Message);
+ }
+ return content;
+ }
+ /// <summary>
/// 浜屾湡鎾澧欏洖浼�
/// </summary>
/// <returns></returns>
@@ -727,7 +1023,7 @@
return content.Error($"鏈壘鍒版挱绉嶅涓嬪彂鎺ュ彛,璇锋鏌ユ帴鍙i厤缃�");
}
string request = JsonConvert.SerializeObject(lightSendDTOs, settings).ToUpper();
- //璋冪敤鎺ュ彛
+ // 璋冪敤鎺ュ彛
string response = HttpHelper.Post(url, request);
EPLightContent lightContent = JsonConvert.DeserializeObject<EPLightContent>(response) ?? throw new Exception($"鏈帴鏀跺埌鎾澧欎笅鍙戜笂鎶ヨ繑鍥炲��");
if (lightContent.Result != "0") throw new Exception($"鎾澧欎笅鍙戦敊璇�,淇℃伅:{lightContent.Msg}");
@@ -793,5 +1089,57 @@
}
return content;
}
+ public override WebResponseContent Export(PageDataOptions options)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ string savePath = AppDomain.CurrentDomain.BaseDirectory + "ExcelExport";
+
+ // 纭繚鐩綍瀛樺湪
+ if (!Directory.Exists(savePath))
+ Directory.CreateDirectory(savePath);
+
+ // 鑾峰彇鏁版嵁
+ ISugarQueryable<Dt_Task> query = BaseDal.Db.Queryable<Dt_Task>();
+ var dataList = query.ToList();
+ var properties = typeof(Dt_Task).GetProperties();
+
+ string filePath = TExportHelper.GetExport(savePath, properties, dataList);
+ return WebResponseContent.Instance.OK(data: filePath);
+ }
+ catch (Exception ex)
+ {
+ content = WebResponseContent.Instance.Error(ex.Message);
+ }
+ return content;
+ }
+ /// <summary>
+ /// 閲嶇疆鎵�鏈夊紓甯镐换鍔�
+ /// </summary>
+ public WebResponseContent ResetAllExceptionTask(int taskNum)
+ {
+ // 鑾峰彇寮傚父浠诲姟990淇敼涓篈GV寰呮墽琛�300
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
+ if (task == null) return WebResponseContent.Instance.Error($"鏈壘鍒拌浠诲姟淇℃伅,浠诲姟鍙�:銆恵taskNum}銆�");
+ if (task.TaskState != (int)TaskStatusEnum.Exception)
+ {
+ return content = WebResponseContent.Instance.Error($"璇ヤ换鍔$姸鎬佷笉鍙噸缃�,浠诲姟鍙�:銆恵taskNum}銆�,浠诲姟鐘舵��:銆恵task.TaskState}銆�");
+ }
+ task.TaskState = (int)TaskStatusEnum.AGV_Execute;
+ BaseDal.UpdateData(task);
+ //_taskExecuteDetailService.AddTaskExecuteDetail(task, $"浜哄伐閲嶇疆寮傚父浠诲姟,閲嶇疆鍚庝换鍔$姸鎬併�恵task.TaskState}銆�");
+ content = WebResponseContent.Instance.OK();
+ }
+ catch (Exception ex)
+ {
+ content.Error(ex.Message);
+ }
+ return content;
+ }
+
}
}
--
Gitblit v1.9.3