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
765a005c
Commit
765a005c
authored
Aug 06, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
介绍记录改为全局
parent
e5863dea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
48 deletions
+0
-48
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/GroupPurchaseServiceImpl.java
...wdz/ch/wx/impl/distribution/GroupPurchaseServiceImpl.java
+0
-48
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/GroupPurchaseServiceImpl.java
View file @
765a005c
...
@@ -338,54 +338,6 @@ public class GroupPurchaseServiceImpl implements GroupPurchaseService {
...
@@ -338,54 +338,6 @@ public class GroupPurchaseServiceImpl implements GroupPurchaseService {
return Result.failed("支付尾款失败");
return Result.failed("支付尾款失败");
}*/
}*/
@Transactional
public
Result
calculateProfit
(
GroupPurchaseRecordRequestDto
dto
)
{
try
{
String
distributionOrderId
=
dto
.
getDistributionOrderId
();
DistributionOrder
distributionOrder
=
distributionOrderDao
.
findById
(
distributionOrderId
);
long
itemId
=
distributionOrder
.
getItemId
();
GroupPurchaseConfig
groupPurchaseConfig
=
groupPurchaseConfigDao
.
findByItemId
(
itemId
);
//计算账单
DistributorProfit
distributorProfit
=
new
DistributorProfit
();
//查询介绍佣金比例
FollowFansRecordRequestDto
followFansRecordRequestDto
=
new
FollowFansRecordRequestDto
();
followFansRecordRequestDto
.
setFollowerId
(
distributionOrder
.
getSellerId
());
followFansRecordRequestDto
.
setFansId
(
distributionOrder
.
getBuyerId
());
double
rebate
=
distributorProfitService
.
getIntroduceRebate
(
followFansRecordRequestDto
);
double
introduceCost
=
distributionOrder
.
getAmount
().
doubleValue
()
*
rebate
;
//实际订单到账金额
double
realAmount
=
distributionOrder
.
getAmount
().
doubleValue
()
*
(
1
-
CommConsts
.
WX_COMMISSION_REBATE
);
//拍卖的平台佣金= 订单金额 - 藏家供货价 - 介绍佣金
double
channelServiceCost
=
distributionOrder
.
getAmount
().
doubleValue
()
-
groupPurchaseConfig
.
getSupplyPrice
()
-
introduceCost
;
distributorProfit
.
setChannelCost
(
PriceUtil
.
convertPriceFromStr
(
PriceUtil
.
convertDoubleToString
(
channelServiceCost
)));
distributorProfit
.
setIntroduceCost
(
PriceUtil
.
convertPriceFromStr
(
PriceUtil
.
convertDoubleToString
(
introduceCost
)));
distributorProfit
.
setDistributionOrderId
(
distributionOrderId
);
distributorProfit
.
setDistributorId
(
distributionOrder
.
getSellerId
());
distributorProfit
.
setItemId
(
distributionOrder
.
getItemId
());
distributorProfit
.
setItemNum
(
distributionOrder
.
getItemNum
());
distributorProfit
.
setAmount
(
distributionOrder
.
getAmount
());
distributorProfit
.
setRealAmount
(
PriceUtil
.
convertPriceFromStr
(
PriceUtil
.
convertDoubleToString
(
realAmount
)));
distributorProfit
.
setItemCost
(
groupPurchaseConfig
.
getSupplyPrice
());
distributorProfit
.
setChannelCost
(
PriceUtil
.
convertPriceFromStr
(
PriceUtil
.
convertDoubleToString
(
channelServiceCost
)));
distributorProfit
.
setIntroduceCost
(
PriceUtil
.
convertPriceFromStr
(
PriceUtil
.
convertDoubleToString
(
introduceCost
)));
//团购订单,藏家的利润就是商品设置的供货价
distributorProfit
.
setProfit
(
groupPurchaseConfig
.
getSupplyPrice
());
distributorProfit
.
setCreateTime
(
new
Date
());
distributorProfit
.
setType
(
DistributionEnum
.
DistributionTypeEnum
.
GROUP_PURCHASE
.
getCode
());
distributorProfit
.
setIsValid
(
true
);
distributorProfitDao
.
insert
(
distributorProfit
);
}
catch
(
Exception
e
){
logger
.
error
(
"团购订单创建失败 error : {}"
,
e
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
}
return
Result
.
failed
(
"团购订单账单计算失败"
);
}
@Override
@Override
...
...
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