Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
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
黄奎
Education
Commits
ae14a38d
Commit
ae14a38d
authored
Mar 31, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
66fe96be
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
4 deletions
+41
-4
Program.cs
Edu.Test/Program.cs
+31
-0
LoginController.cs
Edu.WebApi/Controllers/User/LoginController.cs
+0
-1
TimerJobj.cs
Edu.WebApi/Timers/TimerJobj.cs
+10
-3
No files found.
Edu.Test/Program.cs
View file @
ae14a38d
...
...
@@ -19,8 +19,39 @@ namespace Edu.Test
//var list = Common.Plugin.FileHelper.GetFileAllPath(filePath, newPath);
//string str = Common.Plugin.JsonHelper.Serialize(list);
//Console.WriteLine(str);
var
str
=
ConvertStringToDateTime
(
"1492617600"
);
Console
.
WriteLine
(
str
);
var
date
=
new
DateTime
(
2022
,
3
,
21
,
0
,
0
,
0
);
var
res1
=
ConvertDateTimeInt
(
date
);
Console
.
WriteLine
(
res1
);
Console
.
WriteLine
(
"End......"
);
Console
.
ReadKey
();
}
/// <summary>
/// 将c# DateTime时间格式转换为Unix时间戳格式
/// </summary>
/// <param name="time">时间</param>
/// <returns>double</returns>
private
static
double
ConvertDateTimeInt
(
DateTime
time
)
{
DateTime
dd
=
new
DateTime
(
1970
,
1
,
1
,
0
,
0
,
0
,
0
);
TimeSpan
ts
=
(
time
-
dd
);
return
(
Int64
)
ts
.
TotalMilliseconds
;
}
/// <summary>
/// 时间戳转为C#格式时间
/// </summary>
/// <param name=”timeStamp”></param>
/// <returns></returns>
public
static
DateTime
ConvertStringToDateTime
(
string
timeStamp
)
{
DateTime
dtStart
=
TimeZoneInfo
.
ConvertTime
(
new
DateTime
(
1970
,
1
,
1
,
0
,
0
,
0
,
0
,
DateTimeKind
.
Utc
),
TimeZoneInfo
.
Local
);
long
lTime
=
long
.
Parse
(
timeStamp
+
"0000"
);
TimeSpan
toNow
=
new
TimeSpan
(
lTime
);
return
dtStart
.
Add
(
toNow
);
}
}
}
Edu.WebApi/Controllers/User/LoginController.cs
View file @
ae14a38d
...
...
@@ -68,7 +68,6 @@ namespace Edu.WebApi.Controllers.User
[
AllowAnonymous
]
public
ApiResult
Test
()
{
Edu
.
ThirdCore
.
QYWinXin
.
QYWeiXinHelper
.
GetWeChatCheck
();
return
ApiResult
.
Success
();
}
...
...
Edu.WebApi/Timers/TimerJobj.cs
View file @
ae14a38d
...
...
@@ -67,6 +67,11 @@ namespace Edu.WebApi.Timers
/// </summary>
private
static
readonly
MarketConsultantModule
marketConsultantModule
=
new
MarketConsultantModule
();
/// <summary>
/// 教师行为数据统计
/// </summary>
private
static
readonly
TeacherStaticModule
teacherStaticModule
=
new
TeacherStaticModule
();
static
System
.
Timers
.
Timer
timer1
;
//计时器
static
System
.
Timers
.
Timer
timer2
;
//定期处理未值班数据
...
...
@@ -242,9 +247,11 @@ namespace Edu.WebApi.Timers
marketConsultantModule
.
CreateConsultantDataModule
(
today
);
marketConsultantModule
.
CreateMarketDataModule
(
today
);
UserInfo
user
=
UserReidsCache
.
GetUserLoginInfo
(
"1"
);
studentStatModule
.
CreateStudentStaticModule
(
user
,
Common
.
ConvertHelper
.
FormatDate
(
today
.
AddDays
(-
1
)),
currentDate
,
isInit
:
false
);
studentStatModule
.
CreateStudentMarketModule
(
user
,
Common
.
ConvertHelper
.
FormatDate
(
today
.
AddDays
(-
1
)),
currentDate
,
isInit
:
false
);
studentStatModule
.
CreateStudentCompanyModule
(
user
,
Common
.
ConvertHelper
.
FormatDate
(
today
.
AddDays
(-
1
)),
currentDate
,
isInit
:
false
);
var
startDate
=
Common
.
ConvertHelper
.
FormatDate
(
today
.
AddDays
(-
1
));
studentStatModule
.
CreateStudentStaticModule
(
user
,
startDate
,
currentDate
,
isInit
:
false
);
studentStatModule
.
CreateStudentMarketModule
(
user
,
startDate
,
currentDate
,
isInit
:
false
);
studentStatModule
.
CreateStudentCompanyModule
(
user
,
startDate
,
currentDate
,
isInit
:
false
);
teacherStaticModule
.
CreateTeacherStaticModule
(
user
,
startDate
,
currentDate
,
isInit
:
false
);
redis
.
Set
(
createMarkDataKey
,
currentDate
);
}
Interlocked
.
Exchange
(
ref
marketconsultant_Timer
,
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