Authored by chenchao

add imperfect goods list api

... ... @@ -157,4 +157,22 @@ public class SellerGoodsController {
throw ex;
}
}
@RequestMapping(params = "method=ufo.seller.imperfectGoodsList")
@ResponseBody
public ApiResponse getImperfectGoodsList(@RequestParam("type") int type,
@RequestParam("uid") int uid,
@RequestParam(value = "page", required = false, defaultValue = "1") int page,
@RequestParam(value = "limit", required = false, defaultValue = "10") int limit) {
OrderListRequest orderListRequest = OrderListRequest.builder()
.uid(uid)
.type(type)
.page(page)
.limit(limit)
.build();
logger.info("ufo.seller.imperfectGoodsList orderListRequest {}", orderListRequest);
PageResp<OrderListInfo> orderListInfoRsp;
orderListInfoRsp = skupListService.getImperfectGoodsList(orderListRequest);
return new ApiResponse.ApiResponseBuilder().code(200).data(orderListInfoRsp).message("卖家订单列表").build();
}
}
... ...
... ... @@ -410,6 +410,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
orderDetailInfo.setSecendLevelCreateTime(order.getCreateTime());
orderDetailInfo.setCreateTime(DateUtil.formatDate(order.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
orderDetailInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(soga));
orderDetailInfo.setAttributes(soga);
orderDetailInfo.setStatusDetail(statusDetail);
return orderDetailInfo;
}
... ...
... ... @@ -39,6 +39,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
... ... @@ -107,12 +108,13 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
public List<OrderListInfo> buildOrderList(List<SellerOrderGoods> sogList, SellerType sellerType){
/*
sogList.stream().forEach(item -> {
item.setImageUrl(ImageUrlAssist.getAllProductPicUrl(item.getImageUrl(), "goodsimg", "center", "d2hpdGU="));
});
});*/
Map<String, String> overPriceTipsMap = buildOverPriceTipsMap(sogList);
Map<Integer, SellerOrderGoods> skupSellerOrderGoodsMap = sogList.parallelStream()
.collect(Collectors.toMap(SellerOrderGoods::getId, (SellerOrderGoods sog) -> sog));
.collect(Collectors.toMap(SellerOrderGoods::getId, Function.identity()));
List<Integer> skupList = sogList.parallelStream().map(SellerOrderGoods::getId).collect(Collectors.toList());
List<SellerOrder> sellerOrders = sellerOrderMapper.selectBySkups(skupList);
List<OrderListInfo> data ;
... ... @@ -337,6 +339,7 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
orderListInfo.setTips(tips);
}
orderListInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(soga));
orderListInfo.setAttributes(soga);
return orderListInfo;
}
... ...
... ... @@ -129,8 +129,6 @@ public class SkupListService {
List<OrderListInfo> data = sellerOrderListService.buildOrderList(sogList, sellerType);
orderListInfoRsp = respBuilder.data(data).build();
}
return orderListInfoRsp;
}
... ... @@ -686,7 +684,8 @@ public class SkupListService {
logger.warn("seller get imperfect order list SellerOrderGoods is empty,req {}", request);
return respBuilder.build();
}
final SellerType sellerType = SellerType.COMMON;
boolean isEntry = userProxyService.isEntryShop(request.getUid());
final SellerType sellerType = isEntry ? SellerType.ENTRY : SellerType.COMMON;
List<OrderListInfo> data = sellerOrderListService.buildOrderList(sogList, sellerType);
respBuilder.data(data);
}
... ...