dengjunjie
2025-06-26 6d9829c889a826d39cbc911ef5d01825edd1bffc
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -17,6 +17,7 @@
using AutoMapper;
using MailKit.Search;
using Newtonsoft.Json;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using SqlSugar;
using System;
@@ -29,6 +30,7 @@
using System.Text;
using System.Threading.Tasks;
using System.Transactions;
using WIDESEA_Common.StockEnum;
using WIDESEA_Common.TaskEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
@@ -37,6 +39,7 @@
using WIDESEA_Core.Helper;
using WIDESEA_DTO.Inbound;
using WIDESEA_DTO.Stock;
using WIDESEA_DTO.WCSInfo;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_IInboundService;
@@ -48,6 +51,7 @@
using WIDESEA_ITaskInfoRepository;
using WIDESEA_ITaskInfoService;
using WIDESEA_Model.Models;
using WIDESEA_OutboundRepository;
using WIDESEA_TaskInfoRepository;
using WIDESEAWCS_DTO.WCSInfo;
@@ -247,6 +251,72 @@
            return WebResponseContent.Instance.OK();
        }
        public WebResponseContent ModifyBarcode(string barcode, string newBarcode)
        {
            WebResponseContent webResponseContent = new WebResponseContent();
            try
            {
                Dt_Task? dt_Task = BaseDal.QueryFirst(x => x.PalletCode == barcode);
                if (dt_Task == null) throw new Exception($"未找到托盘号为【{barcode}】的任务!");
                if (TaskEnumHelper.GetTaskTypeGroup(dt_Task.TaskType) != TaskTypeGroup.InboundGroup)
                    throw new Exception($"只可修改入库任务,如需修改其他任务类型请联系管理员!");
                var stock = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == newBarcode);
                if (stock != null) throw new Exception($"托盘号【{newBarcode}】已存在库存信息!");
                stock = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == barcode);
                if (stock == null) throw new Exception($"托盘号【{barcode}】未找到库存信息!");
                stock.PalletCode = newBarcode;
                dt_Task.PalletCode = newBarcode;
                Db.Ado.BeginTran();
                WMSTaskDTO wMSTaskDTOs = _mapper.Map<WMSTaskDTO>(dt_Task);
                var ResultData = HttpHelper.PostAsync(WCSInterfaceAddress.ModifyBarcode, wMSTaskDTOs.ToJson(), headers: new Dictionary<string, string>());
                if (ResultData.Result == null) throw new Exception($"WCS响应超时");
                WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(ResultData.Result);
                if (content == null) throw new Exception($"WCS无响应");
                if (!content.Status) throw new Exception(content.Message);
                BaseDal.UpdateData(dt_Task);
                _stockService.StockInfoService.Repository.UpdateData(stock);
                Db.Ado.CommitTran();
                webResponseContent.OK();
            }
            catch (Exception ex)
            {
                Db.Ado.RollbackTran();
                webResponseContent.Error(ex.Message);
            }
            return webResponseContent;
        }
        public WebResponseContent CancelTask(WMSTaskDTO WMStask)
        {
            WebResponseContent webResponseContent = new WebResponseContent();
            try
            {
                Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == WMStask.TaskNum && x.TaskType == WMStask.TaskType);
                if (task == null) return WebResponseContent.Instance.Error("未找到任务信息");
                Dt_StockInfo? _StockInfo = _stockService.StockInfoService.GetStockByPalletCode(task.PalletCode);
                if (_StockInfo != null)
                {
                    Dt_StockInfoDetail? detail = _StockInfo.Details.FirstOrDefault();
                    if (detail != null)
                    {
                        Dt_InboundOrder dt_InboundOrder = _inboundService.InbounOrderService.GetInboundOrder(detail.OrderNo);
                        Dt_InboundOrderDetail? inboundOrderDetail = dt_InboundOrder.Details.FirstOrDefault(x => x.BatchNo == detail.BatchNo);
                        if (inboundOrderDetail != null)
                        {
                            inboundOrderDetail.ReceiptQuantity--;
                            _inboundService.InboundOrderDetailService.Repository.UpdateData(inboundOrderDetail);
                        }
                        _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(_StockInfo.Details, OperateType.AGV删除);
                    }
                    _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(_StockInfo, OperateType.AGV删除);
                }
                BaseDal.DeleteAndMoveIntoHty(task, /*App.User.UserId == 0 ? OperateType.自动完成 :*/ OperateType.AGV删除);
            }
            catch (Exception ex)
            {
                webResponseContent.Error(ex.Message);
            }
            return webResponseContent;
        }
        /// <summary>
        /// åŒæ­¥ä»»åŠ¡çŠ¶æ€
        /// </summary>
