|
|
@ -1892,8 +1892,8 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 下单
|
|
|
|
// 下单
|
|
|
|
jsonObject = QianZhuConfig.starbucksOrders(user.getId().toString(), object.getString("storeCode"), List.toString().replace(" ", ""), object.getString("customerMobile")); |
|
|
|
// jsonObject = QianZhuConfig.starbucksOrders(user.getId().toString(), object.getString("storeCode"), List.toString().replace(" ", ""), object.getString("customerMobile"));
|
|
|
|
// jsonObject = QianZhuConfig.starbucksOrders(user.getId().toString(), "50562", List.toString().replace(" ", ""), object.getString("customerMobile"));
|
|
|
|
jsonObject = QianZhuConfig.starbucksOrders(user.getId().toString(), "50562", List.toString().replace(" ", ""), object.getString("customerMobile")); |
|
|
|
|
|
|
|
|
|
|
|
// 判断下单是否成功
|
|
|
|
// 判断下单是否成功
|
|
|
|
if (!Objects.equals(jsonObject.getString("code"), "200")) { |
|
|
|
if (!Objects.equals(jsonObject.getString("code"), "200")) { |
|
|
@ -1940,18 +1940,19 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
childOrder.setGoodsImg(childObject.getString("imgUrl")); |
|
|
|
childOrder.setGoodsImg(childObject.getString("imgUrl")); |
|
|
|
childOrder.setSaleCount(childObject.getInteger("quantity")); |
|
|
|
childOrder.setSaleCount(childObject.getInteger("quantity")); |
|
|
|
childOrder.setGoodsPrice(childObject.getBigDecimal("marketPrice")); |
|
|
|
childOrder.setGoodsPrice(childObject.getBigDecimal("marketPrice")); |
|
|
|
if (object.getLong("memDiscountId") != null) { |
|
|
|
|
|
|
|
childOrder.setGoodsActualPrice(childObject.getBigDecimal("marketPrice")); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
childOrder.setGoodsActualPrice(childObject.getBigDecimal("unitPrice")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 计算利润
|
|
|
|
// 计算利润
|
|
|
|
BigDecimal profitPrice = childOrder.getGoodsActualPrice().multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100))); |
|
|
|
BigDecimal profitPrice = childObject.getBigDecimal("marketPrice").multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100))); |
|
|
|
// 计算子订单支付金额
|
|
|
|
// 计算子订单支付金额
|
|
|
|
BigDecimal childPrice = childOrder.getGoodsActualPrice().add(profitPrice).setScale(2 , RoundingMode.HALF_UP); |
|
|
|
BigDecimal childPrice = childObject.getBigDecimal("unitPrice").add(profitPrice).setScale(2 , RoundingMode.HALF_UP); |
|
|
|
if (childPrice.compareTo(childObject.getBigDecimal("marketPrice")) > 0) { |
|
|
|
if (childPrice.compareTo(childObject.getBigDecimal("marketPrice")) > 0) { |
|
|
|
childPrice = childObject.getBigDecimal("marketPrice"); |
|
|
|
childPrice = childObject.getBigDecimal("marketPrice"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (object.getLong("memDiscountId") != null) { |
|
|
|
|
|
|
|
childOrder.setGoodsActualPrice(childObject.getBigDecimal("marketPrice")); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
childOrder.setGoodsActualPrice(childPrice); |
|
|
|
|
|
|
|
} |
|
|
|
childPrice = childPrice.multiply(childObject.getBigDecimal("quantity")); |
|
|
|
childPrice = childPrice.multiply(childObject.getBigDecimal("quantity")); |
|
|
|
// 计算总订单实际支付金额
|
|
|
|
// 计算总订单实际支付金额
|
|
|
|
orderPayPrice = orderPayPrice.add(childPrice); |
|
|
|
orderPayPrice = orderPayPrice.add(childPrice); |
|
|
@ -2008,20 +2009,20 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
childOrder.setGoodsImg(childObject.getString("imageUrl")); |
|
|
|
childOrder.setGoodsImg(childObject.getString("imageUrl")); |
|
|
|
childOrder.setSaleCount(childObject.getInteger("quantity")); |
|
|
|
childOrder.setSaleCount(childObject.getInteger("quantity")); |
|
|
|
childOrder.setGoodsPrice(childObject.getBigDecimal("originPrice")); |
|
|
|
childOrder.setGoodsPrice(childObject.getBigDecimal("originPrice")); |
|
|
|
if (object.getLong("memDiscountId") != null) { |
|
|
|
|
|
|
|
childOrder.setGoodsActualPrice(childObject.getBigDecimal("originPrice")); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
childOrder.setGoodsActualPrice(childObject.getBigDecimal("price")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 计算利润
|
|
|
|
// 计算利润
|
|
|
|
BigDecimal profitPrice = childOrder.getGoodsActualPrice().multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100))); |
|
|
|
BigDecimal profitPrice = childObject.getBigDecimal("originPrice").multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100))); |
|
|
|
// 计算子订单支付金额
|
|
|
|
// 计算子订单支付金额
|
|
|
|
BigDecimal childPrice = childOrder.getGoodsActualPrice().add(profitPrice).setScale(2 , RoundingMode.HALF_UP); |
|
|
|
BigDecimal childPrice = childObject.getBigDecimal("price").add(profitPrice).setScale(2 , RoundingMode.HALF_UP); |
|
|
|
if (childPrice.compareTo(childObject.getBigDecimal("originPrice")) > 0) { |
|
|
|
if (childPrice.compareTo(childObject.getBigDecimal("originPrice")) > 0) { |
|
|
|
childPrice = childObject.getBigDecimal("originPrice"); |
|
|
|
childPrice = childObject.getBigDecimal("originPrice"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (object.getLong("memDiscountId") != null) { |
|
|
|
|
|
|
|
childOrder.setGoodsActualPrice(childObject.getBigDecimal("originPrice")); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
childOrder.setGoodsActualPrice(childPrice); |
|
|
|
|
|
|
|
} |
|
|
|
childPrice = childPrice.multiply(childObject.getBigDecimal("quantity")); |
|
|
|
childPrice = childPrice.multiply(childObject.getBigDecimal("quantity")); |
|
|
|
// 计算总订单实际支付金额
|
|
|
|
// 计算总订单实际支付金额
|
|
|
|
orderPayPrice = orderPayPrice.add(childPrice); |
|
|
|
orderPayPrice = orderPayPrice.add(childPrice); |
|
|
@ -2049,7 +2050,7 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
highOrder.setOrderStatus(1); |
|
|
|
highOrder.setOrderStatus(1); |
|
|
|
|
|
|
|
|
|
|
|
// 计算实际支付金额
|
|
|
|
// 计算实际支付金额
|
|
|
|
orderPayPrice = memberProduct.getCostPrice().add(memberProduct.getCostPrice().multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP); |
|
|
|
orderPayPrice = memberProduct.getCostPrice().add(memberProduct.getPrice().multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP); |
|
|
|
if (orderPayPrice.compareTo(memberProduct.getPrice()) > 0) { |
|
|
|
if (orderPayPrice.compareTo(memberProduct.getPrice()) > 0) { |
|
|
|
orderPayPrice = memberProduct.getPrice(); |
|
|
|
orderPayPrice = memberProduct.getPrice(); |
|
|
|
} |
|
|
|
} |
|
|
|