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
5c894047
Commit
5c894047
authored
Dec 16, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
bee881e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
52 deletions
+22
-52
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+20
-49
RB_StudentRepository.cs
Edu.Repository/User/RB_StudentRepository.cs
+2
-3
No files found.
Edu.Module.Course/OrderModule.cs
View file @
5c894047
...
...
@@ -2406,59 +2406,19 @@ namespace Edu.Module.Course
}
#
region
新增修改学员账号
if
(
flag
)
if
(
flag
&&!
string
.
IsNullOrEmpty
(
dmodel
.
Mobile
)
)
{
//检查【学员表(rb_order_guest)和学生表(rb_student)】关联信息
var
stuOrderGuestModel
=
student_OrderGuestRepository
.
GetStrOrderGuestListRepository
(
new
RB_Student_OrderGuest_ViewModel
{
ClassId
=
ordermodel
.
ClassId
,
OrderId
=
ordermodel
.
OrderId
,
GuestId
=
dmodel
.
Id
}).
FirstOrDefault
();
//学员账号信息
var
accmodel
=
accountRepository
.
GetAccountListRepository
(
new
RB_Account_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
AccountType
=
Common
.
Enum
.
User
.
AccountTypeEnum
.
Student
,
Account
=
dmodel
.
Mobile
}).
FirstOrDefault
();
//【学员表、学生表、账号表】关联表和账号信息都存在
if
(
stuOrderGuestModel
!=
null
&&
accmodel
!=
null
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_ViewModel
.
StuIcon
),
dmodel
.
StuIcon
},
{
nameof
(
RB_Student_ViewModel
.
StuTel
),
dmodel
.
Mobile
},
{
nameof
(
RB_Student_ViewModel
.
StuName
),
dmodel
.
GuestName
},
{
nameof
(
RB_Student_ViewModel
.
StuSex
),
dmodel
.
Sex
-
1
},
{
nameof
(
RB_Student_ViewModel
.
StuBirth
),
dmodel
.
BirthDate
},
};
studentRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Student_ViewModel
.
StuId
),
stuOrderGuestModel
.
Student_Id
));
}
//有【学员表、学生表、账号表】关联信息,没有账号信息【需要修改账号表中的账号】
else
if
(
stuOrderGuestModel
!=
null
&&
accmodel
==
null
)
//学员表
var
stuModel
=
studentRepository
.
GetStuByTelRepository
(
new
RB_Student_ViewModel
()
{
Dictionary
<
string
,
object
>
accountFileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Account_ViewModel
.
Account
),
dmodel
.
Mobile
}
};
accountRepository
.
Update
(
accountFileds
,
new
WhereHelper
(
nameof
(
RB_Account_ViewModel
.
Id
),
stuOrderGuestModel
.
Account_Id
));
}
//有【账号】信息,没有关联信息
else
if
(
stuOrderGuestModel
==
null
&&
accmodel
!=
null
)
{
//创建学员表、学生表、账号表关联信息
student_OrderGuestRepository
.
Insert
(
new
Model
.
Entity
.
User
.
RB_Student_OrderGuest
()
{
Id
=
0
,
Account_Id
=
accmodel
.
Id
,
ClassId
=
ordermodel
.
ClassId
,
CreateBy
=
dmodel
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
GuestId
=
dmodel
.
Id
,
OrderId
=
dmodel
.
OrderId
,
Status
=
DateStateEnum
.
Normal
,
Student_Id
=
accmodel
.
AccountId
});
LogContent
+=
",添加学生账号关联【"
+
accmodel
.
Id
+
"】"
;
}
//关联信息和账号都不存在
else
Group_Id
=
dmodel
.
Group_Id
,
StuTel
=
dmodel
.
Mobile
});
//不存在存在学员基本信息
if
(
stuModel
==
null
)
{
//创建学生表信息
var
stuModel
=
new
RB_Student_ViewModel
()
stuModel
=
new
RB_Student_ViewModel
()
{
StuId
=
0
,
AreaId
=
0
,
...
...
@@ -2482,7 +2442,18 @@ namespace Edu.Module.Course
CreateType
=
Common
.
Enum
.
User
.
StuCreateTypeEnum
.
EmployeeInput
};
studentRepository
.
SetStudentRepository
(
stuModel
);
}
//检查【学员表(rb_order_guest)和学生表(rb_student)】关联信息
var
stuOrderGuestModel
=
student_OrderGuestRepository
.
GetStrOrderGuestListRepository
(
new
RB_Student_OrderGuest_ViewModel
{
ClassId
=
ordermodel
.
ClassId
,
OrderId
=
ordermodel
.
OrderId
,
GuestId
=
dmodel
.
Id
}).
FirstOrDefault
();
//不存在学员表、学生表、账号表】关联信息
if
(
stuOrderGuestModel
==
null
)
{
//创建【学员表、学生表、账号表】关联信息
student_OrderGuestRepository
.
Insert
(
new
Model
.
Entity
.
User
.
RB_Student_OrderGuest
()
{
...
...
Edu.Repository/User/RB_StudentRepository.cs
View file @
5c894047
...
...
@@ -516,7 +516,6 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
accountRepository
.
Update
(
accountFileds
,
new
WhereHelper
(
nameof
(
RB_Account
.
Id
),
accountModel
.
Id
));
}
}
#
endregion
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
BasicInfo
,
logTitle
,
logContent
,
createBy
,
CreateType
:
model
.
OperateType
);
...
...
@@ -633,8 +632,8 @@ WHERE 1=1 AND YEARWEEK(date_format(t.CreateTime, '%Y-%m-%d')) = YEARWEEK(now())
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT t.*
FROM rb_student AS t
SELECT t.*
,B.Id AS Account_Id
FROM rb_student AS t
LEFT JOIN rb_account AS B ON t.StuId=B.AccountId AND B.AccountType=4
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_ViewModel
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
...
...
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