服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2025-01-09 454bd635d7e37aec7c48bb627129b519b4853ce6
U9C条码实体更新
已修改2个文件
267 ■■■■ 文件已修改
Tiger.Business.MES/iERP/U9C_MES.cs 239 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Model.Net/Entitys/MES/YadaU9/mes_MaterialBarCode.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.MES/iERP/U9C_MES.cs
@@ -88,49 +88,50 @@
            db = Biz.Db;
            //var dbTran = db.UseTran(() =>
            //{
                if (items.Any())
            if (items.Any())
            {
                if (items.Count > 100)
                {
                    if (items.Count > 100)
                    db.Utilities.PageEach(items, 100, pageList =>
                    {
                        db.Utilities.PageEach(items, 100, pageList =>
                        {
                            var y = db.Storageable(pageList, "U9C")
                                   .WhereColumns(t => new { t.ID, t.GHOST_ROW })
                                   .ToStorage();
                            y.AsInsertable.ExecuteCommand();
                            y.AsUpdateable.ExecuteCommand();
                        });
                    }
                    else {
                        var y = db.Storageable(items, "U9C")
                                       .WhereColumns(t => new { t.ID, t.GHOST_ROW })
                                       .ToStorage();
                        var y = db.Storageable(pageList, "U9C")
                               .WhereColumns(t => new { t.ID, t.GHOST_ROW })
                               .ToStorage();
                        y.AsInsertable.ExecuteCommand();
                        y.AsUpdateable.ExecuteCommand();
                    }
                    });
                }
                if (itemExts.Any())
                else
                {
                    if (itemExts.Count > 100)
                    {
                        db.Utilities.PageEach(itemExts, 100, pageList =>
                         {
                             var y = db.Storageable(pageList, "U9C")
                                    .WhereColumns(t => new { t.ITEM_ID, t.GHOST_ROW })
                                    .ToStorage();
                             y.AsInsertable.ExecuteCommand();
                             y.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand();
                         });
                    }
                    else
                    {
                        var s = db.Storageable(itemExts, "U9C")
                               .WhereColumns(t => new { t.ITEM_ID, t.GHOST_ROW })
                               .ToStorage();
                        s.AsInsertable.ExecuteCommand();
                        s.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand();
                    }
                    var y = db.Storageable(items, "U9C")
                                   .WhereColumns(t => new { t.ID, t.GHOST_ROW })
                                   .ToStorage();
                    y.AsInsertable.ExecuteCommand();
                    y.AsUpdateable.ExecuteCommand();
                }
            }
            if (itemExts.Any())
            {
                if (itemExts.Count > 100)
                {
                    db.Utilities.PageEach(itemExts, 100, pageList =>
                     {
                         var y = db.Storageable(pageList, "U9C")
                                .WhereColumns(t => new { t.ITEM_ID, t.GHOST_ROW })
                                .ToStorage();
                         y.AsInsertable.ExecuteCommand();
                         y.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand();
                     });
                }
                else
                {
                    var s = db.Storageable(itemExts, "U9C")
                           .WhereColumns(t => new { t.ITEM_ID, t.GHOST_ROW })
                           .ToStorage();
                    s.AsInsertable.ExecuteCommand();
                    s.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand();
                }
            }
            //});
            //if (!dbTran.IsSuccess)
            //{
