diff --git a/ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsNowProductionController.cs b/ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsNowProductionController.cs index 41d8d7cb..d4629b71 100644 --- a/ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsNowProductionController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsNowProductionController.cs @@ -70,16 +70,16 @@ namespace ZR.Admin.WebApi.Controllers [HttpGet("shortPatchsearch")] public IActionResult QueryshortPatch(CommonQueryDto parm) { - List response = _WmGoodsNowProductionService.QueryshortPatch(parm); + (List,int) response = _WmGoodsNowProductionService.QueryshortPatch(parm); var json = new { - list = response, - total = response.Count + list = response.Item1, + total = response.Item2 }; return ToResponse(new ApiResult(200, "ok", json)); } /// - /// 移动端 短批次号查询 + /// 移动端 短批次号详细信息查询 /// /// /// @@ -87,7 +87,12 @@ namespace ZR.Admin.WebApi.Controllers public IActionResult Patchsearchdetail(WmGoodsNowProductionQueryDto parm) { var response = _WmGoodsNowProductionService.Patchsearchdetail(parm); - return SUCCESS(response); + var json = new + { + list = response.Item1, + total = response.Item2 + }; + return ToResponse(new ApiResult(200, "ok", json)); } /// diff --git a/ZR.Service/mes/wms/IService/IWmGoodsNowProductionService.cs b/ZR.Service/mes/wms/IService/IWmGoodsNowProductionService.cs index 788d0d22..4c878785 100644 --- a/ZR.Service/mes/wms/IService/IWmGoodsNowProductionService.cs +++ b/ZR.Service/mes/wms/IService/IWmGoodsNowProductionService.cs @@ -22,14 +22,14 @@ namespace ZR.Service.mes.wms.IService /// /// /// - List QueryshortPatch(CommonQueryDto parm); + (List,int) QueryshortPatch(CommonQueryDto parm); /// /// 移动端 查询短批次号 细则详情 /// /// /// - List Patchsearchdetail(WmGoodsNowProductionQueryDto parm); + (List,int) Patchsearchdetail(WmGoodsNowProductionQueryDto parm); WmGoodsNowProduction GetInfo(string Id); diff --git a/ZR.Service/mes/wms/WmGoodsNowProductionService.cs b/ZR.Service/mes/wms/WmGoodsNowProductionService.cs index edd5f16b..97247c82 100644 --- a/ZR.Service/mes/wms/WmGoodsNowProductionService.cs +++ b/ZR.Service/mes/wms/WmGoodsNowProductionService.cs @@ -164,7 +164,7 @@ namespace ZR.Service.mes.wms /// /// /// - public List QueryshortPatch(CommonQueryDto parm) + public (List, int) QueryshortPatch(CommonQueryDto parm) { // 结果集 List resultList = new(); @@ -211,7 +211,7 @@ namespace ZR.Service.mes.wms { resultList = resultList.Skip(startIndex).Take(startIndex + rows).ToList(); } - return resultList; + return (resultList, sum); } /// @@ -219,7 +219,9 @@ namespace ZR.Service.mes.wms /// /// /// - public List Patchsearchdetail(WmGoodsNowProductionQueryDto parm) + public (List, int) Patchsearchdetail( + WmGoodsNowProductionQueryDto parm + ) { var predicate = Expressionable .Create() @@ -246,6 +248,8 @@ namespace ZR.Service.mes.wms WmMaterial material = Context .Queryable() .Where(it => it.Partnumber == item.Partnumber) + .Where(it => it.Type == 1) + .Where(it => it.Status == 1) .First(); if (material == null) { @@ -256,7 +260,7 @@ namespace ZR.Service.mes.wms ? material.Description : material.ProductName; } - return response; + return (response, response.Count); } /// @@ -413,16 +417,20 @@ namespace ZR.Service.mes.wms List updateList = new List(); foreach (string id in parm.Ids) { - WmGoodsNowProduction nowProduction = new() - { - Id = id, - LocationCode = parm.LocationCode, - UpdatedBy = parm.UpdatedBy, - UpdatedTime = parm.UpdatedTime, - }; + WmGoodsNowProduction nowProduction = + new() + { + Id = id, + LocationCode = parm.LocationCode, + UpdatedBy = parm.UpdatedBy, + UpdatedTime = parm.UpdatedTime, + }; updateList.Add(nowProduction); } - return Context.Updateable(updateList).IgnoreColumns(ignoreAllNullColumns:true).ExecuteCommand(); + return Context + .Updateable(updateList) + .IgnoreColumns(ignoreAllNullColumns: true) + .ExecuteCommand(); } catch (Exception e) {