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
c295f6e7
Commit
c295f6e7
authored
Nov 28, 2019
by
yinyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动周转修复销量预测
parent
d8c8f488
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
15 deletions
+32
-15
AutoTurnoverJob.java
...over/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
+32
-15
No files found.
data-show/show-auto-turnover/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
View file @
c295f6e7
...
...
@@ -1068,51 +1068,68 @@ public class AutoTurnoverJob extends PointJob {
BigDecimal
forecastSales
=
BigDecimal
.
ZERO
;
List
<
Integer
>
historySalesList
=
JSON
.
parseObject
(
dcAutoSales
.
getHistorySalesDetails
(),
new
TypeReference
<
List
<
Integer
>>()
{
});
List
<
Integer
>
weekRateList
=
JSON
.
parseObject
(
"["
+
dcAutoWarehouseweekSales
.
getRateDetail
()+
"]"
,
new
TypeReference
<
List
<
Integer
>>(){
List
<
Integer
>
weekRateList
=
null
;
int
weekTime
=
0
;
boolean
hasValue
=
true
;
if
(
dcAutoWarehouseweekSales
==
null
)
{
hasValue
=
false
;
}
else
{
weekRateList
=
JSON
.
parseObject
(
"["
+
dcAutoWarehouseweekSales
.
getRateDetail
()+
"]"
,
new
TypeReference
<
List
<
Integer
>>(){
});
int
weekTime
=
Integer
.
valueOf
(
dcAutoWarehouseweekSales
.
getWeekTime
());
weekTime
=
Integer
.
valueOf
(
dcAutoWarehouseweekSales
.
getWeekTime
());
}
if
(
0
<=
j
&&
j
<
7
)
{
forecastSales
=
BigDecimal
.
valueOf
(
historySalesList
.
get
(
2
+
j
)).
multiply
(
BigDecimal
.
valueOf
(
0.1
)).
add
(
BigDecimal
.
valueOf
(
historySalesList
.
get
(
9
+
j
)).
multiply
(
BigDecimal
.
valueOf
(
0.1
))).
add
(
BigDecimal
.
valueOf
(
historySalesList
.
get
(
16
+
j
)).
multiply
(
BigDecimal
.
valueOf
(
0.3
))).
add
(
BigDecimal
.
valueOf
(
historySalesList
.
get
(
23
+
j
)).
multiply
(
BigDecimal
.
valueOf
(
0.5
)));
forecastSales
=
forecastSales
.
multiply
(
BigDecimal
.
valueOf
(
weekRateList
.
get
(
weekTime
-
1
)));
if
(
hasValue
)
{
forecastSales
=
forecastSales
.
multiply
(
BigDecimal
.
valueOf
(
weekRateList
.
get
(
weekTime
-
1
)).
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
BigDecimal
.
ONE
:
BigDecimal
.
valueOf
(
weekRateList
.
get
(
weekTime
-
1
)));
}
}
else
if
(
7
<=
j
&&
j
<
14
)
{
forecastSales
=
(
BigDecimal
.
valueOf
(
historySalesList
.
get
(
2
+
j
)).
multiply
(
BigDecimal
.
valueOf
(
0.1
))).
add
(
BigDecimal
.
valueOf
(
historySalesList
.
get
(
9
+
j
)).
multiply
(
BigDecimal
.
valueOf
(
0.1
))).
add
(
BigDecimal
.
valueOf
(
historySalesList
.
get
(
16
+
j
)).
multiply
(
BigDecimal
.
valueOf
(
0.3
))).
add
(
forecastSalesList
.
get
(
j
-
7
).
multiply
(
BigDecimal
.
valueOf
(
0.5
)));
if
(
weekTime
>
51
)
{
weekTime
=
weekTime
-
51
;
if
(
hasValue
)
{
if
(
weekTime
>
51
)
{
weekTime
=
weekTime
-
51
;
}
forecastSales
=
forecastSales
.
multiply
(
BigDecimal
.
valueOf
(
weekRateList
.
get
(
weekTime
-
1
)).
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
BigDecimal
.
ONE
:
BigDecimal
.
valueOf
(
weekRateList
.
get
(
weekTime
-
1
)));
}
forecastSales
=
forecastSales
.
multiply
(
BigDecimal
.
valueOf
(
weekRateList
.
get
(
weekTime
-
1
)));
}
else
if
(
14
<=
j
&&
j
<
21
)
{
forecastSales
=
(
BigDecimal
.
valueOf
(
historySalesList
.
get
(
2
+
j
)).
multiply
(
BigDecimal
.
valueOf
(
0.1
))).
add
(
BigDecimal
.
valueOf
(
historySalesList
.
get
(
9
+
j
)).
multiply
(
BigDecimal
.
valueOf
(
0.1
))).
add
(
forecastSalesList
.
get
(
j
-
14
).
multiply
(
BigDecimal
.
valueOf
(
0.3
))).
add
(
forecastSalesList
.
get
(
j
-
7
).
multiply
(
BigDecimal
.
valueOf
(
0.5
)));
if
(
weekTime
>
50
)
{
weekTime
=
weekTime
-
50
;
if
(
hasValue
)
{
if
(
weekTime
>
50
)
{
weekTime
=
weekTime
-
50
;
}
forecastSales
=
forecastSales
.
multiply
(
BigDecimal
.
valueOf
(
weekRateList
.
get
(
weekTime
-
1
)).
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
BigDecimal
.
ONE
:
BigDecimal
.
valueOf
(
weekRateList
.
get
(
weekTime
-
1
)));
}
forecastSales
=
forecastSales
.
multiply
(
BigDecimal
.
valueOf
(
weekRateList
.
get
(
weekTime
-
1
)));
}
else
if
(
21
<=
j
&&
j
<
27
)
{
forecastSales
=
(
BigDecimal
.
valueOf
(
historySalesList
.
get
(
2
+
j
)).
multiply
(
BigDecimal
.
valueOf
(
0.1
))).
add
(
forecastSalesList
.
get
(
j
-
21
).
multiply
(
BigDecimal
.
valueOf
(
0.1
))).
add
(
forecastSalesList
.
get
(
j
-
14
).
multiply
(
BigDecimal
.
valueOf
(
0.3
))).
add
(
forecastSalesList
.
get
(
j
-
7
).
multiply
(
BigDecimal
.
valueOf
(
0.5
)));
if
(
weekTime
>
49
)
{
weekTime
=
weekTime
-
49
;
if
(
hasValue
)
{
if
(
weekTime
>
49
)
{
weekTime
=
weekTime
-
49
;
}
forecastSales
=
forecastSales
.
multiply
(
BigDecimal
.
valueOf
(
weekRateList
.
get
(
weekTime
-
1
)).
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
BigDecimal
.
ONE
:
BigDecimal
.
valueOf
(
weekRateList
.
get
(
weekTime
-
1
)));
}
forecastSales
=
forecastSales
.
multiply
(
BigDecimal
.
valueOf
(
weekRateList
.
get
(
weekTime
-
1
)));
}
else
if
(
27
<=
j
&&
j
<
autoForecastDay
)
{
forecastSales
=
(
forecastSalesList
.
get
(
j
-
27
).
multiply
(
BigDecimal
.
valueOf
(
0.1
))).
add
(
forecastSalesList
.
get
(
j
-
21
).
multiply
(
BigDecimal
.
valueOf
(
0.1
))).
add
(
forecastSalesList
.
get
(
j
-
14
).
multiply
(
BigDecimal
.
valueOf
(
0.3
))).
add
(
forecastSalesList
.
get
(
j
-
7
).
multiply
(
BigDecimal
.
valueOf
(
0.5
)));
if
(
weekTime
>
48
)
{
weekTime
=
weekTime
-
48
;
if
(
hasValue
)
{
if
(
weekTime
>
48
)
{
weekTime
=
weekTime
-
48
;
}
forecastSales
=
forecastSales
.
multiply
(
BigDecimal
.
valueOf
(
weekRateList
.
get
(
weekTime
-
1
)).
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
BigDecimal
.
ONE
:
BigDecimal
.
valueOf
(
weekRateList
.
get
(
weekTime
-
1
)));
}
forecastSales
=
forecastSales
.
multiply
(
BigDecimal
.
valueOf
(
weekRateList
.
get
(
weekTime
-
1
)));
}
forecastSalesList
.
set
(
j
,
forecastSales
.
compareTo
(
salesUpperLimit
)
==
1
?
salesUpperLimit
:
forecastSales
);
}
...
...
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