コード例 #1
0
        public async Task <JsonResult> ReleaseQuestionList(string endTime)
        {
            GuessGameManager manager     = new GuessGameManager();
            DateTime         enddatetime = DateTime.Now;

            if (!string.IsNullOrWhiteSpace(endTime))
            {
                enddatetime = DateTime.Parse(endTime);
            }
            var result = manager.ReleaseQuestionList(enddatetime);
            IEnumerable <Question> questionList = manager.GetQuestionAnswerList(enddatetime);

            if (result)
            {
                using (var client = new ConfigLogClient())
                {
                    foreach (var question in questionList)
                    {
                        var response = client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                        {
                            ObjectId    = question.PKID,
                            ObjectType  = "WorldCupConfig",
                            BeforeValue = "",
                            AfterValue  = "",
                            Remark      = "公布答案",
                            Creator     = User.Identity.Name,
                        }));
                    }
                }
            }
            return(Json(result ? "" : "操作失败", JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public async Task <JsonResult> UpdateQuestionList(Question question1, Question question2, Question question3)
        {
            GuessGameManager manager      = new GuessGameManager();
            List <Question>  questionList = new List <Question>()
            {
                question1, question2, question3
            };


            bool updatesuccess = manager.UpdateQuestionList(questionList);

            if (updatesuccess)
            {
                using (var client = new ConfigLogClient())
                {
                    foreach (var question in questionList)
                    {
                        var response = client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                        {
                            ObjectId    = question.PKID,
                            ObjectType  = "WorldCupConfig",
                            BeforeValue = "",
                            AfterValue  = "",
                            Remark      = "更新题目竞猜结果",
                            Creator     = User.Identity.Name,
                        }));
                    }
                }
            }
            return(Json(updatesuccess ? "" : "操作失败", JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
        public ActionResult AddMaintenancePackageOnSaleList(List <MaintenancePackageOnSaleModel> list)
        {
            int maxUpdateID = 0;
            var success     = TireActivityManager.AddMaintenancePackageOnSaleList(out maxUpdateID, list);

            #region 日志记录
            using (var client = new ConfigLogClient())
            {
                var response = client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                {
                    ObjectId   = maxUpdateID,
                    ObjectType = "MaintenancePackageOnSale",
                    Remark     = "导入小保养套餐优惠价格excel",
                    Creator    = User.Identity.Name,
                }));
            }
            #endregion

            //等待1秒,写库同步到读库
            Thread.Sleep(1000);
            if (success == true)
            {
                return(Json(new { status = success, code = 1, msg = "上传成功" }));
            }
            else
            {
                return(Json(new { status = success, code = 1, msg = "上传失败" }));
            }
        }
コード例 #4
0
        public static bool InsertFlashSaleLog(QiangGouModel model, string hashkey)
        {
            var result = true;

            try
            {
                //if (model.Products.Count() > 10)
                //{
                //    result = DALLogger.BatchInsertFlashSaleProductsLog(model, hashkey);
                //}
                //else
                //{
                using (var client = new ConfigLogClient())
                {
                    foreach (var item in model.Products)
                    {
                        item.HashKey = hashkey;
                        var status = client.InsertDefaultLogQueue("FlashSaleProductsLog", JsonConvert.SerializeObject(item));
                        result = result && status.Success;
                    }
                }
                //}
            }
            catch (Exception ex)
            {
                Logger.Log(Level.Error, $"InsertFlashSaleLog执行错误{ex}-{ex.InnerException}-{ex.StackTrace}");
                result = false;
                throw;
            }
            return(result);
        }
コード例 #5
0
        public ActionResult UpdateTireActivityStatus(int pkid)
        {
            var model   = TireActivityManager.GetTireActivityModel(pkid);
            var nowtime = DateTime.Now;

            if (nowtime > model.EndDatetime)
            {
                return(Json(new { status = true, msg = "该轮胎活动计划已过期!", code = 0 }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                var  oldModel = TireActivityManager.GetTireActivityModel(pkid);
                bool sucess   = TireActivityManager.UpdateTireActivityStatus(pkid, User.Identity.Name) > 0;
                var  newModel = TireActivityManager.GetTireActivityModel(pkid);
                #region 日志记录
                using (var client = new ConfigLogClient())
                {
                    var response = client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = pkid,
                        ObjectType  = "TireActivity",
                        BeforeValue = JsonConvert.SerializeObject(oldModel),
                        AfterValue  = JsonConvert.SerializeObject(newModel),
                        Remark      = "停止计划",
                        Creator     = User.Identity.Name,
                    }));
                }
                #endregion

                //等待1秒,写库同步到读库
                Thread.Sleep(1000);
                return(Json(new { status = sucess, msg = "", code = 1 }, JsonRequestBehavior.AllowGet));
            }
        }
