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
99fa01c5
Commit
99fa01c5
authored
Oct 18, 2019
by
yinyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
每日库存修改
parent
4b237ef7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
61 deletions
+39
-61
DcBaseStockMapper.java
...src/main/java/com/bailuntec/mapper/DcBaseStockMapper.java
+1
-3
DcBaseStockMapper.xml
.../src/main/java/com/bailuntec/mapper/DcBaseStockMapper.xml
+37
-56
DailyStockJob.java
...-stock/src/main/java/com/bailuntec/job/DailyStockJob.java
+1
-2
No files found.
data-common/src/main/java/com/bailuntec/mapper/DcBaseStockMapper.java
View file @
99fa01c5
...
@@ -128,9 +128,7 @@ public interface DcBaseStockMapper {
...
@@ -128,9 +128,7 @@ public interface DcBaseStockMapper {
void
supplementPurchaseSku
();
void
supplementPurchaseSku
();
void
insertDailyStock
(
@Param
(
"list"
)
List
<
DcBaseStock
>
dcBaseStockList
);
void
insertDailyStock
();
List
<
DcBaseStock
>
selectStock
();
List
<
DcBaseStock
>
listStockById
(
@Param
(
"v1"
)
int
v1
,
@Param
(
"v2"
)
int
v2
);
List
<
DcBaseStock
>
listStockById
(
@Param
(
"v1"
)
int
v1
,
@Param
(
"v2"
)
int
v2
);
...
...
data-common/src/main/java/com/bailuntec/mapper/DcBaseStockMapper.xml
View file @
99fa01c5
...
@@ -1147,8 +1147,42 @@
...
@@ -1147,8 +1147,42 @@
tbs.bailun_sku IS NULL;
tbs.bailun_sku IS NULL;
</insert>
</insert>
<select
id=
"selectStock"
resultType=
"com.bailuntec.domain.entity.DcBaseStock"
>
<insert
id=
"insertDailyStock"
>
SELECT
INSERT INTO dc_daily_stock (
`bailun_sku`,
`warehouse_code`,
`owner_code`,
`quantity_reservation`,
`quantity_transport`,
`quantity_transfer`,
`quantity_freeze`,
`quantity_supplier`,
`quantity_presell`,
`quantity_defective`,
`quantity_transit`,
`wait_check`,
`wait_putaway`,
`usable_stock`,
`usable_sales`,
`usable_sales_private`,
`usable_sales_share`,
`in_warehouse_share`,
`in_warehouse_private`,
`in_warehouse`,
`occupy_stock_share`,
`occupy_stock_private`,
`occupy_stock`,
`occupy_activity`,
`occupy_order_private`,
`occupy_order_share`,
`occupy_order`,
`gmt_create`,
`gmt_modified`,
`record_time`,
`create_time`,
`update_time`,
unit_price
) SELECT
dc0.bailun_sku,
dc0.bailun_sku,
dc0.warehouse_code,
dc0.warehouse_code,
dc0.owner_code,
dc0.owner_code,
...
@@ -1178,6 +1212,7 @@
...
@@ -1178,6 +1212,7 @@
dc0.occupy_order,
dc0.occupy_order,
dc0.gmt_create,
dc0.gmt_create,
dc0.gmt_modified,
dc0.gmt_modified,
DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),
dc0.create_time,
dc0.create_time,
dc0.update_time,
dc0.update_time,
dc1.unit_price
dc1.unit_price
...
@@ -1185,60 +1220,6 @@
...
@@ -1185,60 +1220,6 @@
dc_base_stock dc0
dc_base_stock dc0
left join dc_base_sku dc1 on dc0.bailun_sku = dc1.bailun_sku
left join dc_base_sku dc1 on dc0.bailun_sku = dc1.bailun_sku
where dc0.usable_stock>0 or dc0.occupy_stock>0
where dc0.usable_stock>0 or dc0.occupy_stock>0
</select>
<insert
id=
"insertDailyStock"
>
INSERT INTO dc_daily_stock (
`bailun_sku`,
`warehouse_code`,
`owner_code`,
`quantity_reservation`,
`quantity_transport`,
`quantity_transfer`,
`quantity_freeze`,
`quantity_supplier`,
`quantity_presell`,
`quantity_defective`,
`quantity_transit`,
`wait_check`,
`wait_putaway`,
`usable_stock`,
`usable_sales`,
`usable_sales_private`,
`usable_sales_share`,
`in_warehouse_share`,
`in_warehouse_private`,
`in_warehouse`,
`occupy_stock_share`,
`occupy_stock_private`,
`occupy_stock`,
`occupy_activity`,
`occupy_order_private`,
`occupy_order_share`,
`occupy_order`,
`gmt_create`,
`gmt_modified`,
`record_time`,
`create_time`,
`update_time`,
unit_price
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.bailunSku}, #{item.warehouseCode}, #{item.ownerCode}, #{item.quantityReservation}, #{item.quantityTransport}, #{item.quantityTransfer}, #{item.quantityFreeze}, #{item.quantitySupplier}, #{item.quantityPresell}, #{item.quantityDefective}, #{item.quantityTransit}
,#{item.waitCheck}, #{item.waitPutaway}, #{item.usableStock}, #{item.usableSales}, #{item.usableSalesPrivate}, #{item.usableSalesShare}, #{item.inWarehouseShare}, #{item.inWarehousePrivate}, #{item.inWarehouse}, #{item.occupyStockShare}, #{item.occupyStockPrivate}, #{item.occupyStock}
,#{item.occupyActivity}, #{item.occupyOrderPrivate}, #{item.occupyOrderShare}, #{item.occupyOrder}, #{item.gmtCreate}, #{item.gmtModified}, DATE_SUB( CURDATE( ), INTERVAL 1 DAY ), #{item.createTime}, #{item.updateTime},
<choose>
<when
test=
"item.unitPrice != null"
>
#{item.unitPrice}
</when>
<otherwise>
0
</otherwise>
</choose>
)
</foreach>
</insert>
</insert>
<update
id=
"updateSkuUnitPrice"
>
<update
id=
"updateSkuUnitPrice"
>
...
...
data-mid/mid-daily-stock/src/main/java/com/bailuntec/job/DailyStockJob.java
View file @
99fa01c5
...
@@ -17,8 +17,7 @@ public class DailyStockJob implements SimpleJob {
...
@@ -17,8 +17,7 @@ public class DailyStockJob implements SimpleJob {
public
void
execute
(
ShardingContext
shardingContext
)
{
public
void
execute
(
ShardingContext
shardingContext
)
{
try
{
try
{
DcBaseStockMapper
mapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseStockMapper
.
class
);
DcBaseStockMapper
mapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseStockMapper
.
class
);
List
<
DcBaseStock
>
dcBaseStockList
=
mapper
.
selectStock
();
mapper
.
insertDailyStock
();
mapper
.
insertDailyStock
(
dcBaseStockList
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
throw
new
RuntimeException
(
"MYBATIS操作DB失败"
,
e
);
throw
new
RuntimeException
(
"MYBATIS操作DB失败"
,
e
);
...
...
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