Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
1b49aabc
Commit
1b49aabc
authored
Jun 28, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询商品服务费和佣金接口2
parent
9212f263
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/DistributorProfitServiceImpl.java
...ch/wx/impl/distribution/DistributorProfitServiceImpl.java
+16
-2
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/DistributorProfitServiceImpl.java
View file @
1b49aabc
...
...
@@ -2,8 +2,10 @@ package com.wwdz.ch.wx.impl.distribution;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.core.util.PriceUtil
;
import
com.wwdz.ch.db.dao.CollectorWhiteListDao
;
import
com.wwdz.ch.db.dao.FollowFansRecordDao
;
import
com.wwdz.ch.db.dao.distribution.DistributorProfitDao
;
import
com.wwdz.ch.db.domain.CollectorWhiteList
;
import
com.wwdz.ch.db.domain.FollowFansRecord
;
import
com.wwdz.ch.db.dto.request.FollowFansRecordRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto
;
...
...
@@ -30,6 +32,9 @@ public class DistributorProfitServiceImpl implements DistributorProfitService {
@Autowired
FollowFansRecordDao
followFansRecordDao
;
@Autowired
CollectorWhiteListDao
collectorWhiteListDao
;
@Override
public
Double
getIntroduceRebate
(
FollowFansRecordRequestDto
dto
)
{
double
rebate
=
0.3
;
...
...
@@ -69,11 +74,20 @@ public class DistributorProfitServiceImpl implements DistributorProfitService {
@Override
public
Result
getExpectAmount
(
SupplierItemRequestDto
supplierItemRequestDto
)
{
try
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"introduceRebate"
,
"3%"
);
double
channelServiceRebate
=
0.15
;
CollectorWhiteList
collectorWhiteList
=
collectorWhiteListDao
.
findById
(
supplierItemRequestDto
.
getUserId
());
if
(
collectorWhiteList
!=
null
)
{
channelServiceRebate
=
PriceUtil
.
convertToDivide
(
collectorWhiteList
.
getChannelCostRebate
()).
doubleValue
();
map
.
put
(
"channelServiceRebate"
,
collectorWhiteList
.
getChannelCostRebate
().
intValue
()
+
"%"
);
}
else
{
map
.
put
(
"channelServiceRebate"
,
"15%"
);
}
Long
itemPrice
=
PriceUtil
.
convertPriceFromStr
(
supplierItemRequestDto
.
getDistributionPrice
());
long
channelServiceCost
=
PriceUtil
.
convertPriceFromStr
(
PriceUtil
.
convertDoubleToString
(
itemPrice
.
doubleValue
()
*
0.05
));
long
channelServiceCost
=
PriceUtil
.
convertPriceFromStr
(
PriceUtil
.
convertDoubleToString
(
itemPrice
.
doubleValue
()
*
channelServiceRebate
));
long
introduceCost
=
PriceUtil
.
convertPriceFromStr
(
PriceUtil
.
convertDoubleToString
(
itemPrice
.
doubleValue
()
*
0.03
));
long
profit
=
itemPrice
-
channelServiceCost
-
introduceCost
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"channelServiceCost"
,
PriceUtil
.
convertPriceFenToYuan
(
channelServiceCost
));
map
.
put
(
"introduceCost"
,
PriceUtil
.
convertPriceFenToYuan
(
introduceCost
));
map
.
put
(
"profit"
,
PriceUtil
.
convertPriceFenToYuan
(
profit
));
...
...
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