Authored by chenchao

rename

... ... @@ -55,7 +55,7 @@ public class SkupListService {
private final Logger logger = LoggerUtils.getSellerOrderLogger();
final static List<Integer> skupTypes = Lists.newArrayList(SkupType.IN_STOCK.getCode(),
final static List<Integer> NORMAL_SKUPTYPES = Lists.newArrayList(SkupType.IN_STOCK.getCode(),
SkupType.ADVANCE.getCode());
final static List<Integer> IMPERFECT_SKUPTYPES = Lists.newArrayList(SkupType.FLAW.getCode(), SkupType.SECOND_HAND.getCode());
... ... @@ -153,7 +153,7 @@ 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, skupTypes);
int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSkc(uid, statusList, NORMAL_SKUPTYPES);
respBuilder.total(total)
.pagetotal((total % limit == 0) ? (total / limit) : (total / limit + 1));
if (total == 0){
... ... @@ -161,7 +161,7 @@ public class SkupListService {
}
int offset = (request.getPage() - 1) * limit;
List<SellerOrderGoods> sogList = sellerOrderGoodsViewMapper.selectEntryListByUidStatusGBSkc(uid,
statusList,skupTypes, offset , limit);
statusList, NORMAL_SKUPTYPES, offset , limit);
if (CollectionUtils.isEmpty(sogList)){
logger.warn("seller get entry order list SellerOrderGoods is empty,req {}", request);
return respBuilder.build();
... ... @@ -188,7 +188,7 @@ public class SkupListService {
if ((type=request.getType()) == SellerOrderListType.IN_SALE.getType()){
List<Integer> statusList = sellerOrderListService.initOrderListRequest(request);
int total = sellerOrderGoodsViewMapper.selectNotEntryCntByUidStatus(request.getUid(), statusList, skupTypes);
int total = sellerOrderGoodsViewMapper.selectNotEntryCntByUidStatus(request.getUid(), statusList, NORMAL_SKUPTYPES);
respBuilder = PageResp.builder()
.page(request.getPage())
.pageSize(limit)
... ... @@ -199,7 +199,7 @@ public class SkupListService {
}
int offset = (request.getPage() - 1) * limit;
List<SellerOrderGoods> sogList = sellerOrderGoodsViewMapper.selectNotEntryListByUidStatus(request.getUid(),
statusList, skupTypes, offset, limit);
statusList, NORMAL_SKUPTYPES, offset, limit);
//TODO 可以提前计算 total offset limit三者之间的关系,减少一次网络I
if (CollectionUtils.isEmpty(sogList)){
logger.warn("seller get order list SellerOrderGoods is empty,req {}", request);
... ... @@ -240,7 +240,7 @@ public class SkupListService {
sogCondition.setUid(uid);
sogCondition.setStatus(status);
//
int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSku(sogCondition, skupTypes);
int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSku(sogCondition, NORMAL_SKUPTYPES);
respBuilder.total(total);
if (total == 0){
return respBuilder.build();
... ... @@ -249,7 +249,7 @@ public class SkupListService {
respBuilder.pagetotal(pageTotal);
int offset = (request.getPage() - 1) * limit;
List<SellerOrderGoods> sogList = sellerOrderGoodsViewMapper.selectEntryListByUidStatusGBSku(sogCondition,
skupTypes, offset, limit);
NORMAL_SKUPTYPES, offset, limit);
//TODO 可以提前计算 total offset limit三者之间的关系,减少一次网络IO
if (CollectionUtils.isEmpty(sogList)){
logger.warn("seller get order list SellerOrderGoods is empty,req {}", request);
... ... @@ -310,7 +310,7 @@ public class SkupListService {
private SellerOrderGoods fetchSellerOrderGoodsFromDB(int uid,
List<Integer> statusList,
Integer productId){
SellerOrderGoods psogOfMerge = sellerOrderGoodsViewMapper.selectByUidStatusGBSkc(uid, statusList,skupTypes, productId);
SellerOrderGoods psogOfMerge = sellerOrderGoodsViewMapper.selectByUidStatusGBSkc(uid, statusList, NORMAL_SKUPTYPES, productId);
logger.info("fetchSellerOrderGoodsFromDB uid {} statusList {} prd id {}", uid, statusList, productId);
return psogOfMerge;
}
... ... @@ -327,13 +327,13 @@ public class SkupListService {
sogCondition.setUid(uid);
sogCondition.setStatus(status);
//
int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSku(sogCondition, skupTypes);
int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSku(sogCondition, NORMAL_SKUPTYPES);
if (total == 0){
return popDTO;
}
int offset = 0, limit = total;
List<SellerOrderGoods> sogList = sellerOrderGoodsViewMapper.selectEntryListByUidStatusGBSku(sogCondition, skupTypes,
List<SellerOrderGoods> sogList = sellerOrderGoodsViewMapper.selectEntryListByUidStatusGBSku(sogCondition, NORMAL_SKUPTYPES,
offset, limit);
if (CollectionUtils.isEmpty(sogList)){
logger.warn("seller getPrdOverPriceDTO use SellerOrderGoods is empty,uid {} productId {}", uid, productId);
... ... @@ -458,7 +458,7 @@ public class SkupListService {
sogCondition.setProductId(productId=req.getProductId());
sogCondition.setUid(uid);
sogCondition.setStatus(status);
List<SellerOrderGoods> sogList = sellerOrderGoodsViewMapper.selectEntryListByUidStatusGBSku(sogCondition,skupTypes, 0, 1);
List<SellerOrderGoods> sogList = sellerOrderGoodsViewMapper.selectEntryListByUidStatusGBSku(sogCondition, NORMAL_SKUPTYPES, 0, 1);
if (CollectionUtils.isEmpty(sogList)){
logger.warn("in getOrderListInfo soglist is empty req {}", req);
return null;
... ...