using System.Net; using DS.Module.Core; using DS.WMS.Core.Flow.Dtos; using DS.WMS.Core.Op.Dtos.TaskInteraction; using DS.WMS.Core.Op.Interface.TaskInteraction; using Microsoft.AspNetCore.Mvc; namespace DS.WMS.OpApi.Controllers { /// /// 海运出口任务API /// public class SeaExportTaskController : ApiController { readonly ISeaExportTaskService taskService; /// /// 构造函数 /// /// public SeaExportTaskController(ISeaExportTaskService service) { taskService = service; } /// /// 创建关联任务 /// /// /// [HttpPost, Route("CreateTask")] public async Task CreateTaskAsync(TaskCreationRequest request) { return await taskService.CreateTaskAsync(request); } /// /// 设置任务状态 /// /// /// [HttpPost, Route("SetTaskStatus")] public async Task SetTaskStatusAsync(TaskUpdateRequest request) { return await taskService.SetTaskStatusAsync(request); } /// /// 审批完成回调更新(无需客户端手动调用) /// /// 回调信息 /// [HttpPost, Route("UpdateBusiness")] public async Task UpdateBusinessAsync(FlowCallback callback) { await taskService.UpdateBusinessAsync(callback); return StatusCode((int)HttpStatusCode.NoContent); } } }