啊鑫
2024-10-23 77a6ef8c94bd440919e4b925485215ae92190d81
接口修正
已修改9个文件
93 ■■■■■ 文件已修改
MES.Service/Dto/webApi/ErpItemType.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/BasicData/MesCustomerManager.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/BasicData/MesDepotsManager.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/BasicData/MesItemTypeManager.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/BasicData/MesItemsManager.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/BasicData/MesSupplierManager.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/BasicData/MesUnitManager.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/BasicData/OrganizeManager.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/BasicData/SysDepartmentManager.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/Dto/webApi/ErpItemType.cs
@@ -4,7 +4,7 @@
{
    public string? Type { get; set; }
    public string Id { get; set; }
    public string? FPARENTID { get; set; }
    public string? FParentId { get; set; }
    public string? FNumber { get; set; }
    public string? FName { get; set; }
MES.Service/service/BasicData/MesCustomerManager.cs
@@ -139,7 +139,8 @@
            LastupdateDate = DateTime.Now,
            Company = "1000",
            Factory = "1000",
            DataType = customer.FDocumentStatus
            DataType = customer.FDocumentStatus,
            Type = customer.Type
        };
    }
@@ -186,19 +187,12 @@
        var insert = db.Insertable(entity).ExecuteCommand();
        if (insert > 0)
            return true;
        return false;
        return insert > 0;
    }
    private bool InsertOrUpdateBatch(SqlSugarScope db,
        List<MesCustomer> customerList)
    {
        foreach (var entity in customerList)
            if (!InsertOrUpdate(db, entity))
                return false;
        return true;
        return customerList.All(entity => InsertOrUpdate(db, entity));
    }
}
MES.Service/service/BasicData/MesDepotsManager.cs
@@ -71,8 +71,8 @@
    // 删除仓库的方法
    private bool DeleteDepot(SqlSugarScope db, decimal depotId)
    {
        var deleteById = db.Deleteable<MesDepots>().In(depotId)
            .ExecuteCommand();
        var deleteById = db.Deleteable<MesDepots>()
            .Where(s => s.DepotId == depotId).ExecuteCommand();
        if (deleteById > 0)
            return true;
@@ -195,7 +195,8 @@
    {
        var ids = depotList.Select(it => it.DepotId).ToArray();
        var deleteByIds =
            db.Deleteable<MesDepots>().In(ids).ExecuteCommand();
            db.Deleteable<MesDepots>()
                .Where(s => ids.Contains(s.DepotId)).ExecuteCommand();
        if (deleteByIds > 0)
            return true;
@@ -206,10 +207,6 @@
    private bool InsertOrUpdateBatch(SqlSugarScope db,
        List<MesDepots> depotList)
    {
        foreach (var entity in depotList)
            if (!InsertOrUpdate(db, entity))
                return false;
        return true;
        return depotList.All(entity => InsertOrUpdate(db, entity));
    }
}
MES.Service/service/BasicData/MesItemTypeManager.cs
@@ -54,7 +54,7 @@
        return new MesItemType
        {
            Id = Convert.ToDecimal(department.Id),
            Pgroup = department.FPARENTID,
            Pgroup = department.FParentId,
            Tcode = department.FNumber,
            Tname = department.FName,
            Description = department.FDescription,
MES.Service/service/BasicData/MesItemsManager.cs
@@ -199,10 +199,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));
    }
}
MES.Service/service/BasicData/MesSupplierManager.cs
@@ -166,7 +166,8 @@
        List<MesSupplier> supplierList)
    {
        var ids = supplierList.Select(it => it.Id).ToArray();
        var deleteByIds = db.Deleteable<MesSupplier>().In(ids).ExecuteCommand();
        var deleteByIds = db.Deleteable<MesSupplier>()
            .Where(s=>ids.Contains(s.Id)).ExecuteCommand();
        if (deleteByIds > 0)
            return true;
@@ -188,10 +189,6 @@
    private bool InsertOrUpdateBatch(SqlSugarScope db,
        List<MesSupplier> supplierList)
    {
        foreach (var entity in supplierList)
            if (!InsertOrUpdate(db, entity))
                return false;
        return true;
        return supplierList.All(entity => InsertOrUpdate(db, entity));
    }
}
MES.Service/service/BasicData/MesUnitManager.cs
@@ -108,7 +108,8 @@
    private bool DeleteUnit(SqlSugarScope db, decimal unitId)
    {
        var deleteById = db.Deleteable<MesUnit>().In(unitId).ExecuteCommand();
        var deleteById = db.Deleteable<MesUnit>()
            .Where(s => s.Id == unitId).ExecuteCommand();
        if (deleteById > 0)
            return true;
@@ -134,7 +135,8 @@
            CreateDate = DateTime.Now,
            LastupdateDate = DateTime.Now,
            Company = "1000",
            Factory = "1000"
            Factory = "1000",
            Type = unit.Type
        };
    }
@@ -164,35 +166,21 @@
    private bool DeleteUnitBatch(SqlSugarScope db, List<MesUnit> unitList)
    {
        var ids = unitList.Select(it => it.Id).ToArray();
        var deleteByIds = db.Deleteable<MesUnit>().In(ids).ExecuteCommand();
        var deleteByIds = db.Deleteable<MesUnit>()
            .Where(s => ids.Contains(s.Id)).ExecuteCommand();
        return deleteByIds > 0;
    }
    private bool InsertOrUpdate(SqlSugarScope db, MesUnit entity)
    {
        var exists = db.Queryable<MesUnit>().Any(e => e.Id == entity.Id);
        if (exists)
        {
            var update = db.Updateable(entity).ExecuteCommand();
            if (update > 0)
                return true;
        }
        else
        {
            var insert = db.Insertable(entity).ExecuteCommand();
            if (insert > 0)
                return true;
        }
        return false;
        db.Deleteable<MesUnit>()
            .Where(s => s.Id == entity.Id).ExecuteCommand();
        var insert = db.Insertable(entity).ExecuteCommand();
        return insert > 0;
    }
    private bool InsertOrUpdateBatch(SqlSugarScope db, List<MesUnit> unitList)
    {
        foreach (var entity in unitList)
            if (!InsertOrUpdate(db, entity))
                return false;
        return true;
        return unitList.All(entity => InsertOrUpdate(db, entity));
    }
}
MES.Service/service/BasicData/OrganizeManager.cs
@@ -176,10 +176,6 @@
    private bool InsertOrUpdateBatch(SqlSugarScope db,
        List<SysOrganization> itemList)
    {
        foreach (var entity in itemList)
            if (!InsertOrUpdate(db, entity))
                return false;
        return true;
        return itemList.All(entity => InsertOrUpdate(db, entity));
    }
}
MES.Service/service/BasicData/SysDepartmentManager.cs
@@ -215,10 +215,7 @@
    private bool InsertOrUpdateDepartmentBatch(SqlSugarScope db,
        List<SysDepartment> departmentList)
    {
        foreach (var entity in departmentList)
            if (!InsertOrUpdateDepartment(db, entity))
                return false;
        return true;
        return departmentList.All(
            entity => InsertOrUpdateDepartment(db, entity));
    }
}