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
c078d1e6
Commit
c078d1e6
authored
Jun 02, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
和平返佣
parent
bc33739d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
113 additions
and
25 deletions
+113
-25
RB_Goods_OrderCommission.cs
Mall.Model/Entity/Product/RB_Goods_OrderCommission.cs
+4
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+91
-9
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+8
-8
UserModule.cs
Mall.Module.User/UserModule.cs
+8
-6
RB_Distributor_HPGradeInfoRepository.cs
Mall.Repository/User/RB_Distributor_HPGradeInfoRepository.cs
+1
-1
RB_Distributor_InfoRepository.cs
Mall.Repository/User/RB_Distributor_InfoRepository.cs
+1
-1
No files found.
Mall.Model/Entity/Product/RB_Goods_OrderCommission.cs
View file @
c078d1e6
...
@@ -75,6 +75,10 @@ namespace Mall.Model.Entity.Product
...
@@ -75,6 +75,10 @@ namespace Mall.Model.Entity.Product
set
;
set
;
}
}
/// <summary>
/// <summary>
/// 类型 1标准返佣 2和平返佣
/// </summary>
public
int
?
Type
{
get
;
set
;
}
/// <summary>
/// Remark
/// Remark
/// </summary>
/// </summary>
public
string
Remark
public
string
Remark
...
...
Mall.Module.Product/OrderModule.cs
View file @
c078d1e6
This diff is collapsed.
Click to expand it.
Mall.Module.Product/ProductModule.cs
View file @
c078d1e6
...
@@ -790,16 +790,16 @@ namespace Mall.Module.Product
...
@@ -790,16 +790,16 @@ namespace Mall.Module.Product
var
gList
=
distributor_HPGradeRatioRepository
.
GetList
(
new
RB_Distributor_HPGradeRatio_Extend
()
{
CommissionId
=
hpcModel
.
Id
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
var
gList
=
distributor_HPGradeRatioRepository
.
GetList
(
new
RB_Distributor_HPGradeRatio_Extend
()
{
CommissionId
=
hpcModel
.
Id
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
var
ratioModel
=
gList
.
Where
(
x
=>
x
.
GradeId
==
disModel
.
HPGradeId
).
FirstOrDefault
();
var
ratioModel
=
gList
.
Where
(
x
=>
x
.
GradeId
==
disModel
.
HPGradeId
).
FirstOrDefault
();
decimal
MPrice
=
(
model
.
CostPrice
??
0
)
/
(
1
-
((
ratioModel
.
CommissionRatio
??
0
)
/
100
));
decimal
MPrice
=
(
model
.
CostPrice
??
0
)
/
(
1
-
((
ratioModel
.
CommissionRatio
??
0
)
/
100
));
model
.
MaxShare
=
MaxSellMoney
-
MPrice
>
0
?
MaxSellMoney
-
MPrice
:
0
;
if
(
hpcModel
.
DecimalType
==
1
)
if
(
hpcModel
.
DecimalType
==
1
)
{
{
MPrice
=
Math
.
Ceiling
(
MPric
e
);
model
.
MaxShare
=
Math
.
Ceiling
(
model
.
MaxShar
e
);
}
}
else
if
(
hpcModel
.
DecimalType
==
2
)
else
if
(
hpcModel
.
DecimalType
==
2
)
{
{
MPrice
=
Math
.
Ceiling
(
MPric
e
*
100
)
/
100
;
model
.
MaxShare
=
Math
.
Ceiling
(
model
.
MaxShar
e
*
100
)
/
100
;
}
}
model
.
MaxShare
=
MaxSellMoney
-
MPrice
>
0
?
MaxSellMoney
-
MPrice
:
0
;
}
}
}
}
}
}
...
@@ -1155,16 +1155,16 @@ namespace Mall.Module.Product
...
@@ -1155,16 +1155,16 @@ namespace Mall.Module.Product
var
gList
=
distributor_HPGradeRatioRepository
.
GetList
(
new
RB_Distributor_HPGradeRatio_Extend
()
{
CommissionId
=
hpcModel
.
Id
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
var
gList
=
distributor_HPGradeRatioRepository
.
GetList
(
new
RB_Distributor_HPGradeRatio_Extend
()
{
CommissionId
=
hpcModel
.
Id
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
var
ratioModel
=
gList
.
Where
(
x
=>
x
.
GradeId
==
disModel
.
HPGradeId
).
FirstOrDefault
();
var
ratioModel
=
gList
.
Where
(
x
=>
x
.
GradeId
==
disModel
.
HPGradeId
).
FirstOrDefault
();
decimal
MPrice
=
(
model
.
CostPrice
??
0
)
/
(
1
-
((
ratioModel
.
CommissionRatio
??
0
)
/
100
));
decimal
MPrice
=
(
model
.
CostPrice
??
0
)
/
(
1
-
((
ratioModel
.
CommissionRatio
??
0
)
/
100
));
model
.
MaxShare
=
MaxSellMoney
-
MPrice
>
0
?
MaxSellMoney
-
MPrice
:
0
;
if
(
hpcModel
.
DecimalType
==
1
)
if
(
hpcModel
.
DecimalType
==
1
)
{
{
MPrice
=
Math
.
Ceiling
(
MPric
e
);
model
.
MaxShare
=
Math
.
Ceiling
(
model
.
MaxShar
e
);
}
}
else
if
(
hpcModel
.
DecimalType
==
2
)
else
if
(
hpcModel
.
DecimalType
==
2
)
{
{
MPrice
=
Math
.
Ceiling
(
MPric
e
*
100
)
/
100
;
model
.
MaxShare
=
Math
.
Ceiling
(
model
.
MaxShar
e
*
100
)
/
100
;
}
}
model
.
MaxShare
=
MaxSellMoney
-
MPrice
>
0
?
MaxSellMoney
-
MPrice
:
0
;
}
}
}
}
}
}
...
...
Mall.Module.User/UserModule.cs
View file @
c078d1e6
...
@@ -1140,9 +1140,9 @@ namespace Mall.Module.User
...
@@ -1140,9 +1140,9 @@ namespace Mall.Module.User
//查询和平分销等级
//查询和平分销等级
string
hpgradeIds
=
string
.
Join
(
","
,
list
.
Where
(
x
=>
x
.
HPGradeId
>
0
).
Select
(
x
=>
x
.
HPGradeId
??
0
).
Distinct
());
string
hpgradeIds
=
string
.
Join
(
","
,
list
.
Where
(
x
=>
x
.
HPGradeId
>
0
).
Select
(
x
=>
x
.
HPGradeId
??
0
).
Distinct
());
List
<
RB_Distributor_HPGradeInfo_Extend
>
HPGradeList
=
new
List
<
RB_Distributor_HPGradeInfo_Extend
>();
List
<
RB_Distributor_HPGradeInfo_Extend
>
HPGradeList
=
new
List
<
RB_Distributor_HPGradeInfo_Extend
>();
if
(!
string
.
IsNullOrEmpty
(
gradeIds
))
if
(!
string
.
IsNullOrEmpty
(
hp
gradeIds
))
{
{
HPGradeList
=
distributor_HPGradeInfoRepository
.
GetList
(
new
RB_Distributor_HPGradeInfo_Extend
()
{
GradeIds
=
gradeIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
HPGradeList
=
distributor_HPGradeInfoRepository
.
GetList
(
new
RB_Distributor_HPGradeInfo_Extend
()
{
GradeIds
=
hp
gradeIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
}
}
//查询推荐人列表
//查询推荐人列表
string
tjrIds
=
string
.
Join
(
","
,
list
.
Where
(
x
=>
x
.
SuperiorId
>
0
).
Select
(
x
=>
x
.
SuperiorId
??
0
).
Distinct
());
string
tjrIds
=
string
.
Join
(
","
,
list
.
Where
(
x
=>
x
.
SuperiorId
>
0
).
Select
(
x
=>
x
.
SuperiorId
??
0
).
Distinct
());
...
@@ -1169,11 +1169,12 @@ namespace Mall.Module.User
...
@@ -1169,11 +1169,12 @@ namespace Mall.Module.User
{
{
item
.
GradeName
=
GradeList
.
Where
(
x
=>
x
.
Id
==
item
.
GradeId
).
FirstOrDefault
()?.
Name
??
""
;
item
.
GradeName
=
GradeList
.
Where
(
x
=>
x
.
Id
==
item
.
GradeId
).
FirstOrDefault
()?.
Name
??
""
;
}
}
if
(
item
.
HPGradeId
==
0
)
if
(
(
item
.
HPGradeId
??
0
)
==
0
)
{
{
item
.
HPGradeName
=
"默认等级"
;
item
.
HPGradeName
=
"默认等级"
;
}
}
else
if
(
item
.
HPGradeId
>
0
)
{
else
if
(
item
.
HPGradeId
>
0
)
{
item
.
HPGradeName
=
HPGradeList
.
Where
(
x
=>
x
.
Id
==
item
.
HPGradeId
).
FirstOrDefault
()?.
GradeName
??
""
;
item
.
HPGradeName
=
HPGradeList
.
Where
(
x
=>
x
.
Id
==
item
.
HPGradeId
).
FirstOrDefault
()?.
GradeName
??
""
;
}
}
...
@@ -3118,8 +3119,9 @@ namespace Mall.Module.User
...
@@ -3118,8 +3119,9 @@ namespace Mall.Module.User
var
rInsertList
=
demodel
.
RatioList
.
Where
(
x
=>
!
rlist
.
Select
(
z
=>
z
.
GradeId
).
Contains
(
x
.
GradeId
)).
ToList
();
var
rInsertList
=
demodel
.
RatioList
.
Where
(
x
=>
!
rlist
.
Select
(
z
=>
z
.
GradeId
).
Contains
(
x
.
GradeId
)).
ToList
();
foreach
(
var
item
in
rUpdateList
)
{
foreach
(
var
item
in
rUpdateList
)
{
var
rmodel
=
demodel
.
RatioList
.
Where
(
x
=>
x
.
GradeId
==
item
.
GradeId
).
FirstOrDefault
();
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Distributor_HPGradeRatio
.
CommissionRatio
),
item
.
CommissionRatio
}
{
nameof
(
RB_Distributor_HPGradeRatio
.
CommissionRatio
),
rmodel
?.
CommissionRatio
??
0
}
};
};
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
new
WhereHelper
(){
...
@@ -3324,6 +3326,7 @@ namespace Mall.Module.User
...
@@ -3324,6 +3326,7 @@ namespace Mall.Module.User
/// <returns></returns>
/// <returns></returns>
public
object
GetHpUserDistributorInfo
(
int
userId
,
int
tenantId
,
int
mallBaseId
)
public
object
GetHpUserDistributorInfo
(
int
userId
,
int
tenantId
,
int
mallBaseId
)
{
{
var
umodel
=
member_UserRepository
.
GetEntity
(
userId
);
var
model
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
UserId
=
userId
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
}).
FirstOrDefault
();
var
model
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
UserId
=
userId
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
}).
FirstOrDefault
();
if
(
model
==
null
)
{
if
(
model
==
null
)
{
return
new
return
new
...
@@ -3347,7 +3350,6 @@ namespace Mall.Module.User
...
@@ -3347,7 +3350,6 @@ namespace Mall.Module.User
};
};
}
}
var
gmodel
=
distributor_HPGradeInfoRepository
.
GetEntity
(
model
.
HPGradeId
);
var
gmodel
=
distributor_HPGradeInfoRepository
.
GetEntity
(
model
.
HPGradeId
);
var
umodel
=
member_UserRepository
.
GetEntity
(
userId
);
return
new
return
new
{
{
Status
=
1
,
Status
=
1
,
...
...
Mall.Repository/User/RB_Distributor_HPGradeInfoRepository.cs
View file @
c078d1e6
...
@@ -77,7 +77,7 @@ namespace Mall.Repository.User
...
@@ -77,7 +77,7 @@ namespace Mall.Repository.User
where
+=
$@" and
{
nameof
(
RB_Distributor_HPGradeInfo
.
GradeName
)}
like '%
{
dmodel
.
GradeName
}
%'"
;
where
+=
$@" and
{
nameof
(
RB_Distributor_HPGradeInfo
.
GradeName
)}
like '%
{
dmodel
.
GradeName
}
%'"
;
}
}
string
sql
=
$@"select * from RB_Distributor_HPGradeInfo where
{
where
}
order by
Id de
sc"
;
string
sql
=
$@"select * from RB_Distributor_HPGradeInfo where
{
where
}
order by
Grade a
sc"
;
return
Get
<
RB_Distributor_HPGradeInfo_Extend
>(
sql
).
ToList
();
return
Get
<
RB_Distributor_HPGradeInfo_Extend
>(
sql
).
ToList
();
}
}
}
}
...
...
Mall.Repository/User/RB_Distributor_InfoRepository.cs
View file @
c078d1e6
...
@@ -55,7 +55,7 @@ namespace Mall.Repository.User
...
@@ -55,7 +55,7 @@ namespace Mall.Repository.User
where
+=
$@" and di.
{
nameof
(
RB_Distributor_Info
.
Mobile
)}
like '%
{
dmodel
.
Mobile
}
%'"
;
where
+=
$@" and di.
{
nameof
(
RB_Distributor_Info
.
Mobile
)}
like '%
{
dmodel
.
Mobile
}
%'"
;
}
}
string
sql
=
$@"select di.*,u.Name as NickName,u.Photo,u.Source from RB_Distributor_Info di
string
sql
=
$@"select di.*,u.Name as NickName,u.
SuperiorId,u.
Photo,u.Source from RB_Distributor_Info di
inner join rb_member_user u on di.UserId=u.Id
inner join rb_member_user u on di.UserId=u.Id
where
{
where
}
order by di.CreateDate desc"
;
where
{
where
}
order by di.CreateDate desc"
;
return
GetPage
<
RB_Distributor_Info_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
sql
).
ToList
();
return
GetPage
<
RB_Distributor_Info_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
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