Commit 7b002825 authored by liudong1993's avatar liudong1993

Merge branch 'sdzq' of http://gitlab.oytour.com/Kui2/mall.oytour.com into sdzq-ld

parents 473b3454 07113b7c
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Mall.Model.Entity.Miai
{
/// <summary>
/// 相亲会员基础资料
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_MiAi_BaseInfo
{
/// <summary>
/// 编号
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 会员id
/// </summary>
public int UserId { get; set; }
/// <summary>
/// 性别
/// </summary>
public int Sex { get; set; }
/// <summary>
/// 生日
/// </summary>
public string Birthday { get; set; }
/// <summary>
/// 体重
/// </summary>
public decimal Weight { get; set; }
/// <summary>
/// 身高
/// </summary>
public decimal Height { get; set; }
/// <summary>
/// 学历
/// </summary>
public int EducationType { get; set; }
/// <summary>
/// 婚姻
/// </summary>
public int Marriage { get; set; }
/// <summary>
/// 名称
/// </summary>
public string RealName { get; set; }
/// <summary>
/// 身份证号
/// </summary>
public string IDCard { get; set; }
/// <summary>
/// 身份证反面
/// </summary>
public string IDCardBack { get; set; }
/// <summary>
/// 商户号Id
/// </summary>
public int? TenantId
{
get;
set;
}
/// <summary>
/// 小程序Id
/// </summary>
public int? MallBaseId
{
get;
set;
}
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
/// 删除状态
/// </summary>
public int? Status
{
get;
set;
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Miai;
namespace Mall.Model.Extend.Miai
{
public class RB_MiAi_BaseInfo_Extend: RB_MiAi_BaseInfo
{
}
}
......@@ -23,6 +23,9 @@ namespace Mall.Module.Miai
private readonly RB_Miai_ActivityEnrollRepository miai_ActivityEnrollRepository = new RB_Miai_ActivityEnrollRepository();
private readonly RB_Miai_ActivityDiscussRepository miai_ActivityDiscussRepository = new RB_Miai_ActivityDiscussRepository();
private readonly RB_MiAi_BaseInfoRepository miai_BaseInfoRepository = new RB_MiAi_BaseInfoRepository();
#region 活动版块
/// <summary>
/// 获取活动版本分页列表
......@@ -223,6 +226,48 @@ namespace Mall.Module.Miai
}
#endregion
#region 会员基础信息
/// <summary>
/// 获取列表
/// </summary>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_MiAi_BaseInfo_Extend> GetBaseInfoList(RB_MiAi_BaseInfo_Extend where)
{
return miai_BaseInfoRepository.GetBaseInfoList(where);
}
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_MiAi_BaseInfo_Extend> GetBaseInfoPageList(int pageIndex, int pageSize, out long rowsCount, RB_MiAi_BaseInfo_Extend where)
{
return miai_BaseInfoRepository.GetBaseInfoPageList(pageIndex, pageSize, out rowsCount, where);
}
/// <summary>
/// 新增用户的基础信息
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetMiAiBaseInfo(RB_MiAi_BaseInfo_Extend model)
{
bool flag = false;
if (model.Id == 0)
{
flag = miai_BaseInfoRepository.Insert(model) > 0;
}
return flag;
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mall.Model.Entity.Miai;
using Mall.Model.Extend.Miai;
namespace Mall.Repository.Miai
{
public class RB_MiAi_BaseInfoRepository:BaseRepository<RB_MiAi_BaseInfo>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_MiAi_BaseInfo); } }
/// <summary>
/// 获取列表
/// </summary>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_MiAi_BaseInfo_Extend> GetBaseInfoList(RB_MiAi_BaseInfo_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT * from RB_MiAi_BaseInfo where Status=0");
if (where != null)
{
if (where.TenantId > 0)
{
sb.AppendFormat(" and TenantId={0}", where.TenantId);
}
if (where.MallBaseId > 0)
{
sb.AppendFormat(" and MallBaseId={0}", where.MallBaseId);
}
if (where.Id > 0)
{
sb.AppendFormat(" and Id={0}", where.Id);
}
}
return Get<RB_MiAi_BaseInfo_Extend>(sb.ToString()).ToList();
}
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_MiAi_BaseInfo_Extend> GetBaseInfoPageList(int pageIndex, int pageSize, out long rowsCount, RB_MiAi_BaseInfo_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT * from RB_MiAi_BaseInfo where Status=0");
if (where != null)
{
if (where.TenantId > 0)
{
sb.AppendFormat(" and TenantId={0}", where.TenantId);
}
if (where.MallBaseId > 0)
{
sb.AppendFormat(" and MallBaseId={0}", where.MallBaseId);
}
if (where.Id > 0)
{
sb.AppendFormat(" and Id={0}", where.Id);
}
if (where.UserId > 0)
{
sb.AppendFormat(" and UserId={0}", where.UserId);
}
}
return GetPage<RB_MiAi_BaseInfo_Extend>(pageIndex, pageSize, out rowsCount, sb.ToString()).ToList();
}
}
}
......@@ -178,5 +178,49 @@ namespace Mall.WebApi.Controllers.MallBase
}
#endregion
#region 基础信息
/// <summary>
/// 填写个人基础信息
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
public ApiResult GetSetMiAiBaseInfo()
{
var req = RequestParm;
var userInfo = AppletUserInfo;
AppletUserInfo uInfo = UserReidsCache.GetAppletUserBlacklistInfo(userInfo.UserId);
if ((uInfo?.Blacklist ?? 0) == 1)
{
return ApiResult.Failed("已进入黑名单,无法访问");
}
RB_MiAi_BaseInfo_Extend comment = JsonConvert.DeserializeObject<RB_MiAi_BaseInfo_Extend>(req.msg.ToString());
comment.Status = 0;
comment.CreateDate = DateTime.Now;
comment.UserId = userInfo.UserId;
comment.TenantId = userInfo.TenantId;
comment.MallBaseId = userInfo.MallBaseId;
var oldBaseInfo = miaiModule.GetBaseInfoList(new RB_MiAi_BaseInfo_Extend { UserId = comment.UserId, TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId }).FirstOrDefault();
if (oldBaseInfo == null && oldBaseInfo.Id == 0)
{
if (miaiModule.SetMiAiBaseInfo(comment))
{
return ApiResult.Success("基础资料填写成功");
}
else
{
return ApiResult.Failed("基础资料填写失败");
}
}
else
{
return ApiResult.Failed("请勿重复填写基础资料");
}
}
#endregion
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment