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
1e08387d
Commit
1e08387d
authored
May 07, 2021
by
liyanlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
47ab580d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
AutoTurnoverJob.java
...over/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
+19
-5
No files found.
data-show/show-auto-turnover/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
View file @
1e08387d
...
@@ -1224,8 +1224,8 @@ public class AutoTurnoverJob extends PointJob {
...
@@ -1224,8 +1224,8 @@ public class AutoTurnoverJob extends PointJob {
}
}
//拿调拨单流水
//拿调拨单流水
原逻辑 if(transfer > 0)
if
(
transfer
>
0
)
{
if
(
false
)
{
List
<
DcBaseTransferVerify
>
dcBaseTransferVerifyList
;
List
<
DcBaseTransferVerify
>
dcBaseTransferVerifyList
;
try
{
try
{
DcBaseTransferVerifyMapper
dcBaseTransferVerifyMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseTransferVerifyMapper
.
class
);
DcBaseTransferVerifyMapper
dcBaseTransferVerifyMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseTransferVerifyMapper
.
class
);
...
@@ -1292,12 +1292,23 @@ public class AutoTurnoverJob extends PointJob {
...
@@ -1292,12 +1292,23 @@ public class AutoTurnoverJob extends PointJob {
.
example
());
.
example
());
Map
<
LocalDate
,
List
<
DcBaseTransExpectarrivaltime
>>
map
=
dcBaseTransExpectarrivaltimeList
.
stream
().
collect
(
Collectors
.
groupingBy
(
item
->
item
.
getExpectarrivaltime
().
toLocalDate
()));
Map
<
LocalDate
,
List
<
DcBaseTransExpectarrivaltime
>>
map
=
dcBaseTransExpectarrivaltimeList
.
stream
().
collect
(
Collectors
.
groupingBy
(
item
->
item
.
getExpectarrivaltime
().
toLocalDate
()));
map
.
forEach
((
localDate
,
dcBaseTransExpectarrivaltimes
)
->
{
map
.
forEach
((
localDate
,
dcBaseTransExpectarrivaltimes
)
->
{
int
interval
=
between
(
recordTime
,
localDate
).
getDays
();
int
interval
=
between
(
recordTime
,
localDate
).
getDays
();
int
index
=
Math
.
max
(
interval
,
0
);
int
index
=
Math
.
max
(
interval
,
0
);
forecastInboundRelationList
.
set
(
index
,
forecastInboundRelationList
.
get
(
index
)
+
"*"
+
dcBaseTransExpectarrivaltimes
.
stream
().
map
(
dcBaseTransExpectarrivaltime
->
Constant
.
TRANSFER_SIGN
+
dcBaseTransExpectarrivaltime
.
getTransferOrderId
()
+
"_"
+
dcBaseTransExpectarrivaltime
.
getCount
()).
collect
(
Collectors
.
joining
(
"*"
)));
forecastInboundRelationList
.
set
(
index
,
forecastTransferInboundList
.
set
(
index
,
forecastTransferInboundList
.
get
(
index
)
+
dcBaseTransExpectarrivaltimes
.
stream
().
mapToInt
(
DcBaseTransExpectarrivaltime:
:
getCount
).
sum
());
forecastInboundRelationList
.
get
(
index
)
+
"*"
+
dcBaseTransExpectarrivaltimes
.
stream
()
.
map
(
dcBaseTransExpectarrivaltime
->
Constant
.
TRANSFER_SIGN
+
dcBaseTransExpectarrivaltime
.
getTransferOrderId
()
+
"_"
+
dcBaseTransExpectarrivaltime
.
getCount
()).
collect
(
Collectors
.
joining
(
"*"
)));
forecastTransferInboundList
.
set
(
index
,
forecastTransferInboundList
.
get
(
index
)
+
dcBaseTransExpectarrivaltimes
.
stream
()
.
mapToInt
(
DcBaseTransExpectarrivaltime:
:
getCount
)
.
sum
());
forecastInboundList
.
set
(
index
,
forecastPurchaseInboundList
.
get
(
index
)
+
forecastTransferInboundList
.
get
(
index
));
forecastInboundList
.
set
(
index
,
forecastPurchaseInboundList
.
get
(
index
)
+
forecastTransferInboundList
.
get
(
index
));
});
});
...
@@ -1468,7 +1479,9 @@ public class AutoTurnoverJob extends PointJob {
...
@@ -1468,7 +1479,9 @@ public class AutoTurnoverJob extends PointJob {
*/
*/
DcAutoStockUpRangeMapper
dcAutoStockUpRangeMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcAutoStockUpRangeMapper
.
class
);
DcAutoStockUpRangeMapper
dcAutoStockUpRangeMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcAutoStockUpRangeMapper
.
class
);
DcAutoStockUpRange
dcAutoStockUpRange
=
dcAutoStockUpRangeMapper
.
selectOneByExample
(
DcAutoStockUpRangeExample
.
newAndCreateCriteria
().
andBailunSkuEqualTo
(
bailunSku
).
andWarehouseCodeEqualTo
(
warehouseCode
).
example
());
DcAutoStockUpRange
dcAutoStockUpRange
=
dcAutoStockUpRangeMapper
.
selectOneByExample
(
DcAutoStockUpRangeExample
.
newAndCreateCriteria
().
andBailunSkuEqualTo
(
bailunSku
).
andWarehouseCodeEqualTo
(
warehouseCode
).
example
());
if
((
warehouseCode
.
equals
(
Constant
.
WAREHOUSE_JIT
)
&&
(
turnoverSku
.
getBuyerName
().
equals
(
Constant
.
BUYER_JIT_1
)
||
turnoverSku
.
getBuyerName
().
equals
(
Constant
.
BUYER_JIT_2
)
||
turnoverSku
.
getBuyerName
().
equals
(
Constant
.
BUYER_JIT_3
)))
||
dcAutoStockUpRange
!=
null
||
(
warehouseCode
.
equals
(
Constant
.
WAREHOUSE_JIT1
)
&&
(
turnoverSku
.
getBuyerName
().
equals
(
Constant
.
BUTER_JIT_5
))))
{
if
((
warehouseCode
.
equals
(
Constant
.
WAREHOUSE_JIT
)
&&
(
turnoverSku
.
getBuyerName
().
equals
(
Constant
.
BUYER_JIT_1
)
||
turnoverSku
.
getBuyerName
().
equals
(
Constant
.
BUYER_JIT_2
)
||
turnoverSku
.
getBuyerName
().
equals
(
Constant
.
BUYER_JIT_3
)))
||
dcAutoStockUpRange
!=
null
||
(
warehouseCode
.
equals
(
Constant
.
WAREHOUSE_JIT1
)
&&
(
turnoverSku
.
getBuyerName
().
equals
(
Constant
.
BUTER_JIT_5
))))
{
List
<
BigDecimal
>
historyThirtySalesList
=
JSON
.
parseObject
(
dcAutoSales
.
getHistorySalesDetails
(),
new
TypeReference
<
List
<
BigDecimal
>>()
{
List
<
BigDecimal
>
historyThirtySalesList
=
JSON
.
parseObject
(
dcAutoSales
.
getHistorySalesDetails
(),
new
TypeReference
<
List
<
BigDecimal
>>()
{
});
});
BigDecimal
weightingAvgSales
=
calculateWeightingAvgSales
(
historyThirtySalesList
);
BigDecimal
weightingAvgSales
=
calculateWeightingAvgSales
(
historyThirtySalesList
);
...
@@ -1537,6 +1550,7 @@ public class AutoTurnoverJob extends PointJob {
...
@@ -1537,6 +1550,7 @@ public class AutoTurnoverJob extends PointJob {
});
});
if
(
dcAutoConfigSafeInventory
!=
null
)
{
if
(
dcAutoConfigSafeInventory
!=
null
)
{
weightingAvgSales
=
calculateWeightingAvgSales
(
dcAutoConfigSafeInventory
.
getWeightingCoefficientSeven
(),
dcAutoConfigSafeInventory
.
getWeightingCoefficientFourteen
(),
dcAutoConfigSafeInventory
.
getWeightingCoefficientThirty
(),
historyThirtySalesList
);
weightingAvgSales
=
calculateWeightingAvgSales
(
dcAutoConfigSafeInventory
.
getWeightingCoefficientSeven
(),
dcAutoConfigSafeInventory
.
getWeightingCoefficientFourteen
(),
dcAutoConfigSafeInventory
.
getWeightingCoefficientThirty
(),
historyThirtySalesList
);
dcAutoTurnover
.
setDailyWeightedSales
(
weightingAvgSales
);
//type11 乘倍数
//type11 乘倍数
weightingAvgSales
=
weightingAvgSales
.
multiply
(
dcAutoConfigSafeInventory
.
getParam
()).
setScale
(
3
,
RoundingMode
.
HALF_EVEN
);
weightingAvgSales
=
weightingAvgSales
.
multiply
(
dcAutoConfigSafeInventory
.
getParam
()).
setScale
(
3
,
RoundingMode
.
HALF_EVEN
);
...
...
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