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
2e2e86d8
Commit
2e2e86d8
authored
Oct 29, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2413092d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
28 deletions
+17
-28
DcAutoSalesMapper.xml
.../src/main/java/com/bailuntec/mapper/DcAutoSalesMapper.xml
+2
-4
Application.java
...uto-turnover/src/main/java/com/bailuntec/Application.java
+3
-10
AutoTurnoverJob.java
...over/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
+2
-2
AutoSalesServiceImpl.java
...java/com/bailuntec/service/impl/AutoSalesServiceImpl.java
+2
-2
job.properties
...show/show-auto-turnover/src/main/resources/job.properties
+2
-2
AutoTurnoverTest.java
...ow/show-auto-turnover/src/test/java/AutoTurnoverTest.java
+6
-8
No files found.
data-common/src/main/java/com/bailuntec/mapper/DcAutoSalesMapper.xml
View file @
2e2e86d8
...
...
@@ -2426,8 +2426,7 @@
twenty_fourthday_sales,
twenty_threeday_sales,
twenty_twoday_sales,
twenty_oneday_sales
,
twenty_oneday_sales,
twentyday_sales,
nineteenday_sales,
eighteenday_sales,
...
...
@@ -2437,8 +2436,7 @@
fourteenday_sales,
thridteenday_sales,
twelveday_sales,
elevenday_sales
,
elevenday_sales,
tenday_sales,
nineday_sales,
eightday_sales,
...
...
data-show/show-auto-turnover/src/main/java/com/bailuntec/Application.java
View file @
2e2e86d8
...
...
@@ -2,7 +2,6 @@ package com.bailuntec;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.bailuntec.job.AutoTurnoverJob
;
import
com.bailuntec.listener.AutoTurnoverJobListener
;
import
com.bailuntec.utils.PropertiesUtil
;
import
com.dangdang.ddframe.job.config.JobCoreConfiguration
;
import
com.dangdang.ddframe.job.config.simple.SimpleJobConfiguration
;
...
...
@@ -15,9 +14,6 @@ import com.dangdang.ddframe.job.reg.zookeeper.ZookeeperConfiguration;
import
com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter
;
import
lombok.extern.slf4j.Slf4j
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.context.annotation.ComponentScan
;
import
javax.sql.DataSource
;
...
...
@@ -36,18 +32,15 @@ public class Application {
//
new
JobScheduler
(
createRegistryCenter
(),
createJobConfigurationNormal
(),
createJobEventConfiguration
(),
new
AutoTurnoverJobListener
()).
init
();
createJobEventConfiguration
()).
init
();
new
JobScheduler
(
createRegistryCenter
(),
createJobConfigurationIncrement
(),
createJobEventConfiguration
(),
new
AutoTurnoverJobListener
()).
init
();
createJobEventConfiguration
()).
init
();
new
JobScheduler
(
createRegistryCenter
(),
createJobConfigurationNeNormal
(),
createJobEventConfiguration
(),
new
AutoTurnoverJobListener
()).
init
();
createJobEventConfiguration
()).
init
();
log
.
info
(
"start success"
);
...
...
data-show/show-auto-turnover/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
View file @
2e2e86d8
...
...
@@ -348,7 +348,7 @@ public class AutoTurnoverJob extends PointJob {
// 获取调拨头程 + 调拨打包 + 海外仓入库天数 的配置
DcAutoConfigDelivery
dcAutoConfigDelivery
=
getDcAutoConfigDelivery
(
bailunSku
,
warehouseCode
,
dcBaseWarehouse
);
//获取周转天数计算配置, 数据来源于.net同事计算的均值
Integer
turnoverDays
=
getTurnoverDelivery
(
turnoverSku
,
dcBaseWarehouse
,
dcAutoTurnover
,
dcAutoConfigDelivery
,
dcAveragePurchase
,
dcAverageWarehouse
);
int
turnoverDays
=
getTurnoverDelivery
(
turnoverSku
,
dcBaseWarehouse
,
dcAutoTurnover
,
dcAutoConfigDelivery
,
dcAveragePurchase
,
dcAverageWarehouse
);
if
(
paymentBeforeDelivery
!=
null
)
{
turnoverDays
+=
paymentBeforeDelivery
;
}
...
...
@@ -757,7 +757,7 @@ public class AutoTurnoverJob extends PointJob {
dcAutoTurnover
.
setQuantityPurchase
(
purchase
);
dcAutoTurnover
.
setQuantityTransfer
(
transfer
);
dcAutoTurnover
.
setQuantityOutStock
(
outStock
);
dcAutoTurnover
.
setStatus
(
forecastShortSupplyList
.
get
(
2
*
turnoverDays
.
intValue
()
).
intValue
()
>
0
?
1
:
0
);
dcAutoTurnover
.
setStatus
(
forecastShortSupplyList
.
get
(
2
*
(
int
)
turnoverDays
).
intValue
()
>
0
?
1
:
0
);
dcAutoTurnover
.
setTurnoverDays
(
turnoverDays
);
dcAutoTurnover
.
setQuantitySafeInventory
(
totalSafeInventory
);
dcAutoTurnover
.
setHqType
(
dcBaseWarehouse
.
getHqType
());
...
...
data-show/show-auto-turnover/src/main/java/com/bailuntec/service/impl/AutoSalesServiceImpl.java
View file @
2e2e86d8
...
...
@@ -37,10 +37,10 @@ public class AutoSalesServiceImpl implements AutoSalesService {
if
(
"0"
.
equals
(
historySalesArray
[
i
]))
{
hasZero
=
true
;
}
if
(
iDaySales
.
compareTo
(
maxSales
)
==
1
)
{
if
(
iDaySales
.
compareTo
(
maxSales
)
>
0
)
{
maxSales
=
iDaySales
;
}
if
(
iDaySales
.
compareTo
(
minSales
)
==
-
1
)
{
if
(
iDaySales
.
compareTo
(
minSales
)
<
0
)
{
minSales
=
iDaySales
;
}
}
...
...
data-show/show-auto-turnover/src/main/resources/job.properties
View file @
2e2e86d8
...
...
@@ -10,8 +10,8 @@ EVENT_RDB_STORAGE_PASSWORD=#7kfnymAM$Y9-Ntf
ZOOKEEPER_SERVER=172.31.255.120:2181
NAME_SPACE
=
data-center
JOB_NAME
=
show-auto-turnover
JOB_CRON
=
0
0 3
* * ?
JOB_NAME
=
show-auto-turnover
1
JOB_CRON
=
0
40 17
* * ?
SHARDING_TOTAL_COUNT
=
8
...
...
data-show/show-auto-turnover/src/test/java/AutoTurnoverTest.java
View file @
2e2e86d8
...
...
@@ -6,14 +6,12 @@ import com.bailuntec.domain.example.DcBaseStockExample;
import
com.bailuntec.excel.DcAutoTurnoverExcel
;
import
com.bailuntec.excel.ExcelListener
;
import
com.bailuntec.job.AutoTurnoverJob
;
import
com.bailuntec.listener.AutoTurnoverJobListener
;
import
com.bailuntec.mapper.DcBaseStockMapper
;
import
com.bailuntec.utils.SessionUtil
;
import
com.dangdang.ddframe.job.api.ShardingContext
;
import
com.dangdang.ddframe.job.executor.ShardingContexts
;
import
org.junit.jupiter.api.Test
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.Period
;
...
...
@@ -112,11 +110,11 @@ public class AutoTurnoverTest {
autoTurnoverJob
.
executeJob
(
shardingContext
,
jobPointLog
);
}
@Test
public
void
test5
()
{
AutoTurnoverJobListener
autoTurnoverJobListener
=
new
AutoTurnoverJobListener
();
autoTurnoverJobListener
.
afterJobExecuted
(
null
);
}
//
@Test
//
public void test5() {
//
AutoTurnoverJobListener autoTurnoverJobListener = new AutoTurnoverJobListener();
//
autoTurnoverJobListener.afterJobExecuted(null);
//
}
@Test
public
void
test55
()
{
...
...
@@ -158,7 +156,7 @@ public class AutoTurnoverTest {
@Test
public
void
testBigDecimal
()
{
DcBaseStock
dcBaseStock
=
new
DcBaseStock
();
DcBaseStock
dcBaseStock
=
new
DcBaseStock
();
dcBaseStock
.
setInWarehouse
(
1
);
this
.
add
(
dcBaseStock
);
System
.
out
.
println
(
dcBaseStock
.
getInWarehouse
());
...
...
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