Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dc-java
Overview
Overview
Details
Activity
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
bltdc
dc-java
Commits
dc18615c
Commit
dc18615c
authored
Dec 19, 2019
by
yinyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据中心--订单所有平台费为空读取历史数据
parent
c0a6bfc1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
OrderSyncJob.java
...s-order/src/main/java/com/bailuntec/job/OrderSyncJob.java
+15
-7
No files found.
data-base/base-sync-oms-order/src/main/java/com/bailuntec/job/OrderSyncJob.java
View file @
dc18615c
...
...
@@ -201,13 +201,13 @@ public class OrderSyncJob extends PointJob {
* dc_base_oms_sku字段赋值, 给初始值是为了避免nullPoint
*/
assignmentSkuInfo
(
omsResult
,
dcBaseOmsOrder
,
dcBaseOmsSku
,
bailunSkuObj
,
dcBaseWarehouse
,
logisticsHashMap
,
bailunSkuStructure
);
//总花费用
BigDecimal
initTotalCost
=
(
omsResult
.
getOrderCharge
()
==
null
?
BigDecimal
.
ZERO
:
(
omsResult
.
getOrderCharge
().
getCostTotal
().
getAmount
()
==
null
?
BigDecimal
.
ZERO
:
omsResult
.
getOrderCharge
().
getCostTotal
().
getAmount
()));
//销售额
BigDecimal
productAmount
=
dcBaseOmsOrder
.
getAmountProduct
().
compareTo
(
BigDecimal
.
ZERO
)
==
1
?
dcBaseOmsOrder
.
getAmountProduct
()
:
dcBaseOmsOrder
.
getAmountTotal
();
BigDecimal
amountSales
=
productAmount
.
add
(
dcBaseOmsOrder
.
getAmountShipping
()).
subtract
(
dcBaseOmsOrder
.
getCostPromotion
());
if
(
PlatformType
.
FBA
.
value
().
equals
(
omsResult
.
getPlatformType
().
toUpperCase
()))
{
//FBA费用
BigDecimal
initTotalCost
=
(
omsResult
.
getOrderCharge
()
==
null
?
BigDecimal
.
ZERO
:
(
omsResult
.
getOrderCharge
().
getCostTotal
().
getAmount
()
==
null
?
BigDecimal
.
ZERO
:
omsResult
.
getOrderCharge
().
getCostTotal
().
getAmount
()));
//销售额
BigDecimal
productAmount
=
dcBaseOmsOrder
.
getAmountProduct
().
compareTo
(
BigDecimal
.
ZERO
)
==
1
?
dcBaseOmsOrder
.
getAmountProduct
()
:
dcBaseOmsOrder
.
getAmountTotal
();
BigDecimal
amountSales
=
productAmount
.
add
(
dcBaseOmsOrder
.
getAmountShipping
()).
subtract
(
dcBaseOmsOrder
.
getCostPromotion
());
if
((
dcBaseOmsOrder
.
getCostFbaFee
().
compareTo
(
BigDecimal
.
ZERO
)
==
1
)
||
(
initTotalCost
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
)
||
(
amountSales
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
))
{
BigDecimal
skuCostFbaFee
=
bailunSkuStructure
.
getSkuWeightRatio
().
multiply
(
dcBaseOmsOrder
.
getCostFbaFee
()).
setScale
(
5
,
RoundingMode
.
HALF_EVEN
);
...
...
@@ -220,16 +220,24 @@ public class OrderSyncJob extends PointJob {
omsOrderFBAFee
=
omsOrderFBAFee
.
add
(
dcBaseOmsSku
.
getCostFbaFee
());
}
if
((
dcBaseOmsOrder
.
getCostPlatformFee
().
compareTo
(
BigDecimal
.
ZERO
)
==
0
)
&&
(
initTotalCost
.
compareTo
(
BigDecimal
.
valueOf
(
0
))
==
1
)
&&
(
amountSales
.
compareTo
(
BigDecimal
.
ZERO
)
==
1
))
{
/*
if((dcBaseOmsOrder.getCostPlatformFee().compareTo(BigDecimal.ZERO) == 0) && (initTotalCost.compareTo(BigDecimal.valueOf(0)) == 1) && (amountSales.compareTo(BigDecimal.ZERO) == 1)) {
DcBaseOmsSkuMapper dcBaseOmsSkuMapper = SessionUtil.getSession().getMapper(DcBaseOmsSkuMapper.class);
BigDecimal costPlatformFee = dcBaseOmsSkuMapper.selectCostPlatformFee(dcBaseOmsSku.getBailunSku(), dcBaseOmsSku.getWebsite());
totalCostPlatformFee = totalCostPlatformFee.add(costPlatformFee == null ? BigDecimal.ZERO : costPlatformFee);
hasCostPlatformFee = false;
}
}
*/
//FBA的发货数不用从配货单信息拿, FBA只要下单亚马逊就发货
dcBaseOmsSku
.
setBailunSkuQuantityShipped
(
bailunSkuObj
.
getBailunSkuQuantityOrdered
());
checkFbaFee
(
dcBaseOmsSku
,
dcBaseOmsOrder
);
}
if
((
dcBaseOmsOrder
.
getCostPlatformFee
().
compareTo
(
BigDecimal
.
ZERO
)
==
0
)
&&
(
initTotalCost
.
compareTo
(
BigDecimal
.
valueOf
(
0
))
==
1
)
&&
(
amountSales
.
compareTo
(
BigDecimal
.
ZERO
)
==
1
))
{
DcBaseOmsSkuMapper
dcBaseOmsSkuMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseOmsSkuMapper
.
class
);
BigDecimal
costPlatformFee
=
dcBaseOmsSkuMapper
.
selectCostPlatformFee
(
dcBaseOmsSku
.
getBailunSku
(),
dcBaseOmsSku
.
getPlatformType
(),
dcBaseOmsSku
.
getWebsite
());
totalCostPlatformFee
=
totalCostPlatformFee
.
add
(
costPlatformFee
==
null
?
BigDecimal
.
ZERO
:
costPlatformFee
);
hasCostPlatformFee
=
false
;
}
bailunSkuStructure
.
setDcBaseOmsSku
(
dcBaseOmsSku
);
bailunSkuInfoMap
.
put
(
bailunSkuObj
.
getBailunSku
(),
bailunSkuStructure
);
}
...
...
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