123
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using Infrastructure.Attribute;
|
using Infrastructure.Attribute;
|
||||||
|
using JinianNet.JNTemplate;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -517,21 +518,29 @@ namespace ZR.Service.mes.wms
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
try
|
||||||
// 批量插入到 wm_polish_record 表
|
|
||||||
//如果有这个时间段的数据,要删除
|
|
||||||
List<WmPolishRecord> delwmPolishRecords = Context
|
|
||||||
.Queryable<WmPolishRecord>()
|
|
||||||
.Where(it => it.Code == "自动")
|
|
||||||
.Where(it => it.ActionTime >= parm.StartTime)
|
|
||||||
.ToList();
|
|
||||||
Context.Deleteable(delwmPolishRecords).ExecuteCommand();
|
|
||||||
if (wmPolishRecords.Any())
|
|
||||||
{
|
{
|
||||||
Context.Insertable(wmPolishRecords).ExecuteCommand();
|
Context.Ado.BeginTran();
|
||||||
|
// 批量插入到 wm_polish_record 表
|
||||||
|
//如果有这个时间段的数据,要删除
|
||||||
|
Context.Deleteable<WmPolishRecord>()
|
||||||
|
.Where(it => it.Code == "自动")
|
||||||
|
.Where(it => it.ActionTime >= parm.StartTime)
|
||||||
|
.ExecuteCommand();
|
||||||
|
if (wmPolishRecords.Any())
|
||||||
|
{
|
||||||
|
Context.Fastest<WmPolishRecord>().BulkCopy(wmPolishRecords);
|
||||||
|
//Context.Insertable(wmPolishRecords).ExecuteCommand();
|
||||||
|
}
|
||||||
|
Context.Ado.CommitTran();
|
||||||
|
return wmPolishRecords.Count; // 返回插入的记录数
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
Context.Ado.RollbackTran();
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
return wmPolishRecords.Count; // 返回插入的记录数
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user