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 Microsoft.AspNetCore.Mvc; namespace DS.WMS.ContainerManagementApi.Controllers; /// /// 报废箱 /// public class CM_CtnScrapController : ApiController { private readonly ICM_CtnScrapService _invokeService; /// /// 构造函数 /// /// public CM_CtnScrapController(ICM_CtnScrapService invokeService) { _invokeService = invokeService; } /// /// 列表 /// /// /// [HttpPost] [Route("GetCM_CtnScrapList")] public async Task>> GetCM_CtnScrapList([FromBody] PageRequest request) { var res = await _invokeService.GetListByPage(request); return res; } /// /// 直接编辑状态 /// /// [HttpPost] [Route("EditCM_CtnScrap")] public Task EditCM_CtnScrap([FromBody] CM_CtnScrapReq model) { var res = _invokeService.EditCM_CtnScrap(model); return res; } /// /// 查看报废箱详情 /// /// /// [HttpGet] [Route("GetCM_CtnScrap")] public DataResult GetCM_CtnScrap([FromQuery] string id) { var res = _invokeService.GetCM_CtnScrap(id); return res; } /// /// 删除报废箱 /// /// 删除报废箱 /// [HttpPost, Route("DeleteCM_CtnScrap")] public async Task DeleteCM_CtnScrapAsync([FromBody] IdModel model) { if (!ModelState.IsValid) return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest); return await _invokeService.DeleteCM_CtnScrapAsync(model.Ids); } /// /// 报废箱_确认 /// /// /// [HttpPost] [Route("CM_CtnScrap_Confirm")] public Task CM_CtnScrap_Confirm([FromBody] IdModel model) { if (string.IsNullOrWhiteSpace(model.Id)) { var res = _invokeService.CM_CtnScrap_Confirm(model.Ids); return res; } else { var res = _invokeService.CM_CtnScrap_Confirm(model.Id,model.Ids); return res; } } /// /// 报废箱_取消 /// /// /// [HttpPost] [Route("CM_CtnScrap_Cancel")] public Task CM_CtnScrap_Cancel([FromBody] IdModel model) { if (string.IsNullOrWhiteSpace(model.Id)) { var res = _invokeService.CM_CtnScrap_Cancel(model.Ids); return res; } else { var res = _invokeService.CM_CtnScrap_Cancel(model.Id, model.Ids); return res; } } /// /// 报废箱 待报废 明细视图 /// /// /// [HttpPost] [Route("CM_CtnScrap_Detail_View")] public Task>> CM_CtnScrap_Detail_View([FromBody] PageRequest request) { var res = _invokeService.CM_CtnScrap_Detail_View(request); return res; } /// /// 报废箱 待报废_明细添加 /// /// /// [HttpPost] [Route("CM_CtnScrap_AddCtn")] public async Task CM_SellCtn_AddCtn([FromBody] IdModel model) { return await _invokeService.CM_CtnScrap_AddCtn(long.Parse(model.Id), model.Ids); //return res; } /// /// 报废箱_生成费用 /// /// /// [HttpPost] [Route("CM_CtnScrap_MakeFee")] public Task CM_CtnScrap_MakeFee([FromBody] IdModel model) { var res = _invokeService.CM_CtnScrap_MakeFee(model.Id); return res; } }