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
e9d7c0d0
Commit
e9d7c0d0
authored
Feb 25, 2021
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# 更新
parent
bb9d20b9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
3 deletions
+62
-3
QueueConsumerJob.java
...ver/src/main/java/com/bailuntec/job/QueueConsumerJob.java
+4
-0
AutoTurnoverTest.java
...ow/show-auto-turnover/src/test/java/AutoTurnoverTest.java
+3
-3
QueueConsumerJobTest.java
...src/test/java/com/bailuntec/job/QueueConsumerJobTest.java
+55
-0
No files found.
data-show/show-auto-turnover/src/main/java/com/bailuntec/job/QueueConsumerJob.java
View file @
e9d7c0d0
...
@@ -63,10 +63,14 @@ public class QueueConsumerJob implements SimpleJob {
...
@@ -63,10 +63,14 @@ public class QueueConsumerJob implements SimpleJob {
.
example
());
.
example
());
try
{
try
{
autoTurnoverJob
.
autoTurnoverFromStock
(
DateTimeFormatter
.
ofPattern
(
CommonConstant
.
DATE_FORMAT
).
format
(
LocalDate
.
now
()),
dcBaseStock
);
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
.
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
.
autoTurnoverFromStock
(
DateTimeFormatter
.
ofPattern
(
CommonConstant
.
DATE_FORMAT
).
format
(
LocalDate
.
now
()),
dcBaseStock
);
AutoTurnoverJob
.
shardingContextThreadLocal
.
remove
();
AutoTurnoverJob
.
shardingContextThreadLocal
.
set
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
1
,
Constant
.
AIR_HEAD
,
new
HashMap
<>(
16
)),
0
));
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
);
autoTurnoverJob
.
autoTurnoverFromStock
(
DateTimeFormatter
.
ofPattern
(
CommonConstant
.
DATE_FORMAT
).
format
(
LocalDate
.
now
()),
dcBaseStock
);
AutoTurnoverJob
.
shardingContextThreadLocal
.
remove
();
dcBaseQueueMapper
.
deleteByPrimaryKey
(
dcBaseQueue
.
getId
());
dcBaseQueueMapper
.
deleteByPrimaryKey
(
dcBaseQueue
.
getId
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
data-show/show-auto-turnover/src/test/java/AutoTurnoverTest.java
View file @
e9d7c0d0
...
@@ -256,14 +256,14 @@ public class AutoTurnoverTest {
...
@@ -256,14 +256,14 @@ public class AutoTurnoverTest {
//{"bailun_sku":"N-GNS631-7ML","warehouse_code":"BLGZ03"}
//{"bailun_sku":"N-GNS631-7ML","warehouse_code":"BLGZ03"}
//{"bailun_sku":"N-GNS006-7ML","warehouse_code":"BLGZ03"}
@Transactional
@Transactional
@Test
@Test
public
void
testXX2
()
{
public
void
testXX2
()
{
DcBaseStock
dcBaseStock
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseStockMapper
.
class
)
DcBaseStock
dcBaseStock
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseStockMapper
.
class
)
.
selectOneByExample
(
DcBaseStockExample
.
newAndCreateCriteria
()
.
selectOneByExample
(
DcBaseStockExample
.
newAndCreateCriteria
()
.
andBailunSkuEqualTo
(
"
228427301
"
)
.
andBailunSkuEqualTo
(
"
N-GNS006-7ML
"
)
.
andWarehouseCodeEqualTo
(
"BL
FBW01
"
)
.
andWarehouseCodeEqualTo
(
"BL
GZ03
"
)
.
example
());
.
example
());
try
{
try
{
AutoTurnoverJob
autoTurnoverJob
=
new
AutoTurnoverJob
();
AutoTurnoverJob
autoTurnoverJob
=
new
AutoTurnoverJob
();
...
...
data-show/show-auto-turnover/src/test/java/com/bailuntec/job/QueueConsumerJobTest.java
0 → 100644
View file @
e9d7c0d0
package
com
.
bailuntec
.
job
;
import
com.bailuntec.domain.constant.CommonConstant
;
import
com.bailuntec.domain.constant.Constant
;
import
com.bailuntec.domain.entity.DcBaseStock
;
import
com.bailuntec.domain.example.DcBaseStockExample
;
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.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.util.HashMap
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2021/2/25 10:02 上午
*/
public
class
QueueConsumerJobTest
{
@Test
public
void
test
()
{
ShardingContext
shardingContext
=
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
1
,
Constant
.
AIR_HEAD
,
new
HashMap
<>()),
0
);
AutoTurnoverJob
.
shardingContextThreadLocal
.
set
(
shardingContext
);
QueueConsumerJob
.
BaseQueueMessage
baseQueueMessage
=
new
QueueConsumerJob
.
BaseQueueMessage
();
baseQueueMessage
.
setBailunSku
(
"228427301"
);
baseQueueMessage
.
setWarehouseCode
(
"BLFBW01"
);
DcBaseStockMapper
dcBaseStockMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseStockMapper
.
class
);
AutoTurnoverJob
autoTurnoverJob
=
new
AutoTurnoverJob
();
DcBaseStock
dcBaseStock
=
dcBaseStockMapper
.
selectOneByExample
(
DcBaseStockExample
.
newAndCreateCriteria
()
.
andBailunSkuEqualTo
(
baseQueueMessage
.
getBailunSku
())
.
andWarehouseCodeEqualTo
(
baseQueueMessage
.
getWarehouseCode
())
.
example
());
// 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.remove();
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
);
AutoTurnoverJob
.
shardingContextThreadLocal
.
remove
();
}
}
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