Commit e01a85ed97dfff090fa5e79f2d10933a154c6b38
1 parent
b8b53e1d
update:增加运输费
Showing
6 changed files
with
44 additions
and
1 deletions
etrade-order/src/main/java/com/diligrp/etrade/order/domain/OrderCreateDto.java
1 | package com.diligrp.etrade.order.domain; | 1 | package com.diligrp.etrade.order.domain; |
2 | 2 | ||
3 | +import com.diligrp.etrade.order.util.NumberTransform; | ||
3 | import com.diligrp.etrade.shop.domain.response.ShopVo; | 4 | import com.diligrp.etrade.shop.domain.response.ShopVo; |
4 | import jakarta.validation.Valid; | 5 | import jakarta.validation.Valid; |
5 | import jakarta.validation.constraints.Min; | 6 | import jakarta.validation.constraints.Min; |
@@ -143,6 +144,9 @@ public class OrderCreateDto{ | @@ -143,6 +144,9 @@ public class OrderCreateDto{ | ||
143 | @Valid | 144 | @Valid |
144 | private OrderDeliveryDto delivery; | 145 | private OrderDeliveryDto delivery; |
145 | 146 | ||
147 | + /** 配送费用 */ | ||
148 | + private BigDecimal transportFee = NumberTransform.ZERO; | ||
149 | + | ||
146 | public Integer getAchieveType() { | 150 | public Integer getAchieveType() { |
147 | return achieveType; | 151 | return achieveType; |
148 | } | 152 | } |
@@ -438,4 +442,12 @@ public class OrderCreateDto{ | @@ -438,4 +442,12 @@ public class OrderCreateDto{ | ||
438 | public void setDelivery(OrderDeliveryDto delivery) { | 442 | public void setDelivery(OrderDeliveryDto delivery) { |
439 | this.delivery = delivery; | 443 | this.delivery = delivery; |
440 | } | 444 | } |
445 | + | ||
446 | + public BigDecimal getTransportFee() { | ||
447 | + return transportFee; | ||
448 | + } | ||
449 | + | ||
450 | + public void setTransportFee(BigDecimal transportFee) { | ||
451 | + this.transportFee = transportFee; | ||
452 | + } | ||
441 | } | 453 | } |
etrade-order/src/main/java/com/diligrp/etrade/order/model/Order.java
@@ -279,6 +279,9 @@ public class Order { | @@ -279,6 +279,9 @@ public class Order { | ||
279 | /** 订单配送状态 */ | 279 | /** 订单配送状态 */ |
280 | private Integer achieveState; | 280 | private Integer achieveState; |
281 | 281 | ||
282 | + /** 运费 */ | ||
283 | + private Long transportFee; | ||
284 | + | ||
282 | public Integer getAchieveType() { | 285 | public Integer getAchieveType() { |
283 | return achieveType; | 286 | return achieveType; |
284 | } | 287 | } |
@@ -734,4 +737,12 @@ public class Order { | @@ -734,4 +737,12 @@ public class Order { | ||
734 | public void setRelationId(Long relationId) { | 737 | public void setRelationId(Long relationId) { |
735 | this.relationId = relationId; | 738 | this.relationId = relationId; |
736 | } | 739 | } |
740 | + | ||
741 | + public Long getTransportFee() { | ||
742 | + return transportFee; | ||
743 | + } | ||
744 | + | ||
745 | + public void setTransportFee(Long transportFee) { | ||
746 | + this.transportFee = transportFee; | ||
747 | + } | ||
737 | } | 748 | } |
738 | \ No newline at end of file | 749 | \ No newline at end of file |
etrade-order/src/main/java/com/diligrp/etrade/order/model/OrderPayment.java
@@ -87,6 +87,11 @@ public class OrderPayment { | @@ -87,6 +87,11 @@ public class OrderPayment { | ||
87 | */ | 87 | */ |
88 | private Long relationId; | 88 | private Long relationId; |
89 | 89 | ||
90 | + /** | ||
91 | + * 运费 | ||
92 | + */ | ||
93 | + private Long transportFee; | ||
94 | + | ||
90 | public Long getTotleSellerFee() { | 95 | public Long getTotleSellerFee() { |
91 | return totleSellerFee; | 96 | return totleSellerFee; |
92 | } | 97 | } |
@@ -344,4 +349,12 @@ public class OrderPayment { | @@ -344,4 +349,12 @@ public class OrderPayment { | ||
344 | public void setRelationId(Long relationId) { | 349 | public void setRelationId(Long relationId) { |
345 | this.relationId = relationId; | 350 | this.relationId = relationId; |
346 | } | 351 | } |
352 | + | ||
353 | + public Long getTransportFee() { | ||
354 | + return transportFee; | ||
355 | + } | ||
356 | + | ||
357 | + public void setTransportFee(Long transportFee) { | ||
358 | + this.transportFee = transportFee; | ||
359 | + } | ||
347 | } | 360 | } |
348 | \ No newline at end of file | 361 | \ No newline at end of file |
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/OrderGoodsServiceImpl.java
@@ -185,7 +185,10 @@ public class OrderGoodsServiceImpl implements OrderGoodsService { | @@ -185,7 +185,10 @@ public class OrderGoodsServiceImpl implements OrderGoodsService { | ||
185 | waitCouponAmount = waitCouponAmount.subtract(couponAmount); | 185 | waitCouponAmount = waitCouponAmount.subtract(couponAmount); |
186 | } | 186 | } |
187 | } | 187 | } |
188 | - | 188 | + //配送情况增加计算运费 |
189 | + if(buyerOrderDto.getAchieveType().equals(OrderAchieveType.SELLER_DELIVERY.getCodeInteger())){ | ||
190 | + allmount.add(buyerOrderDto.getTransportFee()); | ||
191 | + } | ||
189 | //效验库存 | 192 | //效验库存 |
190 | for(Long key:validateStockMap.keySet()){ | 193 | for(Long key:validateStockMap.keySet()){ |
191 | ProductCheckDto productDtotemp = validateStockMap.get(key); | 194 | ProductCheckDto productDtotemp = validateStockMap.get(key); |
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/OrderPaymenServiceImpl.java
@@ -394,6 +394,7 @@ public class OrderPaymenServiceImpl implements OrderPaymentService { | @@ -394,6 +394,7 @@ public class OrderPaymenServiceImpl implements OrderPaymentService { | ||
394 | }else{ | 394 | }else{ |
395 | orderPayment = new OrderPayment(); | 395 | orderPayment = new OrderPayment(); |
396 | } | 396 | } |
397 | + orderPayment.setTransportFee(order.getTransportFee()); | ||
397 | orderPayment.setMarketId(order.getMarketId()); | 398 | orderPayment.setMarketId(order.getMarketId()); |
398 | orderPayment.setOrderId(order.getId()); | 399 | orderPayment.setOrderId(order.getId()); |
399 | orderPayment.setOrderCode(order.getCode()); | 400 | orderPayment.setOrderCode(order.getCode()); |
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/OrderServiceImpl.java
@@ -1135,6 +1135,9 @@ public class OrderServiceImpl implements OrderService { | @@ -1135,6 +1135,9 @@ public class OrderServiceImpl implements OrderService { | ||
1135 | order.setTotleAmount(buyerOrderDto.getTotleAmount().multiply(new BigDecimal(100)).longValue()); | 1135 | order.setTotleAmount(buyerOrderDto.getTotleAmount().multiply(new BigDecimal(100)).longValue()); |
1136 | order.setTotleDiscount(buyerOrderDto.getTotleDiscount().multiply(new BigDecimal(100)).longValue()); | 1136 | order.setTotleDiscount(buyerOrderDto.getTotleDiscount().multiply(new BigDecimal(100)).longValue()); |
1137 | order.setTotleWeight(buyerOrderDto.getTotleWeight().multiply(new BigDecimal(500)).longValue()); | 1137 | order.setTotleWeight(buyerOrderDto.getTotleWeight().multiply(new BigDecimal(500)).longValue()); |
1138 | + if(buyerOrderDto.getAchieveType().equals(OrderAchieveType.SELLER_DELIVERY.getCodeInteger())&&buyerOrderDto.getTransportFee()!=null){ | ||
1139 | + order.setTransportFee(buyerOrderDto.getTransportFee().multiply(new BigDecimal(100)).longValue()); | ||
1140 | + } | ||
1138 | order.setTotlePaidAmount(0L); | 1141 | order.setTotlePaidAmount(0L); |
1139 | order.setTotlePayAmount(buyerOrderDto.getTotlePayAmount().multiply(new BigDecimal(100)).longValue()); | 1142 | order.setTotlePayAmount(buyerOrderDto.getTotlePayAmount().multiply(new BigDecimal(100)).longValue()); |
1140 | order.setPayState(OrderPayState.WAIT_PAY.getCodeInteger()); | 1143 | order.setPayState(OrderPayState.WAIT_PAY.getCodeInteger()); |