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
9d381fe1
Commit
9d381fe1
authored
Oct 10, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
e96b7af5
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
118 additions
and
6 deletions
+118
-6
AppletEducationController.cs
...WebApi/Controllers/Education/AppletEducationController.cs
+4
-1
AppletSchoolController.cs
Mall.WebApi/Controllers/Education/AppletSchoolController.cs
+4
-2
TimersHelper.cs
Mall.WindowsService/Helper/TimersHelper.cs
+30
-3
EducationArticleShelvesModule.cs
Mall.WindowsService/Module/EducationArticleShelvesModule.cs
+80
-0
No files found.
Mall.WebApi/Controllers/Education/AppletEducationController.cs
View file @
9d381fe1
...
...
@@ -649,6 +649,8 @@ namespace Mall.WebApi.Controllers.Education
query
.
MallBaseId
=
userInfo
.
MallBaseId
;
query
.
UserId
=
userInfo
.
UserId
;
bool
isUpdate
=
true
;
if
(
query
==
null
)
{
return
ApiResult
.
Failed
(
"请传入我关注的老师信息"
);
...
...
@@ -657,6 +659,7 @@ namespace Mall.WebApi.Controllers.Education
{
if
(
query
.
ID
==
0
)
{
isUpdate
=
false
;
query
.
CreateDate
=
System
.
DateTime
.
Now
;
query
.
UpdateDate
=
System
.
DateTime
.
Now
;
if
(
query
.
TeacherId
<=
0
)
...
...
@@ -673,7 +676,7 @@ namespace Mall.WebApi.Controllers.Education
bool
result
=
educationModule
.
AddOrUpdateFollowTeacher
(
query
);
if
(
query
.
ID
>
0
)
if
(
isUpdate
)
{
if
(
result
)
{
...
...
Mall.WebApi/Controllers/Education/AppletSchoolController.cs
View file @
9d381fe1
...
...
@@ -160,7 +160,8 @@ namespace Mall.WebApi.Controllers.Education
/// <param name="requestMsg"></param>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetAppletCourseCollect
(
object
requestMsg
)
{
public
ApiResult
GetAppletCourseCollect
(
object
requestMsg
)
{
var
req
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
if
(
req
.
MallBaseId
<=
0
)
{
...
...
@@ -419,7 +420,8 @@ namespace Mall.WebApi.Controllers.Education
int
Followteacher
=
0
;
if
(
query
.
UserId
>
0
)
{
Followteacher
=
(
oldList
!=
null
&&
oldList
.
Any
())
?
oldList
.
Where
(
x
=>
x
.
UserId
==
query
.
UserId
).
Count
()
:
0
;
Followteacher
=
(
oldList
!=
null
&&
oldList
.
Any
())
?
oldList
.
Where
(
x
=>
x
.
UserId
==
query
.
UserId
).
FirstOrDefault
()?.
ID
??
0
:
0
;
}
//获取老师对应的课程
...
...
Mall.WindowsService/Helper/TimersHelper.cs
View file @
9d381fe1
...
...
@@ -14,7 +14,7 @@ namespace Mall.WindowsService.Helper
private
static
int
inTimer2
=
0
;
private
static
int
inTimer3
=
0
;
private
static
int
inTimer4
=
0
;
private
static
int
inTimer5
=
0
;
/// <summary>
/// 收入单子服务开始执行方法
/// </summary>
...
...
@@ -116,8 +116,8 @@ namespace Mall.WindowsService.Helper
{
try
{
string
str
=
Common
.
Config
.
GetConnectionString
(
"DefaultConnection"
);
LogHelper
.
Write
(
"GoodsShelves=====Start"
+
str
);
string
str
=
Common
.
Config
.
GetConnectionString
(
"DefaultConnection"
);
LogHelper
.
Write
(
"GoodsShelves=====Start"
+
str
);
Module
.
GoodsShelvesModule
.
ShelvesGoodsModule
();
Module
.
GoodsShelvesModule
.
DownGoodsModule
();
LogHelper
.
Write
(
"GoodsShelves=====End"
);
...
...
@@ -129,5 +129,32 @@ namespace Mall.WindowsService.Helper
Interlocked
.
Exchange
(
ref
inTimer4
,
0
);
}
}
/// <summary>
/// 资讯定时上架,下架
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public
void
EducationArticleShelves
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
if
(
Interlocked
.
Exchange
(
ref
inTimer5
,
1
)
==
0
)
{
try
{
string
str
=
Common
.
Config
.
GetConnectionString
(
"DefaultConnection"
);
LogHelper
.
Write
(
"EducationArticleShelves=====Start"
+
str
);
Module
.
EducationArticleShelvesModule
.
ShelvesEducationArticleModule
();
Module
.
EducationArticleShelvesModule
.
DownEducationArticleModule
();
LogHelper
.
Write
(
"EducationArticleShelves=====End"
);
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
"EducationArticleShelves=====ex"
+
ex
.
Message
);
}
Interlocked
.
Exchange
(
ref
inTimer5
,
0
);
}
}
}
}
Mall.WindowsService/Module/EducationArticleShelvesModule.cs
0 → 100644
View file @
9d381fe1
using
Mall.Repository.Product
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Linq
;
using
Mall.Model.Entity.Product
;
using
VT.FW.DB
;
using
Mall.Repository.Education
;
using
Mall.Model.Entity.Education
;
namespace
Mall.WindowsService.Module
{
/// <summary>
/// 资讯自动上架下架
/// </summary>
public
class
EducationArticleShelvesModule
{
/// <summary>
/// 资讯评论信息
/// </summary>
private
static
readonly
RB_Education_ArticleRepository
educationArticleRepository
=
new
RB_Education_ArticleRepository
();
/// <summary>
/// 商品自动上架时间
/// </summary>
/// <returns></returns>
public
static
bool
ShelvesEducationArticleModule
()
{
bool
flag
=
false
;
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT ID,ArticleStatus,ShelvesDate,DownDate
FROM rb_education_article
WHERE Status=0 AND '{0}'>=ShelvesDate AND '{0}'<=DownDate AND GoodsStatus<>1
"
,
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
var
list
=
educationArticleRepository
.
Get
<
RB_Education_Article
>(
builder
.
ToString
()).
ToList
();
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
foreach
(
var
item
in
list
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Education_Article
.
ArticleStatus
),
1
}
};
flag
=
educationArticleRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Education_Article
.
ID
),
item
.
ID
));
}
}
return
flag
;
}
/// <summary>
/// 商品自动下架
/// </summary>
/// <returns></returns>
public
static
bool
DownEducationArticleModule
()
{
bool
flag
=
false
;
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT ID,ArticleStatus,ShelvesDate,DownDate
FROM rb_education_article
WHERE Status=0 AND DownDate<='{0}' AND GoodsStatus=1 "
,
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
var
list
=
educationArticleRepository
.
Get
<
RB_Education_Article
>(
builder
.
ToString
()).
ToList
();
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
foreach
(
var
item
in
list
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Education_Article
.
ArticleStatus
),
2
}
};
flag
=
educationArticleRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Education_Article
.
ID
),
item
.
ID
));
}
}
return
flag
;
}
}
}
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