From add375531bd290eb9d36ec15111e81060fabde60 Mon Sep 17 00:00:00 2001 From: "xiaowei.song" Date: Fri, 24 Nov 2023 08:45:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E5=AF=B9=E8=B1=A1=E4=B8=AD?= =?UTF-8?q?=20=E5=8E=BB=E6=8E=89=E4=BA=86=E4=B8=A4=E4=B8=AA=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=20=E5=A2=9E=E5=8A=A0=E4=BA=86=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/mes/pro/ProWorkorderController.cs | 4 ++-- .../Controllers/mes/pro/ProWorkplanController.cs | 8 +++----- .../Controllers/mes/qu/QuRoughController.cs | 2 +- ZR.Model/mes/pro/ProWorkorder.cs | 12 +++--------- ZR.Service/mes/pro/IService/IProWorkorderService.cs | 2 +- ZR.Service/mes/pro/ProWorkorderService.cs | 10 +++++----- ZR.Service/mes/qu/IService/IQuRoughService.cs | 2 +- ZR.Service/mes/qu/QuRoughService.cs | 4 ++-- 8 files changed, 18 insertions(+), 26 deletions(-) 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;