sjz
5 天以前 5de35354e8dfcb4933350d0d1b645d400bcf23ab
MES.Service/service/BasicData/MesDepotsManager.cs
@@ -53,10 +53,10 @@
    // 插入新仓库的方法
    private bool InsertDepot(SqlSugarScope db, MesDepots entity)
    {
        var exists = db.Queryable<MesDepots>().Any(e => e.DepotId == entity.DepotId);
        var exists = db.Queryable<MesDepots>().Any(e => e.DepotId == entity.DepotId && e.DepotCode == entity.DepotCode);
        if (exists)
        {
            var result = db.Updateable<MesDepots>().ExecuteCommand();
            var result = db.Updateable(entity).Where(e => e.DepotId == entity.DepotId && e.DepotCode == entity.DepotCode).ExecuteCommand();
            return true;
        }
        else
@@ -76,10 +76,10 @@
    // 插入或更新仓库的方法
    private bool InsertOrUpdate(SqlSugarScope db, MesDepots entity)
    {
        var exists = db.Queryable<MesDepots>().Any(e => e.DepotId == entity.DepotId);
        var exists = db.Queryable<MesDepots>().Any(e => e.DepotId == entity.DepotId && e.DepotCode == entity.DepotCode);
        if (exists)
        {
            var update = db.Updateable(entity).ExecuteCommand();
            var update = db.Updateable(entity).Where(e => e.DepotId == entity.DepotId && e.DepotCode == entity.DepotCode).ExecuteCommand();
            return true;
        }
        else
@@ -156,8 +156,7 @@
    }
    // 批量更新仓库状态的方法
    private bool UpdateDepotStatusBatch(SqlSugarScope db,
        List<MesDepots> depotList, string status)
    private bool UpdateDepotStatusBatch(SqlSugarScope db,List<MesDepots> depotList, string status)
    {
        var ids = depotList.Select(it => it.DepotId).ToArray();
        var result = db.Updateable<MesDepots>().SetColumns(s => s.IsNg == status).Where(s => ids.Contains(s.DepotId)).ExecuteCommand();