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
71683841
Commit
71683841
authored
Aug 05, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
推荐供应商
parent
a899eb14
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
193 additions
and
188 deletions
+193
-188
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+186
-181
UserModule.cs
Mall.Module.User/UserModule.cs
+1
-1
PayUtil.cs
Mall.WebApi/App_Code/PayUtil.cs
+2
-2
ERPOrderCommissionController.cs
...ebApi/Controllers/Finance/ERPOrderCommissionController.cs
+2
-2
UserController.cs
Mall.WebApi/Controllers/User/UserController.cs
+2
-2
No files found.
Mall.Module.Product/OrderModule.cs
View file @
71683841
...
@@ -3256,7 +3256,9 @@ namespace Mall.Module.Product
...
@@ -3256,7 +3256,9 @@ namespace Mall.Module.Product
try
try
{
{
var
basicModel
=
distributor_BasicsRepository
.
GetList
(
new
RB_Distributor_Basics_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
}).
FirstOrDefault
();
var
basicModel
=
distributor_BasicsRepository
.
GetList
(
new
RB_Distributor_Basics_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
}).
FirstOrDefault
();
if
((
basicModel
?.
IsEnableFXGrade
??
2
)
==
1
&&
(((
basicModel
?.
IsEnableNoSuperiorFY
??
1
)
==
1
)
||
((
basicModel
?.
IsEnableNoSuperiorFY
??
1
)
==
2
&&
(
umodel
.
SuperiorId
??
0
)
>
0
)))
if
((
basicModel
?.
IsEnableFXGrade
??
2
)
==
1
)
{
if
(((
basicModel
?.
IsEnableNoSuperiorFY
??
1
)
==
1
)
||
((
basicModel
?.
IsEnableNoSuperiorFY
??
1
)
==
2
&&
(
umodel
.
SuperiorId
??
0
)
>
0
))
{
{
//粉象返佣
//粉象返佣
var
FXList
=
distributor_FXGradeRepository
.
GetList
(
new
RB_Distributor_FXGrade_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
var
FXList
=
distributor_FXGradeRepository
.
GetList
(
new
RB_Distributor_FXGrade_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
...
@@ -3292,7 +3294,8 @@ namespace Mall.Module.Product
...
@@ -3292,7 +3294,8 @@ namespace Mall.Module.Product
var
DetailList
=
demodel
.
DetailList
.
Where
(
x
=>
x
.
CommissionPrice
>
0
).
ToList
();
var
DetailList
=
demodel
.
DetailList
.
Where
(
x
=>
x
.
CommissionPrice
>
0
).
ToList
();
foreach
(
var
item
in
DetailList
)
foreach
(
var
item
in
DetailList
)
{
{
if
((
item
.
PresentFXGrade
??
0
)
>
0
)
{
if
((
item
.
PresentFXGrade
??
0
)
>
0
)
{
//是赠送VIP等级的 暂直接表示 反购买VIP佣金 2020-08-03 ld
//是赠送VIP等级的 暂直接表示 反购买VIP佣金 2020-08-03 ld
continue
;
continue
;
}
}
...
@@ -3480,7 +3483,8 @@ namespace Mall.Module.Product
...
@@ -3480,7 +3483,8 @@ namespace Mall.Module.Product
UserId
=
n1umodel
.
Id
;
UserId
=
n1umodel
.
Id
;
break
;
break
;
}
}
else
{
else
{
UserId
=
0
;
UserId
=
0
;
numodel
=
n1umodel
;
//继续查找下一级
numodel
=
n1umodel
;
//继续查找下一级
}
}
...
@@ -3500,6 +3504,7 @@ namespace Mall.Module.Product
...
@@ -3500,6 +3504,7 @@ namespace Mall.Module.Product
}
}
}
}
}
}
}
else
else
{
{
//判断是否开启和平返佣
//判断是否开启和平返佣
...
@@ -4077,11 +4082,11 @@ namespace Mall.Module.Product
...
@@ -4077,11 +4082,11 @@ namespace Mall.Module.Product
foreach
(
var
item
in
detailList
)
{
foreach
(
var
item
in
detailList
)
{
var
supplierModel
=
supplist
.
Where
(
x
=>
x
.
ID
==
item
.
SupplierId
).
FirstOrDefault
();
var
supplierModel
=
supplist
.
Where
(
x
=>
x
.
ID
==
item
.
SupplierId
).
FirstOrDefault
();
var
qscList
=
scList
.
Where
(
x
=>
x
.
SupplierId
==
item
.
SupplierId
).
ToList
();
var
qscList
=
scList
.
Where
(
x
=>
x
.
SupplierId
==
item
.
SupplierId
).
ToList
();
if
(
item
.
CostMoney
>
0
&&
((
item
.
Final_Price
??
0
)
-
(
item
.
CostMoney
??
0
)
-
item
.
TCommissionMoney
)>
0
&&
qscList
.
Any
())
if
(
item
.
CostMoney
>
0
&&
((
item
.
Final_Price
??
0
)
-
(
item
.
CostMoney
??
0
)
*
(
item
.
Number
??
0
)
-
item
.
TCommissionMoney
)>
0
&&
qscList
.
Any
())
{
{
decimal
Profit
=
(
item
.
Final_Price
??
0
)
*
(
item
.
Number
??
0
)
-
(
item
.
CostMoney
??
0
)
*
(
item
.
Number
??
0
)
-
item
.
TCommissionMoney
;
decimal
Profit
=
(
item
.
Final_Price
??
0
)
-
(
item
.
CostMoney
??
0
)
*
(
item
.
Number
??
0
)
-
item
.
TCommissionMoney
;
decimal
GrossMargin
=
Math
.
Round
(
Profit
/
(
(
item
.
Final_Price
??
0
)
*
(
item
.
Number
??
0
)
),
2
,
MidpointRounding
.
AwayFromZero
);
decimal
GrossMargin
=
Math
.
Round
(
Profit
/
(
item
.
Final_Price
??
0
),
2
,
MidpointRounding
.
AwayFromZero
);
var
scModel
=
qscList
.
Where
(
x
=>
(
x
.
CommissionType
*
10
)
>
GrossMargin
).
OrderBy
(
x
=>
x
.
CommissionType
).
FirstOrDefault
();
var
scModel
=
qscList
.
Where
(
x
=>
(
x
.
CommissionType
*
10
)
>
=
(
GrossMargin
*
100
)
).
OrderBy
(
x
=>
x
.
CommissionType
).
FirstOrDefault
();
decimal
Commission
=
Math
.
Round
(
Profit
*
scModel
.
CommissionRate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
Commission
=
Math
.
Round
(
Profit
*
scModel
.
CommissionRate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
);
if
(
Commission
>
0
)
{
if
(
Commission
>
0
)
{
//插入返佣记录
//插入返佣记录
...
...
Mall.Module.User/UserModule.cs
View file @
71683841
...
@@ -5482,7 +5482,7 @@ namespace Mall.Module.User
...
@@ -5482,7 +5482,7 @@ namespace Mall.Module.User
Id
=
0
,
Id
=
0
,
MallBaseId
=
mallBaseId
,
MallBaseId
=
mallBaseId
,
Money
=
totalMoney
,
Money
=
totalMoney
,
Periods
=
DateTime
.
Now
.
ToString
(
"yyyyMM
dd
"
),
Periods
=
DateTime
.
Now
.
ToString
(
"yyyyMM"
),
Remark
=
""
,
Remark
=
""
,
Status
=
0
,
Status
=
0
,
SupplierId
=
supplierId
,
SupplierId
=
supplierId
,
...
...
Mall.WebApi/App_Code/PayUtil.cs
View file @
71683841
...
@@ -473,7 +473,7 @@ namespace Mall.WebApi.App_Code
...
@@ -473,7 +473,7 @@ namespace Mall.WebApi.App_Code
/// <param name="CustomerId"></param>
/// <param name="CustomerId"></param>
/// <param name="openid"></param>
/// <param name="openid"></param>
/// <returns></returns>
/// <returns></returns>
public
static
bool
GetTransfersOrder
(
string
sOrderNo
,
decimal
dPrice
,
string
CustomerId
,
string
openid
,
RB_MiniProgram_Extend
model
,
IHttpContextAccessor
_accessor
)
public
static
bool
GetTransfersOrder
(
string
sOrderNo
,
decimal
dPrice
,
string
CustomerId
,
string
openid
,
RB_MiniProgram_Extend
model
,
IHttpContextAccessor
_accessor
,
string
Remark
=
""
)
{
{
if
(!
System
.
IO
.
File
.
Exists
(
Path
.
Combine
(
AppDomain
.
CurrentDomain
.
BaseDirectory
,
"App_Data/Certs/WeChatApp/"
+
model
.
WeChatPayCertificateUrl
)))
if
(!
System
.
IO
.
File
.
Exists
(
Path
.
Combine
(
AppDomain
.
CurrentDomain
.
BaseDirectory
,
"App_Data/Certs/WeChatApp/"
+
model
.
WeChatPayCertificateUrl
)))
{
{
...
@@ -489,7 +489,7 @@ namespace Mall.WebApi.App_Code
...
@@ -489,7 +489,7 @@ namespace Mall.WebApi.App_Code
req
.
SetParameter
(
"openid"
,
openid
);
req
.
SetParameter
(
"openid"
,
openid
);
req
.
SetParameter
(
"check_name"
,
"NO_CHECK"
);
req
.
SetParameter
(
"check_name"
,
"NO_CHECK"
);
req
.
SetParameter
(
"amount"
,
(
dPrice
*
100
).
ToString
(
"f0"
));
req
.
SetParameter
(
"amount"
,
(
dPrice
*
100
).
ToString
(
"f0"
));
req
.
SetParameter
(
"desc"
,
"赞羊商城佣金提现"
);
req
.
SetParameter
(
"desc"
,
Remark
==
""
?
"赞羊商城佣金提现"
:
Remark
);
req
.
SetParameter
(
"sign"
,
req
.
CreateMd5Sign
(
_accessor
,
model
.
WeChatApiSecret
));
req
.
SetParameter
(
"sign"
,
req
.
CreateMd5Sign
(
_accessor
,
model
.
WeChatApiSecret
));
var
reqXml
=
req
.
ParseXml
();
var
reqXml
=
req
.
ParseXml
();
var
result
=
Common
.
Pay
.
WeChatPat
.
HttpHelper
.
Post
(
new
HttpParam
()
var
result
=
Common
.
Pay
.
WeChatPat
.
HttpHelper
.
Post
(
new
HttpParam
()
...
...
Mall.WebApi/Controllers/Finance/ERPOrderCommissionController.cs
View file @
71683841
...
@@ -224,7 +224,7 @@ namespace Mall.WebApi.Controllers.Finance
...
@@ -224,7 +224,7 @@ namespace Mall.WebApi.Controllers.Finance
{
{
var
mallModel
=
userModule
.
GetMiniProgramExtend
(
MallBaseId
);
var
mallModel
=
userModule
.
GetMiniProgramExtend
(
MallBaseId
);
var
umodel
=
userModule
.
GetMemberUserInfo
(
bmodel
.
UserId
??
0
);
var
umodel
=
userModule
.
GetMemberUserInfo
(
bmodel
.
UserId
??
0
);
var
flag
=
App_Code
.
PayUtil
.
GetTransfersOrder
((
bmodel
.
Periods
??
""
)
+
bmodel
.
Id
,
bmodel
.
Money
??
0
,
(
bmodel
.
UserId
??
0
).
ToString
(),
umodel
.
OpenId
,
mallModel
,
_accessor
);
var
flag
=
App_Code
.
PayUtil
.
GetTransfersOrder
((
bmodel
.
Periods
??
""
)
+
bmodel
.
Id
,
bmodel
.
Money
??
0
,
(
bmodel
.
UserId
??
0
).
ToString
(),
umodel
.
OpenId
,
mallModel
,
_accessor
,
"赞羊供应商佣金打款"
);
if
(
flag
)
if
(
flag
)
{
{
string
msg
=
userModule
.
SetRecommendOrdersBillRemit
(
BillId
,
TenantId
,
MallBaseId
,
0
,
"单据审核通过,已自动打款"
);
string
msg
=
userModule
.
SetRecommendOrdersBillRemit
(
BillId
,
TenantId
,
MallBaseId
,
0
,
"单据审核通过,已自动打款"
);
...
@@ -233,7 +233,7 @@ namespace Mall.WebApi.Controllers.Finance
...
@@ -233,7 +233,7 @@ namespace Mall.WebApi.Controllers.Finance
LogHelper
.
Write
(
"企业付款失败 账单BillId:"
+
BillId
);
LogHelper
.
Write
(
"企业付款失败 账单BillId:"
+
BillId
);
}
}
new
MiniProgramMsgModule
().
SendWithdrawSucceedMsg
(
TenantId
,
MallBaseId
,
umodel
.
OpenId
,
(
bmodel
.
Money
??
0
).
ToString
(),
"0"
,
"自动打款"
,
"已发放
推荐
佣金,请注意查收"
);
new
MiniProgramMsgModule
().
SendWithdrawSucceedMsg
(
TenantId
,
MallBaseId
,
umodel
.
OpenId
,
(
bmodel
.
Money
??
0
).
ToString
(),
"0"
,
"自动打款"
,
"已发放
供应商
佣金,请注意查收"
);
return
ApiResult
.
Success
();
return
ApiResult
.
Success
();
}
}
else
else
...
...
Mall.WebApi/Controllers/User/UserController.cs
View file @
71683841
...
@@ -3013,7 +3013,7 @@ namespace Mall.WebApi.Controllers.User
...
@@ -3013,7 +3013,7 @@ namespace Mall.WebApi.Controllers.User
{
{
var
mallModel
=
userModule
.
GetMiniProgramExtend
(
req
.
MallBaseId
);
var
mallModel
=
userModule
.
GetMiniProgramExtend
(
req
.
MallBaseId
);
var
umodel
=
userModule
.
GetMemberUserInfo
(
bmodel
.
UserId
??
0
);
var
umodel
=
userModule
.
GetMemberUserInfo
(
bmodel
.
UserId
??
0
);
var
flag
=
App_Code
.
PayUtil
.
GetTransfersOrder
((
bmodel
.
Periods
??
""
)
+
bmodel
.
Id
,
bmodel
.
Money
??
0
,
(
bmodel
.
UserId
??
0
).
ToString
(),
umodel
.
OpenId
,
mallModel
,
_accessor
);
var
flag
=
App_Code
.
PayUtil
.
GetTransfersOrder
((
bmodel
.
Periods
??
""
)
+
bmodel
.
Id
,
bmodel
.
Money
??
0
,
(
bmodel
.
UserId
??
0
).
ToString
(),
umodel
.
OpenId
,
mallModel
,
_accessor
,
"赞羊供应商佣金打款"
);
if
(
flag
)
if
(
flag
)
{
{
string
msg
=
userModule
.
SetRecommendOrdersBillRemit
(
BillId
,
req
.
TenantId
,
req
.
MallBaseId
,
req
.
EmpId
);
string
msg
=
userModule
.
SetRecommendOrdersBillRemit
(
BillId
,
req
.
TenantId
,
req
.
MallBaseId
,
req
.
EmpId
);
...
@@ -3022,7 +3022,7 @@ namespace Mall.WebApi.Controllers.User
...
@@ -3022,7 +3022,7 @@ namespace Mall.WebApi.Controllers.User
LogHelper
.
Write
(
"企业付款失败 账单BillId:"
+
BillId
);
LogHelper
.
Write
(
"企业付款失败 账单BillId:"
+
BillId
);
}
}
new
MiniProgramMsgModule
().
SendWithdrawSucceedMsg
(
req
.
TenantId
,
req
.
MallBaseId
,
umodel
.
OpenId
,
(
bmodel
.
Money
??
0
).
ToString
(),
"0"
,
"自动打款"
,
"已发放
推荐
佣金,请注意查收"
);
new
MiniProgramMsgModule
().
SendWithdrawSucceedMsg
(
req
.
TenantId
,
req
.
MallBaseId
,
umodel
.
OpenId
,
(
bmodel
.
Money
??
0
).
ToString
(),
"0"
,
"自动打款"
,
"已发放
供应商
佣金,请注意查收"
);
return
ApiResult
.
Success
();
return
ApiResult
.
Success
();
}
}
else
else
...
...
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