Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
b7c379e6
Commit
b7c379e6
authored
Feb 25, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
1
parents
47a71959
dfaed564
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
773 additions
and
55 deletions
+773
-55
StringHelper.cs
Mall.Common/Plugin/StringHelper.cs
+20
-1
RB_MiAi_BaseInfo.cs
Mall.Model/Entity/Miai/RB_MiAi_BaseInfo.cs
+81
-0
RB_Miniprogram_Template_Extend.cs
.../Extend/MarketingCenter/RB_Miniprogram_Template_Extend.cs
+126
-0
RB_MiAi_BaseInfo_Extend.cs
Mall.Model/Extend/Miai/RB_MiAi_BaseInfo_Extend.cs
+22
-1
MiniprogramTemplateModule.cs
Mall.Module.MarketingCenter/MiniprogramTemplateModule.cs
+25
-0
MiaiModule.cs
Mall.Module.Miai/MiaiModule.cs
+99
-14
RB_MiAi_BaseInfoRepository.cs
Mall.Repository/Miai/RB_MiAi_BaseInfoRepository.cs
+57
-1
MallHelper.cs
Mall.WebApi/Controllers/Mall/MallHelper.cs
+145
-5
AppletMiaiController.cs
Mall.WebApi/Controllers/Miai/AppletMiaiController.cs
+198
-33
No files found.
Mall.Common/Plugin/StringHelper.cs
View file @
b7c379e6
...
...
@@ -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
)
{
...
...
Mall.Model/Entity/Miai/RB_MiAi_BaseInfo.cs
View file @
b7c379e6
...
...
@@ -81,6 +81,87 @@ namespace Mall.Model.Entity.Miai
public
string
IDCardBack
{
get
;
set
;
}
/// <summary>
/// 户口
/// </summary>
public
string
HuKou
{
get
;
set
;
}
/// <summary>
/// 籍贯
/// </summary>
public
string
NativePlace
{
get
;
set
;
}
/// <summary>
/// 房屋信息
/// </summary>
public
string
HouseInfo
{
get
;
set
;
}
/// <summary>
/// 学校信息
/// </summary>
public
string
SchoolInfo
{
get
;
set
;
}
/// <summary>
/// 年收入
/// </summary>
public
string
YearMoney
{
get
;
set
;
}
/// <summary>
/// 职务
/// </summary>
public
string
Job
{
get
;
set
;
}
/// <summary>
/// 其他兄弟姐妹
/// </summary>
public
string
OtherPople
{
get
;
set
;
}
/// <summary>
/// 专业
/// </summary>
public
string
MajorInfo
{
get
;
set
;
}
/// <summary>
/// 车辆信息
/// </summary>
public
string
CarInfo
{
get
;
set
;
}
/// <summary>
/// 父亲工作信息
/// </summary>
public
string
FatherInfo
{
get
;
set
;
}
/// <summary>
/// 母亲工作信息
/// </summary>
public
string
MotherInfo
{
get
;
set
;
}
/// <summary>
/// 关于
/// </summary>
public
string
About
{
get
;
set
;
}
/// <summary>
/// 理想爱情
/// </summary>
public
string
IdealLove
{
get
;
set
;
}
/// <summary>
/// 相册
/// </summary>
public
string
Album
{
get
;
set
;
}
/// <summary>
/// 浏览数
/// </summary>
public
int
BrowseNum
{
get
;
set
;
}
/// <summary>
/// 关注数
/// </summary>
public
int
FollowNum
{
get
;
set
;
}
/// <summary>
/// 商户号Id
/// </summary>
...
...
Mall.Model/Extend/MarketingCenter/RB_Miniprogram_Template_Extend.cs
View file @
b7c379e6
...
...
@@ -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
Mall.Model/Extend/Miai/RB_MiAi_BaseInfo_Extend.cs
View file @
b7c379e6
...
...
@@ -5,8 +5,29 @@ using Mall.Model.Entity.Miai;
namespace
Mall.Model.Extend.Miai
{
public
class
RB_MiAi_BaseInfo_Extend
:
RB_MiAi_BaseInfo
public
class
RB_MiAi_BaseInfo_Extend
:
RB_MiAi_BaseInfo
{
/// <summary>
/// 相册
/// </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
;
}
}
}
Mall.Module.MarketingCenter/MiniprogramTemplateModule.cs
View file @
b7c379e6
...
...
@@ -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
;
...
...
Mall.Module.Miai/MiaiModule.cs
View file @
b7c379e6
...
...
@@ -81,7 +81,8 @@ namespace Mall.Module.Miai
bool
flag
=
miai_ForumRepository
.
Update
(
keyValues
,
wheres
);
return
flag
;
}
else
{
else
{
bool
flag
=
miai_ForumRepository
.
Insert
(
demodel
)
>
0
;
return
flag
;
}
...
...
@@ -113,7 +114,8 @@ namespace Mall.Module.Miai
bool
flag
=
miai_ForumRepository
.
Update
(
keyValues
,
wheres
);
return
flag
;
}
else
{
else
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Miai_Forum_Extend
.
Status
),
1
},
{
nameof
(
RB_Miai_Forum_Extend
.
UpdateDate
),
DateTime
.
Now
},
...
...
@@ -260,7 +262,8 @@ namespace Mall.Module.Miai
};
return
miai_ActivityRepository
.
Update
(
keyValues
,
wheres
);
}
else
{
else
{
return
miai_ActivityRepository
.
Insert
(
demodel
)
>
0
;
}
}
...
...
@@ -288,7 +291,8 @@ namespace Mall.Module.Miai
}
};
bool
flag
=
miai_ActivityRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
if
(
flag
)
{
miai_LogRepository
.
Insert
(
new
Model
.
Entity
.
Miai
.
RB_Miai_Log
()
{
Id
=
0
,
...
...
@@ -355,20 +359,24 @@ namespace Mall.Module.Miai
{
demodel
.
ParentId
=
-
1
;
//查询主评论
var
list
=
miai_ActivityDiscussRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
if
(
list
.
Any
())
{
if
(
list
.
Any
())
{
//查询评论下 前几条回复记录
List
<
int
>
PidsList
=
list
.
Select
(
x
=>
x
.
Id
).
ToList
();
var
clist
=
miai_ActivityDiscussRepository
.
GetActivityDiscussChildList
(
PidsList
,
4
);
//查询评论回复数量
var
rlist
=
miai_ActivityDiscussRepository
.
GetDiscussReplyNumList
(
string
.
Join
(
","
,
PidsList
));
foreach
(
var
item
in
list
)
{
foreach
(
var
item
in
list
)
{
item
.
ReplyList
=
clist
.
Where
(
x
=>
x
.
ParentId
==
item
.
Id
).
OrderBy
(
x
=>
x
.
Id
).
ToList
();
item
.
ReplyNum
=
rlist
.
Where
(
x
=>
x
.
ParentId
==
item
.
Id
).
FirstOrDefault
()?.
ReplyNum
??
0
;
item
.
ImageList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
item
.
Images
)
&&
item
.
Images
!=
"[]"
)
{
if
(!
string
.
IsNullOrEmpty
(
item
.
Images
)
&&
item
.
Images
!=
"[]"
)
{
item
.
ImageList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
item
.
Images
);
}
foreach
(
var
qitem
in
item
.
ReplyList
)
{
foreach
(
var
qitem
in
item
.
ReplyList
)
{
qitem
.
ImageList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
qitem
.
Images
)
&&
qitem
.
Images
!=
"[]"
)
{
...
...
@@ -481,7 +489,7 @@ namespace Mall.Module.Miai
/// <param name="discussId"></param>
/// <param name="empId"></param>
/// <returns></returns>
public
string
DelActivityDiscussInfo_V2
(
int
discussId
,
int
empId
,
int
TenantId
,
int
MallBaseId
)
public
string
DelActivityDiscussInfo_V2
(
int
discussId
,
int
empId
,
int
TenantId
,
int
MallBaseId
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
Status
),
1
},
...
...
@@ -559,7 +567,8 @@ namespace Mall.Module.Miai
if
(
list
.
Any
())
{
return
"已存在报名信息"
;
}
var
model
=
miai_ActivityRepository
.
GetEntity
(
demodel
.
ActivityId
);
if
(
model
==
null
||
model
.
Status
==
1
)
{
return
"活动不存在"
;
}
if
(
model
.
Deadline
<=
DateTime
.
Now
)
{
if
(
model
.
Deadline
<=
DateTime
.
Now
)
{
return
"已过了报名时间,无法报名"
;
}
bool
flag
=
miai_ActivityEnrollRepository
.
Insert
(
demodel
)
>
0
;
...
...
@@ -672,8 +681,59 @@ namespace Mall.Module.Miai
{
flag
=
miai_BaseInfoRepository
.
Insert
(
model
)
>
0
;
}
else
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
//{ 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
.
HuKou
),
model
.
HuKou
},
{
nameof
(
RB_MiAi_BaseInfo_Extend
.
NativePlace
),
model
.
NativePlace
},
{
nameof
(
RB_MiAi_BaseInfo_Extend
.
HouseInfo
),
model
.
HouseInfo
},
{
nameof
(
RB_MiAi_BaseInfo_Extend
.
SchoolInfo
),
model
.
SchoolInfo
},
{
nameof
(
RB_MiAi_BaseInfo_Extend
.
YearMoney
),
model
.
YearMoney
},
{
nameof
(
RB_MiAi_BaseInfo_Extend
.
Job
),
model
.
Job
},
{
nameof
(
RB_MiAi_BaseInfo_Extend
.
OtherPople
),
model
.
OtherPople
},
{
nameof
(
RB_MiAi_BaseInfo_Extend
.
MajorInfo
),
model
.
MajorInfo
},
{
nameof
(
RB_MiAi_BaseInfo_Extend
.
CarInfo
),
model
.
CarInfo
},
{
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
.
Album
),
model
.
Album
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_MiAi_BaseInfo_Extend
.
Id
),
FiledValue
=
model
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
flag
=
miai_BaseInfoRepository
.
Update
(
keyValues
,
wheres
);
}
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
我的粉丝
/
我的关注
...
...
@@ -682,15 +742,15 @@ namespace Mall.Module.Miai
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
AddOrUpdateFollowMember
(
RB_MiAi_FollowMember
model
)
public
bool
AddOrUpdateFollowMember
(
RB_MiAi_FollowMember
model
,
RB_MiAi_BaseInfo_Extend
baseInfo
)
{
bool
flag
=
false
;
try
{
if
(
model
.
ID
==
0
)
{
flag
=
miai_FollowMemberRepository
.
Insert
(
model
)
>
0
;
baseInfo
.
FollowNum
+=
1
;
}
else
{
...
...
@@ -705,8 +765,30 @@ namespace Mall.Module.Miai
OperatorEnum
=
OperatorEnum
.
Equal
}
};
if
(
model
.
Status
==
1
)
//取消关注
{
baseInfo
.
FollowNum
-=
1
;
}
else
{
baseInfo
.
FollowNum
+=
1
;
}
flag
=
miai_FollowMemberRepository
.
Update
(
keyValues
,
wheres
);
}
if
(
flag
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_MiAi_BaseInfo_Extend
.
FollowNum
),
baseInfo
.
FollowNum
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_MiAi_BaseInfo_Extend
.
Id
),
FiledValue
=
baseInfo
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
miai_BaseInfoRepository
.
Update
(
keyValues
,
wheres
);
}
}
catch
(
Exception
ex
)
{
...
...
@@ -782,7 +864,10 @@ namespace Mall.Module.Miai
}
return
list
;
}
#
endregion
}
#
endregion
}
}
Mall.Repository/Miai/RB_MiAi_BaseInfoRepository.cs
View file @
b7c379e6
...
...
@@ -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
();
}
}
}
Mall.WebApi/Controllers/Mall/MallHelper.cs
View file @
b7c379e6
...
...
@@ -92,7 +92,10 @@ namespace Mall.WebApi.Controllers
/// 模板处理类
/// </summary>
private
static
MiniprogramTemplateModule
miniprogramTemplateModule
=
new
MiniprogramTemplateModule
();
/// <summary>
/// 模板处理类
/// </summary>
private
static
Module
.
Miai
.
MiaiModule
miaiModule
=
new
Module
.
Miai
.
MiaiModule
();
/// <summary>
/// 解析插件数据为对象
...
...
@@ -139,14 +142,14 @@ namespace Mall.WebApi.Controllers
var
navPageData
=
subItem
.
data
as
navPageItem
;
if
(
navPageData
!=
null
&&
navPageData
.
navs
!=
null
&&
navPageData
.
navs
.
Count
>
0
)
{
var
subList
=
navPageData
.
navs
.
Where
(
qitem
=>
qitem
.
ShowType
==
1
)?.
ToList
()
??
new
List
<
navPageIconItem
>
();
var
subList
=
navPageData
.
navs
.
Where
(
qitem
=>
qitem
.
ShowType
==
1
)?.
ToList
()
??
new
List
<
navPageIconItem
>
();
if
(
subList
!=
null
&&
subList
.
Count
>
0
)
{
string
tempIds
=
string
.
Join
(
","
,
subList
.
Select
(
qitem
=>
qitem
.
TemplateId
));
List
<
RB_Miniprogram_Template_Extend
>
tempList
=
new
List
<
RB_Miniprogram_Template_Extend
>();
if
(!
string
.
IsNullOrEmpty
(
tempIds
))
{
tempList
=
miniprogramTemplateModule
.
GetMiniprogramTemplateListModule
(
new
RB_Miniprogram_Template_Extend
()
{
QIds
=
tempIds
},
IsAnalyzePlus
:
true
);
tempList
=
miniprogramTemplateModule
.
GetMiniprogramTemplateListModule
(
new
RB_Miniprogram_Template_Extend
()
{
QIds
=
tempIds
},
IsAnalyzePlus
:
true
);
}
foreach
(
var
item
in
navPageData
.
navs
)
{
...
...
@@ -1275,6 +1278,143 @@ namespace Mall.WebApi.Controllers
data
=
reserveStoreInfo
};
break
;
//详情-人物插件
case
"miaiuser"
:
var
miAiUserItem
=
subItem
.
data
as
MiAiUserItem
;
if
(
miAiUserItem
!=
null
)
{
//自定义商品
if
(
miAiUserItem
.
addUserType
==
0
)
{
if
(
miAiUserItem
.
list
!=
null
&&
miAiUserItem
.
list
.
Count
>
0
)
{
var
Ids
=
"0,"
+
string
.
Join
(
","
,
miAiUserItem
.
list
.
Select
(
qitem
=>
qitem
.
id
));
long
rowCount
=
0
;
var
tempGoodsList
=
miaiModule
.
GetFirstBaseInfoPageList
(
1
,
miAiUserItem
.
goodsLength
,
out
rowCount
,
new
Model
.
Extend
.
Miai
.
RB_MiAi_BaseInfo_Extend
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
UserIds
=
Ids
});
List
<
miaiUserDetail
>
newGoodsList
=
new
List
<
miaiUserDetail
>();
foreach
(
var
goodItem
in
miAiUserItem
.
list
)
{
var
lastItem
=
new
miaiUserDetail
();
var
tempGood
=
tempGoodsList
?.
Where
(
qitem
=>
qitem
.
UserId
==
goodItem
.
id
)?.
FirstOrDefault
();
if
(
tempGood
!=
null
&&
tempGood
.
Id
>
0
)
{
lastItem
.
id
=
tempGood
.
UserId
;
lastItem
.
name
=
tempGood
.
Name
;
lastItem
.
Photo
=
tempGood
.
Photo
;
lastItem
.
SexStr
=
tempGood
.
Sex
==
1
?
"男"
:
"女"
;
lastItem
.
Age
=
Common
.
Plugin
.
StringHelper
.
GetAge
(
tempGood
.
Birthday
);
lastItem
.
Marriage
=
(
tempGood
.
Marriage
.
HasValue
&&
tempGood
.
Marriage
.
Value
>
0
)
?
Common
.
Plugin
.
EnumHelper
.
GetEnumName
(
tempGood
.
Marriage
)
:
""
;
lastItem
.
Education
=
(
tempGood
.
EducationType
.
HasValue
&&
tempGood
.
EducationType
.
Value
>
0
)
?
Common
.
Plugin
.
EnumHelper
.
GetEnumName
(
tempGood
.
EducationType
)
:
""
;
lastItem
.
MatchingRate
=
0
;
lastItem
.
Score
=
0
;
lastItem
.
Album
=
tempGood
.
Album
;
if
(!
string
.
IsNullOrWhiteSpace
(
lastItem
.
Album
))
{
lastItem
.
AlbumList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
lastItem
.
Album
);
}
newGoodsList
.
Add
(
lastItem
);
}
}
miAiUserItem
.
list
=
newGoodsList
;
}
}
else
if
(
miAiUserItem
.
addUserType
==
1
)
//匹配度暂无规则
{
}
else
if
(
miAiUserItem
.
addUserType
==
2
)
{
long
rowCount
=
0
;
var
tempGoodsList
=
miaiModule
.
GetFirstBaseInfoPageList
(
1
,
miAiUserItem
.
goodsLength
,
out
rowCount
,
new
Model
.
Extend
.
Miai
.
RB_MiAi_BaseInfo_Extend
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
Sort
=
2
});
List
<
miaiUserDetail
>
newGoodsList
=
new
List
<
miaiUserDetail
>();
foreach
(
var
goodItem
in
miAiUserItem
.
list
)
{
var
lastItem
=
new
miaiUserDetail
();
var
tempGood
=
tempGoodsList
?.
Where
(
qitem
=>
qitem
.
UserId
==
goodItem
.
id
)?.
FirstOrDefault
();
if
(
tempGood
!=
null
&&
tempGood
.
Id
>
0
)
{
lastItem
.
id
=
tempGood
.
UserId
;
lastItem
.
name
=
tempGood
.
Name
;
lastItem
.
Photo
=
tempGood
.
Photo
;
lastItem
.
SexStr
=
tempGood
.
Sex
==
1
?
"男"
:
"女"
;
lastItem
.
Age
=
Common
.
Plugin
.
StringHelper
.
GetAge
(
tempGood
.
Birthday
);
lastItem
.
Marriage
=
(
tempGood
.
Marriage
.
HasValue
&&
tempGood
.
Marriage
.
Value
>
0
)
?
Common
.
Plugin
.
EnumHelper
.
GetEnumName
(
tempGood
.
Marriage
)
:
""
;
lastItem
.
Education
=
(
tempGood
.
EducationType
.
HasValue
&&
tempGood
.
EducationType
.
Value
>
0
)
?
Common
.
Plugin
.
EnumHelper
.
GetEnumName
(
tempGood
.
EducationType
)
:
""
;
lastItem
.
MatchingRate
=
0
;
lastItem
.
Score
=
0
;
lastItem
.
Album
=
tempGood
.
Album
;
if
(!
string
.
IsNullOrWhiteSpace
(
lastItem
.
Album
))
{
lastItem
.
AlbumList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
lastItem
.
Album
);
}
newGoodsList
.
Add
(
lastItem
);
}
}
miAiUserItem
.
list
=
newGoodsList
;
}
else
if
(
miAiUserItem
.
addUserType
==
3
)
{
long
rowCount
=
0
;
var
tempGoodsList
=
miaiModule
.
GetFirstBaseInfoPageList
(
1
,
miAiUserItem
.
goodsLength
,
out
rowCount
,
new
Model
.
Extend
.
Miai
.
RB_MiAi_BaseInfo_Extend
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
Sort
=
3
});
List
<
miaiUserDetail
>
newGoodsList
=
new
List
<
miaiUserDetail
>();
foreach
(
var
goodItem
in
miAiUserItem
.
list
)
{
var
lastItem
=
new
miaiUserDetail
();
var
tempGood
=
tempGoodsList
?.
Where
(
qitem
=>
qitem
.
UserId
==
goodItem
.
id
)?.
FirstOrDefault
();
if
(
tempGood
!=
null
&&
tempGood
.
Id
>
0
)
{
lastItem
.
id
=
tempGood
.
UserId
;
lastItem
.
name
=
tempGood
.
Name
;
lastItem
.
Photo
=
tempGood
.
Photo
;
lastItem
.
SexStr
=
tempGood
.
Sex
==
1
?
"男"
:
"女"
;
lastItem
.
Age
=
Common
.
Plugin
.
StringHelper
.
GetAge
(
tempGood
.
Birthday
);
lastItem
.
Marriage
=
(
tempGood
.
Marriage
.
HasValue
&&
tempGood
.
Marriage
.
Value
>
0
)
?
Common
.
Plugin
.
EnumHelper
.
GetEnumName
(
tempGood
.
Marriage
)
:
""
;
lastItem
.
Education
=
(
tempGood
.
EducationType
.
HasValue
&&
tempGood
.
EducationType
.
Value
>
0
)
?
Common
.
Plugin
.
EnumHelper
.
GetEnumName
(
tempGood
.
EducationType
)
:
""
;
lastItem
.
MatchingRate
=
0
;
lastItem
.
Score
=
0
;
lastItem
.
Album
=
tempGood
.
Album
;
if
(!
string
.
IsNullOrWhiteSpace
(
lastItem
.
Album
))
{
lastItem
.
AlbumList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
lastItem
.
Album
);
}
newGoodsList
.
Add
(
lastItem
);
}
}
miAiUserItem
.
list
=
newGoodsList
;
}
}
obj
=
new
{
id
=
subItem
.
Id
,
data
=
miAiUserItem
};
break
;
}
return
obj
;
}
...
...
@@ -1425,7 +1565,7 @@ namespace Mall.WebApi.Controllers
top
=
"0"
,
isfullscreen
=
false
,
backgroundimage
=
""
,
radius
=
"0"
radius
=
"0"
}
});
templateData
.
data
.
Add
(
new
...
...
@@ -2546,7 +2686,7 @@ namespace Mall.WebApi.Controllers
is_show_cart
=
mallBaseModel
?.
ListShopCar
,
is_show_sales_num
=
mallBaseModel
?.
ListBuyCount
,
is_show_goods_name
=
mallBaseModel
?.
ListName
,
is_show_goods_price
=
mallBaseModel
?.
IsShowPrice
??
0
,
//是否显示商品价格【hk2020-02-21新增】
is_show_goods_price
=
mallBaseModel
?.
IsShowPrice
??
0
,
//是否显示商品价格【hk2020-02-21新增】
is_underline_price
=
mallBaseModel
?.
DetailsLineationPrice
,
is_express
=
mallBaseModel
?.
DeatilsExpress
,
is_not_share_show
=
mallBaseModel
?.
OtherNoShare
,
...
...
Mall.WebApi/Controllers/Miai/AppletMiaiController.cs
View file @
b7c379e6
...
...
@@ -59,12 +59,14 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetActivityPageList
(){
public
ApiResult
GetActivityPageList
()
{
var
parms
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
RB_Miai_Activity_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Miai_Activity_Extend
>(
parms
.
msg
.
ToString
());
if
(
demodel
.
ForumId
<=
0
)
{
if
(
demodel
.
ForumId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递版块id"
);
}
demodel
.
TenantId
=
userInfo
.
TenantId
;
...
...
@@ -94,11 +96,13 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetActivityInfo
(){
public
ApiResult
GetActivityInfo
()
{
var
userInfo
=
AppletUserInfo
;
var
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
int
ActivityId
=
parms
.
GetInt
(
"ActivityId"
,
0
);
if
(
ActivityId
<=
0
)
{
if
(
ActivityId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
...
...
@@ -111,7 +115,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetActivityInfo
()
{
public
ApiResult
SetActivityInfo
()
{
var
parms
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
RB_Miai_Activity_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Miai_Activity_Extend
>(
parms
.
msg
.
ToString
());
...
...
@@ -119,13 +124,16 @@ namespace Mall.WebApi.Controllers.MallBase
{
return
ApiResult
.
ParamIsNull
(
"请传递版块id"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
ActivityTitle
))
{
if
(
string
.
IsNullOrEmpty
(
demodel
.
ActivityTitle
))
{
return
ApiResult
.
ParamIsNull
(
"请传递标题名称"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
Content
))
{
if
(
string
.
IsNullOrEmpty
(
demodel
.
Content
))
{
return
ApiResult
.
ParamIsNull
(
"请传递内容"
);
}
if
(
demodel
.
Deadline
<
DateTime
.
Now
)
{
if
(
demodel
.
Deadline
<
DateTime
.
Now
)
{
return
ApiResult
.
ParamIsNull
(
"请重新选择报名截止日期"
);
}
demodel
.
ImageList
??=
new
List
<
string
>();
...
...
@@ -141,7 +149,8 @@ namespace Mall.WebApi.Controllers.MallBase
{
return
ApiResult
.
Success
();
}
else
{
else
{
return
ApiResult
.
Failed
();
}
}
...
...
@@ -151,11 +160,13 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
DelActivityInfo
()
{
public
ApiResult
DelActivityInfo
()
{
var
userInfo
=
AppletUserInfo
;
var
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
int
ActivityId
=
parms
.
GetInt
(
"ActivityId"
,
0
);
if
(
ActivityId
<=
0
)
{
if
(
ActivityId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
...
...
@@ -164,7 +175,8 @@ namespace Mall.WebApi.Controllers.MallBase
{
return
ApiResult
.
Success
();
}
else
{
else
{
return
ApiResult
.
Failed
(
msg
);
}
}
...
...
@@ -197,7 +209,8 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
Sex
,
x
.
Content
,
x
.
ImageList
,
ReplyList
=
x
.
ReplyList
.
Select
(
z
=>
new
{
ReplyList
=
x
.
ReplyList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
UserId
,
z
.
UserName
,
...
...
@@ -219,7 +232,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetActivityReplyPageList
(){
public
ApiResult
GetActivityReplyPageList
()
{
var
parms
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
...
...
@@ -253,7 +267,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SgetActivityDiscussInfo
()
{
public
ApiResult
SgetActivityDiscussInfo
()
{
var
parms
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
RB_Miai_ActivityDiscuss_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Miai_ActivityDiscuss_Extend
>(
parms
.
msg
.
ToString
());
...
...
@@ -265,7 +280,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
return
ApiResult
.
ParamIsNull
(
"请传递内容"
);
}
demodel
.
ImageList
??=
new
List
<
string
>();
demodel
.
Images
=
JsonConvert
.
SerializeObject
(
demodel
.
ImageList
);
demodel
.
TenantId
=
userInfo
.
TenantId
;
...
...
@@ -316,7 +331,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetActivityEnrollPageList
()
{
public
ApiResult
GetActivityEnrollPageList
()
{
var
parms
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
...
...
@@ -351,7 +367,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetActivityEnrollInfo
()
{
public
ApiResult
SetActivityEnrollInfo
()
{
var
parms
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
RB_Miai_ActivityEnroll_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Miai_ActivityEnroll_Extend
>(
parms
.
msg
.
ToString
());
...
...
@@ -363,7 +380,8 @@ namespace Mall.WebApi.Controllers.MallBase
{
return
ApiResult
.
ParamIsNull
(
"请传递姓名"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
Mobile
))
{
if
(
string
.
IsNullOrEmpty
(
demodel
.
Mobile
))
{
return
ApiResult
.
ParamIsNull
(
"请传递手机号码"
);
}
...
...
@@ -389,7 +407,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
CancelActivityEnrollInfo
()
{
public
ApiResult
CancelActivityEnrollInfo
()
{
var
userInfo
=
AppletUserInfo
;
var
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
int
EnrollId
=
parms
.
GetInt
(
"EnrollId"
,
0
);
...
...
@@ -414,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
());
...
...
@@ -433,7 +453,8 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
PeopleNum
,
x
.
Remark
,
x
.
Status
,
ActivityModel
=
new
{
ActivityModel
=
new
{
x
.
ActivityModel
?.
Id
,
x
.
ActivityModel
?.
ActivityTitle
,
x
.
ActivityModel
?.
UserId
,
...
...
@@ -493,10 +514,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
return
ApiResult
.
Failed
(
"请选择身高"
);
}
if
(
baseInfo
.
Height
==
0
)
{
return
ApiResult
.
Failed
(
"请选择身高"
);
}
if
(!
baseInfo
.
EducationType
.
HasValue
||
(
int
)
baseInfo
.
EducationType
==
0
)
{
return
ApiResult
.
Failed
(
"请选择学历"
);
...
...
@@ -521,21 +539,154 @@ namespace Mall.WebApi.Controllers.MallBase
{
return
ApiResult
.
Failed
(
"请上传身份证国徽面"
);
}
if
(
baseInfo
.
AlbumList
!=
null
&&
baseInfo
.
AlbumList
.
Any
())
{
baseInfo
.
Album
=
JsonConvert
.
SerializeObject
(
baseInfo
.
AlbumList
);
}
else
{
baseInfo
.
Album
=
""
;
}
var
oldBaseInfo
=
miaiModule
.
GetBaseInfoList
(
new
RB_MiAi_BaseInfo_Extend
{
UserId
=
baseInfo
.
UserId
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
if
(
oldBaseInfo
==
null
&&
oldBaseInfo
.
Id
==
0
)
if
(
oldBaseInfo
!=
null
&&
oldBaseInfo
.
Id
>
0
)
{
if
(
miaiModule
.
SetMiAiBaseInfo
(
baseInfo
))
baseInfo
.
Id
=
oldBaseInfo
.
Id
;
}
if
(
miaiModule
.
SetMiAiBaseInfo
(
baseInfo
))
{
return
ApiResult
.
Success
(
"基础资料填写成功"
);
}
else
{
return
ApiResult
.
Failed
(
"基础资料填写失败"
);
}
}
/// <summary>
/// 生肖
/// </summary>
/// <param name="birthday"></param>
/// <returns></returns>
public
string
GetShengXiao
(
DateTime
birthday
)
{
System
.
Globalization
.
ChineseLunisolarCalendar
chinseCaleander
=
new
System
.
Globalization
.
ChineseLunisolarCalendar
();
string
TreeYear
=
"鼠牛虎兔龙蛇马羊猴鸡狗猪"
;
int
intYear
=
chinseCaleander
.
GetSexagenaryYear
(
birthday
);
string
Tree
=
TreeYear
.
Substring
(
chinseCaleander
.
GetTerrestrialBranch
(
intYear
)
-
1
,
1
);
return
Tree
;
}
/// <summary>
/// 获取星座
/// </summary>
/// <param name="birthday"></param>
/// <returns></returns>
public
string
GetAtomFromBirthday
(
DateTime
birthday
)
{
float
birthdayF
=
0.00F
;
if
(
birthday
.
Month
==
1
&&
birthday
.
Day
<
20
)
{
birthdayF
=
float
.
Parse
(
string
.
Format
(
"13.{0}"
,
birthday
.
Day
));
}
else
{
birthdayF
=
float
.
Parse
(
string
.
Format
(
"{0}.{1}"
,
birthday
.
Month
,
birthday
.
Day
));
}
float
[]
atomBound
=
{
1.20F
,
2.20F
,
3.21F
,
4.21F
,
5.21F
,
6.22F
,
7.23F
,
8.23F
,
9.23F
,
10.23F
,
11.21F
,
12.22F
,
13.20F
};
string
[]
atoms
=
{
"水瓶座"
,
"双鱼座"
,
"白羊座"
,
"金牛座"
,
"双子座"
,
"巨蟹座"
,
"狮子座"
,
"处女座"
,
"天秤座"
,
"天蝎座"
,
"射手座"
,
"魔羯座"
};
string
ret
=
"靠!外星人啊。"
;
for
(
int
i
=
0
;
i
<
atomBound
.
Length
-
1
;
i
++)
{
if
(
atomBound
[
i
]
<=
birthdayF
&&
atomBound
[
i
+
1
]
>
birthdayF
)
{
ret
=
atoms
[
i
];
break
;
}
}
return
ret
;
}
public
ApiResult
GetMiAiBaseIfo
()
{
var
req
=
RequestParm
;
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
())
{
return
ApiResult
.
Success
(
"基础资料填写成功"
)
;
isFollow
=
2
;
}
else
{
return
ApiResult
.
Failed
(
"基础资料填写失败"
)
;
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
)
{
oldBaseInfo
.
AlbumList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrWhiteSpace
(
oldBaseInfo
.
Album
))
{
oldBaseInfo
.
AlbumList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
oldBaseInfo
.
Album
);
}
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
)
?
""
:
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
,
oldBaseInfo
.
Weight
,
Marriage
=
(
oldBaseInfo
.
Marriage
.
HasValue
&&
oldBaseInfo
.
Marriage
.
Value
>
0
)
?
EnumHelper
.
GetEnumName
(
oldBaseInfo
.
Marriage
)
:
""
,
EducationType
=
(
oldBaseInfo
.
EducationType
.
HasValue
&&
oldBaseInfo
.
EducationType
.
Value
>
0
)
?
EnumHelper
.
GetEnumName
(
oldBaseInfo
.
EducationType
)
:
""
,
YearMoney
=
oldBaseInfo
.
YearMoney
??
""
,
HuKou
=
oldBaseInfo
.
HuKou
??
""
,
NativePlace
=
oldBaseInfo
.
NativePlace
??
""
,
HouseInfo
=
oldBaseInfo
.
HouseInfo
??
""
,
SchoolInfo
=
oldBaseInfo
.
SchoolInfo
??
""
,
MotherInfo
=
oldBaseInfo
.
MotherInfo
??
""
,
FatherInfo
=
oldBaseInfo
.
FatherInfo
??
""
,
Job
=
oldBaseInfo
.
Job
??
""
,
OtherPople
=
oldBaseInfo
.
OtherPople
??
""
,
MajorInfo
=
oldBaseInfo
.
MajorInfo
??
""
,
CarInfo
=
oldBaseInfo
.
CarInfo
??
""
,
About
=
oldBaseInfo
.
About
??
""
,
IdealLove
=
oldBaseInfo
.
IdealLove
??
""
,
oldBaseInfo
.
AlbumList
};
return
ApiResult
.
Success
(
""
,
result
);
}
else
{
return
ApiResult
.
Failed
(
"
请勿重复填写基础资料
"
);
return
ApiResult
.
Failed
(
"
用户暂未认证
"
);
}
}
...
...
@@ -659,6 +810,20 @@ namespace Mall.WebApi.Controllers.MallBase
}
else
{
var
oldBaseInfo
=
miaiModule
.
GetBaseInfoList
(
new
RB_MiAi_BaseInfo_Extend
{
UserId
=
query
.
CreateBy
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
if
(
oldBaseInfo
==
null
||
oldBaseInfo
.
Id
==
0
)
{
return
ApiResult
.
Failed
(
"您未实名认证,无法关注"
);
}
oldBaseInfo
=
miaiModule
.
GetBaseInfoList
(
new
RB_MiAi_BaseInfo_Extend
{
UserId
=
query
.
UserId
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
if
(
oldBaseInfo
==
null
||
oldBaseInfo
.
Id
==
0
)
{
return
ApiResult
.
Failed
(
"会员未实名认证,无法关注"
);
}
//判断是否已经关注过
var
oldList
=
miaiModule
.
GetFollowMemberList
(
new
RB_MiAi_FollowMember_Extend
{
Status
=
-
1
,
UserId
=
query
.
UserId
,
CreateBy
=
query
.
CreateBy
,
MallBaseId
=
query
.
MallBaseId
,
TenantId
=
query
.
TenantId
});
;
if
(
query
.
ID
==
0
)
...
...
@@ -688,7 +853,7 @@ namespace Mall.WebApi.Controllers.MallBase
query
.
Status
=
1
;
}
bool
result
=
miaiModule
.
AddOrUpdateFollowMember
(
query
);
bool
result
=
miaiModule
.
AddOrUpdateFollowMember
(
query
,
oldBaseInfo
);
if
(
isUpdate
)
{
if
(
result
)
...
...
@@ -730,7 +895,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
return
ApiResult
.
Failed
(
"请重新登录"
);
}
Rb_Education_Dynamic_Extend
article
=
JsonConvert
.
DeserializeObject
<
Rb_Education_Dynamic_Extend
>(
req
.
msg
.
ToString
());
article
.
Content
=
StringHelper
.
UrlDecode
(
article
.
Content
);
if
(
string
.
IsNullOrWhiteSpace
(
article
.
Content
)
&&
(
article
.
FileList
==
null
||
!
article
.
FileList
.
Any
()))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment