二级分类,预约、到站、定时下单

master
jevononlie 6 months ago committed by siontion
parent 7e83c6e044
commit 950e7b8686

@ -144,13 +144,16 @@ public class RecycleOrderController {
RecycleOrder recycleOrder = recycleOrderService.getOrderById(orderId, false); RecycleOrder recycleOrder = recycleOrderService.getOrderById(orderId, false);
// 查询回收站下的所有类目信息 // 查询回收站下的所有类目信息
String recycleStationId = recycleOrder.getRecycleStationId(); String recycleStationId = recycleOrder.getRecycleStationId();
List<ProductRespVO> productList = recycleStationService.getStationProduct(recycleStationId); List<ProductRespVO> productList = recycleStationService.getStationProductAllByStationId(recycleStationId);
List<ProductRespVO> productTreeList = CommonUtil.getChildrenList(null, productList); List<ProductRespVO> productTreeList = CommonUtil.getChildrenList(null, productList);
// 查询订单关联的一级类目信息
// // 查询订单关联的二级类目信息
List<RecycleOrderProduct> orderProducts = recycleOrderProductService.getOrderProductsByOrderId(orderId); List<RecycleOrderProduct> orderProducts = recycleOrderProductService.getOrderProductsByOrderId(orderId);
List<String> categoryIdList = orderProducts.stream().map(RecycleOrderProduct::getProductId).collect(Collectors.toList()); List<String> categoryIdList = orderProducts.stream().map(RecycleOrderProduct::getProductId).collect(Collectors.toList());
productTreeList = productTreeList.stream().filter(v -> categoryIdList.contains(v.getProductId())).collect(Collectors.toList());
productTreeList = productTreeList.stream().filter(v -> categoryIdList.contains(v.getId())).collect(Collectors.toList());
return CommonResult.success(productTreeList); return CommonResult.success(productTreeList);
} }

@ -103,6 +103,9 @@ public class RecycleStationController {
public CommonResult<List<ProductRespVO>> stationProduct(@RequestParam("stationId") String stationId) { public CommonResult<List<ProductRespVO>> stationProduct(@RequestParam("stationId") String stationId) {
List<ProductRespVO> productList = recycleStationService.getStationProductAllByStationId(stationId); List<ProductRespVO> productList = recycleStationService.getStationProductAllByStationId(stationId);
List<ProductRespVO> productTreeList = CommonUtil.getChildrenList(null, productList); List<ProductRespVO> productTreeList = CommonUtil.getChildrenList(null, productList);
for(ProductRespVO item : productTreeList) {
item.setProductId(item.getId());
}
return CommonResult.success(productTreeList); return CommonResult.success(productTreeList);
} }

@ -288,8 +288,8 @@ public class RecycleOrderServiceImpl extends ServiceImpl<RecycleOrderMapper, Rec
if (ObjectUtil.isEmpty(latestPriceProduct)) { if (ObjectUtil.isEmpty(latestPriceProduct)) {
throw new BusinessLogicException("产品价格信息未公布,请联系商户!"); throw new BusinessLogicException("产品价格信息未公布,请联系商户!");
} }
BigDecimal recoveryPrice = Optional.ofNullable(latestPriceProduct.getRecoveryPrice()).orElse(new BigDecimal("0.00")); // BigDecimal recoveryPrice = Optional.ofNullable(latestPriceProduct.getRecoveryPrice()).orElse(new BigDecimal("0.00"));
rp.setActualRecoveryPrice(recoveryPrice); // rp.setActualRecoveryPrice(recoveryPrice);
}); });
this.recycleOrderProductService.createOrderProducts(recycleOrderProducts); this.recycleOrderProductService.createOrderProducts(recycleOrderProducts);
@ -420,8 +420,8 @@ public class RecycleOrderServiceImpl extends ServiceImpl<RecycleOrderMapper, Rec
if (ObjectUtil.isEmpty(latestPriceProduct)) { if (ObjectUtil.isEmpty(latestPriceProduct)) {
throw new BusinessLogicException("产品价格信息未公布,请联系商户!"); throw new BusinessLogicException("产品价格信息未公布,请联系商户!");
} }
BigDecimal recoveryPrice = Optional.ofNullable(latestPriceProduct.getRecoveryPrice()).orElse(new BigDecimal("0.00")); // BigDecimal recoveryPrice = Optional.ofNullable(latestPriceProduct.getRecoveryPrice()).orElse(new BigDecimal("0.00"));
rp.setActualRecoveryPrice(recoveryPrice); // rp.setActualRecoveryPrice(recoveryPrice);
}); });
this.recycleOrderProductService.saveOrderProducts(recycleOrderProducts); this.recycleOrderProductService.saveOrderProducts(recycleOrderProducts);
@ -481,8 +481,8 @@ public class RecycleOrderServiceImpl extends ServiceImpl<RecycleOrderMapper, Rec
if (ObjectUtil.isEmpty(latestPriceProduct)) { if (ObjectUtil.isEmpty(latestPriceProduct)) {
throw new BusinessLogicException("产品价格信息未公布,请联系商户!"); throw new BusinessLogicException("产品价格信息未公布,请联系商户!");
} }
BigDecimal recoveryPrice = Optional.ofNullable(latestPriceProduct.getRecoveryPrice()).orElse(new BigDecimal("0.00")); // BigDecimal recoveryPrice = Optional.ofNullable(latestPriceProduct.getRecoveryPrice()).orElse(new BigDecimal("0.00"));
rp.setActualRecoveryPrice(recoveryPrice); // rp.setActualRecoveryPrice(recoveryPrice);
}); });
this.recycleOrderProductService.saveOrderProducts(recycleOrderProducts); this.recycleOrderProductService.saveOrderProducts(recycleOrderProducts);

Loading…
Cancel
Save