コード例 #6
0
        public bool Save(SE_GetPromotionActivityConfig model)
        {
            bool   result  = false;
            string operate = "";

            if (model.ID == null)
            {
                result  = dal.Add(model);
                operate = "新增";
            }
            else
            {
                result  = dal.Update(model);
                operate = "修改";
            }
            if (result)
            {
                using (var client = new ConfigLogClient())
                {
                    client.InsertDefaultLogQueue("PromotionConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = model.ID?.ToString().ToLower(),
                        ObjectType  = "PromotionActivity",
                        BeforeValue = "",
                        AfterValue  = JsonConvert.SerializeObject(model),
                        Operate     = operate,
                        Author      = ThreadIdentity.Operator.Name
                    }));
                }
            }

            return(result);
        }
コード例 #7
0
        /// <summary>
        /// 更新模块信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public async Task <ActionResult> UpdateModule(CarProductsHomePageModuleConfig model)
        {
            if (model.PKID <= 0)
            {
                return(Json(false));
            }
            var result = _manager.UpdateHomePageModuleConfig(model);

            if (result)
            {
                using (var client = new ConfigLogClient())
                {
                    client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = model.PKID,
                        ObjectType  = "CarProductsModule",
                        BeforeValue = JsonConvert.SerializeObject(model),
                        AfterValue  = "",
                        Remark      = "更新",
                        Creator     = User.Identity.Name,
                    }));
                }
                using (var client = new RefreshClient())
                {
                    var refResult = await client.RefreshSelectHomePageConfigAsync();

                    refResult.ThrowIfException(true);
                    return(Json(refResult.Result));
                }
            }

            return(Json(result));
        }
コード例 #8
0
        public static bool InserUploadFiletLog(string filePath, FileType type, string fileName, string batchCode, string user)
        {
            var result = false;

            if (!string.IsNullOrEmpty(filePath) && !string.IsNullOrEmpty(user))
            {
                var data = new UploadFileTaskLog
                {
                    FilePath   = filePath,
                    FileName   = fileName,
                    BatchCode  = batchCode,
                    Type       = type.ToString(),
                    Status     = FileStatus.Wait.ToString(),
                    CreateUser = user
                };
                using (var client = new ConfigLogClient())
                {
                    var getResult = client.InsertDefaultLogQueue("UploadFileTaskLog", JsonConvert.SerializeObject(data));
                    getResult.ThrowIfException(true);
                    if (getResult.Success && getResult.Exception == null)
                    {
                        result = false;
                    }
                }
            }
            return(result);
        }
コード例 #9
0
        public async Task <JsonResult> UpdateQuestionWithOptionList(QuestionWithOption question1, QuestionWithOption question2, QuestionWithOption question3)
        {
            GuessGameManager manager = new GuessGameManager();

            question1.StartTime = DateTime.Parse(question1.StartTime).ToString("yyyy-MM-dd 11:00:00");
            question1.EndTime   = DateTime.Parse(question1.EndTime).ToString("yyyy-MM-dd 11:00:00");
            question2.StartTime = question1.StartTime;
            question2.EndTime   = question1.EndTime;
            question3.StartTime = question1.StartTime;
            question3.EndTime   = question1.EndTime;

            DateTime starttimedate = DateTime.Parse(question1.StartTime);
            DateTime endtimedate   = DateTime.Parse(question1.EndTime);

            IEnumerable <Question> questionlist   = manager.GetALLQuestionList();
            List <long>            removePKIDlist = new List <long>()
            {
                question1.PKID, question2.PKID, question3.PKID
            };
            var allquestion = questionlist.ToList();

            allquestion.RemoveAll(s => removePKIDlist.Any(a => a == s.PKID));
            if (allquestion.Any())
            {
                foreach (var question in allquestion.Where(p => p != null).ToList())
                {
                    if (!(starttimedate >= DateTime.Parse(question.EndTime) || endtimedate <= DateTime.Parse(question.StartTime)))
                    {
                        return(Json("题目设置时间与线上题目时间段:(" + question.StartTime + "-" + question.EndTime + ")有重叠,请重设", JsonRequestBehavior.AllowGet));
                    }
                }
            }
            List <QuestionWithOption> questionList = new List <QuestionWithOption>()
            {
                question1, question2, question3
            };

            bool savesuccess = manager.UpdateQuestionWithOptionList(questionList);

            if (savesuccess)
            {
                using (var client = new ConfigLogClient())
                {
                    foreach (var question in questionList)
                    {
                        var response = client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                        {
                            ObjectId    = question.PKID,
                            ObjectType  = "WorldCupConfig",
                            BeforeValue = "",
                            AfterValue  = "",
                            Remark      = "修改题目及竞猜项",
                            Creator     = User.Identity.Name,
                        }));
                    }
                }
            }
            return(Json(savesuccess ? "" : "操作失败", JsonRequestBehavior.AllowGet));
        }
