| | |
| | | |
| | | #endregion << ç æ¬ 注 é >> |
| | | |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | |
| | | { |
| | | public class TaskCZService : ServiceBase<DtCZTask, ITaskCZRepository>, ITaskCZService |
| | | { |
| | | public TaskCZService(ITaskCZRepository BaseDal) : base(BaseDal) |
| | | private readonly ITaskRepository _taskRepository; |
| | | public TaskCZService(ITaskCZRepository BaseDal, ITaskRepository taskRepository) : base(BaseDal) |
| | | { |
| | | _taskRepository = taskRepository; |
| | | } |
| | | |
| | | public Task<WebResponseContent> AddTaskCZAsync(CZTaskDto dto) |
| | |
| | | } |
| | | return Task.FromResult(response); |
| | | } |
| | | /// <summary> |
| | | /// è¾éçº¿åæµ |
| | | /// </summary> |
| | | /// <param name="saveModel"></param> |
| | | /// <returns></returns> |
| | | public Task<WebResponseContent> EmptyTask(SaveModel saveModel) |
| | | { |
| | | WebResponseContent webResponseContent = new WebResponseContent(); |
| | | try |
| | | { |
| | | string Saddress = saveModel.MainData["sourceAddress"].ToString(); |
| | | string Taddress = saveModel.MainData["targetAddress"].ToString(); |
| | | |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.SourceAddress == Saddress && x.TaskState == (int)TaskInStatusEnum.InPending && x.TargetAddress == "WaitBind"); |
| | | if (task == null) |
| | | { |
| | | webResponseContent.Error("ä»»å¡ä¸åå¨ï¼"); |
| | | return Task.FromResult(webResponseContent); |
| | | } |
| | | task.TargetAddress = Taddress; |
| | | task.TaskState = (int)TaskInStatusEnum.InNew; |
| | | var isTrue = _taskRepository.UpdateData(task); |
| | | if (isTrue) |
| | | { |
| | | webResponseContent.OK("ä»»å¡ä¸åæåï¼"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | webResponseContent.Error(ex.Message); |
| | | } |
| | | return Task.FromResult(webResponseContent); |
| | | } |
| | | } |
| | | } |