Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
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
黄奎
mall.oytour.com
Commits
af4e004f
Commit
af4e004f
authored
Aug 18, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动现结调整
parent
957cbf4d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
160 additions
and
115 deletions
+160
-115
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+160
-115
No files found.
Mall.Module.Product/OrderModule.cs
View file @
af4e004f
...
...
@@ -8227,17 +8227,27 @@ namespace Mall.Module.Product
var
ssmodel
=
ssList
.
FirstOrDefault
();
//获取微店信息
var
smallModel
=
smallShops_InfoRepository
.
GetList
(
new
RB_SmallShops_Info_Extend
()
{
UserId
=
ssmodel
.
UserId
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
}).
FirstOrDefault
();
if
(
smallModel
!=
null
&&
smallModel
.
AuditStatus
==
DistributorAuditStatusEnum
.
Audited
)
{
//总佣金
decimal
Total
Commission
=
0
;
foreach
(
var
item
in
ssList
.
Where
(
x
=>
x
.
CommissionState
==
1
))
{
if
(
smallModel
!=
null
&&
smallModel
.
AuditStatus
==
DistributorAuditStatusEnum
.
Audited
)
{
decimal
TotalCommission
=
0
,
Old
Commission
=
0
;
foreach
(
var
item
in
ssList
.
Where
(
x
=>
x
.
CommissionState
==
1
))
{
TotalCommission
+=
(
item
.
Commission
??
0
);
}
#
region
看微店佣金是否是负数
是的话
需要走总佣金里减去
if
((
smallModel
.
Commission
??
0
)
<
0
)
{
OldCommission
=
TotalCommission
;
TotalCommission
+=
(
smallModel
?.
Commission
??
0
);
}
if
(
TotalCommission
>
0
)
{
#
endregion
if
(
TotalCommission
>
0
)
{
decimal
RemitMoney
=
TotalCommission
,
fee
=
0
;
var
feeValue
=
ssbaseModel
?.
WithdrawalFree
??
0
;
if
(
feeValue
>
0
)
{
if
(
feeValue
>
0
)
{
fee
=
Math
.
Round
(
TotalCommission
*
(
feeValue
)
/
100
,
2
,
MidpointRounding
.
AwayFromZero
);
RemitMoney
=
TotalCommission
-
fee
;
}
...
...
@@ -8305,7 +8315,8 @@ namespace Mall.Module.Product
WithdrawalWay
=
DistrbutorWithdrawWayEnum
.
ZDXJ
});
}
else
{
else
{
//更新状态
foreach
(
var
item
in
ssList
.
Where
(
x
=>
x
.
CommissionState
==
1
))
{
...
...
@@ -8356,17 +8367,51 @@ namespace Mall.Module.Product
WithdrawalWay
=
DistrbutorWithdrawWayEnum
.
ZDDK
});
}
if
((
smallModel
.
Commission
??
0
)
<
0
)
{
//更新微店佣金等于0
Dictionary
<
string
,
object
>
keyValues2
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_SmallShops_Info_Extend
.
TotalCommission
),(
smallModel
.
TotalCommission
??
0
)
+
OldCommission
},
{
nameof
(
RB_SmallShops_Info_Extend
.
Commission
),
0
},
};
List
<
WhereHelper
>
wheres2
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_SmallShops_Info_Extend
.
Id
),
FiledValue
=
smallModel
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag1
=
smallShops_InfoRepository
.
Update
(
keyValues2
,
wheres2
);
}
}
else
if
(
TotalCommission
<
0
)
{
//存在微店佣金里 继续负数累加
Dictionary
<
string
,
object
>
keyValues2
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_SmallShops_Info_Extend
.
TotalCommission
),(
smallModel
.
TotalCommission
??
0
)
+
OldCommission
},
{
nameof
(
RB_SmallShops_Info_Extend
.
Commission
),
TotalCommission
},
};
List
<
WhereHelper
>
wheres2
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_SmallShops_Info_Extend
.
Id
),
FiledValue
=
smallModel
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag1
=
smallShops_InfoRepository
.
Update
(
keyValues2
,
wheres2
);
}
}
}
else
{
var
ssmodel
=
ssList
.
FirstOrDefault
();
//获取微店信息
var
smallModel
=
smallShops_InfoRepository
.
GetList
(
new
RB_SmallShops_Info_Extend
()
{
UserId
=
ssmodel
.
UserId
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
}).
FirstOrDefault
();
foreach
(
var
item
in
ssList
.
Where
(
x
=>
x
.
CommissionState
==
1
))
{
//获取微店信息
var
smallModel
=
smallShops_InfoRepository
.
GetList
(
new
RB_SmallShops_Info_Extend
()
{
UserId
=
item
.
UserId
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
}).
FirstOrDefault
();
if
(
smallModel
!=
null
&&
smallModel
.
AuditStatus
==
DistributorAuditStatusEnum
.
Audited
)
{
//更新
分销商
佣金
//更新
微店
佣金
Dictionary
<
string
,
object
>
keyValues2
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_SmallShops_Info_Extend
.
TotalCommission
),(
smallModel
.
TotalCommission
??
0
)+(
item
.
Commission
??
0
)},
{
nameof
(
RB_SmallShops_Info_Extend
.
Commission
),(
smallModel
.
Commission
??
0
)+(
item
.
Commission
??
0
)},
...
...
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