...
|
...
|
@@ -10,10 +10,7 @@ import com.yohobuy.ufo.model.order.common.SellerFuncEnum; |
|
|
import com.yohobuy.ufo.model.order.common.SkupStatus;
|
|
|
import com.yohobuy.ufo.model.order.constants.SkupType;
|
|
|
import com.yohobuy.ufo.model.order.req.*;
|
|
|
import com.yohobuy.ufo.model.order.resp.FastDeliveryGetShelfDetailResp;
|
|
|
import com.yohobuy.ufo.model.order.resp.FastDeliveryGetShelfResp;
|
|
|
import com.yohobuy.ufo.model.order.resp.OrderListInfo;
|
|
|
import com.yohobuy.ufo.model.order.resp.PageResp;
|
|
|
import com.yohobuy.ufo.model.order.resp.*;
|
|
|
import com.yohobuy.ufo.model.request.product.ProductImportTranItemBo;
|
|
|
import com.yohobuy.ufo.model.request.product.ProductRequestBo;
|
|
|
import com.yohobuy.ufo.model.response.ProductDetailResp;
|
...
|
...
|
@@ -360,7 +357,7 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService { |
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<Integer> batchOnShelf(FastDeliveryBatchOnShelfReq req) {
|
|
|
public List<FastDeliveryBatchOnShelfResp> batchOnShelf(FastDeliveryBatchOnShelfReq req) {
|
|
|
|
|
|
// 1.检查入口参数
|
|
|
checkBatchOnShelf(req);
|
...
|
...
|
@@ -381,6 +378,7 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService { |
|
|
List<Integer> skupIds = Lists.newArrayList();
|
|
|
|
|
|
// 上架的代码(和之前同)
|
|
|
List<FastDeliveryBatchOnShelfResp> shelfResps = Lists.newArrayList();
|
|
|
for(FastDeliveryBatchOnShelfReq.ProductInfo productInfo : req.getProductInfos()){
|
|
|
|
|
|
StorageCheckResp storage = storageMap.get(getProductCodeSizeNameKey(productInfo.getProductCode(), productInfo.getSizeName()));
|
...
|
...
|
@@ -391,6 +389,13 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService { |
|
|
|
|
|
productInfo.setStorageId(storage.getStorageId());
|
|
|
|
|
|
FastDeliveryBatchOnShelfResp resp = new FastDeliveryBatchOnShelfResp();
|
|
|
resp.setProductCode(productInfo.getProductCode());
|
|
|
resp.setSizeName(productInfo.getSizeName());
|
|
|
FastDeliveryBatchOnShelfResp.ShelfResult shelfResult = new FastDeliveryBatchOnShelfResp.ShelfResult();
|
|
|
resp.setShelfResult(shelfResult);
|
|
|
shelfResps.add(resp);
|
|
|
|
|
|
ImPrdNode node = ImPrdNode.builder().uid(req.getUid())
|
|
|
.sellerWrapper(sellerWrapper)
|
|
|
.storageId(productInfo.getStorageId())
|
...
|
...
|
@@ -403,19 +408,20 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService { |
|
|
|
|
|
try{
|
|
|
SellerOrderSubmitHandler.ForkJoinResult fjr = importPublishExcutor.publishOne(node);
|
|
|
skupIds.addAll(fjr.getSkupIds());
|
|
|
shelfResult.setSkups(fjr.getSkupIds());
|
|
|
|
|
|
responseList.add(buildShelfResp(req, productInfo, fjr));
|
|
|
}catch(Exception ex){
|
|
|
logger.warn("in batchOnShelf.publishOne fail, uid {} productCode {} sizeName {} storageId {} salePrice {} storageNum {}",
|
|
|
req.getUid(), productInfo.getProductCode(), productInfo.getSizeName(), productInfo.getStorageId(),
|
|
|
productInfo.getConvertedPrice(), productInfo.getNum());
|
|
|
logger.warn("in batchOnShelf.publishOne fail, productCode {} sizeName {} storageId {} salePrice {} storageNum {}, {}",
|
|
|
productInfo.getProductCode(), productInfo.getSizeName(), productInfo.getStorageId(),
|
|
|
productInfo.getConvertedPrice(), productInfo.getNum(), ex);
|
|
|
shelfResult.setErrorMessage(ex.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(responseList)){
|
|
|
productProxyService.batchAdd(responseList);
|
|
|
return skupIds;
|
|
|
return shelfResps;
|
|
|
}else{
|
|
|
logger.warn("responseList empty");
|
|
|
throw new UfoServiceException(502, "上架失败!");
|
...
|
...
|
|