コード例 #10
0
 /// <summary>
 /// 插入日志
 /// </summary>
 /// <param name="type"></param>
 /// <param name="data"></param>
 public void InsertLog(string type, object data)
 {
     using (var client = new ConfigLogClient())
     {
         var status = client.InsertDefaultLogQueue(type, JsonConvert.SerializeObject(data));
         if (!status.Success)
         {
             status.ThrowIfException(true);
         }
     }
 }
コード例 #11
0
        public JsonResult AddMemberPageModule(MemberPageModuleModel model)
        {
            bool flag = false;
            var  memberPageManager = new MemberPageManager();
            var  moduleManager     = new MemberPageModuleManager();

            if (model.PKID == 0)//新建
            {
                var memberPageInfo = memberPageManager.GetMemberPageByPageCode(model.PageCode);
                if (memberPageInfo != null)
                {
                    model.MemberPageID = memberPageInfo.PKID;
                }
                model.Creator = User.Identity.Name;
                flag          = moduleManager.AddMemberPageModule(model);
                #region 日志记录
                using (var client = new ConfigLogClient())
                {
                    var response = client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = model.PKID,
                        ObjectType  = "MemberPageModule",
                        BeforeValue = "",
                        AfterValue  = JsonConvert.SerializeObject(model),
                        Remark      = "创建",
                        Creator     = User.Identity.Name,
                    }));
                }
                #endregion
            }
            else//编辑
            {
                var moduleInfo = moduleManager.GetMemberPageModuleInfo(model.PKID);
                flag = moduleManager.UpdateMemberPageModule(model);
                #region 日志记录
                using (var client = new ConfigLogClient())
                {
                    var response = client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = model.PKID,
                        ObjectType  = "MemberPageModule",
                        BeforeValue = JsonConvert.SerializeObject(moduleInfo),
                        AfterValue  = JsonConvert.SerializeObject(model),
                        Remark      = "编辑",
                        Creator     = User.Identity.Name,
                    }));
                }
                #endregion
            }
            //等待1秒,写库同步到读库
            Thread.Sleep(1000);
            moduleManager.RefreshMemberPageCache();
            return(Json(flag));
        }
コード例 #12
0
        /// <summary>
        /// 删除模块或模块内容
        /// </summary>
        /// <param name="contentId"></param>
        /// <param name="moduleId"></param>
        /// <param name="moduleType"></param>
        /// <returns></returns>
        public JsonResult DeleteMemberPageModule(long contentId, long moduleId, int moduleType)
        {
            bool flag           = false;
            var  channelManager = new MemberPageChannelManager();
            var  contentManager = new MemberPageModuleContentManager();
            var  moduleManager  = new MemberPageModuleManager();

            if (moduleType == 0)//模块内容
            {
                channelManager.DeleteMemberPageChannel(contentId);
                flag = contentManager.DeleteMemberPageModuleContent(contentId);
                #region 日志记录
                using (var client = new ConfigLogClient())
                {
                    var response = client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = contentId,
                        ObjectType  = "MemberPageModuleContent",
                        BeforeValue = "",
                        AfterValue  = "",
                        Remark      = "删除",
                        Creator     = User.Identity.Name,
                    }));
                }
                #endregion
            }
            else//模块
            {
                channelManager.DeleteMemberPageChannelByModuleID(moduleId);
                contentManager.DeleteMemberPageModuleContentByModuleID(moduleId);
                flag = moduleManager.DeleteMemberPageModule(moduleId);
                #region 日志记录
                using (var client = new ConfigLogClient())
                {
                    var response = client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = moduleId,
                        ObjectType  = "MemberPageModule",
                        BeforeValue = "",
                        AfterValue  = "",
                        Remark      = "删除",
                        Creator     = User.Identity.Name,
                    }));
                }
                #endregion
            }
            //等待1秒,写库同步到读库
            Thread.Sleep(1000);
            moduleManager.RefreshMemberPageCache();
            return(Json(flag, JsonRequestBehavior.AllowGet));
        }
