Ver a proveniência

[订单处理][修改]:整理目前订单接口

release_toaliyun_real
Stormeye Wu há 7 anos
ascendente
cometimento
06c9093491
2 ficheiros alterados com 37 adições e 1 eliminações
  1. +13
    -0
      mallinkService/src/main/java/com/iformall/service/WxOrderService.java
  2. +24
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java

+ 13
- 0
mallinkService/src/main/java/com/iformall/service/WxOrderService.java Ver ficheiro

@@ -165,4 +165,17 @@ public interface WxOrderService {

void updateOrderGroupStatusByCouponChannelId(Long id, String tenantId, Integer code);


/**
* 订单处理
* 1. 检查coupon是否免费
*/
boolean checkCouponIsFree(WxCUser user, WxCoupon coupon);

// 2. 创建免费订单, 领取 couponOrder
WxOrder saveFreeOrderForCoupon(WxCUser user, WxCoupon coupon, Long couponChannelId, boolean isPress, Long orderGroupId, String formId);

// 3. 创建有价订单
WxOrder saveNoFreeOrderForCoupon(WxCUser user, WxCoupon coupon, Long couponChannelId, boolean isPress, Long orderGroupId, String formId);

}

+ 24
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java Ver ficheiro

@@ -349,7 +349,7 @@ public class WxOrderServiceImpl implements WxOrderService {
String couponIdStr = String.valueOf(couponId);
WxCoupon coupon = wxCouponMapper.selectByPrimaryKey(couponId);
if (coupon == null) {
logger.error("券不存在, couponId: " + couponIdStr);
logger.error("券不存在, couponId: " + couponId);
throw new MallinkException(ErrorCode.COUPON_IS_EMPTY);
}

@@ -1389,4 +1389,27 @@ public class WxOrderServiceImpl implements WxOrderService {
wxOrderMapper.updateStatusByPressCouponId(updateOrder);
}

@Override
public boolean checkCouponIsFree(WxCUser user, WxCoupon coupon) {
return false;
}

@Override
public WxOrder saveFreeOrderForCoupon(WxCUser user, WxCoupon coupon, Long couponChannelId, boolean isPress, Long orderGroupId, String formId) {
// 1. check user info and coupon info
// 2. 减库存
// 3. save order
// 4. 积分券 -- 扣减积分
// 10. coupon order
// 11. 生成完成后一系列操作
return null;
}

@Override
public WxOrder saveNoFreeOrderForCoupon(WxCUser user, WxCoupon coupon, Long couponChannelId, boolean isPress, Long orderGroupId, String formId) {
// 1. check user info and coupon info
// 2. save order
return null;
}

}

Carregando…
Cancelar
Guardar