public ActionResult DeleteActivityUrl(Guid activityId, string targetUrl, string wxappUrl) { if (activityId == Guid.Empty) { return(Json(new { Status = false, Msg = "活动ID不合法" })); } if (string.IsNullOrEmpty(targetUrl)) { return(Json(new { Status = false, Msg = "目标Url不能为空" })); } targetUrl = targetUrl.Trim(); var result = cityActivityConfig.DeleteActivityUrl(activityId, targetUrl, wxappUrl); if (result) { int id = cityActivityConfig.GetActivityPKIDByActivityId(activityId);//适配日志重构 var AfterValue = $"H5活动页地址:{targetUrl},小程序活动页地址:{wxappUrl}"; var log = new ConfigHistory() { AfterValue = AfterValue, Author = User.Identity.Name, Operation = activityId.ToString() + "删除活动页", ObjectType = "CVPage", ObjectID = id.ToString() }; LoggerManager.InsertOplog(log); } return(Json(new { Status = result, Msg = $"删除活动页面{(result ? "成功" : "失败")}" })); }
public JsonResult UpdateTopLevelTouSu(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; } } return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult UpdateActivityUrl(RegionVehicleIdActivityUrlConfig model, string h5OldUrl, string wxOldUrl, string vehicleIds, string regionIds) { if (model == null || model.ActivityId == Guid.Empty) { return(Json(new { Status = false, Msg = "未知的更新对象" })); } if (string.IsNullOrWhiteSpace(model.TargetUrl) && string.IsNullOrWhiteSpace(model.WxappUrl)) { return(Json(new { Status = false, Msg = "活动页面地址不能全为空" })); } if (model.IsDefault != 0 && model.IsDefault != 1) { return(Json(new { Status = false, Msg = "是否默认页面字段出错" })); } if (model.IsDefault != 1 && string.IsNullOrWhiteSpace(vehicleIds) && string.IsNullOrWhiteSpace(regionIds)) { return(Json(new { Status = false, Msg = "车型或地区不能为空" })); } if (string.IsNullOrWhiteSpace(h5OldUrl) && string.IsNullOrWhiteSpace(wxOldUrl)) { return(Json(new { Status = false, Msg = "原有活动页链接为空" })); } if (!string.IsNullOrWhiteSpace(model.TargetUrl) && !string.Equals(h5OldUrl, model.TargetUrl)) { var isExist = cityActivityConfig.IsExistActivityTargetUrl(model.ActivityId, model.TargetUrl); if (isExist) { return(Json(new { Status = false, Msg = "已存在该H5活动页" })); } } if (!string.IsNullOrWhiteSpace(model.WxappUrl) && !string.Equals(wxOldUrl, model.WxappUrl)) { var isExist = cityActivityConfig.IsExistActivityWxappUrl(model.ActivityId, model.WxappUrl); if (isExist) { return(Json(new { Status = false, Msg = "已存在该小程序活动页" })); } } var user = User.Identity.Name; var result = cityActivityConfig.UpdateActivityUrl(model, h5OldUrl, wxOldUrl, vehicleIds, regionIds); if (result) { int id = cityActivityConfig.GetActivityPKIDByActivityId(model.ActivityId); var AfterValue = $"H5活动页地址:{h5OldUrl}改为{model.TargetUrl}" + $",小程序活动页地址:{wxOldUrl}改为{model.WxappUrl}" + $",是否默认页面:{model.IsDefault},车型ID:{vehicleIds},城市ID:{regionIds}";//适配日志重构 var log = new ConfigHistory() { AfterValue = AfterValue, Author = user, Operation = $"{model.ActivityId.ToString()}更新活动页", ObjectType = "CVPage", ObjectID = id.ToString() }; LoggerManager.InsertOplog(log); } return(Json(new { Status = result, Msg = $"活动页更新{(result ? "成功" : "失败")}" })); }
public ActionResult GetLogger(string id) { ConfigHistory model = LoggerManager.GetConfigHistory(id); if (model?.ObjectType.Trim().ToLower() == "ACFV2".ToLower()) { return(View(model)); } else { return(HttpNotFound()); } // return Json(model,JsonRequestBehavior.AllowGet); }
public virtual void createOne(long? configId, string oldValue, string newValue) { ConfigHistory configHistory = new ConfigHistory(); configHistory.ConfigId = configId; configHistory.OldValue = oldValue; configHistory.NewValue = newValue; string curTime = DateUtils.format(DateTime.Now, DataFormatConstants.COMMON_TIME_FORMAT); configHistory.CreateTime = curTime; configHistoryDao.create(configHistory); }
public ActionResult CreateActivityUrl(RegionVehicleIdActivityUrlConfig model, string vehicleIds, string regionIds) { if (model == null || model.ActivityId == Guid.Empty) { return(Json(new { Status = false, Msg = "未知的创建对象" })); } if (string.IsNullOrWhiteSpace(model.TargetUrl) && string.IsNullOrWhiteSpace(model.WxappUrl)) { return(Json(new { Status = false, Msg = "活动页面地址不能全为空" })); } if (model.IsDefault != 0 && model.IsDefault != 1) { return(Json(new { Status = false, Msg = "是否默认页面字段出错" })); } if (model.IsDefault != 1 && string.IsNullOrWhiteSpace(vehicleIds) && string.IsNullOrWhiteSpace(regionIds)) { return(Json(new { Status = false, Msg = "车型或地区不能为空" })); } if (!string.IsNullOrWhiteSpace(model.TargetUrl) && cityActivityConfig.IsExistActivityTargetUrl(model.ActivityId, model.TargetUrl)) { return(Json(new { Status = false, Msg = "该H5活动页已存在,请勿重复添加" })); } if (!string.IsNullOrWhiteSpace(model.WxappUrl) && cityActivityConfig.IsExistActivityWxappUrl(model.ActivityId, model.WxappUrl)) { return(Json(new { Status = false, Msg = "该小程序活动页已存在,请勿重复添加" })); } var result = cityActivityConfig.CreateActivityUrl(model, vehicleIds, regionIds); if (result) { int id = cityActivityConfig.GetActivityPKIDByActivityId(model.ActivityId);//适配日志重构 var AfterValue = $"H5活动页地址:{model.TargetUrl}" + $",小程序活动页地址:{model.WxappUrl}" + $",是否默认页面:{model.IsDefault},车型ID:{vehicleIds},城市ID:{regionIds}"; var log = new ConfigHistory() { AfterValue = AfterValue, Author = User.Identity.Name, Operation = $"{model.ActivityId}新增活动页", ObjectType = "CVPage", ObjectID = id.ToString() }; LoggerManager.InsertOplog(log); } return(Json(new { Status = result, Msg = $"活动页添加{(result ? "成功" : "失败")}" })); }
public static bool InsertOplog(ConfigHistory model) { //AutoMapper初始化配置文件 var config = new MapperConfiguration(cfg => cfg.CreateMap <ConfigHistory, OprLogModel>()); var mapper = config.CreateMapper(); //集合类型转换 var oprLogModel = mapper.Map <OprLogModel>(model); bool flag = false; using (var client = new OprLogClient()) { var result = client.AddOprLog(oprLogModel); if (result.Result > 0) { flag = true; } } return(flag); }
public IList <ConfigHistoryData> GetAllHistory(Guid id) { return(ConfigHistory.ToJavaScriptConfigHistory(_eventStoreRepository.All(id))); }