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
a5f9388d
Commit
a5f9388d
authored
Apr 01, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增字段
parent
5bca9891
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
213 additions
and
99 deletions
+213
-99
RB_Order_Guest.cs
Edu.Model/Entity/Course/RB_Order_Guest.cs
+30
-0
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+143
-87
RB_Order_GuestRepository.cs
Edu.Repository/Course/RB_Order_GuestRepository.cs
+4
-0
OrderController.cs
Edu.WebApi/Controllers/Course/OrderController.cs
+36
-12
No files found.
Edu.Model/Entity/Course/RB_Order_Guest.cs
View file @
a5f9388d
...
...
@@ -140,5 +140,35 @@ namespace Edu.Model.Entity.Course
/// 联系地址
/// </summary>
public
string
ContactAddress
{
get
;
set
;
}
/// <summary>
/// 留学就业编号
/// </summary>
public
int
SourceId
{
get
;
set
;
}
/// <summary>
/// 毕业院校
/// </summary>
public
string
GraduatedSchool
{
get
;
set
;
}
/// <summary>
/// 毕业专业
/// </summary>
public
string
GraduatedMajor
{
get
;
set
;
}
/// <summary>
/// 志愿专业
/// </summary>
public
string
VolunteerMajor
{
get
;
set
;
}
/// <summary>
/// 价格
/// </summary>
public
decimal
Price
{
get
;
set
;
}
/// <summary>
/// 留学就业备注
/// </summary>
public
string
StudyRemark
{
get
;
set
;
}
}
}
Edu.Module.Course/OrderModule.cs
View file @
a5f9388d
...
...
@@ -1220,84 +1220,131 @@ namespace Edu.Module.Course
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
string
SetOrderGuestInfo
(
RB_Order_Guest_ViewModel
dmodel
)
[
TransactionCallHandler
]
public
virtual
bool
SetOrderGuestInfo
(
RB_Order_Guest_ViewModel
dmodel
,
out
string
message
)
{
bool
flag
=
false
;
message
=
""
;
if
(
dmodel
.
Id
>
0
)
{
var
gModel
=
order_GuestRepository
.
GetEntity
(
dmodel
.
Id
);
string
LogContent
=
"修改学生名单【"
+
dmodel
.
Id
+
"】"
;
gModel
.
Age
=
dmodel
.
Age
;
if
(
gModel
.
Age
!=
dmodel
.
Age
)
{
LogContent
+=
",年龄由【"
+
gModel
.
Age
+
"】修改为【"
+
dmodel
.
Age
+
"】"
;
}
gModel
.
Basics
=
dmodel
.
Basics
;
gModel
.
Age
=
dmodel
.
Age
;
if
(
gModel
.
Basics
!=
dmodel
.
Basics
)
{
LogContent
+=
",日语基础由【"
+
gModel
.
Basics
+
"】修改为【"
+
dmodel
.
Basics
+
"】"
;
}
gModel
.
Contact
=
dmodel
.
Contact
;
gModel
.
Basics
=
dmodel
.
Basics
;
if
(
gModel
.
Contact
!=
dmodel
.
Contact
)
{
LogContent
+=
",紧急联系人由【"
+
gModel
.
Contact
+
"】修改为【"
+
dmodel
.
Contact
+
"】"
;
}
gModel
.
ContactMobile
=
dmodel
.
ContactMobile
;
gModel
.
Contact
=
dmodel
.
Contact
;
if
(
gModel
.
ContactMobile
!=
dmodel
.
ContactMobile
)
{
LogContent
+=
",紧急联系电话由【"
+
gModel
.
ContactMobile
+
"】修改为【"
+
dmodel
.
ContactMobile
+
"】"
;
}
gModel
.
Education
=
dmodel
.
Education
;
gModel
.
ContactMobile
=
dmodel
.
ContactMobile
;
if
(
gModel
.
Education
!=
dmodel
.
Education
)
{
LogContent
+=
",学历由【"
+
gModel
.
Education
.
ToName
()
+
"】修改为【"
+
dmodel
.
Education
.
ToName
()
+
"】"
;
}
gModel
.
GuestName
=
dmodel
.
GuestName
;
gModel
.
Education
=
dmodel
.
Education
;
if
(
gModel
.
GuestName
!=
dmodel
.
GuestName
)
{
LogContent
+=
",客人名称由【"
+
gModel
.
GuestName
+
"】修改为【"
+
dmodel
.
GuestName
+
"】"
;
}
gModel
.
GuestSource
=
dmodel
.
GuestSource
;
gModel
.
GuestName
=
dmodel
.
GuestName
;
if
(
gModel
.
GuestSource
!=
dmodel
.
GuestSource
)
{
LogContent
+=
",客人来源由【"
+
gModel
.
GuestSource
.
ToName
()
+
"】修改为【"
+
dmodel
.
GuestSource
.
ToName
()
+
"】"
;
}
gModel
.
LearningGoals
=
dmodel
.
LearningGoals
;
gModel
.
GuestSource
=
dmodel
.
GuestSource
;
if
(
gModel
.
LearningGoals
!=
dmodel
.
LearningGoals
)
{
LogContent
+=
",学习目的由【"
+
gModel
.
LearningGoals
.
ToName
()
+
"】修改为【"
+
dmodel
.
LearningGoals
.
ToName
()
+
"】"
;
}
gModel
.
Mobile
=
dmodel
.
Mobile
;
gModel
.
LearningGoals
=
dmodel
.
LearningGoals
;
if
(
gModel
.
Mobile
!=
dmodel
.
Mobile
)
{
LogContent
+=
",手机号码由【"
+
gModel
.
Mobile
+
"】修改为【"
+
dmodel
.
Mobile
+
"】"
;
}
gModel
.
Profession
=
dmodel
.
Profession
;
gModel
.
Mobile
=
dmodel
.
Mobile
;
if
(
gModel
.
Profession
!=
dmodel
.
Profession
)
{
LogContent
+=
",职业由【"
+
gModel
.
Profession
+
"】修改为【"
+
dmodel
.
Profession
+
"】"
;
}
gModel
.
Sex
=
dmodel
.
Sex
;
gModel
.
Profession
=
dmodel
.
Profession
;
if
(
gModel
.
Sex
!=
dmodel
.
Sex
)
{
LogContent
+=
",性别由【"
+
gModel
.
Sex
+
"】修改为【"
+
dmodel
.
Sex
+
"】"
;
}
gModel
.
IDCard
=
dmodel
.
IDCard
;
gModel
.
Sex
=
dmodel
.
Sex
;
if
(
gModel
.
IDCard
!=
dmodel
.
IDCard
)
{
LogContent
+=
",身份证由【"
+
gModel
.
IDCard
+
"】修改为【"
+
dmodel
.
IDCard
+
"】"
;
}
gModel
.
Domicile
=
dmodel
.
Domicile
;
gModel
.
IDCard
=
dmodel
.
IDCard
;
if
(
gModel
.
Domicile
!=
dmodel
.
Domicile
)
{
LogContent
+=
",身份证居住地由【"
+
gModel
.
Domicile
+
"】修改为【"
+
dmodel
.
Domicile
+
"】"
;
}
gModel
.
ContactAddress
=
dmodel
.
ContactAddress
;
gModel
.
Domicile
=
dmodel
.
Domicile
;
if
(
gModel
.
ContactAddress
!=
dmodel
.
ContactAddress
)
{
LogContent
+=
",联系地址由【"
+
gModel
.
ContactAddress
+
"】修改为【"
+
dmodel
.
ContactAddress
+
"】"
;
}
gModel
.
ContactAddress
=
dmodel
.
ContactAddress
;
if
(
gModel
.
GraduatedSchool
!=
dmodel
.
GraduatedSchool
)
{
LogContent
+=
",毕业院校由【"
+
gModel
.
GraduatedSchool
+
"】修改为【"
+
dmodel
.
GraduatedSchool
+
"】"
;
}
gModel
.
GraduatedSchool
=
dmodel
.
GraduatedSchool
;
if
(
gModel
.
GraduatedMajor
!=
dmodel
.
GraduatedMajor
)
{
LogContent
+=
",毕业专业由【"
+
gModel
.
GraduatedMajor
+
"】修改为【"
+
dmodel
.
GraduatedMajor
+
"】"
;
}
gModel
.
GraduatedMajor
=
dmodel
.
GraduatedMajor
;
if
(
gModel
.
VolunteerMajor
!=
dmodel
.
VolunteerMajor
)
{
LogContent
+=
",志愿专业由【"
+
gModel
.
VolunteerMajor
+
"】修改为【"
+
dmodel
.
VolunteerMajor
+
"】"
;
}
gModel
.
VolunteerMajor
=
dmodel
.
VolunteerMajor
;
if
(
gModel
.
Price
!=
dmodel
.
Price
)
{
LogContent
+=
",价格由【"
+
gModel
.
Price
+
"】修改为【"
+
dmodel
.
Price
+
"】"
;
}
gModel
.
Price
=
dmodel
.
Price
;
if
(
gModel
.
StudyRemark
!=
dmodel
.
StudyRemark
)
{
LogContent
+=
",备注由【"
+
gModel
.
StudyRemark
+
"】修改为【"
+
dmodel
.
StudyRemark
+
"】"
;
}
gModel
.
StudyRemark
=
dmodel
.
StudyRemark
;
gModel
.
UpdateTime
=
dmodel
.
UpdateTime
;
bool
flag
=
order_GuestRepository
.
Update
(
gModel
);
flag
=
order_GuestRepository
.
Update
(
gModel
);
if
(
flag
)
{
//记录日志
...
...
@@ -1313,25 +1360,33 @@ namespace Edu.Module.Course
SourceId
=
gModel
.
OrderId
});
}
return
flag
?
""
:
"出错了,请联系管理员"
;
}
else
{
else
{
var
ordermodel
=
orderRepository
.
GetEntity
(
dmodel
.
OrderId
);
if
(
ordermodel
==
null
)
{
return
"订单不存在"
;
}
if
(
ordermodel
==
null
)
{
message
=
"订单不存在"
;
return
flag
;
}
dmodel
.
ClassId
=
ordermodel
.
ClassId
;
dmodel
.
SourceId
=
ordermodel
.
SourceId
;
int
GuestNum
=
order_GuestRepository
.
GetGuestNum
(
new
RB_Order_Guest_ViewModel
()
{
OrderId
=
dmodel
.
OrderId
,
GuestState
=
1
});
if
(
GuestNum
>=
ordermodel
.
GuestNum
)
{
return
"学生名单已录入完毕"
;
message
=
"学生名单已录入完毕"
;
return
flag
;
}
int
Id
=
order_GuestRepository
.
Insert
(
dmodel
);
bool
flag
=
Id
>
0
;
flag
=
Id
>
0
;
if
(
flag
)
{
var
classmodel
=
classRepository
.
GetEntity
(
ordermodel
.
ClassId
);
//验证账号是否存在
var
accmodel
=
accountRepository
.
GetAccountListRepository
(
new
RB_Account_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
AccountType
=
Common
.
Enum
.
User
.
AccountTypeEnum
.
Student
,
Account
=
dmodel
.
Mobile
}).
FirstOrDefault
();
string
LogContent
=
"新增学生名单【"
+
Id
+
"】"
;
if
(
dmodel
.
ClassId
>
0
)
{
if
(
accmodel
!=
null
)
{
student_OrderGuestRepository
.
Insert
(
new
Model
.
Entity
.
User
.
RB_Student_OrderGuest
()
...
...
@@ -1401,6 +1456,7 @@ namespace Edu.Module.Course
});
LogContent
+=
",自动创建学生账号【"
+
AccountId
+
"】"
;
}
}
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
{
Id
=
0
,
...
...
@@ -1413,8 +1469,8 @@ namespace Edu.Module.Course
SourceId
=
dmodel
.
OrderId
});
}
return
flag
?
""
:
"出错了,请联系管理员"
;
}
return
flag
;
}
/// <summary>
...
...
Edu.Repository/Course/RB_Order_GuestRepository.cs
View file @
a5f9388d
...
...
@@ -91,6 +91,10 @@ namespace Edu.Repository.Course
{
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
ClassId
)}
=
{
demodel
.
ClassId
}
"
;
}
if
(
demodel
.
SourceId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
SourceId
)}
=
{
demodel
.
SourceId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
GuestName
))
{
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
GuestName
)}
like '%
{
demodel
.
GuestName
}
%'"
;
...
...
Edu.WebApi/Controllers/Course/OrderController.cs
View file @
a5f9388d
...
...
@@ -812,6 +812,11 @@ namespace Edu.WebApi.Controllers.Course
x
.
Domicile
,
UpdateTime
=
x
.
UpdateTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
IsShow
=
true
,
x
.
GraduatedSchool
,
x
.
GraduatedMajor
,
x
.
VolunteerMajor
,
x
.
Price
,
x
.
StudyRemark
,
});
return
ApiResult
.
Success
(
""
,
pageModel
);
}
...
...
@@ -823,17 +828,42 @@ namespace Edu.WebApi.Controllers.Course
[
HttpPost
]
public
ApiResult
SetOrderGuestInfo
()
{
var
userInfo
=
base
.
UserInfo
;
var
dmodel
=
JsonHelper
.
DeserializeObject
<
RB_Order_Guest_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
if
(
dmodel
.
OrderId
<=
0
)
{
var
dmodel
=
new
RB_Order_Guest_ViewModel
()
{
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
),
OrderId
=
base
.
ParmJObj
.
GetInt
(
"OrderId"
),
GuestName
=
base
.
ParmJObj
.
GetStringValue
(
"GuestName"
),
Profession
=
base
.
ParmJObj
.
GetStringValue
(
"Profession"
),
Sex
=
base
.
ParmJObj
.
GetInt
(
"Sex"
,
1
),
Age
=
base
.
ParmJObj
.
GetInt
(
"Age"
),
Mobile
=
base
.
ParmJObj
.
GetStringValue
(
"Mobile"
),
Basics
=
base
.
ParmJObj
.
GetStringValue
(
"Basics"
),
Education
=(
GuestEducationEnum
)
base
.
ParmJObj
.
GetInt
(
"Education"
),
GuestSource
=(
OrderSourceEnum
)
base
.
ParmJObj
.
GetInt
(
"GuestSource"
),
LearningGoals
=(
GuestLearningGoalsEnum
)
base
.
ParmJObj
.
GetInt
(
"LearningGoals"
),
Contact
=
base
.
ParmJObj
.
GetStringValue
(
"Contact"
),
ContactMobile
=
base
.
ParmJObj
.
GetStringValue
(
"ContactMobile"
),
IDCard
=
base
.
ParmJObj
.
GetStringValue
(
"IDCard"
),
Domicile
=
base
.
ParmJObj
.
GetStringValue
(
"Domicile"
),
ContactAddress
=
base
.
ParmJObj
.
GetStringValue
(
"ContactAddress"
),
SourceId
=
base
.
ParmJObj
.
GetInt
(
"SourceId"
),
GraduatedSchool
=
base
.
ParmJObj
.
GetStringValue
(
"GraduatedSchool"
),
GraduatedMajor
=
base
.
ParmJObj
.
GetStringValue
(
"GraduatedMajor"
),
VolunteerMajor
=
base
.
ParmJObj
.
GetStringValue
(
"VolunteerMajor"
),
Price
=
base
.
ParmJObj
.
GetDecimal
(
"Price"
),
StudyRemark
=
base
.
ParmJObj
.
GetStringValue
(
"StudyRemark"
),
};
if
(
dmodel
.
OrderId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递订单id"
);
}
if
(
string
.
IsNullOrEmpty
(
dmodel
.
GuestName
))
{
return
ApiResult
.
ParamIsNull
(
"请输入客人姓名"
);
}
if
(
string
.
IsNullOrEmpty
(
dmodel
.
Mobile
))
{
if
(
string
.
IsNullOrEmpty
(
dmodel
.
Mobile
))
{
return
ApiResult
.
ParamIsNull
(
"请输入手机号码"
);
}
dmodel
.
GuestState
=
1
;
dmodel
.
Status
=
0
;
dmodel
.
Group_Id
=
userInfo
.
Group_Id
;
...
...
@@ -842,14 +872,8 @@ namespace Edu.WebApi.Controllers.Course
dmodel
.
CreateTime
=
DateTime
.
Now
;
dmodel
.
UpdateBy
=
userInfo
.
Id
;
dmodel
.
UpdateTime
=
DateTime
.
Now
;
string
msg
=
orderModule
.
SetOrderGuestInfo
(
dmodel
);
if
(
msg
==
""
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
(
msg
);
}
bool
flag
=
orderModule
.
SetOrderGuestInfo
(
dmodel
,
out
string
message
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
(
message
);
}
/// <summary>
...
...
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