Authored by chenchao

seller order list filter by skup type of hongkong

@@ -13,7 +13,6 @@ import com.yohoufo.dal.order.model.SellerWallet; @@ -13,7 +13,6 @@ import com.yohoufo.dal.order.model.SellerWallet;
13 import com.yohoufo.order.event.BatchPublishTailEvent; 13 import com.yohoufo.order.event.BatchPublishTailEvent;
14 import com.yohoufo.order.event.SellerOrderPriceChangeEvent; 14 import com.yohoufo.order.event.SellerOrderPriceChangeEvent;
15 import com.yohoufo.order.service.MerchantOrderPaymentService; 15 import com.yohoufo.order.service.MerchantOrderPaymentService;
16 -import com.yohoufo.order.service.impl.SellerWrapper;  
17 import com.yohoufo.order.service.proxy.ProductProxyService; 16 import com.yohoufo.order.service.proxy.ProductProxyService;
18 import com.yohoufo.order.service.seller.support.SkupTypeCodeSupport; 17 import com.yohoufo.order.service.seller.support.SkupTypeCodeSupport;
19 import com.yohoufo.order.utils.LoggerUtils; 18 import com.yohoufo.order.utils.LoggerUtils;
@@ -55,8 +55,14 @@ public class SkupListService { @@ -55,8 +55,14 @@ public class SkupListService {
55 55
56 private final Logger logger = LoggerUtils.getSellerOrderLogger(); 56 private final Logger logger = LoggerUtils.getSellerOrderLogger();
57 57
58 - final static List<Integer> NORMAL_SKUPTYPES = Lists.newArrayList(SkupType.IN_STOCK.getCode(),  
59 - SkupType.ADVANCE.getCode()); 58 + final static List<Integer> NORMAL_SKUPTYPES = Lists.newArrayList(SkupType.IN_STOCK.prdAttributes().getCode(),
  59 + SkupType.ADVANCE.prdAttributes().getCode()),
  60 +
  61 + ENTRY_SKUP_TYPES = Lists.newArrayList(SkupType.IN_STOCK.prdAttributes().getCode(),
  62 + SkupType.ADVANCE.prdAttributes().getCode(),SkupType.HK_IN_STOCK.prdAttributes().getCode())
  63 + ;
  64 +
  65 +
60 66
61 final static List<Integer> IMPERFECT_SKUPTYPES = Lists.newArrayList(SkupType.FLAW.getCode(), SkupType.SECOND_HAND.getCode()); 67 final static List<Integer> IMPERFECT_SKUPTYPES = Lists.newArrayList(SkupType.FLAW.getCode(), SkupType.SECOND_HAND.getCode());
62 68
@@ -154,7 +160,8 @@ public class SkupListService { @@ -154,7 +160,8 @@ public class SkupListService {
154 if ((type=request.getType()) == SellerOrderListType.IN_SALE.getType()) { 160 if ((type=request.getType()) == SellerOrderListType.IN_SALE.getType()) {
155 SkupStatus viewableStatus = SkupStatus.CAN_SELL; 161 SkupStatus viewableStatus = SkupStatus.CAN_SELL;
156 List<Integer> statusList = Arrays.asList(viewableStatus.getCode()); 162 List<Integer> statusList = Arrays.asList(viewableStatus.getCode());
157 - int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSkc(uid, statusList, NORMAL_SKUPTYPES); 163 + final List<Integer> skupTypeCodes = ENTRY_SKUP_TYPES;
  164 + int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSkc(uid, statusList, skupTypeCodes);
158 respBuilder.total(total) 165 respBuilder.total(total)
159 .pagetotal((total % limit == 0) ? (total / limit) : (total / limit + 1)); 166 .pagetotal((total % limit == 0) ? (total / limit) : (total / limit + 1));
160 if (total == 0){ 167 if (total == 0){
@@ -162,7 +169,7 @@ public class SkupListService { @@ -162,7 +169,7 @@ public class SkupListService {
162 } 169 }
163 int offset = (request.getPage() - 1) * limit; 170 int offset = (request.getPage() - 1) * limit;
164 List<SellerOrderGoods> sogList = sellerOrderGoodsViewMapper.selectEntryListByUidStatusGBSkc(uid, 171 List<SellerOrderGoods> sogList = sellerOrderGoodsViewMapper.selectEntryListByUidStatusGBSkc(uid,
165 - statusList, NORMAL_SKUPTYPES, offset , limit); 172 + statusList, skupTypeCodes, offset , limit);
166 if (CollectionUtils.isEmpty(sogList)){ 173 if (CollectionUtils.isEmpty(sogList)){
167 logger.warn("seller get entry order list SellerOrderGoods is empty,req {}", request); 174 logger.warn("seller get entry order list SellerOrderGoods is empty,req {}", request);
168 return respBuilder.build(); 175 return respBuilder.build();
@@ -240,8 +247,9 @@ public class SkupListService { @@ -240,8 +247,9 @@ public class SkupListService {
240 sogCondition.setProductId(productId=request.getProductId()); 247 sogCondition.setProductId(productId=request.getProductId());
241 sogCondition.setUid(uid); 248 sogCondition.setUid(uid);
242 sogCondition.setStatus(status); 249 sogCondition.setStatus(status);
  250 + final List<Integer> skupTypeCodes = ENTRY_SKUP_TYPES;
243 // 251 //
244 - int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSku(sogCondition, NORMAL_SKUPTYPES); 252 + int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSku(sogCondition, skupTypeCodes);
245 respBuilder.total(total); 253 respBuilder.total(total);
246 if (total == 0){ 254 if (total == 0){
247 return respBuilder.build(); 255 return respBuilder.build();
@@ -250,7 +258,7 @@ public class SkupListService { @@ -250,7 +258,7 @@ public class SkupListService {
250 respBuilder.pagetotal(pageTotal); 258 respBuilder.pagetotal(pageTotal);
251 int offset = (request.getPage() - 1) * limit; 259 int offset = (request.getPage() - 1) * limit;
252 List<SellerOrderGoods> sogList = sellerOrderGoodsViewMapper.selectEntryListByUidStatusGBSku(sogCondition, 260 List<SellerOrderGoods> sogList = sellerOrderGoodsViewMapper.selectEntryListByUidStatusGBSku(sogCondition,
253 - NORMAL_SKUPTYPES, offset, limit); 261 + skupTypeCodes, offset, limit);
254 //TODO 可以提前计算 total offset limit三者之间的关系,减少一次网络IO 262 //TODO 可以提前计算 total offset limit三者之间的关系,减少一次网络IO
255 if (CollectionUtils.isEmpty(sogList)){ 263 if (CollectionUtils.isEmpty(sogList)){
256 logger.warn("seller get order list SellerOrderGoods is empty,req {}", request); 264 logger.warn("seller get order list SellerOrderGoods is empty,req {}", request);
@@ -33,6 +33,9 @@ public final class SellerGoodsHelper { @@ -33,6 +33,9 @@ public final class SellerGoodsHelper {
33 } 33 }
34 34
35 public static String addFlag2GoodsNameHead(String prdName, SkupType skupType){ 35 public static String addFlag2GoodsNameHead(String prdName, SkupType skupType){
  36 + if (SkupType.IN_STOCK.equals(skupType)){
  37 + return prdName;
  38 + }
36 String goodsFlag = buildGoodsFlag(skupType); 39 String goodsFlag = buildGoodsFlag(skupType);
37 return StringUtils.isNoneBlank(goodsFlag)? goodsFlag+prdName: prdName; 40 return StringUtils.isNoneBlank(goodsFlag)? goodsFlag+prdName: prdName;
38 } 41 }