刘磊
7 天以前 2de09bec5cc05bf875543fa8956167ca7db73021
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_Task_HtyService.cs
@@ -1,25 +1,71 @@
锘縩amespace WIDESEA_StorageTaskServices;
锘縰sing Autofac.Core;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_DTO.WMS;
using WIDESEA_StorageBasicRepository;
namespace WIDESEA_StorageTaskServices;
public class Dt_Task_HtyService : ServiceBase<Dt_Task_Hty, IDt_Task_HtyRepository>, IDt_Task_HtyService
{
    private readonly IUnitOfWorkManage _unitOfWorkManage;
    private readonly IDt_OutOrderService _outOrderService;
    private readonly IDt_TaskService _taskService;
    public Dt_Task_HtyService(IDt_Task_HtyRepository BaseDal,
                                    IUnitOfWorkManage unitOfWorkManage,
                                    IDt_OutOrderService outOrderService) : base(BaseDal)
                                    IDt_OutOrderService outOrderService,
                                    IDt_TaskService taskService) : base(BaseDal)
    {
        _unitOfWorkManage = unitOfWorkManage;
        _outOrderService = outOrderService;
        _taskService = taskService;
    }
    /// <summary>
    /// 娣诲姞鍘嗗彶浠诲姟
    /// </summary>
    /// <param name="task">鍘嗗彶浠诲姟Model</param>
    /// <returns>鎴愬姛/澶辫触</returns>
    public bool InsertTask(Dt_Task_Hty task)
    public WebResponseContent TaskRollback(int input)
    {
        return BaseDal.InsertTask(task);
        WebResponseContent content = new WebResponseContent();
        try
        {
            Dt_Task_Hty dt_Task_ = BaseDal.QueryFirst(x => x.TaskId == input);
            if(dt_Task_ == null)
            {
                return content.Error("鏈煡鎵惧埌鏁版嵁");
            }
            // 鍒涘缓WMS浠诲姟
            Dt_Task taskDTO = new Dt_Task()
            {
                TaskNum = dt_Task_.TaskNum.Value,
                Grade = dt_Task_.Grade.Value,
                PalletCode = dt_Task_.PalletCode,
                Roadway = dt_Task_.Roadway,
                SourceAddress = dt_Task_.SourceAddress,
                TargetAddress = dt_Task_.TargetAddress,
                CurrentAddress=dt_Task_.CurrentAddress,
                NextAddress = dt_Task_.NextAddress,
                TaskState = 999,
                TaskType = dt_Task_.TaskType,
                wheels_mttype = dt_Task_.wheels_mttype,
                CarType = dt_Task_.CarType,
                wheels_gkcc = dt_Task_.wheels_gkcc,
                WheelsNewOrOld = dt_Task_.WheelsNewOrOld,
                IsCheck = dt_Task_.IsCheck,
                WheelsLX = dt_Task_.WheelsLX,
                CreateDate = DateTime.Now,
                Dispatchertime=dt_Task_.Dispatchertime,
                Creater ="浠诲姟鍥炴粴"
            };
            _taskService.AddData(taskDTO);
            return content.OK("鎴愬姛");
        }
        catch (Exception ex)
        {
            return content.Error(ex.Message);
            throw;
        }
    }
}