Authored by LUOXC

refactor

... ... @@ -13,6 +13,7 @@ import com.yohoufo.order.common.Payment;
import com.yohoufo.order.constants.InviteConstant;
import com.yohoufo.order.model.request.InviteSettlementItemCreateRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
... ... @@ -171,7 +172,7 @@ public class InviteSettlementItemCreator {
return Pair.of(InviteSettlementItem.STATUS_DISABLE, "NON_STORED_SELLER");
}
// 品类无效
else if (nonSupportProductSortLimit(request.getSkup())) {
else if (!hitProductSortLimit(request.getSkup())) {
return Pair.of(InviteSettlementItem.STATUS_DISABLE, "PRODUCT_SORT_LIMIT");
} else {
return Pair.of(InviteSettlementItem.STATUS_ENABLE, "OK");
... ... @@ -202,12 +203,15 @@ public class InviteSettlementItemCreator {
return true;
}
private boolean nonSupportProductSortLimit(Integer skup) {
private boolean hitProductSortLimit(Integer skup) {
if (StringUtils.isBlank(productSortLimit)) {
return true;
}
List<String> productSortLimitList = Splitter.on(",").splitToList(productSortLimit);
StoragePrice storagePrice = storagePriceMapper.selectBySkup(skup);
Product product = productMapper.selectByPrimaryKey(storagePrice.getProductId());
String maxSortId = product.getMaxSortId().toString();
return !productSortLimitList.contains(maxSortId);
return productSortLimitList.contains(maxSortId);
}
... ...