...
|
...
|
@@ -186,6 +186,19 @@ public class SellerOrderCancelService { |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 下架商品
|
|
|
* @param uid
|
|
|
* @param skup
|
|
|
* @return
|
|
|
*/
|
|
|
public int cancelSellerOrderBySkup(int uid, int skup){
|
|
|
logger.info("cancelSellerOrder By Skup,uid {} skup {}", uid, skup);
|
|
|
SellerOrder sellerOrder = sellerOrderMapper.selectBySkup(skup);
|
|
|
int result = doCancelSellerOrder(sellerOrder);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 取消卖家订单(待支付 已上架)
|
|
|
* @param uid
|
|
|
* @param orderCode
|
...
|
...
|
@@ -193,15 +206,21 @@ public class SellerOrderCancelService { |
|
|
*/
|
|
|
public int cancelSellerOrder(int uid, long orderCode){
|
|
|
logger.info("cancelSellerOrder uid {} orderCode {}", uid, orderCode);
|
|
|
SellerOrder sellerOrder = sellerOrderMapper.selectByOrderCodeUid(orderCode, uid);
|
|
|
int result = doCancelSellerOrder(sellerOrder);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
private int doCancelSellerOrder(SellerOrder sellerOrder){
|
|
|
int result = 0;
|
|
|
final OrderCodeType codeType = OrderCodeType.SELLER_TYPE;
|
|
|
SellerOrder sellerOrder = null;
|
|
|
Integer skup=null;
|
|
|
sellerOrder = sellerOrderMapper.selectByOrderCodeUid(orderCode, uid);
|
|
|
if (Objects.isNull(sellerOrder)){
|
|
|
logger.warn("in doCancelSellerOrder sellerOrder is null");
|
|
|
return result;
|
|
|
}
|
|
|
skup = sellerOrder.getSkup();
|
|
|
final OrderCodeType codeType = OrderCodeType.SELLER_TYPE;
|
|
|
int skup = sellerOrder.getSkup();
|
|
|
int uid = sellerOrder.getUid();
|
|
|
long orderCode = sellerOrder.getOrderCode();
|
|
|
List<BuyerOrder> buyerOrders = checkCancelRelatedBuyerOrder(skup, uid, orderCode, codeType);
|
|
|
|
|
|
Integer status = checkAndAcquireStatus(sellerOrder);
|
...
|
...
|
|