备件领用bug

This commit is contained in:
qianjiawei
2023-11-29 16:56:59 +08:00
parent ba7d9813b4
commit 297f90bd0c

View File

@@ -1,3 +1,4 @@
using System.Linq;
using JNPF.Common.Core.Manager;
using JNPF.Common.Dtos.VisualDev;
using JNPF.Common.Security;
@@ -117,7 +118,14 @@ namespace Tnb.EquipMgr
if (eqpSparePartsList.Count > 0)
{
_ = await db.Insertable<EqpEquipSpareParts>(eqpSparePartsList).ExecuteCommandAsync();
var datas= await db.Queryable<EqpEquipSpareParts>().ToListAsync();
foreach (var item in eqpSparePartsList)
{
if (!datas.Where(p => p.equip_id == item.equip_id && p.spare_parts_id == item.spare_parts_id).Any())
_ = await db.Insertable<EqpEquipSpareParts>(eqpSparePartsList).ExecuteCommandAsync();
}
}
}