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
b8e18e24
Commit
b8e18e24
authored
Jun 19, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定时器
parent
c536b505
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
11 deletions
+110
-11
RB_Goods_Online_Trade.cs
Mall.Model/Entity/Product/RB_Goods_Online_Trade.cs
+1
-1
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+12
-0
AppletOrderController.cs
Mall.WebApi/Controllers/Product/AppletOrderController.cs
+16
-0
Startup.cs
Mall.WebApi/Startup.cs
+9
-10
TimerJobj.cs
Mall.WebApi/Timers/TimerJobj.cs
+72
-0
No files found.
Mall.Model/Entity/Product/RB_Goods_Online_Trade.cs
View file @
b8e18e24
...
...
@@ -31,7 +31,7 @@ namespace Mall.Model.Entity.Product
set
;
}
/// <summary>
/// 类型 1收款 2退款
/// 类型 1收款 2退款
3余额充值 4会员购买
/// </summary>
public
int
?
Type
{
...
...
Mall.Module.Product/OrderModule.cs
View file @
b8e18e24
...
...
@@ -3847,6 +3847,18 @@ namespace Mall.Module.Product
return
false
;
}
/// <summary>
/// 获取小程序配置
/// </summary>
/// <param name="TenantId"></param>
/// <param name="MallBaseId"></param>
/// <returns></returns>
public
Model
.
Extend
.
BaseSetUp
.
RB_MallBase_Extend
GetMallBaseInfo
(
int
TenantId
,
int
MallBaseId
)
{
var
mallbaseModel
=
mallBaseRepository
.
GetListRepository
(
new
Model
.
Extend
.
BaseSetUp
.
RB_MallBase_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
}).
FirstOrDefault
();
return
mallbaseModel
;
}
/// <summary>
/// 获取买家发货界面信息
/// </summary>
...
...
Mall.WebApi/Controllers/Product/AppletOrderController.cs
View file @
b8e18e24
...
...
@@ -560,6 +560,22 @@ namespace Mall.WebApi.Controllers.MallBase
return
ApiResult
.
ParamIsNull
(
"数量不正确"
);
}
//查询售后时间
//var mallbaseModel = orderModule.GetMallBaseInfo(userInfo.TenantId, userInfo.MallBaseId);
//if (mallbaseModel == null) {
// return ApiResult.ParamIsNull("请联系管理员,未查询到配置信息");
//}
//if (mallbaseModel.AfterTime > 0) {
// //获取订单发货时间
// var detailModel = orderModule.GetOrderDetailInfo(demodel.OrderDetialId ?? 0);
// var omodel = orderModule.GetOrderInfo(detailModel?.OrderId ?? 0);
// if (omodel != null && omodel.OrderStatus > Common.Enum.Goods.OrderStatusEnum.WaitReceiving && omodel.ReceivingTime.HasValue) {
// if (omodel.ReceivingTime.Value.AddDays(mallbaseModel.AfterTime) > DateTime.Now) {
// return ApiResult.ParamIsNull("已超过售后期限(" + mallbaseModel.AfterTime + "天),无法申请售后");
// }
// }
//}
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
UserId
=
userInfo
.
UserId
;
...
...
Mall.WebApi/Startup.cs
View file @
b8e18e24
...
...
@@ -61,7 +61,7 @@ namespace Mall.WebApi
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public
void
Configure
(
IApplicationBuilder
app
,
IWebHostEnvironment
env
)
public
void
Configure
(
IApplicationBuilder
app
,
IWebHostEnvironment
env
,
IHostApplicationLifetime
appLifetime
)
{
if
(
env
.
IsDevelopment
())
{
...
...
@@ -88,16 +88,15 @@ namespace Mall.WebApi
//获取前面注入的Quartz调度类
//var quartz = app.ApplicationServices.GetRequiredService<QuartzHelper>();
//appLifetime.ApplicationStarted.Register(() =>
//{
// quartz.Start().Wait(); //网站启动完成执行
//});
//appLifetime.ApplicationStopped.Register(() =>
//{
// quartz.Stop(); //网站停止完成执行
appLifetime
.
ApplicationStarted
.
Register
(()
=>
{
Timers
.
TimerJobj
.
RunTimer
();
//网站启动完成执行
});
//});
appLifetime
.
ApplicationStopped
.
Register
(()
=>
{
Timers
.
TimerJobj
.
RunStop
();
//网站停止完成执行
});
app
.
UseStaticFiles
(
new
StaticFileOptions
{
FileProvider
=
new
Microsoft
.
Extensions
.
FileProviders
.
PhysicalFileProvider
(
...
...
Mall.WebApi/Timers/TimerJobj.cs
0 → 100644
View file @
b8e18e24
using
Mall.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
Mall.WebApi.Timers
{
public
class
TimerJobj
{
static
System
.
Timers
.
Timer
timer1
;
//计时器
public
static
void
RunTimer
()
{
LogHelper
.
Write
(
"进来了 。。。 定时器启动"
);
timer1
=
new
System
.
Timers
.
Timer
();
timer1
.
Interval
=
1000
*
(
60
*
60
);
//60分钟
timer1
.
Elapsed
+=
new
System
.
Timers
.
ElapsedEventHandler
(
ClearFile
);
timer1
.
Enabled
=
true
;
}
public
static
void
RunStop
()
{
LogHelper
.
Write
(
"定时器停止运行......"
);
timer1
.
Enabled
=
false
;
}
/// <summary>
/// 防止重置
/// </summary>
private
static
int
inTimer
=
0
;
/// <summary>
/// 清理文件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public
static
void
ClearFile
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
if
(
Interlocked
.
Exchange
(
ref
inTimer
,
1
)
==
0
)
{
if
(
DateTime
.
Now
.
Hour
==
1
)
{
LogHelper
.
Write
(
"开始清理临时文件"
);
string
rootBook
=
AppDomain
.
CurrentDomain
.
BaseDirectory
;
try
{
DirectoryInfo
dir
=
new
DirectoryInfo
(
rootBook
+
"/upfile/temporary"
);
DirectoryInfo
[]
dirArr
=
dir
.
GetDirectories
();
foreach
(
DirectoryInfo
item
in
dirArr
)
{
if
(
item
.
CreationTime
<
DateTime
.
Now
.
AddDays
(-
1
))
item
.
Delete
(
true
);
}
foreach
(
FileInfo
fi
in
dir
.
GetFiles
())
{
if
(
fi
.
CreationTime
<
DateTime
.
Now
.
AddDays
(-
1
))
fi
.
Delete
();
}
}
catch
{
LogHelper
.
Write
(
"清理临时文件失败"
);
}
}
Interlocked
.
Exchange
(
ref
inTimer
,
0
);
}
}
}
}
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