|
|
@ -508,10 +508,9 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<HighChildOrder> thirdPartyOrder(JSONObject object) throws Exception { |
|
|
|
public List<HighChildOrder> thirdPartyOrder(JSONObject object) throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = null; |
|
|
|
JSONObject jsonObject; |
|
|
|
|
|
|
|
|
|
|
|
List<HighChildOrder> childOrderList = new ArrayList<>(); |
|
|
|
List<HighChildOrder> childOrderList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
// 查询用户
|
|
|
|
// 查询用户
|
|
|
|
HighUser user = highUserService.findByUserId(object.getLong("userId")); |
|
|
|
HighUser user = highUserService.findByUserId(object.getLong("userId")); |
|
|
|
|
|
|
|
|
|
|
@ -596,15 +595,21 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { |
|
|
|
HighChildOrder childOrder = new HighChildOrder(); |
|
|
|
HighChildOrder childOrder = new HighChildOrder(); |
|
|
|
childOrder.setChildOrderStatus(1); |
|
|
|
childOrder.setChildOrderStatus(1); |
|
|
|
childOrder.setGoodsType(9); |
|
|
|
childOrder.setGoodsType(9); |
|
|
|
|
|
|
|
childOrder.setChildOrderNo(OrderUtil.generateChildOrderNo()); |
|
|
|
childOrder.setStoreId(object.getLong("storeCode")); |
|
|
|
childOrder.setStoreId(object.getLong("storeCode")); |
|
|
|
childOrder.setChannelOrderNo(jsonObject.getJSONObject("data").getString("orderNo")); |
|
|
|
childOrder.setChannelOrderNo(jsonObject.getJSONObject("data").getString("orderNo")); |
|
|
|
childOrder.setGoodsId(object.getLong("productId")); |
|
|
|
childOrder.setGoodsId(object.getLong("productId")); |
|
|
|
|
|
|
|
childOrder.setMemId(user.getId()); |
|
|
|
|
|
|
|
childOrder.setMemName(user.getName()); |
|
|
|
|
|
|
|
childOrder.setMemPhone(user.getPhone()); |
|
|
|
childOrder.setStoreAddress(childObject.getString("storeAddress")); |
|
|
|
childOrder.setStoreAddress(childObject.getString("storeAddress")); |
|
|
|
childOrder.setStoreName(childObject.getString("storeName")); |
|
|
|
childOrder.setStoreName(childObject.getString("storeName")); |
|
|
|
childOrder.setGoodsName(childObject.getString("productName")); |
|
|
|
childOrder.setGoodsName(childObject.getString("productName")); |
|
|
|
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")); |
|
|
|
|
|
|
|
childOrder.setGiveawayType(false); |
|
|
|
|
|
|
|
childOrder.setCreateTime(new Date()); |
|
|
|
|
|
|
|
|
|
|
|
// 计算利润
|
|
|
|
// 计算利润
|
|
|
|
BigDecimal profitPrice = childObject.getBigDecimal("marketPrice").multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100))); |
|
|
|
BigDecimal profitPrice = childObject.getBigDecimal("marketPrice").multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100))); |
|
|
@ -623,7 +628,9 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { |
|
|
|
orderPayPrice = orderPayPrice.add(childPrice); |
|
|
|
orderPayPrice = orderPayPrice.add(childPrice); |
|
|
|
// 计算市场价金额
|
|
|
|
// 计算市场价金额
|
|
|
|
marketPrice = marketPrice.add(childObject.getBigDecimal("marketPrice").multiply(childObject.getBigDecimal("quantity"))); |
|
|
|
marketPrice = marketPrice.add(childObject.getBigDecimal("marketPrice").multiply(childObject.getBigDecimal("quantity"))); |
|
|
|
childOrder.setTotalPrice(childPrice); |
|
|
|
childOrder.setTotalPrice(marketPrice); |
|
|
|
|
|
|
|
childOrder.setTotalActualPrice(orderPayPrice); |
|
|
|
|
|
|
|
childOrder.setTotalDeductionPrice(marketPrice.subtract(orderPayPrice)); |
|
|
|
childOrderList.add(childOrder); |
|
|
|
childOrderList.add(childOrder); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -656,6 +663,10 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { |
|
|
|
HighChildOrder childOrder = new HighChildOrder(); |
|
|
|
HighChildOrder childOrder = new HighChildOrder(); |
|
|
|
childOrder.setChildOrderStatus(1); |
|
|
|
childOrder.setChildOrderStatus(1); |
|
|
|
childOrder.setGoodsType(4); |
|
|
|
childOrder.setGoodsType(4); |
|
|
|
|
|
|
|
childOrder.setMemId(user.getId()); |
|
|
|
|
|
|
|
childOrder.setMemName(user.getName()); |
|
|
|
|
|
|
|
childOrder.setMemPhone(user.getPhone()); |
|
|
|
|
|
|
|
childOrder.setChildOrderNo(OrderUtil.generateChildOrderNo()); |
|
|
|
childOrder.setGoodsId(object.getLong("productId")); |
|
|
|
childOrder.setGoodsId(object.getLong("productId")); |
|
|
|
childOrder.setChannelOrderNo(jsonObject.getJSONObject("data").getString("orderNo")); |
|
|
|
childOrder.setChannelOrderNo(jsonObject.getJSONObject("data").getString("orderNo")); |
|
|
|
childOrder.setStoreAddress(orderObject.getJSONObject("data").getJSONObject("kfcPlaceOrder").getString("storeAddress")); |
|
|
|
childOrder.setStoreAddress(orderObject.getJSONObject("data").getJSONObject("kfcPlaceOrder").getString("storeAddress")); |
|
|
@ -664,7 +675,8 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { |
|
|
|
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")); |
|
|
|
|
|
|
|
childOrder.setGiveawayType(false); |
|
|
|
|
|
|
|
childOrder.setCreateTime(new Date()); |
|
|
|
// 计算利润
|
|
|
|
// 计算利润
|
|
|
|
BigDecimal profitPrice = childObject.getBigDecimal("originPrice").multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100))); |
|
|
|
BigDecimal profitPrice = childObject.getBigDecimal("originPrice").multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100))); |
|
|
|
// 计算子订单支付金额
|
|
|
|
// 计算子订单支付金额
|
|
|
@ -683,7 +695,9 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { |
|
|
|
orderPayPrice = orderPayPrice.add(childPrice); |
|
|
|
orderPayPrice = orderPayPrice.add(childPrice); |
|
|
|
// 计算市场价金额
|
|
|
|
// 计算市场价金额
|
|
|
|
marketPrice = marketPrice.add(childObject.getBigDecimal("originPrice").multiply(childObject.getBigDecimal("quantity"))); |
|
|
|
marketPrice = marketPrice.add(childObject.getBigDecimal("originPrice").multiply(childObject.getBigDecimal("quantity"))); |
|
|
|
childOrder.setTotalPrice(childPrice); |
|
|
|
childOrder.setTotalPrice(marketPrice); |
|
|
|
|
|
|
|
childOrder.setTotalActualPrice(orderPayPrice); |
|
|
|
|
|
|
|
childOrder.setTotalDeductionPrice(marketPrice.subtract(orderPayPrice)); |
|
|
|
childOrderList.add(childOrder); |
|
|
|
childOrderList.add(childOrder); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -708,17 +722,24 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { |
|
|
|
HighChildOrder childOrder = new HighChildOrder(); |
|
|
|
HighChildOrder childOrder = new HighChildOrder(); |
|
|
|
childOrder.setChildOrderStatus(1); |
|
|
|
childOrder.setChildOrderStatus(1); |
|
|
|
childOrder.setGoodsType(10); |
|
|
|
childOrder.setGoodsType(10); |
|
|
|
|
|
|
|
childOrder.setChildOrderNo(OrderUtil.generateChildOrderNo()); |
|
|
|
childOrder.setStoreId(object.getLong("storeCode")); |
|
|
|
childOrder.setStoreId(object.getLong("storeCode")); |
|
|
|
childOrder.setGoodsId(memberProduct.getId()); |
|
|
|
childOrder.setGoodsId(memberProduct.getId()); |
|
|
|
childOrder.setGoodsName(memberProduct.getName()); |
|
|
|
childOrder.setGoodsName(memberProduct.getName()); |
|
|
|
|
|
|
|
childOrder.setGiveawayType(false); |
|
|
|
childOrder.setSaleCount(1); |
|
|
|
childOrder.setSaleCount(1); |
|
|
|
|
|
|
|
childOrder.setMemId(user.getId()); |
|
|
|
|
|
|
|
childOrder.setMemName(user.getName()); |
|
|
|
|
|
|
|
childOrder.setMemPhone(user.getPhone()); |
|
|
|
childOrder.setGoodsPrice(marketPrice); |
|
|
|
childOrder.setGoodsPrice(marketPrice); |
|
|
|
|
|
|
|
childOrder.setTotalPrice(marketPrice); |
|
|
|
|
|
|
|
childOrder.setTotalActualPrice(orderPayPrice); |
|
|
|
|
|
|
|
childOrder.setCreateTime(new Date()); |
|
|
|
|
|
|
|
childOrder.setTotalDeductionPrice(marketPrice.subtract(orderPayPrice)); |
|
|
|
if (object.getLong("memDiscountId") != null) { |
|
|
|
if (object.getLong("memDiscountId") != null) { |
|
|
|
childOrder.setGoodsActualPrice(marketPrice); |
|
|
|
childOrder.setGoodsActualPrice(marketPrice); |
|
|
|
childOrder.setTotalPrice(marketPrice); |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
childOrder.setGoodsActualPrice(orderPayPrice); |
|
|
|
childOrder.setGoodsActualPrice(orderPayPrice); |
|
|
|
childOrder.setTotalPrice(orderPayPrice); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
childOrderList.add(childOrder); |
|
|
|
childOrderList.add(childOrder); |
|
|
|