|
|
|
@ -58,8 +58,9 @@ public class RecycleStationController {
|
|
|
|
|
});
|
|
|
|
|
List<RecycleStationRespVO> recycleStationRespVOList = recycleStationPageVO.getList();
|
|
|
|
|
recycleStationRespVOList.forEach(stationRespVO -> {
|
|
|
|
|
List<ProductRespVO> produceList = recycleStationService.getStationProduct(stationRespVO.getId());
|
|
|
|
|
stationRespVO.setStationProducts(produceList);
|
|
|
|
|
List<ProductRespVO> productList = recycleStationService.getStationProduct(stationRespVO.getId());
|
|
|
|
|
List<ProductRespVO> productTreeList = CommonUtil.getChildrenList(null, productList);
|
|
|
|
|
stationRespVO.setStationProducts(productTreeList);
|
|
|
|
|
}); // 性能优化 todo
|
|
|
|
|
return CommonResult.success(recycleStationPageVO);
|
|
|
|
|
}
|
|
|
|
@ -72,8 +73,9 @@ public class RecycleStationController {
|
|
|
|
|
RecycleStationRespVO recycleStationRespVO = BeanUtils.copyBean(station, RecycleStationRespVO.class);
|
|
|
|
|
if (ObjectUtil.isNotEmpty(station)) {
|
|
|
|
|
recycleStationRespVO = BeanUtils.copyBean(station, RecycleStationRespVO.class);
|
|
|
|
|
List<ProductRespVO> produceList = recycleStationService.getStationProduct(station.getId());
|
|
|
|
|
recycleStationRespVO.setStationProducts(produceList);
|
|
|
|
|
List<ProductRespVO> productList = recycleStationService.getStationProduct(station.getId());
|
|
|
|
|
List<ProductRespVO> productTreeList = CommonUtil.getChildrenList(null, productList);
|
|
|
|
|
recycleStationRespVO.setStationProducts(productTreeList);
|
|
|
|
|
this.computeStationDistance(recycleStationRespVO, location);
|
|
|
|
|
}
|
|
|
|
|
return CommonResult.success(recycleStationRespVO);
|
|
|
|
@ -83,8 +85,9 @@ public class RecycleStationController {
|
|
|
|
|
@ApiOperation("回收站废品价格类目")
|
|
|
|
|
@GetMapping("/price-product")
|
|
|
|
|
public CommonResult<List<ProductRespVO>> stationProduct(@RequestParam("stationId") String stationId) {
|
|
|
|
|
List<ProductRespVO> stationProduct = recycleStationService.getStationProduct(stationId);
|
|
|
|
|
return CommonResult.success(stationProduct);
|
|
|
|
|
List<ProductRespVO> productList = recycleStationService.getStationProduct(stationId);
|
|
|
|
|
List<ProductRespVO> productTreeList = CommonUtil.getChildrenList(null, productList);
|
|
|
|
|
return CommonResult.success(productTreeList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|