工单操作
This commit is contained in:
@@ -49,8 +49,8 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
int data = 0;
|
||||
if (proWorkplan!=null)
|
||||
{
|
||||
data = proWorkplanService.AddWorkPlan(proWorkplan);
|
||||
proWorkplan.ToCreate(HttpContext);
|
||||
data = proWorkplanService.AddWorkPlan(proWorkplan);
|
||||
}
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
@@ -67,8 +67,9 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
int data = 0;
|
||||
if (proWorkplan != null)
|
||||
{
|
||||
data = proWorkplanService.UpdateWorkPlan(proWorkplan);
|
||||
proWorkplan.ToUpdate(HttpContext);
|
||||
data = proWorkplanService.UpdateWorkPlan(proWorkplan);
|
||||
|
||||
}
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
@@ -108,5 +109,60 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", lst));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增生产工单
|
||||
/// </summary>
|
||||
/// <param name="proWorkorder">生产工单对象</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("addworkorder")]
|
||||
public IActionResult AddWorkorder([FromBody] ProWorkorder proWorkorder)
|
||||
{
|
||||
int data = 0;
|
||||
if (proWorkorder != null)
|
||||
{
|
||||
proWorkorder.ToCreate(HttpContext);
|
||||
data = proWorkplanService.AddWorkorder(proWorkorder);
|
||||
|
||||
}
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新生产工单
|
||||
/// </summary>
|
||||
/// <param name="proWorkorder">生产工单对象</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("updateworkplan")]
|
||||
public IActionResult UpdateWorkorder([FromBody] ProWorkorder proWorkorder)
|
||||
{
|
||||
int data = 0;
|
||||
if (proWorkorder != null)
|
||||
{
|
||||
proWorkorder.ToUpdate(HttpContext);
|
||||
data = proWorkplanService.UpdateWorkorder(proWorkorder);
|
||||
|
||||
}
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除生产工单
|
||||
/// </summary>
|
||||
/// <param name="id">工单ID</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("deleteworkorder/{id}")]
|
||||
public IActionResult DeleteWorkorder(string id)
|
||||
{
|
||||
int data = 0;
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
data = proWorkplanService.DeleteWorkPlan(id);
|
||||
}
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,5 +21,11 @@ namespace ZR.Service.mes.pro.IService
|
||||
public int DeleteWorkPlan(string id);
|
||||
|
||||
public List<ProWorkorder> GetWorkorderList(string id);
|
||||
|
||||
public int AddWorkorder(ProWorkorder proWorkorder);
|
||||
|
||||
public int UpdateWorkorder(ProWorkorder proWorkorder);
|
||||
|
||||
public int DeleteWorkorder(string id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,5 +54,21 @@ namespace ZR.Service.mes.pro
|
||||
{
|
||||
return Context.Queryable<ProWorkorder>().Where(it => it.FkProPlanId == id).ToList();
|
||||
}
|
||||
|
||||
public int AddWorkorder(ProWorkorder proWorkorder)
|
||||
{
|
||||
proWorkorder.Id = DateTime.Now.ToString("yyyyMMddHHmmss");
|
||||
return Context.Insertable(proWorkorder).ExecuteCommand();
|
||||
}
|
||||
|
||||
public int UpdateWorkorder(ProWorkorder proWorkorder)
|
||||
{
|
||||
return Context.Updateable(proWorkorder).ExecuteCommand();
|
||||
}
|
||||
|
||||
public int DeleteWorkorder(string id)
|
||||
{
|
||||
return Context.Deleteable<ProWorkorder>().In(id).ExecuteCommand();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user