コード例 #13
0
 public void InsertVehicleAssociateLog(string tid, string pid)
 {
     using (var configclient = new ConfigLogClient())
     {
         var vehicleInfo = new
         {
             TID = tid,
             PID = pid
         };
         var status = configclient.InsertDefaultLogQueue("VehProShiPeiLog", JsonConvert.SerializeObject(vehicleInfo));
         if (!status.Success)
         {
             logger.Error("记录产品适配车型日志失败", status.Exception);
         }
     }
 }
コード例 #14
0
 public bool Delete(Guid ID)
 {
     using (var client = new ConfigLogClient())
     {
         client.InsertDefaultLogQueue("PromotionConfigLog", JsonConvert.SerializeObject(new
         {
             ObjectId    = ID.ToString().ToLower(),
             ObjectType  = "PromotionActivity",
             BeforeValue = "",
             AfterValue  = "",
             Operate     = "删除",
             Author      = ThreadIdentity.Operator.Name
         }));
     }
     return(dal.Delete(ID));
 }
コード例 #15
0
        /// <summary>
        /// 创建优惠券任务
        /// </summary>
        /// <param name="promotionTask">优惠券任务对象</param>
        /// <param name="cellPhones">需要发送优惠券的用户列表</param>
        /// <returns></returns>
        public int CreatePromotionTask(PromotionTask promotionTask, List <string> TaskPromotionListIds = null, List <string> cellPhones = null)
        {
            try
            {
                var oper = ThreadIdentity.Operator.Name;
                var task = DalPromotionJob.GetPromotionTaskById(promotionTask.PromotionTaskId ?? 0);
                if (task != null && task.TaskStatus > 0)             //已经审核或者关闭的任务不能修改
                {
                    return(0);
                }
                if (promotionTask.PromotionTaskId != null && promotionTask.PromotionTaskId > 0)
                {
                    //如果是修改了数据源,则要释放原来的数据源
                    if (promotionTask.SelectUserType == 3 && task.PromotionTaskActivityId !=
                        promotionTask.PromotionTaskActivityId)
                    {
                        DalPromotionJob.ResetPromotionTaskActivity(task.PromotionTaskActivityId,
                                                                   task.PromotionTaskId);
                    }
                }

                var resultId = handler.CreatePromotionTask(promotionTask, oper, TaskPromotionListIds, cellPhones);
                if (promotionTask.SelectUserType == 3)
                {
                    //如果是从BI库里获取数据,则要同步taskid
                    DalPromotionJob.SetPromotionTaskActivity(promotionTask.PromotionTaskActivityId.Value, resultId);
                }

                using (var log = new ConfigLogClient())
                {
                    log.InsertDefaultLogQueue("PromotionConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = resultId,
                        ObjectType  = "PromTask",
                        BeforeValue = "",
                        AfterValue  = JsonConvert.SerializeObject(promotionTask),
                        Operate     = promotionTask?.PromotionTaskId == null ? "新增优惠券任务" : "修改优惠券任务",
                        Author      = oper
                    }));
                }
                return(resultId);
            }
            catch (Exception ex)
            {
                throw new Exception(" 优惠券任务对象出错");
            }
        }
