Commit 364550d2 by 姜海波

调整浮点

parent b1f522c3
...@@ -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="另需配送费%s元"; public final static String DELIVERY_DISCOUNT_DESC3="另需配送费%s元";
} }
...@@ -1006,7 +1006,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1006,7 +1006,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 +1032,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1032,10 +1032,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 +1047,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1047,10 +1047,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);
...@@ -1058,7 +1058,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1058,7 +1058,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
shoppingCartGoodsResponseVo.setIsDiscountDelivery(false); shoppingCartGoodsResponseVo.setIsDiscountDelivery(false);
}else{ }else{
DecimalFormat df = new DecimalFormat("###.##");
String desc = DELIVERY_DISCOUNT_DESC3; String desc = DELIVERY_DISCOUNT_DESC3;
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, df.format(deliveryAmount.doubleValue() / 100))); shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, df.format(deliveryAmount.doubleValue() / 100)));
shoppingCartGoodsResponseVo.setDeliveryAmount(deliveryAmount); shoppingCartGoodsResponseVo.setDeliveryAmount(deliveryAmount);
......
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