diff --git a/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkorderController.cs b/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkorderController.cs
index 18dc8724..f2ce99e4 100644
--- a/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkorderController.cs
+++ b/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkorderController.cs
@@ -92,6 +92,21 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
return ToResponse(new ApiResult(200, "success", data));
}
+
+ ///
+ /// 下达生产指令
+ ///
+ /// 工单ID
+ ///
+ [HttpGet("releaseProduction/{id}")]
+ public IActionResult ReleaseProduction(string id)
+ {
+
+ int data = proWorkorderService.ReleaseProduction(id);
+
+ return ToResponse(new ApiResult(200, "success", data));
+ }
+
///
/// 对当前的,排产工单排序
///
diff --git a/ZR.Service/mes/pro/IService/IProWorkorderService.cs b/ZR.Service/mes/pro/IService/IProWorkorderService.cs
index 0d06f69e..d4846945 100644
--- a/ZR.Service/mes/pro/IService/IProWorkorderService.cs
+++ b/ZR.Service/mes/pro/IService/IProWorkorderService.cs
@@ -18,5 +18,8 @@ namespace ZR.Service.mes.pro.IService
public int ResetWorkorderSechedule(string id);
public int SortWorkorderSchedule(string id, int sort);
+
+ public int ReleaseProduction(string id);
+
}
}
diff --git a/ZR.Service/mes/pro/ProWorkorderService.cs b/ZR.Service/mes/pro/ProWorkorderService.cs
index 17dd08d3..575dba7c 100644
--- a/ZR.Service/mes/pro/ProWorkorderService.cs
+++ b/ZR.Service/mes/pro/ProWorkorderService.cs
@@ -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") })
+ .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" })
.Where(it => it.Id.Equals(id))
.ExecuteCommand();
}
@@ -74,5 +74,13 @@ namespace ZR.Service.mes.pro
.Where(it => it.Id.Equals(id))
.ExecuteCommand();
}
+
+ public int ReleaseProduction(string id)
+ {
+ return Context.Updateable()
+ .SetColumns(it => it.Isproduction == "1")
+ .Where(it => it.Id.Equals(id))
+ .ExecuteCommand();
+ }
}
}