diff --git a/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkorderController.cs b/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkorderController.cs index f2ce99e4..3fbfb0cc 100644 --- a/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkorderController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkorderController.cs @@ -39,7 +39,7 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro [HttpGet("getworkorderListwithoutschedule")] public IActionResult GetWorkorderListWithoutSchedule(int pageNum, int pageSize, int year = -1, int week = -1, int date = -1) { - (List, int) data = proWorkorderService.GetWorkorderList(pageNum, pageSize, year, week, date, "0"); + (List, int) data = proWorkorderService.GetWorkorderList(pageNum, pageSize, year, week, date, 0); return ToResponse(new ApiResult(200, "success", data)); } @@ -56,7 +56,7 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro [HttpGet("getworkorderListwithschedule")] public IActionResult GetWorkorderListWithSchedule(int pageNum, int pageSize, int year = -1, int week = -1, int date = -1) { - (List, int) data = proWorkorderService.GetWorkorderList(pageNum, pageSize, year, week, date, "1"); + (List, int) data = proWorkorderService.GetWorkorderList(pageNum, pageSize, year, week, date, 1); return ToResponse(new ApiResult(200, "success", data)); } diff --git a/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkplanController.cs b/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkplanController.cs index 911e9f4a..89f4d2f1 100644 --- a/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkplanController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkplanController.cs @@ -200,7 +200,8 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro { if(item.Id.Equals(workorderId)) // 找到当前工单ID的对象 { - if(!string.IsNullOrEmpty(item.Isarrange)) isArrange = item.Isarrange; + //if(!string.IsNullOrEmpty(item.Wrokerorder_status)) isArrange = item.Isarrange; + isArrange = item.Wrokerorder_status.ToString(); currentWorkorder = item; break; } @@ -268,10 +269,7 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro string isArrange = "0"; // 排产状态非空 - if (!string.IsNullOrEmpty(lstWorkorder[0].Isarrange)) - { - isArrange = lstWorkorder[0].Isarrange; - } + isArrange = lstWorkorder[0].Wrokerorder_status.ToString(); // 排产状态为 0 ,可执行删除 if ("0".Equals(isArrange)) diff --git a/ZR.Admin.WebApi/Controllers/mes/qu/QuRoughController.cs b/ZR.Admin.WebApi/Controllers/mes/qu/QuRoughController.cs index 6b6985bb..b4e6cc7f 100644 --- a/ZR.Admin.WebApi/Controllers/mes/qu/QuRoughController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/qu/QuRoughController.cs @@ -35,7 +35,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.qu [HttpGet("getworkorderList")] public IActionResult GetWorkorderList(int pageNum, int pageSize, int year = -1, int week = -1, int date = -1) { - (List, int) data = quRoughService.GetWorkorderList(pageNum, pageSize, year, week, date, "1"); + (List, int) data = quRoughService.GetWorkorderList(pageNum, pageSize, year, week, date, 1); return ToResponse(new ApiResult(200, "success", data)); } diff --git a/ZR.Model/mes/pro/ProWorkorder.cs b/ZR.Model/mes/pro/ProWorkorder.cs index e5794897..2aa0ff2d 100644 --- a/ZR.Model/mes/pro/ProWorkorder.cs +++ b/ZR.Model/mes/pro/ProWorkorder.cs @@ -40,16 +40,10 @@ namespace ZR.Model.mes.pro public int? Date { get; set; } /// - /// 是否已经生产 + /// 工单状态 /// - [SugarColumn(ColumnName = "isproduction")] - public string Isproduction { get; set; } - - /// - /// 是否已经排程 - /// - [SugarColumn(ColumnName = "isarrange")] - public string Isarrange { get; set; } + [SugarColumn(ColumnName = "wrokerorder_status")] + public int Wrokerorder_status { get; set; } /// diff --git a/ZR.Service/mes/pro/IService/IProWorkorderService.cs b/ZR.Service/mes/pro/IService/IProWorkorderService.cs index d4846945..d0bde9c0 100644 --- a/ZR.Service/mes/pro/IService/IProWorkorderService.cs +++ b/ZR.Service/mes/pro/IService/IProWorkorderService.cs @@ -11,7 +11,7 @@ namespace ZR.Service.mes.pro.IService { public interface IProWorkorderService { - public (List, int) GetWorkorderList(int pageNum, int pageSize, int year, int week,int date,string isSchedule); + public (List, int) GetWorkorderList(int pageNum, int pageSize, int year, int week,int date, int isSchedule); public int SetWorkorderSechedule(string id, DateTime arrange_starttime, DateTime arrange_endtime); diff --git a/ZR.Service/mes/pro/ProWorkorderService.cs b/ZR.Service/mes/pro/ProWorkorderService.cs index 575dba7c..86162dad 100644 --- a/ZR.Service/mes/pro/ProWorkorderService.cs +++ b/ZR.Service/mes/pro/ProWorkorderService.cs @@ -19,14 +19,14 @@ namespace ZR.Service.mes.pro public class ProWorkorderService : BaseService, IProWorkorderService { - public (List, int) GetWorkorderList(int pageNum, int pageSize, int year, int week, int date, string isSchedule) + public (List, int) GetWorkorderList(int pageNum, int pageSize, int year, int week, int date, int isSchedule) { var predicate = Expressionable.Create() .AndIF(year > 0, it => it.Year == year) .AndIF(week > 0, it => it.Week == week) .AndIF(date > 0, it => it.Date == date) - .And(it => it.Isarrange.Equals(isSchedule)) + .And(it => it.Wrokerorder_status.Equals(isSchedule)) .ToExpression(); int totalCount = 0; @@ -53,7 +53,7 @@ namespace ZR.Service.mes.pro TimeSpan productionTime = arrange_endtime - arrange_starttime; return Context.Updateable() - .SetColumns(it => new ProWorkorder() { ArrangeStarttime = arrange_starttime, ArrangeEndtime = arrange_endtime, Isarrange = "1", ProductionTime = (decimal)productionTime.TotalMinutes,Order=(int) CacheHelper.GetCache("workorder_id_max"),Isproduction="0" }) + .SetColumns(it => new ProWorkorder() { ArrangeStarttime = arrange_starttime, ArrangeEndtime = arrange_endtime, Wrokerorder_status = 1, ProductionTime = (decimal)productionTime.TotalMinutes,Order=(int) CacheHelper.GetCache("workorder_id_max") }) .Where(it => it.Id.Equals(id)) .ExecuteCommand(); } @@ -61,7 +61,7 @@ namespace ZR.Service.mes.pro public int ResetWorkorderSechedule(string id) { return Context.Updateable() - .SetColumns(it => it.Isarrange == "0") + .SetColumns(it => it.Wrokerorder_status == 0) .SetColumns(it => it.Order == 0) .Where(it => it.Id.Equals(id)) .ExecuteCommand(); @@ -78,7 +78,7 @@ namespace ZR.Service.mes.pro public int ReleaseProduction(string id) { return Context.Updateable() - .SetColumns(it => it.Isproduction == "1") + .SetColumns(it => it.Wrokerorder_status == 1) .Where(it => it.Id.Equals(id)) .ExecuteCommand(); } diff --git a/ZR.Service/mes/qu/IService/IQuRoughService.cs b/ZR.Service/mes/qu/IService/IQuRoughService.cs index 10882ee0..1a208121 100644 --- a/ZR.Service/mes/qu/IService/IQuRoughService.cs +++ b/ZR.Service/mes/qu/IService/IQuRoughService.cs @@ -11,6 +11,6 @@ namespace ZR.Service.mes.qu.IService { public interface IQuRoughService { - public (List, int) GetWorkorderList(int pageNum, int pageSize, int year, int week, int date, string isSchedule); + public (List, int) GetWorkorderList(int pageNum, int pageSize, int year, int week, int date, int isSchedule); } } diff --git a/ZR.Service/mes/qu/QuRoughService.cs b/ZR.Service/mes/qu/QuRoughService.cs index 07530036..92322482 100644 --- a/ZR.Service/mes/qu/QuRoughService.cs +++ b/ZR.Service/mes/qu/QuRoughService.cs @@ -18,13 +18,13 @@ namespace ZR.Service.mes.qu public class QuRoughService : BaseService, IQuRoughService { - public (List, int) GetWorkorderList(int pageNum, int pageSize, int year, int week, int date, string isSchedule) + public (List, int) GetWorkorderList(int pageNum, int pageSize, int year, int week, int date, int isSchedule) { var predicate = Expressionable.Create() .AndIF(year > 0, it => it.Year == year) .AndIF(week > 0, it => it.Week == week) .AndIF(date > 0, it => it.Date == date) - .AndIF(date > 0, it => it.Isarrange.Equals(isSchedule)) + .AndIF(date > 0, it => it.Wrokerorder_status==isSchedule) .ToExpression(); int totalCount = 0;