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
55fce26a
Commit
55fce26a
authored
Nov 08, 2023
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
f211fcd4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
2 deletions
+87
-2
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+57
-0
RB_Order_GuestRepository.cs
Edu.Repository/Sell/RB_Order_GuestRepository.cs
+14
-0
LoginController.cs
Edu.WebApi/Controllers/User/LoginController.cs
+16
-2
lib.zip
lib/lib.zip
+0
-0
No files found.
Edu.Module.Course/OrderModule.cs
View file @
55fce26a
...
...
@@ -9,6 +9,7 @@ using Edu.Common.Enum.User;
using
Edu.Common.Plugin
;
using
Edu.Model.CacheModel
;
using
Edu.Model.Entity.Contract
;
using
Edu.Model.Entity.Grade
;
using
Edu.Model.Entity.Sell
;
using
Edu.Model.ViewModel.Contract
;
using
Edu.Model.ViewModel.Course
;
...
...
@@ -4865,5 +4866,61 @@ namespace Edu.Module.Course
}
}
}
/// <summary>
/// 更新学员完成状态和手动添加签到数据
/// </summary>
/// <returns></returns>
public
bool
UpdateGuestStateModule
()
{
bool
flag
=
false
;
var
list
=
order_GuestRepository
.
UpdateGuestStateRepository
();
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
string
guestIds
=
string
.
Join
(
","
,
list
.
Select
(
qitem
=>
qitem
.
Id
));
var
checkList
=
class_CheckRepository
.
GetClassCheckList
(
new
RB_Class_Check_ViewModel
()
{
QOrderGuestIds
=
guestIds
});
int
index
=
1
;
foreach
(
var
item
in
list
)
{
var
guestCheckList
=
checkList
.
Where
(
qitem
=>
qitem
.
OrderGuestId
==
item
.
Id
);
var
totalHours
=
guestCheckList
?.
Sum
(
qitem
=>
qitem
.
CurrentDeductionHours
)
??
0
;
if
(
item
.
TotalHours
!=
totalHours
)
{
decimal
shengyu
=
item
.
TotalHours
-
totalHours
;
var
lastCheck
=
guestCheckList
.
OrderByDescending
(
qitem
=>
qitem
.
ClassDate
).
FirstOrDefault
();
var
checkModel
=
new
RB_Class_Check
()
{
ClassCheckId
=
0
,
ClassId
=
0
,
ClassDate
=
lastCheck
.
ClassDate
.
AddDays
(
1
),
Status
=
0
,
ClassRoomId
=
0
,
Group_Id
=
lastCheck
.
Group_Id
,
School_Id
=
0
,
TeacherId
=
0
,
OrderGuestId
=
item
.
Id
,
CheckStatus
=
0
,
CreateBy
=
0
,
StudyNum
=
Convert
.
ToInt32
(
shengyu
)
*
45
,
MakeUpStatus
=
1
,
CurrentDeductionHours
=
shengyu
,
IsAbsentHours
=
0
,
ClassTimeId
=
0
,
};
checkModel
.
CreateTime
=
checkModel
.
ClassDate
;
class_CheckRepository
.
Insert
(
checkModel
);
}
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Order_Guest
.
CompleteHours
),
item
.
TotalHours
},
{
nameof
(
RB_Order_Guest
.
GuestState
),
(
int
)
GuestStateEnum
.
Graduate
},
};
flag
=
order_GuestRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Order_Guest
.
Id
),
item
.
Id
));
Console
.
WriteLine
(
string
.
Format
(
"已完成 {0}/{1} "
,
index
,
list
.
Count
));
index
++;
}
}
return
flag
;
}
}
}
\ No newline at end of file
Edu.Repository/Sell/RB_Order_GuestRepository.cs
View file @
55fce26a
...
...
@@ -9,6 +9,7 @@ using Edu.Repository.Scroll;
using
Edu.Repository.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Dynamic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
...
...
@@ -1219,5 +1220,18 @@ group by og.Id";
return
Get
<
RB_Order_Guest_ViewModel
>(
sql
).
ToList
();
}
/// <summary>
/// 获取需要更新学员状态的数据
/// </summary>
/// <returns></returns>
public
List
<
RB_Order_Guest_ViewModel
>
UpdateGuestStateRepository
()
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.OrderId,A.ClassId,A.Income,A.OrderState,A.CourseId,B.GuestName,B.Id,B.GuestState,B.TotalHours,B.CompleteHours
FROM rb_order AS A INNER JOIN rb_order_guest AS B ON A.OrderId=B.OrderId
WHERE A.CourseId IN(215,285,301) and A.OrderState IN(1) "
);
return
Get
<
RB_Order_Guest_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
}
}
Edu.WebApi/Controllers/User/LoginController.cs
View file @
55fce26a
...
...
@@ -61,6 +61,8 @@ namespace Edu.WebApi.Controllers.User
/// </summary>
private
static
readonly
OrderChangeModule
orderChangeModule
=
new
OrderChangeModule
();
private
static
readonly
OrderModule
orderModule
=
new
OrderModule
();
[
HttpGet
]
[
HttpPost
]
[
AllowAnonymous
]
...
...
@@ -96,6 +98,20 @@ namespace Edu.WebApi.Controllers.User
return
ApiResult
.
Success
();
}
/// <summary>
/// 更新学员毕业状态
/// </summary>
/// <returns></returns>
[
HttpGet
]
[
HttpPost
]
[
AllowAnonymous
]
public
ApiResult
UpdateOrderGuest
()
{
orderModule
.
UpdateGuestStateModule
();
return
ApiResult
.
Success
();
}
/// <summary>
/// 用户登录
/// </summary>
...
...
@@ -364,8 +380,6 @@ namespace Edu.WebApi.Controllers.User
}
/// <summary>
/// 用户登录
/// </summary>
...
...
lib/lib.zip
deleted
100644 → 0
View file @
f211fcd4
File deleted
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