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