|
|
|
using Autofac.Core;
|
|
|
|
using DS.Module.Core;
|
|
|
|
using DS.Module.Core.Data;
|
|
|
|
using DS.Module.Core.Enums;
|
|
|
|
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 Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
namespace DS.WMS.ContainerManagementApi.Controllers;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 状态变动日志
|
|
|
|
/// </summary>
|
|
|
|
public class CM_State_ChangeController : ApiController
|
|
|
|
{
|
|
|
|
private readonly ICM_State_ChangeService _invokeService;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 构造函数
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="invokeService"></param>
|
|
|
|
public CM_State_ChangeController(ICM_State_ChangeService invokeService)
|
|
|
|
{
|
|
|
|
_invokeService = invokeService;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 列表
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="request"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
[Route("GetCM_State_ChangeList")]
|
|
|
|
public async Task<DataResult<List<CM_State_ChangeRes>>> GetCM_State_ChangeList([FromBody] PageRequest request)
|
|
|
|
{
|
|
|
|
var res = await _invokeService.GetListByPage(request);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 直接编辑状态
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
[Route("EditCM_State_Change")]
|
|
|
|
public DataResult EditCM_State_Change([FromBody] CM_State_ChangeReq model)
|
|
|
|
{
|
|
|
|
var res = _invokeService.EditCM_State_Change(model);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 批量编辑状态
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
[Route("CM_State_Change_Multi")]
|
|
|
|
public Task<DataResult> CM_State_Change_Multi([FromBody] CM_State_ChangeReq model)
|
|
|
|
{
|
|
|
|
var res = _invokeService.CM_State_Change_Multi( model);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 批量上线
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
[Route("CM_State_Change_Multi_OnLine")]
|
|
|
|
public async Task<DataResult> CM_State_Change_Multi_OnLine([FromBody] IdModel model)
|
|
|
|
{
|
|
|
|
if (!ModelState.IsValid)
|
|
|
|
return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
|
|
|
|
|
|
|
|
return await _invokeService.CM_State_Change_Multi_OnLine(CM_IsOnlineEnum.上线, model.Ids);
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
|
|
/// 批量下线
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
[Route("CM_State_Change_Multi_OffLine")]
|
|
|
|
public async Task<DataResult> CM_State_Change_Multi_OffLine([FromBody] IdModel model)
|
|
|
|
{
|
|
|
|
if (!ModelState.IsValid)
|
|
|
|
return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
|
|
|
|
|
|
|
|
return await _invokeService.CM_State_Change_Multi_OnLine(CM_IsOnlineEnum.下线, model.Ids);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 查看状态详情
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
|
|
|
[Route("GetCM_State_Change")]
|
|
|
|
public DataResult<CM_State_ChangeRes> GetCM_State_Change([FromQuery] string id)
|
|
|
|
{
|
|
|
|
var res = _invokeService.GetCM_State_Change(id);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 删除状态变动日志
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="model">删除状态变动日志</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost, Route("DeleteCM_State_Change")]
|
|
|
|
public async Task<DataResult> DeleteCM_State_ChangeAsync([FromBody] IdModel model)
|
|
|
|
{
|
|
|
|
if (!ModelState.IsValid)
|
|
|
|
return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
|
|
|
|
|
|
|
|
return await _invokeService.DeleteCM_State_ChangeAsync(model.Ids);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|