Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-api-boot-master
Commits
f309519c
Commit
f309519c
authored
Oct 30, 2024
by
zhengyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
强制到仓和一键到仓业务一致
parent
8cf1d723
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
53 deletions
+49
-53
OrderWarehouseCheckServiceImpl.java
...e/orderWarehouseCheck/OrderWarehouseCheckServiceImpl.java
+49
-53
No files found.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/orderWarehouseCheck/OrderWarehouseCheckServiceImpl.java
View file @
f309519c
...
@@ -83,60 +83,11 @@ public class OrderWarehouseCheckServiceImpl
...
@@ -83,60 +83,11 @@ public class OrderWarehouseCheckServiceImpl
Date
now
=
DateUtil
.
date
();
Date
now
=
DateUtil
.
date
();
Long
userId
=
SecurityFrameworkUtils
.
getLoginUserId
();
Long
userId
=
SecurityFrameworkUtils
.
getLoginUserId
();
List
<
OrderWarehouseCheckDO
>
newWarehouseCheckDOList
=
new
ArrayList
<>();
List
<
OrderWarehouseCheckDO
>
newWarehouseCheckDOList
=
new
ArrayList
<>();
// 全部到仓,复制入仓信息
for
(
OrderWarehouseInDO
inDo
:
orderWarehouseInService
.
selectList
(
OrderWarehouseInDO:
:
getOrderId
,
orderId
))
{
OrderWarehouseCheckDO
checkDo
=
new
OrderWarehouseCheckDO
();
BeanUtils
.
copyProperties
(
inDo
,
checkDo
);
checkDo
.
setWarehouseInId
(
inDo
.
getId
());
checkDo
.
setSource
(
3
);
checkDo
.
setCheckTime
(
now
);
checkDo
.
setCreateTime
(
now
);
checkDo
.
setCreator
(
String
.
valueOf
(
userId
));
checkDo
.
setUpdateTime
(
now
);
checkDo
.
setUpdater
(
String
.
valueOf
(
userId
));
abstractMapper
.
insert
(
checkDo
);
newWarehouseCheckDOList
.
add
(
checkDo
);
}
// 货物信息查询
List
<
OrderItemDO
>
orderItemDOList
=
orderItemService
.
list
(
new
LambdaQueryWrapper
<
OrderItemDO
>().
eq
(
OrderItemDO:
:
getOrderId
,
orderId
));
// 货物的到仓信息分组
// 货物的到仓信息分组
Map
<
Long
,
List
<
OrderWarehouseCheckDO
>>
warehouseCheckDOListMap
=
newWarehouseCheckDOList
.
stream
().
collect
(
Collectors
.
groupingBy
(
OrderWarehouseCheckDO:
:
getOrderItemId
));
Map
<
Long
,
OrderItemCheckWarehouseVO
>
orderItemCheckWarehouseVOMap
=
new
HashMap
<>();
Map
<
Long
,
OrderItemCheckWarehouseVO
>
orderItemCheckWarehouseVOMap
=
new
HashMap
<>();
for
(
OrderItemDO
orderItemDO
:
orderItemDOList
)
{
OrderItemCheckWarehouseVO
orderItemCheckWarehouseVO
=
new
OrderItemCheckWarehouseVO
();
BeanUtils
.
copyProperties
(
orderItemDO
,
orderItemCheckWarehouseVO
);
orderItemCheckWarehouseVO
.
setCheckBrand
(
orderItemDO
.
getBrand
());
orderItemCheckWarehouseVO
.
setCheckBrandType
(
orderItemDO
.
getFeeType
());
orderItemCheckWarehouseVO
.
setCheckMaterial
(
orderItemDO
.
getMaterial
());
orderItemCheckWarehouseVO
.
setCheckProdAttrIds
(
orderItemDO
.
getWarehouseInProdAttrIds
());
WarehouseCheckInfoVO
warehouseCheckInfoVO
=
orderItemSetWarehouseCheckInfoVO
(
orderItemDO
.
getBoxGauge
(),
warehouseCheckDOListMap
.
get
(
orderItemDO
.
getOrderItemId
()));
orderItemCheckWarehouseVO
.
setWarehouseCheckInfoVO
(
warehouseCheckInfoVO
);
orderItemCheckWarehouseVOMap
.
put
(
orderItemDO
.
getOrderItemId
(),
orderItemCheckWarehouseVO
);
}
// 合并单个货物信息的到仓总数据
orderBusinessService
.
orderToWarehouse
(
orderId
,
orderItemCheckWarehouseVOMap
);
}
@Override
public
void
revoke
(
long
orderId
)
{
LambdaQueryWrapper
<
OrderWarehouseCheckDO
>
wrapper
=
Wrappers
.
lambdaQuery
();
// 清空到仓信息
abstractMapper
.
delete
(
wrapper
.
eq
(
OrderWarehouseCheckDO:
:
getOrderId
,
orderId
));
orderBusinessService
.
revokeToWarehouse
(
orderId
);
}
@Override
public
void
force
(
long
orderId
)
{
List
<
OrderWarehouseCheckDO
>
warehouseCheckDOList
=
list
(
orderId
);
List
<
OrderWarehouseCheckDO
>
warehouseCheckDOList
=
list
(
orderId
);
// 强制到仓信息一致
// 强制到仓信息一致
if
(
CollectionUtil
.
isNotEmpty
(
warehouseCheckDOList
))
{
if
(
CollectionUtil
.
isNotEmpty
(
warehouseCheckDOList
))
{
List
<
OrderWarehouseCheckDO
>
newWarehouseCheckDOList
=
new
ArrayList
<>();
Date
now
=
DateUtil
.
date
();
Long
userId
=
SecurityFrameworkUtils
.
getLoginUserId
();
Map
<
Long
,
OrderWarehouseCheckDO
>
mappings
=
warehouseCheckDOList
.
stream
().
collect
(
Collectors
.
toMap
(
OrderWarehouseCheckDO:
:
getWarehouseInId
,
Function
.
identity
()));
Map
<
Long
,
OrderWarehouseCheckDO
>
mappings
=
warehouseCheckDOList
.
stream
().
collect
(
Collectors
.
toMap
(
OrderWarehouseCheckDO:
:
getWarehouseInId
,
Function
.
identity
()));
for
(
OrderWarehouseInDO
inDo
:
orderWarehouseInService
.
selectList
(
OrderWarehouseInDO:
:
getOrderId
,
orderId
))
{
for
(
OrderWarehouseInDO
inDo
:
orderWarehouseInService
.
selectList
(
OrderWarehouseInDO:
:
getOrderId
,
orderId
))
{
OrderWarehouseCheckDO
checkDo
=
mappings
.
get
(
inDo
.
getId
());
OrderWarehouseCheckDO
checkDo
=
mappings
.
get
(
inDo
.
getId
());
Long
id
=
checkDo
.
getId
();
Long
id
=
checkDo
.
getId
();
...
@@ -152,7 +103,6 @@ public class OrderWarehouseCheckServiceImpl
...
@@ -152,7 +103,6 @@ public class OrderWarehouseCheckServiceImpl
List
<
OrderItemDO
>
orderItemDOList
=
orderItemService
.
list
(
new
LambdaQueryWrapper
<
OrderItemDO
>().
eq
(
OrderItemDO:
:
getOrderId
,
orderId
));
List
<
OrderItemDO
>
orderItemDOList
=
orderItemService
.
list
(
new
LambdaQueryWrapper
<
OrderItemDO
>().
eq
(
OrderItemDO:
:
getOrderId
,
orderId
));
// 货物的到仓信息分组
// 货物的到仓信息分组
Map
<
Long
,
List
<
OrderWarehouseCheckDO
>>
warehouseCheckDOListMap
=
newWarehouseCheckDOList
.
stream
().
collect
(
Collectors
.
groupingBy
(
OrderWarehouseCheckDO:
:
getOrderItemId
));
Map
<
Long
,
List
<
OrderWarehouseCheckDO
>>
warehouseCheckDOListMap
=
newWarehouseCheckDOList
.
stream
().
collect
(
Collectors
.
groupingBy
(
OrderWarehouseCheckDO:
:
getOrderItemId
));
Map
<
Long
,
OrderItemCheckWarehouseVO
>
orderItemCheckWarehouseVOMap
=
new
HashMap
<>();
for
(
OrderItemDO
orderItemDO
:
orderItemDOList
)
{
for
(
OrderItemDO
orderItemDO
:
orderItemDOList
)
{
OrderItemCheckWarehouseVO
orderItemCheckWarehouseVO
=
new
OrderItemCheckWarehouseVO
();
OrderItemCheckWarehouseVO
orderItemCheckWarehouseVO
=
new
OrderItemCheckWarehouseVO
();
BeanUtils
.
copyProperties
(
orderItemDO
,
orderItemCheckWarehouseVO
);
BeanUtils
.
copyProperties
(
orderItemDO
,
orderItemCheckWarehouseVO
);
...
@@ -164,10 +114,56 @@ public class OrderWarehouseCheckServiceImpl
...
@@ -164,10 +114,56 @@ public class OrderWarehouseCheckServiceImpl
orderItemCheckWarehouseVO
.
setWarehouseCheckInfoVO
(
warehouseCheckInfoVO
);
orderItemCheckWarehouseVO
.
setWarehouseCheckInfoVO
(
warehouseCheckInfoVO
);
orderItemCheckWarehouseVOMap
.
put
(
orderItemDO
.
getOrderItemId
(),
orderItemCheckWarehouseVO
);
orderItemCheckWarehouseVOMap
.
put
(
orderItemDO
.
getOrderItemId
(),
orderItemCheckWarehouseVO
);
}
}
orderBusinessService
.
orderToWarehouse
(
orderId
,
orderItemCheckWarehouseVOMap
);
}
else
{
}
else
{
check
(
orderId
);
// 全部到仓,复制入仓信息
for
(
OrderWarehouseInDO
inDo
:
orderWarehouseInService
.
selectList
(
OrderWarehouseInDO:
:
getOrderId
,
orderId
))
{
OrderWarehouseCheckDO
checkDo
=
new
OrderWarehouseCheckDO
();
BeanUtils
.
copyProperties
(
inDo
,
checkDo
);
checkDo
.
setWarehouseInId
(
inDo
.
getId
());
checkDo
.
setSource
(
3
);
checkDo
.
setCheckTime
(
now
);
checkDo
.
setCreateTime
(
now
);
checkDo
.
setCreator
(
String
.
valueOf
(
userId
));
checkDo
.
setUpdateTime
(
now
);
checkDo
.
setUpdater
(
String
.
valueOf
(
userId
));
abstractMapper
.
insert
(
checkDo
);
newWarehouseCheckDOList
.
add
(
checkDo
);
}
// 货物信息查询
List
<
OrderItemDO
>
orderItemDOList
=
orderItemService
.
list
(
new
LambdaQueryWrapper
<
OrderItemDO
>().
eq
(
OrderItemDO:
:
getOrderId
,
orderId
));
// 货物的到仓信息分组
// 货物的到仓信息分组
Map
<
Long
,
List
<
OrderWarehouseCheckDO
>>
warehouseCheckDOListMap
=
newWarehouseCheckDOList
.
stream
().
collect
(
Collectors
.
groupingBy
(
OrderWarehouseCheckDO:
:
getOrderItemId
));
for
(
OrderItemDO
orderItemDO
:
orderItemDOList
)
{
OrderItemCheckWarehouseVO
orderItemCheckWarehouseVO
=
new
OrderItemCheckWarehouseVO
();
BeanUtils
.
copyProperties
(
orderItemDO
,
orderItemCheckWarehouseVO
);
orderItemCheckWarehouseVO
.
setCheckBrand
(
orderItemDO
.
getBrand
());
orderItemCheckWarehouseVO
.
setCheckBrandType
(
orderItemDO
.
getFeeType
());
orderItemCheckWarehouseVO
.
setCheckMaterial
(
orderItemDO
.
getMaterial
());
orderItemCheckWarehouseVO
.
setCheckProdAttrIds
(
orderItemDO
.
getWarehouseInProdAttrIds
());
WarehouseCheckInfoVO
warehouseCheckInfoVO
=
orderItemSetWarehouseCheckInfoVO
(
orderItemDO
.
getBoxGauge
(),
warehouseCheckDOListMap
.
get
(
orderItemDO
.
getOrderItemId
()));
orderItemCheckWarehouseVO
.
setWarehouseCheckInfoVO
(
warehouseCheckInfoVO
);
orderItemCheckWarehouseVOMap
.
put
(
orderItemDO
.
getOrderItemId
(),
orderItemCheckWarehouseVO
);
}
}
}
// 合并单个货物信息的到仓总数据
orderBusinessService
.
orderToWarehouse
(
orderId
,
orderItemCheckWarehouseVOMap
);
}
@Override
public
void
revoke
(
long
orderId
)
{
LambdaQueryWrapper
<
OrderWarehouseCheckDO
>
wrapper
=
Wrappers
.
lambdaQuery
();
// 清空到仓信息
abstractMapper
.
delete
(
wrapper
.
eq
(
OrderWarehouseCheckDO:
:
getOrderId
,
orderId
));
orderBusinessService
.
revokeToWarehouse
(
orderId
);
}
@Override
public
void
force
(
long
orderId
)
{
check
(
orderId
);
}
}
@Override
@Override
...
@@ -193,7 +189,7 @@ public class OrderWarehouseCheckServiceImpl
...
@@ -193,7 +189,7 @@ public class OrderWarehouseCheckServiceImpl
abstractMapper
.
updateBatch
(
newWarehouseCheckDOList
);
abstractMapper
.
updateBatch
(
newWarehouseCheckDOList
);
// 更新到订单中汇总
// 更新到订单中汇总
// 货物信息查询
// 货物信息查询
OrderItemDO
orderItemDO
=
orderItemService
.
getById
(
checkUpdateReqVO
.
getOrderItemId
());
OrderItemDO
orderItemDO
=
orderItemService
.
getById
(
checkUpdateReqVO
.
getOrderItemId
());
// 货物的到仓信息分组
// 货物的到仓信息分组
Map
<
Long
,
OrderItemCheckWarehouseVO
>
orderItemCheckWarehouseVOMap
=
new
HashMap
<>();
Map
<
Long
,
OrderItemCheckWarehouseVO
>
orderItemCheckWarehouseVOMap
=
new
HashMap
<>();
OrderItemCheckWarehouseVO
orderItemCheckWarehouseVO
=
new
OrderItemCheckWarehouseVO
();
OrderItemCheckWarehouseVO
orderItemCheckWarehouseVO
=
new
OrderItemCheckWarehouseVO
();
...
...
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