This commit is contained in:
qianhao.xu 2024-08-30 16:51:51 +08:00
parent c15cb5d6e7
commit 64afa6a8ca

View File

@ -199,7 +199,7 @@ namespace DOAN.Service.MES.product
int result = 0;
proWorkorder.Id = XueHua;
proWorkorder.WorkorderDate = proWorkorder.WorkorderDate.Value.Date;
if(!string.IsNullOrEmpty(next_id))
if(!string.IsNullOrEmpty(next_id)&&next_id!="-1")
{
UseTran2(() =>
{
@ -219,9 +219,12 @@ namespace DOAN.Service.MES.product
}
else
{
int sortNum = Context.Queryable<ProWorkorder>().Max(it => it.Sort.Value);
DateTime dateOnly= proWorkorder.WorkorderDate.Value.Date;
int sortNum = Context.Queryable<ProWorkorder>().Where(it=>it.WorkorderDate== dateOnly).Max(it => it.Sort.Value);
proWorkorder.Sort = sortNum+10;
proWorkorder.Status = 1;
Context.Insertable(proWorkorder).ExecuteCommand();