11
啊鑫
2024-10-30 b957cfb89c9968f47cc5ce9795e6ffb05bc57fd8
MES.Service/service/BasicData/MesItemsManager.cs
@@ -23,14 +23,11 @@
                    if (UpdateItemStatus(db, entity.Id, "B"))
                        return 1;
                    break;
                case "2":
                    if (InsertItem(db, entity))
                        return 1;
                    break;
                case "3":
                    if (DeleteItem(db, entity.Id))
                        return 1;
                    break;
                case "2":
                case "4":
                    if (InsertOrUpdate(db, entity))
                        return 1;
@@ -63,14 +60,11 @@
                        if (!UpdateItemStatusBatch(db, itemGroup.Value, "B"))
                            throw new NotImplementedException("禁用失败");
                        break;
                    case "2":
                        if (!InsertItemBatch(db, itemGroup.Value))
                            throw new NotImplementedException("插入失败");
                        break;
                    case "3":
                        if (!DeleteItemBatch(db, itemGroup.Value))
                            throw new NotImplementedException("删除失败");
                        break;
                    case "2":
                    case "4":
                        if (!InsertOrUpdateBatch(db, itemGroup.Value))
                            throw new NotImplementedException("同步失败");
@@ -199,10 +193,6 @@
    private bool InsertOrUpdateBatch(SqlSugarScope db, List<MesItems> itemList)
    {
        foreach (var entity in itemList)
            if (!InsertOrUpdate(db, entity))
                return false;
        return true;
        return itemList.All(entity => InsertOrUpdate(db, entity));
    }
}