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
7889007a
Commit
7889007a
authored
Dec 16, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
cbd4171f
5c894047
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
63 deletions
+62
-63
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+20
-49
RB_StudentRepository.cs
Edu.Repository/User/RB_StudentRepository.cs
+33
-13
CustomerStudentController.cs
Edu.WebApi/Controllers/Customer/CustomerStudentController.cs
+9
-1
No files found.
Edu.Module.Course/OrderModule.cs
View file @
7889007a
...
...
@@ -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 @
7889007a
using
Edu.Common.Enum
;
using
Edu.Common.Plugin
;
using
Edu.Model.Entity.User
;
using
Edu.Model.ViewModel.User
;
using
Edu.Repository.Customer
;
using
Edu.Repository.System
;
...
...
@@ -423,7 +424,6 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
{
{
nameof
(
RB_Student_ViewModel
.
StuName
),
model
.
StuName
.
Trim
()
},
{
nameof
(
RB_Student_ViewModel
.
StuTel
),
model
.
StuTel
.
Trim
()
},
{
nameof
(
RB_Student_ViewModel
.
StuIcon
),
model
.
StuIcon
.
Trim
()
},
{
nameof
(
RB_Student_ViewModel
.
StuSex
),
model
.
StuSex
},
{
nameof
(
RB_Student_ViewModel
.
StuBirth
),
model
.
StuBirth
},
{
nameof
(
RB_Student_ViewModel
.
ProviceId
),
model
.
ProviceId
},
...
...
@@ -456,6 +456,7 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
fileds
.
Add
(
nameof
(
RB_Student_ViewModel
.
StuContractMobile
),
model
.
StuContractMobile
);
fileds
.
Add
(
nameof
(
RB_Student_ViewModel
.
StuIDCard
),
model
.
StuIDCard
);
fileds
.
Add
(
nameof
(
RB_Student_ViewModel
.
StuIDCardAddress
),
model
.
StuIDCardAddress
);
fileds
.
Add
(
nameof
(
RB_Student_ViewModel
.
StuIcon
),
model
.
StuIcon
.
Trim
());
}
flag
=
base
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Student_ViewModel
.
StuId
),
model
.
StuId
));
createBy
=
model
.
UpdateBy
;
...
...
@@ -469,9 +470,25 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
var
newId
=
base
.
Insert
(
model
);
model
.
StuId
=
newId
;
flag
=
newId
>
0
;
if
(
model
.
CreateType
==
Common
.
Enum
.
User
.
StuCreateTypeEnum
.
EmployeeInput
)
{
createBy
=
model
.
CreateBy
;
}
else
{
createBy
=
model
.
CustomerId
;
}
logContent
=
"创建了该客户"
;
logTitle
=
"创建客户"
;
}
#
region
处理学员账号信息
var
accountModel
=
accountRepository
.
GetAccountListRepository
(
new
RB_Account_ViewModel
()
{
Group_Id
=
model
.
Group_Id
,
AccountType
=
Common
.
Enum
.
User
.
AccountTypeEnum
.
Student
,
AccountId
=
model
.
StuId
}).
FirstOrDefault
();
if
(
accountModel
==
null
)
{
//创建学生账号
model
.
Account_Id
=
accountRepository
.
Insert
(
new
Model
.
Entity
.
User
.
RB_Account
()
model
.
Account_Id
=
accountRepository
.
Insert
(
new
RB_Account
()
{
Id
=
0
,
Account
=
model
.
StuTel
,
...
...
@@ -487,18 +504,21 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
UpdateTime
=
DateTime
.
Now
,
Password
=
Common
.
DES
.
Encrypt
(
Common
.
Config
.
DefaultPwd
)
});
if
(
model
.
CreateType
==
Common
.
Enum
.
User
.
StuCreateTypeEnum
.
EmployeeInput
)
{
createBy
=
model
.
CreateBy
;
}
else
}
else
{
if
(
model
.
StuTel
!=
accountModel
.
Account
)
{
createBy
=
model
.
CustomerId
;
Dictionary
<
string
,
object
>
accountFileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Account
.
Account
),
model
.
StuTel
}
};
accountRepository
.
Update
(
accountFileds
,
new
WhereHelper
(
nameof
(
RB_Account
.
Id
),
accountModel
.
Id
));
}
logContent
=
"创建了该客户"
;
logTitle
=
"创建客户"
;
}
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
BasicInfo
,
logTitle
,
logContent
,
createBy
,
CreateType
:
(
int
)
model
.
CreateType
);
#
endregion
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
BasicInfo
,
logTitle
,
logContent
,
createBy
,
CreateType
:
model
.
OperateType
);
return
flag
;
}
...
...
@@ -612,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
);
...
...
Edu.WebApi/Controllers/Customer/CustomerStudentController.cs
View file @
7889007a
...
...
@@ -343,7 +343,15 @@ namespace Edu.WebApi.Controllers.Customer
foreach
(
var
item
in
data
)
{
string
CreateByName
=
""
;
CreateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
AccountName
??
""
;
if
(
item
.
CreateBy
==
1
)
{
CreateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
AccountName
??
""
;
}
else
{
CreateByName
=
UserReidsCache
.
GetAppletCustomerLoginInfo
(
item
.
CreateBy
)?.
CustomerName
??
""
;
}
list
.
Add
(
new
{
item
.
LogId
,
...
...
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