| | |
| | | using Tiger.Model.Entitys.MES.Position; |
| | | using Apache.NMS.ActiveMQ.Commands; |
| | | using System.Security.Cryptography; |
| | | using System.Diagnostics; |
| | | |
| | | namespace Tiger.Business.MES |
| | | { |
| | |
| | | } |
| | | } |
| | | Logger.Scheduler.Info($"物料信息存入实体中,总数:[{items.Count}]"); |
| | | db = Biz.Db; |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | if (items.Any()) |
| | | { |
| | | if (items.Count > 150) |
| | | if (items.Count > 100) |
| | | { |
| | | db.Utilities.PageEach(items, 1000, pageList => |
| | | db.Utilities.PageEach(items, 100, pageList => |
| | | { |
| | | var y = db.Storageable(pageList, "U9C") |
| | | .WhereColumns(t => new { t.ID, t.GHOST_ROW }) |
| | | .ToStorage(); |
| | | y.BulkCopy(); |
| | | y.BulkUpdate(); |
| | | y.AsInsertable.ExecuteCommand(); |
| | | y.AsUpdateable.ExecuteCommand(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | var s = db.Storageable(items, "U9C") |
| | | .WhereColumns(t => new { t.ID, t.GHOST_ROW }) |
| | | .ToStorage(); |
| | | s.AsInsertable.ExecuteCommand(); |
| | | s.AsUpdateable.ExecuteCommand(); |
| | | else { |
| | | 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 > 150) |
| | | if (itemExts.Count > 100) |
| | | { |
| | | db.Utilities.PageEach(itemExts, 1000, pageList => |
| | | { |
| | | var y = db.Storageable(pageList, "U9C") |
| | | .WhereColumns(t => new { t.ITEM_ID, t.GHOST_ROW }) |
| | | .ToStorage(); |
| | | y.BulkCopy(); |
| | | y.BulkUpdate(); |
| | | }); |
| | | 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.ExecuteCommand(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | |
| | | Logger.Scheduler.Error(action.Message); |
| | | } |
| | | Logger.Scheduler.Info($"物料信息存入数据库,总数:[{items.Count}]"); |
| | | action.Message = $"物料信息存入数据库,总数:[{items.Count}]"; |
| | | return action; |
| | | } |
| | | |
| | |
| | | } |
| | | Logger.Scheduler.Info($"客户信息存入实体中,总数:[{items.Count}]"); |
| | | db = Biz.Db; |
| | | var LastRun = db.Queryable<SYS_PARAM>().Where(q => q.PRMG_CODE == "Interface_LastRun" && q.PARAM_CODE == "GetCust_LastRun").Single(); |
| | | LastRun.PARAM_VALUE = (input.endTime.ToDateTime() - DateTime.Now).TotalMinutes > 0 ? LastRun.PARAM_VALUE : input.endTime; |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | db.Storageable(LastRun, "U9C_MES_GetCustomer").ExecuteCommand(); |
| | | if (items.Any()) |
| | | { |
| | | if (items.Count > 150) |
| | | if (items.Count > 100) |
| | | { |
| | | db.Utilities.PageEach(items, 1000, pageList => |
| | | db.Utilities.PageEach(items, 100, pageList => |
| | | { |
| | | var y = db.Storageable(pageList, "U9C") |
| | | .WhereColumns(t => new { t.CUST_CODE, t.GHOST_ROW }) |
| | | .ToStorage(); |
| | | y.BulkCopy(); |
| | | y.BulkUpdate(); |
| | | y.AsInsertable.ExecuteCommand(); |
| | | y.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand(); |
| | | }); |
| | | } |
| | | else |
| | |
| | | Logger.Scheduler.Error(action.Message); |
| | | } |
| | | Logger.Scheduler.Info($"客户信息存入数据库,总数:[{items.Count}]"); |
| | | action.Message = $"客户信息存入数据库,总数:[{items.Count}]"; |
| | | return action; |
| | | } |
| | | |
| | |
| | | } |
| | | Logger.Scheduler.Info($"供应商信息存入实体中,总数:[{items.Count}]"); |
| | | db = Biz.Db; |
| | | var LastRun = db.Queryable<SYS_PARAM>().Where(q => q.PRMG_CODE == "Interface_LastRun" && q.PARAM_CODE == "Vender_LastTime").Single(); |
| | | LastRun.PARAM_VALUE = (input.endTime.ToDateTime() - DateTime.Now).TotalMinutes > 0 ? LastRun.PARAM_VALUE : input.endTime; |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | db.Storageable(LastRun, "U9C_MES_GetCustomer").ExecuteCommand(); |
| | | if (items.Any()) |
| | | { |
| | | if (items.Count > 150) |
| | | if (items.Count > 100) |
| | | { |
| | | db.Utilities.PageEach(items, 1000, pageList => |
| | | db.Utilities.PageEach(items, 100, pageList => |
| | | { |
| | | var y = db.Storageable(pageList, "U9C") |
| | | .WhereColumns(t => new { t.SUPP_CODE, t.GHOST_ROW }) |
| | | .ToStorage(); |
| | | y.BulkCopy(); |
| | | y.BulkUpdate(); |
| | | y.AsInsertable.ExecuteCommand(); |
| | | y.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand(); |
| | | }); |
| | | } |
| | | else |
| | |
| | | Logger.Scheduler.Error(action.Message); |
| | | } |
| | | Logger.Scheduler.Info($"供应商信息存入数据库,总数:[{items.Count}]"); |
| | | action.Message = $"供应商信息存入数据库,总数:[{items.Count}]"; |
| | | return action; |
| | | } |
| | | |
| | |
| | | } |
| | | Logger.Scheduler.Info($"客户条码信息存入实体中,总数:[{items.Count}]"); |
| | | db = Biz.Db; |
| | | var LastRun = db.Queryable<SYS_PARAM>().Where(q => q.PRMG_CODE == "Interface_LastRun" && q.PARAM_CODE == "GetCustBar_LastTime").Single(); |
| | | LastRun.PARAM_VALUE = (input.endTime.ToDateTime() - DateTime.Now).TotalMinutes > 0 ? LastRun.PARAM_VALUE : input.endTime; |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | db.Storageable(LastRun, "U9C_MES_GetCustomer").ExecuteCommand(); |
| | | if (items.Any()) |
| | | { |
| | | if (items.Count > 150) |
| | | if (items.Count > 100) |
| | | { |
| | | db.Utilities.PageEach(items, 1000, pageList => |
| | | db.Utilities.PageEach(items, 100, pageList => |
| | | { |
| | | var y = db.Storageable(pageList, "U9C") |
| | | .WhereColumns(t => new { t.CUST_SN, t.GHOST_ROW }) |
| | | .ToStorage(); |
| | | y.BulkCopy(); |
| | | y.BulkUpdate(); |
| | | y.AsInsertable.ExecuteCommand(); |
| | | y.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand(); |
| | | }); |
| | | } |
| | | else |
| | |
| | | Logger.Scheduler.Error(action.Message); |
| | | } |
| | | Logger.Scheduler.Info($"客户条码信息存入数据库,总数:[{items.Count}]"); |
| | | action.Message = $"客户条码信息存入数据库,总数:[{items.Count}]"; |
| | | return action; |
| | | } |
| | | |
| | |
| | | { |
| | | if (items.Any()) |
| | | { |
| | | if (items.Count > 150) |
| | | if (items.Count > 100) |
| | | { |
| | | db.Utilities.PageEach(items, 1000, pageList => |
| | | db.Utilities.PageEach(items, 100, pageList => |
| | | { |
| | | var y = db.Storageable(pageList, "U9C") |
| | | .WhereColumns(t => new { t.ORDER_NO, t.GHOST_ROW }) |
| | | .ToStorage(); |
| | | y.BulkCopy(); |
| | | y.BulkUpdate(); |
| | | y.AsInsertable.ExecuteCommand(); |
| | | y.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand(); |
| | | }); |
| | | } |
| | | else |