kyy
2025-08-11 a2eed1b966a6700530814f3f468a7258f8b4f9b8
MES.Service/service/BasicData/MesItemTypeManager.cs
@@ -32,6 +32,17 @@
    private bool InsertItemType(MesItemType entity)
    {
        // 先根据ID删除现有记录
        try
        {
            Db.Deleteable<MesItemType>()
                .Where(it => it.Id == entity.Id).ExecuteCommand();
        }
        catch (Exception)
        {
            // 删除失败可能是因为记录不存在,继续执行插入操作
        }
        var insert = base.Insert(entity);
        if (insert)
            return true;