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
bb9d20b9
Commit
bb9d20b9
authored
Feb 25, 2021
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# 更新
parent
6e9eec41
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
DcBaseStockMapper.xml
.../src/main/java/com/bailuntec/mapper/DcBaseStockMapper.xml
+4
-4
QueueConsumerJob.java
...ver/src/main/java/com/bailuntec/job/QueueConsumerJob.java
+8
-0
AutoTurnoverTest.java
...ow/show-auto-turnover/src/test/java/AutoTurnoverTest.java
+4
-3
No files found.
data-common/src/main/java/com/bailuntec/mapper/DcBaseStockMapper.xml
View file @
bb9d20b9
...
...
@@ -1473,7 +1473,7 @@
select t1.*
from dc_base_stock t1
left join dc_base_warehouse t2 on t1.warehouse_code = t2.warehouse_code
where t2.hq_type
= '海外
仓'
where t2.hq_type
!= '国内
仓'
and t1.id % #{shardingContext.shardingTotalCount} = #{shardingContext.shardingItem}
limit #{pageStart}, #{pageOffset}
</select>
...
...
@@ -1482,7 +1482,7 @@
select t1.*
from dc_base_stock t1
left join dc_base_warehouse t2 on t1.warehouse_code = t2.warehouse_code
where t2.hq_type
= '海外
仓'
where t2.hq_type
!= '国内
仓'
and t1.id % #{shardingContext.shardingTotalCount} = #{shardingContext.shardingItem}
limit #{pageStart}, #{pageOffset}
</select>
...
...
@@ -1491,7 +1491,7 @@
select count(t1.id)
from dc_base_stock t1
left join dc_base_warehouse t2 on t1.warehouse_code = t2.warehouse_code
where t2.hq_type
= '海外
仓'
where t2.hq_type
!= '国内
仓'
and t1.id % #{shardingContext.shardingTotalCount} = #{shardingContext.shardingItem}
</select>
...
...
@@ -1499,7 +1499,7 @@
select count(t1.id)
from dc_base_stock t1
left join dc_base_warehouse t2 on t1.warehouse_code = t2.warehouse_code
where t2.hq_type
= '海外
仓'
where t2.hq_type
!= '国内
仓'
and t1.id % #{shardingContext.shardingTotalCount} = #{shardingContext.shardingItem}
</select>
...
...
data-show/show-auto-turnover/src/main/java/com/bailuntec/job/QueueConsumerJob.java
View file @
bb9d20b9
...
...
@@ -3,6 +3,7 @@ package com.bailuntec.job;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.bailuntec.domain.constant.CommonConstant
;
import
com.bailuntec.domain.constant.Constant
;
import
com.bailuntec.domain.entity.DcBaseQueue
;
import
com.bailuntec.domain.entity.DcBaseStock
;
import
com.bailuntec.domain.example.DcBaseStockExample
;
...
...
@@ -11,6 +12,7 @@ import com.bailuntec.mapper.DcBaseStockMapper;
import
com.bailuntec.utils.SessionUtil
;
import
com.dangdang.ddframe.job.api.ShardingContext
;
import
com.dangdang.ddframe.job.api.simple.SimpleJob
;
import
com.dangdang.ddframe.job.executor.ShardingContexts
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.ibatis.session.SqlSession
;
...
...
@@ -18,6 +20,7 @@ import org.apache.ibatis.session.SqlSession;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
/**
...
...
@@ -60,6 +63,11 @@ public class QueueConsumerJob implements SimpleJob {
.
example
());
try
{
autoTurnoverJob
.
autoTurnoverFromStock
(
DateTimeFormatter
.
ofPattern
(
CommonConstant
.
DATE_FORMAT
).
format
(
LocalDate
.
now
()),
dcBaseStock
);
AutoTurnoverJob
.
shardingContextThreadLocal
.
set
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
1
,
Constant
.
OCEAN_HEAD
,
new
HashMap
<>(
16
)),
0
));
autoTurnoverJob
.
autoTurnoverFromStock
(
DateTimeFormatter
.
ofPattern
(
CommonConstant
.
DATE_FORMAT
).
format
(
LocalDate
.
now
()),
dcBaseStock
);
AutoTurnoverJob
.
shardingContextThreadLocal
.
set
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
1
,
Constant
.
AIR_HEAD
,
new
HashMap
<>(
16
)),
0
));
autoTurnoverJob
.
autoTurnoverFromStock
(
DateTimeFormatter
.
ofPattern
(
CommonConstant
.
DATE_FORMAT
).
format
(
LocalDate
.
now
()),
dcBaseStock
);
dcBaseQueueMapper
.
deleteByPrimaryKey
(
dcBaseQueue
.
getId
());
}
catch
(
Exception
e
)
{
try
{
...
...
data-show/show-auto-turnover/src/test/java/AutoTurnoverTest.java
View file @
bb9d20b9
...
...
@@ -4,6 +4,7 @@ import com.alibaba.excel.context.AnalysisContext;
import
com.alibaba.excel.event.AnalysisEventListener
;
import
com.alibaba.fastjson.JSON
;
import
com.bailuntec.domain.constant.CommonConstant
;
import
com.bailuntec.domain.constant.Constant
;
import
com.bailuntec.domain.entity.DcBaseStock
;
import
com.bailuntec.domain.entity.JobPointLog
;
import
com.bailuntec.domain.entity.SalesDayConfig
;
...
...
@@ -261,14 +262,14 @@ public class AutoTurnoverTest {
public
void
testXX2
()
{
DcBaseStock
dcBaseStock
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseStockMapper
.
class
)
.
selectOneByExample
(
DcBaseStockExample
.
newAndCreateCriteria
()
.
andBailunSkuEqualTo
(
"
3395609119
"
)
.
andWarehouseCodeEqualTo
(
"
GZBLWH
"
)
.
andBailunSkuEqualTo
(
"
228427301
"
)
.
andWarehouseCodeEqualTo
(
"
BLFBW01
"
)
.
example
());
try
{
AutoTurnoverJob
autoTurnoverJob
=
new
AutoTurnoverJob
();
long
time
=
System
.
currentTimeMillis
();
log
.
info
(
Long
.
toString
(
time
));
AutoTurnoverJob
.
shardingContextThreadLocal
.
set
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
8
,
"NORMAL"
,
new
HashMap
<>()),
0
));
AutoTurnoverJob
.
shardingContextThreadLocal
.
set
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
8
,
Constant
.
AIR_HEAD
,
new
HashMap
<>()),
0
));
autoTurnoverJob
.
autoTurnoverFromStock
(
DateTimeFormatter
.
ofPattern
(
CommonConstant
.
DATE_FORMAT
).
format
(
LocalDate
.
now
()),
dcBaseStock
);
log
.
info
(
String
.
valueOf
((
System
.
currentTimeMillis
()
-
time
)));
...
...
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