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
42d492be
Commit
42d492be
authored
Dec 13, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
8a08a2af
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
2 deletions
+59
-2
EduB2BOrderModule.cs
Edu.Module.Course/EduB2BOrderModule.cs
+43
-0
CustomerModule.cs
Edu.Module.Customer/CustomerModule.cs
+2
-2
RB_Customer_BalanceDetailRepository.cs
...epository/Customer/RB_Customer_BalanceDetailRepository.cs
+14
-0
No files found.
Edu.Module.Course/EduB2BOrderModule.cs
View file @
42d492be
...
...
@@ -158,5 +158,48 @@ namespace Edu.Module.Course
return
false
;
}
}
/// <summary>
/// 发放教育同业每月佣金/幸福存折
/// </summary>
/// <returns></returns>
public
bool
SetEduB2BCustomerCommission
()
{
if
(
DateTime
.
Now
.
Day
!=
25
)
{
return
false
;
}
var
glist
=
groupRepository
.
GetGroupListRepository
(
new
Model
.
ViewModel
.
User
.
RB_Group_ViewModel
()
{
});
var
trans
=
customerRepository
.
DbTransaction
;
try
{
foreach
(
var
group
in
glist
)
{
int
GroupId
=
group
.
GId
;
string
dateStr
=
Convert
.
ToDateTime
(
DateTime
.
Now
.
ToString
(
"yyyy-MM"
)
+
"-01"
).
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd"
);
//获取可发放返佣列表
var
blist
=
customer_BalanceDetailRepository
.
SetEduB2BCustomerCommissionCanSendList
(
GroupId
,
dateStr
);
if
(
blist
.
Any
())
{
//获取所有的同业
customerRepository
.
GetCustomerListRepository
(
new
RB_Customer_Extend
()
{
});
//获取所有的订单列表
//获取所有的学生列表
//获取所有学生已上课课时
//获取已发放记录
//根据当月已上课时 计算当月应返佣金额
}
}
customerRepository
.
DBSession
.
Commit
();
return
true
;
}
catch
(
Exception
ex
)
{
customerRepository
.
DBSession
.
Rollback
();
LogHelper
.
Write
(
ex
,
"SetEduB2BOrderCommission 定时更新 更新教育同业订单返佣"
);
return
false
;
}
}
}
}
Edu.Module.Customer/CustomerModule.cs
View file @
42d492be
...
...
@@ -64,6 +64,7 @@ namespace Edu.Module.Customer
bool
flag
;
if
(
model
.
CustomerId
>
0
)
{
var
oldModel
=
customerRepository
.
GetEntity
(
model
.
CustomerId
);
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Customer_Extend
.
CustomerName
),
model
.
CustomerName
},
...
...
@@ -89,8 +90,7 @@ namespace Edu.Module.Customer
flag
=
customerRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Customer_Extend
.
CustomerId
),
model
.
CustomerId
));
if
(
flag
)
{
#
region
操作记录
string
LogContent
=
"后台修改同业信息:"
;
var
oldModel
=
customerRepository
.
GetEntity
(
model
.
CustomerId
);
string
LogContent
=
"后台修改同业信息:"
;
if
(
oldModel
.
CustomerName
!=
model
.
CustomerName
)
{
LogContent
+=
"名称由'"
+
oldModel
.
CustomerName
+
"'修改为'"
+
model
.
CustomerName
+
"';"
;
...
...
Edu.Repository/Customer/RB_Customer_BalanceDetailRepository.cs
View file @
42d492be
...
...
@@ -142,5 +142,19 @@ WHERE o.Group_Id ={groupId} and o.OrderState =1 and o.OrderSource =9 and o.PaySt
var
Robj
=
ExecuteScalar
(
sql
);
return
Robj
==
null
?
0
:
Convert
.
ToDecimal
(
Robj
);
}
/// <summary>
/// 获取未发放完的返佣列表
/// </summary>
/// <param name="groupId"></param>
/// <param name="dateStr"></param>
/// <returns></returns>
public
List
<
RB_Customer_BalanceDetail_ViewModel
>
SetEduB2BCustomerCommissionCanSendList
(
int
groupId
,
string
dateStr
)
{
string
sql
=
$@"SELECT b.* FROM rb_customer_balancedetail b
INNER JOIN rb_order o on b.OrderId = o.OrderId
WHERE b.Group_Id =
{
groupId
}
and o.OrderState in(1,2) and b.UpdateTime <='
{
dateStr
}
23:59:59' and b.BalanceState =1 and b.GiveOutOK <>1 "
;
return
Get
<
RB_Customer_BalanceDetail_ViewModel
>(
sql
).
ToList
();
}
}
}
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