コード例 #16
0
        /// <summary>
        /// 下载excel-轮胎pid列表
        /// </summary>
        /// <returns></returns>
        public ActionResult ExportExcelTireActivity(int tireActivityID)
        {
            var workbook = new XSSFWorkbook();
            var sheet    = workbook.CreateSheet();
            var index    = 0;
            var row      = sheet.CreateRow(index++);

            var num = 0;

            row.CreateCell(num++).SetCellValue("PID");

            num = 0;
            sheet.SetColumnWidth(num++, 16 * 256);
            var exm  = new TireActivityManage();
            var list = exm.GetTireActivityPIDList(tireActivityID);

            foreach (var item in list)
            {
                row = sheet.CreateRow(index++);
                num = 0;
                row.CreateCell(num++).SetCellValue(item.PID);
            }
            var ms = new MemoryStream();

            workbook.Write(ms);
            var model = TireActivityManager.GetTireActivityModel(tireActivityID);

            #region 日志记录
            using (var client = new ConfigLogClient())
            {
                var response = client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                {
                    ObjectId    = tireActivityID,
                    ObjectType  = "TireActivity",
                    BeforeValue = JsonConvert.SerializeObject(model),
                    AfterValue  = JsonConvert.SerializeObject(model),
                    Remark      = "下载",
                    Creator     = User.Identity.Name,
                }));
            }
            #endregion

            //等待1秒,写库同步到读库
            Thread.Sleep(1000);
            return(File(ms.ToArray(), "application/x-xls", $"轮胎活动列表-{DateTime.Now.ToString("yyyy年MM月dd日HH时mm分ss秒")}.xlsx"));
        }
コード例 #17
0
        public void InsertLog(string type, object data)
        {
            //var dict = new Dictionary<string, string>
            //{
            //    ["type"] = type,
            //    ["data"] = JsonConvert.SerializeObject(data),
            //};

            using (var client = new ConfigLogClient())
            {
                var status = client.InsertDefaultLogQueue(type, JsonConvert.SerializeObject(data));
                if (!status.Success)
                {
                    status.ThrowIfException(true);
                }
            }
        }
コード例 #18
0
 public void InsertPidAssociationLog(string pid)
 {
     using (var configclient = new ConfigLogClient())
     {
         var entity = new ProductVehicleTypeConfigOpLog()
         {
             PID            = pid,
             Operator       = "系统自动",
             OperateContent = string.Format("修改配置:产品{0}已自动适配车型", pid),
             OperateTime    = DateTime.Now,
             CreatedTime    = DateTime.Now,
         };
         var status = configclient.InsertDefaultLogQueue("PrdVehicleOprLog", JsonConvert.SerializeObject(entity));
         if (!status.Success)
         {
             logger.Error("记录产品适配车型日志失败", status.Exception);
         }
     }
 }
コード例 #19
0
        /// <summary>
        /// 保存限购信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ActionResult SaveCategoryLimitCount(ProductLimitCountEntity model)
        {
            var dbResult = _manager.FetchCategoryLimitCount(model);

            if (dbResult == null || dbResult.PKID <= 0)
            {
                var result = _manager.InsertProductLimitCount(model);
                using (var client = new ConfigLogClient())
                {
                    client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = result,
                        ObjectType  = "CategoryLimitCount",
                        BeforeValue = 0,
                        AfterValue  = model.LimitCount,
                        Remark      = "初次设置类目限购",
                        Creator     = User.Identity.Name
                    }));
                }
                return(Json(new { success = result > 0 }));
            }
            else
            {
                var oldVal = dbResult.LimitCount;
                dbResult.LimitCount = model.LimitCount;
                var result = _manager.UpdateProductLimitCount(dbResult);
                using (var client = new ConfigLogClient())
                {
                    client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = dbResult.PKID,
                        ObjectType  = "CategoryLimitCount",
                        BeforeValue = oldVal,
                        AfterValue  = model.LimitCount,
                        Remark      = "编辑类目限购数量",
                        Creator     = User.Identity.Name
                    }));
                }
                return(Json(new { success = result }));
            }
        }