@@ -260,30 +330,48 @@
            {
                Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == WMStask.TaskNum && x.TaskType == WMStask.TaskType);
                if (task == null) return WebResponseContent.Instance.Error("未找到任务信息");
                if (task.TaskType == (int)TaskTypeEnum.Inbound)
                if (TaskEnumHelper.GetTaskTypeGroup(task.TaskType) == TaskTypeGroup.InboundGroup)
                {
                    int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskInStatusEnum>();
                    if (WMStask.TaskState != nextStatus) return WebResponseContent.Instance.Error($"该任务状态有误,任务号:【{task.TaskNum}】,任务状态:【{task.TaskState}】");
                    //if (WMStask.TaskState != nextStatus) return WebResponseContent.Instance.Error($"该任务状态有误,任务号:【{task.TaskNum}】,任务状态:【{task.TaskState}】");
                    //task.TaskState = nextStatus;
                    task.TaskState = TaskInStatusEnum.InFinish.ObjToInt();
                    content = UpdateTaskStatusInFinish(task);
                }
                else if (task.TaskType == (int)TaskTypeEnum.Outbound)
                else if (TaskEnumHelper.GetTaskTypeGroup(task.TaskType) == TaskTypeGroup.OutbondGroup)
                {
                    int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskOutStatusEnum>();
                    if (WMStask.TaskState != nextStatus) return WebResponseContent.Instance.Error($"该任务状态有误,任务号:【{task.TaskNum}】,任务状态:【{task.TaskState}】");
                    task.TaskState = nextStatus;
                    switch (nextStatus)
                    //int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskOutStatusEnum>();
                    //if (WMStask.TaskState != nextStatus) return WebResponseContent.Instance.Error($"该任务状态有误,任务号:【{task.TaskNum}】,任务状态:【{task.TaskState}】");
                    //task.TaskState = nextStatus;
                    task.TaskState = WMStask.TaskState;
                    switch (task.TaskState)
                    {
                        case (int)TaskOutStatusEnum.SC_OutFinish://更新货位信息
                        case (int)TaskOutStatusEnum.SC_OutFinish://更新货位库存信息
                            UpdateTaskStatusSC_OutFinish(task);
                            break;
                        case (int)TaskOutStatusEnum.AGV_OutFinish:
                            {
                                task.CurrentAddress = WMStask.CurrentAddress;
                                task.TargetAddress = WMStask.TargetAddress;
                                task.NextAddress = string.Empty;
                                UpdateData(task);
                            }
                            break;
                        case (int)TaskOutStatusEnum.OutFinish:
                            UpdateTaskStatusOutFinish(task);
                            break;
                        default:
                            UpdateData(task);
                            break;
                    }
                }
                else if (task.TaskType == (int)TaskTypeEnum.Relocation)
                {
                    task.TaskState = WMStask.TaskState;
                    if (task.TaskState == (int)WIDESEA_Core.Enums.TaskRelocationStatusEnum.SC_RelocationFinish)
                        content = UpdateTaskStatusRelocationCarFinish(task);
                    else
                        content = UpdateData(task);
                }
            }
            catch (Exception ex)
