|
|
@ -66,6 +66,22 @@ public class RecycleStationController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("回收站详情")
|
|
|
|
|
|
|
|
@GetMapping("/info2")
|
|
|
|
|
|
|
|
public CommonResult<RecycleStationRespVO> stationInfo2(@RequestParam("stationId") String stationId, @Valid LocationDTO location) {
|
|
|
|
|
|
|
|
RecycleStation station = recycleStationService.getStationById(stationId);
|
|
|
|
|
|
|
|
RecycleStationRespVO recycleStationRespVO = BeanUtils.copyBean(station, RecycleStationRespVO.class);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(station)) {
|
|
|
|
|
|
|
|
recycleStationRespVO = BeanUtils.copyBean(station, RecycleStationRespVO.class);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("回收站详情")
|
|
|
|
@ApiOperation("回收站详情")
|
|
|
|
@GetMapping("/info")
|
|
|
|
@GetMapping("/info")
|
|
|
|
public CommonResult<RecycleStationRespVO> stationInfo(@RequestParam("stationId") String stationId, @Valid LocationDTO location) {
|
|
|
|
public CommonResult<RecycleStationRespVO> stationInfo(@RequestParam("stationId") String stationId, @Valid LocationDTO location) {
|
|
|
@ -73,7 +89,7 @@ public class RecycleStationController {
|
|
|
|
RecycleStationRespVO recycleStationRespVO = BeanUtils.copyBean(station, RecycleStationRespVO.class);
|
|
|
|
RecycleStationRespVO recycleStationRespVO = BeanUtils.copyBean(station, RecycleStationRespVO.class);
|
|
|
|
if (ObjectUtil.isNotEmpty(station)) {
|
|
|
|
if (ObjectUtil.isNotEmpty(station)) {
|
|
|
|
recycleStationRespVO = BeanUtils.copyBean(station, RecycleStationRespVO.class);
|
|
|
|
recycleStationRespVO = BeanUtils.copyBean(station, RecycleStationRespVO.class);
|
|
|
|
List<ProductRespVO> productList = recycleStationService.getStationProduct(station.getId());
|
|
|
|
List<ProductRespVO> productList = recycleStationService.getStationProductAllByStationId(station.getId());
|
|
|
|
List<ProductRespVO> productTreeList = CommonUtil.getChildrenList(null, productList);
|
|
|
|
List<ProductRespVO> productTreeList = CommonUtil.getChildrenList(null, productList);
|
|
|
|
recycleStationRespVO.setStationProducts(productTreeList);
|
|
|
|
recycleStationRespVO.setStationProducts(productTreeList);
|
|
|
|
this.computeStationDistance(recycleStationRespVO, location);
|
|
|
|
this.computeStationDistance(recycleStationRespVO, location);
|
|
|
@ -85,12 +101,11 @@ public class RecycleStationController {
|
|
|
|
@ApiOperation("回收站废品价格类目")
|
|
|
|
@ApiOperation("回收站废品价格类目")
|
|
|
|
@GetMapping("/price-product")
|
|
|
|
@GetMapping("/price-product")
|
|
|
|
public CommonResult<List<ProductRespVO>> stationProduct(@RequestParam("stationId") String stationId) {
|
|
|
|
public CommonResult<List<ProductRespVO>> stationProduct(@RequestParam("stationId") String stationId) {
|
|
|
|
List<ProductRespVO> productList = recycleStationService.getStationProduct(stationId);
|
|
|
|
List<ProductRespVO> productList = recycleStationService.getStationProductAllByStationId(stationId);
|
|
|
|
List<ProductRespVO> productTreeList = CommonUtil.getChildrenList(null, productList);
|
|
|
|
List<ProductRespVO> productTreeList = CommonUtil.getChildrenList(null, productList);
|
|
|
|
return CommonResult.success(productTreeList);
|
|
|
|
return CommonResult.success(productTreeList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("附近的回收站")
|
|
|
|
@ApiOperation("附近的回收站")
|
|
|
|
@GetMapping("/nearby")
|
|
|
|
@GetMapping("/nearby")
|
|
|
|
public CommonResult<RecycleStationRespVO> stationNearby(@Valid LocationDTO location) {
|
|
|
|
public CommonResult<RecycleStationRespVO> stationNearby(@Valid LocationDTO location) {
|
|
|
@ -98,7 +113,8 @@ public class RecycleStationController {
|
|
|
|
RecycleStationRespVO stationRespVO = null;
|
|
|
|
RecycleStationRespVO stationRespVO = null;
|
|
|
|
if (ObjectUtil.isNotEmpty(nearbyStation)) {
|
|
|
|
if (ObjectUtil.isNotEmpty(nearbyStation)) {
|
|
|
|
stationRespVO = BeanUtils.copyBean(nearbyStation, RecycleStationRespVO.class);
|
|
|
|
stationRespVO = BeanUtils.copyBean(nearbyStation, RecycleStationRespVO.class);
|
|
|
|
List<ProductRespVO> produceList = recycleStationService.getStationProduct(nearbyStation.getId());
|
|
|
|
List<ProductRespVO> produceList = recycleStationService.getStationProductFirstByStationId(nearbyStation.getId());
|
|
|
|
|
|
|
|
|
|
|
|
stationRespVO.setStationProducts(produceList);
|
|
|
|
stationRespVO.setStationProducts(produceList);
|
|
|
|
this.computeStationDistance(stationRespVO, location);
|
|
|
|
this.computeStationDistance(stationRespVO, location);
|
|
|
|
}
|
|
|
|
}
|
|
|
|