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
95cf6b00
Commit
95cf6b00
authored
Mar 05, 2025
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
特价相关业务调整
parent
573c8467
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
55 deletions
+44
-55
OrderServiceImpl.java
...dao/module/order/service/order/impl/OrderServiceImpl.java
+44
-55
No files found.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderServiceImpl.java
View file @
95cf6b00
...
...
@@ -5235,17 +5235,17 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
// 校验是否有已核销的应收单,如果有,则不能再次入仓修改
receivableService
.
verificationReceivableIsWriteOff
(
null
,
orderItemDO
.
getOrderItemId
());
if
(
specialApplyVO
.
getApplyType
()
==
1
&&
specialApplyVO
.
getApplyType
()
==
2
)
{
if
(
specialApplyVO
.
getApplyType
()
==
1
||
specialApplyVO
.
getApplyType
()
==
2
)
{
if
(
Objects
.
isNull
(
specialApplyVO
.
getFreight
())
||
specialApplyVO
.
getFreight
().
compareTo
(
orderItemDO
.
getHiddenCommission
().
add
(
orderItemDO
.
getPlainCommission
()))
<=
0
)
{
throw
exception
(
FINAL_SALE_FREIGHT_AMOUNT_MUST_GT_ZERO
);
}
if
(
specialApplyVO
.
getFreight
().
compareTo
(
specialApplyVO
.
getOrgFreight
())
==
0
)
{
if
(
specialApplyVO
.
getFreight
().
compareTo
(
specialApplyVO
.
getOrgFreight
())
==
0
&&
Objects
.
equals
(
specialApplyVO
.
getFreightCurrency
(),
specialApplyVO
.
getOrgFreightCurrency
())
)
{
throw
exception
(
SPECIAL_APPLY_DISCOUNT_FREIGHT_NEW_AMOUNT_NOT_EQ_ORG_AMOUNT
);
}
if
(
Objects
.
isNull
(
specialApplyVO
.
getClearanceFreight
())
||
specialApplyVO
.
getClearanceFreight
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
{
throw
exception
(
FINAL_SALE_CLEARANCE_AMOUNT_MUST_GT_ZERO
);
}
if
(
specialApplyVO
.
getClearanceFreight
().
compareTo
(
specialApplyVO
.
getOrgClearanceFreight
())
==
0
)
{
if
(
specialApplyVO
.
getClearanceFreight
().
compareTo
(
specialApplyVO
.
getOrgClearanceFreight
())
==
0
&&
Objects
.
equals
(
specialApplyVO
.
getClearanceFreightCurrency
(),
specialApplyVO
.
getOrgClearanceFreightCurrency
())
)
{
throw
exception
(
SPECIAL_APPLY_DISCOUNT_CLEARANCE_NEW_AMOUNT_NOT_EQ_ORG_AMOUNT
);
}
}
...
...
@@ -5448,64 +5448,19 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
List
<
OrderItemDO
>
orderItemDOList
=
new
ArrayList
<>();
List
<
OrderSpecialBatchApplyOrderItemDetailVO
>
batchApplyOrderItemDetailVOList
=
specialBatchApplyVO
.
getBatchApplyOrderItemDetailVOList
();
if
(
CollectionUtil
.
isNotEmpty
(
batchApplyOrderItemDetailVOList
))
{
for
(
OrderSpecialBatchApplyOrderItemDetailVO
batchApplyOrderItemDetailVO
:
batchApplyOrderItemDetailVOList
)
{
OrderItemDO
orderItemDO
=
orderItemMapper
.
selectById
(
batchApplyOrderItemDetailVO
.
getOrderItemId
());
if
(
Objects
.
isNull
(
orderItemDO
))
{
throw
exception
(
ORDER_ITEM_PROD_NOT_EXISTS
);
}
// 校验是否有已核销的应收单,如果有,则不能再次入仓修改
receivableService
.
verificationReceivableIsWriteOff
(
null
,
orderItemDO
.
getOrderItemId
());
if
(
specialBatchApplyVO
.
getApplyType
()
==
1
&&
specialBatchApplyVO
.
getApplyType
()
==
2
)
{
if
(
Objects
.
isNull
(
batchApplyOrderItemDetailVO
.
getFreight
())
||
batchApplyOrderItemDetailVO
.
getFreight
().
compareTo
(
orderItemDO
.
getHiddenCommission
().
add
(
orderItemDO
.
getPlainCommission
()))
<=
0
)
{
throw
exception
(
FINAL_SALE_FREIGHT_AMOUNT_MUST_GT_ZERO
);
}
if
(
batchApplyOrderItemDetailVO
.
getFreight
().
compareTo
(
batchApplyOrderItemDetailVO
.
getOrgFreight
())
==
0
)
{
throw
exception
(
SPECIAL_APPLY_DISCOUNT_FREIGHT_NEW_AMOUNT_NOT_EQ_ORG_AMOUNT
);
}
if
(
Objects
.
isNull
(
batchApplyOrderItemDetailVO
.
getClearanceFreight
())
||
batchApplyOrderItemDetailVO
.
getClearanceFreight
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
{
throw
exception
(
FINAL_SALE_CLEARANCE_AMOUNT_MUST_GT_ZERO
);
}
if
(
batchApplyOrderItemDetailVO
.
getClearanceFreight
().
compareTo
(
batchApplyOrderItemDetailVO
.
getOrgClearanceFreight
())
==
0
)
{
throw
exception
(
SPECIAL_APPLY_DISCOUNT_CLEARANCE_NEW_AMOUNT_NOT_EQ_ORG_AMOUNT
);
}
}
orderItemDOList
.
add
(
orderItemDO
);
}
}
OrderApprovalDO
orderApprovalDO
=
orderApprovalMapper
.
newItemInfo
(
null
,
specialBatchApplyVO
.
getOrderId
(),
specialBatchApplyVO
.
getApplyType
());
if
(
Objects
.
nonNull
(
orderApprovalDO
)
&&
orderApprovalDO
.
getStatus
()
==
1
)
{
throw
exception
(
YOUR_APPLY_PENDING
);
}
orderApprovalDO
=
new
OrderApprovalDO
();
orderApprovalDO
.
setOrderId
(
specialBatchApplyVO
.
getOrderId
());
orderApprovalDO
.
setType
(
specialBatchApplyVO
.
getApplyType
());
orderApprovalDO
.
setFollowUpSalesmanId
(
String
.
valueOf
(
orderDO
.
getSalesmanId
()));
//跟进业务员为订单的跟进业务员
specialBatchApplyVO
.
setApplyStatus
(
1
);
orderApprovalDO
.
setDetails
(
JSONObject
.
toJSONString
(
specialBatchApplyVO
));
orderApprovalDO
.
setCreator
(
creator
);
orderApprovalDO
.
setUpdater
(
creator
);
orderApprovalDO
.
setCreateTime
(
new
Date
());
orderApprovalDO
.
setUpdateTime
(
new
Date
());
orderApprovalMapper
.
insert
(
orderApprovalDO
);
// 创建流程实例
String
key
=
null
;
List
<
ApplyInfoVO
>
applyInfoVOList
=
new
ArrayList
<>();
Map
<
Integer
,
CurrencyRespDTO
>
currencyRespDTOMap
=
currencyApi
.
getAllCurrency
();
Map
<
Integer
,
UnitRespDto
>
unitRespDtoMap
=
unitApi
.
getAllUnit
();
// BoxCheckOrderSchedulingEvent event = new BoxCheckOrderSchedulingEvent(orderDO.getOrderId());
if
(
CollectionUtil
.
isNotEmpty
(
specialBatchApplyVO
.
getBatchApplyOrderItemDetailVOList
()))
{
if
(
CollectionUtil
.
isNotEmpty
(
batchApplyOrderItemDetailVOList
))
{
for
(
OrderSpecialBatchApplyOrderItemDetailVO
vo
:
specialBatchApplyVO
.
getBatchApplyOrderItemDetailVOList
())
{
for
(
OrderSpecialBatchApplyOrderItemDetailVO
vo
:
batchApplyOrderItemDetailVOList
)
{
OrderItemDO
orderItemDO
=
orderItemMapper
.
selectById
(
vo
.
getOrderItemId
());
if
(
Objects
.
isNull
(
orderItemDO
))
{
throw
exception
(
ORDER_ITEM_PROD_NOT_EXISTS
);
}
ApplyInfoVO
applyInfoVO
=
new
ApplyInfoVO
();
switch
(
specialBatchApplyVO
.
getApplyType
())
{
case
31
:
applyInfoVO
.
setName
(
vo
.
getProdTitleZh
()
+
(
vo
.
getCharging
()
==
1
?
"全包价优惠"
:
"运费优惠"
));
...
...
@@ -5556,10 +5511,44 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
default
:
throw
exception
(
ORDER_APPLY_TYPE_NOT_EXISTS
);
}
// 校验是否有已核销的应收单,如果有,则不能再次入仓修改
receivableService
.
verificationReceivableIsWriteOff
(
null
,
orderItemDO
.
getOrderItemId
());
if
(
specialBatchApplyVO
.
getApplyType
()
==
1
||
specialBatchApplyVO
.
getApplyType
()
==
2
)
{
if
(
Objects
.
isNull
(
vo
.
getFreight
())
||
vo
.
getFreight
().
compareTo
(
orderItemDO
.
getHiddenCommission
().
add
(
orderItemDO
.
getPlainCommission
()))
<=
0
)
{
throw
exception
(
FINAL_SALE_FREIGHT_AMOUNT_MUST_GT_ZERO
);
}
if
(
vo
.
getFreight
().
compareTo
(
vo
.
getOrgFreight
())
==
0
&&
Objects
.
equals
(
vo
.
getFreightCurrency
(),
vo
.
getOrgFreightCurrency
()))
{
throw
exception
(
SPECIAL_APPLY_DISCOUNT_FREIGHT_NEW_AMOUNT_NOT_EQ_ORG_AMOUNT
);
}
if
(
Objects
.
isNull
(
vo
.
getClearanceFreight
())
||
vo
.
getClearanceFreight
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
{
throw
exception
(
FINAL_SALE_CLEARANCE_AMOUNT_MUST_GT_ZERO
);
}
if
(
vo
.
getClearanceFreight
().
compareTo
(
vo
.
getOrgClearanceFreight
())
==
0
&&
Objects
.
equals
(
vo
.
getClearanceFreightCurrency
(),
vo
.
getOrgClearanceFreightCurrency
()))
{
throw
exception
(
SPECIAL_APPLY_DISCOUNT_CLEARANCE_NEW_AMOUNT_NOT_EQ_ORG_AMOUNT
);
}
}
orderItemDOList
.
add
(
orderItemDO
);
}
}
OrderApprovalDO
orderApprovalDO
=
orderApprovalMapper
.
newItemInfo
(
null
,
specialBatchApplyVO
.
getOrderId
(),
specialBatchApplyVO
.
getApplyType
());
if
(
Objects
.
nonNull
(
orderApprovalDO
)
&&
orderApprovalDO
.
getStatus
()
==
1
)
{
throw
exception
(
YOUR_APPLY_PENDING
);
}
orderApprovalDO
=
new
OrderApprovalDO
();
orderApprovalDO
.
setOrderId
(
specialBatchApplyVO
.
getOrderId
());
orderApprovalDO
.
setType
(
specialBatchApplyVO
.
getApplyType
());
orderApprovalDO
.
setFollowUpSalesmanId
(
String
.
valueOf
(
orderDO
.
getSalesmanId
()));
//跟进业务员为订单的跟进业务员
specialBatchApplyVO
.
setApplyStatus
(
1
);
orderApprovalDO
.
setDetails
(
JSONObject
.
toJSONString
(
specialBatchApplyVO
));
orderApprovalDO
.
setCreator
(
creator
);
orderApprovalDO
.
setUpdater
(
creator
);
orderApprovalDO
.
setCreateTime
(
new
Date
());
orderApprovalDO
.
setUpdateTime
(
new
Date
());
orderApprovalMapper
.
insert
(
orderApprovalDO
);
// 创建流程实例
// BoxCheckOrderSchedulingEvent event = new BoxCheckOrderSchedulingEvent(orderDO.getOrderId());
String
formId
=
bpmCreateServiceFactory
.
createBmp
(
Long
.
valueOf
(
creator
),
orderApprovalDO
.
getOrderApprovalId
(),
key
,
orderDO
.
getOrderNo
(),
StringUtils
.
isNotBlank
(
specialBatchApplyVO
.
getCcIds
())
?
specialBatchApplyVO
.
getCcIds
().
split
(
StrUtil
.
COMMA
)
:
null
);
...
...
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