コード例 #20
0
        public JsonResult UpdateLastLevelTouSu(TousuModel model, string oldAppDisplayName)
        {
            var identity = ThreadIdentity.Operator;
            //var histroylog = new ConfigHistory()
            //{
            //    ObjectType = "TouSuTopLevelAppNameUpdate",
            //    Author = identity.Name,
            //    BeforeValue = oldAppDisplayName,
            //    AfterValue = model.AppDisplayName,
            //    IPAddress = identity.IPAddress,
            //    ChangeDatetime = DateTime.Now,
            //    Operation = "更新投诉大类在APP端的显示名称"
            //};
            //LoggerManager.InsertOplog(histroylog);
            var result = TousuBusiness.SetAppDisplayName(model, identity.Name);

            if (result)
            {
                var tousuitem = TousuBusiness.tousuList.FirstOrDefault(s => string.Equals(s.DicValue, model.DicValue, StringComparison.OrdinalIgnoreCase));
                if (tousuitem != null)
                {
                    tousuitem.AppDisplayName = model.AppDisplayName;
                }

                var aftervalue = "修改LastLevelTousuName:" + model.DicValue + ",OldAppDisplayName:" + oldAppDisplayName + ",AppDisplayName:" + model.AppDisplayName;
                using (var log = new ConfigLogClient())
                {
                    var issuccess = log.InsertDefaultLogQueue("TousuConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = model.DicValue,
                        ObjectType  = "LastLevelTousuNameUpdate",
                        BeforeValue = "",
                        AfterValue  = "修改LastLevelTousuName:" + model.DicValue + ",OldAppDisplayName:" + oldAppDisplayName + ",AppDisplayName:" + model.AppDisplayName,
                        Operate     = "Update",
                        Author      = identity.Name
                    }));
                }
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
コード例 #21
0
        public async Task <JsonResult> InsertActivityPrize(ActivityPrize activityPrize)
        {
            GuessGameManager manager     = new GuessGameManager();
            bool             savesuccess = manager.SaveActivityPrize(activityPrize);

            if (savesuccess)
            {
                using (var client = new ConfigLogClient())
                {
                    var response = client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = activityPrize.PKID,
                        ObjectType  = "WorldCupConfigPrize",
                        BeforeValue = "",
                        AfterValue  = "",
                        Remark      = "新增兑换物",
                        Creator     = User.Identity.Name,
                    }));
                }
            }
            return(Json(savesuccess ? "" : "操作失败", JsonRequestBehavior.AllowGet));
        }
コード例 #22
0
        public async Task <JsonResult> UpdateActivityPrizeSale(int onsale, long pkid)
        {
            GuessGameManager manager = new GuessGameManager();
            var result = manager.UpdateActivityPrizeSale(onsale, pkid);

            if (result)
            {
                using (var client = new ConfigLogClient())
                {
                    var response = client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = pkid,
                        ObjectType  = "WorldCupConfigPrize",
                        BeforeValue = "",
                        AfterValue  = "",
                        Remark      = "修改兑换物上下架状态",
                        Creator     = User.Identity.Name,
                    }));
                }
            }
            return(Json(result? "" : "操作失败", JsonRequestBehavior.AllowGet));
        }
コード例 #23
0
        public static bool InsertLog(string type, object data)
        {
            var result = true;

            try
            {
                using (var client = new ConfigLogClient())
                {
                    var status = client.InsertDefaultLogQueue(type, JsonConvert.SerializeObject(data));
                    if (!status.Success)
                    {
                        status.ThrowIfException(true);
                        result = false;
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Log(Level.Error, $"通用日志==》InsertLog执行错误{ex}-{ex.InnerException}-{ex.StackTrace}");
            }
            return(result);
        }
コード例 #24
0
        /// <summary>
        /// 删除下单完成页配置
        /// </summary>
        /// <param name="pagination"></param>
        /// <returns></returns>
        public ActionResult DeletePaymentPageConfig(long pkid)
        {
            var  manager    = new PaymentPageConfigManager();
            var  configInfo = manager.GetPaymentPageConfigInfo(pkid);
            bool result     = manager.DeletePaymentPageConfig(pkid);

            if (result)
            {
                #region 日志记录
                using (var client = new ConfigLogClient())
                {
                    var response = client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = pkid,
                        ObjectType  = "PaymentPageConfig",
                        BeforeValue = JsonConvert.SerializeObject(configInfo),
                        AfterValue  = "",
                        Remark      = "删除下单完成页配置",
                        Creator     = User.Identity.Name,
                    }));
                }
                #endregion
                //等待1秒,写库同步到读库
                Thread.Sleep(1000);
                return(Content(JsonConvert.SerializeObject(new
                {
                    state = "success",
                    message = "操作成功"
                })));
            }
            else
            {
                return(Content(JsonConvert.SerializeObject(new
                {
                    state = "failure",
                    message = "操作失败"
                })));
            }
        }
