You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.9 KiB
C#

using DS.Module.Core;
using DS.Module.Core.Attributes;
using DS.WMS.Core.TaskPlat.Dtos;
using DS.WMS.Core.TaskPlat.Interface;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
namespace DS.WMS.TaskApi.Controllers;
/// <summary>
/// 任务台相关接口
/// </summary>
public class TaskManageController : ApiController
{
private readonly ITaskManageService taskManageService;
public TaskManageController(ITaskManageService taskManageService)
{
this.taskManageService = taskManageService;
}
/// <summary>
/// 创建任务
/// </summary>
/// <param name="info">任务详情</param>
/// <returns>返回回执</returns>
[HttpPost("CreateTaskJob")]
[ApiUser(ApiCode = "BCTaskManage"), AllowAnonymous]
public async Task<DataResult> CreateTaskJob(TaskManageOrderMessageInfo info)
{
var result = await taskManageService.InitTaskJob(info);
return result;
}
/// <summary>
/// 创建BC任务
/// </summary>
/// <param name="file">文件</param>
/// <param name="modifyFile">BC变更内容后文件</param>
/// <param name="jsonData">BC任务详情JSON</param>
/// <returns>返回回执</returns>
[HttpPost("CreateBCTaskJob")]
[ApiUser(ApiCode = "BCTaskManage"), AllowAnonymous]
public async Task<DataResult> CreateBCTaskJob(IFormFile file, IFormFile modifyFile, [FromForm] string jsonData)
{
TaskManageOrderMessageInfo? info = JsonConvert.DeserializeObject<TaskManageOrderMessageInfo>(jsonData);
if (info == null)
{
throw new ArgumentException(nameof(jsonData));
}
var result = await taskManageService.InitTaskJob(info, file, modifyFile);
return result;
}
// /TaskManage/CreateBCTaskJob
// /TaskManage/CreateDRAFTTaskJob
// /TaskManage/CreateAdvisoryTaskJob
// /TaskManage/CreateDRAFTTaskJob
}