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.

144 lines
4.2 KiB
C#

using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.ContainerManagement.Info.Dtos;
using DS.WMS.ContainerManagement.Info.Entity;
using DS.WMS.ContainerManagement.Info.Interface;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.Op.View;
using LanguageExt.Common;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.ContainerManagementApi.Controllers;
/// <summary>
/// 批量变动导入
/// </summary>
public class CM_State_Change_TemplatImportController : ApiController
{
private readonly ICM_State_Change_TemplatImportService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public CM_State_Change_TemplatImportController(ICM_State_Change_TemplatImportService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetCM_State_Change_TemplatImportList")]
public async Task<DataResult<List<CM_State_Change_TemplatImportRes>>> GetCM_State_Change_TemplatImportList([FromBody] PageRequest request)
{
var res = await _invokeService.GetListByPage(request);
return res;
}
/// <summary>
/// 直接编辑状态
/// </summary>
/// <returns></returns>
[HttpPost]
[Route("EditCM_State_Change_TemplatImport")]
public Task<DataResult> EditCM_State_Change_TemplatImport([FromBody] CM_State_Change_TemplatImportReq model)
{
var res = _invokeService.EditCM_State_Change_TemplatImport(model);
return res;
}
/// <summary>
/// 查看详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("Get_State_Change_TemplatImport")]
public DataResult<CM_State_Change_TemplatImportRes> GetCM_State_Change_Templat([FromQuery] string id)
{
var res = _invokeService.GetCM_State_Change_TemplatImport(id);
return res;
}
/// <summary>
/// 删除
/// </summary>
/// <param name="model">删除</param>
/// <returns></returns>
[HttpPost, Route("DeleteCM_State_Change_TemplatImport")]
public async Task<DataResult> DeleteCM_State_Change_TemplatImport([FromBody] IdModel model)
{
if (!ModelState.IsValid)
return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
return await _invokeService.DeleteCM_State_Change_TemplatImport(model.Ids);
}
/// <summary>
/// 删除明细
/// </summary>
/// <param name="model">删除</param>
/// <returns></returns>
[HttpPost, Route("DeleteCM_State_Change_Temp")]
public async Task<DataResult> DeleteCM_State_Change_Temp([FromBody] IdModel model)
{
if (!ModelState.IsValid)
return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
return await _invokeService.DeleteCM_State_Change_Temp(model.Ids);
}
/// <summary>
/// 确认引入
///
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost]
[Route("CM_State_Change_TemplatImport_Confirm")]
public Task<DataResult> CM_State_Change_TemplatImport_Confirm([FromBody] IdModel model)
{
if (string.IsNullOrWhiteSpace(model.Id))
{
var res = _invokeService.CM_State_Change_TemplatImport_Confirm(model.Ids);
return res;
}
else
{
var res = _invokeService.CM_State_Change_TemplatImport_Confirm(model.Id, model.Ids);
return res;
}
}
/// <summary>
/// 获取选定业务的待上线明细
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
[HttpPost]
[Route("GetDSX_TemplatDetailList")]
public Task<DataResult> GetDSX_TemplatDetailList([FromBody] IdModel model)
{
if (model.Ids!=null && model.Ids.Count()>0)
{
var res = _invokeService.GetDSX_TemplatDetailList(model.Ids);
return res;
}
else
{
var res = new DataResult(ResultCode.Fail,"");
return Task.FromResult(res);
}
}
}