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
b3b2ac97
Commit
b3b2ac97
authored
Jan 27, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
d3206d26
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
80 deletions
+88
-80
EducationTimerServer.cs
Edu.EducationCore/EducationTimerServer.cs
+4
-2
QuarzHelper.cs
Edu.EducationCore/Helper/QuarzHelper.cs
+19
-18
appsettings.json
Edu.EducationCore/appsettings.json
+2
-0
ScrollClassCommonModule.cs
Edu.Module.Course/ScrollClassCommonModule.cs
+63
-60
No files found.
Edu.EducationCore/EducationTimerServer.cs
View file @
b3b2ac97
...
@@ -30,8 +30,10 @@ namespace Edu.Education
...
@@ -30,8 +30,10 @@ namespace Edu.Education
new
QuarzHelper
().
RevenueReportTimer
().
GetAwaiter
().
GetResult
();
new
QuarzHelper
().
RevenueReportTimer
().
GetAwaiter
().
GetResult
();
new
QuarzHelper
().
WeXinMediumTimer
().
GetAwaiter
().
GetResult
();
//企业微信定时上传文件 2021-08-09
new
QuarzHelper
().
WeXinMediumTimer
().
GetAwaiter
().
GetResult
();
//企业微信定时上传文件 2021-08-09
new
QuarzHelper
().
WeXinChannelTimer
().
GetAwaiter
().
GetResult
();
//企业微信定时渠道码更新 2021-08-20
new
QuarzHelper
().
WeXinChannelTimer
().
GetAwaiter
().
GetResult
();
//企业微信定时渠道码更新 2021-08-20
new
QuarzHelper
().
EduB2BOrderCancelTimer
().
GetAwaiter
().
GetResult
();
//教育同业订单超时取消
//new QuarzHelper().EduB2BOrderCancelTimer().GetAwaiter().GetResult();//教育同业订单超时取消 (2022-01-25 暂屏蔽)
//new QuarzHelper().EduB2BOrderCommissionTimer().GetAwaiter().GetResult();//教育同业订单返佣
//new QuarzHelper().EduB2BOrderCommissionTimer().GetAwaiter().GetResult();//教育同业订单返佣 (2022-01-25 暂屏蔽)
new
QuarzHelper
().
EduCreateScrollClassTimer
().
GetAwaiter
().
GetResult
();
//滚动开班
new
QuarzHelper
().
EduCreateScrollAppointmentTimer
().
GetAwaiter
().
GetResult
();
//预约课程
new
QuarzHelper
().
CheckPerparingTimer
().
GetAwaiter
().
GetResult
();
new
QuarzHelper
().
CheckPerparingTimer
().
GetAwaiter
().
GetResult
();
}
}
...
...
Edu.EducationCore/Helper/QuarzHelper.cs
View file @
b3b2ac97
...
@@ -316,6 +316,7 @@ namespace Edu.Education.Helper
...
@@ -316,6 +316,7 @@ namespace Edu.Education.Helper
/// <returns></returns>
/// <returns></returns>
public
async
Task
EduCreateScrollClassTimer
()
public
async
Task
EduCreateScrollClassTimer
()
{
{
string
cronExpression
=
"0 10 0 1 * ?"
;
//每月1号 凌晨10分
NameValueCollection
props
=
new
NameValueCollection
NameValueCollection
props
=
new
NameValueCollection
{
{
{
"quartz.serializer.type"
,
"binary"
}
{
"quartz.serializer.type"
,
"binary"
}
...
@@ -327,17 +328,17 @@ namespace Edu.Education.Helper
...
@@ -327,17 +328,17 @@ namespace Edu.Education.Helper
IJobDetail
job
=
JobBuilder
.
Create
<
CreateScrollClass
>()
IJobDetail
job
=
JobBuilder
.
Create
<
CreateScrollClass
>()
.
WithIdentity
(
"job10"
,
"group10"
)
.
WithIdentity
(
"job10"
,
"group10"
)
.
Build
();
.
Build
();
ITrigger
trigger
=
TriggerBuilder
.
Create
()
//ITrigger trigger = TriggerBuilder.Create()
.
WithIdentity
(
"trigger10"
,
"group10"
)
.
StartNow
()
.
WithSimpleSchedule
(
x
=>
x
.
WithIntervalInHours
(
1
)
.
RepeatForever
())
.
Build
();
//ICronTrigger trigger = (ICronTrigger)TriggerBuilder.Create()
// .WithIdentity("trigger10", "group10")
// .WithIdentity("trigger10", "group10")
// .WithCronSchedule(cronExpression)
// .StartNow()
// .WithSimpleSchedule(x => x
// .WithIntervalInHours(1)
// .RepeatForever())
// .Build();
// .Build();
ICronTrigger
trigger
=
(
ICronTrigger
)
TriggerBuilder
.
Create
()
.
WithIdentity
(
"trigger10"
,
"group10"
)
.
WithCronSchedule
(
cronExpression
)
.
Build
();
await
scheduler
.
ScheduleJob
(
job
,
trigger
);
await
scheduler
.
ScheduleJob
(
job
,
trigger
);
}
}
...
@@ -360,17 +361,17 @@ namespace Edu.Education.Helper
...
@@ -360,17 +361,17 @@ namespace Edu.Education.Helper
IJobDetail
job
=
JobBuilder
.
Create
<
CreateScrollAppointment
>()
IJobDetail
job
=
JobBuilder
.
Create
<
CreateScrollAppointment
>()
.
WithIdentity
(
"job11"
,
"group11"
)
.
WithIdentity
(
"job11"
,
"group11"
)
.
Build
();
.
Build
();
ITrigger
trigger
=
TriggerBuilder
.
Create
()
//ITrigger trigger = TriggerBuilder.Create()
.
WithIdentity
(
"trigger11"
,
"group11"
)
.
StartNow
()
.
WithSimpleSchedule
(
x
=>
x
.
WithIntervalInHours
(
1
)
.
RepeatForever
())
.
Build
();
//ICronTrigger trigger = (ICronTrigger)TriggerBuilder.Create()
// .WithIdentity("trigger11", "group11")
// .WithIdentity("trigger11", "group11")
// .WithCronSchedule(cronExpression)
// .StartNow()
// .WithSimpleSchedule(x => x
// .WithIntervalInHours(1)
// .RepeatForever())
// .Build();
// .Build();
ICronTrigger
trigger
=
(
ICronTrigger
)
TriggerBuilder
.
Create
()
.
WithIdentity
(
"trigger11"
,
"group11"
)
.
WithCronSchedule
(
cronExpression
)
.
Build
();
await
scheduler
.
ScheduleJob
(
job
,
trigger
);
await
scheduler
.
ScheduleJob
(
job
,
trigger
);
}
}
...
...
Edu.EducationCore/appsettings.json
View file @
b3b2ac97
...
@@ -40,6 +40,8 @@
...
@@ -40,6 +40,8 @@
"TeachingBonusTemplete"
:
141
,
"TeachingBonusTemplete"
:
141
,
"BonusCostTypeId"
:
540
,
"BonusCostTypeId"
:
540
,
"EduDateBase"
:
"uat_reborn_edu"
,
"EduDateBase"
:
"uat_reborn_edu"
,
//消息推送AppId
"PushAppId"
:
"JiaHeJiaoYu"
,
"RabbitMqConfig"
:
{
"RabbitMqConfig"
:
{
"HostName"
:
"47.96.25.130"
,
"HostName"
:
"47.96.25.130"
,
"VirtualHost"
:
"/"
,
"VirtualHost"
:
"/"
,
...
...
Edu.Module.Course/ScrollClassCommonModule.cs
View file @
b3b2ac97
...
@@ -226,7 +226,8 @@ namespace Edu.Module.Course
...
@@ -226,7 +226,8 @@ namespace Edu.Module.Course
if
(
item
.
Count
()
<
item
.
Key
.
ScrollMinNum
)
if
(
item
.
Count
()
<
item
.
Key
.
ScrollMinNum
)
{
{
//人数未达标 取消课程
//人数未达标 取消课程
foreach
(
var
qitem
in
item
)
{
foreach
(
var
qitem
in
item
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
State
),
Common
.
Enum
.
Course
.
CourseAppointStateEnum
.
Cancel
}
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
State
),
Common
.
Enum
.
Course
.
CourseAppointStateEnum
.
Cancel
}
};
};
...
@@ -238,7 +239,8 @@ namespace Edu.Module.Course
...
@@ -238,7 +239,8 @@ namespace Edu.Module.Course
}
}
};
};
bool
flag
=
scroll_AppointmentRepository
.
Update
(
keyValues
,
wheres
);
bool
flag
=
scroll_AppointmentRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
if
(
flag
)
{
//给学生推送 取消课程的订阅消息
//给学生推送 取消课程的订阅消息
SendAppointmentCancelMsg
(
token
,
qitem
.
StuOpenId
,
qitem
,
StartTime
);
SendAppointmentCancelMsg
(
token
,
qitem
.
StuOpenId
,
qitem
,
StartTime
);
}
}
...
@@ -253,25 +255,13 @@ namespace Edu.Module.Course
...
@@ -253,25 +255,13 @@ namespace Edu.Module.Course
上课时段:<font color='warning'>
{
CourseTime
}
</font>\n>
上课时段:<font color='warning'>
{
CourseTime
}
</font>\n>
取消原因:<font color='comment'>预约人数未达到最低成班人数
{
item
.
Key
.
ScrollMinNum
}
人</font>\n>
取消原因:<font color='comment'>预约人数未达到最低成班人数
{
item
.
Key
.
ScrollMinNum
}
人</font>\n>
请 点 击:[查看详情](
{
Config
.
ErpUrl
}
/autologin?loginId=
{
item
.
Key
.
AccountId
}
&target=
{
recipientPath
}
)"
;
请 点 击:[查看详情](
{
Config
.
ErpUrl
}
/autologin?loginId=
{
item
.
Key
.
AccountId
}
&target=
{
recipientPath
}
)"
;
PushWorkChatHelper
.
PushToWorkChat
(
content
,
item
.
Key
.
WorkUserId
,
"课程取消通知"
);
PushWorkChatHelper
.
PushToWorkChat
(
content
,
"LiuDong"
,
"课程取消通知"
);
}
}
}
}
else
{
else
{
//人数达标 写入计划课程
//人数达标 写入计划课程
foreach
(
var
qitem
in
item
)
foreach
(
var
qitem
in
item
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
State
),
Common
.
Enum
.
Course
.
CourseAppointStateEnum
.
WaitCourse
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Scroll_Appointment_ViewModel
.
Id
),
FiledValue
=
qitem
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag
=
scroll_AppointmentRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
{
#
region
写入
class_plan
计划表
#
region
写入
class_plan
计划表
int
planId
=
class_PlanRepository
.
Insert
(
new
RB_Class_Plan
()
int
planId
=
class_PlanRepository
.
Insert
(
new
RB_Class_Plan
()
...
@@ -294,7 +284,8 @@ namespace Edu.Module.Course
...
@@ -294,7 +284,8 @@ namespace Edu.Module.Course
if
(
planId
>
0
)
if
(
planId
>
0
)
{
{
//写入时间
//写入时间
foreach
(
var
citem
in
CourseTimeList
)
{
foreach
(
var
citem
in
CourseTimeList
)
{
class_TimeRepository
.
Insert
(
new
RB_Class_Time
()
class_TimeRepository
.
Insert
(
new
RB_Class_Time
()
{
{
ClassTimeId
=
0
,
ClassTimeId
=
0
,
...
@@ -310,15 +301,27 @@ namespace Edu.Module.Course
...
@@ -310,15 +301,27 @@ namespace Edu.Module.Course
TimeHour
=
citem
.
ClassHours
TimeHour
=
citem
.
ClassHours
});
});
}
}
//更新预约 =》 计划ID
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
State
),
Common
.
Enum
.
Course
.
CourseAppointStateEnum
.
WaitCourse
},
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
ClassPlanId
),
planId
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Scroll_Appointment_ViewModel
.
Id
),
FiledValue
=
qitem
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
}
#
endregion
};
bool
flag
=
scroll_AppointmentRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
//给学生推送 预约课程的订阅消息
//给学生推送 预约课程的订阅消息
SendAppointmentSusscessMsg
(
token
,
qitem
.
StuOpenId
,
qitem
,
StartTime
);
SendAppointmentSusscessMsg
(
token
,
qitem
.
StuOpenId
,
qitem
,
StartTime
);
}
}
}
}
#
endregion
}
//给老师推送课程 信息
//给老师推送课程 信息
if
(!
string
.
IsNullOrEmpty
(
item
.
Key
.
WorkUserId
))
if
(!
string
.
IsNullOrEmpty
(
item
.
Key
.
WorkUserId
))
...
@@ -331,7 +334,7 @@ namespace Edu.Module.Course
...
@@ -331,7 +334,7 @@ namespace Edu.Module.Course
上课教室:<font color='warning'>
{
item
.
Key
.
RoomName
}
(
{
item
.
Key
.
RoomSchoolName
}
)</font>\n>
上课教室:<font color='warning'>
{
item
.
Key
.
RoomName
}
(
{
item
.
Key
.
RoomSchoolName
}
)</font>\n>
上课人数:<font color='comment'>
{
item
.
Count
()}
人</font>\n>
上课人数:<font color='comment'>
{
item
.
Count
()}
人</font>\n>
请 点 击:[查看详情](
{
Config
.
ErpUrl
}
/autologin?loginId=
{
item
.
Key
.
AccountId
}
&target=
{
recipientPath
}
)"
;
请 点 击:[查看详情](
{
Config
.
ErpUrl
}
/autologin?loginId=
{
item
.
Key
.
AccountId
}
&target=
{
recipientPath
}
)"
;
PushWorkChatHelper
.
PushToWorkChat
(
content
,
item
.
Key
.
WorkUserId
,
"课程预约成功通知"
);
PushWorkChatHelper
.
PushToWorkChat
(
content
,
"LiuDong"
,
"课程预约成功通知"
);
}
}
}
}
...
@@ -448,7 +451,7 @@ namespace Edu.Module.Course
...
@@ -448,7 +451,7 @@ namespace Edu.Module.Course
};
};
wenXinResult
=
HttpHelper
.
HttpPost
(
Url
,
JsonHelper
.
Serialize
(
postdata
),
""
);
wenXinResult
=
HttpHelper
.
HttpPost
(
Url
,
JsonHelper
.
Serialize
(
postdata
),
""
);
LogHelper
.
WriteInfo
(
"SendAppointment
SusscessMsg 预约成功
发送订阅消息:"
+
wenXinResult
);
LogHelper
.
WriteInfo
(
"SendAppointment
CancelMsg 预约取消
发送订阅消息:"
+
wenXinResult
);
JObject
jo
=
(
JObject
)
JsonConvert
.
DeserializeObject
(
wenXinResult
);
JObject
jo
=
(
JObject
)
JsonConvert
.
DeserializeObject
(
wenXinResult
);
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
if
(
errcode
==
0
)
...
@@ -458,7 +461,7 @@ namespace Edu.Module.Course
...
@@ -458,7 +461,7 @@ namespace Edu.Module.Course
}
}
else
else
{
{
LogHelper
.
Write
(
string
.
Format
(
"SendAppointment
Susscess
Msg:wenXinResult:{0}"
,
wenXinResult
));
LogHelper
.
Write
(
string
.
Format
(
"SendAppointment
Cancel
Msg:wenXinResult:{0}"
,
wenXinResult
));
}
}
}
}
return
false
;
return
false
;
...
...
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