diff --git a/AMESCoreStudio.Web/Controllers/BASController.cs b/AMESCoreStudio.Web/Controllers/BASController.cs index dcd3abb6..da3fdcf9 100644 --- a/AMESCoreStudio.Web/Controllers/BASController.cs +++ b/AMESCoreStudio.Web/Controllers/BASController.cs @@ -2030,16 +2030,29 @@ namespace AMESCoreStudio.Web.Controllers [HttpPost] public async Task BAS012SaveAsync(MaterialFlow model) { + var userID = ""; + HttpContext.Request.Cookies.TryGetValue("UserID", out userID); + int user_id = 0; + if (userID != null) + { + if (int.Parse(userID.ToString()) >= 0) + { + user_id = int.Parse(userID.ToString()); + } + } if (ModelState.IsValid) { IResultModel result; if (model.MFID == 0) { + model.CreateUserID = user_id; result = await _basApi.PostMaterialFlows(JsonConvert.SerializeObject(model)); } else { + model.UpdateUserID = user_id; + result = await _basApi.PutMaterialFlows(model.MFID, JsonConvert.SerializeObject(model)); } diff --git a/AMESCoreStudio.Web/Views/BAS/BAS012U.cshtml b/AMESCoreStudio.Web/Views/BAS/BAS012U.cshtml index 325bfa48..d1efd435 100644 --- a/AMESCoreStudio.Web/Views/BAS/BAS012U.cshtml +++ b/AMESCoreStudio.Web/Views/BAS/BAS012U.cshtml @@ -18,7 +18,7 @@ - + diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs index 98d97edc..c736cb98 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs @@ -1532,7 +1532,7 @@ FROM [SFIS].[dbo].[ZPDKeyPart] B WHERE B.[IsActive] = 1 AND B.[ProductSN] = (S q1.LineID, q1.FlowRuleID, q1.StatusNO, - q1.CreateDate, + q1.WipScheduleDate, q2.ItemNO, q2.ModelNO, q3.LineDesc, @@ -1563,7 +1563,7 @@ FROM [SFIS].[dbo].[ZPDKeyPart] B WHERE B.[IsActive] = 1 AND B.[ProductSN] = (S } if (dateStart != null && dateStart != "" && dateEnd != null && dateEnd != "") { - q = q.Where(w => w.CreateDate >= DateTime.Parse(dateStart) && w.CreateDate <= DateTime.Parse(dateEnd).AddDays(1)); + q = q.Where(w => w.WipScheduleDate >= DateTime.Parse(dateStart) && w.WipScheduleDate <= DateTime.Parse(dateEnd).AddDays(1)); } //紀錄筆數 diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipStationController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipStationController.cs index 4187500e..871e39d3 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipStationController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipStationController.cs @@ -219,7 +219,7 @@ FROM JHAMES.WIP_STATION"; q1.StationID, q1.RuleStatus, q1.FirstCnt, - q1.CreateDate + q2.WipScheduleDate }; if (itemNo != null) @@ -245,7 +245,7 @@ FROM JHAMES.WIP_STATION"; { if (dateStart != "" && dateEnd != "") { - q = q.Where(w => w.CreateDate >= DateTime.Parse(dateStart) && w.CreateDate <= DateTime.Parse(dateEnd)); + q = q.Where(w => w.WipScheduleDate >= DateTime.Parse(dateStart) && w.WipScheduleDate <= DateTime.Parse(dateEnd)); } } @@ -295,7 +295,7 @@ FROM JHAMES.WIP_STATION"; q4.StationName, q1.RuleStatus, q1.FirstCnt, - q1.CreateDate + q2.WipScheduleDate }; q = q.Where(w => w.CustomerMedical == "N" && w.UnitNO == "S"); @@ -324,7 +324,7 @@ FROM JHAMES.WIP_STATION"; { if (dateStart != "" && dateEnd != "") { - q = q.Where(w => w.CreateDate >= DateTime.Parse(dateStart) && w.CreateDate <= DateTime.Parse(dateEnd)); + q = q.Where(w => w.WipScheduleDate >= DateTime.Parse(dateStart) && w.WipScheduleDate <= DateTime.Parse(dateEnd)); } } @@ -375,7 +375,7 @@ FROM JHAMES.WIP_STATION"; q4.StationName, q1.RuleStatus, q1.FirstCnt, - q1.CreateDate + q2.WipScheduleDate }; q = q.Where(w => w.CustomerMedical == "N" && w.UnitNO == "B"); @@ -404,7 +404,7 @@ FROM JHAMES.WIP_STATION"; { if (dateStart != "" && dateEnd != "") { - q = q.Where(w => w.CreateDate >= DateTime.Parse(dateStart) && w.CreateDate <= DateTime.Parse(dateEnd)); + q = q.Where(w => w.WipScheduleDate >= DateTime.Parse(dateStart) && w.WipScheduleDate <= DateTime.Parse(dateEnd)); } } @@ -455,7 +455,7 @@ FROM JHAMES.WIP_STATION"; q4.StationName, q1.RuleStatus, q1.FirstCnt, - q1.CreateDate + q2.WipScheduleDate }; q = q.Where(w => w.CustomerMedical == "Y"); @@ -484,7 +484,7 @@ FROM JHAMES.WIP_STATION"; { if (dateStart != "" && dateEnd != "") { - q = q.Where(w => w.CreateDate >= DateTime.Parse(dateStart) && w.CreateDate <= DateTime.Parse(dateEnd)); + q = q.Where(w => w.WipScheduleDate >= DateTime.Parse(dateStart) && w.WipScheduleDate <= DateTime.Parse(dateEnd)); } }