/// <summary> /// 新增or修改微信通知用户 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task CreateOrUpdateWXMemberConfigDtoAsync(MemberCodeEditDto input) { MemberConfigEditDto dto = new MemberConfigEditDto(); if (input.UserCode == 4 && input.UserId.HasValue) { dto.Code = DeployCodeEnum.通知配置; dto.Value = input.UserValue; dto.Type = DeployTypeEnum.通知配置; dto.CreationTime = DateTime.Now; dto.Id = input.UserId; if (input.Desc.Length <= 0) { dto.Desc = null; } else { dto.Desc = input.Desc; } await UpdateMemberConfigAsync(dto); } else { dto.Code = DeployCodeEnum.通知配置; dto.Value = input.UserValue; dto.Type = DeployTypeEnum.通知配置; dto.CreationTime = DateTime.Now; dto.Id = Guid.NewGuid(); if (input.Desc.Length > 0) { dto.Desc = input.Desc; } await CreateMemberConfigAsync(dto); } }
/// <summary> /// 新增or修改积分配置 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task CreateOrUpdateMemberConfigDtoAsync(MemberCodeEditDto input) { MemberConfigEditDto dto = new MemberConfigEditDto(); if (input.ECode == 2 && input.EId.HasValue) { dto.Code = DeployCodeEnum.商品评价; dto.Value = input.EValue; dto.Type = DeployTypeEnum.积分配置; dto.CreationTime = DateTime.Now; dto.Id = input.EId; dto.Desc = "店铺评价积分配置"; await UpdateMemberConfigAsync(dto); } else { dto.Code = DeployCodeEnum.商品评价; dto.Value = input.EValue; dto.Type = DeployTypeEnum.积分配置; dto.CreationTime = DateTime.Now; dto.Id = Guid.NewGuid(); dto.Desc = "店铺评价积分配置"; await CreateMemberConfigAsync(dto); } if (input.CCode == 1 && input.CId.HasValue) { dto.Code = DeployCodeEnum.商品购买; dto.Value = input.CValue; dto.Type = DeployTypeEnum.积分配置; dto.CreationTime = DateTime.Now; dto.Id = input.CId; dto.Desc = "商品购买积分配置"; await UpdateMemberConfigAsync(dto); } else { dto.Code = DeployCodeEnum.商品购买; dto.Value = input.CValue; dto.Type = DeployTypeEnum.积分配置; dto.CreationTime = DateTime.Now; dto.Id = Guid.NewGuid(); dto.Desc = "商品购买积分配置"; await CreateMemberConfigAsync(dto); } if (input.RcCode == 3 && input.RcId.HasValue) { dto.Code = DeployCodeEnum.店铺扫码兑换; dto.Value = input.RcValue; dto.Type = DeployTypeEnum.积分配置; dto.CreationTime = DateTime.Now; dto.Id = input.RcId; dto.Desc = "店铺扫码积分配置"; await UpdateMemberConfigAsync(dto); } else { dto.Code = DeployCodeEnum.店铺扫码兑换; dto.Value = input.RcValue; dto.Type = DeployTypeEnum.积分配置; dto.CreationTime = DateTime.Now; dto.Id = Guid.NewGuid(); dto.Desc = "店铺扫码积分配置"; await CreateMemberConfigAsync(dto); } if (input.FCode == 5 && input.FId.HasValue) { dto.Code = DeployCodeEnum.首次注册; dto.Value = input.FValue; dto.Type = DeployTypeEnum.积分配置; dto.CreationTime = DateTime.Now; dto.Id = input.FId; dto.Desc = "首次注册积分配置"; await UpdateMemberConfigAsync(dto); } else { dto.Code = DeployCodeEnum.首次注册; dto.Value = input.FValue; dto.Type = DeployTypeEnum.积分配置; dto.Id = Guid.NewGuid(); dto.CreationTime = DateTime.Now; dto.Desc = "首次注册积分配置"; await CreateMemberConfigAsync(dto); } }