Commit dfaed564 authored by 吴春's avatar 吴春

提交代码

parent 5890453a
......@@ -52,7 +52,26 @@ namespace Mall.Common.Plugin
#region "日期相关"
/// <summary>
/// 年龄
/// </summary>
/// <param name="bornDate"></param>
/// <returns></returns>
public static string GetAge(string bornDate)
{
DateTime b = DateTime.Parse(bornDate);
int a2 = DateTime.Now.Year;
int b2 = b.Year;
int a3 = DateTime.Now.Month;
int b3 = b.Month;
int a4 = DateTime.Now.Day;
int b4 = b.Day;
int aa = (a2 - 1900) * 365 + a3 * 30 + a4;
int bb = (b2 - 1900) * 365 + b3 * 30 + b4;
int cc = aa - bb; //天数
int dd = (int)Math.Floor(Convert.ToDouble(cc / 365));
return dd.ToString();
}
public static string DateFormatToString(DateTime dt)
{
......
......@@ -3010,4 +3010,130 @@ namespace Mall.Model.Extend.MarketingCenter
}
#endregion
#region 相亲- 人物插件
public class MiAiUserItem
{
/// <summary>
/// 人数数量
/// </summary>
public int goodsLength { get; set; }
/// <summary>
/// 列表样式[-1-列表模式,0-左右滑动,1-一行一个,2-一行两个3-一行三个]
/// </summary>
public int listStyle { get; set; }
/// <summary>
/// 用户添加方式(0-自定义,1-按照匹配度【规则未确定】,2-按照热度【被浏览数据,被关注数据】,3-按照最新)
/// </summary>
public int addUserType { get; set; }
/// <summary>
/// 背景颜色
/// </summary>
public string backgroundColor { get; set; }
/// <summary>
/// 上边距
/// </summary>
public string PaddingTop { get; set; }
/// <summary>
/// 下边距
/// </summary>
public string PaddingBottom { get; set; }
/// <summary>
/// 左边距
/// </summary>
public string PaddingLeft { get; set; }
/// <summary>
/// 右边距
/// </summary>
public string PaddingRight { get; set; }
/// <summary>
/// 搜索圆角像素
/// </summary>
public int SearchFilletPX
{
get;
set;
}
/// <summary>
/// 自定义列表
/// </summary>
public List<miaiUserDetail> list { get; set; }
}
/// <summary>
/// 详情
/// </summary>
public class miaiUserDetail
{
/// <summary>
/// 商品编号
/// </summary>
public int id { get; set; }
/// <summary>
/// 标题
/// </summary>
public string name { get; set; }
/// <summary>
/// 商品图片
/// </summary>
public string Photo { get; set; }
/// <summary>
/// 性别
/// </summary>
public string SexStr { get; set; }
/// <summary>
/// 年龄
/// </summary>
public string Age { get; set; }
/// <summary>
/// 学历
/// </summary>
public string Education { get; set; }
/// <summary>
/// 婚姻状态
/// </summary>
public string Marriage { get; set; }
/// <summary>
/// 匹配度
/// </summary>
public int MatchingRate { get; set; }
/// <summary>
/// 分数
/// </summary>
public int Score { get; set; }
/// <summary>
/// 相册
/// </summary>
public string Album { get; set; }
public List<string> AlbumList { get; set; }
}
#endregion
}
\ No newline at end of file
......@@ -11,5 +11,23 @@ namespace Mall.Model.Extend.Miai
/// 相册
/// </summary>
public List<string> AlbumList { get; set; }
public string Name { get; set; }
/// <summary>
/// 头像
/// </summary>
public string Photo { get; set; }
/// <summary>
/// 指定用户id
/// </summary>
public string UserIds { get; set; }
/// <summary>
/// 0-指定用户,1-按照匹配度,2-按照热度,3-按照最新
/// </summary>
public int Sort { get; set; }
}
}
......@@ -621,6 +621,31 @@ namespace Mall.Module.MarketingCenter
}
item.data = storeModel;
break;
//教育模块-老师列表
case "miaiuser":
MiAiUserItem miaiUserItem = new MiAiUserItem();
try
{
var driveData = JsonHelper.DeserializeObject<MiAiUserItem>(item.data.ToString());
if (driveData != null)
{
miaiUserItem.listStyle = driveData?.listStyle ?? 1;
miaiUserItem.backgroundColor = driveData?.backgroundColor ?? "";
miaiUserItem.PaddingTop = driveData?.PaddingTop ?? "0";
miaiUserItem.PaddingBottom = driveData?.PaddingBottom ?? "0";
miaiUserItem.PaddingLeft = driveData?.PaddingLeft ?? "0";
miaiUserItem.PaddingRight = driveData?.PaddingRight ?? "0";
miaiUserItem.SearchFilletPX = driveData?.SearchFilletPX ?? 0;
miaiUserItem.list = new List<miaiUserDetail>();
miaiUserItem.list = driveData.list;
}
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "miaiuser");
}
item.data = miaiUserItem;
break;
//导航-页面
case "nav-page": item.data = JsonHelper.DeserializeObject<navPageItem>(item.data.ToString()); break;
......
......@@ -677,16 +677,16 @@ namespace Mall.Module.Miai
}
else {
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_MiAi_BaseInfo_Extend.Sex),model.Sex},
//{ nameof(RB_MiAi_BaseInfo_Extend.Sex),model.Sex},
{ nameof(RB_MiAi_BaseInfo_Extend.Birthday),model.Birthday},
{ nameof(RB_MiAi_BaseInfo_Extend.Weight),model.Weight},
{ nameof(RB_MiAi_BaseInfo_Extend.Height),model.Height},
{ nameof(RB_MiAi_BaseInfo_Extend.EducationType),model.EducationType},
{ nameof(RB_MiAi_BaseInfo_Extend.Marriage),model.Marriage},
{ nameof(RB_MiAi_BaseInfo_Extend.RealName),model.RealName},
{ nameof(RB_MiAi_BaseInfo_Extend.IDCardNo),model.IDCardNo},
{ nameof(RB_MiAi_BaseInfo_Extend.IDCard),model.IDCard},
{ nameof(RB_MiAi_BaseInfo_Extend.IDCardBack),model.IDCardBack},
//{ nameof(RB_MiAi_BaseInfo_Extend.RealName),model.RealName},
//{ nameof(RB_MiAi_BaseInfo_Extend.IDCardNo),model.IDCardNo},
//{ nameof(RB_MiAi_BaseInfo_Extend.IDCard),model.IDCard},
//{ nameof(RB_MiAi_BaseInfo_Extend.IDCardBack),model.IDCardBack},
{ nameof(RB_MiAi_BaseInfo_Extend.HuKou),model.HuKou},
{ nameof(RB_MiAi_BaseInfo_Extend.NativePlace),model.NativePlace},
{ nameof(RB_MiAi_BaseInfo_Extend.HouseInfo),model.HouseInfo},
......@@ -699,7 +699,8 @@ namespace Mall.Module.Miai
{ nameof(RB_MiAi_BaseInfo_Extend.FatherInfo),model.FatherInfo},
{ nameof(RB_MiAi_BaseInfo_Extend.MotherInfo),model.MotherInfo},
{ nameof(RB_MiAi_BaseInfo_Extend.About),model.About},
{ nameof(RB_MiAi_BaseInfo_Extend.IdealLove),model.IdealLove}
{ nameof(RB_MiAi_BaseInfo_Extend.IdealLove),model.IdealLove},
{ nameof(RB_MiAi_BaseInfo_Extend.Album),model.Album}
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
......@@ -713,6 +714,20 @@ namespace Mall.Module.Miai
}
return flag;
}
/// <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> GetFirstBaseInfoPageList(int pageIndex, int pageSize, out long rowsCount, RB_MiAi_BaseInfo_Extend where)
{
return miai_BaseInfoRepository.GetFirstBaseInfoPageList(pageIndex, pageSize, out rowsCount, where);
}
#endregion
#region 我的粉丝/我的关注
......@@ -843,6 +858,9 @@ namespace Mall.Module.Miai
}
return list;
}
#endregion
}
......
......@@ -7,7 +7,7 @@ using Mall.Model.Extend.Miai;
namespace Mall.Repository.Miai
{
public class RB_MiAi_BaseInfoRepository:BaseRepository<RB_MiAi_BaseInfo>
public class RB_MiAi_BaseInfoRepository : BaseRepository<RB_MiAi_BaseInfo>
{
/// <summary>
/// 表名称
......@@ -77,5 +77,61 @@ namespace Mall.Repository.Miai
}
return GetPage<RB_MiAi_BaseInfo_Extend>(pageIndex, pageSize, out rowsCount, 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> GetFirstBaseInfoPageList(int pageIndex, int pageSize, out long rowsCount, RB_MiAi_BaseInfo_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT a.*,b.`Name`,b.Photo from RB_MiAi_BaseInfo as a
LEFT JOIN rb_member_user as b on a.UserId=b.Id where a.Status=0 and b.Blacklist!=1 ");
if (where != null)
{
if (where.TenantId > 0)
{
sb.AppendFormat(" and a.TenantId={0}", where.TenantId);
}
if (where.MallBaseId > 0)
{
sb.AppendFormat(" and a.MallBaseId={0}", where.MallBaseId);
}
if (where.Id > 0)
{
sb.AppendFormat(" and a.Id={0}", where.Id);
}
if (where.UserId > 0)
{
sb.AppendFormat(" and a.UserId={0}", where.UserId);
}
if (!string.IsNullOrWhiteSpace(where.UserIds))
{
sb.AppendFormat(" and a.UserId in({0})", where.UserIds);
}
if (where.Sort == 1)
{
// sb.AppendFormat(" order by ");
}
else if (where.Sort == 2)
{
sb.AppendFormat(" ORDER BY (a.FollowNum+a.BrowseNum) desc");
}
else if (where.Sort ==3)
{
sb.AppendFormat(" ORDER BY b.CreateDate desc ");
}
}
return GetPage<RB_MiAi_BaseInfo_Extend>(pageIndex, pageSize, out rowsCount, sb.ToString()).ToList();
}
}
}
This diff is collapsed.
......@@ -380,7 +380,8 @@ namespace Mall.WebApi.Controllers.MallBase
{
return ApiResult.ParamIsNull("请传递姓名");
}
if (string.IsNullOrEmpty(demodel.Mobile)) {
if (string.IsNullOrEmpty(demodel.Mobile))
{
return ApiResult.ParamIsNull("请传递手机号码");
}
......@@ -432,7 +433,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetMyEnrollPageList() {
public ApiResult GetMyEnrollPageList()
{
var parms = RequestParm;
var userInfo = AppletUserInfo;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(parms.msg.ToString());
......@@ -450,7 +452,8 @@ namespace Mall.WebApi.Controllers.MallBase
x.Mobile,
x.PeopleNum,
x.Remark,
ActivityModel = new {
ActivityModel = new
{
x.ActivityModel?.Id,
x.ActivityModel?.ActivityTitle,
x.ActivityModel?.UserId,
......@@ -537,7 +540,7 @@ namespace Mall.WebApi.Controllers.MallBase
}
if (baseInfo.AlbumList != null && baseInfo.AlbumList.Any())
{
baseInfo.Album = JsonConvert.SerializeObject(baseInfo.Album);
baseInfo.Album = JsonConvert.SerializeObject(baseInfo.AlbumList);
}
else
{
......@@ -557,26 +560,7 @@ namespace Mall.WebApi.Controllers.MallBase
return ApiResult.Failed("基础资料填写失败");
}
}
/// <summary>
/// 年龄
/// </summary>
/// <param name="bornDate"></param>
/// <returns></returns>
private string GetAge(string bornDate)
{
DateTime b = DateTime.Parse(bornDate);
int a2 = DateTime.Now.Year;
int b2 = b.Year;
int a3 = DateTime.Now.Month;
int b3 = b.Month;
int a4 = DateTime.Now.Day;
int b4 = b.Day;
int aa = (a2 - 1900) * 365 + a3 * 30 + a4;
int bb = (b2 - 1900) * 365 + b3 * 30 + b4;
int cc = aa - bb; //天数
int dd = (int)Math.Floor(Convert.ToDouble(cc / 365));
return dd.ToString();
}
/// <summary>
/// 生肖
/// </summary>
......@@ -634,9 +618,28 @@ namespace Mall.WebApi.Controllers.MallBase
JObject parm = JObject.Parse(req.msg.ToString());
var userInfo = AppletUserInfo;
int userId = parm.GetInt("UserId");
int isFollow = -1;//-1 自己, 0-未关注,1-已关注,2-别人关注了你,3-互相关注
if (userId == 0)
{
userId = userInfo.UserId;
var oldList = miaiModule.GetFollowMemberList(new RB_MiAi_FollowMember_Extend { Status = 0, UserId = userId, CreateBy = userInfo.UserId, MallBaseId = userInfo.MallBaseId, TenantId = userInfo.TenantId });
var oldOtherList = miaiModule.GetFollowMemberList(new RB_MiAi_FollowMember_Extend { Status = 0, UserId = userInfo.UserId, CreateBy = userId, MallBaseId = userInfo.MallBaseId, TenantId = userInfo.TenantId });
if (oldList != null && oldList.Any() && oldOtherList != null && oldOtherList.Any())
{
isFollow = 3;
}
else if (oldList != null && oldList.Any())
{
isFollow = 1;
}
else if (oldOtherList != null && oldOtherList.Any())
{
isFollow = 2;
}
else
{
isFollow = 0;
}
}
var oldBaseInfo = miaiModule.GetBaseInfoList(new RB_MiAi_BaseInfo_Extend { UserId = userId, TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId }).FirstOrDefault();
if (oldBaseInfo != null && oldBaseInfo.Id > 0)
......@@ -648,9 +651,15 @@ namespace Mall.WebApi.Controllers.MallBase
}
var result = new
{
IsFollow = isFollow,
oldBaseInfo.Sex,
oldBaseInfo.IDCardNo,
oldBaseInfo.RealName,
oldBaseInfo.IDCard,
oldBaseInfo.IDCardBack,
SexStr = oldBaseInfo.Sex == 1 ? "男" : "女",
oldBaseInfo.Birthday,
Age = string.IsNullOrWhiteSpace(oldBaseInfo.Birthday) ? "" : GetAge(oldBaseInfo.Birthday),//年纪
Age = string.IsNullOrWhiteSpace(oldBaseInfo.Birthday) ? "" : StringHelper.GetAge(oldBaseInfo.Birthday),//年纪
ShenXiao = string.IsNullOrWhiteSpace(oldBaseInfo.Birthday) ? "" : GetShengXiao(Convert.ToDateTime((oldBaseInfo.Birthday))),//生肖
ConoldBaseInfostellation = string.IsNullOrWhiteSpace(oldBaseInfo.Birthday) ? "" : GetAtomFromBirthday(Convert.ToDateTime((oldBaseInfo.Birthday))),//星座
oldBaseInfo.Height,
......
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