protected override bool AddLocalDataToDb(List <Jc_Ll_DInfo> addLocalItems) { addLocalItems.ForEach(o => o.Bz4 = "2"); var accumulationDModels = ObjectConverter.CopyList <Jc_Ll_DInfo, Jc_Ll_DModel>(addLocalItems); return(accumulationRepository.BulkCopy("CF_Day", accumulationDModels, BuildDataColumn(columns))); }
protected override void AddItemsToDb(List <Jc_Ll_DInfo> addItems) { try { var accumulationDModels = ObjectConverter.CopyList <Jc_Ll_DInfo, Jc_Ll_DModel>(addItems); //如果插入失败,则判断数据库连接是否成功 if (!accumulationRepository.BulkCopy("CF_Day", accumulationDModels, BuildDataColumn(columns))) { int isconn = accumulationRepository.GetTotalRecord("DataToDb_GetDbServerIsNormal"); if (isconn <= 0) { AddDataToLocal(addItems); } } } catch (Exception ex) { LogHelper.Error("累积量日表数据入库失败:" + "\r\n" + ex.Message); } }