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
74452a3b
Commit
74452a3b
authored
Oct 28, 2024
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单到仓数据更新业务
parent
cb9c07af
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
105 additions
and
3 deletions
+105
-3
OrderBusinessService.java
...udao/module/order/service/order/OrderBusinessService.java
+20
-0
OrderBusinessServiceImpl.java
...le/order/service/order/impl/OrderBusinessServiceImpl.java
+85
-3
No files found.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/OrderBusinessService.java
View file @
74452a3b
...
...
@@ -398,4 +398,24 @@ public interface OrderBusinessService extends IService<OrderDO> {
void
updateItem
(
OrderItemDO
orderItemDO
);
/**
* 订单到仓更新
*
* @param orderId 订单ID
* @param checkNum 到仓箱数
* @param checkQuantity 到仓数量
* @param checkVolume 到仓体积
* @param checkWeight 到仓重量
*/
void
orderToWarehouse
(
Long
orderId
,
Integer
checkNum
,
Integer
checkQuantity
,
BigDecimal
checkVolume
,
BigDecimal
checkWeight
);
/**
* 撤销到仓
*
* @param orderId 订单id
*/
void
revokeToWarehouse
(
Long
orderId
);
}
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderBusinessServiceImpl.java
View file @
74452a3b
...
...
@@ -107,6 +107,8 @@ import static cn.iocoder.yudao.framework.apollo.core.constants.Constants.NOT_ACC
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
yudao
.
module
.
ecw
.
enums
.
ErrorCodeConstants
.
EXCHANGE_RATE_NOT_EXISTS_PARAM
;
import
static
cn
.
iocoder
.
yudao
.
module
.
order
.
enums
.
ErrorCodeConstants
.*;
import
static
cn
.
iocoder
.
yudao
.
module
.
order
.
enums
.
OrderAirTimeEnum
.
AIR_UNLOADED_CABINET
;
import
static
cn
.
iocoder
.
yudao
.
module
.
order
.
enums
.
OrderSeaTimeEnum
.
SEA_UNLOADED_CABINET
;
/**
* 订单 Service 实现类
...
...
@@ -2623,7 +2625,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
null
,
CollectionUtil
.
newArrayList
(
OrderExceptionEnum
.
LINE_WEIGHT_EXCEPTION
.
getKey
()));
if
(
CollectionUtil
.
isNotEmpty
(
lineOverweightExceptionDOList
)
||
lineOverweightExceptionDOList
.
isEmpty
()){
lineOverweightExceptionDOList
.
isEmpty
())
{
overweightExceptionDOList
.
addAll
(
lineOverweightExceptionDOList
);
}
orderDO
.
setIsAutomaticHandleNoCanShipmentChannelException
(
false
);
...
...
@@ -2638,7 +2640,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
orderItemDO
.
getProdId
(),
CollectionUtil
.
newArrayList
(
OrderExceptionEnum
.
GOODS_OVERWEIGHT_EXCEPTION
.
getKey
()));
if
(
CollectionUtil
.
isNotEmpty
(
goodsOverweightExceptionDOList
)
||
goodsOverweightExceptionDOList
.
isEmpty
()){
goodsOverweightExceptionDOList
.
isEmpty
())
{
overweightExceptionDOList
.
addAll
(
goodsOverweightExceptionDOList
);
}
//生成未报价异常 (草稿订单除外)
...
...
@@ -2769,7 +2771,6 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
}
private
void
airShipmentStateUpdate
(
Integer
type
,
List
<
FeeDto
>
newFeeDtoList
,
OrderDO
newOrder
)
{
...
...
@@ -4039,4 +4040,85 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
orderItemMapper
.
updateById
(
orderItemDO
);
}
@Override
public
void
orderToWarehouse
(
Long
orderId
,
Integer
checkNum
,
Integer
checkQuantity
,
BigDecimal
checkVolume
,
BigDecimal
checkWeight
)
{
OrderDO
orderDO
=
orderMapper
.
getOrderById
(
orderId
);
Integer
orgCheckNum
=
orderDO
.
getCheckNum
();
Integer
orgCheckQuantity
=
orderDO
.
getCheckQuantity
();
BigDecimal
orgCheckVolume
=
orderDO
.
getCheckVolume
();
BigDecimal
orgCheckWeight
=
orderDO
.
getCheckWeight
();
// 更新订单到仓数据
orderMapper
.
update
(
null
,
new
LambdaUpdateWrapper
<
OrderDO
>()
.
set
(
OrderDO:
:
getCheckNum
,
checkNum
)
.
set
(
OrderDO:
:
getCheckQuantity
,
checkQuantity
)
.
set
(
OrderDO:
:
getCheckVolume
,
checkVolume
)
.
set
(
OrderDO:
:
getCheckWeight
,
checkWeight
)
.
eq
(
OrderDO:
:
getOrderId
,
orderId
)
);
// 添加订单到仓操作日志
List
<
ApplyInfoVO
>
list
=
new
ArrayList
<>();
ApplyInfoVO
applyInfoVO
=
new
ApplyInfoVO
();
applyInfoVO
.
setName
(
"卸柜/到仓箱数"
);
applyInfoVO
.
setOrgValue
(
orgCheckNum
+
"箱"
);
applyInfoVO
.
setNewValue
(
checkNum
+
"箱"
);
list
.
add
(
applyInfoVO
);
applyInfoVO
=
new
ApplyInfoVO
();
applyInfoVO
.
setName
(
"卸柜/到仓数量"
);
applyInfoVO
.
setOrgValue
(
orgCheckQuantity
+
"个"
);
applyInfoVO
.
setNewValue
(
checkQuantity
+
"个"
);
list
.
add
(
applyInfoVO
);
applyInfoVO
=
new
ApplyInfoVO
();
applyInfoVO
.
setName
(
"卸柜/到仓体积"
);
applyInfoVO
.
setOrgValue
(
orgCheckVolume
+
"m³"
);
applyInfoVO
.
setNewValue
(
checkVolume
+
"m³"
);
list
.
add
(
applyInfoVO
);
applyInfoVO
=
new
ApplyInfoVO
();
applyInfoVO
.
setName
(
"卸柜/到仓重量"
);
applyInfoVO
.
setOrgValue
(
orgCheckWeight
+
"kg"
);
applyInfoVO
.
setNewValue
(
checkWeight
+
"kg"
);
list
.
add
(
applyInfoVO
);
this
.
addOrderOperateLog
(
orderId
,
"订单操作"
,
"订单卸柜/到仓数据更新"
,
list
);
}
@Override
public
void
revokeToWarehouse
(
Long
orderId
)
{
OrderDO
orderDO
=
orderMapper
.
getOrderById
(
orderId
);
Integer
orgCheckNum
=
orderDO
.
getCheckNum
();
Integer
orgCheckQuantity
=
orderDO
.
getCheckQuantity
();
BigDecimal
orgCheckVolume
=
orderDO
.
getCheckVolume
();
BigDecimal
orgCheckWeight
=
orderDO
.
getCheckWeight
();
Integer
orderStatus
=
orderDO
.
getStatus
();
Integer
orderInWarehouseState
=
orderDO
.
getInWarehouseState
();
Integer
orderShipmentState
=
orderDO
.
getShipmentState
();
// 更新订单到仓数据,回滚订单状态
orderMapper
.
update
(
null
,
new
LambdaUpdateWrapper
<
OrderDO
>()
.
set
(
OrderDO:
:
getCheckNum
,
0
)
.
set
(
OrderDO:
:
getCheckQuantity
,
0
)
.
set
(
OrderDO:
:
getCheckVolume
,
0
)
.
set
(
OrderDO:
:
getCheckWeight
,
0
)
.
set
(
OrderDO:
:
getUnloadTime
,
null
)
.
set
(
OrderDO:
:
getStatus
,
15
)
.
set
(
OrderDO:
:
getOldStatus
,
orderStatus
)
.
set
(
OrderDO:
:
getInWarehouseState
,
0
)
.
set
(
OrderDO:
:
getOldInWarehouseState
,
orderInWarehouseState
)
.
set
(
OrderDO:
:
getShipmentState
,
330
)
// 回滚为已清关,待卸柜/到仓
.
set
(
OrderDO:
:
getOldShipmentState
,
orderShipmentState
)
.
eq
(
OrderDO:
:
getOrderId
,
orderId
)
);
// 回滚订单动态日志
OrderTimeDO
orderTimeDO
=
orderTimeMapper
.
selectOne
(
new
LambdaQueryWrapper
<
OrderTimeDO
>()
.
eq
(
OrderTimeDO:
:
getOrderId
,
orderId
)
.
eq
(
OrderTimeDO:
:
getStatus
,
orderDO
.
getTransportId
()
==
1
?
SEA_UNLOADED_CABINET
.
getValue
()
:
AIR_UNLOADED_CABINET
.
getValue
())
.
orderByDesc
(
OrderTimeDO:
:
getId
)
.
last
(
"limit 1"
)
);
if
(
Objects
.
nonNull
(
orderTimeDO
))
{
orderTimeMapper
.
deleteById
(
orderTimeDO
.
getId
());
}
// 添加订单到仓操作日志
this
.
addOrderOperateLog
(
orderId
,
"订单操作"
,
"撤销订单卸柜/到仓,清空到仓数据"
,
""
);
}
}
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