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
62e730c3
Commit
62e730c3
authored
Mar 09, 2021
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# 更新
parent
5998d989
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
11 deletions
+48
-11
DcBaseStockMapper.java
...src/main/java/com/bailuntec/mapper/DcBaseStockMapper.java
+2
-0
DcBaseStockMapper.xml
.../src/main/java/com/bailuntec/mapper/DcBaseStockMapper.xml
+15
-4
QueueConsumerJob.java
...ver/src/main/java/com/bailuntec/job/QueueConsumerJob.java
+1
-1
TurnoverDaysHandler.java
.../java/com/bailuntec/service/impl/TurnoverDaysHandler.java
+1
-1
AutoTurnoverTest.java
...ow/show-auto-turnover/src/test/java/AutoTurnoverTest.java
+29
-5
No files found.
data-common/src/main/java/com/bailuntec/mapper/DcBaseStockMapper.java
View file @
62e730c3
...
...
@@ -272,4 +272,6 @@ public interface DcBaseStockMapper {
* @return res
*/
long
countOcean
(
@Param
(
"shardingContext"
)
ShardingContext
shardingContext
);
List
<
DcBaseStock
>
selectNew
(
LocalDateTime
localDateTime
);
}
data-common/src/main/java/com/bailuntec/mapper/DcBaseStockMapper.xml
View file @
62e730c3
...
...
@@ -1474,7 +1474,8 @@
from dc_base_stock t1
left join dc_base_warehouse t2 on t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse t3 on t1.bailun_sku = t3.bailun_sku and t1.warehouse_code = t3.warehouse_code
where t2.hq_type != '国内仓' and (t3.`status`=0 or t3.`status` is null)
where t2.hq_type != '国内仓'
and (t3.`status` = 0 or t3.`status` is null)
and t1.id % #{shardingContext.shardingTotalCount} = #{shardingContext.shardingItem}
limit #{pageStart}, #{pageOffset}
</select>
...
...
@@ -1484,7 +1485,8 @@
from dc_base_stock t1
left join dc_base_warehouse t2 on t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse t3 on t1.bailun_sku = t3.bailun_sku and t1.warehouse_code = t3.warehouse_code
where t2.hq_type != '国内仓' and (t3.`status`=0 or t3.`status` is null)
where t2.hq_type != '国内仓'
and (t3.`status` = 0 or t3.`status` is null)
and t1.id % #{shardingContext.shardingTotalCount} = #{shardingContext.shardingItem}
limit #{pageStart}, #{pageOffset}
</select>
...
...
@@ -1494,7 +1496,8 @@
from dc_base_stock t1
left join dc_base_warehouse t2 on t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse t3 on t1.bailun_sku = t3.bailun_sku and t1.warehouse_code = t3.warehouse_code
where t2.hq_type != '国内仓' and (t3.`status`=0 or t3.`status` is null)
where t2.hq_type != '国内仓'
and (t3.`status` = 0 or t3.`status` is null)
and t1.id % #{shardingContext.shardingTotalCount} = #{shardingContext.shardingItem}
</select>
...
...
@@ -1503,9 +1506,17 @@
from dc_base_stock t1
left join dc_base_warehouse t2 on t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse t3 on t1.bailun_sku = t3.bailun_sku and t1.warehouse_code = t3.warehouse_code
where t2.hq_type != '国内仓' and (t3.`status`=0 or t3.`status` is null)
where t2.hq_type != '国内仓'
and (t3.`status` = 0 or t3.`status` is null)
and t1.id % #{shardingContext.shardingTotalCount} = #{shardingContext.shardingItem}
</select>
<select
id=
"selectNew"
resultType=
"com.bailuntec.domain.entity.DcBaseStock"
>
SELECT t1.*
from dc_base_stock t1
LEFT join dc_auto_turnover t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
where t1.create_time
>
#{localDateTime}
</select>
</mapper>
data-show/show-auto-turnover/src/main/java/com/bailuntec/job/QueueConsumerJob.java
View file @
62e730c3
...
...
@@ -30,7 +30,7 @@ public class QueueConsumerJob implements SimpleJob {
@Data
static
class
BaseQueueMessage
{
public
static
class
BaseQueueMessage
{
@JSONField
(
name
=
"bailun_sku"
)
private
String
bailunSku
;
@JSONField
(
name
=
"warehouse_code"
)
...
...
data-show/show-auto-turnover/src/main/java/com/bailuntec/service/impl/TurnoverDaysHandler.java
View file @
62e730c3
...
...
@@ -256,7 +256,7 @@ public class TurnoverDaysHandler {
//来源切换lms
if
(
dcAverageWarehouse
!=
null
&&
dcAverageWarehouse
.
getAbroadInboundDelivery
().
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
abroadInboundDelivery
=
dcAverageWarehouse
.
get
TransferBale
Delivery
().
intValue
();
abroadInboundDelivery
=
dcAverageWarehouse
.
get
AbroadInbound
Delivery
().
intValue
();
abroadInboundDeliverySource
=
Constant
.
SOURCE_LMS
;
}
...
...
data-show/show-auto-turnover/src/test/java/AutoTurnoverTest.java
View file @
62e730c3
...
...
@@ -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.entity.DcBaseQueue
;
import
com.bailuntec.domain.entity.DcBaseStock
;
import
com.bailuntec.domain.entity.JobPointLog
;
import
com.bailuntec.domain.entity.SalesDayConfig
;
...
...
@@ -13,10 +14,8 @@ import com.bailuntec.domain.example.DcMidTransitExample;
import
com.bailuntec.excel.DcAutoTurnoverExcel
;
import
com.bailuntec.excel.ExcelListener
;
import
com.bailuntec.job.AutoTurnoverJob
;
import
com.bailuntec.mapper.DcAutoTurnoverMapper
;
import
com.bailuntec.mapper.DcBaseStockMapper
;
import
com.bailuntec.mapper.DcMidTransitMapper
;
import
com.bailuntec.mapper.SalesDayConfigMapper
;
import
com.bailuntec.job.QueueConsumerJob
;
import
com.bailuntec.mapper.*
;
import
com.bailuntec.utils.PropertiesUtil
;
import
com.bailuntec.utils.SessionUtil
;
import
com.dangdang.ddframe.job.api.ShardingContext
;
...
...
@@ -34,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
import
java.io.Serializable
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.LocalTime
;
import
java.time.Period
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
...
...
@@ -259,7 +259,7 @@ public class AutoTurnoverTest {
public
void
testXX2
()
{
DcBaseStock
dcBaseStock
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseStockMapper
.
class
)
.
selectOneByExample
(
DcBaseStockExample
.
newAndCreateCriteria
()
.
andBailunSkuEqualTo
(
"95
2680001
"
)
.
andBailunSkuEqualTo
(
"95
1030904
"
)
.
andWarehouseCodeEqualTo
(
"GZBLWH"
)
.
example
());
try
{
...
...
@@ -277,6 +277,30 @@ public class AutoTurnoverTest {
SessionUtil
.
getSession
().
getMapper
(
DcAutoTurnoverMapper
.
class
);
}
@Test
public
void
testQueue
()
{
DcBaseStockMapper
dcBaseStockMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseStockMapper
.
class
);
DcBaseQueueMapper
dcBaseQueueMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseQueueMapper
.
class
);
List
<
DcBaseStock
>
dcBaseStockList
=
dcBaseStockMapper
.
selectNew
(
LocalDateTime
.
of
(
LocalDate
.
now
().
minusDays
(
2
),
LocalTime
.
MIN
));
dcBaseStockList
.
forEach
(
dcBaseStock
->
{
DcBaseQueue
dcBaseQueue
=
new
DcBaseQueue
();
QueueConsumerJob
.
BaseQueueMessage
message
=
new
QueueConsumerJob
.
BaseQueueMessage
();
message
.
setBailunSku
(
dcBaseStock
.
getBailunSku
());
message
.
setWarehouseCode
(
dcBaseStock
.
getWarehouseCode
());
dcBaseQueue
.
setMessage
(
JSON
.
toJSONString
(
message
));
dcBaseQueue
.
setType
(
"10"
);
dcBaseQueue
.
setSubmitDate
(
LocalDateTime
.
now
());
dcBaseQueue
.
setQueueType
(
1
);
dcBaseQueueMapper
.
insert
(
dcBaseQueue
);
});
SessionUtil
.
closeSession
();
}
public
void
add
(
DcBaseStock
dcBaseStock
)
{
dcBaseStock
.
setInWarehouse
(
2
);
}
...
...
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