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
da3e6ffd
Commit
da3e6ffd
authored
Apr 12, 2021
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
854f1d25
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
65 additions
and
10 deletions
+65
-10
RB_Finance_Configurine.cs
Mall.Model/Entity/Finance/RB_Finance_Configurine.cs
+10
-0
TimersHelper.cs
Mall.WindowsService/Helper/TimersHelper.cs
+26
-0
Mall.WindowsService.csproj
Mall.WindowsService/Mall.WindowsService.csproj
+5
-0
Mall.WindowsService.csproj.user
Mall.WindowsService/Mall.WindowsService.csproj.user
+1
-1
EducationArticleShelvesModule.cs
Mall.WindowsService/Module/EducationArticleShelvesModule.cs
+4
-4
FinanceModule.cs
Mall.WindowsService/Module/FinanceModule.cs
+3
-3
WindowsService.cs
Mall.WindowsService/WindowsService.cs
+16
-2
No files found.
Mall.Model/Entity/Finance/RB_Finance_Configurine.cs
View file @
da3e6ffd
...
@@ -70,6 +70,16 @@ namespace Mall.Model.Entity.User
...
@@ -70,6 +70,16 @@ namespace Mall.Model.Entity.User
get
;
get
;
set
;
set
;
}
}
/// <summary>
/// 储值卡收入费用
/// </summary>
public
int
?
DepositIncomeTypeId
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 运费收入费用
/// 运费收入费用
/// </summary>
/// </summary>
...
...
Mall.WindowsService/Helper/TimersHelper.cs
View file @
da3e6ffd
...
@@ -16,6 +16,7 @@ namespace Mall.WindowsService.Helper
...
@@ -16,6 +16,7 @@ namespace Mall.WindowsService.Helper
private
static
int
inTimer4
=
0
;
private
static
int
inTimer4
=
0
;
private
static
int
inTimer5
=
0
;
private
static
int
inTimer5
=
0
;
private
static
int
inTimer6
=
0
;
private
static
int
inTimer6
=
0
;
private
static
int
inTimer7
=
0
;
/// <summary>
/// <summary>
/// 收入单子服务开始执行方法
/// 收入单子服务开始执行方法
/// </summary>
/// </summary>
...
@@ -182,5 +183,30 @@ namespace Mall.WindowsService.Helper
...
@@ -182,5 +183,30 @@ namespace Mall.WindowsService.Helper
Interlocked
.
Exchange
(
ref
inTimer6
,
0
);
Interlocked
.
Exchange
(
ref
inTimer6
,
0
);
}
}
}
}
/// <summary>
///用户储值卡赠送状态更新
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public
void
DepositIncomeFinanceShelves
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
if
(
Interlocked
.
Exchange
(
ref
inTimer7
,
1
)
==
0
)
{
try
{
string
str
=
Common
.
Config
.
GetConnectionString
(
"DefaultConnection"
);
LogHelper
.
Write
(
"DepositIncomeFinanceShelves=====Start"
+
str
);
Module
.
FinanceModule
.
DepositIncomeFinanceModule
();
LogHelper
.
Write
(
"DepositIncomeFinanceShelves=====End"
);
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
"DepositIncomeFinanceShelves=====ex"
+
ex
.
Message
);
}
Interlocked
.
Exchange
(
ref
inTimer7
,
0
);
}
}
}
}
}
}
Mall.WindowsService/Mall.WindowsService.csproj
View file @
da3e6ffd
...
@@ -3,6 +3,11 @@
...
@@ -3,6 +3,11 @@
<PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<StartupObject>Mall.WindowsService.Program</StartupObject>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
...
...
Mall.WindowsService/Mall.WindowsService.csproj.user
View file @
da3e6ffd
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"Current"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<Project
ToolsVersion=
"Current"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<PropertyGroup>
<_LastSelectedProfileId>
D:\project\GitProject\
Mall\oldMall
\Mall.WindowsService\Properties\PublishProfiles\FolderProfile.pubxml
</_LastSelectedProfileId>
<_LastSelectedProfileId>
D:\project\GitProject\
Shopping
\Mall.WindowsService\Properties\PublishProfiles\FolderProfile.pubxml
</_LastSelectedProfileId>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<Compile
Update=
"WindowsService.cs"
>
<Compile
Update=
"WindowsService.cs"
>
...
...
Mall.WindowsService/Module/EducationArticleShelvesModule.cs
View file @
da3e6ffd
...
@@ -37,7 +37,7 @@ namespace Mall.WindowsService.Module
...
@@ -37,7 +37,7 @@ namespace Mall.WindowsService.Module
builder
.
AppendFormat
(
@"
builder
.
AppendFormat
(
@"
SELECT ID,ArticleStatus,ShelvesDate,DownDate
SELECT ID,ArticleStatus,ShelvesDate,DownDate
FROM rb_education_article
FROM rb_education_article
WHERE Status=0 AND '{0}'>=ShelvesDate AND '{0}'<=DownDate AND
Goods
Status<>1
WHERE Status=0 AND '{0}'>=ShelvesDate AND '{0}'<=DownDate AND
Article
Status<>1
"
,
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
"
,
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
var
list
=
educationArticleRepository
.
Get
<
RB_Education_Article
>(
builder
.
ToString
()).
ToList
();
var
list
=
educationArticleRepository
.
Get
<
RB_Education_Article
>(
builder
.
ToString
()).
ToList
();
...
@@ -67,7 +67,7 @@ WHERE Status=0 AND '{0}'>=ShelvesDate AND '{0}'<=DownDate AND GoodsStatus<>1
...
@@ -67,7 +67,7 @@ WHERE Status=0 AND '{0}'>=ShelvesDate AND '{0}'<=DownDate AND GoodsStatus<>1
builder
.
AppendFormat
(
@"
builder
.
AppendFormat
(
@"
SELECT ID,ArticleStatus,ShelvesDate,DownDate
SELECT ID,ArticleStatus,ShelvesDate,DownDate
FROM rb_education_article
FROM rb_education_article
WHERE Status=0 AND DownDate<='{0}' AND
Goods
Status=1 "
,
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
WHERE Status=0 AND DownDate<='{0}' AND
Article
Status=1 "
,
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
var
list
=
educationArticleRepository
.
Get
<
RB_Education_Article
>(
builder
.
ToString
()).
ToList
();
var
list
=
educationArticleRepository
.
Get
<
RB_Education_Article
>(
builder
.
ToString
()).
ToList
();
if
(
list
!=
null
&&
list
.
Count
>
0
)
if
(
list
!=
null
&&
list
.
Count
>
0
)
...
@@ -97,7 +97,7 @@ SELECT *
...
@@ -97,7 +97,7 @@ SELECT *
FROM RB_Member_DepositBuy
FROM RB_Member_DepositBuy
WHERE Status=1 AND SendTime<='{0}' and SendStatus=2 "
,
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
WHERE Status=1 AND SendTime<='{0}' and SendStatus=2 "
,
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
var
list
=
educationArticle
Repository
.
Get
<
Model
.
Entity
.
User
.
RB_Member_DepositBuy
>(
builder
.
ToString
()).
ToList
();
var
list
=
memberDepositBuy
Repository
.
Get
<
Model
.
Entity
.
User
.
RB_Member_DepositBuy
>(
builder
.
ToString
()).
ToList
();
if
(
list
!=
null
&&
list
.
Count
>
0
)
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
{
foreach
(
var
item
in
list
)
foreach
(
var
item
in
list
)
...
@@ -107,7 +107,7 @@ WHERE Status=1 AND SendTime<='{0}' and SendStatus=2 ", DateTime.Now.ToString("yy
...
@@ -107,7 +107,7 @@ WHERE Status=1 AND SendTime<='{0}' and SendStatus=2 ", DateTime.Now.ToString("yy
{
nameof
(
Model
.
Entity
.
User
.
RB_Member_DepositBuy
.
SendStatus
),
0
},
{
nameof
(
Model
.
Entity
.
User
.
RB_Member_DepositBuy
.
SendStatus
),
0
},
{
nameof
(
Model
.
Entity
.
User
.
RB_Member_DepositBuy
.
SendTime
),
null
}
{
nameof
(
Model
.
Entity
.
User
.
RB_Member_DepositBuy
.
SendTime
),
null
}
};
};
flag
=
educationArticle
Repository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
Model
.
Entity
.
User
.
RB_Member_DepositBuy
.
Id
),
item
.
Id
));
flag
=
memberDepositBuy
Repository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
Model
.
Entity
.
User
.
RB_Member_DepositBuy
.
Id
),
item
.
Id
));
}
}
}
}
return
flag
;
return
flag
;
...
...
Mall.WindowsService/Module/FinanceModule.cs
View file @
da3e6ffd
...
@@ -475,7 +475,7 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
...
@@ -475,7 +475,7 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
var
addFinance
=
false
;
var
addFinance
=
false
;
DateTime
startDate
=
System
.
DateTime
.
Now
.
AddDays
(-
1
);
DateTime
startDate
=
System
.
DateTime
.
Now
.
AddDays
(-
1
);
var
recordModel
=
financeRecordRepository
.
GetList
(
new
RB_Finance_Record_Extend
{
TenantId
=
item
.
TenantId
,
MallBaseId
=
item
.
MallBaseId
,
Type
=
1
}).
OrderByDescending
(
x
=>
x
.
CreateDate
).
FirstOrDefault
();
var
recordModel
=
financeRecordRepository
.
GetList
(
new
RB_Finance_Record_Extend
{
TenantId
=
item
.
TenantId
,
MallBaseId
=
item
.
MallBaseId
,
Type
=
5
}).
OrderByDescending
(
x
=>
x
.
CreateDate
).
FirstOrDefault
();
if
(
recordModel
==
null
)
//今天没生成单据
if
(
recordModel
==
null
)
//今天没生成单据
{
{
if
(
Convert
.
ToDateTime
(
item
.
StartTime
.
Value
.
AddDays
(
item
.
IntervalDay
??
0
).
ToString
(
"yyyy-MM-dd 00:00:00"
))
<=
Convert
.
ToDateTime
(
System
.
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd 00:00:00"
)))
//判断开始时间加上执行周期是否等于当前日期
if
(
Convert
.
ToDateTime
(
item
.
StartTime
.
Value
.
AddDays
(
item
.
IntervalDay
??
0
).
ToString
(
"yyyy-MM-dd 00:00:00"
))
<=
Convert
.
ToDateTime
(
System
.
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd 00:00:00"
)))
//判断开始时间加上执行周期是否等于当前日期
...
@@ -511,7 +511,7 @@ and DATE_FORMAT(a.PayTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') AND a
...
@@ -511,7 +511,7 @@ and DATE_FORMAT(a.PayTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') AND a
RB_Finance_Record_Extend
record
=
new
RB_Finance_Record_Extend
();
RB_Finance_Record_Extend
record
=
new
RB_Finance_Record_Extend
();
record
.
MallBaseId
=
item
.
MallBaseId
;
record
.
MallBaseId
=
item
.
MallBaseId
;
record
.
TenantId
=
item
.
TenantId
;
record
.
TenantId
=
item
.
TenantId
;
record
.
Type
=
1
;
record
.
Type
=
5
;
record
.
CreateDate
=
System
.
DateTime
.
Now
;
record
.
CreateDate
=
System
.
DateTime
.
Now
;
record
.
RecordDetailList
=
new
List
<
RB_Finance_RecordDetail_Extend
>();
record
.
RecordDetailList
=
new
List
<
RB_Finance_RecordDetail_Extend
>();
...
@@ -587,7 +587,7 @@ and DATE_FORMAT(a.PayTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') AND a
...
@@ -587,7 +587,7 @@ and DATE_FORMAT(a.PayTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') AND a
}
}
var
detailList
=
goodsDetailList
.
Select
(
x
=>
new
var
detailList
=
goodsDetailList
.
Select
(
x
=>
new
{
{
CostTypeId
=
item
.
IncomeCostTypeId
,
CostTypeId
=
item
.
DepositIncomeTypeId
,
Number
=
1
,
Number
=
1
,
OriginalMoney
=
x
.
SalePrice
,
OriginalMoney
=
x
.
SalePrice
,
UnitPrice
=
x
.
SalePrice
,
UnitPrice
=
x
.
SalePrice
,
...
...
Mall.WindowsService/WindowsService.cs
View file @
da3e6ffd
...
@@ -18,7 +18,7 @@ namespace Mall.WindowsService
...
@@ -18,7 +18,7 @@ namespace Mall.WindowsService
private
System
.
Timers
.
Timer
timer5
;
//定时上架和下架
private
System
.
Timers
.
Timer
timer5
;
//定时上架和下架
private
System
.
Timers
.
Timer
timer6
;
//资讯定时上架和下架
private
System
.
Timers
.
Timer
timer6
;
//资讯定时上架和下架
private
System
.
Timers
.
Timer
timer7
;
//会员储值卡赠送状态更新
private
System
.
Timers
.
Timer
timer7
;
//会员储值卡赠送状态更新
private
System
.
Timers
.
Timer
timer8
;
//会员购买储值卡收入
public
WindowsService
()
public
WindowsService
()
{
{
InitializeComponent
();
InitializeComponent
();
...
@@ -69,6 +69,7 @@ namespace Mall.WindowsService
...
@@ -69,6 +69,7 @@ namespace Mall.WindowsService
#
endregion
#
endregion
#
region
商品定时上下架
timer5
=
new
System
.
Timers
.
Timer
();
timer5
=
new
System
.
Timers
.
Timer
();
timer5
=
new
System
.
Timers
.
Timer
timer5
=
new
System
.
Timers
.
Timer
{
{
...
@@ -76,7 +77,7 @@ namespace Mall.WindowsService
...
@@ -76,7 +77,7 @@ namespace Mall.WindowsService
};
};
timer5
.
Elapsed
+=
new
System
.
Timers
.
ElapsedEventHandler
(
helper
.
GoodsShelves
);
timer5
.
Elapsed
+=
new
System
.
Timers
.
ElapsedEventHandler
(
helper
.
GoodsShelves
);
timer5
.
Enabled
=
true
;
timer5
.
Enabled
=
true
;
#
region
#
end
region
#
region
资讯上下架
#
region
资讯上下架
...
@@ -98,7 +99,20 @@ namespace Mall.WindowsService
...
@@ -98,7 +99,20 @@ namespace Mall.WindowsService
timer7
.
Elapsed
+=
new
System
.
Timers
.
ElapsedEventHandler
(
helper
.
MemberDepositBuyShelves
);
timer7
.
Elapsed
+=
new
System
.
Timers
.
ElapsedEventHandler
(
helper
.
MemberDepositBuyShelves
);
timer7
.
Enabled
=
true
;
timer7
.
Enabled
=
true
;
#
endregion
#
endregion
#
region
储值卡收入
timer8
=
new
System
.
Timers
.
Timer
();
timer8
=
new
System
.
Timers
.
Timer
{
Interval
=
1000
*
(
60
*
30
)
//10分钟调用一次
};
timer8
.
Elapsed
+=
new
System
.
Timers
.
ElapsedEventHandler
(
helper
.
DepositIncomeFinanceShelves
);
timer8
.
Enabled
=
true
;
#
endregion
#
endregion
}
}
protected
override
void
OnStop
()
protected
override
void
OnStop
()
...
...
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