@@ -292,9 +380,155 @@
            }
            return content;
        }
        /// <summary>
        /// æ›´æ–°ä»»åŠ¡çŠ¶æ€å®Œæˆ
        /// ä¿®æ”¹ä»»åŠ¡çŠ¶æ€ä¸ºå †åž›æœºå‡ºåº“å®Œæˆ
        /// </summary>
        /// <param name="task"></param>
        /// <returns></returns>
        public WebResponseContent UpdateTaskStatusSC_OutFinish(Dt_Task task)
        {
            try
            {
                Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
                Dt_LocationInfo Sourcelocation = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);
                Dt_OutStockLockInfo outStockLockInfo = _outboundService.OutboundStockLockInfoService.Repository.QueryFirst(x => x.TaskNum == task.TaskNum);
                Db.Ado.BeginTran();
                if (stockInfo != null)
                {
                    _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateType.自动完成 : OperateType.人工完成);
                    _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateType.自动完成 : OperateType.人工完成);
                }
                if (Sourcelocation != null)
                {
                    /*if (task.TaskType == TaskOutboundTypeEnum.Outbound.ObjToInt())*/
                    if (BaseDal.QueryFirst(x => x.SourceAddress == task.SourceAddress && x.TaskState < TaskOutStatusEnum.SC_OutFinish.ObjToInt()) == null)
                        Sourcelocation.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
                    Sourcelocation.CurrentQty--;
                    if (Sourcelocation.CurrentQty <= 0)
                    {
                        Sourcelocation.CurrentQty = 0;
                        Sourcelocation.LocationStatus = LocationStatusEnum.Free.ObjToInt();
                        Sourcelocation.EnableStatus = EnableStatusEnum.Normal.ObjToInt();
                    }
                    _basicService.LocationInfoService.Repository.UpdateData(Sourcelocation);
                }
                if (outStockLockInfo != null)
                {
                    outStockLockInfo.Status = OutLockStockStatusEnum.出库中.ObjToInt();
                    _outboundService.OutboundStockLockInfoService.Repository.UpdateData(outStockLockInfo);
                }
                UpdateData(task);
                Db.Ado.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                Db.Ado.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// æ›´æ–°å‡ºåº“任务状态完成
        /// </summary>
        /// <param name="task"></param>
        /// <returns></returns>
        public WebResponseContent UpdateTaskStatusOutFinish(Dt_Task task)
        {
            try
            {
                Db.Ado.BeginTran();
                Dt_OutStockLockInfo? outStockLockInfo = _outboundService.OutboundStockLockInfoService.Repository.QueryFirst(x => x.TaskNum == task.TaskNum);
                Dt_OutboundOrder? outboundOrder = null;
                Dt_OutboundOrderDetail? outboundOrderDetail = null;
                int overCount = 0;
                if (outStockLockInfo != null)
                {
                    outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.Id == outStockLockInfo.OrderDetailId);
                    if (outboundOrderDetail != null)
                    {
                        outboundOrder = Db.Queryable<Dt_OutboundOrder>().Where(x => x.Id == outboundOrderDetail.OrderId).Includes(x => x.Details).First();
                        if (outboundOrder != null)
                        {
                            outboundOrderDetail.OverOutQuantity++;
                            overCount = outboundOrder.Details.Where(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()).Count();
                            if (outboundOrderDetail.OverOutQuantity == outboundOrderDetail.OrderQuantity)
                            {
                                outboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt();
                                overCount++;
                            }
                        }
                    }
                    outStockLockInfo.Status = OutLockStockStatusEnum.出库完成.ObjToInt();
                }
                if (outboundOrder != null && outboundOrder.Details.Count == overCount)
                {
                    outboundOrder.OrderStatus = OutboundStatusEnum.出库完成.ObjToInt();
                    _outboundService.OutboundOrderDetailService.Repository.DeleteAndMoveIntoHty(outboundOrder.Details, App.User.UserId == 0 ? OperateType.自动完成 : OperateType.人工完成);
                    outboundOrder.Details = null;
                    _outboundService.OutboundOrderService.Repository.DeleteAndMoveIntoHty(outboundOrder, App.User.UserId == 0 ? OperateType.自动完成 : OperateType.人工完成);
                }
                else
                {
                    if (outboundOrderDetail != null)
                        _outboundService.OutboundOrderDetailService.Repository.UpdateData(outboundOrderDetail);
                }
                BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.自动完成 : OperateType.人工完成);
                if (outStockLockInfo != null) _outboundService.OutboundStockLockInfoService.Repository.UpdateData(outStockLockInfo);
                Db.Ado.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                Db.Ado.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// æ›´æ–°ç§»åº“任务状态完成
        /// </summary>
        /// <param name="task"></param>
        /// <returns></returns>
        public WebResponseContent UpdateTaskStatusRelocationCarFinish(Dt_Task task)
        {
            try
            {
                Dt_LocationInfo Sourcelocation = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);//起始货位
                Dt_LocationInfo Targetlocation = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);//目标货位
                Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);//托盘库存
                Sourcelocation.CurrentQty--;
                Targetlocation.CurrentQty++;
                stockInfo.LocationCode = Targetlocation.LocationCode;
                stockInfo.SerialNumber = Targetlocation.CurrentQty;
                stockInfo.StockStatus = StockStatusEmun.已入库.ObjToInt();
                if (Sourcelocation.CurrentQty == 0) Sourcelocation.LocationStatus = LocationStatusEnum.Free.ObjToInt();
                Dt_Task _Task = BaseDal.QueryFirst(x => x.TaskNum != task.TaskNum && x.TaskType == task.TaskType && x.SourceAddress == Sourcelocation.LocationCode && x.TargetAddress == Targetlocation.LocationCode);
                if (_Task == null)
                {
                    if (Targetlocation.CurrentQty == Targetlocation.MaxQty) Targetlocation.LocationStatus = LocationStatusEnum.Fullload.ObjToInt();
                    else Targetlocation.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
                    if (Sourcelocation.CurrentQty == 0) Sourcelocation.LocationStatus = LocationStatusEnum.Free.ObjToInt();
                }
                task.CurrentAddress = task.NextAddress;
                task.NextAddress = string.Empty;
                task.ModifyDate = DateTime.Now;
                task.Modifier = "System";
                Db.Ado.BeginTran();
                _basicService.LocationInfoService.Repository.UpdateData(Sourcelocation);
                _basicService.LocationInfoService.Repository.UpdateData(Targetlocation);
                _stockService.StockInfoService.Repository.UpdateData(stockInfo);
                //BaseDal.DeleteAndMoveIntoHty(task, OperateType.自动完成);
                BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.自动完成 : OperateType.人工完成);
                Db.Ado.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                Db.Ado.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// æ›´æ–°å…¥åº“任务状态完成
        /// </summary>
        /// <param name="WMStask"></param>
        /// <returns></returns>
