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
huluobin
dc-java
Commits
d57e2278
Commit
d57e2278
authored
Sep 03, 2021
by
liyanlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、增加Shopify销量计算;
2、修复已知bug。
parent
2841bd08
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
7 deletions
+64
-7
OrderSyncJob.java
...s-order/src/main/java/com/bailuntec/job/OrderSyncJob.java
+6
-4
DcAutoTurnover.java
...main/java/com/bailuntec/domain/entity/DcAutoTurnover.java
+26
-1
PlatformType.java
...ain/java/com/bailuntec/domain/enumerate/PlatformType.java
+3
-2
DcAutoTurnoverMapper.xml
...c/main/java/com/bailuntec/mapper/DcAutoTurnoverMapper.xml
+18
-0
AutoTurnoverJob.java
...over/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
+11
-0
No files found.
data-base/base-sync-oms-order/src/main/java/com/bailuntec/job/OrderSyncJob.java
View file @
d57e2278
...
@@ -464,10 +464,12 @@ public class OrderSyncJob extends PointJob {
...
@@ -464,10 +464,12 @@ public class OrderSyncJob extends PointJob {
dcBaseOmsSku
.
setCostTotal
(
rmbCost
);
dcBaseOmsSku
.
setCostTotal
(
rmbCost
);
//利润都转为人民币计算
//利润都转为人民币计算
BigDecimal
unitSkuProfit
=
BigDecimal
.
ZERO
;
BigDecimal
unitSkuProfit
=
BigDecimal
.
ZERO
;
if
(
dcBaseOmsOrder
.
getPlatformType
().
toUpperCase
().
equals
(
PlatformType
.
Amazon
.
value
()))
{
if
(
bailunSkuQuantityShippedDecimal
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
unitSkuProfit
=
unitSkuAmountSalesRMB
.
add
(
unitSkuAmountTaxRMB
).
subtract
(
dcBaseOmsSku
.
getCostTotal
());
if
(
dcBaseOmsOrder
.
getPlatformType
().
toUpperCase
().
equals
(
PlatformType
.
Amazon
.
value
()))
{
}
else
{
unitSkuProfit
=
unitSkuAmountSalesRMB
.
add
(
unitSkuAmountTaxRMB
).
subtract
(
dcBaseOmsSku
.
getCostTotal
());
unitSkuProfit
=
unitSkuAmountSalesRMB
.
subtract
(
dcBaseOmsSku
.
getCostTotal
());
}
else
{
unitSkuProfit
=
unitSkuAmountSalesRMB
.
subtract
(
dcBaseOmsSku
.
getCostTotal
());
}
}
}
//只有发货的SKU才去算订单维度利润
//只有发货的SKU才去算订单维度利润
BigDecimal
skuShippedProfit
=
unitSkuProfit
.
multiply
(
bailunSkuQuantityShippedDecimal
);
BigDecimal
skuShippedProfit
=
unitSkuProfit
.
multiply
(
bailunSkuQuantityShippedDecimal
);
...
...
data-common/src/main/java/com/bailuntec/domain/entity/DcAutoTurnover.java
View file @
d57e2278
...
@@ -853,6 +853,21 @@ public class DcAutoTurnover {
...
@@ -853,6 +853,21 @@ public class DcAutoTurnover {
private
BigDecimal
historyThirtydaySalesWalmart
;
private
BigDecimal
historyThirtydaySalesWalmart
;
/**
/**
* shopify 过去7日销量(日均)
*/
private
BigDecimal
historySevendaySalesShopify
;
/**
* shopify 过去14日销量(日均)
*/
private
BigDecimal
historyFourteendaySalesShopify
;
/**
* shopify 过去30日销量(日均)
*/
private
BigDecimal
historyThirtydaySalesShopify
;
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_turnover
* This method corresponds to the database table dc_auto_turnover
*
*
...
@@ -958,6 +973,9 @@ public class DcAutoTurnover {
...
@@ -958,6 +973,9 @@ public class DcAutoTurnover {
sb
.
append
(
", historySevendaySalesWalmart="
).
append
(
historySevendaySalesWalmart
);
sb
.
append
(
", historySevendaySalesWalmart="
).
append
(
historySevendaySalesWalmart
);
sb
.
append
(
", historyFourteendaySalesWalmart="
).
append
(
historyFourteendaySalesWalmart
);
sb
.
append
(
", historyFourteendaySalesWalmart="
).
append
(
historyFourteendaySalesWalmart
);
sb
.
append
(
", historyThirtydaySalesWalmart="
).
append
(
historyThirtydaySalesWalmart
);
sb
.
append
(
", historyThirtydaySalesWalmart="
).
append
(
historyThirtydaySalesWalmart
);
sb
.
append
(
", historySevendaySalesShopify="
).
append
(
historySevendaySalesShopify
);
sb
.
append
(
", historyFourteendaySalesShopify="
).
append
(
historyFourteendaySalesShopify
);
sb
.
append
(
", historyThirtydaySalesShopify="
).
append
(
historyThirtydaySalesShopify
);
sb
.
append
(
"]"
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
return
sb
.
toString
();
}
}
...
@@ -1073,7 +1091,10 @@ public class DcAutoTurnover {
...
@@ -1073,7 +1091,10 @@ public class DcAutoTurnover {
&&
(
this
.
getBailunSkuWarehouseCode
()
==
null
?
other
.
getBailunSkuWarehouseCode
()
==
null
:
this
.
getBailunSkuWarehouseCode
().
equals
(
other
.
getBailunSkuWarehouseCode
()))
&&
(
this
.
getBailunSkuWarehouseCode
()
==
null
?
other
.
getBailunSkuWarehouseCode
()
==
null
:
this
.
getBailunSkuWarehouseCode
().
equals
(
other
.
getBailunSkuWarehouseCode
()))
&&
(
this
.
getHistorySevendaySalesWalmart
()
==
null
?
other
.
getHistorySevendaySalesWalmart
()
==
null
:
this
.
getHistorySevendaySalesWalmart
().
equals
(
other
.
getHistorySevendaySalesWalmart
()))
&&
(
this
.
getHistorySevendaySalesWalmart
()
==
null
?
other
.
getHistorySevendaySalesWalmart
()
==
null
:
this
.
getHistorySevendaySalesWalmart
().
equals
(
other
.
getHistorySevendaySalesWalmart
()))
&&
(
this
.
getHistoryFourteendaySalesWalmart
()
==
null
?
other
.
getHistoryFourteendaySalesWalmart
()
==
null
:
this
.
getHistoryFourteendaySalesWalmart
().
equals
(
other
.
getHistoryFourteendaySalesWalmart
()))
&&
(
this
.
getHistoryFourteendaySalesWalmart
()
==
null
?
other
.
getHistoryFourteendaySalesWalmart
()
==
null
:
this
.
getHistoryFourteendaySalesWalmart
().
equals
(
other
.
getHistoryFourteendaySalesWalmart
()))
&&
(
this
.
getHistoryThirtydaySalesWalmart
()
==
null
?
other
.
getHistoryThirtydaySalesWalmart
()
==
null
:
this
.
getHistoryThirtydaySalesWalmart
().
equals
(
other
.
getHistoryThirtydaySalesWalmart
()));
&&
(
this
.
getHistoryThirtydaySalesWalmart
()
==
null
?
other
.
getHistoryThirtydaySalesWalmart
()
==
null
:
this
.
getHistoryThirtydaySalesWalmart
().
equals
(
other
.
getHistoryThirtydaySalesWalmart
()))
&&
(
this
.
getHistorySevendaySalesShopify
()
==
null
?
other
.
getHistorySevendaySalesShopify
()
==
null
:
this
.
getHistorySevendaySalesShopify
().
equals
(
other
.
getHistorySevendaySalesShopify
()))
&&
(
this
.
getHistoryFourteendaySalesShopify
()
==
null
?
other
.
getHistoryFourteendaySalesShopify
()
==
null
:
this
.
getHistoryFourteendaySalesShopify
().
equals
(
other
.
getHistoryFourteendaySalesShopify
()))
&&
(
this
.
getHistoryThirtydaySalesShopify
()
==
null
?
other
.
getHistoryThirtydaySalesShopify
()
==
null
:
this
.
getHistoryThirtydaySalesShopify
().
equals
(
other
.
getHistoryThirtydaySalesShopify
()));
}
}
/**
/**
...
@@ -1180,6 +1201,9 @@ public class DcAutoTurnover {
...
@@ -1180,6 +1201,9 @@ public class DcAutoTurnover {
result
=
prime
*
result
+
((
getHistorySevendaySalesWalmart
()
==
null
)
?
0
:
getHistorySevendaySalesWalmart
().
hashCode
());
result
=
prime
*
result
+
((
getHistorySevendaySalesWalmart
()
==
null
)
?
0
:
getHistorySevendaySalesWalmart
().
hashCode
());
result
=
prime
*
result
+
((
getHistoryFourteendaySalesWalmart
()
==
null
)
?
0
:
getHistoryFourteendaySalesWalmart
().
hashCode
());
result
=
prime
*
result
+
((
getHistoryFourteendaySalesWalmart
()
==
null
)
?
0
:
getHistoryFourteendaySalesWalmart
().
hashCode
());
result
=
prime
*
result
+
((
getHistoryThirtydaySalesWalmart
()
==
null
)
?
0
:
getHistoryThirtydaySalesWalmart
().
hashCode
());
result
=
prime
*
result
+
((
getHistoryThirtydaySalesWalmart
()
==
null
)
?
0
:
getHistoryThirtydaySalesWalmart
().
hashCode
());
result
=
prime
*
result
+
((
getHistorySevendaySalesShopify
()
==
null
)
?
0
:
getHistorySevendaySalesShopify
().
hashCode
());
result
=
prime
*
result
+
((
getHistoryFourteendaySalesShopify
()
==
null
)
?
0
:
getHistoryFourteendaySalesShopify
().
hashCode
());
result
=
prime
*
result
+
((
getHistoryThirtydaySalesShopify
()
==
null
)
?
0
:
getHistoryThirtydaySalesShopify
().
hashCode
());
return
result
;
return
result
;
}
}
}
}
\ No newline at end of file
data-common/src/main/java/com/bailuntec/domain/enumerate/PlatformType.java
View file @
d57e2278
...
@@ -20,8 +20,9 @@ public enum PlatformType {
...
@@ -20,8 +20,9 @@ public enum PlatformType {
Walmart
(
13
,
"WALMART"
),
Walmart
(
13
,
"WALMART"
),
PriceMinister
(
14
,
"PRICEMINISTER"
),
PriceMinister
(
14
,
"PRICEMINISTER"
),
wwFnac
(
15
,
"WWFNAC"
),
wwFnac
(
15
,
"WWFNAC"
),
Marketing
(
16
,
"MARKETING"
);
Marketing
(
16
,
"MARKETING"
),
Shopify
(
21
,
"SHOPIFY"
);
private
final
int
code
;
private
final
int
code
;
private
final
String
value
;
private
final
String
value
;
...
...
data-common/src/main/java/com/bailuntec/mapper/DcAutoTurnoverMapper.xml
View file @
d57e2278
...
@@ -682,6 +682,15 @@
...
@@ -682,6 +682,15 @@
<if
test=
"salesDetailsFormula != null"
>
<if
test=
"salesDetailsFormula != null"
>
sales_details_formula,
sales_details_formula,
</if>
</if>
<if
test=
"historySevendaySalesShopify != null"
>
history_sevenday_sales_shopify,
</if>
<if
test=
"historyFourteendaySalesShopify != null"
>
history_fourteenday_sales_shopify,
</if>
<if
test=
"historyThirtydaySalesShopify != null"
>
history_thirtyday_sales_shopify,
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
<if
test=
"id != null"
>
...
@@ -975,6 +984,15 @@
...
@@ -975,6 +984,15 @@
<if
test=
"salesDetailsFormula != null"
>
<if
test=
"salesDetailsFormula != null"
>
#{salesDetailsFormula,jdbcType=LONGVARCHAR},
#{salesDetailsFormula,jdbcType=LONGVARCHAR},
</if>
</if>
<if
test=
"historySevendaySalesShopify != null"
>
#{historySevendaySalesShopify,jdbcType=DECIMAL},
</if>
<if
test=
"historyFourteendaySalesShopify != null"
>
#{historyFourteendaySalesShopify,jdbcType=DECIMAL},
</if>
<if
test=
"historyThirtydaySalesShopify != null"
>
#{historyThirtydaySalesShopify,jdbcType=DECIMAL},
</if>
</trim>
</trim>
</insert>
</insert>
<select
id=
"countByExample"
parameterType=
"com.bailuntec.domain.example.DcAutoTurnoverExample"
resultType=
"java.lang.Long"
>
<select
id=
"countByExample"
parameterType=
"com.bailuntec.domain.example.DcAutoTurnoverExample"
resultType=
"java.lang.Long"
>
...
...
data-show/show-auto-turnover/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
View file @
d57e2278
...
@@ -951,6 +951,17 @@ public class AutoTurnoverJob extends PointJob {
...
@@ -951,6 +951,17 @@ public class AutoTurnoverJob extends PointJob {
dcAutoTurnover
.
setHistoryThirtydaySalesWalmart
(
BigDecimal
.
valueOf
(
walmartAvgSales
.
getThirtydaySales
()).
divide
(
Constant
.
BIGDECIMAL_THIRTY
,
3
,
RoundingMode
.
HALF_EVEN
));
dcAutoTurnover
.
setHistoryThirtydaySalesWalmart
(
BigDecimal
.
valueOf
(
walmartAvgSales
.
getThirtydaySales
()).
divide
(
Constant
.
BIGDECIMAL_THIRTY
,
3
,
RoundingMode
.
HALF_EVEN
));
}
}
//Shopify
SalesVolumeAvgDTO
shopifyAvgSales
=
mapper
.
getPlatformHistorySales
(
dcAutoTurnover
.
getBailunSku
(),
dcAutoTurnover
.
getWarehouseCode
(),
PlatformType
.
Shopify
.
value
());
dcAutoTurnover
.
setHistorySevendaySalesShopify
(
BigDecimal
.
ZERO
);
dcAutoTurnover
.
setHistoryFourteendaySalesShopify
(
BigDecimal
.
ZERO
);
dcAutoTurnover
.
setHistoryThirtydaySalesShopify
(
BigDecimal
.
ZERO
);
if
(
shopifyAvgSales
!=
null
)
{
dcAutoTurnover
.
setHistorySevendaySalesShopify
(
BigDecimal
.
valueOf
(
shopifyAvgSales
.
getSevendaySales
()).
divide
(
Constant
.
BIGDECIMAL_SEVEN
,
3
,
RoundingMode
.
HALF_EVEN
));
dcAutoTurnover
.
setHistoryFourteendaySalesShopify
(
BigDecimal
.
valueOf
(
shopifyAvgSales
.
getFourteendaySales
()).
divide
(
Constant
.
BIGDECIMAL_FOURTEEN
,
3
,
RoundingMode
.
HALF_EVEN
));
dcAutoTurnover
.
setHistoryThirtydaySalesShopify
(
BigDecimal
.
valueOf
(
shopifyAvgSales
.
getThirtydaySales
()).
divide
(
Constant
.
BIGDECIMAL_THIRTY
,
3
,
RoundingMode
.
HALF_EVEN
));
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"计算平台的平均销量失败"
,
e
);
throw
new
RuntimeException
(
"计算平台的平均销量失败"
,
e
);
}
finally
{
}
finally
{
...
...
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