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
a61ebe1a
Commit
a61ebe1a
authored
Jun 10, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
1b575f43
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
242 additions
and
149 deletions
+242
-149
RB_Order.cs
Edu.Model/Entity/Course/RB_Order.cs
+5
-0
RB_Order_Guest_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Order_Guest_ViewModel.cs
+27
-1
RB_Order_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Order_ViewModel.cs
+7
-5
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+32
-34
RB_ClassRepository.cs
Edu.Repository/Course/RB_ClassRepository.cs
+0
-1
RB_OrderRepository.cs
Edu.Repository/Course/RB_OrderRepository.cs
+12
-9
RB_Order_GuestRepository.cs
Edu.Repository/Course/RB_Order_GuestRepository.cs
+15
-12
OrderController.cs
Edu.WebApi/Controllers/Course/OrderController.cs
+144
-87
No files found.
Edu.Model/Entity/Course/RB_Order.cs
View file @
a61ebe1a
...
@@ -209,5 +209,10 @@ namespace Edu.Model.Entity.Course
...
@@ -209,5 +209,10 @@ namespace Edu.Model.Entity.Course
/// 插班开始课时
/// 插班开始课时
/// </summary>
/// </summary>
public
int
StartClassHours
{
get
;
set
;
}
public
int
StartClassHours
{
get
;
set
;
}
/// <summary>
/// 是否插班报入
/// </summary>
public
int
IsChaBan
{
get
;
set
;
}
}
}
}
}
Edu.Model/ViewModel/Course/RB_Order_Guest_ViewModel.cs
View file @
a61ebe1a
using
System
;
using
Edu.Common.Enum.Sale
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
namespace
Edu.Model.ViewModel.Course
namespace
Edu.Model.ViewModel.Course
...
@@ -69,5 +70,30 @@ namespace Edu.Model.ViewModel.Course
...
@@ -69,5 +70,30 @@ namespace Edu.Model.ViewModel.Course
{
{
get
;
set
;
get
;
set
;
}
}
/// <summary>
/// 课程名称
/// </summary>
public
string
CourseName
{
get
;
set
;
}
/// <summary>
/// 课程编号
/// </summary>
public
int
CourseId
{
get
;
set
;
}
/// <summary>
/// 订单类型
/// </summary>
public
OrderTypeEnum
OrderType
{
get
;
set
;
}
/// <summary>
/// 开始课时
/// </summary>
public
int
StartClassHours
{
get
;
set
;
}
/// <summary>
/// 是否插班报入(1-是)
/// </summary>
public
int
IsChaBan
{
get
;
set
;
}
}
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/Course/RB_Order_ViewModel.cs
View file @
a61ebe1a
...
@@ -44,11 +44,6 @@ namespace Edu.Model.ViewModel.Course
...
@@ -44,11 +44,6 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
/// </summary>
public
string
GuestName
{
get
;
set
;
}
public
string
GuestName
{
get
;
set
;
}
/// <summary>
/// 课程id
/// </summary>
public
int
CouseId
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 订单查询状态 1正常 2取消
/// 订单查询状态 1正常 2取消
/// </summary>
/// </summary>
...
@@ -126,5 +121,12 @@ namespace Edu.Model.ViewModel.Course
...
@@ -126,5 +121,12 @@ namespace Edu.Model.ViewModel.Course
/// 协助人员姓名
/// 协助人员姓名
/// </summary>
/// </summary>
public
string
HelpEnterName
{
get
;
set
;
}
public
string
HelpEnterName
{
get
;
set
;
}
/// <summary>
/// 课程名称
/// </summary>
public
string
CourseName
{
get
;
set
;
}
}
}
}
}
\ No newline at end of file
Edu.Module.Course/OrderModule.cs
View file @
a61ebe1a
...
@@ -238,7 +238,8 @@ namespace Edu.Module.Course
...
@@ -238,7 +238,8 @@ namespace Edu.Module.Course
var
courseModel
=
courseRepository
.
GetEntity
(
classModel
.
CouseId
);
var
courseModel
=
courseRepository
.
GetEntity
(
classModel
.
CouseId
);
if
(
courseModel
!=
null
&&
courseModel
.
CourseId
>
0
)
if
(
courseModel
!=
null
&&
courseModel
.
CourseId
>
0
)
{
{
fileds
.
Add
(
"currentCourse"
,
new
{
fileds
.
Add
(
"currentCourse"
,
new
{
courseModel
.
CourseId
,
courseModel
.
CourseId
,
courseModel
.
CourseName
,
courseModel
.
CourseName
,
courseModel
.
ClassHours
,
courseModel
.
ClassHours
,
...
@@ -248,7 +249,7 @@ namespace Edu.Module.Course
...
@@ -248,7 +249,7 @@ namespace Edu.Module.Course
var
courseList
=
class_CourseRepository
.
GetClassCourseListRepository
(
new
RB_Class_Course_Extend
()
{
ClassId
=
classId
});
var
courseList
=
class_CourseRepository
.
GetClassCourseListRepository
(
new
RB_Class_Course_Extend
()
{
ClassId
=
classId
});
if
(
courseList
!=
null
)
if
(
courseList
!=
null
)
{
{
fileds
.
Add
(
"otherCourse"
,
courseList
.
Select
(
qitem
=>
new
{
qitem
.
CourseId
,
qitem
.
CourseName
,
qitem
.
ClassHours
,
qitem
.
SellPrice
}));
fileds
.
Add
(
"otherCourse"
,
courseList
.
Select
(
qitem
=>
new
{
qitem
.
CourseId
,
qitem
.
CourseName
,
qitem
.
ClassHours
,
qitem
.
SellPrice
}));
}
}
return
fileds
;
return
fileds
;
}
}
...
@@ -283,24 +284,29 @@ namespace Edu.Module.Course
...
@@ -283,24 +284,29 @@ namespace Edu.Module.Course
/// <param name="userInfo"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
/// <returns></returns>
[
TransactionCallHandler
]
[
TransactionCallHandler
]
public
virtual
bool
SetClassOrder
(
RB_Order_ViewModel
demodel
,
UserInfo
userInfo
,
bool
isEditOrder
,
out
string
message
)
public
virtual
bool
SetClassOrder
(
RB_Order_ViewModel
demodel
,
UserInfo
userInfo
,
bool
isEditOrder
,
out
string
message
)
{
{
bool
flag
=
false
;
bool
flag
=
false
;
message
=
""
;
message
=
""
;
//查询班级信息
//查询班级信息
var
classModel
=
classRepository
.
GetEntity
(
demodel
.
ClassId
);
var
classModel
=
classRepository
.
GetEntity
(
demodel
.
ClassId
);
var
courseModel
=
courseRepository
.
GetEntity
(
classModel
.
CouseId
);
if
(
classModel
==
null
)
if
(
classModel
==
null
)
{
{
flag
=
false
;
flag
=
false
;
message
=
"班级不存在"
;
message
=
"班级不存在"
;
return
flag
;
return
flag
;
}
}
if
(
demodel
.
IsChaBan
==
0
)
{
demodel
.
CourseId
=
classModel
.
CouseId
;
}
var
courseModel
=
courseRepository
.
GetEntity
(
demodel
.
CourseId
);
#
region
计算订单优惠信息
#
region
计算订单优惠信息
//获取课程优惠
//获取课程优惠
var
coursePreferentialList
=
course_PreferentialRepository
.
GetCoursePreferentialListRepostory
(
new
RB_Course_Preferential_Extend
()
var
coursePreferentialList
=
course_PreferentialRepository
.
GetCoursePreferentialListRepostory
(
new
RB_Course_Preferential_Extend
()
{
{
CourseId
=
classModel
.
Cou
seId
CourseId
=
demodel
.
Cour
seId
});
});
if
(
demodel
.
IsLessPrice
==
1
&&
demodel
.
LessPrice
>
0
)
if
(
demodel
.
IsLessPrice
==
1
&&
demodel
.
LessPrice
>
0
)
{
{
...
@@ -425,7 +431,7 @@ namespace Edu.Module.Course
...
@@ -425,7 +431,7 @@ namespace Edu.Module.Course
return
flag
;
return
flag
;
}
}
}
}
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
{
nameof
(
RB_Order_ViewModel
.
GuestNum
),
demodel
.
GuestNum
},
{
nameof
(
RB_Order_ViewModel
.
GuestNum
),
demodel
.
GuestNum
},
...
@@ -510,18 +516,18 @@ namespace Edu.Module.Course
...
@@ -510,18 +516,18 @@ namespace Edu.Module.Course
}
}
else
else
{
{
if
(
classModel
.
ClassStatus
!=
Common
.
Enum
.
Course
.
ClassStatusEnum
.
NonOpen
Class
)
if
(
classModel
.
ClassStatus
==
Common
.
Enum
.
Course
.
ClassStatusEnum
.
EndClass
||
classModel
.
ClassStatus
==
Common
.
Enum
.
Course
.
ClassStatusEnum
.
Cancel
Class
)
{
{
flag
=
false
;
flag
=
false
;
message
=
"班级状态不正确"
;
message
=
"班级状态不正确"
;
return
flag
;
return
flag
;
}
}
if
(
classModel
.
EndOrderTime
<
Convert
.
ToDateTime
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)))
//
if (classModel.EndOrderTime < Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")))
{
//
{
flag
=
false
;
//
flag = false;
message
=
"已过期,无法报名"
;
//
message = "已过期,无法报名";
return
flag
;
//
return flag;
}
//
}
int
BNum
=
orderRepository
.
GetClassOrderPeopleNum
(
demodel
.
ClassId
.
ToString
()).
FirstOrDefault
()?.
GuestNum
??
0
;
int
BNum
=
orderRepository
.
GetClassOrderPeopleNum
(
demodel
.
ClassId
.
ToString
()).
FirstOrDefault
()?.
GuestNum
??
0
;
if
(
BNum
+
demodel
.
GuestNum
>
classModel
.
ClassPersion
)
if
(
BNum
+
demodel
.
GuestNum
>
classModel
.
ClassPersion
)
{
{
...
@@ -555,7 +561,7 @@ namespace Edu.Module.Course
...
@@ -555,7 +561,7 @@ namespace Edu.Module.Course
return
flag
;
return
flag
;
}
}
}
}
int
OrderId
=
orderRepository
.
Insert
(
demodel
);
int
OrderId
=
orderRepository
.
Insert
(
demodel
);
flag
=
OrderId
>
0
;
flag
=
OrderId
>
0
;
if
(
flag
)
if
(
flag
)
...
@@ -778,7 +784,7 @@ namespace Edu.Module.Course
...
@@ -778,7 +784,7 @@ namespace Edu.Module.Course
return
model
;
return
model
;
}
}
/// <summary>
/// <summary>
/// 获取订单阶梯价格
/// 获取订单阶梯价格
...
@@ -919,6 +925,7 @@ namespace Edu.Module.Course
...
@@ -919,6 +925,7 @@ namespace Edu.Module.Course
ClassInfo
=
new
{
};
ClassInfo
=
new
{
};
//获取订单列表
//获取订单列表
var
orderList
=
new
List
<
RB_Order_ViewModel
>();
var
orderList
=
new
List
<
RB_Order_ViewModel
>();
int
courseId
=
0
;
if
(
classId
>
0
)
if
(
classId
>
0
)
{
{
var
cModel
=
classRepository
.
GetEntity
(
classId
);
var
cModel
=
classRepository
.
GetEntity
(
classId
);
...
@@ -926,6 +933,7 @@ namespace Edu.Module.Course
...
@@ -926,6 +933,7 @@ namespace Edu.Module.Course
{
{
return
new
List
<
RB_Order_ViewModel
>();
return
new
List
<
RB_Order_ViewModel
>();
}
}
courseId
=
cModel
.
CouseId
;
//获取班级教师
//获取班级教师
var
tModel
=
teacherRepository
.
GetEntity
(
cModel
.
Teacher_Id
);
var
tModel
=
teacherRepository
.
GetEntity
(
cModel
.
Teacher_Id
);
var
zModel
=
assistRepository
.
GetEntity
(
cModel
.
Assist_Id
);
var
zModel
=
assistRepository
.
GetEntity
(
cModel
.
Assist_Id
);
...
@@ -1396,18 +1404,6 @@ namespace Edu.Module.Course
...
@@ -1396,18 +1404,6 @@ namespace Edu.Module.Course
var
orderList
=
orderRepository
.
GetList
(
new
RB_Order_ViewModel
()
{
Group_Id
=
groupId
,
ClassId
=
classId
,
SourceId
=
SourceId
});
var
orderList
=
orderRepository
.
GetList
(
new
RB_Order_ViewModel
()
{
Group_Id
=
groupId
,
ClassId
=
classId
,
SourceId
=
SourceId
});
return
orderList
;
return
orderList
;
}
}
/// <summary>
/// 获取班级订单列表
/// </summary>
/// <param name="classId"></param>
/// <param name="groupId"></param>
/// <returns></returns>
public
List
<
RB_Order_ViewModel
>
GetClassOrderList_V3
(
int
orderId
,
int
groupId
)
{
//获取订单列表
var
orderList
=
orderRepository
.
GetList
(
new
RB_Order_ViewModel
()
{
Group_Id
=
groupId
,
OrderId
=
orderId
});
return
orderList
;
}
#
endregion
#
endregion
...
@@ -2125,16 +2121,19 @@ namespace Edu.Module.Course
...
@@ -2125,16 +2121,19 @@ namespace Edu.Module.Course
if
(
list
.
Any
())
if
(
list
.
Any
())
{
{
var
model
=
list
.
FirstOrDefault
();
var
model
=
list
.
FirstOrDefault
();
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Education_ContractAdjust_ViewModel
.
AdjustPrice
),
dmodel
.
AdjustPrice
},
{
nameof
(
RB_Education_ContractAdjust_ViewModel
.
AdjustPrice
),
dmodel
.
AdjustPrice
},
{
nameof
(
RB_Education_ContractAdjust_ViewModel
.
UpdateBy
),
userInfo
.
Id
},
{
nameof
(
RB_Education_ContractAdjust_ViewModel
.
UpdateBy
),
userInfo
.
Id
},
{
nameof
(
RB_Education_ContractAdjust_ViewModel
.
UpdateTime
),
DateTime
.
Now
},
{
nameof
(
RB_Education_ContractAdjust_ViewModel
.
UpdateTime
),
DateTime
.
Now
},
};
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
new
WhereHelper
(){
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Education_ContractAdjust_ViewModel
.
Id
),
FiledName
=
nameof
(
RB_Education_ContractAdjust_ViewModel
.
Id
),
FiledValue
=
model
.
Id
,
FiledValue
=
model
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
OperatorEnum
=
OperatorEnum
.
Equal
}
}
};
};
return
education_ContractAdjustRepository
.
Update
(
keyValues
,
wheres
);
return
education_ContractAdjustRepository
.
Update
(
keyValues
,
wheres
);
...
@@ -2154,7 +2153,6 @@ namespace Edu.Module.Course
...
@@ -2154,7 +2153,6 @@ namespace Edu.Module.Course
})
>
0
;
})
>
0
;
}
}
}
}
#
endregion
#
endregion
}
}
}
}
\ No newline at end of file
Edu.Repository/Course/RB_ClassRepository.cs
View file @
a61ebe1a
...
@@ -39,7 +39,6 @@ WHERE 1=1
...
@@ -39,7 +39,6 @@ WHERE 1=1
{
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Class_ViewModel
.
Group_Id
),
query
.
Group_Id
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Class_ViewModel
.
Group_Id
),
query
.
Group_Id
);
}
}
if
(
query
.
ClassId
>
0
)
if
(
query
.
ClassId
>
0
)
{
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Class_ViewModel
.
ClassId
),
query
.
ClassId
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Class_ViewModel
.
ClassId
),
query
.
ClassId
);
...
...
Edu.Repository/Course/RB_OrderRepository.cs
View file @
a61ebe1a
...
@@ -97,12 +97,15 @@ namespace Edu.Repository.Course
...
@@ -97,12 +97,15 @@ namespace Edu.Repository.Course
orderBy
=
" o.CreateTime desc"
;
orderBy
=
" o.CreateTime desc"
;
}
}
string
sql
=
$@" select o.*,c.ClassName,t.TeacherName,t.TeacherIcon from RB_Order o
string
sql
=
$@"
left join rb_class c on o.ClassId = c.ClassId
SELECT o.*,c.ClassName,t.TeacherName,t.TeacherIcon,IFNULL(course.CourseName,'') AS CourseName
left join rb_teacher t on c.Teacher_Id = t.TId
FROM RB_Order o
where
{
where
}
order by
{
orderBy
}
LEFT JOIN rb_class c on o.ClassId = c.ClassId
LEFT JOIN rb_teacher t on c.Teacher_Id = t.TId
LEFT JOIN rb_course AS course ON (o.CourseId=course.CourseId AND o.CourseId>0 AND o.OrderType=1)
WHERE
{
where
}
ORDER BY
{
orderBy
}
"
;
"
;
return
Get
<
RB_Order_ViewModel
>(
sql
).
ToList
();
return
Get
<
RB_Order_ViewModel
>(
sql
).
ToList
();
}
}
...
@@ -180,9 +183,9 @@ where {where} order by {orderBy}
...
@@ -180,9 +183,9 @@ where {where} order by {orderBy}
where
+=
$@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and GuestName like '%
{
demodel
.
GuestName
}
%')"
;
where
+=
$@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and GuestName like '%
{
demodel
.
GuestName
}
%')"
;
}
}
}
}
if
(
demodel
.
CouseId
>
0
)
if
(
demodel
.
Cou
r
seId
>
0
)
{
{
where
+=
$@" and c.
{
nameof
(
RB_Class
.
CouseId
)}
=
{
demodel
.
CouseId
}
"
;
where
+=
$@" and c.
{
nameof
(
RB_Class
.
CouseId
)}
=
{
demodel
.
Cou
r
seId
}
"
;
}
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
StartTime
))
if
(!
string
.
IsNullOrEmpty
(
demodel
.
StartTime
))
{
{
...
@@ -282,9 +285,9 @@ where {where} order by {orderBy}
...
@@ -282,9 +285,9 @@ where {where} order by {orderBy}
where
+=
$@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and GuestName like '%
{
demodel
.
GuestName
}
%')"
;
where
+=
$@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and GuestName like '%
{
demodel
.
GuestName
}
%')"
;
}
}
}
}
if
(
demodel
.
CouseId
>
0
)
if
(
demodel
.
Cou
r
seId
>
0
)
{
{
where
+=
$@" and c.
{
nameof
(
RB_Class
.
CouseId
)}
=
{
demodel
.
CouseId
}
"
;
where
+=
$@" and c.
{
nameof
(
RB_Class
.
CouseId
)}
=
{
demodel
.
Cou
r
seId
}
"
;
}
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
StartTime
))
if
(!
string
.
IsNullOrEmpty
(
demodel
.
StartTime
))
{
{
...
...
Edu.Repository/Course/RB_Order_GuestRepository.cs
View file @
a61ebe1a
...
@@ -74,38 +74,42 @@ namespace Edu.Repository.Course
...
@@ -74,38 +74,42 @@ namespace Edu.Repository.Course
/// <returns></returns>
/// <returns></returns>
public
List
<
RB_Order_Guest_ViewModel
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Order_Guest_ViewModel
demodel
)
public
List
<
RB_Order_Guest_ViewModel
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Order_Guest_ViewModel
demodel
)
{
{
string
where
=
$@" 1=1 and Status=0"
;
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.* ,IFNULL(course.CourseName,'') AS CourseName,tOrder.CourseId,tOrder.OrderType,tOrder.StartClassHours,tOrder.IsChaBan
FROM RB_Order_Guest AS A LEFT JOIN RB_Order as tOrder ON A.OrderId=tOrder.OrderId
LEFT JOIN rb_course AS course ON (tOrder.CourseId=course.CourseId AND tOrder.CourseId>0 AND tOrder.OrderType=1)
WHERE 1=1 AND A.Status=0
"
);
if
(
demodel
.
Group_Id
>
0
)
if
(
demodel
.
Group_Id
>
0
)
{
{
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
Group_Id
)}
=
{
demodel
.
Group_Id
}
"
;
builder
.
AppendFormat
(
$@" AND A.
{
nameof
(
RB_Order_Guest_ViewModel
.
Group_Id
)}
=
{
demodel
.
Group_Id
}
"
)
;
}
}
if
(
demodel
.
School_Id
>
0
)
if
(
demodel
.
School_Id
>
0
)
{
{
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
School_Id
)}
=
{
demodel
.
School_Id
}
"
;
builder
.
AppendFormat
(
$@" AND A.
{
nameof
(
RB_Order_Guest_ViewModel
.
School_Id
)}
=
{
demodel
.
School_Id
}
"
)
;
}
}
if
(
demodel
.
OrderId
>
0
)
if
(
demodel
.
OrderId
>
0
)
{
{
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
OrderId
)}
=
{
demodel
.
OrderId
}
"
;
builder
.
AppendFormat
(
$@" AND A.
{
nameof
(
RB_Order_Guest_ViewModel
.
OrderId
)}
=
{
demodel
.
OrderId
}
"
)
;
}
}
if
(
demodel
.
ClassId
>
0
)
if
(
demodel
.
ClassId
>
0
)
{
{
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
ClassId
)}
=
{
demodel
.
ClassId
}
"
;
builder
.
AppendFormat
(
$@" AND A.
{
nameof
(
RB_Order_Guest_ViewModel
.
ClassId
)}
=
{
demodel
.
ClassId
}
"
)
;
}
}
if
(
demodel
.
SourceId
>
0
)
if
(
demodel
.
SourceId
>
0
)
{
{
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
SourceId
)}
=
{
demodel
.
SourceId
}
"
;
builder
.
AppendFormat
(
$@" AND A.
{
nameof
(
RB_Order_Guest_ViewModel
.
SourceId
)}
=
{
demodel
.
SourceId
}
"
)
;
}
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
GuestName
))
if
(!
string
.
IsNullOrEmpty
(
demodel
.
GuestName
))
{
{
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
GuestName
)}
like '%
{
demodel
.
GuestName
}
%'"
;
builder
.
AppendFormat
(
$@" AND A.
{
nameof
(
RB_Order_Guest_ViewModel
.
GuestName
)}
like '%
{
demodel
.
GuestName
}
%'"
)
;
}
}
if
(
demodel
.
GuestState
>
0
)
if
(
demodel
.
GuestState
>
0
)
{
{
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
GuestState
)}
=
{
demodel
.
GuestState
}
"
;
builder
.
AppendFormat
(
$@" AND A.
{
nameof
(
RB_Order_Guest_ViewModel
.
GuestState
)}
=
{
demodel
.
GuestState
}
"
)
;
}
}
return
GetPage
<
RB_Order_Guest_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
string
sql
=
$@" select * from RB_Order_Guest where
{
where
}
"
;
return
GetPage
<
RB_Order_Guest_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
sql
).
ToList
();
}
}
...
@@ -145,7 +149,6 @@ namespace Edu.Repository.Course
...
@@ -145,7 +149,6 @@ namespace Edu.Repository.Course
{
{
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
GuestState
)}
=
{
demodel
.
GuestState
}
"
;
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
GuestState
)}
=
{
demodel
.
GuestState
}
"
;
}
}
string
sql
=
$@" select count(0) from RB_Order_Guest where
{
where
}
"
;
string
sql
=
$@" select count(0) from RB_Order_Guest where
{
where
}
"
;
var
obj
=
ExecuteScalar
(
sql
);
var
obj
=
ExecuteScalar
(
sql
);
if
(
obj
==
null
)
if
(
obj
==
null
)
...
...
Edu.WebApi/Controllers/Course/OrderController.cs
View file @
a61ebe1a
...
@@ -56,6 +56,12 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -56,6 +56,12 @@ namespace Edu.WebApi.Controllers.Course
List
<
object
>
result
=
new
List
<
object
>();
List
<
object
>
result
=
new
List
<
object
>();
foreach
(
var
x
in
list
)
foreach
(
var
x
in
list
)
{
{
int
IsChaBan
=
0
;
//不能插班报入
int
SurplusNum
=
x
.
ClassPersion
-
x
.
OrderStudentCount
;
if
(
x
.
ClassStatus
==
ClassStatusEnum
.
StudyIng
&&
SurplusNum
>
0
)
{
IsChaBan
=
1
;
//可以插班报入
}
var
obj
=
new
var
obj
=
new
{
{
x
.
ClassId
,
x
.
ClassId
,
...
@@ -76,7 +82,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -76,7 +82,7 @@ namespace Edu.WebApi.Controllers.Course
x
.
ClassPersion
,
x
.
ClassPersion
,
x
.
OutRemark
,
x
.
OutRemark
,
x
.
OrderStudentCount
,
x
.
OrderStudentCount
,
SurplusNum
=
x
.
ClassPersion
-
x
.
OrderStudentCount
,
SurplusNum
,
ClassStepPriceList
=
x
.
ClassStepPriceList
.
Select
(
z
=>
new
ClassStepPriceList
=
x
.
ClassStepPriceList
.
Select
(
z
=>
new
{
{
z
.
ClassStepPriceId
,
z
.
ClassStepPriceId
,
...
@@ -90,8 +96,9 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -90,8 +96,9 @@ namespace Edu.WebApi.Controllers.Course
ClassDate
=
x
.
ClassStyle
==
Common
.
Enum
.
Course
.
ClassStyleEnum
.
FixedDate
?
z
.
ClassDate
.
ToString
(
"yyyy-MM-dd"
)
:
""
ClassDate
=
x
.
ClassStyle
==
Common
.
Enum
.
Course
.
ClassStyleEnum
.
FixedDate
?
z
.
ClassDate
.
ToString
(
"yyyy-MM-dd"
)
:
""
}),
}),
x
.
SchoolName
,
x
.
SchoolName
,
UpdateTime
=
Common
.
ConvertHelper
.
FormatTime
(
x
.
UpdateTime
),
UpdateTime
=
Common
.
ConvertHelper
.
FormatTime
(
x
.
UpdateTime
),
x
.
OtherCourseList
,
x
.
OtherCourseList
,
IsChaBan
,
};
};
result
.
Add
(
obj
);
result
.
Add
(
obj
);
}
}
...
@@ -109,7 +116,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -109,7 +116,8 @@ namespace Edu.WebApi.Controllers.Course
var
userInfo
=
base
.
UserInfo
;
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
string
ClassIds
=
parms
.
GetStringValue
(
"ClassIds"
);
string
ClassIds
=
parms
.
GetStringValue
(
"ClassIds"
);
if
(
string
.
IsNullOrEmpty
(
ClassIds
))
{
if
(
string
.
IsNullOrEmpty
(
ClassIds
))
{
return
ApiResult
.
ParamIsNull
(
"请传递班级ids"
);
return
ApiResult
.
ParamIsNull
(
"请传递班级ids"
);
}
}
...
@@ -172,6 +180,10 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -172,6 +180,10 @@ namespace Edu.WebApi.Controllers.Course
{
{
x
.
OrderId
,
x
.
OrderId
,
x
.
ClassId
,
x
.
ClassId
,
x
.
CourseId
,
x
.
CourseName
,
x
.
StartClassHours
,
x
.
IsChaBan
,
x
.
ClassSchoolId
,
x
.
ClassSchoolId
,
x
.
TradeWay
,
x
.
TradeWay
,
x
.
Class_Price
,
x
.
Class_Price
,
...
@@ -187,7 +199,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -187,7 +199,7 @@ namespace Edu.WebApi.Controllers.Course
x
.
OrderState
,
x
.
OrderState
,
OrderStateName
=
x
.
OrderState
.
ToName
(),
OrderStateName
=
x
.
OrderState
.
ToName
(),
x
.
OrderSource
,
x
.
OrderSource
,
OrderSourceName
=
x
.
OrderSource
.
ToName
(),
OrderSourceName
=
x
.
OrderSource
.
ToName
(),
x
.
EnterID
,
x
.
EnterID
,
EnterName
=
UserReidsCache
.
GetUserLoginInfo
(
x
.
EnterID
)?.
AccountName
??
""
,
EnterName
=
UserReidsCache
.
GetUserLoginInfo
(
x
.
EnterID
)?.
AccountName
??
""
,
x
.
CommissionMoney
,
x
.
CommissionMoney
,
...
@@ -201,7 +213,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -201,7 +213,7 @@ namespace Edu.WebApi.Controllers.Course
x
.
DirectorRemark
,
x
.
DirectorRemark
,
x
.
OfferId
,
x
.
OfferId
,
x
.
HelpEnterId
,
x
.
HelpEnterId
,
HelpEnterName
=
UserReidsCache
.
GetUserLoginInfo
(
x
.
HelpEnterId
)?.
AccountName
,
HelpEnterName
=
UserReidsCache
.
GetUserLoginInfo
(
x
.
HelpEnterId
)?.
AccountName
,
x
.
GeneralOccupation
,
x
.
GeneralOccupation
,
x
.
EduOccupation
,
x
.
EduOccupation
,
x
.
IsLessPrice
,
x
.
IsLessPrice
,
...
@@ -240,7 +252,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -240,7 +252,8 @@ namespace Edu.WebApi.Controllers.Course
z
.
GuestName
,
z
.
GuestName
,
z
.
GuestState
z
.
GuestState
}),
}),
ContractList
=
x
.
ContractList
.
Select
(
z
=>
new
{
ContractList
=
x
.
ContractList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
Id
,
z
.
StudentName
,
z
.
StudentName
,
z
.
ContractNo
,
z
.
ContractNo
,
...
@@ -317,7 +330,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -317,7 +330,8 @@ namespace Edu.WebApi.Controllers.Course
z
.
GuestName
,
z
.
GuestName
,
z
.
GuestState
z
.
GuestState
}),
}),
ContractList
=
x
.
ContractList
.
Select
(
z
=>
new
{
ContractList
=
x
.
ContractList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
Id
,
z
.
StudentName
,
z
.
StudentName
,
z
.
ContractNo
,
z
.
ContractNo
,
...
@@ -339,26 +353,27 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -339,26 +353,27 @@ namespace Edu.WebApi.Controllers.Course
var
userInfo
=
base
.
UserInfo
;
var
userInfo
=
base
.
UserInfo
;
RB_Order_ViewModel
demodel
=
new
RB_Order_ViewModel
()
RB_Order_ViewModel
demodel
=
new
RB_Order_ViewModel
()
{
{
OrderId
=
base
.
ParmJObj
.
GetInt
(
"OrderId"
),
OrderId
=
base
.
ParmJObj
.
GetInt
(
"OrderId"
),
ClassId
=
base
.
ParmJObj
.
GetInt
(
"ClassId"
),
ClassId
=
base
.
ParmJObj
.
GetInt
(
"ClassId"
),
GuestNum
=
base
.
ParmJObj
.
GetInt
(
"GuestNum"
),
GuestNum
=
base
.
ParmJObj
.
GetInt
(
"GuestNum"
),
OrderSource
=(
OrderSourceEnum
)
base
.
ParmJObj
.
GetInt
(
"OrderSource"
),
OrderSource
=
(
OrderSourceEnum
)
base
.
ParmJObj
.
GetInt
(
"OrderSource"
),
OrderType
=(
OrderTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"OrderType"
),
OrderType
=
(
OrderTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"OrderType"
),
PreferPrice
=
base
.
ParmJObj
.
GetDecimal
(
"PreferPrice"
),
PreferPrice
=
base
.
ParmJObj
.
GetDecimal
(
"PreferPrice"
),
SaleRemark
=
base
.
ParmJObj
.
GetStringValue
(
"SaleRemark"
),
SaleRemark
=
base
.
ParmJObj
.
GetStringValue
(
"SaleRemark"
),
SourceId
=
base
.
ParmJObj
.
GetInt
(
"SourceId"
),
SourceId
=
base
.
ParmJObj
.
GetInt
(
"SourceId"
),
Unit_Price
=
base
.
ParmJObj
.
GetDecimal
(
"Unit_Price"
),
Unit_Price
=
base
.
ParmJObj
.
GetDecimal
(
"Unit_Price"
),
HelpEnterId
=
base
.
ParmJObj
.
GetInt
(
"HelpEnterId"
),
HelpEnterId
=
base
.
ParmJObj
.
GetInt
(
"HelpEnterId"
),
GeneralOccupation
=
base
.
ParmJObj
.
GetStringValue
(
"GeneralOccupation"
),
GeneralOccupation
=
base
.
ParmJObj
.
GetStringValue
(
"GeneralOccupation"
),
EduOccupation
=
base
.
ParmJObj
.
GetStringValue
(
"EduOccupation"
),
EduOccupation
=
base
.
ParmJObj
.
GetStringValue
(
"EduOccupation"
),
IsLessPrice
=
base
.
ParmJObj
.
GetInt
(
"IsLessPrice"
),
IsLessPrice
=
base
.
ParmJObj
.
GetInt
(
"IsLessPrice"
),
LessPrice
=
base
.
ParmJObj
.
GetDecimal
(
"LessPrice"
),
LessPrice
=
base
.
ParmJObj
.
GetDecimal
(
"LessPrice"
),
OrderNature
=(
OrderNatureEnum
)
base
.
ParmJObj
.
GetInt
(
"OrderNature"
),
OrderNature
=
(
OrderNatureEnum
)
base
.
ParmJObj
.
GetInt
(
"OrderNature"
),
OldPreferPrice
=
base
.
ParmJObj
.
GetDecimal
(
"OldPreferPrice"
),
OldPreferPrice
=
base
.
ParmJObj
.
GetDecimal
(
"OldPreferPrice"
),
CourseId
=
base
.
ParmJObj
.
GetInt
(
"CourseId"
),
CourseId
=
base
.
ParmJObj
.
GetInt
(
"CourseId"
),
StartClassHours
=
base
.
ParmJObj
.
GetInt
(
"StartClassHours"
),
StartClassHours
=
base
.
ParmJObj
.
GetInt
(
"StartClassHours"
),
IsChaBan
=
base
.
ParmJObj
.
GetInt
(
"IsChaBan"
),
};
};
if
(
demodel
.
OrderType
==
OrderTypeEnum
.
CourseOrder
&&
demodel
.
ClassId
<=
0
)
if
(
demodel
.
OrderType
==
OrderTypeEnum
.
CourseOrder
&&
demodel
.
ClassId
<=
0
)
{
{
return
ApiResult
.
ParamIsNull
(
"请传递班级id"
);
return
ApiResult
.
ParamIsNull
(
"请传递班级id"
);
}
}
...
@@ -392,7 +407,18 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -392,7 +407,18 @@ namespace Edu.WebApi.Controllers.Course
if
(
demodel
.
OrderType
==
OrderTypeEnum
.
CourseOrder
)
if
(
demodel
.
OrderType
==
OrderTypeEnum
.
CourseOrder
)
{
{
flag
=
orderModule
.
SetClassOrder
(
demodel
,
userInfo
,
base
.
CheckUserActionAuth
(
"Edit_Order"
),
out
message
);
if
(
demodel
.
IsChaBan
==
0
)
{
demodel
.
StartClassHours
=
0
;
}
else
if
(
demodel
.
IsChaBan
==
1
)
{
if
(
demodel
.
CourseId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
message
:
"请选择插班课程!"
);
}
}
flag
=
orderModule
.
SetClassOrder
(
demodel
,
userInfo
,
base
.
CheckUserActionAuth
(
"Edit_Order"
),
out
message
);
}
}
else
else
{
{
...
@@ -406,12 +432,14 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -406,12 +432,14 @@ namespace Edu.WebApi.Controllers.Course
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
SetOrderPreferPrice
()
{
public
ApiResult
SetOrderPreferPrice
()
{
var
userInfo
=
base
.
UserInfo
;
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
decimal
PreferPrice
=
parms
.
GetDecimal
(
"PreferPrice"
);
decimal
PreferPrice
=
parms
.
GetDecimal
(
"PreferPrice"
);
if
(
OrderId
<=
0
)
{
if
(
OrderId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递订单id"
);
return
ApiResult
.
ParamIsNull
(
"请传递订单id"
);
}
}
...
@@ -420,7 +448,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -420,7 +448,8 @@ namespace Edu.WebApi.Controllers.Course
{
{
return
ApiResult
.
Success
();
return
ApiResult
.
Success
();
}
}
else
{
else
{
return
ApiResult
.
Failed
();
return
ApiResult
.
Failed
();
}
}
}
}
...
@@ -430,7 +459,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -430,7 +459,8 @@ namespace Edu.WebApi.Controllers.Course
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
GetClassOrderInfo
()
{
public
ApiResult
GetClassOrderInfo
()
{
var
userInfo
=
base
.
UserInfo
;
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
...
@@ -440,13 +470,14 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -440,13 +470,14 @@ namespace Edu.WebApi.Controllers.Course
}
}
var
model
=
orderModule
.
GetClassOrderInfoModule
(
OrderId
);
var
model
=
orderModule
.
GetClassOrderInfoModule
(
OrderId
);
if
(
model
==
null
)
{
if
(
model
==
null
)
{
return
ApiResult
.
Failed
(
"订单不存在"
);
return
ApiResult
.
Failed
(
"订单不存在"
);
}
}
var
list
=
new
List
<
RB_Order_StepPrice_ViewModel
>();
var
list
=
new
List
<
RB_Order_StepPrice_ViewModel
>();
if
(
model
.
OrderType
==
OrderTypeEnum
.
CourseOrder
)
if
(
model
.
OrderType
==
OrderTypeEnum
.
CourseOrder
)
{
{
list
=
orderModule
.
GetClassOrderSetpPrice
(
OrderId
);
list
=
orderModule
.
GetClassOrderSetpPrice
(
OrderId
);
}
}
return
ApiResult
.
Success
(
""
,
new
return
ApiResult
.
Success
(
""
,
new
{
{
...
@@ -469,8 +500,11 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -469,8 +500,11 @@ namespace Edu.WebApi.Controllers.Course
model
.
IsLessPrice
,
model
.
IsLessPrice
,
model
.
LessPrice
,
model
.
LessPrice
,
model
.
OrderNature
,
model
.
OrderNature
,
OrderNatureName
=
model
.
OrderNature
.
ToName
(),
OrderNatureName
=
model
.
OrderNature
.
ToName
(),
model
.
OldPreferPrice
,
model
.
OldPreferPrice
,
model
.
IsChaBan
,
model
.
CourseId
,
model
.
StartClassHours
,
},
},
StepPriceList
=
list
.
Select
(
x
=>
new
StepPriceList
=
list
.
Select
(
x
=>
new
{
{
...
@@ -486,7 +520,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -486,7 +520,7 @@ namespace Edu.WebApi.Controllers.Course
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
GetClassOrderForDetail
()
public
ApiResult
GetClassOrderForDetail
()
{
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
...
@@ -526,7 +560,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -526,7 +560,7 @@ namespace Edu.WebApi.Controllers.Course
CreateTime2
=
model
.
CreateTime
.
ToString
(
"yyyy年MM月dd日"
),
CreateTime2
=
model
.
CreateTime
.
ToString
(
"yyyy年MM月dd日"
),
model
.
OrderType
,
model
.
OrderType
,
model
.
SourceId
,
model
.
SourceId
,
OrderTypeName
=
Common
.
Plugin
.
EnumHelper
.
ToName
(
model
.
OrderType
),
OrderTypeName
=
Common
.
Plugin
.
EnumHelper
.
ToName
(
model
.
OrderType
),
});
});
}
}
...
@@ -540,7 +574,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -540,7 +574,7 @@ namespace Edu.WebApi.Controllers.Course
var
userInfo
=
base
.
UserInfo
;
var
userInfo
=
base
.
UserInfo
;
JObject
prams
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
JObject
prams
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
OrderId
=
prams
.
GetInt
(
"OrderId"
,
0
);
int
OrderId
=
prams
.
GetInt
(
"OrderId"
,
0
);
if
(
OrderId
<=
0
)
if
(
OrderId
<=
0
)
{
{
return
ApiResult
.
ParamIsNull
(
"订单号不存在"
);
return
ApiResult
.
ParamIsNull
(
"订单号不存在"
);
}
}
...
@@ -549,7 +583,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -549,7 +583,8 @@ namespace Edu.WebApi.Controllers.Course
{
{
return
ApiResult
.
Success
();
return
ApiResult
.
Success
();
}
}
else
{
else
{
return
ApiResult
.
Failed
();
return
ApiResult
.
Failed
();
}
}
}
}
...
@@ -559,7 +594,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -559,7 +594,8 @@ namespace Edu.WebApi.Controllers.Course
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
UpdateOrderSale
()
{
public
ApiResult
UpdateOrderSale
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
var
userInfo
=
base
.
UserInfo
;
var
userInfo
=
base
.
UserInfo
;
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
...
@@ -578,7 +614,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -578,7 +614,8 @@ namespace Edu.WebApi.Controllers.Course
{
{
return
ApiResult
.
Success
();
return
ApiResult
.
Success
();
}
}
else
{
else
{
return
ApiResult
.
Failed
(
msg
);
return
ApiResult
.
Failed
(
msg
);
}
}
}
}
...
@@ -615,7 +652,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -615,7 +652,8 @@ namespace Edu.WebApi.Controllers.Course
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
UpdateOrderRemark
()
{
public
ApiResult
UpdateOrderRemark
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
var
userInfo
=
base
.
UserInfo
;
var
userInfo
=
base
.
UserInfo
;
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
...
@@ -646,7 +684,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -646,7 +684,8 @@ namespace Edu.WebApi.Controllers.Course
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
UpdateOrderCommission
()
{
public
ApiResult
UpdateOrderCommission
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
var
userInfo
=
base
.
UserInfo
;
var
userInfo
=
base
.
UserInfo
;
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
...
@@ -797,10 +836,12 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -797,10 +836,12 @@ namespace Edu.WebApi.Controllers.Course
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
int
ClassId
=
parms
.
GetInt
(
"ClassId"
,
0
);
int
ClassId
=
parms
.
GetInt
(
"ClassId"
,
0
);
if
(
OrderId
<=
0
)
{
if
(
OrderId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递订单id"
);
return
ApiResult
.
ParamIsNull
(
"请传递订单id"
);
}
}
if
(
ClassId
<=
0
)
{
if
(
ClassId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递转入班级id"
);
return
ApiResult
.
ParamIsNull
(
"请传递转入班级id"
);
}
}
...
@@ -809,7 +850,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -809,7 +850,8 @@ namespace Edu.WebApi.Controllers.Course
{
{
return
ApiResult
.
Success
();
return
ApiResult
.
Success
();
}
}
else
{
else
{
return
ApiResult
.
Failed
(
msg
);
return
ApiResult
.
Failed
(
msg
);
}
}
}
}
...
@@ -824,7 +866,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -824,7 +866,8 @@ namespace Edu.WebApi.Controllers.Course
var
userInfo
=
base
.
UserInfo
;
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
if
(
OrderId
<=
0
)
{
if
(
OrderId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
return
ApiResult
.
ParamIsNull
();
}
}
...
@@ -833,7 +876,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -833,7 +876,8 @@ namespace Edu.WebApi.Controllers.Course
{
{
return
ApiResult
.
Success
();
return
ApiResult
.
Success
();
}
}
else
{
else
{
return
ApiResult
.
Failed
();
return
ApiResult
.
Failed
();
}
}
}
}
...
@@ -850,9 +894,15 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -850,9 +894,15 @@ namespace Edu.WebApi.Controllers.Course
{
{
var
userInfo
=
base
.
UserInfo
;
var
userInfo
=
base
.
UserInfo
;
var
pageModel
=
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
pageModel
=
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
dmodel
=
JsonHelper
.
DeserializeObject
<
RB_Order_Guest_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
var
dmodel
=
new
RB_Order_Guest_ViewModel
()
{
OrderId
=
base
.
ParmJObj
.
GetInt
(
"OrderId"
),
ClassId
=
base
.
ParmJObj
.
GetInt
(
"ClassId"
),
GuestState
=
base
.
ParmJObj
.
GetInt
(
"GuestState"
),
GuestName
=
base
.
ParmJObj
.
GetStringValue
(
"GuestName"
),
SourceId
=
base
.
ParmJObj
.
GetInt
(
"SourceId"
),
};
dmodel
.
Group_Id
=
userInfo
.
Group_Id
;
dmodel
.
Group_Id
=
userInfo
.
Group_Id
;
var
list
=
orderModule
.
GetOrderGuestPageList
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
count
,
dmodel
);
var
list
=
orderModule
.
GetOrderGuestPageList
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
count
,
dmodel
);
pageModel
.
Count
=
Convert
.
ToInt32
(
count
);
pageModel
.
Count
=
Convert
.
ToInt32
(
count
);
pageModel
.
PageData
=
list
.
Select
(
x
=>
new
pageModel
.
PageData
=
list
.
Select
(
x
=>
new
...
@@ -864,9 +914,9 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -864,9 +914,9 @@ namespace Edu.WebApi.Controllers.Course
x
.
GuestStateStr
,
x
.
GuestStateStr
,
x
.
Profession
,
x
.
Profession
,
x
.
Sex
,
x
.
Sex
,
SexStr
=
x
.
Sex
==
1
?
"男"
:
"女"
,
SexStr
=
x
.
Sex
==
1
?
"男"
:
"女"
,
x
.
Age
,
x
.
Age
,
BirthDate
=
Common
.
ConvertHelper
.
FormatDate
(
x
.
BirthDate
),
BirthDate
=
Common
.
ConvertHelper
.
FormatDate
(
x
.
BirthDate
),
x
.
TotalHours
,
x
.
TotalHours
,
x
.
Mobile
,
x
.
Mobile
,
x
.
Basics
,
x
.
Basics
,
...
@@ -882,13 +932,17 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -882,13 +932,17 @@ namespace Edu.WebApi.Controllers.Course
x
.
ContactAddress
,
x
.
ContactAddress
,
x
.
Domicile
,
x
.
Domicile
,
UpdateTime
=
x
.
UpdateTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
UpdateTime
=
x
.
UpdateTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
IsShow
=
true
,
IsShow
=
true
,
x
.
GraduatedSchool
,
x
.
GraduatedSchool
,
x
.
GraduatedMajor
,
x
.
GraduatedMajor
,
x
.
VolunteerMajor
,
x
.
VolunteerMajor
,
x
.
Price
,
x
.
Price
,
x
.
StudyRemark
,
x
.
StudyRemark
,
x
.
StuIcon
x
.
StuIcon
,
x
.
CourseId
,
x
.
CourseName
,
x
.
StartClassHours
,
x
.
IsChaBan
,
});
});
return
ApiResult
.
Success
(
""
,
pageModel
);
return
ApiResult
.
Success
(
""
,
pageModel
);
}
}
...
@@ -898,38 +952,38 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -898,38 +952,38 @@ namespace Edu.WebApi.Controllers.Course
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
SetOrderGuestInfo
()
public
ApiResult
SetOrderGuestInfo
()
{
{
var
userInfo
=
base
.
UserInfo
;
var
userInfo
=
base
.
UserInfo
;
var
dmodel
=
new
RB_Order_Guest_ViewModel
()
var
dmodel
=
new
RB_Order_Guest_ViewModel
()
{
{
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
),
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
),
OrderId
=
base
.
ParmJObj
.
GetInt
(
"OrderId"
),
OrderId
=
base
.
ParmJObj
.
GetInt
(
"OrderId"
),
GuestName
=
base
.
ParmJObj
.
GetStringValue
(
"GuestName"
),
GuestName
=
base
.
ParmJObj
.
GetStringValue
(
"GuestName"
),
Profession
=
base
.
ParmJObj
.
GetStringValue
(
"Profession"
),
Profession
=
base
.
ParmJObj
.
GetStringValue
(
"Profession"
),
Sex
=
base
.
ParmJObj
.
GetInt
(
"Sex"
,
1
),
Sex
=
base
.
ParmJObj
.
GetInt
(
"Sex"
,
1
),
Age
=
base
.
ParmJObj
.
GetInt
(
"Age"
),
Age
=
base
.
ParmJObj
.
GetInt
(
"Age"
),
Mobile
=
base
.
ParmJObj
.
GetStringValue
(
"Mobile"
),
Mobile
=
base
.
ParmJObj
.
GetStringValue
(
"Mobile"
),
Basics
=
base
.
ParmJObj
.
GetStringValue
(
"Basics"
),
Basics
=
base
.
ParmJObj
.
GetStringValue
(
"Basics"
),
Education
=
(
GuestEducationEnum
)
base
.
ParmJObj
.
GetInt
(
"Education"
),
Education
=
(
GuestEducationEnum
)
base
.
ParmJObj
.
GetInt
(
"Education"
),
GuestSource
=
(
OrderSourceEnum
)
base
.
ParmJObj
.
GetInt
(
"GuestSource"
),
GuestSource
=
(
OrderSourceEnum
)
base
.
ParmJObj
.
GetInt
(
"GuestSource"
),
LearningGoals
=
(
GuestLearningGoalsEnum
)
base
.
ParmJObj
.
GetInt
(
"LearningGoals"
),
LearningGoals
=
(
GuestLearningGoalsEnum
)
base
.
ParmJObj
.
GetInt
(
"LearningGoals"
),
Contact
=
base
.
ParmJObj
.
GetStringValue
(
"Contact"
),
Contact
=
base
.
ParmJObj
.
GetStringValue
(
"Contact"
),
ContactMobile
=
base
.
ParmJObj
.
GetStringValue
(
"ContactMobile"
),
ContactMobile
=
base
.
ParmJObj
.
GetStringValue
(
"ContactMobile"
),
IDCard
=
base
.
ParmJObj
.
GetStringValue
(
"IDCard"
),
IDCard
=
base
.
ParmJObj
.
GetStringValue
(
"IDCard"
),
Domicile
=
base
.
ParmJObj
.
GetStringValue
(
"Domicile"
),
Domicile
=
base
.
ParmJObj
.
GetStringValue
(
"Domicile"
),
ContactAddress
=
base
.
ParmJObj
.
GetStringValue
(
"ContactAddress"
),
ContactAddress
=
base
.
ParmJObj
.
GetStringValue
(
"ContactAddress"
),
SourceId
=
base
.
ParmJObj
.
GetInt
(
"SourceId"
),
SourceId
=
base
.
ParmJObj
.
GetInt
(
"SourceId"
),
GraduatedSchool
=
base
.
ParmJObj
.
GetStringValue
(
"GraduatedSchool"
),
GraduatedSchool
=
base
.
ParmJObj
.
GetStringValue
(
"GraduatedSchool"
),
GraduatedMajor
=
base
.
ParmJObj
.
GetStringValue
(
"GraduatedMajor"
),
GraduatedMajor
=
base
.
ParmJObj
.
GetStringValue
(
"GraduatedMajor"
),
VolunteerMajor
=
base
.
ParmJObj
.
GetStringValue
(
"VolunteerMajor"
),
VolunteerMajor
=
base
.
ParmJObj
.
GetStringValue
(
"VolunteerMajor"
),
Price
=
base
.
ParmJObj
.
GetDecimal
(
"Price"
),
Price
=
base
.
ParmJObj
.
GetDecimal
(
"Price"
),
StudyRemark
=
base
.
ParmJObj
.
GetStringValue
(
"StudyRemark"
),
StudyRemark
=
base
.
ParmJObj
.
GetStringValue
(
"StudyRemark"
),
BirthDate
=
base
.
ParmJObj
.
GetDateTime
(
"BirthDate"
),
BirthDate
=
base
.
ParmJObj
.
GetDateTime
(
"BirthDate"
),
TotalHours
=
base
.
ParmJObj
.
GetInt
(
"TotalHours"
),
TotalHours
=
base
.
ParmJObj
.
GetInt
(
"TotalHours"
),
StuIcon
=
base
.
ParmJObj
.
GetStringValue
(
"StuIcon"
),
StuIcon
=
base
.
ParmJObj
.
GetStringValue
(
"StuIcon"
),
};
};
if
(
dmodel
.
OrderId
<=
0
)
if
(
dmodel
.
OrderId
<=
0
)
{
{
return
ApiResult
.
ParamIsNull
(
"请传递订单id"
);
return
ApiResult
.
ParamIsNull
(
"请传递订单id"
);
}
}
...
@@ -949,7 +1003,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -949,7 +1003,7 @@ namespace Edu.WebApi.Controllers.Course
dmodel
.
CreateTime
=
DateTime
.
Now
;
dmodel
.
CreateTime
=
DateTime
.
Now
;
dmodel
.
UpdateBy
=
userInfo
.
Id
;
dmodel
.
UpdateBy
=
userInfo
.
Id
;
dmodel
.
UpdateTime
=
DateTime
.
Now
;
dmodel
.
UpdateTime
=
DateTime
.
Now
;
bool
flag
=
orderModule
.
SetOrderGuestInfo
(
dmodel
,
out
string
message
);
bool
flag
=
orderModule
.
SetOrderGuestInfo
(
dmodel
,
out
string
message
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
(
message
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
(
message
);
}
}
...
@@ -958,7 +1012,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -958,7 +1012,8 @@ namespace Edu.WebApi.Controllers.Course
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
DelOrderGuestInfo
()
{
public
ApiResult
DelOrderGuestInfo
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
var
userInfo
=
base
.
UserInfo
;
var
userInfo
=
base
.
UserInfo
;
int
GuestId
=
parms
.
GetInt
(
"GuestId"
,
0
);
int
GuestId
=
parms
.
GetInt
(
"GuestId"
,
0
);
...
@@ -996,7 +1051,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -996,7 +1051,7 @@ namespace Edu.WebApi.Controllers.Course
OrderId
=
base
.
ParmJObj
.
GetInt
(
"OrderId"
),
OrderId
=
base
.
ParmJObj
.
GetInt
(
"OrderId"
),
GuestName
=
base
.
ParmJObj
.
GetStringValue
(
"GuestName"
),
GuestName
=
base
.
ParmJObj
.
GetStringValue
(
"GuestName"
),
ClassName
=
base
.
ParmJObj
.
GetStringValue
(
"ClassName"
),
ClassName
=
base
.
ParmJObj
.
GetStringValue
(
"ClassName"
),
CouseId
=
base
.
ParmJObj
.
GetInt
(
"CouseId"
),
Cou
r
seId
=
base
.
ParmJObj
.
GetInt
(
"CouseId"
),
StartTime
=
base
.
ParmJObj
.
GetStringValue
(
"StartTime"
),
StartTime
=
base
.
ParmJObj
.
GetStringValue
(
"StartTime"
),
EndTime
=
base
.
ParmJObj
.
GetStringValue
(
"EndTime"
),
EndTime
=
base
.
ParmJObj
.
GetStringValue
(
"EndTime"
),
OPStartTime
=
base
.
ParmJObj
.
GetStringValue
(
"OPStartTime"
),
OPStartTime
=
base
.
ParmJObj
.
GetStringValue
(
"OPStartTime"
),
...
@@ -1106,7 +1161,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -1106,7 +1161,8 @@ namespace Edu.WebApi.Controllers.Course
z
.
ContractStatus
,
z
.
ContractStatus
,
z
.
ContractStatusStr
,
z
.
ContractStatusStr
,
}),
}),
ContractList
=
x
?.
ContractList
.
Select
(
z
=>
new
{
ContractList
=
x
?.
ContractList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
Id
,
z
.
StudentName
,
z
.
StudentName
,
z
.
ContractNo
,
z
.
ContractNo
,
...
@@ -1133,7 +1189,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -1133,7 +1189,7 @@ namespace Edu.WebApi.Controllers.Course
OrderId
=
base
.
ParmJObj
.
GetInt
(
"OrderId"
),
OrderId
=
base
.
ParmJObj
.
GetInt
(
"OrderId"
),
GuestName
=
base
.
ParmJObj
.
GetStringValue
(
"GuestName"
),
GuestName
=
base
.
ParmJObj
.
GetStringValue
(
"GuestName"
),
ClassName
=
base
.
ParmJObj
.
GetStringValue
(
"ClassName"
),
ClassName
=
base
.
ParmJObj
.
GetStringValue
(
"ClassName"
),
CouseId
=
base
.
ParmJObj
.
GetInt
(
"CouseId"
),
Cou
r
seId
=
base
.
ParmJObj
.
GetInt
(
"CouseId"
),
StartTime
=
base
.
ParmJObj
.
GetStringValue
(
"StartTime"
),
StartTime
=
base
.
ParmJObj
.
GetStringValue
(
"StartTime"
),
EndTime
=
base
.
ParmJObj
.
GetStringValue
(
"EndTime"
),
EndTime
=
base
.
ParmJObj
.
GetStringValue
(
"EndTime"
),
OPStartTime
=
base
.
ParmJObj
.
GetStringValue
(
"OPStartTime"
),
OPStartTime
=
base
.
ParmJObj
.
GetStringValue
(
"OPStartTime"
),
...
@@ -1243,7 +1299,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -1243,7 +1299,8 @@ namespace Edu.WebApi.Controllers.Course
z
.
ContractStatus
,
z
.
ContractStatus
,
z
.
ContractStatusStr
,
z
.
ContractStatusStr
,
}),
}),
ContractList
=
x
?.
ContractList
.
Select
(
z
=>
new
{
ContractList
=
x
?.
ContractList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
Id
,
z
.
StudentName
,
z
.
StudentName
,
z
.
ContractNo
,
z
.
ContractNo
,
...
@@ -1303,7 +1360,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -1303,7 +1360,7 @@ namespace Edu.WebApi.Controllers.Course
x
.
OrderType
,
x
.
OrderType
,
x
.
SourceId
,
x
.
SourceId
,
x
.
ClassSchoolId
,
x
.
ClassSchoolId
,
ClassName
=
x
.
StudyName
,
ClassName
=
x
.
StudyName
,
x
.
TradeWay
,
x
.
TradeWay
,
x
.
Class_Price
,
x
.
Class_Price
,
x
.
Unit_Price
,
x
.
Unit_Price
,
...
...
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