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
1d7bf23c
Commit
1d7bf23c
authored
Nov 05, 2024
by
zhengyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预装校验逻辑修改补充
parent
9173c71f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
26 deletions
+63
-26
ErrorCodeConstants.java
.../iocoder/yudao/module/order/enums/ErrorCodeConstants.java
+1
-0
BoxPreloadGoodsServiceImpl.java
...t/service/boxPreloadGoods/BoxPreloadGoodsServiceImpl.java
+57
-24
messages.properties
yudao-server/src/main/resources/i18n/messages.properties
+2
-1
messages_en.properties
yudao-server/src/main/resources/i18n/messages_en.properties
+2
-1
messages_zh.properties
yudao-server/src/main/resources/i18n/messages_zh.properties
+1
-0
No files found.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/enums/ErrorCodeConstants.java
View file @
1d7bf23c
...
...
@@ -430,4 +430,5 @@ public interface ErrorCodeConstants {
ErrorCode
ORDER_NOT_IS_OVERSEAS_WAREHOUSE_ORDER
=
new
ErrorCode
(
1004001170
,
"order.not.is.overseas.warehouse.order"
);
ErrorCode
ORDER_APPROVAL_IS_NOT_EXISTS
=
new
ErrorCode
(
1004001171
,
"order.approval.is.not.exists"
);
ErrorCode
FEE_APPLICATION_NOT_IS_ZERO
=
new
ErrorCode
(
1004001172
,
"fee.application.not.is.zero"
);
ErrorCode
GUAN_LIAN_ORDER_IS_APPROVAL_IN_PROCESS
=
new
ErrorCode
(
1004001173
,
"guan.lian.order.is.approval.in.process"
);
}
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/service/boxPreloadGoods/BoxPreloadGoodsServiceImpl.java
View file @
1d7bf23c
package
cn
.
iocoder
.
yudao
.
module
.
shipment
.
service
.
boxPreloadGoods
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.iocoder.yudao.framework.apollo.core.event.Order.OrderApprovalTypeCheckEvent
;
import
cn.iocoder.yudao.framework.common.exception.ServiceException
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
...
...
@@ -30,6 +31,7 @@ import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO;
import
cn.iocoder.yudao.module.order.enums.OrderStatusEnum
;
import
cn.iocoder.yudao.module.order.service.order.*
;
import
cn.iocoder.yudao.module.order.service.orderException.OrderExceptionService
;
import
cn.iocoder.yudao.module.order.vo.order.GuanLianOrderStatusVO
;
import
cn.iocoder.yudao.module.order.vo.order.OrderPreloadReq
;
import
cn.iocoder.yudao.module.order.vo.order.OrderPreloadVO
;
import
cn.iocoder.yudao.module.order.vo.orderGuanlian.OrderTree
;
...
...
@@ -68,6 +70,7 @@ import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataExpo
import
cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO
;
import
cn.iocoder.yudao.module.system.service.dict.DictDataService
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.google.common.base.Joiner
;
...
...
@@ -88,8 +91,7 @@ import java.util.stream.Collectors;
import
java.util.stream.Stream
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
yudao
.
module
.
order
.
enums
.
ErrorCodeConstants
.
ORDER_HAS_PROCESSING_APPROVAL
;
import
static
cn
.
iocoder
.
yudao
.
module
.
order
.
enums
.
ErrorCodeConstants
.
ORDER_IS_APPROVAL_IN_PROCESS
;
import
static
cn
.
iocoder
.
yudao
.
module
.
order
.
enums
.
ErrorCodeConstants
.*;
import
static
cn
.
iocoder
.
yudao
.
module
.
order
.
enums
.
OrderApprovalTypeEnum
.
ORDER_UPDATE
;
import
static
cn
.
iocoder
.
yudao
.
module
.
shipment
.
enums
.
ErrorCodeConstants
.*;
...
...
@@ -200,6 +202,24 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
if
(
approvalTypeCheckEvent
.
getResult
())
{
throw
exception
(
ORDER_IS_APPROVAL_IN_PROCESS
);
}
// 2024-11-5 注意:此处要关注关联订单,关联订单也是一并修改成不受费用申请和特价影响
if
(
StringUtils
.
isNotBlank
(
orderDO
.
getGuanLianOrderStatus
())){
List
<
GuanLianOrderStatusVO
>
guanLianOrderStatusVOList
=
JSONObject
.
parseArray
(
orderDO
.
getGuanLianOrderStatus
(),
GuanLianOrderStatusVO
.
class
);
if
(
CollectionUtil
.
isNotEmpty
(
guanLianOrderStatusVOList
)
&&
guanLianOrderStatusVOList
.
size
()
>
0
){
List
<
GuanLianOrderStatusVO
>
approvalGuanLianOrderList
=
guanLianOrderStatusVOList
.
stream
().
filter
(
vo
->
vo
.
getType
()
==
2
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
approvalGuanLianOrderList
)){
String
orderNoStr
=
approvalGuanLianOrderList
.
stream
().
filter
(
o
->
{
OrderApprovalTypeCheckEvent
guanLianApprovalTypeCheckEvent
=
new
OrderApprovalTypeCheckEvent
(
o
.
getOrderId
(),
null
,
null
,
Arrays
.
asList
(
1
,
2
,
3
,
4
,
5
,
12
,
31
,
32
)
,
false
);
applicationContext
.
publishEvent
(
guanLianApprovalTypeCheckEvent
);
return
guanLianApprovalTypeCheckEvent
.
getResult
();
}).
map
(
GuanLianOrderStatusVO:
:
getOrderNo
).
collect
(
Collectors
.
joining
(
StrUtil
.
COMMA
));
if
(
StringUtils
.
isNotBlank
(
orderNoStr
)){
throw
exception
(
GUAN_LIAN_ORDER_IS_APPROVAL_IN_PROCESS
,
orderNoStr
);
}
}
}
}
//如果都符合,下面展示互斥和关联订单的弹窗
Integer
relationStatus
=
createReqVO
.
getRelationStatus
();
//校验是否是互斥订单
...
...
@@ -257,9 +277,9 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
.
filter
(
t
->
t
.
getAbnormalState
()
!=
0
)
.
collect
(
Collectors
.
toList
());
List
<
OrderDO
>
auditList
=
orderList
.
stream
()
.
filter
(
t
->
t
.
getAuditType
()
!=
0
)
.
collect
(
Collectors
.
toList
());
//
List<OrderDO> auditList = orderList.stream()
//
.filter(t -> t.getAuditType() != 0)
//
.collect(Collectors.toList());
boolean
isSuit
=
true
;
if
(
CollectionUtil
.
isNotEmpty
(
notMatchStatusList
))
{
...
...
@@ -286,17 +306,17 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
sb
.
append
(
"订单:"
).
append
(
orderNos
).
append
(
"存在异常"
);
}
if
(
CollectionUtil
.
isNotEmpty
(
auditList
))
{
isSuit
=
false
;
if
(
hasRelationOrder
)
{
sb
.
append
(
"<br>"
);
}
List
<
String
>
orderNoList
=
auditList
.
stream
()
.
map
(
OrderDO:
:
getOrderNo
)
.
collect
(
Collectors
.
toList
());
String
orderNos
=
Joiner
.
on
(
","
).
join
(
orderNoList
);
sb
.
append
(
"订单:"
).
append
(
orderNos
).
append
(
"审核中"
);
}
//
if (CollectionUtil.isNotEmpty(auditList)) {
//
isSuit = false;
//
if (hasRelationOrder) {
//
sb.append("<br>");
//
}
//
List<String> orderNoList = auditList.stream()
//
.map(OrderDO::getOrderNo)
//
.collect(Collectors.toList());
//
String orderNos = Joiner.on(",").join(orderNoList);
//
sb.append("订单:").append(orderNos).append("审核中");
//
}
if
(!
isSuit
)
{
throw
new
ServiceException
(
500
,
sb
.
toString
());
...
...
@@ -433,11 +453,6 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
.
eq
(
BoxPreloadGoodsDO:
:
getIsRemove
,
0
)
);
OrderDO
orderDO
=
orderService
.
getById
(
orderId
);
OrderApprovalTypeCheckEvent
approvalTypeCheckEvent
=
new
OrderApprovalTypeCheckEvent
(
orderDO
.
getOrderId
(),
null
,
null
,
Arrays
.
asList
(
1
,
2
,
3
,
4
,
5
,
12
,
31
,
32
)
,
false
);
applicationContext
.
publishEvent
(
approvalTypeCheckEvent
);
if
(
approvalTypeCheckEvent
.
getResult
())
{
throw
exception
(
ORDER_IS_APPROVAL_IN_PROCESS
);
}
//校验是否符合预装。
checkInstallAvailable
(
boxDO
,
secId
,
loadList
,
orderDO
,
orderItemIdList
);
...
...
@@ -767,10 +782,28 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
OrderDO
orderDO
,
List
<
Long
>
orderItemIdList
)
{
//订单校验是否在审核中
Integer
auditType
=
orderDO
.
getAuditType
();
if
(
auditType
!=
0
)
{
throw
exception
(
ORDER_HAS_PROCESSING_APPROVAL
,
orderDO
.
getOrderNo
());
OrderApprovalTypeCheckEvent
approvalTypeCheckEvent
=
new
OrderApprovalTypeCheckEvent
(
orderDO
.
getOrderId
(),
null
,
null
,
Arrays
.
asList
(
1
,
2
,
3
,
4
,
5
,
12
,
31
,
32
)
,
false
);
applicationContext
.
publishEvent
(
approvalTypeCheckEvent
);
if
(
approvalTypeCheckEvent
.
getResult
())
{
throw
exception
(
ORDER_IS_APPROVAL_IN_PROCESS
);
}
// 2024-11-5 注意:此处要关注关联订单,关联订单也是一并修改成不受费用申请和特价影响
// if (StringUtils.isNotBlank(orderDO.getGuanLianOrderStatus())){
// List<GuanLianOrderStatusVO> guanLianOrderStatusVOList = JSONObject.parseArray(orderDO.getGuanLianOrderStatus(), GuanLianOrderStatusVO.class);
// if (CollectionUtil.isNotEmpty(guanLianOrderStatusVOList) && guanLianOrderStatusVOList.size() > 0){
// List<GuanLianOrderStatusVO> approvalGuanLianOrderList = guanLianOrderStatusVOList.stream().filter(vo -> vo.getType() == 2).collect(Collectors.toList());
// if (CollectionUtil.isNotEmpty(approvalGuanLianOrderList)){
// String orderNoStr = approvalGuanLianOrderList.stream().filter(o -> {
// OrderApprovalTypeCheckEvent guanLianApprovalTypeCheckEvent = new OrderApprovalTypeCheckEvent(o.getOrderId(), null, null, Arrays.asList(1,2,3,4,5,12,31,32) , false);
// applicationContext.publishEvent(guanLianApprovalTypeCheckEvent);
// return guanLianApprovalTypeCheckEvent.getResult();
// }).map(GuanLianOrderStatusVO::getOrderNo).collect(Collectors.joining(StrUtil.COMMA));
// if (StringUtils.isNotBlank(orderNoStr)){
// throw exception(GUAN_LIAN_ORDER_IS_APPROVAL_IN_PROCESS, orderNoStr);
// }
// }
// }
// }
checkInstallItem
(
loadList
,
orderItemIdList
,
Collections
.
singletonList
(
orderDO
));
...
...
yudao-server/src/main/resources/i18n/messages.properties
View file @
1d7bf23c
...
...
@@ -307,4 +307,5 @@ area.code.not.null=
currency.id.not.null
=
order.approval.is.not.exists
=
fee.application.not.is.zero
=
\ No newline at end of file
fee.application.not.is.zero
=
guan.lian.order.is.approval.in.process
=
\ No newline at end of file
yudao-server/src/main/resources/i18n/messages_en.properties
View file @
1d7bf23c
...
...
@@ -1121,4 +1121,5 @@ area.code.not.null=The national mobile phone area code cannot be empty
currency.id.not.null
=
The country ID cannot be empty
order.approval.is.not.exists
=
Order approval type does not exist
fee.application.not.is.zero
=
The expense application amount is not 0, and cannot be directly deleted
\ No newline at end of file
fee.application.not.is.zero
=
The expense application amount is not 0, and cannot be directly deleted
guan.lian.order.is.approval.in.process
=
Related order [{}] has approval in progress
\ No newline at end of file
yudao-server/src/main/resources/i18n/messages_zh.properties
View file @
1d7bf23c
...
...
@@ -1122,3 +1122,4 @@ currency.id.not.null=\u56fd\u5bb6id\u4e0d\u80fd\u4e3a\u7a7a
order.approval.is.not.exists
=
\u
8ba2
\u5355\u
5ba1
\u6279\u
7c7b
\u
578b
\u
4e0d
\u
5b58
\u5728
fee.application.not.is.zero
=
\u
8d39
\u7528\u7533\u
8bf7
\u
91d1
\u
989d
\u
4e0d
\u
4e3a0
\u
ff0c
\u
4e0d
\u
80fd
\u
8fdb
\u
884c
\u
76f4
\u
63a5
\u5220\u9664
guan.lian.order.is.approval.in.process
=
\u5173\u8054\u
8ba2
\u5355\u3010
{}
\u3011\u6709\u
5ba1
\u6279\u
6b63
\u5728\u
8fdb
\u
884c
\u
4e2d
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