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
a995d81e
Commit
a995d81e
authored
Jul 21, 2021
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
3d4d0538
3a3eef4e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
783 additions
and
93 deletions
+783
-93
Config.cs
Edu.Common/Config.cs
+11
-0
ReceiptTypeEnum.cs
Edu.Common/Enum/Finance/ReceiptTypeEnum.cs
+6
-0
RB_Class_Check.cs
Edu.Model/Entity/Course/RB_Class_Check.cs
+1
-1
RB_Student_Makeup.cs
Edu.Model/Entity/Course/RB_Student_Makeup.cs
+1
-1
RB_Class_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Class_ViewModel.cs
+1
-1
RB_Student_Makeup_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Student_Makeup_ViewModel.cs
+8
-3
RB_Order_Change_ViewModel.cs
Edu.Model/ViewModel/EduTask/RB_Order_Change_ViewModel.cs
+63
-1
ClassModule.cs
Edu.Module.Course/ClassModule.cs
+91
-13
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+50
-0
StudentBillModule.cs
Edu.Module.Course/StudentBillModule.cs
+80
-3
EducationReceiptModule.cs
Edu.Module.EduTask/EducationReceiptModule.cs
+29
-1
OrderChangeModule.cs
Edu.Module.EduTask/OrderChangeModule.cs
+299
-62
RB_ClassRepository.cs
Edu.Repository/Course/RB_ClassRepository.cs
+2
-1
RB_Class_CheckRepository.cs
Edu.Repository/Course/RB_Class_CheckRepository.cs
+4
-0
RB_OrderRepository.cs
Edu.Repository/Course/RB_OrderRepository.cs
+1
-1
RB_Student_MakeupRepository.cs
Edu.Repository/Course/RB_Student_MakeupRepository.cs
+2
-2
RB_Education_ReceiptRepository.cs
Edu.Repository/EduTask/RB_Education_ReceiptRepository.cs
+9
-0
ClassController.cs
Edu.WebApi/Controllers/Course/ClassController.cs
+1
-0
OrderController.cs
Edu.WebApi/Controllers/Course/OrderController.cs
+28
-2
StuController.cs
Edu.WebApi/Controllers/Course/StuController.cs
+52
-0
OrderChangeController.cs
Edu.WebApi/Controllers/EduTask/OrderChangeController.cs
+41
-0
appsettings.json
Edu.WebApi/appsettings.json
+3
-1
No files found.
Edu.Common/Config.cs
View file @
a995d81e
...
...
@@ -406,6 +406,17 @@ namespace Edu.Common
}
/// <summary>
/// 订单分拆流程编号
/// </summary>
public
static
int
OrderSplitClassFlowId
{
get
{
int
.
TryParse
(
ReadConfigKey
(
"OrderSplitClassFlowId"
),
out
int
OrderSplitClassFlowId
);
return
OrderSplitClassFlowId
;
}
}
/// <summary>
...
...
Edu.Common/Enum/Finance/ReceiptTypeEnum.cs
View file @
a995d81e
...
...
@@ -37,5 +37,11 @@ namespace Edu.Common.Enum.Finance
/// </summary>
[
EnumField
(
"订单转班"
)]
OrderTransClass
=
5
,
/// <summary>
/// 订单分拆
/// </summary>
[
EnumField
(
"订单分拆"
)]
OrderSplitClass
=
6
,
}
}
Edu.Model/Entity/Course/RB_Class_Check.cs
View file @
a995d81e
...
...
@@ -95,7 +95,7 @@ namespace Edu.Model.Entity.Course
public
int
IsAbsentHours
{
get
;
set
;
}
/// <summary>
/// 补课状态(1-正常,2-
已处理,3
-未处理)
/// 补课状态(1-正常,2-
可补课,3-不可补课, 4
-未处理)
/// </summary>
public
int
MakeUpStatus
{
get
;
set
;
}
}
...
...
Edu.Model/Entity/Course/RB_Student_Makeup.cs
View file @
a995d81e
...
...
@@ -33,7 +33,7 @@ namespace Edu.Model.Entity.Course
public
DateTime
ClassDate
{
get
;
set
;
}
/// <summary>
/// 补课状态(1-
正常,2-已处理,3-未处理
)
/// 补课状态(1-
未处理,2-可补课,3-不可补课
)
/// </summary>
public
int
MakeUpStatus
{
get
;
set
;
}
...
...
Edu.Model/ViewModel/Course/RB_Class_ViewModel.cs
View file @
a995d81e
...
...
@@ -75,7 +75,7 @@ namespace Edu.Model.ViewModel.Course
public
int
OrderStudentCount
{
get
;
set
;
}
/// <summary>
/// 学
习
名称
/// 学
校
名称
/// </summary>
public
string
SchoolName
{
get
;
set
;
}
...
...
Edu.Model/ViewModel/Course/RB_Student_Makeup_ViewModel.cs
View file @
a995d81e
...
...
@@ -25,9 +25,9 @@ namespace Edu.Model.ViewModel.Course
string
str
=
""
;
switch
(
this
.
MakeUpStatus
)
{
case
1
:
str
=
"
正常
"
;
break
;
case
2
:
str
=
"
已处理
"
;
break
;
case
3
:
str
=
"
未处理
"
;
break
;
case
1
:
str
=
"
未处理
"
;
break
;
case
2
:
str
=
"
可补课
"
;
break
;
case
3
:
str
=
"
不可补课
"
;
break
;
}
return
str
;
...
...
@@ -101,5 +101,10 @@ namespace Edu.Model.ViewModel.Course
/// 结束时间
/// </summary>
public
string
EndTime
{
get
;
set
;
}
/// <summary>
/// 课时
/// </summary>
public
string
TimeHour
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/EduTask/RB_Order_Change_ViewModel.cs
View file @
a995d81e
using
Edu.Model.Entity.EduTask
;
using
Edu.Model.CacheModel
;
using
Edu.Model.Entity.EduTask
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
...
...
@@ -45,4 +46,65 @@ namespace Edu.Model.ViewModel.EduTask
/// </summary>
public
string
EffectiveDateStr
{
get
{
return
Common
.
ConvertHelper
.
FormatDate
(
this
.
EffectiveDate
);
}
}
}
/// <summary>
/// 订单转班分拆生成财务单据实体类
/// </summary>
public
class
OrderChangeFinace
{
/// <summary>
/// 更改类型(1-转班,2-分拆)
/// </summary>
public
int
ChangeType
{
get
;
set
;
}
/// <summary>
/// 应收/退款
/// </summary>
public
decimal
InCome
{
get
;
set
;
}
/// <summary>
/// 学员编号
/// </summary>
public
int
GuestId
{
get
;
set
;
}
/// <summary>
/// 学员名称
/// </summary>
public
string
GuestName
{
get
;
set
;
}
/// <summary>
/// 操作人员
/// </summary>
public
UserInfo
UserInfo
{
get
;
set
;
}
/// <summary>
/// 班级编号
/// </summary>
public
int
ClassId
{
get
;
set
;
}
/// <summary>
/// 班级所在校区编号
/// </summary>
public
int
Class_School_Id
{
get
;
set
;
}
/// <summary>
/// 校区名称
/// </summary>
public
string
SName
{
get
;
set
;
}
/// <summary>
/// 班级名称
/// </summary>
public
string
ClassName
{
get
;
set
;
}
/// <summary>
/// 订单编号
/// </summary>
public
int
OrderId
{
get
;
set
;
}
/// <summary>
/// 关联财务单号
/// </summary>
public
int
ReFinanceId
{
get
;
set
;
}
}
}
Edu.Module.Course/ClassModule.cs
View file @
a995d81e
...
...
@@ -693,7 +693,7 @@ namespace Edu.Module.Course
}
}
List
<
RB_Class_Plan_ViewModel
>
classPlanList
=
new
List
<
RB_Class_Plan_ViewModel
>();
if
(
model
.
ClassHours
>
0
)
if
(
model
.
ClassHours
>
0
&&
defaultPlanTimeList
!=
null
&&
defaultPlanTimeList
.
Count
>
0
)
{
var
srartDate
=
model
.
OpenTime
;
//按周排课和按月排课
...
...
@@ -1567,7 +1567,7 @@ namespace Edu.Module.Course
}).
OrderByDescending
(
qitem
=>
qitem
.
ClassDate
).
ToList
();
for
(
var
i
=
0
;
i
<
checkList
.
Count
;
i
++)
{
if
((
checkList
[
i
].
CheckStatus
==
1
)
&&
(
checkList
[
i
].
MakeUpStatus
==
3
||
checkList
[
i
].
MakeUpStatus
==
1
))
if
((
checkList
[
i
].
CheckStatus
==
1
)
&&
(
checkList
[
i
].
MakeUpStatus
==
3
||
checkList
[
i
].
MakeUpStatus
==
4
||
checkList
[
i
].
MakeUpStatus
==
1
))
{
NoFinishHours
+=
checkList
[
i
].
CurrentDeductionHours
;
}
...
...
@@ -1583,7 +1583,7 @@ namespace Edu.Module.Course
{
fileds
.
Add
(
nameof
(
RB_Order_Guest_ViewModel
.
GuestState
),
5
);
checkFileds
.
Add
(
nameof
(
RB_Class_Check_ViewModel
.
IsAbsentHours
),
1
);
checkFileds
.
Add
(
nameof
(
RB_Class_Check_ViewModel
.
MakeUpStatus
),
3
);
checkFileds
.
Add
(
nameof
(
RB_Class_Check_ViewModel
.
MakeUpStatus
),
4
);
}
if
(
fileds
!=
null
&&
fileds
.
Count
>
0
&&
checkFileds
!=
null
&&
checkFileds
.
Count
>
0
)
{
...
...
@@ -1610,7 +1610,7 @@ namespace Edu.Module.Course
CreateBy
=
checkModel
.
CreateBy
,
CreateTime
=
checkModel
.
CreateTime
,
Group_Id
=
checkModel
.
Group_Id
,
MakeUpStatus
=
3
,
MakeUpStatus
=
1
,
OrderGuestId
=
checkModel
.
OrderGuestId
});
}
...
...
@@ -1629,7 +1629,9 @@ namespace Edu.Module.Course
public
virtual
bool
SetMakeUpStatusModule
(
int
Id
,
int
MakeUpStatus
,
int
ClassCheckId
,
int
GuestId
,
UserInfo
userinfo
)
{
bool
flag
=
true
;
if
(
MakeUpStatus
==
2
)
var
model
=
student_MakeupRepository
.
GetEntity
(
Id
);
if
(
model
.
MakeUpStatus
==
MakeUpStatus
)
{
return
true
;
}
if
(
model
.
MakeUpStatus
==
1
)
{
Dictionary
<
string
,
object
>
makeUpFileds
=
new
Dictionary
<
string
,
object
>()
{
...
...
@@ -1651,16 +1653,92 @@ namespace Edu.Module.Course
if
(
flag
)
{
//更新学员状态和已补课时
var
guestModel
=
order_GuestRepository
.
GetEntity
(
GuestId
);
var
checkModel
=
classCheckRepository
.
GetEntity
(
ClassCheckId
);
var
makeUpHours
=
(
guestModel
?.
MakeUpHours
??
0
)
+
(
checkModel
?.
CurrentDeductionHours
??
0
);
Dictionary
<
string
,
object
>
guestFileds
=
new
Dictionary
<
string
,
object
>()
if
(
MakeUpStatus
==
2
)
{
{
nameof
(
RB_Order_Guest_ViewModel
.
GuestState
),
1
},
{
nameof
(
RB_Order_Guest_ViewModel
.
MakeUpHours
),
makeUpHours
}
//更新学员状态和已补课时
var
guestModel
=
order_GuestRepository
.
GetEntity
(
GuestId
);
var
checkModel
=
classCheckRepository
.
GetEntity
(
ClassCheckId
);
var
makeUpHours
=
(
guestModel
?.
MakeUpHours
??
0
)
+
(
checkModel
?.
CurrentDeductionHours
??
0
);
Dictionary
<
string
,
object
>
guestFileds
=
new
Dictionary
<
string
,
object
>()
{
//{ nameof(RB_Order_Guest_ViewModel.GuestState), 1 },
{
nameof
(
RB_Order_Guest_ViewModel
.
MakeUpHours
),
makeUpHours
}
};
flag
=
order_GuestRepository
.
Update
(
guestFileds
,
new
WhereHelper
(
nameof
(
RB_Order_Guest_ViewModel
.
Id
),
GuestId
));
}
}
}
else
{
if
(
MakeUpStatus
==
2
)
{
Dictionary
<
string
,
object
>
makeUpFileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_Makeup_ViewModel
.
MakeUpStatus
),
MakeUpStatus
},
{
nameof
(
RB_Student_Makeup_ViewModel
.
DealBy
),
userinfo
.
Id
},
{
nameof
(
RB_Student_Makeup_ViewModel
.
DealTime
),
DateTime
.
Now
},
};
flag
=
order_GuestRepository
.
Update
(
guestFileds
,
new
WhereHelper
(
nameof
(
RB_Order_Guest_ViewModel
.
Id
),
GuestId
));
//更新补课表状态
flag
=
student_MakeupRepository
.
Update
(
makeUpFileds
,
new
WhereHelper
(
nameof
(
RB_Student_Makeup_ViewModel
.
Id
),
Id
));
if
(
flag
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Class_Check_ViewModel
.
MakeUpStatus
),
MakeUpStatus
}
};
//更新签到表状态
flag
=
classCheckRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Class_Check_ViewModel
.
ClassCheckId
),
ClassCheckId
));
}
if
(
flag
)
{
//更新学员状态和已补课时
var
guestModel
=
order_GuestRepository
.
GetEntity
(
GuestId
);
var
checkModel
=
classCheckRepository
.
GetEntity
(
ClassCheckId
);
var
makeUpHours
=
(
guestModel
?.
MakeUpHours
??
0
)
+
(
checkModel
?.
CurrentDeductionHours
??
0
);
Dictionary
<
string
,
object
>
guestFileds
=
new
Dictionary
<
string
,
object
>()
{
//{ nameof(RB_Order_Guest_ViewModel.GuestState), 1 },
{
nameof
(
RB_Order_Guest_ViewModel
.
MakeUpHours
),
makeUpHours
}
};
flag
=
order_GuestRepository
.
Update
(
guestFileds
,
new
WhereHelper
(
nameof
(
RB_Order_Guest_ViewModel
.
Id
),
GuestId
));
}
}
else
if
(
MakeUpStatus
==
3
)
{
//由可补课 修改为 不可补课, 需要扣回
Dictionary
<
string
,
object
>
makeUpFileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_Makeup_ViewModel
.
MakeUpStatus
),
MakeUpStatus
},
{
nameof
(
RB_Student_Makeup_ViewModel
.
DealBy
),
userinfo
.
Id
},
{
nameof
(
RB_Student_Makeup_ViewModel
.
DealTime
),
DateTime
.
Now
},
};
//更新补课表状态
flag
=
student_MakeupRepository
.
Update
(
makeUpFileds
,
new
WhereHelper
(
nameof
(
RB_Student_Makeup_ViewModel
.
Id
),
Id
));
if
(
flag
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Class_Check_ViewModel
.
MakeUpStatus
),
MakeUpStatus
}
};
//更新签到表状态
flag
=
classCheckRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Class_Check_ViewModel
.
ClassCheckId
),
ClassCheckId
));
}
if
(
flag
)
{
//更新学员状态和已补课时
var
guestModel
=
order_GuestRepository
.
GetEntity
(
GuestId
);
var
checkModel
=
classCheckRepository
.
GetEntity
(
ClassCheckId
);
var
makeUpHours
=
(
guestModel
?.
MakeUpHours
??
0
)
-
(
checkModel
?.
CurrentDeductionHours
??
0
);
makeUpHours
=
makeUpHours
<
0
?
0
:
makeUpHours
;
Dictionary
<
string
,
object
>
guestFileds
=
new
Dictionary
<
string
,
object
>()
{
//{ nameof(RB_Order_Guest_ViewModel.GuestState), 1 },
{
nameof
(
RB_Order_Guest_ViewModel
.
MakeUpHours
),
makeUpHours
}
};
flag
=
order_GuestRepository
.
Update
(
guestFileds
,
new
WhereHelper
(
nameof
(
RB_Order_Guest_ViewModel
.
Id
),
GuestId
));
}
}
}
return
flag
;
...
...
Edu.Module.Course/OrderModule.cs
View file @
a995d81e
...
...
@@ -2273,6 +2273,56 @@ namespace Edu.Module.Course
{
return
orderRepository
.
GetMyOrderStatisticsRepository
(
demodel
);
}
/// <summary>
/// 修改订单关联人员
/// </summary>
/// <param name="orderId"></param>
/// <param name="helpEnterId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
string
SetOrderHelpEnterId
(
int
orderId
,
int
helpEnterId
,
UserInfo
userInfo
)
{
var
orderModel
=
orderRepository
.
GetEntity
(
orderId
);
if
(
orderModel
==
null
)
{
return
"订单不存在"
;
}
if
(
orderModel
.
OrderState
==
OrderStateEnum
.
Cancel
)
{
return
"订单已取消,无法修改"
;
}
if
(
orderModel
.
HelpEnterId
==
helpEnterId
)
{
return
""
;
}
string
OldName
=
"无"
,
NewName
=
"无"
;
if
(
orderModel
.
HelpEnterId
>
0
)
{
OldName
=
accountRepository
.
GetEmployeeInfo
(
orderModel
.
HelpEnterId
)?.
EmployeeName
??
""
;
}
if
(
helpEnterId
>
0
)
{
var
teacherModel
=
accountRepository
.
GetEmployeeInfo
(
helpEnterId
);
if
(
teacherModel
.
AccountType
!=
Common
.
Enum
.
User
.
AccountTypeEnum
.
Teacher
)
{
return
"所选账号不是教师端,无法关联"
;
}
NewName
=
teacherModel
?.
EmployeeName
??
""
;
}
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Order
.
HelpEnterId
),
helpEnterId
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Order
.
OrderId
),
FiledValue
=
orderId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag
=
orderRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
//写入日志
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
{
Id
=
0
,
Type
=
2
,
CreateBy
=
userInfo
.
Id
,
CreateTime
=
DateTime
.
Now
,
Group_Id
=
userInfo
.
Group_Id
,
LogContent
=
$"修改订单关联教师 由【
{
OldName
}
】修改为【
{
NewName
}
】"
,
School_Id
=
userInfo
.
School_Id
,
SourceId
=
orderId
});
}
return
flag
?
""
:
"出错了,请联系管理员"
;
}
#
endregion
#
region
订单操作
...
...
Edu.Module.Course/StudentBillModule.cs
View file @
a995d81e
...
...
@@ -271,6 +271,8 @@ namespace Edu.Module.Course
item
.
TeacherName
,
item
.
RoomName
,
OpenTime
=
Common
.
ConvertHelper
.
FormatDate
(
item
.
OpenTime
),
NewOriginalPrice
=
item
.
OriginalPrice
,
NewSellPrice
=
item
.
SellPrice
,
OriginalPrice
,
SellPrice
,
item
.
ClassPersion
,
...
...
@@ -294,7 +296,7 @@ namespace Edu.Module.Course
//获取当日签到数据
var
list
=
class_CheckRepository
.
GetStudentAttendanceDayStatistics
(
demodel
);
//根据班级 课次分组
var
RList
=
list
.
GroupBy
(
x
=>
new
{
x
.
ClassId
,
x
.
ClassName
,
x
.
CouseId
,
x
.
CourseName
,
x
.
ClassRoomId
,
x
.
RoomName
,
x
.
TeacherId
,
x
.
TeacherName
,
x
.
ClassDate
,
x
.
TimeBucket
}
).
Select
(
x
=>
new
var
RList
=
list
.
GroupBy
(
x
=>
new
{
x
.
ClassId
,
x
.
ClassName
,
x
.
CouseId
,
x
.
CourseName
,
x
.
ClassRoomId
,
x
.
RoomName
,
x
.
School_Id
,
x
.
TeacherId
,
x
.
TeacherName
,
x
.
ClassDate
,
x
.
TimeBucket
}).
OrderBy
(
x
=>
x
.
Key
.
ClassId
).
ThenBy
(
x
=>
x
.
Key
.
TimeBucket
).
Select
(
x
=>
new
{
x
.
Key
.
ClassId
,
x
.
Key
.
ClassName
,
...
...
@@ -302,20 +304,95 @@ namespace Edu.Module.Course
x
.
Key
.
CourseName
,
x
.
Key
.
ClassRoomId
,
x
.
Key
.
RoomName
,
x
.
Key
.
School_Id
,
x
.
Key
.
TeacherId
,
x
.
Key
.
TeacherName
,
ClassDate
=
x
.
Key
.
ClassDate
.
ToString
(
"yyyy-MM-dd"
),
x
.
Key
.
TimeBucket
,
GuestList
=
x
.
Select
(
z
=>
new
{
GuestList
=
x
.
Select
(
z
=>
new
{
z
.
OrderGuestId
,
z
.
GuestName
,
z
.
CurrentDeductionHours
,
z
.
CheckStatus
z
.
StudyNum
,
z
.
CheckStatus
,
z
.
ClassTimeId
})
});
return
RList
;
}
/// <summary>
/// 获取学生的当日出勤情况 Excel
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
ExcelDataSource
>
GetStudentAttendanceDayStatisticsToExcel
(
RB_Class_Check_ViewModel
demodel
)
{
List
<
ExcelDataSource
>
RDate
=
new
List
<
ExcelDataSource
>();
//获取当日签到数据
var
list
=
class_CheckRepository
.
GetStudentAttendanceDayStatistics
(
demodel
);
//根据班级 课次分组
var
glist
=
list
.
GroupBy
(
x
=>
new
{
x
.
ClassId
,
x
.
ClassName
,
x
.
CouseId
,
x
.
CourseName
,
x
.
ClassRoomId
,
x
.
RoomName
,
x
.
School_Id
,
x
.
TeacherId
,
x
.
TeacherName
,
x
.
ClassDate
,
x
.
TimeBucket
}).
OrderBy
(
x
=>
x
.
Key
.
ClassId
).
ThenBy
(
x
=>
x
.
Key
.
TimeBucket
);
foreach
(
var
qitem
in
glist
)
{
int
Count
=
qitem
.
Count
();
int
Num
=
1
;
foreach
(
var
item
in
qitem
)
{
string
CheckStatusName
=
""
;
switch
(
item
.
CheckStatus
)
{
case
0
:
CheckStatusName
=
"正常"
;
break
;
case
1
:
CheckStatusName
=
"缺席"
;
break
;
case
2
:
CheckStatusName
=
"请假"
;
break
;
}
if
(
Num
==
1
)
{
ExcelDataSource
datarow
=
new
ExcelDataSource
(
30
)
{
ExcelRows
=
new
List
<
ExcelColumn
>()
{
new
ExcelColumn
(
value
:
qitem
.
Key
.
ClassName
){
Rowspan
=
Count
},
new
ExcelColumn
(
value
:
qitem
.
Key
.
CourseName
){
Rowspan
=
Count
},
new
ExcelColumn
(
value
:
qitem
.
Key
.
TeacherName
){
Rowspan
=
Count
},
new
ExcelColumn
(
value
:
qitem
.
Key
.
ClassDate
.
ToString
(
"yyyy-MM-dd"
)){
Rowspan
=
Count
},
new
ExcelColumn
(
value
:
qitem
.
Key
.
TimeBucket
){
Rowspan
=
Count
},
new
ExcelColumn
(
value
:
item
.
GuestName
){
},
new
ExcelColumn
(
value
:
item
.
CurrentDeductionHours
.
ToString
()){
},
new
ExcelColumn
(
value
:
CheckStatusName
){
},
}
};
RDate
.
Add
(
datarow
);
}
else
{
ExcelDataSource
datarow
=
new
ExcelDataSource
(
30
)
{
ExcelRows
=
new
List
<
ExcelColumn
>()
{
new
ExcelColumn
(
value
:
""
){
},
new
ExcelColumn
(
value
:
""
){
},
new
ExcelColumn
(
value
:
""
){
},
new
ExcelColumn
(
value
:
""
){
},
new
ExcelColumn
(
value
:
""
){
},
new
ExcelColumn
(
value
:
item
.
GuestName
){
},
new
ExcelColumn
(
value
:
item
.
CurrentDeductionHours
.
ToString
()){
},
new
ExcelColumn
(
value
:
CheckStatusName
){
},
}
};
RDate
.
Add
(
datarow
);
}
Num
++;
}
}
return
RDate
;
}
#
endregion
...
...
Edu.Module.EduTask/EducationReceiptModule.cs
View file @
a995d81e
...
...
@@ -319,6 +319,18 @@ namespace Edu.Module.EduTask
});
}
#
endregion
#
region
订单分拆
if
(
subItem
.
ReceiptType
==
Common
.
Enum
.
Finance
.
ReceiptTypeEnum
.
OrderSplitClass
)
{
string
transClassIds
=
string
.
Join
(
","
,
list
.
Where
(
qitem
=>
qitem
.
ReceiptType
==
subItem
.
ReceiptType
).
Select
(
qitem
=>
qitem
.
RelationId
));
orderTransList
=
order_ChangeRepository
.
GetOrderChangeListRepository
(
new
RB_Order_Change_ViewModel
()
{
QIds
=
transClassIds
,
ChangeType
=
2
,
});
}
#
endregion
}
foreach
(
var
item
in
list
)
...
...
@@ -401,7 +413,12 @@ namespace Edu.Module.EduTask
//订单转班
if
(
item
.
ReceiptType
==
Common
.
Enum
.
Finance
.
ReceiptTypeEnum
.
OrderTransClass
)
{
DataObj
=
orderTransList
?.
Where
(
qitem
=>
qitem
.
Id
==
item
.
RelationId
)?.
FirstOrDefault
();
DataObj
=
orderTransList
?.
Where
(
qitem
=>
qitem
.
Id
==
item
.
RelationId
&&
qitem
.
ChangeType
==
1
)?.
FirstOrDefault
();
}
//订单分拆
if
(
item
.
ReceiptType
==
Common
.
Enum
.
Finance
.
ReceiptTypeEnum
.
OrderSplitClass
)
{
DataObj
=
orderTransList
?.
Where
(
qitem
=>
qitem
.
Id
==
item
.
RelationId
&&
qitem
.
ChangeType
==
2
)?.
FirstOrDefault
();
}
object
AuditObj
=
new
object
();
if
(
item
.
VerifyStatus
==
EduTaskRrocessStatus
.
NotAudit
||
item
.
VerifyStatus
==
EduTaskRrocessStatus
.
AuditIng
)
...
...
@@ -1129,6 +1146,17 @@ namespace Edu.Module.EduTask
student_BackClassRepository
.
UpdateGuestStateRepository
(
receiptModel
,
auditModel
);
}
}
if
(
receiptModel
.
ReceiptType
==
Common
.
Enum
.
Finance
.
ReceiptTypeEnum
.
OrderSplitClass
)
{
if
(
auditModel
.
AuditStatus
==
2
)
{
orderChangeModule
.
UpdateOrderSplitModule
(
receiptModel
);
}
else
if
(
auditModel
.
AuditStatus
==
3
)
{
student_BackClassRepository
.
UpdateGuestStateRepository
(
receiptModel
,
auditModel
);
}
}
return
flag
;
}
...
...
Edu.Module.EduTask/OrderChangeModule.cs
View file @
a995d81e
This diff is collapsed.
Click to expand it.
Edu.Repository/Course/RB_ClassRepository.cs
View file @
a995d81e
...
...
@@ -24,9 +24,10 @@ namespace Edu.Repository.Course
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.* ,IFNULL(B.CourseName,'') AS CourseName,IFNULL(C.GuestNum,0) AS GuestNum
SELECT A.* ,IFNULL(B.CourseName,'') AS CourseName,IFNULL(C.GuestNum,0) AS GuestNum
,IFNULL(D.SName,'') AS SchoolName
FROM rb_class AS A LEFT JOIN rb_course AS B ON A.CouseId=B.CourseId
LEFT JOIN(SELECT ClassId,SUM(GuestNum) AS GuestNum FROM rb_order WHERE OrderState=1 GROUP BY ClassId) AS C ON A.ClassId=C.ClassId
LEFT JOIN rb_school AS D ON A.School_Id=D.SId
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Class_ViewModel
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
...
...
Edu.Repository/Course/RB_Class_CheckRepository.cs
View file @
a995d81e
...
...
@@ -358,6 +358,10 @@ WHERE 1=1 AND A.Status=0 ");
{
builder
.
AppendFormat
(
" AND C.{0}={1} "
,
nameof
(
RB_Class_Check_ViewModel
.
CouseId
),
query
.
CouseId
);
}
if
(
query
.
CheckStatus
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Class_Check_ViewModel
.
CheckStatus
),
query
.
CheckStatus
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
Q_ClassIds
))
{
builder
.
AppendFormat
(
" AND A.{0} in({1}) "
,
nameof
(
RB_Class_Check_ViewModel
.
ClassId
),
query
.
Q_ClassIds
);
...
...
Edu.Repository/Course/RB_OrderRepository.cs
View file @
a995d81e
...
...
@@ -237,7 +237,7 @@ ORDER BY {orderBy}
where
+=
$@" and o.
{
nameof
(
RB_Order_ViewModel
.
PreferPrice
)}
> (o.
{
nameof
(
RB_Order_ViewModel
.
Income
)}
- o.
{
nameof
(
RB_Order_ViewModel
.
Refund
)}
+ o.
{
nameof
(
RB_Order_ViewModel
.
PlatformTax
)}
+ o.
{
nameof
(
RB_Order_ViewModel
.
DiscountMoney
)}
) "
;
}
}
if
(
demodel
.
HelpEnterId
>
0
)
if
(
demodel
.
HelpEnterId
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Order_ViewModel
.
HelpEnterId
)}
=
{
demodel
.
HelpEnterId
}
"
;
}
...
...
Edu.Repository/Course/RB_Student_MakeupRepository.cs
View file @
a995d81e
...
...
@@ -27,7 +27,7 @@ namespace Edu.Repository.Course
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*,C.GuestName, D.ClassName,E.CourseName,F.TeacherName,G.RoomName,C.GuestState,H.StartTime,H.EndTime
SELECT A.*,C.GuestName, D.ClassName,E.CourseName,F.TeacherName,G.RoomName,C.GuestState,H.StartTime,H.EndTime
,H.TimeHour
FROM RB_Student_Makeup AS A LEFT JOIN rb_class_check AS B ON A.ClassCheckId=B.ClassCheckId
LEFT JOIN rb_order_guest AS C ON A.OrderGuestId=C.Id
LEFT JOIN rb_class AS D ON A.ClassId=D.ClassId
...
...
@@ -92,7 +92,7 @@ WHERE 1=1
CreateBy
=
model
.
CreateBy
,
CreateTime
=
model
.
CreateTime
,
Group_Id
=
model
.
Group_Id
,
MakeUpStatus
=
3
,
MakeUpStatus
=
1
,
OrderGuestId
=
model
.
OrderGuestId
};
newModel
.
Id
=
CheckStudentMakeUpExistsRepository
(
model
);
...
...
Edu.Repository/EduTask/RB_Education_ReceiptRepository.cs
View file @
a995d81e
...
...
@@ -259,6 +259,15 @@ WHERE 1=1
return
false
;
}
}
else
if
(
model
.
ReceiptType
==
Common
.
Enum
.
Finance
.
ReceiptTypeEnum
.
OrderSplitClass
)
{
flowModel
=
flowRepository
.
GetFlowRepository
(
Common
.
Config
.
OrderSplitClassFlowId
);
if
(
flowModel
==
null
)
{
message
=
"未配置订单分拆流程!"
;
return
false
;
}
}
if
(
flowModel
?.
FlowNodeList
?.
Count
==
0
)
{
message
=
"未配置审核流程!"
;
...
...
Edu.WebApi/Controllers/Course/ClassController.cs
View file @
a995d81e
...
...
@@ -1138,6 +1138,7 @@ namespace Edu.WebApi.Controllers.Course
item
.
MakeUpStatusStr
,
item
.
StartTime
,
item
.
EndTime
,
item
.
TimeHour
,
DealByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
DealBy
)?.
AccountName
,
DealTime
=
Common
.
ConvertHelper
.
FormatTime
(
item
.
DealTime
)
});
...
...
Edu.WebApi/Controllers/Course/OrderController.cs
View file @
a995d81e
...
...
@@ -1342,7 +1342,7 @@ namespace Edu.WebApi.Controllers.Course
PlatformTax
=
base
.
ParmJObj
.
GetDecimal
(
"PlatformTax"
),
EnterID
=
base
.
ParmJObj
.
GetInt
(
"EnterID"
),
HelpEnterId
=
base
.
ParmJObj
.
GetInt
(
"HelpEnterId"
,
0
),
ClassNo
=
base
.
ParmJObj
.
GetStringValue
(
"ClassNo"
)
,
ClassNo
=
base
.
ParmJObj
.
GetStringValue
(
"ClassNo"
)
};
demodel
.
Group_Id
=
userInfo
.
Group_Id
;
...
...
@@ -1533,7 +1533,9 @@ namespace Edu.WebApi.Controllers.Course
Q_OrderState
=
base
.
ParmJObj
.
GetInt
(
"Q_OrderState"
),
Q_OrderBy
=
base
.
ParmJObj
.
GetInt
(
"Q_OrderBy"
),
PlatformTax
=
base
.
ParmJObj
.
GetDecimal
(
"PlatformTax"
),
EnterID
=
base
.
ParmJObj
.
GetInt
(
"EnterID"
)
EnterID
=
base
.
ParmJObj
.
GetInt
(
"EnterID"
),
HelpEnterId
=
base
.
ParmJObj
.
GetInt
(
"HelpEnterId"
,
0
),
ClassNo
=
base
.
ParmJObj
.
GetStringValue
(
"ClassNo"
)
};
demodel
.
Group_Id
=
userInfo
.
Group_Id
;
...
...
@@ -1617,6 +1619,30 @@ namespace Edu.WebApi.Controllers.Course
}
}
/// <summary>
/// 修改订单的关联教师
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetOrderHelpEnterId
()
{
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
int
HelpEnterId
=
parms
.
GetInt
(
"HelpEnterId"
,
0
);
if
(
OrderId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递订单id"
);
}
string
msg
=
orderModule
.
SetOrderHelpEnterId
(
OrderId
,
HelpEnterId
,
userInfo
);
if
(
msg
==
""
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
(
msg
);
}
}
/// <summary>
/// 获取我的留学就业订单列表
/// </summary>
...
...
Edu.WebApi/Controllers/Course/StuController.cs
View file @
a995d81e
...
...
@@ -212,6 +212,58 @@ namespace Edu.WebApi.Controllers.Course
return
ApiResult
.
Success
(
""
,
RObj
);
}
/// <summary>
/// 获取学生的当日出勤情况 Excel导出
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
Obsolete
]
public
FileContentResult
GetStudentAttendanceDayStatisticsToExcel
()
{
List
<
ExcelDataSource
>
slist
=
new
List
<
ExcelDataSource
>();
ExcelDataSource
header
=
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
new
ExcelColumn
(
value
:
"班级"
){
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"课程"
){
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"老师"
){
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"上课日期"
){
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"上课时间"
){
CellWidth
=
25
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"学员姓名"
){
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"学习课时"
){
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"出勤状态"
){
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
}
}
};
slist
.
Add
(
header
);
string
ExcelName
=
"学员出勤统计"
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
)
+
".xls"
;
var
userInfo
=
base
.
UserInfo
;
RB_Class_Check_ViewModel
demodel
=
JsonHelper
.
DeserializeObject
<
RB_Class_Check_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
demodel
.
Group_Id
=
userInfo
.
Group_Id
;
if
(
string
.
IsNullOrEmpty
(
demodel
.
StartDate
))
{
var
byteData1
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData1
,
"application/octet-stream"
,
ExcelName
);
}
try
{
List
<
ExcelDataSource
>
RDate
=
studentBillModule
.
GetStudentAttendanceDayStatisticsToExcel
(
demodel
);
slist
.
AddRange
(
RDate
);
var
byteData
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData
,
"application/octet-stream"
,
ExcelName
);
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
"OutToExcelOrderStudentClassHoursList"
);
var
byteData1
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData1
,
"application/octet-stream"
,
ExcelName
);
}
}
#
endregion
...
...
Edu.WebApi/Controllers/EduTask/OrderChangeController.cs
View file @
a995d81e
...
...
@@ -106,5 +106,46 @@ namespace Edu.WebApi.Controllers.EduTask
bool
flag
=
orderChangeModule
.
SetOrderChangeModule
(
model
,
out
string
message
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
(
message
:
message
);
}
/// <summary>
/// 订单拆分申请
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetOrderSplit
()
{
var
model
=
new
RB_Order_Change_ViewModel
()
{
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
),
SourceOrderId
=
base
.
ParmJObj
.
GetInt
(
"SourceOrderId"
),
ChangeType
=
base
.
ParmJObj
.
GetInt
(
"ChangeType"
),
NewClassId
=
base
.
ParmJObj
.
GetInt
(
"NewClassId"
),
NewCourseId
=
base
.
ParmJObj
.
GetInt
(
"NewCourseId"
),
EffectiveDate
=
base
.
ParmJObj
.
GetDateTime
(
"EffectiveDate"
),
Remarks
=
base
.
ParmJObj
.
GetStringValue
(
"Remarks"
),
OrderGuestId
=
base
.
ParmJObj
.
GetInt
(
"OrderGuestId"
),
OutTime
=
base
.
ParmJObj
.
GetDateTime
(
"OutTime"
),
};
var
oldOrderModel
=
orderModule
.
GetClassOrderInfoModule
(
model
.
SourceOrderId
);
if
(
oldOrderModel
==
null
)
{
return
ApiResult
.
ParamIsNull
(
message
:
"原订单号不存在!"
);
}
if
(
oldOrderModel
.
PreferPrice
!=
(
oldOrderModel
.
Income
+
oldOrderModel
.
PlatformTax
-
oldOrderModel
.
Refund
))
{
return
ApiResult
.
ParamIsNull
(
message
:
"原订单款未收齐,不能转班!"
);
}
var
classModel
=
classModule
.
GetClassModule
(
model
.
NewClassId
);
model
.
CreateBy
=
base
.
UserInfo
.
Id
;
model
.
CreateTime
=
DateTime
.
Now
;
model
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
model
.
School_Id
=
classModel
.
School_Id
;
model
.
UpdateBy
=
base
.
UserInfo
.
Id
;
model
.
UpdateTime
=
DateTime
.
Now
;
bool
flag
=
orderChangeModule
.
SetOrderSplitModule
(
model
,
out
string
message
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
(
message
:
message
);
}
}
}
Edu.WebApi/appsettings.json
View file @
a995d81e
...
...
@@ -87,5 +87,7 @@
//临时上课邀请流程编号
"TempInvitationClassFlowId"
:
4
,
//订单转班流程编号
"OrderTransClassFlowId"
:
5
"OrderTransClassFlowId"
:
5
,
//订单分拆流程编号
"OrderSplitClassFlowId"
:
6
}
\ No newline at end of file
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