diff --git a/ZR.Admin.WebApi/Controllers/mes/wms/WmFgentryInspectController.cs b/ZR.Admin.WebApi/Controllers/mes/wms/WmFgentryInspectController.cs index 7c6dbc42..f234fff4 100644 --- a/ZR.Admin.WebApi/Controllers/mes/wms/WmFgentryInspectController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/wms/WmFgentryInspectController.cs @@ -164,6 +164,25 @@ namespace ZR.Admin.WebApi.Controllers } + /// + /// 设置全部合格 + /// + /// + /// + [HttpGet("setAllQualified")] + public IActionResult SetAllQualified(string workorder_selected) + { + if (string.IsNullOrEmpty(workorder_selected)) + { + return SUCCESS(null); + } + + var response = _WmFgentryInspectService.SetAllQualified(workorder_selected, HttpContext.GetName()); + + return ToResponse(response); + + } + diff --git a/ZR.Model/MES/wms/WmFgentryInspect.cs b/ZR.Model/MES/wms/WmFgentryInspect.cs index f9fc88c3..b2d218aa 100644 --- a/ZR.Model/MES/wms/WmFgentryInspect.cs +++ b/ZR.Model/MES/wms/WmFgentryInspect.cs @@ -50,6 +50,12 @@ namespace ZR.Model.MES.wms /// public int? Result { get; set; } + /// + /// 是否入库(0未入,1入库) + /// + [SugarColumn(ColumnName = "bit_wm")] + public int? Bitwm { get; set; } + /// /// 创建人 /// diff --git a/ZR.Service/mes/wms/IService/IWmFgentryInspectService.cs b/ZR.Service/mes/wms/IService/IWmFgentryInspectService.cs index b434b53d..c6d8ca0c 100644 --- a/ZR.Service/mes/wms/IService/IWmFgentryInspectService.cs +++ b/ZR.Service/mes/wms/IService/IWmFgentryInspectService.cs @@ -25,6 +25,8 @@ namespace ZR.Service.mes.wms.IService int UpdateWmFgentryInspect(WmFgentryInspect parm); int BatchQualified(string[] packcode_select,string updateby); + + int SetAllQualified(string workorder_selected, string updateby); int BatchUnQualified(string[] packcode_select,string updateby); } diff --git a/ZR.Service/mes/wms/WMentryWarehousing_productService.cs b/ZR.Service/mes/wms/WMentryWarehousing_productService.cs index 5764b6bb..78ff5499 100644 --- a/ZR.Service/mes/wms/WMentryWarehousing_productService.cs +++ b/ZR.Service/mes/wms/WMentryWarehousing_productService.cs @@ -44,6 +44,7 @@ namespace ZR.Service.mes.wms } wmGood.PackageCode = Getpack_no(resultionPackage.WorkoderID, flow_num.ToString("000")); + wmGood.PackageCodeClient = resultionPackage.PatchCode; wmGood.Partnumber = resultionPackage.PartNumner; wmGood.PackageCodeOriginal = resultionPackage.originalCode; @@ -68,6 +69,28 @@ namespace ZR.Service.mes.wms } } + // 修改入库检验 为入库完成 WmFgentryInspect + UseTran2(() => + { + if(preparegoodsList!=null&& preparegoodsList.Count() > 0) { + foreach(var preparegood in preparegoodsList) + { + if (!string.IsNullOrEmpty(preparegood.PackageCode)) + { + Context.Updateable() + .SetColumns(it=>it.Bitwm==1) + .Where(it => it.Packcode == preparegood.PackageCode) + .ExecuteCommand(); + + } + + + } + + } + + }); + int result = Context.Insertable(preparegoodsList).ExecuteCommand(); return result; @@ -239,6 +262,20 @@ namespace ZR.Service.mes.wms { return "标签解析异常!"; } + //1.2 判断是否检验合格 + WmFgentryInspect inspect = Context.Queryable() + .LeftJoin((g, f) => g.PackageCode == f.Packcode) + .Where(g => g.PackageCodeClient == resultionPackage.PatchCode) + .Select((g, f) => new WmFgentryInspect() + { + Result = f.Result + + }).First(); + if (inspect == null || inspect.Result == 2) + { + return "该箱号GP12 检验不合格"; + } + // 2.判断是否已入库 bool isExistedWarehouse = Context.Queryable().Where(it => it.PackageCodeClient == resultionPackage.PatchCode).Any(); if (isExistedWarehouse) @@ -284,11 +321,11 @@ namespace ZR.Service.mes.wms } return "ok"; } - catch(Exception e) + catch (Exception e) { return "标签存在异常!"; } - + } /// diff --git a/ZR.Service/mes/wms/WmFgentryInspectService.cs b/ZR.Service/mes/wms/WmFgentryInspectService.cs index 3b9c2c8e..7ff2fc00 100644 --- a/ZR.Service/mes/wms/WmFgentryInspectService.cs +++ b/ZR.Service/mes/wms/WmFgentryInspectService.cs @@ -54,6 +54,7 @@ namespace ZR.Service.mes.wms List inspects = Queryable() .Where(predicate.ToExpression()) + .Where(it=>it.Bitwm==0) .GroupBy(it => it.Workorder) .Select(it => new WmFgentryInspect_parentDto() { @@ -100,6 +101,7 @@ namespace ZR.Service.mes.wms .AndIF(parm.endtime != null && parm.endtime > new DateTime(1999, 1, 1), it => it.CreatedTime < parm.endtime) ; var response = Queryable() + .Where(it => it.Bitwm == 0) .Where(predicate.ToExpression()) .ToPage(parm); return response; @@ -172,6 +174,22 @@ namespace ZR.Service.mes.wms } + /// + /// 设置全部批量合格 + /// + /// + /// + /// + public int SetAllQualified(string workorder_selected, string updateby) + { + return Context.Updateable() + .SetColumns(it=>it.Result==1) + .Where(it=>it.Workorder==workorder_selected) + .ExecuteCommand(); + } + + + /// /// 批量修改合格 ///