fix-交付中心

This commit is contained in:
xl
2024-07-10 15:01:11 +08:00
parent fa79aeec73
commit 5a195d7612
3 changed files with 14 additions and 5 deletions

View File

@@ -65,7 +65,7 @@ public class CarProductSellController {
@ApiImplicitParam(name = "type", value = "订单状态0买车1组买灵活", required = true)
})
@RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
public CommonResult<CarSellerProduct> info(@PathVariable Integer id, @RequestParam(name = "type") Integer type) {
public CommonResult<CarSellerProduct> info(@PathVariable Integer id, @RequestParam(name = "type") Integer type, @RequestParam(name = "city") String city) {
Integer uid = userService.getUserIdException();
CarSellerProduct carSellerProduct = carSellerProductService.detail(id);
if (carSellerProduct.getType() != 2 && !carSellerProduct.getType().equals(type)) {
@@ -73,7 +73,7 @@ public class CarProductSellController {
}
carSellerProduct.setInteriorList(carParameterColorService.getByCpId(carSellerProduct.getId(), CarSellerProductColorConstants.TYPE_2));
carSellerProduct.setAppearaceList(carParameterColorService.getByCpId(carSellerProduct.getId(), CarSellerProductColorConstants.TYPE_1));
List<CarSellerProductAttr> attrList = carSellerProductAttrService.listByCspIdAndType(carSellerProduct.getId(), type);
List<CarSellerProductAttr> attrList = carSellerProductAttrService.listByCspIdAndType(carSellerProduct.getId(), type, city);
if (attrList != null && !attrList.isEmpty()) {
List<Integer> carDealerIdList = attrList.stream().map(CarSellerProductAttr::getCarDealerId).collect(Collectors.toList());
Map<Integer, CarDealer> map = carDealerService.getMapList(carDealerIdList);

View File

@@ -29,7 +29,7 @@ public interface CarSellerProductAttrService extends IService<CarSellerProductAt
List<CarSellerProductAttr> getByCarDealerIdAndType(Integer carDealerId, Integer type, List<CarDealerPageResponse> carDealerList);
List<CarSellerProductAttr> listByCspIdAndType(Integer cspId, Integer type);
List<CarSellerProductAttr> listByCspIdAndType(Integer cspId, Integer type, String city);
List<CarSellerProductAttr> getListByCspIdAll(Integer cspId);

View File

@@ -202,11 +202,20 @@ public class CarSellerProductAttrServiceImpl extends ServiceImpl<CarSellerProduc
}
@Override
public List<CarSellerProductAttr> listByCspIdAndType(Integer cspId, Integer type) {
public List<CarSellerProductAttr> listByCspIdAndType(Integer cspId, Integer type, String city) {
Set<Integer> carDealerIds = CollUtil.newHashSet();
if (StrUtil.isNotBlank(city)) {
List<CarDealer> carDealerList = carDealerService.list(new LambdaQueryWrapper<CarDealer>().eq(CarDealer::getCity, city));
if (CollUtil.isEmpty(carDealerList)) {
return CollUtil.newArrayList();
}
carDealerIds = carDealerList.stream().map(CarDealer::getId).collect(Collectors.toSet());
}
List<CarSellerProductAttr> list = list(new LambdaQueryWrapper<CarSellerProductAttr>()
.eq(CarSellerProductAttr::getCspId, cspId)
.eq(CarSellerProductAttr::getIsShow, Boolean.TRUE)
.eq(CarSellerProductAttr::getType, type));
.eq(CarSellerProductAttr::getType, type)
.in(CollUtil.isNotEmpty(carDealerIds), CarSellerProductAttr::getCarDealerId, carDealerIds));
if (CollUtil.isEmpty(list)) {
return CollUtil.newArrayList();
}