Showing
1 changed file
with
7 additions
and
3 deletions
@@ -13,6 +13,7 @@ import com.yohoufo.order.common.Payment; | @@ -13,6 +13,7 @@ import com.yohoufo.order.common.Payment; | ||
13 | import com.yohoufo.order.constants.InviteConstant; | 13 | import com.yohoufo.order.constants.InviteConstant; |
14 | import com.yohoufo.order.model.request.InviteSettlementItemCreateRequest; | 14 | import com.yohoufo.order.model.request.InviteSettlementItemCreateRequest; |
15 | import lombok.extern.slf4j.Slf4j; | 15 | import lombok.extern.slf4j.Slf4j; |
16 | +import org.apache.commons.lang3.StringUtils; | ||
16 | import org.apache.commons.lang3.tuple.Pair; | 17 | import org.apache.commons.lang3.tuple.Pair; |
17 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
18 | import org.springframework.beans.factory.annotation.Value; | 19 | import org.springframework.beans.factory.annotation.Value; |
@@ -171,7 +172,7 @@ public class InviteSettlementItemCreator { | @@ -171,7 +172,7 @@ public class InviteSettlementItemCreator { | ||
171 | return Pair.of(InviteSettlementItem.STATUS_DISABLE, "NON_STORED_SELLER"); | 172 | return Pair.of(InviteSettlementItem.STATUS_DISABLE, "NON_STORED_SELLER"); |
172 | } | 173 | } |
173 | // 品类无效 | 174 | // 品类无效 |
174 | - else if (nonSupportProductSortLimit(request.getSkup())) { | 175 | + else if (!hitProductSortLimit(request.getSkup())) { |
175 | return Pair.of(InviteSettlementItem.STATUS_DISABLE, "PRODUCT_SORT_LIMIT"); | 176 | return Pair.of(InviteSettlementItem.STATUS_DISABLE, "PRODUCT_SORT_LIMIT"); |
176 | } else { | 177 | } else { |
177 | return Pair.of(InviteSettlementItem.STATUS_ENABLE, "OK"); | 178 | return Pair.of(InviteSettlementItem.STATUS_ENABLE, "OK"); |
@@ -202,12 +203,15 @@ public class InviteSettlementItemCreator { | @@ -202,12 +203,15 @@ public class InviteSettlementItemCreator { | ||
202 | return true; | 203 | return true; |
203 | } | 204 | } |
204 | 205 | ||
205 | - private boolean nonSupportProductSortLimit(Integer skup) { | 206 | + private boolean hitProductSortLimit(Integer skup) { |
207 | + if (StringUtils.isBlank(productSortLimit)) { | ||
208 | + return true; | ||
209 | + } | ||
206 | List<String> productSortLimitList = Splitter.on(",").splitToList(productSortLimit); | 210 | List<String> productSortLimitList = Splitter.on(",").splitToList(productSortLimit); |
207 | StoragePrice storagePrice = storagePriceMapper.selectBySkup(skup); | 211 | StoragePrice storagePrice = storagePriceMapper.selectBySkup(skup); |
208 | Product product = productMapper.selectByPrimaryKey(storagePrice.getProductId()); | 212 | Product product = productMapper.selectByPrimaryKey(storagePrice.getProductId()); |
209 | String maxSortId = product.getMaxSortId().toString(); | 213 | String maxSortId = product.getMaxSortId().toString(); |
210 | - return !productSortLimitList.contains(maxSortId); | 214 | + return productSortLimitList.contains(maxSortId); |
211 | } | 215 | } |
212 | 216 | ||
213 | 217 |
-
Please register or login to post a comment