コード例 #25
0
        public JsonResult UpdateOrInsertOrderTypeTousuConfig(OrderTypeTousuConfig model)
        {
            var identity = ThreadIdentity.Operator;
            var result   = TousuBusiness.UpdateOrInsertOrderTypeTousuConfig(model);

            if (result)
            {
                var aftervalue = "修改LastLevelTousu:" + model.LastLevelTousu + ",IsChecked:" + model.IsChecked + ",IsNeedPhoto:" + model.IsNeedPhoto + ",CautionText:" + model.CautionText;
                using (var log = new ConfigLogClient())
                {
                    var issuccess = log.InsertDefaultLogQueue("TousuConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = model.LastLevelTousu,
                        ObjectType  = "LastLevelTousuUpdate",
                        BeforeValue = "",
                        AfterValue  = "修改LastLevelTousu:" + model.LastLevelTousu + ",IsChecked:" + model.IsChecked + ",IsNeedPhoto:" + model.IsNeedPhoto + ",CautionText:" + model.CautionText,
                        Operate     = "Update",
                        Author      = identity.Name
                    }));
                }
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
コード例 #26
0
        /// <summary>
        /// 新增部门或用途
        /// </summary>
        /// <param name="model"></param>
        /// <param name="userName"></param>
        /// <returns></returns>
        public static bool InsertDepartmentUseSettingName(DepartmentAndUseModel model, string userName)
        {
            var result = DALPromotion.InsertDepartmentUseSetting(model);

            #region 新增日志
            if (result)
            {
                using (var log = new ConfigLogClient())
                {
                    log.InsertDefaultLogQueue("PromotionConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = model.SettingId,
                        ObjectType  = "CouponDepartmentAndUse",
                        BeforeValue = "",
                        AfterValue  = JsonConvert.SerializeObject(model),
                        Operate     = "新增",
                        Author      = userName
                    }));
                }
            }
            #endregion
            return(result);
        }
コード例 #27
0
 /// <summary>
 /// 删除banner
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public ActionResult DeleteFloor(int id)
 {
     if (id > 0)
     {
         var model = _manager.GetCarProductsFloorEntity(id);
         if (_manager.DeleteCarProductsFloor(id))
         {
             using (var client = new ConfigLogClient())
             {
                 client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                 {
                     ObjectId    = id,
                     ObjectType  = "CarProductsFloor",
                     BeforeValue = JsonConvert.SerializeObject(model),
                     AfterValue  = "",
                     Remark      = "删除",
                     Creator     = User.Identity.Name,
                 }));
             }
             return(Json(true));
         }
     }
     return(Json(false));
 }
コード例 #28
0
        /// <summary>
        /// 删除部门或用途
        /// </summary>
        /// <param name="id"></param>
        /// <param name="userName"></param>
        /// <returns></returns>
        public static bool DeleteDepartmentUseSettingNameBySettingId(int id, string userName)
        {
            var CouponDepartUseInfo = GetCouponDepartmentUseSettingBySettingId(id);
            var result = DALPromotion.DeleteDepartmentUseSettingNameBySettingId(id);

            #region 新增日志
            if (result)
            {
                using (var log = new ConfigLogClient())
                {
                    log.InsertDefaultLogQueue("PromotionConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = id,
                        ObjectType  = "CouponDepartmentAndUse",
                        BeforeValue = JsonConvert.SerializeObject(CouponDepartUseInfo),
                        AfterValue  = "",
                        Operate     = "删除",
                        Author      = userName
                    }));
                }
            }
            #endregion
            return(result);
        }
