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
7df359f8
Commit
7df359f8
authored
Sep 24, 2019
by
yinyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
采购特例计算:广州-03仓,赵美聪-日均加权*备货天数-库存-广州-01仓库存-广州-01仓在途
parent
aeedc5bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
3 deletions
+36
-3
AutoTurnoverJob.java
...over/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
+36
-3
No files found.
data-show/show-auto-turnover/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
View file @
7df359f8
...
...
@@ -411,7 +411,7 @@ public class AutoTurnoverJob extends PointJob {
* 获取采购建议-普通仓库
* 实际缺货 + 总销量 - 总预计入库 + (安全库存 - 预测库存) + 周转天的销量
*/
inventoryAvailableDays
=
commonAdvise
(
turnoverSku
,
warehouseCode
,
hasMonitorFluctuation
,
forecastFluctuationList
,
recordTime
,
dcAutoTurnover
,
turnoverDays
,
autoForecastDay
,
forecastInventoryList
,
forecastInboundList
,
forecastSalesList
,
forecastShortSupplyList
,
forecastPurchaseAdvisedList
,
moqPurchaseAdvisedList
,
realInventory
,
totalSafeInventory
,
outStock
,
inventoryAvailableDays
,
totalSales
,
totalInbound
,
moqDecimal
,
saveDaysMap
);
inventoryAvailableDays
=
commonAdvise
(
turnoverSku
,
bailunSku
,
warehouseCode
,
hasMonitorFluctuation
,
forecastFluctuationList
,
recordTime
,
dcAutoTurnover
,
turnoverDays
,
autoForecastDay
,
forecastInventoryList
,
forecastInboundList
,
forecastSalesList
,
forecastShortSupplyList
,
forecastPurchaseAdvisedList
,
moqPurchaseAdvisedList
,
realInventory
,
totalSafeInventory
,
outStock
,
inventoryAvailableDays
,
totalSales
,
totalInbound
,
moqDecimal
,
saveDaysMap
);
}
/*
...
...
@@ -1477,7 +1477,7 @@ public class AutoTurnoverJob extends PointJob {
forecastFluctuationList
.
add
(
forecastFluctuation
);
}
private
Integer
commonAdvise
(
DcBaseSku
turnoverSku
,
String
warehouseCode
,
boolean
hasMonitorFluctuation
,
List
<
DcAutoForecastFluctuation
>
forecastFluctuationList
,
LocalDate
private
Integer
commonAdvise
(
DcBaseSku
turnoverSku
,
String
bailunSku
,
String
warehouseCode
,
boolean
hasMonitorFluctuation
,
List
<
DcAutoForecastFluctuation
>
forecastFluctuationList
,
LocalDate
recordTime
,
DcAutoTurnover
dcAutoTurnover
,
Integer
turnoverDays
,
Integer
autoForecastDay
,
List
<
BigDecimal
>
forecastInventoryList
,
List
<
Integer
>
forecastInboundList
,
List
<
BigDecimal
>
forecastSalesList
,
List
<
BigDecimal
>
forecastShortSupplyList
,
List
<
BigDecimal
>
forecastPurchaseAdvisedList
,
List
<
BigDecimal
>
moqPurchaseAdvisedList
,
Integer
realInventory
,
BigDecimal
totalSafeInventory
,
Integer
outStock
,
Integer
inventoryAvailableDays
,
BigDecimal
...
...
@@ -1539,7 +1539,7 @@ public class AutoTurnoverJob extends PointJob {
BigDecimal
totalAdvised
=
BigDecimal
.
ZERO
;
Boolean
firstAdvice
=
true
;
if
(
j
==
turnoverDays
)
{
if
(
warehouseCode
.
equals
(
Constant
.
WAREHOUSE_JIT
)
&&
(
turnoverSku
.
getBuyerName
().
equals
(
Constant
.
BUYER_JIT_1
)
||
turnoverSku
.
getBuyerName
().
equals
(
Constant
.
BUYER_JIT_2
))
||
(
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
)))
{
BigDecimal
saveDays
=
saveDaysMap
.
get
(
"saveDays"
);
totalSales
=
dcAutoTurnover
.
getDailyWeightedSales
().
multiply
(
BigDecimal
.
valueOf
(
turnoverDays
));
dcAutoTurnover
.
setTurnoverSales
(
totalSales
);
...
...
@@ -1556,6 +1556,39 @@ public class AutoTurnoverJob extends PointJob {
.
add
(
BigDecimal
.
valueOf
(
outStock
.
longValue
()));
//今天的实际缺货
firstAdvice
=
false
;
}
}
else
if
(
warehouseCode
.
equals
(
Constant
.
WAREHOUSE_JIT1
)
&&
(
turnoverSku
.
getBuyerName
().
equals
(
Constant
.
BUTER_JIT_5
)))
{
DcBaseStockMapper
dcBaseStockMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseStockMapper
.
class
);
DcBaseStock
dcBaseStock
=
dcBaseStockMapper
.
selectOneByExample
(
DcBaseStockExample
.
newAndCreateCriteria
().
andBailunSkuEqualTo
(
bailunSku
).
andWarehouseCodeEqualTo
(
Constant
.
WAREHOUSE_JIT
).
example
());
Integer
purchase
=
0
;
//采购在途
Integer
transfer
=
0
;
//调拨在途
Integer
outStock01
=
0
;
//缺货数
DcMidTransit
dcMidTransit
=
null
;
try
{
DcMidTransitMapper
midTransitMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcMidTransitMapper
.
class
);
dcMidTransit
=
midTransitMapper
.
selectOneByExample
(
DcMidTransitExample
.
newAndCreateCriteria
().
andBailunSkuEqualTo
(
bailunSku
).
andWarehouseCodeEqualTo
(
Constant
.
WAREHOUSE_JIT
).
example
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"Mybatis操作DB失败"
,
e
);
}
finally
{
SessionUtil
.
closeSession
();
}
if
(
dcMidTransit
!=
null
)
{
purchase
=
dcMidTransit
.
getQuantityPurchase
();
transfer
=
dcMidTransit
.
getQuantityTransfer
();
outStock01
=
dcMidTransit
.
getQuantityOutStock
();
}
BigDecimal
saveDays
=
saveDaysMap
.
get
(
"saveDays"
);
totalSales
=
dcAutoTurnover
.
getDailyWeightedSales
().
multiply
(
BigDecimal
.
valueOf
(
turnoverDays
));
dcAutoTurnover
.
setTurnoverSales
(
totalSales
);
BigDecimal
forecastInbound
=
BigDecimal
.
ZERO
;
if
(
saveDays
!=
null
)
{
totalSales
=
dcAutoTurnover
.
getDailyWeightedSales
().
multiply
(
saveDays
);
totalAdvised
=
totalSales
.
subtract
(
outStock
>
0
?
BigDecimal
.
ZERO
:
BigDecimal
.
valueOf
(
realInventory
.
longValue
()))
//真实库存,如果缺货就不减
.
subtract
(
outStock01
>
0
?
BigDecimal
.
ZERO
:
((
dcBaseStock
!=
null
&&
dcBaseStock
.
getUsableStock
()
!=
null
)
?
BigDecimal
.
valueOf
(
dcBaseStock
.
getUsableStock
())
:
BigDecimal
.
ZERO
))
//广州014仓库存
.
subtract
(
BigDecimal
.
valueOf
(
purchase
+
transfer
));
//广州001仓在途数
firstAdvice
=
false
;
}
}
else
{
dcAutoTurnover
.
setTurnoverSales
(
totalSales
);
}
...
...
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