dev-discount
胡锐 2 years ago
commit c0d4557dad
  1. 2
      hai-cweb/src/main/java/com/cweb/controller/HighThirdPartyController.java
  2. 63
      hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java
  3. 6
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java

@ -407,7 +407,7 @@ public class HighThirdPartyController {
} }
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 9) { } else if (order.getHighChildOrderList().get(0).getGoodsType() == 9) {
object = QianZhuConfig.starbucksOrderByOrderNo(order.getOrderNo()); object = QianZhuConfig.starbucksOrderByOrderNo(order.getHighChildOrderList().get(0).getChannelOrderNo());
if (object.getBoolean("success")) { if (object.getBoolean("success")) {
partyModel.setCode(object.getJSONObject("data").getString("ticket")); partyModel.setCode(object.getJSONObject("data").getString("ticket"));
partyModel.setStatusDesc(object.getJSONObject("data").getString("statusDesc")); partyModel.setStatusDesc(object.getJSONObject("data").getString("statusDesc"));

@ -594,10 +594,6 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
// 查询用户 // 查询用户
HighUser user = highUserService.findByUserId(object.getLong("userId")); 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")); 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.setMemId(user.getId());
childOrder.setMemName(user.getName()); childOrder.setMemName(user.getName());
childOrder.setMemPhone(user.getPhone()); childOrder.setMemPhone(user.getPhone());
childOrder.setStoreAddress(childObject.getString("storeAddress")); childOrder.setStoreAddress(orderObject.getJSONObject("data").getString("storeAddress"));
childOrder.setStoreName(childObject.getString("storeName")); childOrder.setStoreName(orderObject.getJSONObject("data").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"));
@ -698,19 +694,14 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
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); childOrder.setGoodsActualPrice(childPrice);
}
childPrice = childPrice.multiply(childObject.getBigDecimal("quantity"));
// 计算总订单实际支付金额
orderPayPrice = orderPayPrice.add(childPrice);
// 计算市场价金额 // 计算市场价金额
marketPrice = marketPrice.add(childObject.getBigDecimal("marketPrice").multiply(childObject.getBigDecimal("quantity"))); childOrder.setTotalPrice(childObject.getBigDecimal("marketPrice").multiply(childObject.getBigDecimal("quantity")));
childOrder.setTotalPrice(marketPrice); childOrder.setTotalActualPrice(childPrice.multiply(childObject.getBigDecimal("quantity")));
childOrder.setTotalActualPrice(orderPayPrice); childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice()));
childOrder.setTotalDeductionPrice(marketPrice.subtract(orderPayPrice));
childOrderList.add(childOrder); childOrderList.add(childOrder);
} }
@ -765,19 +756,13 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
childPrice = childObject.getBigDecimal("originPrice"); childPrice = childObject.getBigDecimal("originPrice");
} }
if (object.getLong("memDiscountId") != null) { // 配置实际支付金额
childOrder.setGoodsActualPrice(childObject.getBigDecimal("originPrice"));
} else {
childOrder.setGoodsActualPrice(childPrice); childOrder.setGoodsActualPrice(childPrice);
}
childPrice = childPrice.multiply(childObject.getBigDecimal("quantity"));
// 计算总订单实际支付金额
orderPayPrice = orderPayPrice.add(childPrice);
// 计算市场价金额 // 计算市场价金额
marketPrice = marketPrice.add(childObject.getBigDecimal("originPrice").multiply(childObject.getBigDecimal("quantity"))); childOrder.setTotalPrice(childObject.getBigDecimal("originPrice").multiply(childObject.getBigDecimal("quantity")));
childOrder.setTotalPrice(marketPrice); childOrder.setTotalActualPrice(childPrice.multiply(childObject.getBigDecimal("quantity")));
childOrder.setTotalActualPrice(orderPayPrice); childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice()));
childOrder.setTotalDeductionPrice(marketPrice.subtract(orderPayPrice));
childOrderList.add(childOrder); 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); BigDecimal childPrice = 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 (childPrice.compareTo(memberProduct.getPrice()) > 0) {
orderPayPrice = memberProduct.getPrice(); childPrice = memberProduct.getPrice();
} }
// 计算市场价金额
marketPrice = memberProduct.getPrice();
HighChildOrder childOrder = new HighChildOrder(); HighChildOrder childOrder = new HighChildOrder();
@ -811,16 +794,12 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
childOrder.setMemId(user.getId()); childOrder.setMemId(user.getId());
childOrder.setMemName(user.getName()); childOrder.setMemName(user.getName());
childOrder.setMemPhone(user.getPhone()); childOrder.setMemPhone(user.getPhone());
childOrder.setGoodsPrice(marketPrice); childOrder.setGoodsPrice(memberProduct.getPrice());
childOrder.setTotalPrice(marketPrice); childOrder.setTotalPrice(memberProduct.getPrice());
childOrder.setTotalActualPrice(orderPayPrice); childOrder.setTotalActualPrice(childPrice);
childOrder.setCreateTime(new Date()); childOrder.setCreateTime(new Date());
childOrder.setTotalDeductionPrice(marketPrice.subtract(orderPayPrice)); childOrder.setTotalDeductionPrice(memberProduct.getPrice().subtract(childPrice));
if (object.getLong("memDiscountId") != null) {
childOrder.setGoodsActualPrice(marketPrice);
} else {
childOrder.setGoodsActualPrice(orderPayPrice);
}
childOrderList.add(childOrder); childOrderList.add(childOrder);

@ -216,11 +216,11 @@ public class OrderServiceImpl implements OrderService {
// 话费充值 // 话费充值
} else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE6.getNumber())) { } else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE6.getNumber())) {
order.setProductType(OrderProductType.PRODUCT_TYPE7.getNumber()); order.setProductType(OrderProductType.PRODUCT_TYPE9.getNumber());
// 优惠券包 // 优惠券包
} else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE7.getNumber())) { } else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE7.getNumber())) {
order.setProductType(OrderProductType.PRODUCT_TYPE9.getNumber()); order.setProductType(OrderProductType.PRODUCT_TYPE7.getNumber());
HighChildOrder childOrder = orderCreateHandleService.couponPackage(child); HighChildOrder childOrder = orderCreateHandleService.couponPackage(child);
childOrderList.add(childOrder); childOrderList.add(childOrder);
order.setTitle(childOrder.getGoodsName()); order.setTitle(childOrder.getGoodsName());
@ -465,7 +465,7 @@ public class OrderServiceImpl implements OrderService {
} }
// 使用了积分抵扣 // 使用了积分抵扣
if (order.getPayGold() != null && order.getPayGold().intValue() > 0) { if (order.getPayGold() != null && order.getPayGold() > 0) {
// 积分返回 // 积分返回
String remark = "订单" + order.getOrderNo() + "取消,退还积分:" + order.getPayGold(); String remark = "订单" + order.getOrderNo() + "取消,退还积分:" + order.getPayGold();
userService.goldHandle(order.getMemId(), order.getPayGold(), 1, 3, order.getId() , remark); userService.goldHandle(order.getMemId(), order.getPayGold(), 1, 3, order.getId() , remark);

Loading…
Cancel
Save