示例#1
0
        /// <summary>
        /// 保存基础配置信息
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public ReturnMsg SaveWctBasConfigInfo(WctBasConfigDto dto)
        {
            var rm     = new ReturnMsg();
            var entity = new WctBasConfig();
            var redis  = _redisHelper.GetRedisClient(Convert.ToInt(dto.REDIS_NUM));

            if (string.IsNullOrEmpty(dto.Id))
            {
                _initHelper.InitAdd(dto, AbpSession.USR_ID, AbpSession.ORG_NO, AbpSession.BG_NO);
                entity = dto.ToEntity();
                _wctBasConfigRepository.Insert(entity);
                redis.Add(AbpSession.BG_NO + "-CONFIG_ID", dto);
            }
            else
            {
                _initHelper.InitUpdate(dto, AbpSession.USR_ID);
                entity = dto.ToEntity();
                _wctBasConfigRepository.Update(entity);
                //redis集团缓存配置修改
                if (redis.Exists(AbpSession.BG_NO + "-CONFIG_ID") != 1)
                {
                    redis.Add(AbpSession.BG_NO + "-CONFIG_ID", dto);
                }
                else
                {
                    redis.Set(AbpSession.BG_NO + "-CONFIG_ID", dto);
                }
            }
            rm.IsSuccess = true;

            return(rm);
        }
示例#2
0
 public ActionResult SaveWctBasConfigInfo([FromBody] WctBasConfigDto dto)
 {
     try
     {
         var result = _wctBasConfigService.SaveWctBasConfigInfo(dto);
         if (!result.IsSuccess)
         {
             return(Fail(result.msg));
         }
         return(Success("保存成功"));
     }
     catch (Exception ex)
     {
         return(Fail(ex.Message));
     }
 }