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
a99264cf
Commit
a99264cf
authored
Nov 15, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 修改相亲 查看次数 =》 每周重置
parent
f50efb80
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
20 deletions
+63
-20
MemberLookModule.cs
Mall.Module.User/MemberLookModule.cs
+48
-5
ConfigValue.json
Mall.ThirdCore/ConfigValue.json
+1
-1
appsettings.json
Mall.WebApi/appsettings.json
+11
-11
appsettings.json
Mall.WindowsService/appsettings.json
+3
-3
No files found.
Mall.Module.User/MemberLookModule.cs
View file @
a99264cf
...
...
@@ -58,8 +58,8 @@ namespace Mall.Module.User
public
bool
AddMemberLookModule
(
RB_Member_Look_Extend
model
)
{
#
region
验证当月时长已存在
string
STime
=
DateTime
.
Now
.
ToString
(
"yyyy-MM"
)
+
"-01"
;
string
ETime
=
Convert
.
ToDateTime
(
STime
).
AddMonths
(
1
).
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd"
);
string
STime
=
GetMondayDate
().
ToString
(
"yyyy-MM-dd"
);
//本周一
string
ETime
=
GetSundayDate
().
ToString
(
"yyyy-MM-dd"
);
//本周日
var
list
=
member_LookRepository
.
GetMemberLookListRepository
(
new
RB_Member_Look_Extend
()
{
MallBaseId
=
model
.
MallBaseId
,
UserId
=
model
.
UserId
,
CreateBy
=
model
.
CreateBy
,
StartTime
=
STime
,
EndTime
=
ETime
});
if
(
list
.
Any
())
{
return
false
;
...
...
@@ -79,8 +79,8 @@ namespace Mall.Module.User
/// <returns></returns>
public
object
GetWeChatLookUser
(
int
userId
,
AppletUserInfo
userInfo
,
out
bool
IsLook
)
{
string
STime
=
DateTime
.
Now
.
ToString
(
"yyyy-MM"
)
+
"-01"
;
string
ETime
=
Convert
.
ToDateTime
(
STime
).
AddMonths
(
1
).
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd"
);
string
STime
=
GetMondayDate
().
ToString
(
"yyyy-MM-dd"
);
//本周一
string
ETime
=
GetSundayDate
().
ToString
(
"yyyy-MM-dd"
);
//本周日
//首先查询是否已查看
IsLook
=
false
;
var
list
=
member_LookRepository
.
GetMemberLookListRepository
(
new
RB_Member_Look_Extend
()
{
MallBaseId
=
userInfo
.
MallBaseId
,
UserId
=
userId
,
CreateBy
=
userInfo
.
UserId
,
StartTime
=
STime
,
EndTime
=
ETime
});
...
...
@@ -88,7 +88,7 @@ namespace Mall.Module.User
{
IsLook
=
true
;
}
//查询
当月已查看
次数
//查询
本周已查看次数 ld 2021-11-15 修改为周
次数
int
LookNum
=
member_LookRepository
.
GetMemberLookNum
(
userInfo
.
MallBaseId
,
userInfo
.
UserId
,
STime
,
ETime
);
//查询用户可查看次数
var
umodel
=
member_UserRepository
.
GetEntity
(
userInfo
.
UserId
);
...
...
@@ -108,5 +108,48 @@ namespace Mall.Module.User
SurplusNum
=
TotalNum
-
LookNum
>
0
?
TotalNum
-
LookNum
:
0
};
}
#
region
计算本周日期
/// <summary>
/// 计算本周的周一日期
/// </summary>
/// <returns></returns>
private
DateTime
GetMondayDate
()
{
return
GetMondayDate
(
DateTime
.
Now
);
}
/// <summary>
/// 计算本周周日的日期
/// </summary>
/// <returns></returns>
private
DateTime
GetSundayDate
()
{
return
GetSundayDate
(
DateTime
.
Now
);
}
/// <summary>
/// 计算某日起始日期(礼拜一的日期)
/// </summary>
/// <param name="someDate">该周中任意一天</param>
/// <returns>返回礼拜一日期,后面的具体时、分、秒和传入值相等</returns>
private
DateTime
GetMondayDate
(
DateTime
someDate
)
{
int
i
=
someDate
.
DayOfWeek
-
DayOfWeek
.
Monday
;
if
(
i
==
-
1
)
i
=
6
;
// i值 > = 0 ,因为枚举原因,Sunday排在最前,此时Sunday-Monday=-1,必须+7=6。
TimeSpan
ts
=
new
TimeSpan
(
i
,
0
,
0
,
0
);
return
someDate
.
Subtract
(
ts
);
}
/// <summary>
/// 计算某日结束日期(礼拜日的日期)
/// </summary>
/// <param name="someDate">该周中任意一天</param>
/// <returns>返回礼拜日日期,后面的具体时、分、秒和传入值相等</returns>
private
DateTime
GetSundayDate
(
DateTime
someDate
)
{
int
i
=
someDate
.
DayOfWeek
-
DayOfWeek
.
Sunday
;
if
(
i
!=
0
)
i
=
7
-
i
;
// 因为枚举原因,Sunday排在最前,相减间隔要被7减。
TimeSpan
ts
=
new
TimeSpan
(
i
,
0
,
0
,
0
);
return
someDate
.
Add
(
ts
);
}
#
endregion
}
}
Mall.ThirdCore/ConfigValue.json
View file @
a99264cf
...
...
@@ -15,5 +15,5 @@
"masterSecret"
:
"dda819c1de00c64ae0fad4c7"
},
//消息推送rabbit配置(ip
,
端口
,
账号
,
密码
,
推送队列名)
"WebPushRabbitConfig"
:
"192.168.
2
0.214,5672,rbAdmin,rbadmin123456,WebPushRabbitMQ"
"WebPushRabbitConfig"
:
"192.168.
1
0.214,5672,rbAdmin,rbadmin123456,WebPushRabbitMQ"
}
Mall.WebApi/appsettings.json
View file @
a99264cf
{
"ConnectionStrings"
:
{
"DefaultConnection"
:
"server=192.168.
2
0.214;user id=reborn;password=Reborn@2018;database=reborn_mall;CharSet=utf8mb4; Convert Zero Datetime=true; "
,
"DefaultConnection"
:
"server=192.168.
1
0.214;user id=reborn;password=Reborn@2018;database=reborn_mall;CharSet=utf8mb4; Convert Zero Datetime=true; "
,
"DefaultConnectionPName"
:
"MySql.Data.MySqlClient"
,
"FinanceConnection"
:
"server=192.168.
2
0.214;user id=reborn;password=Reborn@2018;database=reborn_finance;CharSet=utf8mb4; Convert Zero Datetime=true; "
,
"FinanceConnection"
:
"server=192.168.
1
0.214;user id=reborn;password=Reborn@2018;database=reborn_finance;CharSet=utf8mb4; Convert Zero Datetime=true; "
,
"FinanceConnectionPName"
:
"MySql.Data.MySqlClient"
,
"UserConnection"
:
"server=192.168.
2
0.214;user id=reborn;password=Reborn@2018;database=reborn_user;CharSet=utf8mb4; Convert Zero Datetime=true; "
,
"UserConnection"
:
"server=192.168.
1
0.214;user id=reborn;password=Reborn@2018;database=reborn_user;CharSet=utf8mb4; Convert Zero Datetime=true; "
,
"UserConnectionPName"
:
"MySql.Data.MySqlClient"
,
"PropertyConnection"
:
"server=192.168.
2
0.214;user id=reborn;password=Reborn@2018;database=test_property;CharSet=utf8mb4; Convert Zero Datetime=true; "
,
"PropertyConnection"
:
"server=192.168.
1
0.214;user id=reborn;password=Reborn@2018;database=test_property;CharSet=utf8mb4; Convert Zero Datetime=true; "
,
"PropertyConnectionPName"
:
"MySql.Data.MySqlClient"
,
"EduConnection"
:
"server=192.168.
2
0.214;user id=reborn;password=Reborn@2018;database=reborn_edu;CharSet=utf8mb4; Convert Zero Datetime=true; "
,
"EduConnection"
:
"server=192.168.
1
0.214;user id=reborn;password=Reborn@2018;database=reborn_edu;CharSet=utf8mb4; Convert Zero Datetime=true; "
,
"EduConnectionPName"
:
"MySql.Data.MySqlClient"
},
"Logging"
:
{
...
...
@@ -28,7 +28,7 @@
"ApiExpirTime"
:
2592000
,
"AllowedHosts"
:
"*"
,
"OpenValidation"
:
"False"
,
"UploadSiteUrl"
:
"http://192.168.
2
0.214:8120"
,
"UploadSiteUrl"
:
"http://192.168.
1
0.214:8120"
,
"ViewFileSiteUrl"
:
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com"
,
"AliFileSiteUrl"
:
"https://vt-im-bucket.oss-cn-chengdu.aliyuncs.com"
,
"ImKey"
:
"b612b31e837c79c68f141aeb719d2b20"
,
...
...
@@ -55,12 +55,12 @@
"XuZongUserId"
:
111790
,
//徐总的id,用于区分线下订单
"RebornDMC"
:
"reborn_dmc"
,
"PropertyDB"
:
"test_property"
,
"IncomeFinanceApi"
:
"http://192.168.
2
0.7:8083/api/Mall/InsertFinanceBatchForMallIn"
,
"PaymentFinanceApi"
:
"http://192.168.
2
0.7:8083/api/Mall/InsertFinanceBatchForMallOut"
,
"ZYRefundFinanceApi"
:
"http://192.168.
2
0.7:8083/api/Mall/SetMallOrderSalesTheWayRefund"
,
"IncomeFinanceApi"
:
"http://192.168.
1
0.7:8083/api/Mall/InsertFinanceBatchForMallIn"
,
"PaymentFinanceApi"
:
"http://192.168.
1
0.7:8083/api/Mall/InsertFinanceBatchForMallOut"
,
"ZYRefundFinanceApi"
:
"http://192.168.
1
0.7:8083/api/Mall/SetMallOrderSalesTheWayRefund"
,
"PropertyApi"
:
"http://192.168.1.13:8087/api/ECWorkFlow/SetECSuppliesStockInFlow"
,
"EduOrderApi"
:
"http://192.168.
2
0.17:8017/api/Order/SetBatchClassOrder"
,
"EduUpdateGoodsSpecification"
:
"http://192.168.
2
0.17:8017/api/Order/UpdateGoodsSpecification"
,
"EduOrderApi"
:
"http://192.168.
1
0.17:8017/api/Order/SetBatchClassOrder"
,
"EduUpdateGoodsSpecification"
:
"http://192.168.
1
0.17:8017/api/Order/UpdateGoodsSpecification"
,
"FinanceKey"
:
"FinanceMallInsertToERPViitto2020"
,
"SettlementRate"
:
"0.60"
,
"EduSettlementRate"
:
"0.54"
,
...
...
Mall.WindowsService/appsettings.json
View file @
a99264cf
{
"ConnectionStrings"
:
{
"DefaultConnection"
:
"server=192.168.
2
0.214;user id=reborn;password=Reborn@2018;database=test_reborn_mall;CharSet=utf8; Convert Zero Datetime=true; "
,
"DefaultConnection"
:
"server=192.168.
1
0.214;user id=reborn;password=Reborn@2018;database=test_reborn_mall;CharSet=utf8; Convert Zero Datetime=true; "
,
"DefaultConnectionPName"
:
"MySql.Data.MySqlClient"
,
"FinanceConnection"
:
"server=192.168.
2
0.214;user id=reborn;password=Reborn@2018;database=reborn_finance;CharSet=utf8; Convert Zero Datetime=true; "
,
"FinanceConnection"
:
"server=192.168.
1
0.214;user id=reborn;password=Reborn@2018;database=reborn_finance;CharSet=utf8; Convert Zero Datetime=true; "
,
"FinanceConnectionPName"
:
"MySql.Data.MySqlClient"
},
"Logging"
:
{
...
...
@@ -39,7 +39,7 @@
"RebornDMC"
:
"reborn_dmc"
,
"IncomeFinanceApi"
:
"http://192.168.2.16:8083/api/Mall/InsertFinanceBatchForMallIn"
,
"PaymentFinanceApi"
:
"http://192.168.2.16:8083/api/Mall/InsertFinanceBatchForMallOut"
,
"EduUpdateGoodsSpecification"
:
"http://192.168.
2
0.17:8017/api/Order/UpdateGoodsSpecification"
,
"EduUpdateGoodsSpecification"
:
"http://192.168.
1
0.17:8017/api/Order/UpdateGoodsSpecification"
,
"PayCertificateUrl"
:
"D:/project/GitProject/Shopping/Mall.WebApi/"
,
"SettlementRate"
:
"0.60"
,
//
"FinanceKey"
:
"FinanceMallInsertToERPViitto2020"
,
...
...
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