提交
This commit is contained in:
@@ -22,9 +22,9 @@ namespace ZR.Service.mes.pro.IService
|
||||
/// <returns></returns>
|
||||
public List<ProWorkplan> GetProWorkplanById(string id);
|
||||
|
||||
public int AddWorkPlan(ProWorkplan proWorkplan);
|
||||
public int AddWorkPlan(ProWorklplan_v2 proWorkplan);
|
||||
|
||||
public int UpdateWorkPlan(ProWorkplan proWorkplan);
|
||||
public int UpdateWorkPlan(ProWorklplan_v2 proWorkplan);
|
||||
|
||||
public int DeleteWorkPlan(string id);
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Infrastructure.Attribute;
|
||||
using Mapster.Utils;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Model.DBModel;
|
||||
using SqlSugar;
|
||||
@@ -39,21 +40,30 @@ namespace ZR.Service.mes.pro
|
||||
return Context.Queryable<ProWorkplan>().Where(it => it.Id == id).ToList();
|
||||
}
|
||||
|
||||
public int AddWorkPlan(ProWorkplan proWorkplan)
|
||||
public int AddWorkPlan(ProWorklplan_v2 proWorkplan)
|
||||
{
|
||||
ProWorklplan_v2 max_workplan = Context.Queryable<ProWorklplan_v2>().OrderBy(it => it.Id, OrderByType.Desc).First();
|
||||
if (max_workplan != null && !string.IsNullOrEmpty(max_workplan.Id) && max_workplan.Id.Substring(2, 8) == DateTime.Now.ToString("yyyyMMdd"))
|
||||
{
|
||||
int num = Convert.ToInt32(max_workplan.Id.Substring(10)) + 1;
|
||||
proWorkplan.Id = "MP" + DateTime.Now.ToString("yyyyMMdd") + num.ToString("000");
|
||||
}
|
||||
else
|
||||
{
|
||||
proWorkplan.Id = "MP" + DateTime.Now.ToString("yyyyMMdd") + "001";
|
||||
}
|
||||
|
||||
proWorkplan.Id = DateTime.Now.ToString("yyyyMMddHHmmss");
|
||||
return Context.Insertable(proWorkplan).ExecuteCommand();
|
||||
}
|
||||
|
||||
public int UpdateWorkPlan(ProWorkplan proWorkplan)
|
||||
public int UpdateWorkPlan(ProWorklplan_v2 proWorkplan)
|
||||
{
|
||||
return Context.Updateable(proWorkplan).ExecuteCommand();
|
||||
}
|
||||
|
||||
public int DeleteWorkPlan(string id)
|
||||
{
|
||||
return Context.Deleteable<ProWorkplan>().In(id).ExecuteCommand();
|
||||
return Context.Deleteable<ProWorklplan_v2>().In(id).ExecuteCommand();
|
||||
}
|
||||
|
||||
public List<ProWorkorder> GetWorkorderListByPlanId(string id)
|
||||
|
||||
Reference in New Issue
Block a user