From e7cff07b8afd8bd3d3b750ec4140187f3fdadb48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AD=A3=E6=98=93?= Date: Thu, 20 Feb 2025 10:46:07 +0800 Subject: [PATCH] =?UTF-8?q?GP12=E8=A7=A6=E6=91=B8=E5=B1=8F=EF=BC=8C?= =?UTF-8?q?=E6=B2=B9=E6=BC=86=E5=AE=9E=E9=AA=8C=E5=AE=A4=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/mes/ql/PainLabController.cs | 37 ++++++++++++------- ZR.Service/mes/qc/QcGp12Service.cs | 10 ++--- .../mes/ql/IService/IPLRawMaterialService.cs | 9 +++++ ZR.Service/mes/ql/PLRawMaterialService.cs | 33 ++++++++++++++++- 4 files changed, 68 insertions(+), 21 deletions(-) diff --git a/ZR.Admin.WebApi/Controllers/mes/ql/PainLabController.cs b/ZR.Admin.WebApi/Controllers/mes/ql/PainLabController.cs index ab4bba51..ee9cf9fa 100644 --- a/ZR.Admin.WebApi/Controllers/mes/ql/PainLabController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/ql/PainLabController.cs @@ -33,23 +33,20 @@ namespace ZR.Admin.WebApi.Controllers.mes.ql /// /// 查询原材料记录表 /// - /// 开始时间 - /// 结束时间 - /// 批次号 - /// 颜色代码 + /// 开始时间 + /// 结束时间 + /// 批次号 + /// 描述 + /// 颜色代码 /// 页号 /// 页大小 /// [HttpGet("getrawmateriallist")] - public IActionResult GetRawMateriallist(DateTime starttime, DateTime endTime, string workorderid,string partnumber,string description, int pageNum, int pageSize) + public IActionResult GetRawMateriallist(DateTime startDate, DateTime endDate, string batchNumber, string colorCode, string productDescription, int pageNum, int pageSize) { - //starttime = starttime.AddHours(8); - //endTime = endTime.AddHours(8); + (List, int) list = plRawMaterialService.GetRawMaterialTable(startDate, endDate, batchNumber, colorCode, productDescription, pageNum, pageSize); - // 时间要增加,8个小时 - (List, int) lst = plRawMaterialService.GetRawMaterialTable(starttime, endTime, workorderid, partnumber, description, pageNum, pageSize); - - return ToResponse(new ApiResult(200, "success", lst)); + return ToResponse(new ApiResult(200, "success", list)); } /// @@ -61,9 +58,9 @@ namespace ZR.Admin.WebApi.Controllers.mes.ql public IActionResult AddRawMateriallist(int num) { - int ret = plRawMaterialService.AddRawMaterialRecords(1, 5); + int result = plRawMaterialService.AddRawMaterialRecords(1, 5); - return ToResponse(new ApiResult(200, "success", ret)); + return ToResponse(new ApiResult(200, "success", result)); } /// @@ -131,5 +128,19 @@ namespace ZR.Admin.WebApi.Controllers.mes.ql return pLRawMaterial; } + + /// + /// 根据传入数据查询物料信息,下拉填写 + /// + /// + /// + [HttpGet("QueryMaterialOptions")] + public IActionResult QueryMaterialOptions(string query) + { + + var result = plRawMaterialService.QueryMaterialOptions(query); + + return ToResponse(new ApiResult(200, "success", result)); + } } } diff --git a/ZR.Service/mes/qc/QcGp12Service.cs b/ZR.Service/mes/qc/QcGp12Service.cs index 2a9793c3..c0c90020 100644 --- a/ZR.Service/mes/qc/QcGp12Service.cs +++ b/ZR.Service/mes/qc/QcGp12Service.cs @@ -599,17 +599,13 @@ namespace ZR.Service.Business public string ScanInnerLabel(QcGp12LabelScanDto data) { DateTime nowTime = DateTime.Now; - // 标签防错 + // 标签防错 (内标签零件号) string partNumber = DoAnalyzePartnumber(data.Label); - if (partNumber != data.PartNumber) + // 内标签包含外标签 + if (!partNumber.Contains(data.PartNumber)) { return "内标签零件号与外箱标签不一致!"; } - /* int qt = DoAnalyzeQuantity(data.Label); - if (qt >= 6) - { - return "该标签可能为外箱标签!"; - }*/ bool hasAny = Context .Queryable() .Where(it => it.Label == data.Label) diff --git a/ZR.Service/mes/ql/IService/IPLRawMaterialService.cs b/ZR.Service/mes/ql/IService/IPLRawMaterialService.cs index 57f263af..4b8253bf 100644 --- a/ZR.Service/mes/ql/IService/IPLRawMaterialService.cs +++ b/ZR.Service/mes/ql/IService/IPLRawMaterialService.cs @@ -1,5 +1,7 @@ using System; +using ZR.Model; using ZR.Model.MES.ql; +using ZR.Model.MES.wms.Dto; namespace ZR.Service.mes.ql.IService @@ -15,5 +17,12 @@ namespace ZR.Service.mes.ql.IService public int UpdateRawMaterialRecords(List list); + /// + /// 根据查询条件,获取物料下拉信息 + /// + /// + /// + List QueryMaterialOptions(string query); + } } diff --git a/ZR.Service/mes/ql/PLRawMaterialService.cs b/ZR.Service/mes/ql/PLRawMaterialService.cs index b0298d58..9fc64517 100644 --- a/ZR.Service/mes/ql/PLRawMaterialService.cs +++ b/ZR.Service/mes/ql/PLRawMaterialService.cs @@ -1,7 +1,10 @@ -using Infrastructure.Attribute; +using Aliyun.OSS; +using Infrastructure.Attribute; using SqlSugar; using System; using ZR.Model.MES.ql; +using ZR.Model.MES.wms; +using ZR.Model.MES.wms.Dto; using ZR.Service.mes.ql.IService; namespace ZR.Service.mes.ql @@ -97,6 +100,8 @@ namespace ZR.Service.mes.ql //return (Context.Queryable().Where(it => it.Id > 0).ToList(),100); } + + /// /// 更新数据记录 /// @@ -134,5 +139,31 @@ namespace ZR.Service.mes.ql UpdatedTime = DateTime.Now, }; } + + public List QueryMaterialOptions(string query) + { + var predicate = Expressionable + .Create() + .Or(it => it.Partnumber.Contains(query)) + .Or(it => it.Description.Contains(query)) + .Or(it => it.ProductName.Contains(query)) + .And(it => it.Type == 1) + .And(it => it.Status == 1); + List options = Context + .Queryable() + .Where(predicate.ToExpression()) + .Select( + (it) => + new WmMaterialSelectOptions + { + Key = it.Id, + Label = "[ " + it.Partnumber + " ] " + it.Description, + Value = it.Description + } + ) + .Take(10) + .ToList(); + return options; + } } }