@@ -243,15 +244,18 @@
                Work.DoAsync(() =>
                {
                    List<BIZ_MES_WO> woList = new();
                    foreach (var wo in items) {
                    foreach (var wo in items)
                    {
                        //只有工单状态为初始化和工艺状态为待配置才自动绑定工艺路线
                        if (wo.STATUS == BIZ_MES_WO.STATUSs.Init.GetValue() && wo.ROUTE_STATUS == BIZ_MES_WO.ROUTE_STATUSs.WaitSet.GetValue()) {
                        if (wo.STATUS == BIZ_MES_WO.STATUSs.Init.GetValue() && wo.ROUTE_STATUS == BIZ_MES_WO.ROUTE_STATUSs.WaitSet.GetValue())
                        {
                            try
                            {
                                var rot = Biz.Db.Queryable<MES_PROD_OPER>()
                                .GroupBy(x => new { x.PROD_CODE, x.ROT_ID})
                                .GroupBy(x => new { x.PROD_CODE, x.ROT_ID })
                                .Where(q => q.PROD_CODE == wo.ITEM_CODE)
                                .Select(it => new {
                                .Select(it => new
                                {
                                    PROD_CODE = it.PROD_CODE,
                                    ROT_ID = it.ROT_ID
                                })
@@ -342,28 +346,28 @@
            db = Biz.Db;
            //var dbTran = db.UseTran(() =>
            //    {
                    if (items.Any())
                    {
                        if (items.Count > 100)
                        {
                           db.Utilities.PageEach(items, 100, pageList =>
                            {
                                var y = db.Storageable(pageList, "U9C")
                                       .WhereColumns(t => new { t.CUST_CODE, t.GHOST_ROW })
                                       .ToStorage();
                                y.AsInsertable.ExecuteCommand();
                                y.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand();
                            });
                        }
                        else
                        {
                            var s = db.Storageable(items, "U9C")
                                   .WhereColumns(t => new { t.CUST_CODE, t.GHOST_ROW })
                                   .ToStorage();
                            s.AsInsertable.ExecuteCommand();
                            s.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand();
                        }
                    }
            if (items.Any())
            {
                if (items.Count > 100)
                {
                    db.Utilities.PageEach(items, 100, pageList =>
                     {
                         var y = db.Storageable(pageList, "U9C")
                                .WhereColumns(t => new { t.CUST_CODE, t.GHOST_ROW })
                                .ToStorage();
                         y.AsInsertable.ExecuteCommand();
                         y.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand();
                     });
                }
                else
                {
                    var s = db.Storageable(items, "U9C")
                           .WhereColumns(t => new { t.CUST_CODE, t.GHOST_ROW })
                           .ToStorage();
                    s.AsInsertable.ExecuteCommand();
                    s.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand();
                }
            }
            //    });
            //if (!dbTran.IsSuccess)
@@ -417,27 +421,27 @@
            //var dbTran = db.UseTran(() =>
            // {
            if (items.Any())
            {
                if (items.Count > 100)
                {
                    if (items.Count > 100)
                    db.Utilities.PageEach(items, 100, pageList =>
                    {
                        db.Utilities.PageEach(items, 100, pageList =>
                        {
                            var y = db.Storageable(pageList, "U9C")
                                   .WhereColumns(t => new { t.SUPP_CODE, t.GHOST_ROW })
                                   .ToStorage();
                            y.AsInsertable.ExecuteCommand();
                            y.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand();
                        });
                    }
                    else
                    {
                        var s = db.Storageable(items, "U9C")
                        var y = db.Storageable(pageList, "U9C")
                               .WhereColumns(t => new { t.SUPP_CODE, t.GHOST_ROW })
                               .ToStorage();
                        s.AsInsertable.ExecuteCommand();
                        s.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand();
                    }
                        y.AsInsertable.ExecuteCommand();
                        y.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand();
                    });
                }
                else
                {
                    var s = db.Storageable(items, "U9C")
                           .WhereColumns(t => new { t.SUPP_CODE, t.GHOST_ROW })
                           .ToStorage();
                    s.AsInsertable.ExecuteCommand();
                    s.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand();
                }
            }
            //});
            //if (!dbTran.IsSuccess)
@@ -495,28 +499,28 @@
            db = Biz.Db;
            //var dbTran = db.UseTran(() =>
            //{
                if (items.Any())
            if (items.Any())
            {
                if (items.Count > 100)
                {
                    if (items.Count > 100)
                    {
                      db.Utilities.PageEach(items, 100, pageList =>
                        {
                            var y = db.Storageable(pageList, "U9C")
                                   .WhereColumns(t => new { t.CUST_SN, t.GHOST_ROW })
                                   .ToStorage();
                            y.AsInsertable.ExecuteCommand();
                            y.AsUpdateable.IgnoreColumns(x => x.ID).UpdateColumns(q => new { q.CUST_CODE,q.WORK_ORDER,q.CUST_SN,q.FLOW_SN,q.ITEM_CODE,q.CREATE_TIME,q.UPDATE_TIME,q.UPDATE_USER,q.AUTH_ORG}).ExecuteCommand();
                        });
                    }
                    else
                    {
                        var s = db.Storageable(items, "U9C")
                               .WhereColumns(t => new { t.CUST_SN, t.GHOST_ROW })
                               .ToStorage();
                        s.AsInsertable.ExecuteCommand();
                        s.AsUpdateable.IgnoreColumns(x => x.ID).UpdateColumns(q => new { q.CUST_CODE, q.WORK_ORDER, q.CUST_SN, q.FLOW_SN, q.ITEM_CODE, q.CREATE_TIME, q.UPDATE_TIME, q.UPDATE_USER, q.AUTH_ORG }).ExecuteCommand();
                    }
                    db.Utilities.PageEach(items, 100, pageList =>
                      {
                          var y = db.Storageable(pageList, "U9C")
                                 .WhereColumns(t => new { t.CUST_SN, t.GHOST_ROW })
                                 .ToStorage();
                          y.AsInsertable.ExecuteCommand();
                          y.AsUpdateable.IgnoreColumns(x => x.ID).UpdateColumns(q => new { q.CUST_CODE, q.WORK_ORDER, q.CUST_SN, q.FLOW_SN, q.ITEM_CODE, q.CREATE_TIME, q.UPDATE_TIME, q.UPDATE_USER, q.AUTH_ORG }).ExecuteCommand();
                      });
                }
                else
                {
                    var s = db.Storageable(items, "U9C")
                           .WhereColumns(t => new { t.CUST_SN, t.GHOST_ROW })
                           .ToStorage();
                    s.AsInsertable.ExecuteCommand();
                    s.AsUpdateable.IgnoreColumns(x => x.ID).UpdateColumns(q => new { q.CUST_CODE, q.WORK_ORDER, q.CUST_SN, q.FLOW_SN, q.ITEM_CODE, q.CREATE_TIME, q.UPDATE_TIME, q.UPDATE_USER, q.AUTH_ORG }).ExecuteCommand();
                }
            }
            //});
            //if (!dbTran.IsSuccess)
@@ -561,7 +565,7 @@
                            UPDATE_TIME = di["ModifiedOn"].ToDateTime(),
                            PLAN_START_TIME = di["CreatedOn"].ToDateTime(),
                            STATUS = 0,
                            WS_CODE = di["DepartmentName"] == null ? "" : di["DepartmentName"].ToString(),
                            WS_CODE = di["Department"] == null ? "" : di["Department"].ToString(),
                            AUTH_ORG = orgs.Where(x => x.ID == orgId).Select(q => q.ORG_CODE).FirstOrDefault(),
                            SALES_ORDER = di["SrcDoc_SrcDocNo"] == null ? "" : di["SrcDoc_SrcDocNo"].ToString(),
                            SALES_REMARK = di["SoLineMemo"] == null ? "" : di["SoLineMemo"].ToString(),
@@ -586,28 +590,28 @@
            db = Biz.Db;
            //var dbTran = db.UseTran(() =>
            //{
                if (items.Any())
            if (items.Any())
            {
                if (items.Count > 100)
                {
                    if (items.Count > 100)
                    db.Utilities.PageEach(items, 100, pageList =>
                    {
                        db.Utilities.PageEach(items, 100, pageList =>
                        {
                            var y = db.Storageable(pageList, "U9C")
                                   .WhereColumns(t => new { t.ORDER_NO, t.GHOST_ROW })
                                   .ToStorage();
                            y.AsInsertable.ExecuteCommand();
                            y.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand();
                        });
                    }
                    else
                    {
                        var s = db.Storageable(items, "U9C")
                        var y = db.Storageable(pageList, "U9C")
                               .WhereColumns(t => new { t.ORDER_NO, t.GHOST_ROW })
                               .ToStorage();
                        s.AsInsertable.ExecuteCommand();
                        s.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand();
                    }
                        y.AsInsertable.ExecuteCommand();
                        y.AsUpdateable.IgnoreColumns(x => x.ID).UpdateColumns(q => new { q.ORDER_NO, q.ORDER_TYPE, q.PLAN_QTY, q.CUST_CODE, q.ITEM_CODE, q.CREATE_TIME, q.UPDATE_TIME, q.PLAN_START_TIME, q.STATUS, q.WS_CODE, q.AUTH_ORG, q.SALES_ORDER, q.SALES_REMARK, q.SERIAL_NO, q.SN_PREFIX, q.CUST_PREFIX, q.SALES_CONTRACT }).ExecuteCommand();
                    });
                }
                else
                {
                    var s = db.Storageable(items, "U9C")
                           .WhereColumns(t => new { t.ORDER_NO, t.GHOST_ROW })
                           .ToStorage();
                    s.AsInsertable.ExecuteCommand();
                    s.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand();
                }
            }
            //});
            //if (!dbTran.IsSuccess)
@@ -633,7 +637,8 @@
                                var rot = Biz.Db.Queryable<MES_PROD_OPER>()
                                .GroupBy(x => new { x.PROD_CODE, x.ROT_ID })
                                .Where(q => q.PROD_CODE == wo.ITEM_CODE)
                                .Select(it => new {
                                .Select(it => new
                                {
                                    PROD_CODE = it.PROD_CODE,
                                    ROT_ID = it.ROT_ID
                                })
Tiger.Model.Net/Entitys/MES/YadaU9/mes_MaterialBarCode.cs
@@ -50,17 +50,25 @@
        /// 
        /// </summary>
        public string Segment8 { get; set; }
        #endregion
        /// <summary>
        ///
        /// </summary>
        public int BarCodeCircuStatus { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string CreateEntity_EntityType { get; set; }
        #endregion
        #region 虚拟属性
        /*例子
        #region 虚拟属性
        /*例子
        [SugarColumn(IsIgnore = true)]
        public string FieldName { get; set; }
        */
        #endregion
        #endregion
        #region 枚举变量
        /*例子
        #region 枚举变量
        /*例子
        public enum FieldNames
        {
            [Description("枚举描述0")]
@@ -69,11 +77,11 @@
            Enum1,
        }
        */
        #endregion
        #endregion
        #region 公共方法
        #region 公共方法
        #endregion
        #endregion
    }//endClass
    }//endClass
}