|
|
|
@ -594,10 +594,6 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { |
|
|
|
|
// 查询用户
|
|
|
|
|
HighUser user = highUserService.findByUserId(object.getLong("userId")); |
|
|
|
|
|
|
|
|
|
// 实际支付金额
|
|
|
|
|
BigDecimal orderPayPrice = new BigDecimal(0); |
|
|
|
|
// 市场金额
|
|
|
|
|
BigDecimal marketPrice = new BigDecimal(0); |
|
|
|
|
|
|
|
|
|
// 查询详单订单的实际
|
|
|
|
|
JSONObject productDetail = thirdProductConfig.getThirdPartyByDetail(object.getInteger("platformId"), object.getInteger("productType"), object.getLong("companyId") , object.getLong("productId")); |
|
|
|
@ -682,8 +678,8 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { |
|
|
|
|
childOrder.setMemId(user.getId()); |
|
|
|
|
childOrder.setMemName(user.getName()); |
|
|
|
|
childOrder.setMemPhone(user.getPhone()); |
|
|
|
|
childOrder.setStoreAddress(childObject.getString("storeAddress")); |
|
|
|
|
childOrder.setStoreName(childObject.getString("storeName")); |
|
|
|
|
childOrder.setStoreAddress(orderObject.getJSONObject("data").getString("storeAddress")); |
|
|
|
|
childOrder.setStoreName(orderObject.getJSONObject("data").getString("storeName")); |
|
|
|
|
childOrder.setGoodsName(childObject.getString("productName")); |
|
|
|
|
childOrder.setGoodsImg(childObject.getString("imgUrl")); |
|
|
|
|
childOrder.setSaleCount(childObject.getInteger("quantity")); |
|
|
|
@ -698,19 +694,14 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { |
|
|
|
|
if (childPrice.compareTo(childObject.getBigDecimal("marketPrice")) > 0) { |
|
|
|
|
childPrice = childObject.getBigDecimal("marketPrice"); |
|
|
|
|
} |
|
|
|
|
if (object.getLong("memDiscountId") != null) { |
|
|
|
|
childOrder.setGoodsActualPrice(childObject.getBigDecimal("marketPrice")); |
|
|
|
|
} else { |
|
|
|
|
childOrder.setGoodsActualPrice(childPrice); |
|
|
|
|
} |
|
|
|
|
childPrice = childPrice.multiply(childObject.getBigDecimal("quantity")); |
|
|
|
|
// 计算总订单实际支付金额
|
|
|
|
|
orderPayPrice = orderPayPrice.add(childPrice); |
|
|
|
|
|
|
|
|
|
// 配置实际支付金额
|
|
|
|
|
childOrder.setGoodsActualPrice(childPrice); |
|
|
|
|
|
|
|
|
|
// 计算市场价金额
|
|
|
|
|
marketPrice = marketPrice.add(childObject.getBigDecimal("marketPrice").multiply(childObject.getBigDecimal("quantity"))); |
|
|
|
|
childOrder.setTotalPrice(marketPrice); |
|
|
|
|
childOrder.setTotalActualPrice(orderPayPrice); |
|
|
|
|
childOrder.setTotalDeductionPrice(marketPrice.subtract(orderPayPrice)); |
|
|
|
|
childOrder.setTotalPrice(childObject.getBigDecimal("marketPrice").multiply(childObject.getBigDecimal("quantity"))); |
|
|
|
|
childOrder.setTotalActualPrice(childPrice.multiply(childObject.getBigDecimal("quantity"))); |
|
|
|
|
childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice())); |
|
|
|
|
childOrderList.add(childOrder); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -765,19 +756,13 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { |
|
|
|
|
childPrice = childObject.getBigDecimal("originPrice"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (object.getLong("memDiscountId") != null) { |
|
|
|
|
childOrder.setGoodsActualPrice(childObject.getBigDecimal("originPrice")); |
|
|
|
|
} else { |
|
|
|
|
childOrder.setGoodsActualPrice(childPrice); |
|
|
|
|
} |
|
|
|
|
childPrice = childPrice.multiply(childObject.getBigDecimal("quantity")); |
|
|
|
|
// 计算总订单实际支付金额
|
|
|
|
|
orderPayPrice = orderPayPrice.add(childPrice); |
|
|
|
|
// 配置实际支付金额
|
|
|
|
|
childOrder.setGoodsActualPrice(childPrice); |
|
|
|
|
|
|
|
|
|
// 计算市场价金额
|
|
|
|
|
marketPrice = marketPrice.add(childObject.getBigDecimal("originPrice").multiply(childObject.getBigDecimal("quantity"))); |
|
|
|
|
childOrder.setTotalPrice(marketPrice); |
|
|
|
|
childOrder.setTotalActualPrice(orderPayPrice); |
|
|
|
|
childOrder.setTotalDeductionPrice(marketPrice.subtract(orderPayPrice)); |
|
|
|
|
childOrder.setTotalPrice(childObject.getBigDecimal("originPrice").multiply(childObject.getBigDecimal("quantity"))); |
|
|
|
|
childOrder.setTotalActualPrice(childPrice.multiply(childObject.getBigDecimal("quantity"))); |
|
|
|
|
childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice())); |
|
|
|
|
childOrderList.add(childOrder); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -791,12 +776,10 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 计算实际支付金额
|
|
|
|
|
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) { |
|
|
|
|
orderPayPrice = memberProduct.getPrice(); |
|
|
|
|
BigDecimal childPrice = memberProduct.getCostPrice().add(memberProduct.getPrice().multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP); |
|
|
|
|
if (childPrice.compareTo(memberProduct.getPrice()) > 0) { |
|
|
|
|
childPrice = memberProduct.getPrice(); |
|
|
|
|
} |
|
|
|
|
// 计算市场价金额
|
|
|
|
|
marketPrice = memberProduct.getPrice(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HighChildOrder childOrder = new HighChildOrder(); |
|
|
|
@ -811,16 +794,12 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { |
|
|
|
|
childOrder.setMemId(user.getId()); |
|
|
|
|
childOrder.setMemName(user.getName()); |
|
|
|
|
childOrder.setMemPhone(user.getPhone()); |
|
|
|
|
childOrder.setGoodsPrice(marketPrice); |
|
|
|
|
childOrder.setTotalPrice(marketPrice); |
|
|
|
|
childOrder.setTotalActualPrice(orderPayPrice); |
|
|
|
|
childOrder.setGoodsPrice(memberProduct.getPrice()); |
|
|
|
|
childOrder.setTotalPrice(memberProduct.getPrice()); |
|
|
|
|
childOrder.setTotalActualPrice(childPrice); |
|
|
|
|
childOrder.setCreateTime(new Date()); |
|
|
|
|
childOrder.setTotalDeductionPrice(marketPrice.subtract(orderPayPrice)); |
|
|
|
|
if (object.getLong("memDiscountId") != null) { |
|
|
|
|
childOrder.setGoodsActualPrice(marketPrice); |
|
|
|
|
} else { |
|
|
|
|
childOrder.setGoodsActualPrice(orderPayPrice); |
|
|
|
|
} |
|
|
|
|
childOrder.setTotalDeductionPrice(memberProduct.getPrice().subtract(childPrice)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
childOrderList.add(childOrder); |
|
|
|
|
|
|
|
|
|