public Tuple <bool, bool> AddBatteryFastDelivery(BatteryFastDeliveryModel model, List <BatteryFastDeliveryProductsModel> productModels)
        {
            var result      = false;
            var cacheResult = true;

            try
            {
                dbScopeManagerConfig.CreateTransaction(conn =>
                {
                    var fastDeliveryId = DalBatteryFastDelivery.AddBatteryFastDelivery(conn, model);
                    if (fastDeliveryId > 0)
                    {
                        if (productModels != null && productModels.Any())
                        {
                            foreach (var productModel in productModels)
                            {
                                productModel.FastDeliveryId = fastDeliveryId;
                                var insertResult            = DalBatteryFastDelivery.AddBatteryFastDeliveryProducts(conn, productModel);
                            }
                            cacheResult = RefreshFastDeliveryServiceCache(model.RegionId, productModels.Select(s => s.ProductPid).ToList());
                        }
                        result = true;
                    }
                });
            }
            catch (Exception ex)
            {
                Logger.Error("AddBatteryFastDelivery", ex);
            }
            return(Tuple.Create(result, cacheResult));
        }
        /// <summary>
        /// 更新蓄电池极速达附表 产品表
        /// </summary>
        /// <param name="conn"></param>
        /// <param name="regionId"></param>
        /// <param name="selectedList"></param>
        /// <param name="existList"></param>
        /// <returns></returns>
        private bool UpdateBatteryFastDeliveryProducts(SqlConnection conn, int regionId, List <BatteryFastDeliveryProductsModel> selectedList, List <BatteryFastDeliveryProductsModel> existList)
        {
            var selectPids = selectedList.Select(s => s.ProductPid).ToList();
            var existPids  = existList.Select(e => e.ProductPid).ToList();
            var deleteList = existList.Where(e => !selectPids.Contains(e.ProductPid)).ToList();
            var insertList = selectedList.Where(s => !existPids.Contains(s.ProductPid)).ToList();

            //执行删除配置操作
            if (deleteList.Any())
            {
                foreach (var model in deleteList)
                {
                    if (model.FastDeliveryId > 0 && !string.IsNullOrEmpty(model.Brand) && !string.IsNullOrEmpty(model.ProductPid))
                    {
                        var delResult = DalBatteryFastDelivery.DeleteBatteryFastDeliveryProducts(conn, model);
                    }
                }
            }
            //执行插入操作
            if (insertList.Any())
            {
                foreach (var model in insertList)
                {
                    if (model.FastDeliveryId > 0 && !string.IsNullOrEmpty(model.Brand) && !string.IsNullOrEmpty(model.ProductPid))
                    {
                        var addResult = DalBatteryFastDelivery.AddBatteryFastDeliveryProducts(conn, model);
                    }
                }
            }
            return(true);
        }