Authored by chenchao

optimized code

@@ -104,7 +104,11 @@ public class SkupListService { @@ -104,7 +104,11 @@ public class SkupListService {
104 return orderListInfoRsp; 104 return orderListInfoRsp;
105 } 105 }
106 106
107 - 107 + /**
  108 + * 卖家入驻后出售中的商品列表
  109 + * @param request
  110 + * @return
  111 + */
108 public PageResp<OrderListInfo> getEntryGoodsList(OrderListRequest request){ 112 public PageResp<OrderListInfo> getEntryGoodsList(OrderListRequest request){
109 PageResp.PageRespBuilder respBuilder; 113 PageResp.PageRespBuilder respBuilder;
110 int limit = request.getLimit(); 114 int limit = request.getLimit();
@@ -134,6 +138,11 @@ public class SkupListService { @@ -134,6 +138,11 @@ public class SkupListService {
134 return respBuilder.build(); 138 return respBuilder.build();
135 } 139 }
136 140
  141 + /**
  142 + * 卖家(可以是入驻或非入驻的卖家)非入驻出售中的商品列表
  143 + * @param request
  144 + * @return
  145 + */
137 public PageResp<OrderListInfo> getNotEntryGoodsList(OrderListRequest request){ 146 public PageResp<OrderListInfo> getNotEntryGoodsList(OrderListRequest request){
138 PageResp.PageRespBuilder respBuilder; 147 PageResp.PageRespBuilder respBuilder;
139 int limit = request.getLimit(); 148 int limit = request.getLimit();
@@ -170,7 +179,11 @@ public class SkupListService { @@ -170,7 +179,11 @@ public class SkupListService {
170 } 179 }
171 180
172 181
173 - 182 + /**
  183 + * 卖家入驻后 单个skc聚合的所有尺码商品
  184 + * @param request
  185 + * @return
  186 + */
174 public SellerGoodsPageResp<OrderListInfo> getEntryGoodsSizeList(SellerGoodsListRequest request){ 187 public SellerGoodsPageResp<OrderListInfo> getEntryGoodsSizeList(SellerGoodsListRequest request){
175 SellerGoodsPageResp.SGPRBuilder respBuilder; 188 SellerGoodsPageResp.SGPRBuilder respBuilder;
176 int limit = request.getLimit(); 189 int limit = request.getLimit();
@@ -201,7 +214,7 @@ public class SkupListService { @@ -201,7 +214,7 @@ public class SkupListService {
201 int offset = (request.getPage() - 1) * limit; 214 int offset = (request.getPage() - 1) * limit;
202 List<SellerOrderGoods> sogList = sellerOrderGoodsViewMapper.selectEntryListByUidStatusGBSku(sogCondition, 215 List<SellerOrderGoods> sogList = sellerOrderGoodsViewMapper.selectEntryListByUidStatusGBSku(sogCondition,
203 offset, limit); 216 offset, limit);
204 - //TODO 可以提前计算 total offset limit三者之间的关系,减少一次网络I 217 + //TODO 可以提前计算 total offset limit三者之间的关系,减少一次网络IO
205 if (CollectionUtils.isEmpty(sogList)){ 218 if (CollectionUtils.isEmpty(sogList)){
206 logger.warn("seller get order list SellerOrderGoods is empty,req {}", request); 219 logger.warn("seller get order list SellerOrderGoods is empty,req {}", request);
207 return respBuilder.build(); 220 return respBuilder.build();
@@ -233,12 +246,11 @@ public class SkupListService { @@ -233,12 +246,11 @@ public class SkupListService {
233 return productInfo; 246 return productInfo;
234 } 247 }
235 248
236 - public List<OrderListInfo> buildPrdSkuList(List<SellerOrderGoods> sogList, SellerType sellerType){  
237 - ProductInfo productInfo = new ProductInfo(); 249 + private List<OrderListInfo> buildPrdSkuList(List<SellerOrderGoods> sogList, SellerType sellerType){
238 Map<String, String> overPriceTipsMap = sellerOrderListService.buildOverPriceTipsMap(sogList); 250 Map<String, String> overPriceTipsMap = sellerOrderListService.buildOverPriceTipsMap(sogList);
239 List<OrderListInfo> data ; 251 List<OrderListInfo> data ;
240 data = sogList.parallelStream() 252 data = sogList.parallelStream()
241 - .map(sog -> buildOrderListInfo4Sku(sog, overPriceTipsMap)) 253 + .map(sog -> buildOrderListInfo4Sku(sog, overPriceTipsMap, sellerType))
242 .filter(oli -> Objects.nonNull(oli)) 254 .filter(oli -> Objects.nonNull(oli))
243 .collect(Collectors.toList()); 255 .collect(Collectors.toList());
244 return data; 256 return data;
@@ -311,7 +323,8 @@ public class SkupListService { @@ -311,7 +323,8 @@ public class SkupListService {
311 return orderListInfo; 323 return orderListInfo;
312 } 324 }
313 325
314 - OrderListInfo buildOrderListInfo4Sku(SellerOrderGoods sellerOrderGoods, Map<String, String> overPriceTipsMap) { 326 + OrderListInfo buildOrderListInfo4Sku(SellerOrderGoods sellerOrderGoods, Map<String, String> overPriceTipsMap,
  327 + SellerType sellerType) {
315 Integer uid; 328 Integer uid;
316 OrderListInfo orderListInfo = new OrderListInfo(); 329 OrderListInfo orderListInfo = new OrderListInfo();
317 orderListInfo.setUid(uid = sellerOrderGoods.getUid()); 330 orderListInfo.setUid(uid = sellerOrderGoods.getUid());
@@ -326,7 +339,7 @@ public class SkupListService { @@ -326,7 +339,7 @@ public class SkupListService {
326 orderListInfo.setStatuStr(skupStatus.getDesc()); 339 orderListInfo.setStatuStr(skupStatus.getDesc());
327 340
328 // 按钮显示 341 // 按钮显示
329 - List<ButtonShowBo> buttons = skupStatus.getListButtons(SellerType.ENTRY); 342 + List<ButtonShowBo> buttons = skupStatus.getListButtons(sellerType);
330 orderListInfo.setButtons(buttons); 343 orderListInfo.setButtons(buttons);
331 // 344 //
332 GoodsInfo productInfo = new GoodsInfo(); 345 GoodsInfo productInfo = new GoodsInfo();