コード例 #29
0
        /// <summary>
        /// 新增/复制/编辑下单完成页配置
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ActionResult AddPaymentPageConfig(PaymentPageConfigModel model)
        {
            var manager = new PaymentPageConfigManager();
            //根据区域信息和产品线判断配置是否存在
            var exsitConfigInfo = manager.GetPaymentPageConfigInfo(model.ProvinceID, model.CityID, model.ProductLine);

            if (exsitConfigInfo != null && exsitConfigInfo.PKID != model.PKID)
            {
                exsitConfigInfo.Status = 0;//禁用
                manager.UpdatePaymentPageConfig(exsitConfigInfo);
                #region 日志记录
                using (var client = new ConfigLogClient())
                {
                    var response = client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = exsitConfigInfo.PKID,
                        ObjectType  = "PaymentPageConfig",
                        BeforeValue = "",
                        AfterValue  = JsonConvert.SerializeObject(exsitConfigInfo),
                        Remark      = "禁用下单完成页配置",
                        Creator     = User.Identity.Name,
                    }));
                }
                #endregion
            }
            //新增
            if (model.PKID == 0)
            {
                model.Status  = 1;
                model.Creator = User.Identity.Name;
                manager.AddPaymentPageConfig(model);
                #region 日志记录
                using (var client = new ConfigLogClient())
                {
                    var response = client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = model.PKID,
                        ObjectType  = "PaymentPageConfig",
                        BeforeValue = "",
                        AfterValue  = JsonConvert.SerializeObject(model),
                        Remark      = "新增下单完成页配置",
                        Creator     = User.Identity.Name,
                    }));
                }
                #endregion
            }
            //编辑
            else
            {
                var configInfo = manager.GetPaymentPageConfigInfo(model.PKID);
                model.Status  = 1;//启用
                model.Creator = configInfo.Creator;
                manager.UpdatePaymentPageConfig(model);
                #region 日志记录
                using (var client = new ConfigLogClient())
                {
                    var response = client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = model.PKID,
                        ObjectType  = "PaymentPageConfig",
                        BeforeValue = JsonConvert.SerializeObject(configInfo),
                        AfterValue  = JsonConvert.SerializeObject(model),
                        Remark      = "修改下单完成页配置",
                        Creator     = User.Identity.Name,
                    }));
                }
                #endregion
            }
            //等待1秒,写库同步到读库
            Thread.Sleep(1000);
            return(Content(JsonConvert.SerializeObject(new
            {
                state = "success",
                message = "操作成功",
                data = ""
            })));
        }
コード例 #30
0
        /// <summary>
        /// 启用下单完成页配置
        /// </summary>
        /// <param name="pkid"></param>
        /// <returns></returns>
        public ActionResult EnablePaymentPageConfig(long pkid)
        {
            var manager    = new PaymentPageConfigManager();
            var configInfo = manager.GetPaymentPageConfigInfo(pkid);

            //根据区域信息和产品线判断配置是否存在
            var exsitConfigInfo = manager.GetPaymentPageConfigInfo(configInfo.ProvinceID, configInfo.CityID, configInfo.ProductLine);

            if (exsitConfigInfo != null)
            {
                if (exsitConfigInfo.PKID != configInfo.PKID)
                {
                    exsitConfigInfo.Status = 0;  //禁用
                    manager.UpdatePaymentPageConfig(exsitConfigInfo);
                    #region 日志记录
                    using (var client = new ConfigLogClient())
                    {
                        var response = client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                        {
                            ObjectId    = exsitConfigInfo.PKID,
                            ObjectType  = "PaymentPageConfig",
                            BeforeValue = "",
                            AfterValue  = JsonConvert.SerializeObject(exsitConfigInfo),
                            Remark      = "禁用下单完成页配置",
                            Creator     = User.Identity.Name,
                        }));
                    }
                    #endregion
                }
            }

            bool result = false;
            if (configInfo != null && configInfo.Status == 0)
            {
                configInfo.Status = 1;  //启用
                result            = manager.UpdatePaymentPageConfig(configInfo);
                #region 日志记录
                using (var client = new ConfigLogClient())
                {
                    var response = client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = configInfo.PKID,
                        ObjectType  = "PaymentPageConfig",
                        BeforeValue = "",
                        AfterValue  = JsonConvert.SerializeObject(configInfo),
                        Remark      = "启用下单完成页配置",
                        Creator     = User.Identity.Name,
                    }));
                }
                #endregion
            }
            else
            {
                return(Content(JsonConvert.SerializeObject(new
                {
                    state = "failure",
                    message = "当前已是启用状态"
                })));
            }
            //等待1秒,写库同步到读库
            Thread.Sleep(1000);
            if (result)
            {
                return(Content(JsonConvert.SerializeObject(new
                {
                    state = "success",
                    message = "操作成功"
                })));
            }
            else
            {
                return(Content(JsonConvert.SerializeObject(new
                {
                    state = "failure",
                    message = "操作失败"
                })));
            }
        }