提交2。0代码

dev-discount
袁野 2 years ago
parent 08c9f362cd
commit fa3791d101
  1. 2
      hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java
  2. 14
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java
  3. 4
      hai-service/src/main/java/com/hai/service/HighDiscountPackageActualService.java
  4. 4
      hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageActualServiceImpl.java
  5. 4
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  6. 2
      hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java

@ -390,7 +390,7 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
* @Return void * @Return void
*/ */
private void eCouponPackageHandle(HighOrder order , HighChildOrder highChildOrder) throws Exception { private void eCouponPackageHandle(HighOrder order , HighChildOrder highChildOrder) throws Exception {
HighDiscountPackageActual actual = discountPackageActualService.getDetailByChildOrderId(highChildOrder.getId()); HighDiscountPackageActual actual = discountPackageActualService.getDetailByChildOrderNo(highChildOrder.getOrderNo());
if (actual != null) { if (actual != null) {
List<HighDiscountPackageDiscountActual> discountList = discountPackageDiscountActualService.getHighDiscountPackageDiscountActualList(actual.getId()); List<HighDiscountPackageDiscountActual> discountList = discountPackageDiscountActualService.getHighDiscountPackageDiscountActualList(actual.getId());
for (HighDiscountPackageDiscountActual discount : discountList) { for (HighDiscountPackageDiscountActual discount : discountList) {

@ -82,6 +82,9 @@ public class OrderServiceImpl implements OrderService {
@Resource @Resource
private ThirdProductConfig thirdProductConfig; private ThirdProductConfig thirdProductConfig;
@Resource
private HighDiscountPackageActualService discountPackageActualService;
@Override @Override
public HighOrder insertOrderData(HighOrder order) { public HighOrder insertOrderData(HighOrder order) {
@ -220,6 +223,17 @@ public class OrderServiceImpl implements OrderService {
} else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE7.getNumber())) { } else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE7.getNumber())) {
order.setProductType(OrderProductType.PRODUCT_TYPE7.getNumber()); order.setProductType(OrderProductType.PRODUCT_TYPE7.getNumber());
HighChildOrder childOrder = orderCreateHandleService.couponPackage(child); HighChildOrder childOrder = orderCreateHandleService.couponPackage(child);
// 查询库存
List<HighDiscountPackageActual> list = discountPackageActualService.getListByPackageId(childOrder.getGoodsId().intValue(), 1);
if (list == null || list.size() == 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_STOCK_INSUFFICIENT, "");
}
list.get(0).setUserId(order.getMemId().intValue());
list.get(0).setExt1(childOrder.getOrderNo());
list.get(0).setStatus(2); // 状态: 1: 待分配 2:预分配(售卖)3:已分配
discountPackageActualService.updateHighDiscountPackageActual(list.get(0));
childOrderList.add(childOrder); childOrderList.add(childOrder);
order.setTitle(childOrder.getGoodsName()); order.setTitle(childOrder.getGoodsName());

@ -56,10 +56,10 @@ public interface HighDiscountPackageActualService {
/** /**
* 获取库存 * 获取库存
* @param childOrderId * @param orderNo
* @return * @return
*/ */
HighDiscountPackageActual getDetailByChildOrderId(Long childOrderId); HighDiscountPackageActual getDetailByChildOrderNo(String orderNo);
/** /**
* 查询优惠券包列表 * 查询优惠券包列表

@ -60,9 +60,9 @@ public class HighDiscountPackageActualServiceImpl implements HighDiscountPackage
} }
@Override @Override
public HighDiscountPackageActual getDetailByChildOrderId(Long childOrderId) { public HighDiscountPackageActual getDetailByChildOrderNo(String orderNo) {
HighDiscountPackageActualExample example = new HighDiscountPackageActualExample(); HighDiscountPackageActualExample example = new HighDiscountPackageActualExample();
example.createCriteria().andChildOrderIdEqualTo(childOrderId); example.createCriteria().andExt1EqualTo(orderNo);
List<HighDiscountPackageActual> list = discountPackageActualMapper.selectByExample(example); List<HighDiscountPackageActual> list = discountPackageActualMapper.selectByExample(example);
if (list.size() > 0) { if (list.size() > 0) {
return list.get(0); return list.get(0);

@ -649,7 +649,7 @@ public class HighOrderServiceImpl implements HighOrderService {
} }
*/ */
if (highChildOrder.getGoodsType() == 7) { if (highChildOrder.getGoodsType() == 7) {
HighDiscountPackageActual actual = discountPackageActualService.getDetailByChildOrderId(highChildOrder.getId()); HighDiscountPackageActual actual = discountPackageActualService.getDetailByChildOrderNo(highChildOrder.getOrderNo());
if (actual != null) { if (actual != null) {
List<HighDiscountPackageDiscountActual> discountList = discountPackageDiscountActualService.getHighDiscountPackageDiscountActualList(actual.getId()); List<HighDiscountPackageDiscountActual> discountList = discountPackageDiscountActualService.getHighDiscountPackageDiscountActualList(actual.getId());
for (HighDiscountPackageDiscountActual discount : discountList) { for (HighDiscountPackageDiscountActual discount : discountList) {
@ -1032,7 +1032,7 @@ public class HighOrderServiceImpl implements HighOrderService {
} }
if (highChildOrder.getGoodsType() == 7) { if (highChildOrder.getGoodsType() == 7) {
HighDiscountPackageActual actual = discountPackageActualService.getDetailByChildOrderId(highChildOrder.getId()); HighDiscountPackageActual actual = discountPackageActualService.getDetailByChildOrderNo(highChildOrder.getOrderNo());
if (actual != null) { if (actual != null) {
actual.setChildOrderId(null); actual.setChildOrderId(null);
actual.setUserId(null); actual.setUserId(null);

@ -416,7 +416,7 @@ public class GoodsOrderServiceImpl implements PayService {
}*/ }*/
if (highChildOrder.getGoodsType() == 7) { if (highChildOrder.getGoodsType() == 7) {
HighDiscountPackageActual actual = discountPackageActualService.getDetailByChildOrderId(highChildOrder.getId()); HighDiscountPackageActual actual = discountPackageActualService.getDetailByChildOrderNo(highChildOrder.getOrderNo());
if (actual != null) { if (actual != null) {
List<HighDiscountPackageDiscountActual> discountList = discountPackageDiscountActualService.getHighDiscountPackageDiscountActualList(actual.getId()); List<HighDiscountPackageDiscountActual> discountList = discountPackageDiscountActualService.getHighDiscountPackageDiscountActualList(actual.getId());
for (HighDiscountPackageDiscountActual discount : discountList) { for (HighDiscountPackageDiscountActual discount : discountList) {

Loading…
Cancel
Save