@@ -312,24 +546,58 @@
                if (stockInfo.StockStatus != StockStatusEmun.入库中.ObjToInt()) throw new Exception($"托盘[{task.PalletCode}],该组盘状态不可入库");
                Dt_StockInfoDetail stockInfoDetail = stockInfo.Details.FirstOrDefault(x => x.StockId == stockInfo.Id);
                List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.Repository.LocationCodesGetStockInfos(new List<string> { stockInfo.LocationCode }).Where(x => x.StockStatus == StockStatusEmun.已入库.ObjToInt()).ToList();
                if (task.TaskType == TaskTypeEnum.PalletInbound.ObjToInt())
                {
                    stockInfo.SerialNumber = stockInfos.Count + 1;
                    stockInfo.InDate = DateTime.Now;
                    stockInfo.StockStatus = StockStatusEmun.已入库.ObjToInt();
                    stockInfoDetail.Status = StockStatusEmun.已入库.ObjToInt();
                    locationInfo.LocationStatus = LocationStatusEnum.Pallet.ObjToInt();
                    task.CurrentAddress = task.NextAddress;
                    task.NextAddress = string.Empty;
                    Db.Ado.BeginTran();
                    BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.自动完成 : OperateType.人工完成);
                    _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
                    _stockService.StockInfoService.Repository.UpdateData(stockInfo);
                    _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail);
                    Db.Ado.CommitTran();
                    return content;
                }
                Db.Ado.BeginTran();
                #region å…¥åº“单
                Dt_InboundOrder inboundOrder = _inboundService.InbounOrderService.GetInboundOrder(stockInfoDetail.OrderNo);
                if (inboundOrder == null || inboundOrder.Details == null) throw new Exception($"未找到托盘[{task.PalletCode}]的入库单明细信息");
                Dt_InboundOrderDetail inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.BatchNo == stockInfoDetail.BatchNo && x.MaterielCode == stockInfoDetail.MaterielCode);
                inboundOrderDetail.OverInQuantity++;
                inboundOrderDetail.OrderDetailStatus = inboundOrderDetail.OverInQuantity == inboundOrderDetail.OrderQuantity ? OrderDetailStatusEnum.Over.ObjToInt() : OrderDetailStatusEnum.GroupAndInbound.ObjToInt();
                if (inboundOrder != null)
                {
                    Dt_InboundOrderDetail inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.BatchNo == stockInfoDetail.BatchNo && x.MaterielCode == stockInfoDetail.MaterielCode);
                    if (inboundOrderDetail != null)
                        inboundOrderDetail.OrderDetailStatus = inboundOrderDetail.OverInQuantity == inboundOrderDetail.OrderQuantity ? OrderDetailStatusEnum.Over.ObjToInt() : OrderDetailStatusEnum.GroupAndInbound.ObjToInt();
                if (inboundOrder.Details.FirstOrDefault(x => x.OrderDetailStatus != OrderDetailStatusEnum.Over.ObjToInt()) == null)
                {
                    inboundOrder.OrderStatus = InboundStatusEnum.入库完成.ObjToInt();
                    if (inboundOrder.Details.FirstOrDefault(x => x.OrderDetailStatus != OrderDetailStatusEnum.Over.ObjToInt()) == null)
                    {
                        inboundOrder.OrderStatus = InboundStatusEnum.入库完成.ObjToInt();
                    }
                    else if (inboundOrder.OrderStatus == InboundStatusEnum.未开始.ObjToInt())
                    {
                        inboundOrder.OrderStatus = InboundStatusEnum.入库中.ObjToInt();
                    }
                    if (inboundOrder.OrderStatus != InboundStatusEnum.入库完成.ObjToInt())
                    {
                        _inboundService.InbounOrderService.Repository.UpdateData(inboundOrder);
                        if (inboundOrderDetail != null)
                            _inboundService.InboundOrderDetailService.Repository.UpdateData(inboundOrderDetail);
                    }
                    else
                    {
                        List<Dt_InboundOrderDetail> orderDetails = inboundOrder.Details;
                        inboundOrder.Details = null;
                        _inboundService.InbounOrderService.Repository.DeleteAndMoveIntoHty(inboundOrder, OperateType.自动完成);
                        _inboundService.InboundOrderDetailService.Repository.DeleteAndMoveIntoHty(orderDetails, OperateType.自动完成);
                    }
                }
                else if (inboundOrder.OrderStatus == InboundStatusEnum.未开始.ObjToInt())
                {
                    inboundOrder.OrderStatus = InboundStatusEnum.入库中.ObjToInt();
                }
                #endregion
                List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.Repository.LocationCodesGetStockInfos(new List<string> { stockInfo.LocationCode }).Where(x => x.StockStatus == StockStatusEmun.已入库.ObjToInt()).ToList();
                stockInfo.SerialNumber = stockInfos.Count + 1;
                stockInfo.InDate = DateTime.Now;
                stockInfo.StockStatus = StockStatusEmun.已入库.ObjToInt();
