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
5241cfc4
Commit
5241cfc4
authored
Mar 03, 2021
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
57293efa
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
151 additions
and
61 deletions
+151
-61
StringHelper.cs
Mall.Common/Plugin/StringHelper.cs
+52
-0
RB_Miniprogram_Template_Extend.cs
.../Extend/MarketingCenter/RB_Miniprogram_Template_Extend.cs
+14
-0
RB_MiAi_BaseInfo_Extend.cs
Mall.Model/Extend/Miai/RB_MiAi_BaseInfo_Extend.cs
+11
-0
MiniprogramTemplateModule.cs
Mall.Module.MarketingCenter/MiniprogramTemplateModule.cs
+11
-8
RB_MiAi_BaseInfoRepository.cs
Mall.Repository/Miai/RB_MiAi_BaseInfoRepository.cs
+2
-1
MallHelper.cs
Mall.WebApi/Controllers/Mall/MallHelper.cs
+3
-1
AppletMiaiController.cs
Mall.WebApi/Controllers/Miai/AppletMiaiController.cs
+2
-51
MiaiController.cs
Mall.WebApi/Controllers/Miai/MiaiController.cs
+56
-0
No files found.
Mall.Common/Plugin/StringHelper.cs
View file @
5241cfc4
...
...
@@ -52,6 +52,58 @@ namespace Mall.Common.Plugin
#
region
"日期相关"
/// <summary>
/// 生肖
/// </summary>
/// <param name="birthday"></param>
/// <returns></returns>
public
static
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
static
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
;
}
/// <summary>
/// 年龄
/// </summary>
...
...
Mall.Model/Extend/MarketingCenter/RB_Miniprogram_Template_Extend.cs
View file @
5241cfc4
...
...
@@ -3033,6 +3033,20 @@ namespace Mall.Model.Extend.MarketingCenter
/// </summary>
public
int
addUserType
{
get
;
set
;
}
/// <summary>
/// 浏览权重
/// </summary>
public
decimal
BrowseRate
{
get
;
set
;
}
/// <summary>
/// 关注权重
/// </summary>
public
decimal
FollowRate
{
get
;
set
;
}
/// <summary>
/// 背景颜色
/// </summary>
...
...
Mall.Model/Extend/Miai/RB_MiAi_BaseInfo_Extend.cs
View file @
5241cfc4
...
...
@@ -29,5 +29,16 @@ namespace Mall.Model.Extend.Miai
/// 0-指定用户,1-按照匹配度,2-按照热度,3-按照最新
/// </summary>
public
int
Sort
{
get
;
set
;
}
/// <summary>
/// 浏览权重
/// </summary>
public
decimal
BrowseRate
{
get
;
set
;
}
/// <summary>
/// 关注权重
/// </summary>
public
decimal
FollowRate
{
get
;
set
;
}
}
}
Mall.Module.MarketingCenter/MiniprogramTemplateModule.cs
View file @
5241cfc4
...
...
@@ -154,13 +154,13 @@ namespace Mall.Module.MarketingCenter
nModel
.
btnColor
=
(
nObj
[
"btnColor"
]
!=
null
&&
!
string
.
IsNullOrEmpty
(
nObj
[
"btnColor"
].
ToString
()))
?
nObj
[
"btnColor"
].
ToString
()
:
"#ff4544"
;
Int32
.
TryParse
(
nObj
[
"btnWidth"
].
ToString
(),
out
int
btnWidth
);
nModel
.
btnWidth
=
btnWidth
>
0
?
btnWidth
:
500
;
nModel
.
btnWidth
=
btnWidth
>
0
?
btnWidth
:
500
;
Int32
.
TryParse
(
nObj
[
"btnHeight"
].
ToString
(),
out
int
btnHeight
);
nModel
.
btnHeight
=
btnHeight
>
0
?
btnHeight
:
80
;
nModel
.
btnHeight
=
btnHeight
>
0
?
btnHeight
:
80
;
Int32
.
TryParse
(
nObj
[
"btnRadius"
].
ToString
(),
out
int
btnRadius
);
nModel
.
btnRadius
=
btnRadius
>
0
?
btnRadius
:
40
;
nModel
.
btnRadius
=
btnRadius
>
0
?
btnRadius
:
40
;
nModel
.
btnText
=
(
nObj
[
"btnText"
]
!=
null
&&
!
string
.
IsNullOrEmpty
(
nObj
[
"btnText"
].
ToString
()))
?
nObj
[
"btnText"
].
ToString
()
:
"我知道了"
;
nModel
.
btnTextColor
=
(
nObj
[
"btnTextColor"
]
!=
null
&&
!
string
.
IsNullOrEmpty
(
nObj
[
"btnTextColor"
].
ToString
()))
?
nObj
[
"btnTextColor"
].
ToString
()
:
"#ffffff"
;
...
...
@@ -399,7 +399,8 @@ namespace Mall.Module.MarketingCenter
//图文插件
case
"image-text"
:
imagetextItem
imageItem
=
new
imagetextItem
();
try
{
try
{
var
imgData
=
JsonHelper
.
DeserializeObject
<
imagetextItem
>(
item
.
data
.
ToString
());
imageItem
.
content
=
imgData
.
content
.
Replace
(
'”'
,
'"'
).
Replace
(
"”/"
,
@""""
);
}
...
...
@@ -593,7 +594,7 @@ namespace Mall.Module.MarketingCenter
educationTeacherModel
.
TeacherList
=
driveData
.
TeacherList
;
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"AnalyzePlusModule_educationteacher"
);
}
...
...
@@ -636,6 +637,8 @@ namespace Mall.Module.MarketingCenter
miaiUserItem
.
PaddingLeft
=
driveData
?.
PaddingLeft
??
"0"
;
miaiUserItem
.
PaddingRight
=
driveData
?.
PaddingRight
??
"0"
;
miaiUserItem
.
SearchFilletPX
=
driveData
?.
SearchFilletPX
??
0
;
miaiUserItem
.
BrowseRate
=
miaiUserItem
.
addUserType
==
2
?
(
miaiUserItem
.
BrowseRate
==
0
?
1
:
miaiUserItem
.
BrowseRate
)
:
0
;
miaiUserItem
.
FollowRate
=
miaiUserItem
.
addUserType
==
2
?
(
miaiUserItem
.
FollowRate
==
0
?
1
:
miaiUserItem
.
FollowRate
)
:
0
;
miaiUserItem
.
list
=
new
List
<
miaiUserDetail
>();
miaiUserItem
.
list
=
driveData
.
list
;
}
...
...
Mall.Repository/Miai/RB_MiAi_BaseInfoRepository.cs
View file @
5241cfc4
...
...
@@ -124,7 +124,8 @@ LEFT JOIN rb_member_user as b on a.UserId=b.Id where a.Status=0 and b.Blacklis
}
else
if
(
where
.
Sort
==
2
)
{
sb
.
AppendFormat
(
" ORDER BY (a.FollowNum+a.BrowseNum) desc"
);
sb
.
AppendFormat
(
$@" ORDER BY (((a.FollowNum*
{
where
.
FollowRate
}
)+(a.BrowseNum*
{
where
.
BrowseRate
}
))) desc"
);
}
else
if
(
where
.
Sort
==
3
)
{
...
...
Mall.WebApi/Controllers/Mall/MallHelper.cs
View file @
5241cfc4
...
...
@@ -1339,7 +1339,9 @@ namespace Mall.WebApi.Controllers
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
Sort
=
2
Sort
=
2
,
FollowRate
=
miAiUserItem
.
FollowRate
==
0
?
1
:
miAiUserItem
.
FollowRate
,
BrowseRate
=
miAiUserItem
.
BrowseRate
==
0
?
1
:
miAiUserItem
.
BrowseRate
,
});
List
<
miaiUserDetail
>
newGoodsList
=
new
List
<
miaiUserDetail
>();
foreach
(
var
goodItem
in
miAiUserItem
.
list
)
...
...
Mall.WebApi/Controllers/Miai/AppletMiaiController.cs
View file @
5241cfc4
...
...
@@ -653,55 +653,6 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
/// <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
()
...
...
@@ -752,8 +703,8 @@ namespace Mall.WebApi.Controllers.MallBase
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
))),
//星座
ShenXiao
=
string
.
IsNullOrWhiteSpace
(
oldBaseInfo
.
Birthday
)
?
""
:
StringHelper
.
GetShengXiao
(
Convert
.
ToDateTime
((
oldBaseInfo
.
Birthday
))),
//生肖
ConoldBaseInfostellation
=
string
.
IsNullOrWhiteSpace
(
oldBaseInfo
.
Birthday
)
?
""
:
StringHelper
.
GetAtomFromBirthday
(
Convert
.
ToDateTime
((
oldBaseInfo
.
Birthday
))),
//星座
oldBaseInfo
.
Height
,
oldBaseInfo
.
Weight
,
Marriage
=
(
oldBaseInfo
.
Marriage
.
HasValue
&&
oldBaseInfo
.
Marriage
.
Value
>
0
)
?
EnumHelper
.
GetEnumName
(
oldBaseInfo
.
Marriage
)
:
""
,
...
...
Mall.WebApi/Controllers/Miai/MiaiController.cs
View file @
5241cfc4
...
...
@@ -445,6 +445,62 @@ namespace Mall.WebApi.Controllers.MallBase
#
endregion
#
region
基础信息
public
ApiResult
GetMiAiBaseIfo
()
{
var
parms
=
RequestParm
;
JObject
parm
=
JObject
.
Parse
(
parms
.
msg
.
ToString
());
// var userInfo = AppletUserInfo;
int
userId
=
parm
.
GetInt
(
"UserId"
);
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
{
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
)
?
""
:
StringHelper
.
GetShengXiao
(
Convert
.
ToDateTime
((
oldBaseInfo
.
Birthday
))),
//生肖
ConoldBaseInfostellation
=
string
.
IsNullOrWhiteSpace
(
oldBaseInfo
.
Birthday
)
?
""
:
StringHelper
.
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
(
"用户暂未认证"
);
}
}
#
endregion
}
}
\ No newline at end of file
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