Authored by chenchao

support off shelve seller goods by skup

@@ -186,6 +186,19 @@ public class SellerOrderCancelService { @@ -186,6 +186,19 @@ public class SellerOrderCancelService {
186 } 186 }
187 187
188 /** 188 /**
  189 + * 下架商品
  190 + * @param uid
  191 + * @param skup
  192 + * @return
  193 + */
  194 + public int cancelSellerOrderBySkup(int uid, int skup){
  195 + logger.info("cancelSellerOrder By Skup,uid {} skup {}", uid, skup);
  196 + SellerOrder sellerOrder = sellerOrderMapper.selectBySkup(skup);
  197 + int result = doCancelSellerOrder(sellerOrder);
  198 + return result;
  199 + }
  200 +
  201 + /**
189 * 取消卖家订单(待支付 已上架) 202 * 取消卖家订单(待支付 已上架)
190 * @param uid 203 * @param uid
191 * @param orderCode 204 * @param orderCode
@@ -193,15 +206,21 @@ public class SellerOrderCancelService { @@ -193,15 +206,21 @@ public class SellerOrderCancelService {
193 */ 206 */
194 public int cancelSellerOrder(int uid, long orderCode){ 207 public int cancelSellerOrder(int uid, long orderCode){
195 logger.info("cancelSellerOrder uid {} orderCode {}", uid, orderCode); 208 logger.info("cancelSellerOrder uid {} orderCode {}", uid, orderCode);
  209 + SellerOrder sellerOrder = sellerOrderMapper.selectByOrderCodeUid(orderCode, uid);
  210 + int result = doCancelSellerOrder(sellerOrder);
  211 + return result;
  212 + }
  213 +
  214 + private int doCancelSellerOrder(SellerOrder sellerOrder){
196 int result = 0; 215 int result = 0;
197 - final OrderCodeType codeType = OrderCodeType.SELLER_TYPE;  
198 - SellerOrder sellerOrder = null;  
199 - Integer skup=null;  
200 - sellerOrder = sellerOrderMapper.selectByOrderCodeUid(orderCode, uid);  
201 if (Objects.isNull(sellerOrder)){ 216 if (Objects.isNull(sellerOrder)){
  217 + logger.warn("in doCancelSellerOrder sellerOrder is null");
202 return result; 218 return result;
203 } 219 }
204 - skup = sellerOrder.getSkup(); 220 + final OrderCodeType codeType = OrderCodeType.SELLER_TYPE;
  221 + int skup = sellerOrder.getSkup();
  222 + int uid = sellerOrder.getUid();
  223 + long orderCode = sellerOrder.getOrderCode();
205 List<BuyerOrder> buyerOrders = checkCancelRelatedBuyerOrder(skup, uid, orderCode, codeType); 224 List<BuyerOrder> buyerOrders = checkCancelRelatedBuyerOrder(skup, uid, orderCode, codeType);
206 225
207 Integer status = checkAndAcquireStatus(sellerOrder); 226 Integer status = checkAndAcquireStatus(sellerOrder);