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
bfc4c773
Commit
bfc4c773
authored
Apr 02, 2019
by
wutong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动周转修改有建议才备货.
parent
45352370
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
AutoTurnoverJob.java
...over/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
+8
-2
No files found.
data-show/show-auto-turnover/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
View file @
bfc4c773
...
@@ -319,7 +319,7 @@ public class AutoTurnoverJob extends PointJob {
...
@@ -319,7 +319,7 @@ public class AutoTurnoverJob extends PointJob {
Integer
inventoryAvailableDays
=
0
;
Integer
inventoryAvailableDays
=
0
;
BigDecimal
totalSales
=
BigDecimal
.
ZERO
;
//周转期总销量
BigDecimal
totalSales
=
BigDecimal
.
ZERO
;
//周转期总销量
BigDecimal
totalInbound
=
BigDecimal
.
ZERO
;
//周转期总预计入库
BigDecimal
totalInbound
=
BigDecimal
.
ZERO
;
//周转期总预计入库
BigDecimal
moqDecimal
=
BigDecimal
.
valueOf
(
moq
.
double
Value
());
BigDecimal
moqDecimal
=
BigDecimal
.
valueOf
(
moq
.
long
Value
());
List
<
Integer
>
historySalesList
=
JSON
.
parseObject
(
dcAutoSales
.
getHistorySalesDetails
(),
new
TypeReference
<
List
<
Integer
>>()
{
List
<
Integer
>
historySalesList
=
JSON
.
parseObject
(
dcAutoSales
.
getHistorySalesDetails
(),
new
TypeReference
<
List
<
Integer
>>()
{
});
});
...
@@ -426,7 +426,8 @@ public class AutoTurnoverJob extends PointJob {
...
@@ -426,7 +426,8 @@ public class AutoTurnoverJob extends PointJob {
if
(
i
<
turnoverDays
)
{
if
(
i
<
turnoverDays
)
{
avgForecastTurnoverDaySales
=
avgForecastTurnoverDaySales
.
add
(
forecastSalesList
.
get
(
i
));
avgForecastTurnoverDaySales
=
avgForecastTurnoverDaySales
.
add
(
forecastSalesList
.
get
(
i
));
}
}
if
(
i
<
stockUpDays
)
{
//如果初始采购建议 <= 0, 那就也不用备货.
if
(
i
<
stockUpDays
&&
forecastPurchaseAdvisedList
.
get
(
0
).
compareTo
(
BigDecimal
.
ZERO
)
==
1
)
{
stockUpSales
=
stockUpSales
.
add
(
forecastSalesList
.
get
(
i
+
turnoverDays
+
1
));
stockUpSales
=
stockUpSales
.
add
(
forecastSalesList
.
get
(
i
+
turnoverDays
+
1
));
}
}
}
}
...
@@ -455,7 +456,12 @@ public class AutoTurnoverJob extends PointJob {
...
@@ -455,7 +456,12 @@ public class AutoTurnoverJob extends PointJob {
dcAutoTurnover
.
setSkuTitle
(
turnoverSku
.
getSkuTitle
());
dcAutoTurnover
.
setSkuTitle
(
turnoverSku
.
getSkuTitle
());
dcAutoTurnover
.
setPromotions
(
promotionsBuilder
.
toString
());
dcAutoTurnover
.
setPromotions
(
promotionsBuilder
.
toString
());
dcAutoTurnover
.
setQuantityInitAdvise
(
forecastPurchaseAdvisedList
.
get
(
0
).
add
(
stockUpSales
));
dcAutoTurnover
.
setQuantityInitAdvise
(
forecastPurchaseAdvisedList
.
get
(
0
).
add
(
stockUpSales
));
//如果初始建议数 + 备货数 > moq建议数, 那么moq建议数 + 备货数, 否则, 还是取moq建议数
BigDecimal
subtract
=
dcAutoTurnover
.
getQuantityInitAdvise
().
subtract
(
moqPurchaseAdvisedList
.
get
(
0
));
dcAutoTurnover
.
setQuantityFinalAdvise
(
moqPurchaseAdvisedList
.
get
(
0
));
dcAutoTurnover
.
setQuantityFinalAdvise
(
moqPurchaseAdvisedList
.
get
(
0
));
if
(
subtract
.
compareTo
(
BigDecimal
.
ZERO
)
==
1
)
{
dcAutoTurnover
.
setQuantityFinalAdvise
(
moqPurchaseAdvisedList
.
get
(
0
).
add
(
subtract
));
}
dcAutoTurnover
.
setQuantityMinimumOrder
(
turnoverSku
.
getMoq
());
dcAutoTurnover
.
setQuantityMinimumOrder
(
turnoverSku
.
getMoq
());
dcAutoTurnover
.
setQuantityInventory
(
realInventory
);
dcAutoTurnover
.
setQuantityInventory
(
realInventory
);
dcAutoTurnover
.
setQuantityPurchase
(
purchase
);
dcAutoTurnover
.
setQuantityPurchase
(
purchase
);
...
...
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