...
|
...
|
@@ -55,8 +55,14 @@ public class SkupListService { |
|
|
|
|
|
private final Logger logger = LoggerUtils.getSellerOrderLogger();
|
|
|
|
|
|
final static List<Integer> NORMAL_SKUPTYPES = Lists.newArrayList(SkupType.IN_STOCK.getCode(),
|
|
|
SkupType.ADVANCE.getCode());
|
|
|
final static List<Integer> NORMAL_SKUPTYPES = Lists.newArrayList(SkupType.IN_STOCK.prdAttributes().getCode(),
|
|
|
SkupType.ADVANCE.prdAttributes().getCode()),
|
|
|
|
|
|
ENTRY_SKUP_TYPES = Lists.newArrayList(SkupType.IN_STOCK.prdAttributes().getCode(),
|
|
|
SkupType.ADVANCE.prdAttributes().getCode(),SkupType.HK_IN_STOCK.prdAttributes().getCode())
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
final static List<Integer> IMPERFECT_SKUPTYPES = Lists.newArrayList(SkupType.FLAW.getCode(), SkupType.SECOND_HAND.getCode());
|
|
|
|
...
|
...
|
@@ -154,7 +160,8 @@ public class SkupListService { |
|
|
if ((type=request.getType()) == SellerOrderListType.IN_SALE.getType()) {
|
|
|
SkupStatus viewableStatus = SkupStatus.CAN_SELL;
|
|
|
List<Integer> statusList = Arrays.asList(viewableStatus.getCode());
|
|
|
int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSkc(uid, statusList, NORMAL_SKUPTYPES);
|
|
|
final List<Integer> skupTypeCodes = ENTRY_SKUP_TYPES;
|
|
|
int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSkc(uid, statusList, skupTypeCodes);
|
|
|
respBuilder.total(total)
|
|
|
.pagetotal((total % limit == 0) ? (total / limit) : (total / limit + 1));
|
|
|
if (total == 0){
|
...
|
...
|
@@ -162,7 +169,7 @@ public class SkupListService { |
|
|
}
|
|
|
int offset = (request.getPage() - 1) * limit;
|
|
|
List<SellerOrderGoods> sogList = sellerOrderGoodsViewMapper.selectEntryListByUidStatusGBSkc(uid,
|
|
|
statusList, NORMAL_SKUPTYPES, offset , limit);
|
|
|
statusList, skupTypeCodes, offset , limit);
|
|
|
if (CollectionUtils.isEmpty(sogList)){
|
|
|
logger.warn("seller get entry order list SellerOrderGoods is empty,req {}", request);
|
|
|
return respBuilder.build();
|
...
|
...
|
@@ -240,8 +247,9 @@ public class SkupListService { |
|
|
sogCondition.setProductId(productId=request.getProductId());
|
|
|
sogCondition.setUid(uid);
|
|
|
sogCondition.setStatus(status);
|
|
|
final List<Integer> skupTypeCodes = ENTRY_SKUP_TYPES;
|
|
|
//
|
|
|
int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSku(sogCondition, NORMAL_SKUPTYPES);
|
|
|
int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSku(sogCondition, skupTypeCodes);
|
|
|
respBuilder.total(total);
|
|
|
if (total == 0){
|
|
|
return respBuilder.build();
|
...
|
...
|
@@ -250,7 +258,7 @@ public class SkupListService { |
|
|
respBuilder.pagetotal(pageTotal);
|
|
|
int offset = (request.getPage() - 1) * limit;
|
|
|
List<SellerOrderGoods> sogList = sellerOrderGoodsViewMapper.selectEntryListByUidStatusGBSku(sogCondition,
|
|
|
NORMAL_SKUPTYPES, offset, limit);
|
|
|
skupTypeCodes, offset, limit);
|
|
|
//TODO 可以提前计算 total offset limit三者之间的关系,减少一次网络IO
|
|
|
if (CollectionUtils.isEmpty(sogList)){
|
|
|
logger.warn("seller get order list SellerOrderGoods is empty,req {}", request);
|
...
|
...
|
|