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
dd4a1809
Commit
dd4a1809
authored
Feb 09, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
65f39861
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
1 deletion
+117
-1
RB_Order_ReturnComission_ViewModel.cs
...odel/ViewModel/Sell/RB_Order_ReturnComission_ViewModel.cs
+10
-0
RB_Order_ReturnComissionRepository.cs
Edu.Repository/Sell/RB_Order_ReturnComissionRepository.cs
+107
-1
No files found.
Edu.Model/ViewModel/Sell/RB_Order_ReturnComission_ViewModel.cs
View file @
dd4a1809
...
...
@@ -53,5 +53,15 @@ namespace Edu.Model.ViewModel.Sell
/// 学生
/// </summary>
public
string
StuName
{
get
;
set
;
}
/// <summary>
/// 订单编号【查询使用】
/// </summary>
public
string
QOrderIds
{
get
;
set
;
}
/// <summary>
/// 关联人员名称
/// </summary>
public
string
OrderSourceIdName
{
get
;
set
;
}
}
}
Edu.Repository/Sell/RB_Order_ReturnComissionRepository.cs
View file @
dd4a1809
using
Edu.Model.Entity.Sell
;
using
Edu.Common.Enum.User
;
using
Edu.Model.Entity.Sell
;
using
Edu.Model.ViewModel.Customer
;
using
Edu.Model.ViewModel.Sell
;
using
Edu.Model.ViewModel.User
;
using
Edu.Repository.Customer
;
using
Edu.Repository.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -10,6 +15,20 @@ namespace Edu.Repository.Sell
{
public
class
RB_Order_ReturnComissionRepository
:
BaseRepository
<
RB_Order_ReturnComission
>
{
/// <summary>
/// 员工处理类对象
/// </summary>
private
readonly
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
/// <summary>
/// 同业联系人仓储层对象
/// </summary>
private
readonly
RB_CustomerRepository
customerRepository
=
new
RB_CustomerRepository
();
/// <summary>
/// 学员仓储层对象
/// </summary>
private
readonly
RB_StudentRepository
studentRepository
=
new
RB_StudentRepository
();
/// <summary>
/// 根据OrderId和StuId查询实体
...
...
@@ -260,5 +279,92 @@ where {where}";
where r.GroupId =
{
group_Id
}
and r.UnionCashOutId =
{
remitId
}
"
;
Execute
(
sql
);
}
/// <summary>
/// 获取订单返佣列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Order_ReturnComission_ViewModel
>
GetOrderReturnComissionListRepositpry
(
RB_Order_ReturnComission_ViewModel
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*
FROM rb_order_returncomission AS A
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND A.{0}>=0 "
,
nameof
(
RB_Order_ReturnComission_ViewModel
.
Status
));
if
(
query
!=
null
)
{
if
(
query
.
OrderId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Order_ReturnComission_ViewModel
.
OrderId
),
query
.
OrderId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QOrderIds
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Order_ReturnComission_ViewModel
.
OrderId
),
query
.
QOrderIds
);
}
}
var
list
=
Get
<
RB_Order_ReturnComission_ViewModel
>(
builder
.
ToString
()).
ToList
();
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
var
employeeIds
=
string
.
Join
(
","
,
list
.
Where
(
qitem
=>
qitem
.
OrderSourceType
==
StuCreateTypeEnum
.
EmployeeInput
||
qitem
.
OrderSourceType
==
StuCreateTypeEnum
.
InternalIntroduction
).
Select
(
qitem
=>
qitem
.
OrderSourceId
));
var
customerIds
=
string
.
Join
(
","
,
list
.
Where
(
qitem
=>
qitem
.
OrderSourceType
==
StuCreateTypeEnum
.
CustomerInput
).
Select
(
qitem
=>
qitem
.
OrderSourceId
));
var
stuIds
=
string
.
Join
(
","
,
list
.
Where
(
qitem
=>
qitem
.
OrderSourceType
==
StuCreateTypeEnum
.
TransIntroduction
).
Select
(
qitem
=>
qitem
.
OrderSourceId
));
List
<
Employee_ViewModel
>
empList
=
new
List
<
Employee_ViewModel
>();
List
<
RB_Customer_Extend
>
customerList
=
new
List
<
RB_Customer_Extend
>();
List
<
RB_Student_ViewModel
>
stuList
=
new
List
<
RB_Student_ViewModel
>();
if
(!
string
.
IsNullOrEmpty
(
employeeIds
))
{
empList
=
accountRepository
.
GetEmployeeListRepository
(
new
Employee_ViewModel
()
{
QIds
=
employeeIds
});
}
if
(!
string
.
IsNullOrEmpty
(
customerIds
))
{
customerList
=
customerRepository
.
GetCustomerListRepository
(
new
RB_Customer_Extend
()
{
CustomerIds
=
customerIds
});
}
if
(!
string
.
IsNullOrEmpty
(
stuIds
))
{
stuList
=
studentRepository
.
GetStudentListRepository
(
new
RB_Student_ViewModel
()
{
StuIds
=
stuIds
});
}
foreach
(
var
item
in
list
)
{
switch
(
item
.
OrderSourceType
)
{
case
StuCreateTypeEnum
.
EmployeeInput
:
item
.
OrderSourceIdName
=
empList
?.
FirstOrDefault
(
qitem
=>
qitem
.
Id
==
item
.
OrderSourceId
)?.
EmployeeName
??
""
;
break
;
case
StuCreateTypeEnum
.
CustomerInput
:
var
tempCustomer
=
customerList
?.
FirstOrDefault
(
qitem
=>
qitem
.
CustomerId
==
item
.
OrderSourceId
);
string
tempStr
=
tempCustomer
?.
CustomerName
??
""
;
if
(
tempCustomer
!=
null
)
{
if
(
tempCustomer
.
CustomerType
==
Common
.
Enum
.
Customer
.
CatetoryTypeEnum
.
Other
)
{
tempStr
+=
string
.
Format
(
"({0})"
,
tempCustomer
?.
EnterpriseName
??
""
);
}
else
{
tempStr
+=
string
.
Format
(
"({0})"
,
tempCustomer
?.
CategoryName
??
""
);
}
}
item
.
OrderSourceIdName
=
tempStr
;
break
;
case
StuCreateTypeEnum
.
InternalIntroduction
:
item
.
OrderSourceIdName
=
empList
?.
FirstOrDefault
(
qitem
=>
qitem
.
Id
==
item
.
OrderSourceId
)?.
EmployeeName
??
""
;
break
;
case
StuCreateTypeEnum
.
TransIntroduction
:
item
.
OrderSourceIdName
=
stuList
?.
FirstOrDefault
(
qitem
=>
qitem
.
StuId
==
item
.
OrderSourceId
)?.
StuName
??
""
;
break
;
}
}
}
return
list
;
}
}
}
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