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
bltdc
dc-java
Commits
4fe27d36
Commit
4fe27d36
authored
Apr 03, 2019
by
wutong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动周转若平均交期为负, 则不采用.
parent
c166ae9e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
AutoTurnoverJob.java
...over/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
+4
-7
No files found.
data-show/show-auto-turnover/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
View file @
4fe27d36
...
@@ -81,7 +81,7 @@ public class AutoTurnoverJob extends PointJob {
...
@@ -81,7 +81,7 @@ public class AutoTurnoverJob extends PointJob {
DcAutoException
dcAutoException
=
new
DcAutoException
(
dcBaseStock
.
getBailunSku
(),
dcBaseStock
.
getWarehouseCode
(),
e
.
toString
());
DcAutoException
dcAutoException
=
new
DcAutoException
(
dcBaseStock
.
getBailunSku
(),
dcBaseStock
.
getWarehouseCode
(),
e
.
toString
());
dcAutoExceptionMapper
.
insertSelective
(
dcAutoException
);
dcAutoExceptionMapper
.
insertSelective
(
dcAutoException
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
log
.
error
(
"保存错误SKU失败,sku="
+
dcBaseStock
.
getBailunSku
()
+
",仓库="
+
dcBaseStock
.
getWarehouseCode
());
;
log
.
error
(
"保存错误SKU失败,sku="
+
dcBaseStock
.
getBailunSku
()
+
",仓库="
+
dcBaseStock
.
getWarehouseCode
());
}
finally
{
}
finally
{
SessionUtil
.
closeSession
();
SessionUtil
.
closeSession
();
}
}
...
@@ -260,9 +260,7 @@ public class AutoTurnoverJob extends PointJob {
...
@@ -260,9 +260,7 @@ public class AutoTurnoverJob extends PointJob {
Integer
purchase
=
0
;
//采购在途
Integer
purchase
=
0
;
//采购在途
Integer
transfer
=
0
;
//调拨在途
Integer
transfer
=
0
;
//调拨在途
//通过SKU拿到MOQ和缺货数
Integer
outStock
=
0
;
//缺货数
Integer
outStock
=
0
;
// Integer outStock = getOutStock(bailunSku, warehouseCode);
DcMidTransit
dcMidTransit
=
null
;
DcMidTransit
dcMidTransit
=
null
;
try
{
try
{
DcMidTransitMapper
midTransitMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcMidTransitMapper
.
class
);
DcMidTransitMapper
midTransitMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcMidTransitMapper
.
class
);
...
@@ -300,14 +298,13 @@ public class AutoTurnoverJob extends PointJob {
...
@@ -300,14 +298,13 @@ public class AutoTurnoverJob extends PointJob {
BigDecimal
safeInventory
=
calculateSafeInventory
(
bailunSku
,
warehouseCode
,
bailunFirstLevelCatagoryId
,
dcAutoSales
,
JSON
.
toJSONString
(
forecastSalesList
));
BigDecimal
safeInventory
=
calculateSafeInventory
(
bailunSku
,
warehouseCode
,
bailunFirstLevelCatagoryId
,
dcAutoSales
,
JSON
.
toJSONString
(
forecastSalesList
));
//平均逾期 = 平均交期(dc_average_purchase) - 供应商交期(根据仓库判断, 非国内就取调拨交期) , 小于0的取0
//平均逾期 = 平均交期(dc_average_purchase) - 供应商交期(根据仓库判断, 非国内就取调拨交期) , 小于0的取0
BigDecimal
overdue
=
BigDecimal
.
ZERO
;
BigDecimal
overdue
=
BigDecimal
.
ZERO
;
if
(
dcAveragePurchase
!=
null
)
{
if
(
dcAveragePurchase
!=
null
&&
dcAveragePurchase
.
getDeliveryDays
()
>=
0
)
{
overdue
=
BigDecimal
.
valueOf
((
dcAveragePurchase
.
getDeliveryDays
().
longValue
()
-
dcAutoTurnover
.
getSupplierDelivery
().
longValue
()));
overdue
=
BigDecimal
.
valueOf
((
dcAveragePurchase
.
getDeliveryDays
().
longValue
()
-
dcAutoTurnover
.
getSupplierDelivery
().
longValue
()));
overdue
=
overdue
.
compareTo
(
BigDecimal
.
ZERO
)
==
1
?
overdue
:
BigDecimal
.
ZERO
;
overdue
=
overdue
.
compareTo
(
BigDecimal
.
ZERO
)
==
1
?
overdue
:
BigDecimal
.
ZERO
;
}
}
//安全库存 * 平均逾期
//安全库存 * 平均逾期
BigDecimal
totalSafeInventory
=
safeInventory
.
multiply
((
overdue
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
BigDecimal
.
ONE
:
overdue
));
BigDecimal
totalSafeInventory
=
safeInventory
.
multiply
((
overdue
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
BigDecimal
.
ONE
:
overdue
));
Integer
moq
=
turnoverSku
.
getMoq
();
Integer
moq
=
turnoverSku
.
getMoq
();
/*
/*
* 预测库存 = 前一日库存 - 前一日销量(没有考虑实际缺货)
* 预测库存 = 前一日库存 - 前一日销量(没有考虑实际缺货)
...
@@ -589,7 +586,7 @@ public class AutoTurnoverJob extends PointJob {
...
@@ -589,7 +586,7 @@ public class AutoTurnoverJob extends PointJob {
* 先取dc_average_purchase,如果平均交期没有
* 先取dc_average_purchase,如果平均交期没有
* 再去SKUMS取, 取SKUMS数据的时候如果是国内仓,就还取dc_base_sku原来那个字段,否则就要取dc_base_sku原新字段(调拨交期)
* 再去SKUMS取, 取SKUMS数据的时候如果是国内仓,就还取dc_base_sku原来那个字段,否则就要取dc_base_sku原新字段(调拨交期)
*/
*/
Integer
turnoverSupplierDelivery
=
dcAveragePurchase
!=
null
?
dcAveragePurchase
.
getDeliveryDays
()
:
-
1
;
Integer
turnoverSupplierDelivery
=
dcAveragePurchase
!=
null
&&
dcAveragePurchase
.
getDeliveryDays
()
>=
0
?
dcAveragePurchase
.
getDeliveryDays
()
:
-
1
;
if
(
turnoverSupplierDelivery
==
null
||
turnoverSupplierDelivery
.
equals
(-
1
))
{
if
(
turnoverSupplierDelivery
==
null
||
turnoverSupplierDelivery
.
equals
(-
1
))
{
turnoverSupplierDelivery
=
turnoverSku
.
getSupplierDelivery
();
turnoverSupplierDelivery
=
turnoverSku
.
getSupplierDelivery
();
//如果是国内仓,就还取原来那个字段,否则就要取新字段(调拨交期)
//如果是国内仓,就还取原来那个字段,否则就要取新字段(调拨交期)
...
...
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