@@ -338,48 +606,15 @@
                locationInfo.LocationStatus = locationInfo.MaxQty - locationInfo.CurrentQty == 0 ? LocationStatusEnum.Fullload.ObjToInt() : LocationStatusEnum.InStock.ObjToInt();
                task.CurrentAddress = task.NextAddress;
                task.NextAddress = string.Empty;
                Db.Ado.BeginTran();
                #region ä»»åŠ¡å’Œå…¥åº“å•
                //BaseDal.UpdateData(task);
                BaseDal.DeleteAndMoveIntoHty(task, OperateType.自动完成);
                if (inboundOrder.OrderStatus != InboundStatusEnum.入库完成.ObjToInt())
                {
                    _inboundService.InbounOrderService.Repository.UpdateData(inboundOrder);
                    _inboundService.InboundOrderDetailService.Repository.UpdateData(inboundOrderDetail);
                }
                else
                {
                    _inboundService.InbounOrderService.Repository.DeleteAndMoveIntoHty(inboundOrder, OperateType.自动完成);
                    _inboundService.InboundOrderDetailService.Repository.DeleteAndMoveIntoHty(inboundOrder.Details, OperateType.自动完成);
                }
                #endregion
                BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.自动完成 : OperateType.人工完成);
                _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
                _stockService.StockInfoService.Repository.UpdateData(stockInfo);
                _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail);
                _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
                Db.Ado.CommitTran();
            }
            catch (Exception ex)
            {
                Db.Ado.RollbackTran();
                content.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// æ›´æ–°ä»»åŠ¡çŠ¶æ€æ‰§è¡Œ
        /// </summary>
        /// <param name="WMStask"></param>
        /// <returns></returns>
        public WebResponseContent UpdateTaskStatusExecuting(Dt_Task task)
        {
            WebResponseContent content = new WebResponseContent().OK();
            try
            {
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;