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
e42770db
Commit
e42770db
authored
Jul 23, 2021
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
41d71833
bf21d17e
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
389 additions
and
53 deletions
+389
-53
RB_Education_Contract.cs
Edu.Model/Entity/Course/RB_Education_Contract.cs
+11
-0
RB_Order_SplitDetails.cs
Edu.Model/Entity/Course/RB_Order_SplitDetails.cs
+66
-0
RB_Order_SplitDetails_ViewModel.cs
...Model/ViewModel/Course/RB_Order_SplitDetails_ViewModel.cs
+28
-0
RB_Order_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Order_ViewModel.cs
+5
-0
ClassModule.cs
Edu.Module.Course/ClassModule.cs
+1
-0
EducationContractModule.cs
Edu.Module.Course/EducationContractModule.cs
+4
-23
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+11
-1
EducationReceiptModule.cs
Edu.Module.EduTask/EducationReceiptModule.cs
+1
-1
OrderChangeModule.cs
Edu.Module.EduTask/OrderChangeModule.cs
+183
-23
RB_CourseRepository.cs
Edu.Repository/Course/RB_CourseRepository.cs
+5
-2
RB_Education_ContractRepository.cs
Edu.Repository/Course/RB_Education_ContractRepository.cs
+29
-1
RB_Order_GuestRepository.cs
Edu.Repository/Course/RB_Order_GuestRepository.cs
+1
-1
RB_Order_SplitDetailsRepository.cs
Edu.Repository/Course/RB_Order_SplitDetailsRepository.cs
+43
-0
ClassController.cs
Edu.WebApi/Controllers/Course/ClassController.cs
+1
-1
No files found.
Edu.Model/Entity/Course/RB_Education_Contract.cs
View file @
e42770db
...
...
@@ -343,5 +343,16 @@ namespace Edu.Model.Entity.Course
/// 状态(0-草稿,1-提交审核,2-审核通过,3-驳回,4-取消)
/// </summary>
public
int
Status
{
get
;
set
;
}
/// <summary>
/// 系统查询使用(1-正常,0-不查询)
/// </summary>
public
int
IsSystemUse
{
get
;
set
;
}
/// <summary>
/// 原合同编号
/// </summary>
public
int
SourceContractId
{
get
;
set
;
}
}
}
Edu.Model/Entity/Course/RB_Order_SplitDetails.cs
0 → 100644
View file @
e42770db
using
Edu.Common.Enum.Sale
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.Course
{
/// <summary>
/// 订单分拆关联信息实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Order_SplitDetails
{
/// <summary>
/// 主键
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 销售第一报名的订单编号
/// </summary>
public
int
OldOrderId
{
get
;
set
;
}
/// <summary>
/// 订单编号
/// </summary>
public
int
S_OrderId
{
get
;
set
;
}
/// <summary>
/// 订单报入类型
/// </summary>
public
OrderJoinTypeEnum
S_JoinType
{
get
;
set
;
}
/// <summary>
/// 订单班级编号
/// </summary>
public
int
S_ClassId
{
get
;
set
;
}
/// <summary>
/// 目标订单编号
/// </summary>
public
int
T_OrderId
{
get
;
set
;
}
/// <summary>
/// 目标订单报入类型
/// </summary>
public
OrderJoinTypeEnum
T_JoinType
{
get
;
set
;
}
/// <summary>
/// 目标订单班级编号
/// </summary>
public
int
T_ClassId
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
CreateTime
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/Course/RB_Order_SplitDetails_ViewModel.cs
0 → 100644
View file @
e42770db
using
Edu.Model.Entity.Course
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.Course
{
/// <summary>
/// 订单分拆关联信息视图实体类
/// </summary>
public
class
RB_Order_SplitDetails_ViewModel
:
RB_Order_SplitDetails
{
/// <summary>
/// 原订单编号【查询使用,多个逗号分隔】
/// </summary>
public
string
Q_OldOrderIds
{
get
;
set
;
}
/// <summary>
/// 原订单班级名称
/// </summary>
public
string
S_ClassName
{
get
;
set
;
}
/// <summary>
/// 新订单班级名称
/// </summary>
public
string
T_ClassName
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Course/RB_Order_ViewModel.cs
View file @
e42770db
...
...
@@ -206,6 +206,11 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public
int
OldGuestId
{
get
;
set
;
}
/// <summary>
/// 新订单学员的新总课时
/// </summary>
public
int
NewGuestTotalClassHours
{
get
;
set
;
}
/// <summary>
/// 学员编号【转班生成财务单据使用】
/// </summary>
...
...
Edu.Module.Course/ClassModule.cs
View file @
e42770db
...
...
@@ -1003,6 +1003,7 @@ namespace Edu.Module.Course
subItem
.
TimeHour
,
CheckNum
=
tempCheckList
?.
Where
(
qitem
=>
qitem
.
CheckStatus
==
0
)?.
Count
(),
NoCheckNum
=
tempCheckList
?.
Where
(
qitem
=>
qitem
.
CheckStatus
==
1
)?.
Count
(),
AskForLeaveNum
=
tempCheckList
?.
Where
(
qitem
=>
qitem
.
CheckStatus
==
2
)?.
Count
()
});
}
}
...
...
Edu.Module.Course/EducationContractModule.cs
View file @
e42770db
...
...
@@ -39,11 +39,6 @@ namespace Edu.Module.Course
/// </summary>
private
readonly
RB_GroupRepository
groupRepository
=
new
RB_GroupRepository
();
/// <summary>
/// 校区仓储层对象
/// </summary>
private
readonly
RB_SchoolRepository
schoolRepository
=
new
RB_SchoolRepository
();
/// <summary>
/// 订单仓储层对象
/// </summary>
...
...
@@ -239,7 +234,9 @@ namespace Edu.Module.Course
}
model
.
School_Id
=
classModel
?.
School_Id
??
0
;
//生成合同编码
model
.
ContractNo
=
CreateContractNumModule
(
model
.
Group_Id
,
model
.
School_Id
);
model
.
ContractNo
=
education_ContractRepository
.
CreateContractNumRepository
(
model
.
Group_Id
,
model
.
School_Id
);
model
.
IsSystemUse
=
1
;
model
.
SourceContractId
=
0
;
var
newId
=
education_ContractRepository
.
Insert
(
model
);
model
.
Id
=
newId
;
flag
=
newId
>
0
;
...
...
@@ -247,23 +244,7 @@ namespace Edu.Module.Course
return
flag
;
}
/// <summary>
/// 生成合同编号
/// </summary>
/// <param name="GroupId"></param>
/// <returns></returns>
public
string
CreateContractNumModule
(
int
GroupId
,
int
schoolId
)
{
var
schoolModel
=
schoolRepository
.
GetEntity
(
schoolId
);
string
newContractNum
=
Common
.
Config
.
ContractDefaultTitle
;
if
(
schoolModel
!=
null
&&
schoolModel
.
SId
>
0
)
{
newContractNum
=
schoolModel
?.
ContractTitle
??
Common
.
Config
.
ContractDefaultTitle
;
}
var
totalCount
=
education_ContractRepository
.
GetContractCount
(
new
RB_Education_Contract_ViewModel
()
{
Group_Id
=
GroupId
});
string
num
=
(
totalCount
+
1
+
18
).
ToString
(
"D4"
);
return
newContractNum
+
num
;
}
/// <summary>
/// 获取详情
...
...
Edu.Module.Course/OrderModule.cs
View file @
e42770db
...
...
@@ -164,6 +164,11 @@ namespace Edu.Module.Course
/// </summary>
private
readonly
RB_Visitor_ReserveRepository
visitor_ReserveRepository
=
new
RB_Visitor_ReserveRepository
();
/// <summary>
/// 订单拆分仓储层对象
/// </summary>
private
readonly
RB_Order_SplitDetailsRepository
splitDetailsRepository
=
new
RB_Order_SplitDetailsRepository
();
#
region
日语培训
/// <summary>
...
...
@@ -728,7 +733,7 @@ namespace Edu.Module.Course
}
#
endregion
#
region
续课订单和转班订单
添加学员名单
#
region
续课订单和转班订单
和分拆订单
添加学员名单
if
(
flag
&&
demodel
.
OldGuestId
>
0
)
{
var
oldGuestModel
=
order_GuestRepository
.
GetEntity
(
demodel
.
OldGuestId
);
...
...
@@ -779,6 +784,11 @@ namespace Edu.Module.Course
//原订单学员的剩余课时
guestModel
.
TotalHours
=
oldGuestModel
.
TotalHours
-
oldGuestModel
.
CompleteHours
;
}
else
if
(
demodel
.
JoinType
==
OrderJoinTypeEnum
.
SplitOrder
)
{
//新订单新课程的【根据时间计算的有效课时】
guestModel
.
TotalHours
=
demodel
.
NewGuestTotalClassHours
;
}
SetOrderGuestInfo
(
guestModel
,
out
string
Nmessage
);
demodel
.
NewGuestId
=
guestModel
.
Id
;
}
...
...
Edu.Module.EduTask/EducationReceiptModule.cs
View file @
e42770db
...
...
@@ -1155,7 +1155,7 @@ namespace Edu.Module.EduTask
}
else
if
(
auditModel
.
AuditStatus
==
3
)
{
student_BackClassRepository
.
UpdateGuestStateRepository
(
receiptModel
,
auditModel
);
//
student_BackClassRepository.UpdateGuestStateRepository(receiptModel, auditModel);
}
}
return
flag
;
...
...
Edu.Module.EduTask/OrderChangeModule.cs
View file @
e42770db
...
...
@@ -5,7 +5,7 @@ using Edu.Common.Enum.Course;
using
Edu.Common.Enum.EduTask
;
using
Edu.Common.Enum.Finance
;
using
Edu.Common.Plugin
;
using
Edu.Model.
CacheModel
;
using
Edu.Model.
Entity.Course
;
using
Edu.Model.Entity.EduTask
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Model.ViewModel.EduTask
;
...
...
@@ -13,12 +13,10 @@ using Edu.Module.Course;
using
Edu.Repository.Course
;
using
Edu.Repository.EduTask
;
using
Edu.Repository.Log
;
using
Edu.Repository.User
;
using
Newtonsoft.Json.Linq
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Edu.Module.EduTask
...
...
@@ -78,13 +76,23 @@ namespace Edu.Module.EduTask
/// </summary>
private
readonly
RB_Class_PlanRepository
class_PlanRepository
=
new
RB_Class_PlanRepository
();
/// <summary>
/// 合同仓储层对象
/// </summary>
private
readonly
RB_Education_ContractRepository
education_ContractRepository
=
new
RB_Education_ContractRepository
();
/// <summary>
/// 订单拆分仓储层对象
/// </summary>
private
readonly
RB_Order_SplitDetailsRepository
splitDetailsRepository
=
new
RB_Order_SplitDetailsRepository
();
/// <summary>
/// 新增订单转班
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[
TransactionCallHandler
]
public
virtual
bool
SetOrderChangeModule
(
RB_Order_Change_ViewModel
model
,
string
receiptFile
,
out
string
message
)
public
virtual
bool
SetOrderChangeModule
(
RB_Order_Change_ViewModel
model
,
out
string
message
)
{
message
=
""
;
bool
flag
=
false
;
...
...
@@ -109,8 +117,7 @@ namespace Edu.Module.EduTask
UpdateTime
=
model
.
UpdateTime
,
VerifyStatus
=
Common
.
Enum
.
EduTask
.
EduTaskRrocessStatus
.
NotAudit
,
IsCreate
=
0
,
EffectiveDate
=
model
.
EffectiveDate
,
ReceiptFile
=
receiptFile
EffectiveDate
=
model
.
EffectiveDate
};
flag
=
education_ReceiptRepository
.
SetEducationReceiptRepository
(
educationReceipt
,
out
message
);
Dictionary
<
string
,
object
>
guestFileds
=
new
Dictionary
<
string
,
object
>()
...
...
@@ -289,6 +296,19 @@ namespace Edu.Module.EduTask
}
#
endregion
#
region
新增老订单合同和新的转班合同
oldOrderModel
.
PreferPrice
=
oldPreferPrice
;
var
oldContract
=
education_ContractRepository
.
GetList
(
new
RB_Education_Contract_ViewModel
()
{
OrderId
=
orderChangeModel
.
SourceOrderId
,
GuestId
=
orderChangeModel
.
OrderGuestId
,
}).
Where
(
qitem
=>
qitem
.
Status
==
0
||
qitem
.
Status
==
1
||
qitem
.
Status
==
2
)?.
FirstOrDefault
();
//创建老订单合同
CreateContract
(
oldOrderModel
,
newCourseModel
,
oldContract
,
orderChangeModel
.
OrderGuestId
);
//创建新订单合同
CreateContract
(
orderModel
,
newCourseModel
,
oldContract
,
orderModel
.
NewGuestId
);
#
endregion
#
region
生成财务单据
if
(
flag
)
...
...
@@ -305,7 +325,6 @@ namespace Edu.Module.EduTask
Class_School_Id
=
oldClassModel
.
School_Id
,
SName
=
oldClassModel
.
SchoolName
,
OrderId
=
oldOrderModel
.
OrderId
,
};
var
RelevanceFrId
=
CreateExpenditure
(
changeModel
,
out
string
msg1
);
var
changeModel2
=
new
OrderChangeFinace
()
...
...
@@ -367,7 +386,7 @@ namespace Edu.Module.EduTask
IsPublic
=
7
,
ClientType
=
3659
,
CurrencyId
=
1
,
GuestId
=
change
.
GuestId
,
change
.
GuestId
,
WBMoney
=
change
.
InCome
,
PayDate
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
),
TemplateId
=
186
,
...
...
@@ -455,7 +474,7 @@ namespace Edu.Module.EduTask
ClientType
=
10
,
ClientID
=
3659
,
CurrencyId
=
1
,
GuestId
=
change
.
GuestId
,
change
.
GuestId
,
WBMoney
=
change
.
InCome
,
PayDate
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
),
TemplateId
=
185
,
...
...
@@ -518,7 +537,7 @@ namespace Edu.Module.EduTask
/// <param name="model"></param>
/// <returns></returns>
[
TransactionCallHandler
]
public
virtual
bool
SetOrderSplitModule
(
RB_Order_Change_ViewModel
model
,
string
receiptFile
,
out
string
message
)
public
virtual
bool
SetOrderSplitModule
(
RB_Order_Change_ViewModel
model
,
out
string
message
)
{
message
=
""
;
bool
flag
=
false
;
...
...
@@ -543,18 +562,17 @@ namespace Edu.Module.EduTask
UpdateTime
=
model
.
UpdateTime
,
VerifyStatus
=
Common
.
Enum
.
EduTask
.
EduTaskRrocessStatus
.
NotAudit
,
IsCreate
=
0
,
EffectiveDate
=
model
.
EffectiveDate
,
ReceiptFile
=
receiptFile
EffectiveDate
=
model
.
EffectiveDate
};
flag
=
education_ReceiptRepository
.
SetEducationReceiptRepository
(
educationReceipt
,
out
message
);
Dictionary
<
string
,
object
>
guestFileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Order_Guest_ViewModel
.
GuestState
),
8
}
};
if
(
flag
)
{
flag
=
guestRepository
.
Update
(
guestFileds
,
new
WhereHelper
(
nameof
(
RB_Order_Guest_ViewModel
.
Id
),
model
.
OrderGuestId
));
}
//
Dictionary<string, object> guestFileds = new Dictionary<string, object>()
//
{
//
{nameof(RB_Order_Guest_ViewModel.GuestState),8}
//
};
//
if (flag)
//
{
//
flag = guestRepository.Update(guestFileds, new WhereHelper(nameof(RB_Order_Guest_ViewModel.Id), model.OrderGuestId));
//
}
}
return
flag
;
}
...
...
@@ -584,12 +602,20 @@ namespace Edu.Module.EduTask
{
Q_ClassIds
=
orderChangeModel
.
NewClassId
+
","
+
oldOrderModel
.
ClassId
});
//课程列表
var
courseList
=
courseRepository
.
GetCourseListRepository
(
new
RB_Course_ViewModel
()
{
QCourseIds
=
orderChangeModel
.
NewCourseId
+
","
+
oldOrderModel
.
CourseId
});
var
oldClassModel
=
classList
?.
Where
(
qitem
=>
qitem
.
ClassId
==
oldOrderModel
.
ClassId
)?.
FirstOrDefault
()
??
new
RB_Class_ViewModel
();
var
newClassModel
=
classList
?.
Where
(
qitem
=>
qitem
.
ClassId
==
orderChangeModel
.
NewClassId
)?.
FirstOrDefault
()
??
new
RB_Class_ViewModel
();
//班级有效课时
var
courseValidHourse
=
planList
?.
Sum
(
qitem
=>
qitem
.
TimeHour
)
??
0
;
//课程信息
var
newCourseModel
=
courseRepository
.
GetEntity
(
orderChangeModel
.
NewCourseId
);
//新课程信息
var
newCourseModel
=
courseList
?.
Where
(
qitem
=>
qitem
.
CourseId
==
orderChangeModel
.
NewCourseId
)?.
FirstOrDefault
()
??
new
RB_Course_ViewModel
();
//原课程信息
var
oldCourseModel
=
courseList
.
Where
(
qitem
=>
qitem
.
CourseId
==
oldOrderModel
.
CourseId
)?.
FirstOrDefault
()
??
new
RB_Course_ViewModel
();
//新班级课程的应收
var
newPreferPrice
=
Math
.
Round
(
newCourseModel
.
SellPrice
/
newCourseModel
.
ClassHours
*
courseValidHourse
,
2
);
//原业务员
...
...
@@ -642,11 +668,26 @@ namespace Edu.Module.EduTask
orderModel
.
UpdateBy
=
userInfo
.
Id
;
orderModel
.
UpdateTime
=
DateTime
.
Now
;
orderModel
.
OldGuestId
=
orderChangeModel
.
OrderGuestId
;
orderModel
.
NewGuestTotalClassHours
=
Convert
.
ToInt32
(
courseValidHourse
);
flag
=
orderModule
.
SetClassOrderCommonModule
(
orderModel
,
userInfo
,
false
,
out
string
message
);
#
endregion
if
(
flag
)
{
//添加关联记录
splitDetailsRepository
.
Insert
(
new
RB_Order_SplitDetails
()
{
OldOrderId
=
orderChangeModel
.
SourceOrderId
,
S_OrderId
=
oldOrderModel
.
OrderId
,
S_JoinType
=
oldOrderModel
.
JoinType
,
S_ClassId
=
oldOrderModel
.
ClassId
,
T_OrderId
=
orderModel
.
OrderId
,
T_JoinType
=
orderModel
.
JoinType
,
T_ClassId
=
orderModel
.
ClassId
,
CreateBy
=
orderModel
.
CreateBy
,
CreateTime
=
DateTime
.
Now
});
#
region
修改老订单
【目标订单和应收】
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
...
...
@@ -661,7 +702,7 @@ namespace Edu.Module.EduTask
Dictionary
<
string
,
object
>
guestFileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Order_Guest_ViewModel
.
TotalHours
),
guestModel
.
TotalHours
-
courseValidHourse
},
{
nameof
(
RB_Order_Guest_ViewModel
.
GuestState
),
7
},
//
{nameof(RB_Order_Guest_ViewModel.GuestState),7 },
};
if
(
flag
)
{
...
...
@@ -669,6 +710,18 @@ namespace Edu.Module.EduTask
}
#
endregion
#
region
创建合同
var
oldContract
=
education_ContractRepository
.
GetList
(
new
RB_Education_Contract_ViewModel
()
{
OrderId
=
orderChangeModel
.
SourceOrderId
,
GuestId
=
orderChangeModel
.
OrderGuestId
,
}).
Where
(
qitem
=>
qitem
.
Status
==
0
||
qitem
.
Status
==
1
||
qitem
.
Status
==
2
)?.
FirstOrDefault
();
//生成老订单合同
CreateContract
(
oldOrderModel
,
oldCourseModel
,
oldContract
,
orderChangeModel
.
OrderGuestId
);
//生成新订单合同
CreateContract
(
orderModel
,
oldCourseModel
,
oldContract
,
orderModel
.
NewGuestId
);
#
endregion
#
region
生成财务单据
if
(
flag
)
...
...
@@ -720,5 +773,112 @@ namespace Edu.Module.EduTask
return
flag
;
}
#
endregion
/// <summary>
/// 生成合同
/// </summary>
/// <returns></returns>
public
bool
CreateContract
(
RB_Order
order
,
RB_Course
course
,
RB_Education_Contract_ViewModel
contractModel
,
int
guestId
)
{
bool
flag
=
false
;
var
guestModel
=
guestRepository
.
GetEntity
(
guestId
);
var
newModel
=
new
RB_Education_Contract
()
{
Id
=
0
,
CType
=
ContractTypeEnum
.
Train
,
OrderId
=
order
.
OrderId
,
GuestId
=
guestId
,
ContractNo
=
education_ContractRepository
.
CreateContractNumRepository
(
order
.
Group_Id
,
guestModel
.
School_Id
),
StudentName
=
guestModel
.
GuestName
,
StuBirth
=
contractModel
.
StuBirth
,
StuSex
=
contractModel
.
StuSex
,
StuAddress
=
contractModel
.
StuAddress
,
StuTel
=
contractModel
.
StuTel
,
StuEmail
=
contractModel
.
StuEmail
,
ParentName
=
contractModel
.
ParentName
,
ParentRelation
=
contractModel
.
ParentRelation
,
ParentTel
=
contractModel
.
ParentTel
,
ParentEmail
=
contractModel
.
ParentEmail
,
UrgentName
=
contractModel
.
UrgentName
,
UrgentRelation
=
contractModel
.
UrgentRelation
,
UrgentTel
=
contractModel
.
UrgentTel
,
GuardianIDCard
=
contractModel
.
GuardianIDCard
,
CourseName
=
course
.
CourseName
,
SchoolName
=
contractModel
.
SchoolName
,
SchoolPrincipal
=
contractModel
.
SchoolPrincipal
,
StartLevel
=
contractModel
.
StartLevel
,
CourseConsultant
=
contractModel
.
CourseConsultant
,
Payee
=
contractModel
.
Payee
,
FirstClassHours
=
guestModel
.
TotalHours
,
FirstCourseFee
=
order
.
PreferPrice
,
FirstBookFee
=
0
,
FirstClassFee
=
0
,
FirstDiscountMoney
=
0
,
FirstMoney
=
order
.
PreferPrice
,
FirstPayDate
=
contractModel
.
FirstPayDate
,
SecondClassHours
=
0
,
SecondCourseFee
=
0
,
SecondBookFee
=
0
,
SecondClassFee
=
0
,
SecondDiscountMoney
=
0
,
SecondMoney
=
0
,
SecondPayDate
=
contractModel
.
SecondPayDate
,
ThirdClassHours
=
0
,
ThirdCourseFee
=
0
,
ThirdBookFee
=
0
,
ThirdClassFee
=
0
,
ThirdDiscountMoney
=
0
,
ThirdMoney
=
0
,
ThirdPayDate
=
contractModel
.
ThirdPayDate
,
CNYCaps
=
StringHelper
.
MoneyToUpper
(
order
.
PreferPrice
.
ToString
()),
Money
=
order
.
PreferPrice
,
Exam
=
contractModel
.
Exam
,
IsSupplement
=
contractModel
.
IsSupplement
,
Sign
=
contractModel
.
Sign
,
SignDate
=
contractModel
.
SignDate
,
GuardianSign
=
contractModel
.
GuardianSign
,
AuditDate
=
contractModel
.
AuditDate
,
AuditEmpId
=
contractModel
.
AuditEmpId
,
IsCompanySeal
=
contractModel
.
IsCompanySeal
,
SealDate
=
contractModel
.
SealDate
,
Group_Id
=
contractModel
.
Group_Id
,
School_Id
=
contractModel
.
School_Id
,
CreateBy
=
contractModel
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
UpdateBy
=
contractModel
.
UpdateBy
,
UpdateTime
=
contractModel
.
UpdateTime
,
Status
=
contractModel
.
Status
,
IsSystemUse
=
1
,
SourceContractId
=
contractModel
.
Id
};
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Education_Contract
.
IsSystemUse
),
0
}
};
flag
=
education_ContractRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Education_Contract
.
Id
),
contractModel
.
Id
));
flag
=
education_ContractRepository
.
Insert
(
newModel
)
>
0
;
return
flag
;
}
/// <summary>
/// 回归原班上课
/// </summary>
/// <returns></returns>
public
bool
RegressSourceClassModule
(
int
OrderId
,
int
GuestId
,
int
oldOrderId
)
{
bool
flag
=
false
;
var
oldOrder
=
orderRepository
.
GetEntity
(
oldOrderId
);
var
order
=
orderRepository
.
GetEntity
(
OrderId
);
var
guest
=
guestRepository
.
GetEntity
(
GuestId
);
if
(
guest
.
TotalHours
!=
guest
.
CompleteHours
)
{
//生成收支相抵单据
}
return
flag
;
}
}
}
Edu.Repository/Course/RB_CourseRepository.cs
View file @
e42770db
...
...
@@ -26,10 +26,14 @@ SELECT A.*,IFNULL(B.CateName,'') AS CateName
FROM RB_Course AS A LEFT JOIN rb_course_category AS B ON A.CateId=B.CateId
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course_ViewModel
.
Group_Id
),
query
.
Group_Id
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course_ViewModel
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
if
(
query
!=
null
)
{
if
(
query
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course_ViewModel
.
Group_Id
),
query
.
Group_Id
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
CourseName
))
{
builder
.
AppendFormat
(
" AND A.{0} LIKE @CourseName "
,
nameof
(
RB_Course_ViewModel
.
CourseName
));
...
...
@@ -39,7 +43,6 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course_ViewModel
.
CateId
),
query
.
CateId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QCourseIds
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Course_ViewModel
.
CourseId
),
query
.
QCourseIds
);
...
...
Edu.Repository/Course/RB_Education_ContractRepository.cs
View file @
e42770db
using
Edu.Common.Enum
;
using
Edu.Model.Entity.Course
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Repository.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -14,6 +15,29 @@ namespace Edu.Repository.Course
/// </summary>
public
class
RB_Education_ContractRepository
:
BaseRepository
<
RB_Education_Contract
>
{
/// <summary>
/// 校区仓储层对象
/// </summary>
private
readonly
RB_SchoolRepository
schoolRepository
=
new
RB_SchoolRepository
();
/// <summary>
/// 生成合同编号
/// </summary>
/// <param name="GroupId"></param>
/// <returns></returns>
public
string
CreateContractNumRepository
(
int
GroupId
,
int
schoolId
)
{
var
schoolModel
=
schoolRepository
.
GetEntity
(
schoolId
);
string
newContractNum
=
Common
.
Config
.
ContractDefaultTitle
;
if
(
schoolModel
!=
null
&&
schoolModel
.
SId
>
0
)
{
newContractNum
=
schoolModel
?.
ContractTitle
??
Common
.
Config
.
ContractDefaultTitle
;
}
var
totalCount
=
GetContractCount
(
new
RB_Education_Contract_ViewModel
()
{
Group_Id
=
GroupId
});
string
num
=
(
totalCount
+
1
+
18
).
ToString
(
"D4"
);
return
newContractNum
+
num
;
}
/// <summary>
/// 获取分页列表
/// </summary>
...
...
@@ -89,7 +113,7 @@ namespace Edu.Repository.Course
public
List
<
RB_Education_Contract_ViewModel
>
GetList
(
RB_Education_Contract_ViewModel
demodel
)
{
DynamicParameters
parameters
=
new
DynamicParameters
();
string
where
=
$@" 1=1"
;
string
where
=
$@" 1=1
AND IsSystemUse=1
"
;
if
(
demodel
.
Group_Id
>
0
)
{
where
+=
$@" AND
{
nameof
(
RB_Education_Contract_ViewModel
.
Group_Id
)}
=
{
demodel
.
Group_Id
}
"
;
...
...
@@ -106,6 +130,10 @@ namespace Edu.Repository.Course
{
where
+=
$@" AND
{
nameof
(
RB_Education_Contract_ViewModel
.
OrderId
)}
IN(
{
demodel
.
OrderIds
}
)"
;
}
if
(
demodel
.
GuestId
>
0
)
{
where
+=
$@" AND
{
nameof
(
RB_Education_Contract_ViewModel
.
GuestId
)}
IN(
{
demodel
.
GuestId
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
GuestIds
))
{
where
+=
$@" AND
{
nameof
(
RB_Education_Contract_ViewModel
.
GuestId
)}
IN(
{
demodel
.
GuestIds
}
)"
;
...
...
Edu.Repository/Course/RB_Order_GuestRepository.cs
View file @
e42770db
...
...
@@ -109,7 +109,7 @@ namespace Edu.Repository.Course
}
if
(
demodel
.
QEffectStatus
==
1
)
{
where
+=
$@" AND (B.JoinType=1 OR (B.JoinType=2 AND B.EffectStatus IN(1) )) "
;
where
+=
$@" AND (B.JoinType=1 OR
B.JoinType=3 OR B.JoinType=4 OR B.JoinType=5 OR
(B.JoinType=2 AND B.EffectStatus IN(1) )) "
;
}
string
sql
=
$@"
...
...
Edu.Repository/Course/RB_Order_SplitDetailsRepository.cs
0 → 100644
View file @
e42770db
using
Edu.Model.Entity.Course
;
using
Edu.Model.ViewModel.Course
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Edu.Repository.Course
{
/// <summary>
/// 订单分拆关联信息仓储层
/// </summary>
public
class
RB_Order_SplitDetailsRepository
:
BaseRepository
<
RB_Order_SplitDetails
>
{
/// <summary>
/// 获取订单拆分关联列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Order_SplitDetails_ViewModel
>
GetOrderSplitDetailsListRepository
(
RB_Order_SplitDetails_ViewModel
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*,IFNULL(B.ClassName,'') AS S_ClassName,IFNULL(C.ClassName,'') AS T_ClassName
FROM RB_Order_SplitDetails AS A LEFT JOIN RB_class AS B ON A.S_ClassId=B.ClassId
LEFT JOIN rb_class AS C ON A.T_ClassId=C.ClassId
WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(
query
.
OldOrderId
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Order_SplitDetails_ViewModel
.
OldOrderId
),
query
.
OldOrderId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
Q_OldOrderIds
))
{
builder
.
AppendFormat
(
@" AND A.{0} IN({1}) "
,
nameof
(
RB_Order_SplitDetails_ViewModel
.
OldOrderId
),
query
.
Q_OldOrderIds
);
}
}
return
Get
<
RB_Order_SplitDetails_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
}
}
Edu.WebApi/Controllers/Course/ClassController.cs
View file @
e42770db
...
...
@@ -776,7 +776,7 @@ namespace Edu.WebApi.Controllers.Course
List
<
object
>
guestList
=
new
List
<
object
>();
foreach
(
var
item
in
orderGuestList
.
Where
(
x
=>
x
.
GuestState
==
1
||
x
.
GuestState
==
6
||
((
x
.
GuestState
==
5
||
x
.
GuestState
==
7
)
&&
x
.
ChangeEffectTime
.
HasValue
&&
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
x
.
ChangeEffectTime
))
>=
data
.
ClassDate
)))
{
if
(
item
.
JoinType
==
Common
.
Enum
.
Sale
.
OrderJoinTypeEnum
.
Normal
||
(
item
.
JoinType
==
Common
.
Enum
.
Sale
.
OrderJoinTypeEnum
.
InsertClass
&&
data
.
ClassDate
>=
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
item
.
EffectTime
))))
if
(
item
.
JoinType
==
Common
.
Enum
.
Sale
.
OrderJoinTypeEnum
.
Normal
||
item
.
JoinType
==
Common
.
Enum
.
Sale
.
OrderJoinTypeEnum
.
RenewOrder
||
(
item
.
JoinType
==
Common
.
Enum
.
Sale
.
OrderJoinTypeEnum
.
InsertClass
&&
data
.
ClassDate
>=
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
item
.
EffectTime
))))
{
guestList
.
Add
(
new
{
...
...
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