diff --git a/ZR.Admin.WebApi/Controllers/mes/wms/WMentryWarehousing_productController.cs b/ZR.Admin.WebApi/Controllers/mes/wms/WMentryWarehousing_productController.cs index 4c202de7..94161311 100644 --- a/ZR.Admin.WebApi/Controllers/mes/wms/WMentryWarehousing_productController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/wms/WMentryWarehousing_productController.cs @@ -111,7 +111,6 @@ namespace ZR.Admin.WebApi.Controllers.mes.wms string msg = ""; string createName = HttpContext.GetName(); - int num = this.wm_entryWarehousing_productService.IntoProductwarehouse(wmgoodsDto, createName); if (num == 0) { diff --git a/ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsOutProductionController.cs b/ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsOutProductionController.cs index 59d7ad9f..6503a15b 100644 --- a/ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsOutProductionController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsOutProductionController.cs @@ -120,6 +120,7 @@ namespace ZR.Admin.WebApi.Controllers [Log(Title = "按批次出库", BusinessType = BusinessType.INSERT)] public IActionResult DoPatchOutProduction([FromBody] WmBatchGoodsOutProductionDto parm) { + parm = parm.ToCreate(HttpContext); string response = _WmGoodsOutProductionService.DoPatchOutProduction(parm); if (response == "ok") { diff --git a/ZR.Admin.WebApi/Controllers/mes/wms/WmOutOrderController.cs b/ZR.Admin.WebApi/Controllers/mes/wms/WmOutOrderController.cs index dfe1efc1..4bf87f5a 100644 --- a/ZR.Admin.WebApi/Controllers/mes/wms/WmOutOrderController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/wms/WmOutOrderController.cs @@ -255,8 +255,8 @@ namespace ZR.Admin.WebApi.Controllers { return SUCCESS(null); } - - (int, int) data = _WmOutOrderService.DoMaterialOut(doMaterialOut, "PDA出库"); + string createName = HttpContext.GetName(); + (int, int) data = _WmOutOrderService.DoMaterialOut(doMaterialOut, createName); return SUCCESS(data); } diff --git a/ZR.Model/MES/wms/Dto/WmGoodsOutProductionDto.cs b/ZR.Model/MES/wms/Dto/WmGoodsOutProductionDto.cs index d85a1e2e..dcb17d25 100644 --- a/ZR.Model/MES/wms/Dto/WmGoodsOutProductionDto.cs +++ b/ZR.Model/MES/wms/Dto/WmGoodsOutProductionDto.cs @@ -105,5 +105,14 @@ namespace ZR.Model.MES.wms.Dto /// 1-传ids全部出库 2-按批次号全部出库 /// public int Type { get; set; } + + + public string UpdatedBy { get; set; } + + public DateTime? UpdatedTime { get; set; } + + public string CreatedBy { get; set; } + + public DateTime? CreatedTime { get; set; } } } \ No newline at end of file diff --git a/ZR.Model/MES/wms/Dto/WmgoodsDto.cs b/ZR.Model/MES/wms/Dto/WmgoodsDto.cs index 471bf195..9d3e1638 100644 --- a/ZR.Model/MES/wms/Dto/WmgoodsDto.cs +++ b/ZR.Model/MES/wms/Dto/WmgoodsDto.cs @@ -13,5 +13,12 @@ /// 箱子列表(原始外箱标签码) /// public string[] packagelist { set; get; } + public string CreatedBy { get; set; } + + public DateTime? CreatedTime { get; set; } + + public string UpdatedBy { get; set; } + + public DateTime? UpdatedTime { get; set; } } } diff --git a/ZR.Service/mes/wms/WMentryWarehousing_productService.cs b/ZR.Service/mes/wms/WMentryWarehousing_productService.cs index 79bcf944..4cdfe42c 100644 --- a/ZR.Service/mes/wms/WMentryWarehousing_productService.cs +++ b/ZR.Service/mes/wms/WMentryWarehousing_productService.cs @@ -300,12 +300,18 @@ namespace ZR.Service.mes.wms } - // 2.判断是否已入库 + // 2.1判断是否已入库 bool isExistedWarehouse = Context.Queryable().Where(it => it.PackageCodeClient == resultionPackage.PatchCode).Any(); if (isExistedWarehouse) { return "该箱号已入库!"; } + // 2.2判断是否有出库记录 + bool isoutWarehouse = Context.Queryable().Where(it => it.PackageCodeClient == resultionPackage.PatchCode).Any(); + if (isoutWarehouse) + { + return "该箱号已有出库记录,需要删除后再入库!"; + } // 提取库位信息 WmInfo wmInfo = Context.Queryable().Where(it => it.Location == location).First(); if (wmInfo == null) diff --git a/ZR.Service/mes/wms/WmGoodsOutProductionService.cs b/ZR.Service/mes/wms/WmGoodsOutProductionService.cs index def6c2d1..16d793eb 100644 --- a/ZR.Service/mes/wms/WmGoodsOutProductionService.cs +++ b/ZR.Service/mes/wms/WmGoodsOutProductionService.cs @@ -153,7 +153,7 @@ namespace ZR.Service.mes.wms EntryWarehouseTime = nowProduction.EntryWarehouseTime, OutTime = time, Remark = "批量出库", - CreatedBy = "batch", + CreatedBy = parm.CreatedBy ?? "batch", CreatedTime = time, }; Context.Insertable(outRecord).ExecuteCommand(); @@ -197,7 +197,7 @@ namespace ZR.Service.mes.wms EntryWarehouseTime = nowProduction.EntryWarehouseTime, OutTime = time, Remark = "批量出库", - CreatedBy = "batch", + CreatedBy = parm.CreatedBy ?? "batch", CreatedTime = time, }; Context.Insertable(outRecord).ExecuteCommand();