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
cde72d95
Commit
cde72d95
authored
Aug 29, 2024
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
e9d31347
ac56378b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
924 additions
and
1416 deletions
+924
-1416
RB_Customer_Category.cs
Edu.Model/Entity/Customer/RB_Customer_Category.cs
+12
-1
RB_Employee_Extend.cs
Edu.Model/ViewModel/User/RB_Employee_Extend.cs
+5
-0
ClassModule.cs
Edu.Module.Course/ClassModule.cs
+6
-626
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+93
-65
ScrollClassModule.cs
Edu.Module.Course/ScrollClassModule.cs
+6
-4
CustomerModule.cs
Edu.Module.Customer/CustomerModule.cs
+2
-0
OrderChangeModule.cs
Edu.Module.EduTask/OrderChangeModule.cs
+131
-131
RB_Student_LeaveRepository.cs
Edu.Repository/EduTask/RB_Student_LeaveRepository.cs
+1
-533
RB_Class_CheckRepository.cs
Edu.Repository/Grade/RB_Class_CheckRepository.cs
+653
-0
AppletCenterController.cs
Edu.WebApi/Controllers/Applet/AppletCenterController.cs
+1
-1
ClassController.cs
Edu.WebApi/Controllers/Course/ClassController.cs
+3
-50
OrderController.cs
Edu.WebApi/Controllers/Course/OrderController.cs
+5
-5
B2BCustomerController.cs
Edu.WebApi/Controllers/Customer/B2BCustomerController.cs
+6
-0
No files found.
Edu.Model/Entity/Customer/RB_Customer_Category.cs
View file @
cde72d95
...
...
@@ -73,5 +73,16 @@ namespace Edu.Model.Entity.Customer
/// 合同附件
/// </summary>
public
string
ContractUrl
{
get
;
set
;
}
/// <summary>
/// 返佣比例
/// </summary>
public
decimal
RebateRate
{
get
;
set
;
}
/// <summary>
/// 固定返佣金额
/// </summary>
public
decimal
RebateMoney
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/User/RB_Employee_Extend.cs
View file @
cde72d95
...
...
@@ -128,6 +128,11 @@ namespace Edu.Model.ViewModel.User
/// </summary>
public
int
SumScore
{
get
;
set
;
}
/// <summary>
/// 绑定的企业微信
/// </summary>
public
string
WorkUserId
{
get
;
set
;
}
}
/// <summary>
/// 年假天数
...
...
Edu.Module.Course/ClassModule.cs
View file @
cde72d95
This diff is collapsed.
Click to expand it.
Edu.Module.Course/OrderModule.cs
View file @
cde72d95
...
...
@@ -129,6 +129,11 @@ namespace Edu.Module.Course
/// </summary>
private
readonly
RB_CustomerRepository
customerRepository
=
new
RB_CustomerRepository
();
/// <summary>
/// 同行资料
/// </summary>
private
readonly
RB_Customer_CategoryRepository
customer_CategoryRepository
=
new
RB_Customer_CategoryRepository
();
/// <summary>
/// 学生关联
/// </summary>
...
...
@@ -454,7 +459,8 @@ namespace Edu.Module.Course
CommissionType
=
orderCount
==
0
?
1
:
2
,
SchoolId
=
model
.
School_Id
,
GroupId
=
model
.
Group_Id
,
Remark
=
""
Remark
=
""
,
};
if
(
model
.
OrderType
==
OrderTypeEnum
.
CourseOrder
)
{
...
...
@@ -638,6 +644,27 @@ namespace Edu.Module.Course
else
if
((
int
)
m
.
OrderSourceType
==
2
)
{
var
customerModel
=
customerRepository
.
GetEntity
(
m
.
OrderSourceId
);
var
customerCompany
=
customer_CategoryRepository
.
GetEntity
(
customerModel
.
CategoryId
);
//验证订单是否 续费订单
var
orderModel
=
orderRepository
.
GetEntity
(
m
.
OrderId
);
if
(
orderModel
.
JoinType
==
OrderJoinTypeEnum
.
Normal
&&
(
customerCompany
.
RebateRate
>
0
||
customerCompany
.
RebateMoney
>
0
))
{
//同业返佣 只有首单反, 直接默认 次月全提
if
(
customerCompany
.
RebateRate
>
0
)
{
m
.
CommissionMoeny
=
Math
.
Round
(
sellPrice
*
(
customerCompany
.
RebateRate
/
100
),
2
,
MidpointRounding
.
AwayFromZero
);
}
else
{
m
.
CommissionMoeny
=
customerCompany
.
RebateMoney
;
}
m
.
CommissionReType
=
(
int
)
CourseRebateSetEnum
.
NextMonth
;
m
.
CommissionReValue
=
0
;
m
.
Remark
=
$"学员来源为:同业,学员为首次报名,本次报名金额为:
{
sellPrice
}
,本次返佣金额为:
{
m
.
CommissionMoeny
:
0.00
}
"
;
}
else
{
//走课程配置
if
(
customerModel
.
CustomerType
==
Common
.
Enum
.
Customer
.
CatetoryTypeEnum
.
Company
)
{
if
(
courseModel
.
CommissionReType
==
1
)
...
...
@@ -667,6 +694,7 @@ namespace Edu.Module.Course
m
.
Remark
=
$"学员来源为:校代,学员为
{(
m
.
CommissionType
==
1
?
"首次报名"
:
"续费报名"
)}
,本次报名金额为:
{
sellPrice
}
,本次返佣金额为:
{
m
.
CommissionMoeny
:
0.00
}
"
;
}
}
}
else
if
((
int
)
m
.
OrderSourceType
==
3
)
{
if
(
courseModel
.
CommissionReType
==
1
)
...
...
@@ -4893,57 +4921,57 @@ namespace Edu.Module.Course
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
();
DateTime
classDate
=
DateTime
.
Now
;
if
(
lastCheck
!=
null
&&
!
string
.
IsNullOrEmpty
(
Common
.
ConvertHelper
.
FormatDate
(
lastCheck
?.
ClassDate
)))
{
classDate
=
lastCheck
.
ClassDate
.
AddDays
(
1
);
}
var
checkModel
=
new
RB_Class_Check
()
{
ClassCheckId
=
0
,
ClassId
=
0
,
ClassDate
=
classDate
,
Status
=
0
,
ClassRoomId
=
0
,
Group_Id
=
lastCheck
?.
Group_Id
??
100000
,
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
++;
}
}
//
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();
//
DateTime classDate = DateTime.Now;
//
if (lastCheck != null && !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(lastCheck?.ClassDate)))
//
{
//
classDate = lastCheck.ClassDate.AddDays(1);
//
}
//
var checkModel = new RB_Class_Check()
//
{
//
ClassCheckId = 0,
//
ClassId = 0,
//
ClassDate = classDate,
//
Status = 0,
//
ClassRoomId = 0,
//
Group_Id = lastCheck?.Group_Id ?? 100000,
//
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
;
}
}
...
...
Edu.Module.Course/ScrollClassModule.cs
View file @
cde72d95
...
...
@@ -2863,7 +2863,8 @@ namespace Edu.Module.Course
if
(
gmodel
!=
null
&&
gmodel
.
CourseChapterNo
<
demodel
.
ChapterNo
)
{
//ld 2022-03-08 修改为学员上课最大课时
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Order_Guest_ViewModel
.
CourseChapterNo
),
demodel
.
ChapterNo
},
{
nameof
(
RB_Order_Guest_ViewModel
.
CompleteHours
),
demodel
.
ChapterNo
*
clist
.
Sum
(
x
=>
x
.
ClassHours
)}
};
...
...
@@ -2872,7 +2873,8 @@ namespace Edu.Module.Course
//章节已上完了 修改为 毕业
keyValues1
.
Add
(
nameof
(
Model
.
ViewModel
.
Sell
.
RB_Order_Guest_ViewModel
.
GuestState
),
Common
.
Enum
.
Course
.
GuestStateEnum
.
Graduate
);
}
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
Model
.
ViewModel
.
Sell
.
RB_Order_Guest_ViewModel
.
Id
),
FiledValue
=
gmodel
.
Id
,
...
...
Edu.Module.Customer/CustomerModule.cs
View file @
cde72d95
...
...
@@ -660,6 +660,8 @@ namespace Edu.Module.Customer
{
nameof
(
RB_Customer_Category_Extend
.
UpdateTime
),
model
.
UpdateTime
},
{
nameof
(
RB_Customer_Category_Extend
.
IsContract
),
model
.
IsContract
},
{
nameof
(
RB_Customer_Category_Extend
.
ContractUrl
),
model
.
ContractUrl
},
{
nameof
(
RB_Customer_Category_Extend
.
RebateRate
),
model
.
RebateRate
},
{
nameof
(
RB_Customer_Category_Extend
.
RebateMoney
),
model
.
RebateMoney
},
};
flag
=
customer_CategoryRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Customer_Category_Extend
.
CategoryId
),
model
.
CategoryId
));
}
...
...
Edu.Module.EduTask/OrderChangeModule.cs
View file @
cde72d95
This diff is collapsed.
Click to expand it.
Edu.Repository/EduTask/RB_Student_LeaveRepository.cs
View file @
cde72d95
This diff is collapsed.
Click to expand it.
Edu.Repository/Grade/RB_Class_CheckRepository.cs
View file @
cde72d95
This diff is collapsed.
Click to expand it.
Edu.WebApi/Controllers/Applet/AppletCenterController.cs
View file @
cde72d95
...
...
@@ -122,7 +122,7 @@ namespace Edu.WebApi.Controllers.Applet
{
State
=
1
,
TotalHours
=
guestModel
?.
TotalHours
??
0
,
CompleteHours
=
CompleteHours
,
CompleteHours
,
MakeUpHours
=
guestModel
?.
MakeUpHours
??
0
,
AbsenceNum
=
guestModel
?.
AbsenceNum
??
0
,
LeaveNum
=
guestModel
?.
LeaveNum
??
0
,
...
...
Edu.WebApi/Controllers/Course/ClassController.cs
View file @
cde72d95
...
...
@@ -58,7 +58,9 @@ namespace Edu.WebApi.Controllers.Course
CourseName
=
base
.
ParmJObj
.
GetStringValue
(
"CourseName"
),
ClassNo
=
base
.
ParmJObj
.
GetStringValue
(
"ClassNo"
),
CourseSubject
=
base
.
ParmJObj
.
GetInt
(
"CourseSubject"
),
ClassScrollType
=
base
.
ParmJObj
.
GetInt
(
"ClassScrollType"
,
1
)
ClassScrollType
=
base
.
ParmJObj
.
GetInt
(
"ClassScrollType"
,
1
),
StartTime
=
base
.
ParmJObj
.
GetStringValue
(
"StartTime"
),
EndTime
=
base
.
ParmJObj
.
GetStringValue
(
"EndTime"
),
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
List
<
object
>
result
=
new
List
<
object
>();
...
...
@@ -581,16 +583,6 @@ namespace Edu.WebApi.Controllers.Course
return
ApiResult
.
Success
(
data
:
data
);
}
/// <summary>
/// 初始化数据
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
InitData
()
{
bool
flag
=
classModule
.
InitDataModule
();
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 修改班级状态
...
...
@@ -1244,27 +1236,6 @@ namespace Edu.WebApi.Controllers.Course
EndDate
=
list
.
FirstOrDefault
().
ClassDate
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
ClassTimeId
=
list
.
FirstOrDefault
().
ClassTimeId
,
});
#
region
验证是否存在学员编号
if
(
list
.
Count
==
1
)
{
if
(
list
[
0
].
OrderGuestId
==
0
)
{
var
guestId
=
classModule
.
GetStudentOrderGuestIdByClassTimeIDModule
(
list
[
0
].
StuId
,
list
[
0
].
ClassTimeId
);
if
(
guestId
==
0
)
{
return
ApiResult
.
ParamIsNull
(
message
:
"当前课程不是你的上课内容,请联系前台"
);
}
else
{
list
[
0
].
OrderGuestId
=
guestId
;
}
}
if
(
checkLogList
.
Where
(
x
=>
x
.
OrderGuestId
==
list
[
0
].
OrderGuestId
&&
x
.
CheckStatus
==
list
[
0
].
CheckStatus
).
Any
())
{
return
ApiResult
.
Success
(
message
:
"check_repeat"
);
}
}
#
endregion
if
(
list
==
null
||
!
list
.
Any
())
{
...
...
@@ -1284,23 +1255,6 @@ namespace Edu.WebApi.Controllers.Course
}
#
endregion
//获取班级的学员信息
var
orderGuestList
=
classModule
.
GetOrderGuestListModule
(
new
RB_Order_Guest_ViewModel
{
Group_Id
=
groupId
,
ClassId
=
list
.
FirstOrDefault
().
ClassId
,
QEffectStatus
=
1
});
//判断今天有课没有
var
planList
=
classModule
.
GetClassPlanEntityModule
(
new
RB_Class_Plan_ViewModel
{
Group_Id
=
groupId
,
ClassId
=
list
.
FirstOrDefault
().
ClassId
,
QClassDateStr
=
Common
.
ConvertHelper
.
FormatDate
(
list
.
FirstOrDefault
().
ClassDate
),
});
if
(
planList
==
null
||
!
planList
.
Any
())
{
return
ApiResult
.
Failed
(
"今日无课程,无须签到"
);
}
foreach
(
var
item
in
list
)
{
var
signModel
=
checkLogList
?.
Where
(
qitem
=>
qitem
.
ClassDate
.
ToString
(
"yyyy-MM-dd"
)
==
item
.
ClassDate
.
ToString
(
"yyyy-MM-dd"
)
&&
qitem
.
ClassId
==
item
.
ClassId
&&
qitem
.
OrderGuestId
==
item
.
OrderGuestId
)?.
FirstOrDefault
();
...
...
@@ -1311,7 +1265,6 @@ namespace Edu.WebApi.Controllers.Course
item
.
CreateTime
=
signModel
.
CreateTime
;
item
.
CreateBy
=
Uid
;
item
.
Status
=
0
;
#
region
验证缺席
补课是否已处理
if
(
signModel
.
CheckStatus
==
1
&&
item
.
CheckStatus
!=
1
)
{
...
...
Edu.WebApi/Controllers/Course/OrderController.cs
View file @
cde72d95
...
...
@@ -625,11 +625,11 @@ namespace Edu.WebApi.Controllers.Course
}
//ld 2023-03-22 强验证 学生的到访表
string
rmsg
=
orderModule
.
GetStudentVisitVoucher
(
demodel
.
StuIds
);
if
(
rmsg
!=
""
)
{
return
ApiResult
.
Failed
(
rmsg
);
}
//
string rmsg = orderModule.GetStudentVisitVoucher(demodel.StuIds);
//
if (rmsg != "")
//
{
//
return ApiResult.Failed(rmsg);
//
}
}
demodel
.
Group_Id
=
userInfo
.
Group_Id
;
...
...
Edu.WebApi/Controllers/Customer/B2BCustomerController.cs
View file @
cde72d95
...
...
@@ -973,6 +973,8 @@ namespace Edu.WebApi.Controllers.Customer
item
.
OrderCount
,
item
.
IsContract
,
item
.
ContractUrl
,
item
.
RebateRate
,
item
.
RebateMoney
,
CatetoryTypeName
=
item
.
CatetoryType
.
ToName
(),
CreateTime
=
Common
.
ConvertHelper
.
FormatTime
(
item
.
CreateTime
),
});
...
...
@@ -1097,6 +1099,8 @@ namespace Edu.WebApi.Controllers.Customer
CatetoryType
=
(
CatetoryTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"CatetoryType"
),
IsContract
=
base
.
ParmJObj
.
GetInt
(
"IsContract"
),
ContractUrl
=
base
.
ParmJObj
.
GetStringValue
(
"ContractUrl"
),
RebateRate
=
base
.
ParmJObj
.
GetDecimal
(
"RebateRate"
),
RebateMoney
=
base
.
ParmJObj
.
GetDecimal
(
"RebateMoney"
),
};
var
linkMan
=
base
.
ParmJObj
.
GetStringValue
(
"linkMan"
);
var
linkTel
=
base
.
ParmJObj
.
GetStringValue
(
"linkTel"
);
...
...
@@ -1179,6 +1183,8 @@ namespace Edu.WebApi.Controllers.Customer
CatetoryTypeName
=
extModel
?.
CatetoryType
.
ToName
()??
""
,
extModel
?.
ContractUrl
,
extModel
?.
IsContract
,
extModel
?.
RebateRate
,
extModel
?.
RebateMoney
};
return
ApiResult
.
Success
(
data
:
obj
);
}
...
...
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