Authored by tanling

极速发货

... ... @@ -383,7 +383,7 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService {
// 上架的代码(和之前同)
for(FastDeliveryBatchOnShelfReq.ProductInfo productInfo : req.getProductInfos()){
StorageCheckResp storage = storageMap.get(storageMap.get(getProductCodeSizeNameKey(productInfo.getProductCode(), productInfo.getSizeName())));
StorageCheckResp storage = storageMap.get(getProductCodeSizeNameKey(productInfo.getProductCode(), productInfo.getSizeName()));
if (storage == null){
logger.warn("productCode {} and sizeName {}. storageId not exist.", productInfo.getProductCode(), productInfo.getSizeName());
throw new UfoServiceException(403, "货号和尺寸对应的storageId不存在");
... ... @@ -430,8 +430,9 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService {
logger.warn("storageCheckRespList null");
throw new UfoServiceException(501, "上架失败!");
}
StorageCheckResp storageResp = storageCheckRespList.stream().filter(x->x.getStatus()!= StorageCheckEnum.PRODUCT_SIZE_MATCH.getType()).findAny().get();
if (storageResp != null){
Optional<StorageCheckResp> storageOptional = storageCheckRespList.stream().filter(x->x.getStatus()!= StorageCheckEnum.PRODUCT_SIZE_MATCH.getType()).findAny();
if (storageOptional.isPresent()){
StorageCheckResp storageResp = storageOptional.get();
logger.warn("productCode {} and sizeName {} invalidate", storageResp.getProductCode(), storageResp.getSizeName());
throw new UfoServiceException(403, "["+getProductCodeSizeNameKey(storageResp.getProductCode(),storageResp.getSizeName())+"]"+storageResp.getStatusStr());
}
... ...
... ... @@ -2179,7 +2179,7 @@ public class ProductServiceImpl implements ProductService {
for(Storage storage : storages) {
// 货号和尺码匹配
if (item.getProductCode() == productIdAndCode.get(storage.getProductId()) && item.getSizeName() == sizeIdAndName.get(storage.getSizeId())) {
if (item.getProductCode().equals(productIdAndCode.get(storage.getProductId())) && item.getSizeName().equals(sizeIdAndName.get(storage.getSizeId()))) {
setStorageCheckRespStatusInfo(item, StorageCheckEnum.PRODUCT_SIZE_MATCH.getType());
item.setStorageId(storage.getId());
continue loop;
... ...