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
d67164f7
Commit
d67164f7
authored
Sep 12, 2024
by
zhengyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善出货阶段的订单修改逻辑
parent
9f058cbe
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
14 deletions
+95
-14
ErrorCodeConstants.java
.../iocoder/yudao/module/order/enums/ErrorCodeConstants.java
+13
-0
OrderServiceImpl.java
...dao/module/order/service/order/impl/OrderServiceImpl.java
+49
-13
messages.properties
yudao-server/src/main/resources/i18n/messages.properties
+11
-0
messages_en.properties
yudao-server/src/main/resources/i18n/messages_en.properties
+11
-0
messages_zh.properties
yudao-server/src/main/resources/i18n/messages_zh.properties
+11
-1
No files found.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/enums/ErrorCodeConstants.java
View file @
d67164f7
...
...
@@ -404,4 +404,17 @@ public interface ErrorCodeConstants {
ErrorCode
ORDER_CARGO_CONTROL_LIMIT_UPDATE_CONSIGNEE_INFO
=
new
ErrorCode
(
1004001156
,
"order.cargo.control.limit.update.consignee.info"
);
ErrorCode
ORDER_CARGO_CONTROL_CONSIGNEE_LIMIT_UPDATE_APPLYING
=
new
ErrorCode
(
1004001157
,
"order.cargo.control.consignee.limit.update.applying"
);
ErrorCode
ORDER_CARGO_CONTROL_OVERSEAS_WAREHOUSE_UPDATE_APPLYING
=
new
ErrorCode
(
1004001158
,
"order.cargo.control.overseas.warehouse.update.applying"
);
ErrorCode
ORDER_EXISTS_PICKUP_NOT_CARGO_CONTROL
=
new
ErrorCode
(
1004001159
,
"order.exists.pickup.not.cargo.control"
);
ErrorCode
ORDER_EXISTS_PICK_NOT_CANCEL_CARGO_CONTROL
=
new
ErrorCode
(
1004001160
,
"order.exists.pick.not.cancel.cargo.control"
);
ErrorCode
ORDER_OVERSEAS_WAREHOUSE_UPDATE_NEED_APPLY
=
new
ErrorCode
(
1004001161
,
"order.overseas.warehouse.update.need.applying"
);
ErrorCode
NOT_UPDATE_DEST_COUNTRY
=
new
ErrorCode
(
1004001162
,
"order.not.update.dest.country"
);
ErrorCode
NOT_UPDATE_DEPARTURE
=
new
ErrorCode
(
1004001163
,
"order.not.update.departure"
);
ErrorCode
NOT_UPDATE_TRANSPORT
=
new
ErrorCode
(
1004001164
,
"order.not.update.transport"
);
ErrorCode
ORDER_PRE_INSTALLATION_UNPACKAGED_CONTAINER_NOT_UPDATE
=
new
ErrorCode
(
1004001165
,
"order.pre.installation.unpackaged.container.not.update"
);
// /空运订单分拣未出货, 锁定订单信息无法修改
ErrorCode
ORDER_SORTING_NOT_SHIPMENT_NOT_UPDATE
=
new
ErrorCode
(
1004001166
,
"order.sorting.not.shipment.not.update"
);
}
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderServiceImpl.java
View file @
d67164f7
...
...
@@ -102,6 +102,8 @@ import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
import
cn.iocoder.yudao.module.system.api.user.AdminUserApi
;
import
cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO
;
import
cn.iocoder.yudao.module.wealth.dal.dataobject.receivable.ReceivableDO
;
import
cn.iocoder.yudao.module.wealth.enums.BoxAirStatusEnum
;
import
cn.iocoder.yudao.module.wealth.enums.BoxStatusEnum
;
import
cn.iocoder.yudao.module.wealth.service.receivable.ReceivableService
;
import
cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableQueryVO
;
...
...
@@ -1796,7 +1798,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
throw
exception
(
TRANSPORT_AND_LINE_NOT_AGREEMENT
);
}
// 执行订单审批申请业务
this
.
orderAuditApplyUpdate
(
updateReqVO
,
vo
,
logisticsInfoDto
,
dictDataRespDTO
);
this
.
orderAuditApplyUpdate
(
updateReqVO
,
vo
,
logisticsInfoDto
,
dictDataRespDTO
,
false
);
}
@Override
...
...
@@ -1853,26 +1855,32 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
*/
// 海运订单预装未装柜/空运订单分拣未出货, 锁定订单信息无法修改
if
(
vo
.
getShipmentState
()
==
0
||
vo
.
getShipmentState
()
==
305
||
vo
.
getShipmentState
()
==
307
)
{
// throw exception(ORDER_PRE_INSTALLATION_NOT_UPDATE);
if
(
vo
.
getTransportId
()
==
TransportTypeShortEnum
.
SEA_CONTAINER
.
getValue
())
{
throw
exception
(
ORDER_PRE_INSTALLATION_UNPACKAGED_CONTAINER_NOT_UPDATE
);
}
else
{
// TODO 当前不是海运就是空运
throw
exception
(
ORDER_SORTING_NOT_SHIPMENT_NOT_UPDATE
);
}
}
// 不允许修改运输方式
if
(
updateReqVO
.
getTransportId
()
!=
vo
.
getTransportId
())
{
//
throw exception(NOT_UPDATE_TRANSPORT);
throw
exception
(
NOT_UPDATE_TRANSPORT
);
}
// TODO 这里需要优化查询,这里查询了后面调用不建议重复查询,后面做优化
LogisticsInfoDto
logisticsInfoDto
=
warehouseLineMapper
.
getStartInfoAndDestInfoByLineId
(
updateReqVO
.
getLineId
());
LogisticsInfoDto
orgLogisticsInfoDto
=
warehouseLineMapper
.
getStartInfoAndDestInfoByLineId
(
vo
.
getLineId
());
// 不允许修改始发地
if
(!
Objects
.
equals
(
logisticsInfoDto
.
getStartCityId
(),
updateReqVO
.
getDepartureId
()))
{
//
throw exception(NOT_UPDATE_DEPARTURE);
throw
exception
(
NOT_UPDATE_DEPARTURE
);
}
// 不允许修改目的国
if
(!
Objects
.
equals
(
logisticsInfoDto
.
getDestCountryId
(),
orgLogisticsInfoDto
.
getDestCountryId
()))
{
//
throw exception(NOT_UPDATE_DEST_COUNTRY);
throw
exception
(
NOT_UPDATE_DEST_COUNTRY
);
}
// 海外仓业务变动申请
if
(!
vo
.
getType
().
contains
(
"2"
)
&&
updateReqVO
.
getType
().
contains
(
"2"
)){
// TODO 订单如果转海外仓需要单独申请, 订单如果是海外仓改为非海外仓呢?
throw
exception
(
ORDER_OVERSEAS_WAREHOUSE_UPDATE_NEED_APPLY
);
}
// 当是否控货从是修改成否,需校验订单是否有放货记录状态≠已取消,有则弹出提示“订单已放货,无法修改为不控货”
if
(
vo
.
getIsCargoControl
()
&&
!
updateReqVO
.
getIsCargoControl
()){
...
...
@@ -1882,7 +1890,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
.
in
(
OrderCargoControlPickDO:
:
getStatus
,
1
,
2
,
3
,
4
,
5
,
6
));
if
(
pickCount
>
0
){
// 订单存在放货记录,不能取消控货
//
throw exception(ORDER_EXISTS_PICK_NOT_CANCEL_CARGO_CONTROL);
throw
exception
(
ORDER_EXISTS_PICK_NOT_CANCEL_CARGO_CONTROL
);
}
}
// 当是否控货从否修改成是,校验订单是否有提货记录,有则弹出提示“订单已有提货记录,无法修改成控货”
...
...
@@ -1892,11 +1900,11 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
.
eq
(
OrderPickupDO:
:
getOrderId
,
vo
.
getOrderNo
()));
if
(
pickupCount
>
0
){
// 订单存在提货记录,不能进行控货
//
throw exception(ORDER_EXISTS_PICKUP_NOT_CARGO_CONTROL);
throw
exception
(
ORDER_EXISTS_PICKUP_NOT_CARGO_CONTROL
);
}
}
// 执行订单审批申请业务
this
.
orderAuditApplyUpdate
(
updateReqVO
,
vo
,
logisticsInfoDto
,
dictDataRespDTO
);
this
.
orderAuditApplyUpdate
(
updateReqVO
,
vo
,
logisticsInfoDto
,
dictDataRespDTO
,
true
);
}
...
...
@@ -1908,7 +1916,26 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
* @param logisticsInfoDto
*/
private
void
orderAuditApplyUpdate
(
OrderUpdateReqVO
updateReqVO
,
OrderBackVO
vo
,
LogisticsInfoDto
logisticsInfoDto
,
DictDataRespDTO
dictDataRespDTO
)
{
DictDataRespDTO
dictDataRespDTO
,
boolean
isShipment
)
{
String
statusName
=
""
;
if
(
isShipment
){
if
(!
Objects
.
equals
(
vo
.
getTransportId
(),
TransportTypeShortEnum
.
AIR_FREIGHT_LINE
.
getValue
())
&&
!
Objects
.
equals
(
vo
.
getTransportId
(),
TransportTypeShortEnum
.
AIR_SEA_COMBINED_TRANSPORT
.
getValue
()))
{
statusName
=
OrderStatusEnum
.
valueOf
(
vo
.
getStatus
()).
getNameZh
();
}
else
{
if
(
vo
.
getStatus
().
equals
(
OrderStatusEnum
.
IN_SHIPPING
.
getValue
()))
{
// 此状态为状态13的空运转义状态,当运输方式为空运时,状态13为已起飞, 订单日志信息单独更新
statusName
=
OrderStatusEnum
.
HAS_TAKEN_OFF
.
getNameZh
();
}
if
(
vo
.
getStatus
().
equals
(
OrderStatusEnum
.
SHIPMENT
.
getValue
())
&&
vo
.
getShipmentState
().
equals
(
BoxAirStatusEnum
.
WAREHOUSED
))
{
// 此状态为状态32的空运转义状态,当运输方式为空运时,状态32为,出货子状态为出仓, 订单实时状态为出仓
statusName
=
OrderStatusEnum
.
WAREHOUSED
.
getNameZh
();
}
if
(
vo
.
getStatus
().
equals
(
OrderStatusEnum
.
UNLOADED_CABINET
.
getValue
())
&&
vo
.
getShipmentState
().
equals
(
BoxAirStatusEnum
.
TO_WAREHOUSED
))
{
// 此状态为空运到仓状态
statusName
=
OrderStatusEnum
.
WAREHOUSED
.
getNameZh
();
}
}
}
OrderApprovalDO
orderApprovalDO
;
OrderDO
updateObj
=
OrderConvert
.
INSTANCE
.
convert
(
updateReqVO
);
if
(
updateReqVO
.
getIsExternalWarehouse
()
&&
StringUtils
.
isNotBlank
(
updateReqVO
.
getType
())
&&
updateReqVO
.
getType
().
contains
(
"1"
))
{
...
...
@@ -1939,7 +1966,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
vo
.
setCcIds
(
updateReqVO
.
getCcIds
());
vo
.
setApplyType
(
ORDER_UPDATE
.
getValue
());
Li
st
<
ApplyInfoVO
>
applyInfoList
=
new
Array
List
<>();
Li
nkedList
<
ApplyInfoVO
>
applyInfoList
=
new
Linked
List
<>();
// 通用信息比较
this
.
compareGenericForms
(
updateReqVO
,
vo
,
applyInfoList
);
// 空运信息比较
...
...
@@ -2090,9 +2117,18 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
// 处理完订单相关的所有业务后,如果有待审批的订单修改内容,则创建待审批任务
if
(
CollectionUtil
.
isNotEmpty
(
applyInfoList
))
{
// 订单修改审批提交不允许在出货阶段进行
if
(
vo
.
getStatus
()
>
10
&&
vo
.
getStatus
()
<
19
)
{
throw
exception
(
ORDER_UPDATE_APPROVAL_MUST_BE_WAREHOUSE_IN
);
if
(!
isShipment
)
{
// 2024-09-11 重新修正,出货阶段有单独的修改审批业务需要走
// 订单修改审批提交不允许在出货阶段进行
if
(
vo
.
getStatus
()
>
10
&&
vo
.
getStatus
()
<
19
)
{
throw
exception
(
ORDER_UPDATE_APPROVAL_MUST_BE_WAREHOUSE_IN
);
}
}
if
(
isShipment
){
// TODO 出货阶段的修改,需要将当前订单状态值标出,放首位
ApplyInfoVO
applyInfoVO
=
new
ApplyInfoVO
();
applyInfoVO
.
setName
(
statusName
);
applyInfoList
.
addFirst
(
applyInfoVO
);
}
// 订单有修改则执行修改审批任务
vo
.
setApplyInfoList
(
applyInfoList
);
...
...
yudao-server/src/main/resources/i18n/messages.properties
View file @
d67164f7
...
...
@@ -279,3 +279,14 @@ customer.deleted.not.exists=
customer.saved.customer.service.is.null
=
customer.deleted.customer.service.is.null
=
customer.merge.customer.service.not.same
=
order.exists.pickup.not.cargo.control
=
order.exists.pick.not.cancel.cargo.control
=
order.overseas.warehouse.update.need.applying
=
order.not.update.dest.country
=
order.not.update.departure
=
order.not.update.transport
=
order.pre.installation.unpackaged.container.not.update
=
order.sorting.not.shipment.not.update
=
yudao-server/src/main/resources/i18n/messages_en.properties
View file @
d67164f7
...
...
@@ -1086,3 +1086,14 @@ customer.deleted.not.exists=customer deleted not exists
customer.saved.customer.service.is.null
=
customer saved customer service is null
customer.deleted.customer.service.is.null
=
customer merged customer service is null
customer.merge.customer.service.not.same
=
tow customer's customer serivce not same
order.exists.pickup.not.cargo.control
=
The order has a delivery record and cannot be controlled
order.exists.pick.not.cancel.cargo.control
=
There is a release record for the order, and the control cannot be cancelled
order.overseas.warehouse.update.need.applying
=
Order overseas warehouse modification requires separate application
order.not.update.dest.country
=
Not allowed to modify the destination country
order.not.update.departure
=
Not allowed to modify the origin location
order.not.update.transport
=
No modification of transportation method allowed
order.pre.installation.unpackaged.container.not.update
=
Order pre installed without container, order information cannot be modified
order.sorting.not.shipment.not.update
=
Order sorting not shipped, order information cannot be modified
\ No newline at end of file
yudao-server/src/main/resources/i18n/messages_zh.properties
View file @
d67164f7
...
...
@@ -1085,4 +1085,14 @@ customer.saved.not.exists=\u4FDD\u7559\u5BA2\u6237\u4E0D\u5B58\u5728
customer.deleted.not.exists
=
\u
88AB
\u5408\u
5E76
\u
5BA2
\u6237\u
4E0D
\u
5B58
\u5728
customer.saved.customer.service.is.null
=
\u
88AB
\u
4FDD
\u7559\u
5BA2
\u6237\u7684\u
5BA2
\u6237\u
7ECF
\u7406\u
4E3A
\u
7A7A
customer.deleted.customer.service.is.null
=
\u
88AB
\u5408\u
5E76
\u7684\u
5BA2
\u6237\u7684\u
5BA2
\u6237\u
7ECF
\u7406\u
4E3A
\u
7A7A
customer.merge.customer.service.not.same
=
\u
4E24
\u
5BA2
\u6237\u7684\u
5BA2
\u6237\u
7ECF
\u7406\u
4E0D
\u
4E00
\u
81F4
\ No newline at end of file
customer.merge.customer.service.not.same
=
\u
4E24
\u
5BA2
\u6237\u7684\u
5BA2
\u6237\u
7ECF
\u7406\u
4E0D
\u
4E00
\u
81F4
order.exists.pickup.not.cargo.control
=
\u
8ba2
\u5355\u
5b58
\u5728\u
63d0
\u
8d27
\u
8bb0
\u
5f55
\u
ff0c
\u
4e0d
\u
80fd
\u
8fdb
\u
884c
\u
63a7
\u
8d27
order.exists.pick.not.cancel.cargo.control
=
\u
8ba2
\u5355\u
5b58
\u5728\u
653e
\u
8d27
\u
8bb0
\u
5f55
\u
ff0c
\u
4e0d
\u
80fd
\u
53d6
\u
6d88
\u
63a7
\u
8d27
order.overseas.warehouse.update.need.applying
=
\u
8ba2
\u5355\u
6d77
\u5916\u
4ed3
\u
4fee
\u6539\u9700\u8981\u5355\u
72ec
\u7533\u
8bf7
order.not.update.dest.country
=
\u
4e0d
\u5141\u
8bb8
\u
4fee
\u6539\u
76ee
\u7684\u
56fd
order.not.update.departure
=
\u
4e0d
\u5141\u
8bb8
\u
4fee
\u6539\u
59cb
\u
53d1
\u5730
order.not.update.transport
=
\u
4e0d
\u5141\u
8bb8
\u
4fee
\u6539\u
8fd0
\u
8f93
\u
65b9
\u
5f0f
order.pre.installation.unpackaged.container.not.update
=
\u
8ba2
\u5355\u9884\u
88c5
\u
672a
\u
88c5
\u
67dc,
\u
8ba2
\u5355\u
4fe1
\u
606f
\u
65e0
\u
6cd5
\u
4fee
\u6539
order.sorting.not.shipment.not.update
=
\u
8ba2
\u5355\u5206\u
62e3
\u
672a
\u
51fa
\u
8d27,
\u
8ba2
\u5355\u
4fe1
\u
606f
\u
65e0
\u
6cd5
\u
4fee
\u6539
\ No newline at end of file
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