diff --git a/ZR.Service/mes/wms/WmPolishRecordService.cs b/ZR.Service/mes/wms/WmPolishRecordService.cs index 15b287e8..99cc5b47 100644 --- a/ZR.Service/mes/wms/WmPolishRecordService.cs +++ b/ZR.Service/mes/wms/WmPolishRecordService.cs @@ -178,10 +178,12 @@ namespace ZR.Service.mes.wms .ToList(); #endregion + //int totalcount = qcQualityStatisticsFirsts.Count + wmPolishQualityStatistics.Count + qcGp12ServiceStatistics.Count + wmGp12QualityStatistics.Count + // + wmPolishWorkQualityStatistics.Count; - #region 组装 WmPolishRecord 实体 - // 组装 WmPolishRecord 实体 - List wmPolishRecords = new List(); + #region 组装 WmPolishRecord 实体 + // 组装 WmPolishRecord 实体 + List wmPolishRecords = new List(); foreach (var item in qcQualityStatisticsFirsts) { @@ -189,7 +191,7 @@ namespace ZR.Service.mes.wms new WmPolishRecord { Id = SnowFlakeSingle.Instance.NextId().ToString(), - FkInventoryId = SnowFlakeSingle.Instance.NextId().ToString(), + FkInventoryId = item.Id, Code = "自动", Partnumber = item.FinishedPartNumber, ChangeType = 1, @@ -207,7 +209,7 @@ namespace ZR.Service.mes.wms new WmPolishRecord { Id = SnowFlakeSingle.Instance.NextId().ToString(), - FkInventoryId = SnowFlakeSingle.Instance.NextId().ToString(), + FkInventoryId = item.Id, Code = "自动", Partnumber = item.Partnumber, ChangeType = 1, @@ -225,8 +227,8 @@ namespace ZR.Service.mes.wms new WmPolishRecord { Id = SnowFlakeSingle.Instance.NextId().ToString(), - FkInventoryId = SnowFlakeSingle.Instance.NextId().ToString(), - Code = "自动", + FkInventoryId = item.Id, + Code = "自动", Partnumber = item.PartNumber, ChangeType = 1, ChangeQuantity = item.PolishNumber, @@ -243,8 +245,8 @@ namespace ZR.Service.mes.wms new WmPolishRecord { Id = SnowFlakeSingle.Instance.NextId().ToString(), - FkInventoryId = SnowFlakeSingle.Instance.NextId().ToString(), - Code = "自动", + FkInventoryId = item.Id, + Code = "自动", Partnumber = item.Partnumber, ChangeType = 1, ChangeQuantity = item.PaoguangTotal, @@ -261,14 +263,14 @@ namespace ZR.Service.mes.wms new WmPolishRecord { Id = SnowFlakeSingle.Instance.NextId().ToString(), - FkInventoryId = SnowFlakeSingle.Instance.NextId().ToString(), + FkInventoryId = item.Id, Code = "自动", Partnumber = item.Partnumber, ChangeType = 2, ChangeQuantity = item.RequireNumber, ActionTime = item.StartTime, Status = 1, - Remark = " 根据日期范围 去取抛光操作出库的数据" + Remark = " 根据日期范围 去取抛光操作出库的数据" } ); } @@ -280,7 +282,7 @@ namespace ZR.Service.mes.wms List delwmPolishRecords = Context .Queryable() .Where(it => it.Code == "自动") - .Where(it => it.CreatedTime >= parm.StartTime && it.CreatedTime <= parm.EndTime) + .Where(it => it.ActionTime >= parm.StartTime && it.ActionTime <= parm.EndTime) .ToList(); Context.Deleteable(delwmPolishRecords).ExecuteCommand();