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
b8c4ba8e
Commit
b8c4ba8e
authored
Oct 23, 2024
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
空运预约入仓上限计价判断逻辑补充
parent
bb85817e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
5 deletions
+55
-5
OrderMapper.java
...coder/yudao/module/order/dal/mysql/order/OrderMapper.java
+19
-0
OrderBusinessServiceImpl.java
...le/order/service/order/impl/OrderBusinessServiceImpl.java
+8
-2
ProdCostCalculation.java
...r/yudao/module/product/component/ProdCostCalculation.java
+19
-3
ErrorCodeConstants.java
...ocoder/yudao/module/product/enums/ErrorCodeConstants.java
+3
-0
ProdConditionParam.java
...ocoder/yudao/module/product/param/ProdConditionParam.java
+4
-0
messages_en.properties
yudao-server/src/main/resources/i18n/messages_en.properties
+1
-0
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/dal/mysql/order/OrderMapper.java
View file @
b8c4ba8e
...
...
@@ -2988,6 +2988,25 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
})
BigDecimal
getOrderTotalVolumeByDeliveryDate
(
@Param
(
"deliveryDate"
)
Date
deliveryDate
,
@Param
(
"prodId"
)
Long
prodId
,
@Param
(
"orderItemId"
)
Long
orderItemId
);
@ResultType
(
BigDecimal
.
class
)
@Select
({
"<script>"
,
"SELECT"
,
"IFNULL(sum(oi.weight),0)"
,
"FROM"
,
"ecw_order_item oi "
,
"LEFT JOIN ecw_order o "
,
"on o.order_id = oi.order_id "
,
"WHERE"
,
"o.delivery_date = #{deliveryDate}"
,
"AND oi.prod_id = #{prodId}"
,
"<when test = 'orderItemId != null '>"
,
"AND oi.order_item_id != #{orderItemId}"
,
"</when>"
,
"</script>"
})
BigDecimal
getOrderTotalWeightByDeliveryDate
(
@Param
(
"deliveryDate"
)
Date
deliveryDate
,
@Param
(
"prodId"
)
Long
prodId
,
@Param
(
"orderItemId"
)
Long
orderItemId
);
@ResultType
(
OrderDO
.
class
)
@Select
({
"<script>"
,
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderBusinessServiceImpl.java
View file @
b8c4ba8e
...
...
@@ -3530,8 +3530,14 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
}
}
if
(
Objects
.
equals
(
orderDO
.
getStatus
(),
OrderStatusEnum
.
ORDER_PLACED
.
getValue
())
||
Objects
.
equals
(
orderDO
.
getStatus
(),
OrderStatusEnum
.
DRAFT
.
getValue
()))
{
BigDecimal
alreadyExistsTotalVolume
=
orderMapper
.
getOrderTotalVolumeByDeliveryDate
(
orderDO
.
getDeliveryDate
(),
orderItemDO
.
getProdId
(),
orderItemDO
.
getOrderItemId
());
param
.
setAlreadyExistsTotalVolume
(
Objects
.
isNull
(
alreadyExistsTotalVolume
)
?
BigDecimal
.
ZERO
:
alreadyExistsTotalVolume
);
if
(
orderDO
.
getTransportId
()
==
1
)
{
BigDecimal
alreadyExistsTotalVolume
=
orderMapper
.
getOrderTotalVolumeByDeliveryDate
(
orderDO
.
getDeliveryDate
(),
orderItemDO
.
getProdId
(),
orderItemDO
.
getOrderItemId
());
param
.
setAlreadyExistsTotalVolume
(
Objects
.
isNull
(
alreadyExistsTotalVolume
)
?
BigDecimal
.
ZERO
:
alreadyExistsTotalVolume
);
}
if
(
orderDO
.
getTransportId
()
==
3
)
{
BigDecimal
alreadyExistsTotalWeight
=
orderMapper
.
getOrderTotalWeightByDeliveryDate
(
orderDO
.
getDeliveryDate
(),
orderItemDO
.
getProdId
(),
orderItemDO
.
getOrderItemId
());
param
.
setAlreadyExistsTotalWeight
(
Objects
.
isNull
(
alreadyExistsTotalWeight
)
?
BigDecimal
.
ZERO
:
alreadyExistsTotalWeight
);
}
}
if
(
null
!=
orderItemDO
.
getOneSeaFreight
()
&&
...
...
yudao-module-product/yudao-module-product-core/src/main/java/cn/iocoder/yudao/module/product/component/ProdCostCalculation.java
View file @
b8c4ba8e
...
...
@@ -740,10 +740,26 @@ public class ProdCostCalculation {
}
if
(
productPriceDO
.
getNeedBook
()
==
1
)
{
// 预约入仓,控制上限
if
(
productPriceDO
.
getDayLimit
().
subtract
(
prodParam
.
getAlreadyExistsTotalVolume
().
add
(
prodParam
.
getVolume
())).
compareTo
(
BigDecimal
.
ZERO
)
<
0
)
{
throw
exception
(
PROD_VOLUME_BEYOND_DAY_UPPER_LIMIT
,
I18nMessage
.
getLang
()
==
0
?
prodParam
.
getProdTitleZh
()
:
prodParam
.
getProdTitleEn
());
if
(
transportId
==
1
)
{
if
(
Objects
.
isNull
(
productPriceDO
.
getDayLimit
())){
throw
exception
(
PROD_VOLUME_BEYOND_DAY_UPPER_LIMIT
);
}
// 海运预约入仓,控制上限
if
(
productPriceDO
.
getDayLimit
().
subtract
(
prodParam
.
getAlreadyExistsTotalVolume
().
add
(
prodParam
.
getVolume
())).
compareTo
(
BigDecimal
.
ZERO
)
<
0
)
{
throw
exception
(
PROD_VOLUME_BEYOND_DAY_UPPER_LIMIT
,
I18nMessage
.
getLang
()
==
0
?
prodParam
.
getProdTitleZh
()
:
prodParam
.
getProdTitleEn
());
}
}
if
(
transportId
==
3
)
{
if
(
Objects
.
isNull
(
productPriceDO
.
getWeightLimit
())){
throw
exception
(
PROD_VOLUME_BEYOND_DAY_UPPER_LIMIT
);
}
// 空运预约入仓,控制上限
if
(
productPriceDO
.
getWeightLimit
().
subtract
(
prodParam
.
getAlreadyExistsTotalWeight
().
add
(
prodParam
.
getWeight
())).
compareTo
(
BigDecimal
.
ZERO
)
<
0
)
{
throw
exception
(
PROD_WEIGHT_BEYOND_DAY_UPPER_LIMIT
,
I18nMessage
.
getLang
()
==
0
?
prodParam
.
getProdTitleZh
()
:
prodParam
.
getProdTitleEn
());
}
}
}
// 线路价格的单询状态
prodParam
.
setNeedOrderInquiry
(
productPriceDO
.
getNeedOrderInquiry
());
...
...
yudao-module-product/yudao-module-product-core/src/main/java/cn/iocoder/yudao/module/product/enums/ErrorCodeConstants.java
View file @
b8c4ba8e
...
...
@@ -91,5 +91,8 @@ public interface ErrorCodeConstants {
ErrorCode
PRODUCT_BRANK_ENGLISH_NAME_EXISTS
=
new
ErrorCode
(
1004001067
,
"product.brand.english.name.exist"
);
ErrorCode
PROD_WEIGHT_BEYOND_DAY_UPPER_LIMIT
=
new
ErrorCode
(
1004001068
,
"prod.weight.beyond.day.upper.limit"
);
}
yudao-module-product/yudao-module-product-core/src/main/java/cn/iocoder/yudao/module/product/param/ProdConditionParam.java
View file @
b8c4ba8e
...
...
@@ -170,6 +170,10 @@ public class ProdConditionParam {
* 已存在订单商品的同一天送货总方数
*/
private
BigDecimal
alreadyExistsTotalVolume
=
BigDecimal
.
ZERO
;
/**
* 已存在订单商品的同一天送货总重量
*/
private
BigDecimal
alreadyExistsTotalWeight
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
value
=
"是否特价"
)
private
Boolean
specialPriceType
=
false
;
...
...
yudao-server/src/main/resources/i18n/messages_en.properties
View file @
b8c4ba8e
...
...
@@ -303,6 +303,7 @@ order.label.overlap=order label is overlap
transfer.goods.order.not.null
=
The goods transfer order cannot be empty
file.format.is.excel
=
The file format only supports excel
prod.volume.beyond.day.upper.limit
=
Quantity of {} commodity exceeds the upper limit of acceptance of the warehouse on the current day
prod.weight.beyond.day.upper.limit
=
The weight of the product {} exceeds the warehouse's daily acceptance limit
coupon.full.reduce.value.gt.payment.value
=
The full impairment of preferential activities cannot be greater than the original value
coupon.full.net.value.gt.payment.value
=
The full price of the promotional activities cannot be greater than the original price
coupon.currency.or.unit.not.null
=
The currency unit or measurement unit of preferential activity conditions cannot be blank
...
...
yudao-server/src/main/resources/i18n/messages_zh.properties
View file @
b8c4ba8e
...
...
@@ -300,6 +300,7 @@ order.label.overlap=\u6807\u7B7E\u53F7\u672C\u8EAB\u5B58\u5728\u91CD\u53E0
transfer.goods.order.not.null
=
\u
8C03
\u
8D27
\u
8BA2
\u5355\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
file.format.is.excel
=
\u6587\u
4EF6
\u
683C
\u
5F0F
\u
53EA
\u
652F
\u6301
excel
prod.volume.beyond.day.upper.limit
=
\u5546\u
54C1{}
\u
65B9
\u6570\u
8D85
\u
51FA
\u
4ED3
\u
5E93
\u
5F53
\u
65E5
\u
63A5
\u
53D7
\u
4E0A
\u9650
prod.weight.beyond.day.upper.limit
=
\u5546\u
54c1{}
\u
91cd
\u
91cf
\u
8d85
\u
51fa
\u
4ed3
\u
5e93
\u
5f53
\u
65e5
\u
63a5
\u
53d7
\u
4e0a
\u9650
coupon.full.reduce.value.gt.payment.value
=
\u
4F18
\u
60E0
\u
6D3B
\u
52A8
\u
6EE1
\u
51CF
\u
503C
\u
4E0D
\u
80FD
\u5927\u
4E8E
\u
539F
\u
503C
coupon.full.net.value.gt.payment.value
=
\u
4F18
\u
60E0
\u
6D3B
\u
52A8
\u7684\u
6EE1
\u6536\u
4EF7
\u
4E0D
\u
80FD
\u5927\u
4E8E
\u
539F
\u
4EF7
coupon.currency.or.unit.not.null
=
\u
4F18
\u
60E0
\u
6D3B
\u
52A8
\u6761\u
4EF6
\u
8D27
\u
5E01
\u5355\u
4F4D
\u6216\u
8BA1
\u
91CF
\u5355\u
4F4D
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
...
...
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