Authored by Lixiaodi

bug修改

... ... @@ -11,11 +11,13 @@ import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.yoho.core.dal.datasource.annotation.Database;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import com.yoho.core.common.helpers.ImagesHelper;
... ... @@ -254,17 +256,9 @@ public class ProductServiceImpl implements ProductService{
throw new ServiceException(400, "商品(skup)不存在:" + skup);
}
if (sp.getStatus() == null) {
throw new ServiceException(400, "商品(skup)状态异常:" + sp.getStatus());
}
if(status == 4) {
if (sp.getStatus() == 0) {
throw new ServiceException(400, "商品(skup)状态异常:" + sp.getStatus());
}
} else {
if (sp.getStatus() != 0) {
throw new ServiceException(400, "商品(skup)状态已变更:" + sp.getStatus());
}
int expectedStatus = (status == 4) ? 1 : 0;
if (sp.getStatus() == null || sp.getStatus() != expectedStatus) {
throw new ServiceException(400, "商品(skup)状态已变更:" + sp.getStatus());
}
// 使其可售
... ...