Commit 15712231 by shuhu.hou@freemud.cn

Merge branch 'feature/20200330_结算页配送费' into develop

# Conflicts:
#	assortment-ordercenter-sdk/pom.xml
#	assortment-ordercenter-sdk/readme.md
#	order-application-service/pom.xml
parents aab06571 be871695
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<dependency> <dependency>
<groupId>cn.freemud</groupId> <groupId>cn.freemud</groupId>
<artifactId>ordercenter-sdk</artifactId> <artifactId>ordercenter-sdk</artifactId>
<version>1.1.8.RELEASE</version> <version>1.1.9.RELEASE</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.freemud.application.service.sdk</groupId> <groupId>com.freemud.application.service.sdk</groupId>
......
...@@ -19,4 +19,6 @@ ...@@ -19,4 +19,6 @@
| 1.1.8-SNAPSHOT| 预约单接单接口增加预约任务 | wuping | 2020-03-17 | | 1.1.8-SNAPSHOT| 预约单接单接口增加预约任务 | wuping | 2020-03-17 |
| 1.2.3.RELEASE | 预约单升级RELEASE | wuping | 2020-03-18 | | 1.2.3.RELEASE | 预约单升级RELEASE | wuping | 2020-03-18 |
| 1.2.4.RELEASE | 紧急需求 增加骑手电话 | 海波 | 2020-03-19 | | 1.2.4.RELEASE | 紧急需求 增加骑手电话 | 海波 | 2020-03-19 |
| 1.2.5.RELEASE | 满额减配送费 | dingkai | 2020-03-26 |
| 1.2.5.RELEASE | 满额减配送费 | 海波 | 2020-03-26 |
| 1.3.1-SNAPSHOT | 判断优化 | 丁凯 | 2020-03-27 | | 1.3.1-SNAPSHOT | 判断优化 | 丁凯 | 2020-03-27 |
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<version>1.0.0</version> <version>1.0.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>1.1.8.RELEASE</version> <version>1.1.9.RELEASE</version>
<artifactId>ordercenter-sdk</artifactId> <artifactId>ordercenter-sdk</artifactId>
<dependencies> <dependencies>
......
...@@ -12,4 +12,5 @@ ...@@ -12,4 +12,5 @@
| 1.1.6.RELEASE | 升级RELEASE | wuping | 2020-03-04 | | 1.1.6.RELEASE | 升级RELEASE | wuping | 2020-03-04 |
| 1.1.7-SNAPSHOT | 预约单支付成功接口增加预约任务 | wuping | 2020-03-10 | | 1.1.7-SNAPSHOT | 预约单支付成功接口增加预约任务 | wuping | 2020-03-10 |
| 1.1.8-SNAPSHOT | 预约单接单接口增加预约任务 | wuping | 2020-03-17 | | 1.1.8-SNAPSHOT | 预约单接单接口增加预约任务 | wuping | 2020-03-17 |
| 1.1.8.RELEASE | 预约单升级RELEASE | wuping | 2020-03-18 | | 1.1.8.RELEASE | 预约单升级RELEASE | wuping | 2020-03-18 |
\ No newline at end of file | 1.1.9.RELEASE | 满额减配送费RELEASE | dingkai | 2020-03-26 |
\ No newline at end of file
...@@ -18,7 +18,7 @@ public class ApplicationConstant { ...@@ -18,7 +18,7 @@ public class ApplicationConstant {
public final static String BURYINGPOINT = "POINT"; public final static String BURYINGPOINT = "POINT";
public final static String DELIVERY_DISCOUNT_DESC1="订单满%d元 减%d配送费"; public final static String DELIVERY_DISCOUNT_DESC1="订单满%s元减%s元配送费";
public final static String DELIVERY_DISCOUNT_DESC2="订单满%d元 免配送费"; public final static String DELIVERY_DISCOUNT_DESC2="订单满%s元免配送费";
public final static String DELIVERY_DISCOUNT_DESC3="另需配送费%d元"; public final static String DELIVERY_DISCOUNT_DESC3="另需配送费%s元";
} }
...@@ -45,10 +45,6 @@ public class ShoppingCartGoodsResponseVo extends ShoppingCartGoodsBaseResponseV ...@@ -45,10 +45,6 @@ public class ShoppingCartGoodsResponseVo extends ShoppingCartGoodsBaseResponseV
* 总折扣价 * 总折扣价
*/ */
private Long totalDiscountAmount; private Long totalDiscountAmount;
/**
* 包装费
*/
private Long packAmount;
/** /**
* 新包装费(该字段给新版本前端展示,使其好计算) * 新包装费(该字段给新版本前端展示,使其好计算)
......
...@@ -106,8 +106,8 @@ public class BuySendPromotionService implements IPromotionService { ...@@ -106,8 +106,8 @@ public class BuySendPromotionService implements IPromotionService {
activityTip.setActivitySpuIds(activitySpuIds); activityTip.setActivitySpuIds(activitySpuIds);
// 当maxNum>=minNum,在加入买一赠一商品时提示“您参加的买赠优惠最多赠送N件哦~” // 当maxNum>=minNum,在加入买一赠一商品时提示“您参加的买赠优惠最多赠送N件哦~”
shoppingCartGoodsResponseVo.setBuyOneGetActivity(activityTip); shoppingCartGoodsResponseVo.setBuyOneGetActivity(activityTip);
Long packAmount = Objects.isNull(shoppingCartGoodsResponseVo.getPackAmount()) ? 0L : shoppingCartGoodsResponseVo.getPackAmount(); Long packAmount = Objects.isNull(shoppingCartGoodsResponseVo.getNewPackAmount()) ? 0L : shoppingCartGoodsResponseVo.getNewPackAmount();
shoppingCartGoodsResponseVo.setPackAmount(givePackAmount + packAmount); shoppingCartGoodsResponseVo.setNewPackAmount(givePackAmount + packAmount);
Long originalTotalAmount = Objects.isNull(shoppingCartGoodsResponseVo.getOriginalTotalAmount()) ? 0L : shoppingCartGoodsResponseVo.getOriginalTotalAmount(); Long originalTotalAmount = Objects.isNull(shoppingCartGoodsResponseVo.getOriginalTotalAmount()) ? 0L : shoppingCartGoodsResponseVo.getOriginalTotalAmount();
shoppingCartGoodsResponseVo.setOriginalTotalAmount(originalTotalAmount + giveTotalAmount); shoppingCartGoodsResponseVo.setOriginalTotalAmount(originalTotalAmount + giveTotalAmount);
Long totalDiscountAmount = Objects.isNull(shoppingCartGoodsResponseVo.getTotalDiscountAmount()) ? 0L : shoppingCartGoodsResponseVo.getTotalDiscountAmount(); Long totalDiscountAmount = Objects.isNull(shoppingCartGoodsResponseVo.getTotalDiscountAmount()) ? 0L : shoppingCartGoodsResponseVo.getTotalDiscountAmount();
......
...@@ -65,7 +65,6 @@ public class DefaultPromotionService implements IPromotionService { ...@@ -65,7 +65,6 @@ public class DefaultPromotionService implements IPromotionService {
} }
shoppingCartGoodsResponseVo.setOriginalTotalAmount(calculationDiscountResult == null ? totalOriginalAmount : calculationDiscountResult.getOriginalTotalAmount()); shoppingCartGoodsResponseVo.setOriginalTotalAmount(calculationDiscountResult == null ? totalOriginalAmount : calculationDiscountResult.getOriginalTotalAmount());
shoppingCartGoodsResponseVo.setTotalAmount(calculationDiscountResult == null ? totalAmount : calculationDiscountResult.getTotalAmount()); shoppingCartGoodsResponseVo.setTotalAmount(calculationDiscountResult == null ? totalAmount : calculationDiscountResult.getTotalAmount());
shoppingCartGoodsResponseVo.setPackAmount(totalPackgeAmount);
shoppingCartGoodsResponseVo.setNewPackAmount(totalPackgeAmount); shoppingCartGoodsResponseVo.setNewPackAmount(totalPackgeAmount);
shoppingCartGoodsResponseVo.setTotalDiscountAmount(calculationDiscountResult == null ? 0L : calculationDiscountResult.getTotalDiscountAmount()); shoppingCartGoodsResponseVo.setTotalDiscountAmount(calculationDiscountResult == null ? 0L : calculationDiscountResult.getTotalDiscountAmount());
} }
...@@ -80,7 +79,7 @@ public class DefaultPromotionService implements IPromotionService { ...@@ -80,7 +79,7 @@ public class DefaultPromotionService implements IPromotionService {
shoppingCartGoodsDto.setOriginalTotalAmount(shoppingCartGoodsResponseVo.getOriginalTotalAmount()); shoppingCartGoodsDto.setOriginalTotalAmount(shoppingCartGoodsResponseVo.getOriginalTotalAmount());
shoppingCartGoodsDto.setTotalAmount(shoppingCartGoodsResponseVo.getTotalAmount()); shoppingCartGoodsDto.setTotalAmount(shoppingCartGoodsResponseVo.getTotalAmount());
shoppingCartGoodsDto.setTotalDiscountAmount(shoppingCartGoodsResponseVo.getTotalDiscountAmount()); shoppingCartGoodsDto.setTotalDiscountAmount(shoppingCartGoodsResponseVo.getTotalDiscountAmount());
shoppingCartGoodsDto.setPackageAmount(shoppingCartGoodsResponseVo.getPackAmount()); shoppingCartGoodsDto.setPackageAmount(shoppingCartGoodsResponseVo.getNewPackAmount());
List<CartGoods> cartGoodsList = shoppingCartGoodsResponseVo.getProducts(); List<CartGoods> cartGoodsList = shoppingCartGoodsResponseVo.getProducts();
List<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.ApportionGoods> apportionGoodsList = List<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.ApportionGoods> apportionGoodsList =
calculationDiscountResult == null ? new ArrayList<>() : calculationDiscountResult.getApportionGoods(); calculationDiscountResult == null ? new ArrayList<>() : calculationDiscountResult.getApportionGoods();
......
...@@ -69,6 +69,7 @@ import org.springframework.stereotype.Service; ...@@ -69,6 +69,7 @@ import org.springframework.stereotype.Service;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -1006,7 +1007,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1006,7 +1007,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
*/ */
if(BusinessTypeEnum.SAAS_DELIVERY.getCode().equals(menuType)) { if(BusinessTypeEnum.SAAS_DELIVERY.getCode().equals(menuType)) {
DecimalFormat df = new DecimalFormat("###.##");
List<ActivityTypeEnum> activityTypeEnums = new LinkedList<>(); List<ActivityTypeEnum> activityTypeEnums = new LinkedList<>();
activityTypeEnums.add(ActivityTypeEnum.TYPE_14); activityTypeEnums.add(ActivityTypeEnum.TYPE_14);
...@@ -1032,10 +1033,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1032,10 +1033,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if(discount!=null){ if(discount!=null){
if(beanDto.getBenefitType() == 1){ if(beanDto.getBenefitType() == 1){
String desc = DELIVERY_DISCOUNT_DESC2; String desc = DELIVERY_DISCOUNT_DESC2;
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, beanDto.getThresholdAmount() /100 )); shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, df.format(beanDto.getThresholdAmount().doubleValue() /100) ));
}else{ }else{
String desc = DELIVERY_DISCOUNT_DESC1; String desc = DELIVERY_DISCOUNT_DESC1;
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, beanDto.getThresholdAmount() /100 ,beanDto.getDiscountAmount() / 100)); shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, df.format(beanDto.getThresholdAmount().doubleValue() /100) ,df.format(beanDto.getDiscountAmount().doubleValue() / 100)));
} }
shoppingCartGoodsResponseVo.setDeliveryAmount(calculationDiscountResult.getDeliveryAmount()); shoppingCartGoodsResponseVo.setDeliveryAmount(calculationDiscountResult.getDeliveryAmount());
shoppingCartGoodsResponseVo.setDiscountDeliveryAmount(calculationDiscountResult.getDistributionFee()); shoppingCartGoodsResponseVo.setDiscountDeliveryAmount(calculationDiscountResult.getDistributionFee());
...@@ -1047,10 +1048,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1047,10 +1048,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if(beanDto.getBenefitType() == 1){ if(beanDto.getBenefitType() == 1){
String desc = DELIVERY_DISCOUNT_DESC2; String desc = DELIVERY_DISCOUNT_DESC2;
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, beanDto.getThresholdAmount() /100 )); shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, df.format(beanDto.getThresholdAmount().doubleValue() /100) ));
}else{ }else{
String desc = DELIVERY_DISCOUNT_DESC1; String desc = DELIVERY_DISCOUNT_DESC1;
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, beanDto.getThresholdAmount() /100 ,beanDto.getDiscountAmount() / 100)); shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, df.format(beanDto.getThresholdAmount().doubleValue() /100 ),df.format(beanDto.getDiscountAmount().doubleValue() / 100)));
} }
shoppingCartGoodsResponseVo.setDeliveryAmount(deliveryAmount); shoppingCartGoodsResponseVo.setDeliveryAmount(deliveryAmount);
...@@ -1059,7 +1060,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1059,7 +1060,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}else{ }else{
String desc = DELIVERY_DISCOUNT_DESC3; String desc = DELIVERY_DISCOUNT_DESC3;
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, deliveryAmount.doubleValue() / 100)); shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, df.format(deliveryAmount.doubleValue() / 100)));
shoppingCartGoodsResponseVo.setDeliveryAmount(deliveryAmount); shoppingCartGoodsResponseVo.setDeliveryAmount(deliveryAmount);
shoppingCartGoodsResponseVo.setDiscountDeliveryAmount(deliveryAmount); shoppingCartGoodsResponseVo.setDiscountDeliveryAmount(deliveryAmount);
shoppingCartGoodsResponseVo.setIsDiscountDelivery(false); shoppingCartGoodsResponseVo.setIsDiscountDelivery(false);
...@@ -1291,26 +1292,22 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1291,26 +1292,22 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if (StringUtils.isNotEmpty(toastMsg)) { if (StringUtils.isNotEmpty(toastMsg)) {
setToastMsgIfNotExist(shoppingCartGoodsResponseVo, toastMsg); setToastMsgIfNotExist(shoppingCartGoodsResponseVo, toastMsg);
} }
// 给前端展示
shoppingCartGoodsResponseVo.setNewPackAmount(shoppingCartGoodsResponseVo.getPackAmount());
// 更新和添加商品时不需要包装费 // 更新和添加商品时不需要包装费
if (ShoppingCartConstant.ADD_AND_UPDATE.equals(opt)) { if (ShoppingCartConstant.ADD_AND_UPDATE.equals(opt)) {
shoppingCartGoodsResponseVo.setPackAmount(null); shoppingCartGoodsResponseVo.setNewPackAmount(null);
return; return;
} }
//========================== 购物车查询特有逻辑 ================================= //========================== 购物车查询特有逻辑 =================================
// 到店自取包装费设为null,外卖要计算包装费,flag为1表示去结算 // 到店自取包装费设为null,外卖要计算包装费,flag为1表示去结算
// 兼容老版本判断null // 兼容老版本判断null
if (Objects.equals(shoppingCartInfoRequestVo.getOrderType(), CreateOrderType.COLLECT_GOODS.getCode()) if (Objects.equals(shoppingCartInfoRequestVo.getOrderType(), CreateOrderType.COLLECT_GOODS.getCode())
&& (Objects.equals(shoppingCartInfoRequestVo.getReachStoreType(), null) && (Objects.equals(shoppingCartInfoRequestVo.getReachStoreType(), null)
|| Objects.equals(shoppingCartInfoRequestVo.getReachStoreType(), OrderType.EAT_IN.getCode()))) { || Objects.equals(shoppingCartInfoRequestVo.getReachStoreType(), OrderType.EAT_IN.getCode()))) {
shoppingCartGoodsResponseVo.setPackAmount(null); shoppingCartGoodsResponseVo.setNewPackAmount(null);
} else if ((Objects.equals(shoppingCartInfoRequestVo.getOrderType(), CreateOrderType.TAKE_OUT.getCode()) } else if ((Objects.equals(shoppingCartInfoRequestVo.getOrderType(), CreateOrderType.TAKE_OUT.getCode())
|| Objects.equals(shoppingCartInfoRequestVo.getReachStoreType(), OrderType.COLLECT_GOODS.getCode())) || Objects.equals(shoppingCartInfoRequestVo.getReachStoreType(), OrderType.COLLECT_GOODS.getCode()))
&& Objects.equals(shoppingCartInfoRequestVo.getFlag(), CouponFlag.YES.getCode())) { && Objects.equals(shoppingCartInfoRequestVo.getFlag(), CouponFlag.YES.getCode())) {
Long packAmount = shoppingCartGoodsResponseVo.getPackAmount() == null ? 0 : shoppingCartGoodsResponseVo.getPackAmount(); Long packAmount = shoppingCartGoodsResponseVo.getNewPackAmount() == null ? 0 : shoppingCartGoodsResponseVo.getNewPackAmount();
Long originalTotalAmount = shoppingCartGoodsResponseVo.getOriginalTotalAmount() + packAmount; Long originalTotalAmount = shoppingCartGoodsResponseVo.getOriginalTotalAmount() + packAmount;
Long totalAmount = shoppingCartGoodsResponseVo.getTotalAmount() + packAmount; Long totalAmount = shoppingCartGoodsResponseVo.getTotalAmount() + packAmount;
shoppingCartGoodsResponseVo.setOriginalTotalAmount(originalTotalAmount); shoppingCartGoodsResponseVo.setOriginalTotalAmount(originalTotalAmount);
...@@ -1512,14 +1509,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1512,14 +1509,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
} }
private Long calculateDeliveryAmount(String receiveId,String partnerId,String storeId,String wxappid){ private Long calculateDeliveryAmount(String receiveId,String partnerId,String storeId,String wxappid){
Long deliveryAmount=0l; Long deliveryAmount = 0l;
if(receiveId==null) { if(receiveId==null) {
//TODO 查询门店信息
StoreResponseDto storeResponseDto = storeService.getStoreInfo(partnerId, storeId);
//TODO 查询门店外卖信息
StoreDeliveryInfoDto storeDeliveryInfoDto = storeService.getStoreDeliveryInfo(storeResponseDto, wxappid);
deliveryAmount = storeDeliveryInfoDto.getDeliveryAmount();
}else{ }else{
deliveryAmount = Long.parseLong(getDeliveryAmount(receiveId,partnerId,storeId).toString()); deliveryAmount = Long.parseLong(getDeliveryAmount(receiveId,partnerId,storeId).toString());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment