服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-09-11 ba0b68c347de4c9214d128d0b51d3af75688d6b3
Tiger.Business/MES/Biz.Route.cs
@@ -273,20 +273,26 @@
                try
                {
                    var _route = Db.Queryable<MES_ROUTE>().Where(x => x.ROT_CODE == route.ROT_CODE).First();
                    if (_route != null && Db.Queryable<MES_ROUTE_NODE>().Where(x => x.ROT_ID == _route.ID).Any())
                    //if (_route != null && Db.Queryable<MES_ROUTE_NODE>().Where(x => x.ROT_ID == _route.ID).Any())
                    //{
                    //    result.IsSuccessed = false;
                    //    result.LocaleMsg = new($"工艺路线已经有设计记录,不能保存!");
                    //    return result;
                    //}
                    if (_route != null && Db.Queryable<MES_PROD_OPER>().Where(x => x.ROT_ID == _route.ID).Any())
                    {
                        result.IsSuccessed = false;
                        result.LocaleMsg = new($"工艺路线已经有设计记录,不能保存!");
                        result.LocaleMsg = new($"工艺路线已经有绑定记录,不能保存!");
                        return result;
                    }
                    var db = Db;
                    var dbTran = db.UseTran(() =>
                    {
                        var y = db.Storageable(route)
                           .WhereColumns(t => new { t.ROT_CODE, t.GHOST_ROW })
                           //.WhereColumns(t => new { t.ROT_CODE, t.GHOST_ROW })
                           .ToStorage();
                        y.AsInsertable.ExecuteCommand();
                        y.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand();
                        y.AsUpdateable.ExecuteCommand();
                    });
                    if (!dbTran.IsSuccess)
                    {