|
|
@ -244,7 +244,7 @@ public class RecycleOrderController {
|
|
|
|
LocationDTO location = (LocationDTO) CommonUtil.obtainField(orderRespVO, "location");
|
|
|
|
LocationDTO location = (LocationDTO) CommonUtil.obtainField(orderRespVO, "location");
|
|
|
|
if (location != null) {
|
|
|
|
if (location != null) {
|
|
|
|
BigDecimal distance = CommonUtil.getDistance(longitude, latitude, location.getLongitude(), location.getLatitude());
|
|
|
|
BigDecimal distance = CommonUtil.getDistance(longitude, latitude, location.getLongitude(), location.getLatitude());
|
|
|
|
CommonUtil.assignField(orderRespVO, "distance2", distance);
|
|
|
|
CommonUtil.assignField(orderRespVO, "distance2", distance.doubleValue());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -262,7 +262,8 @@ public class RecycleOrderController {
|
|
|
|
List<RecycleOrderDetailResponseVO> detailResponseVOList = BeanUtils.copyList(orderProducts, RecycleOrderDetailResponseVO.class);
|
|
|
|
List<RecycleOrderDetailResponseVO> detailResponseVOList = BeanUtils.copyList(orderProducts, RecycleOrderDetailResponseVO.class);
|
|
|
|
// 查询废品信息
|
|
|
|
// 查询废品信息
|
|
|
|
Set<String> productIds = detailResponseVOList.stream().map(RecycleOrderDetailResponseVO::getProductId).collect(Collectors.toSet());
|
|
|
|
Set<String> productIds = detailResponseVOList.stream().map(RecycleOrderDetailResponseVO::getProductId).collect(Collectors.toSet());
|
|
|
|
List<Product> productList = priceProductService.queryProductList(productIds);
|
|
|
|
List<Product> productList = priceProductService.getProductListByIds(productIds);
|
|
|
|
|
|
|
|
if (CollUtils.isNotEmpty(productList)) {
|
|
|
|
Map<String, Product> productMap = productList.stream().collect(Collectors.toMap(Product::getId, p -> p, (k1, k2) -> k1));
|
|
|
|
Map<String, Product> productMap = productList.stream().collect(Collectors.toMap(Product::getId, p -> p, (k1, k2) -> k1));
|
|
|
|
for (RecycleOrderDetailResponseVO detailVO : detailResponseVOList) {
|
|
|
|
for (RecycleOrderDetailResponseVO detailVO : detailResponseVOList) {
|
|
|
|
Product product = productMap.get(detailVO.getProductId());
|
|
|
|
Product product = productMap.get(detailVO.getProductId());
|
|
|
@ -274,6 +275,7 @@ public class RecycleOrderController {
|
|
|
|
CommonUtil.assignField(v, "orderDetails", orderProductsMap.get(v.getId()));
|
|
|
|
CommonUtil.assignField(v, "orderDetails", orderProductsMap.get(v.getId()));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -288,7 +290,8 @@ public class RecycleOrderController {
|
|
|
|
return Optional.ofNullable(clientAddressId).orElse("");
|
|
|
|
return Optional.ofNullable(clientAddressId).orElse("");
|
|
|
|
}, (k1, k2) -> k1));
|
|
|
|
}, (k1, k2) -> k1));
|
|
|
|
Set<String> addressIds = new HashSet<>(CollUtils.removeEmpty(orderAddressMap.values()));
|
|
|
|
Set<String> addressIds = new HashSet<>(CollUtils.removeEmpty(orderAddressMap.values()));
|
|
|
|
List<ClientAddress> clientAddresses = clientAddressService.queryAddressList(addressIds);
|
|
|
|
List<ClientAddress> clientAddresses = clientAddressService.getAddressListByIds(addressIds);
|
|
|
|
|
|
|
|
if (CollUtils.isNotEmpty(clientAddresses)) {
|
|
|
|
List<ClientAddressSimpleVO> addressSimpleVOList = BeanUtils.copyList(clientAddresses, ClientAddressSimpleVO.class);
|
|
|
|
List<ClientAddressSimpleVO> addressSimpleVOList = BeanUtils.copyList(clientAddresses, ClientAddressSimpleVO.class);
|
|
|
|
Map<String, ClientAddressSimpleVO> clientAddressMap = addressSimpleVOList.stream().collect(
|
|
|
|
Map<String, ClientAddressSimpleVO> clientAddressMap = addressSimpleVOList.stream().collect(
|
|
|
|
Collectors.toMap(ClientAddressSimpleVO::getId, v -> v, (k1, k2) -> k1));
|
|
|
|
Collectors.toMap(ClientAddressSimpleVO::getId, v -> v, (k1, k2) -> k1));
|
|
|
@ -297,6 +300,7 @@ public class RecycleOrderController {
|
|
|
|
CommonUtil.assignField(v, "clientAddressId", clientAddressId);
|
|
|
|
CommonUtil.assignField(v, "clientAddressId", clientAddressId);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -309,6 +313,7 @@ public class RecycleOrderController {
|
|
|
|
RecycleOrderRespVO::getId, v -> Optional.ofNullable(v.getStaffsId()).orElse(""), (k1, k2) -> k1));
|
|
|
|
RecycleOrderRespVO::getId, v -> Optional.ofNullable(v.getStaffsId()).orElse(""), (k1, k2) -> k1));
|
|
|
|
Set<String> recyclerIds = new HashSet<>(CollUtils.removeEmpty(orderRecyclerMap.values()));
|
|
|
|
Set<String> recyclerIds = new HashSet<>(CollUtils.removeEmpty(orderRecyclerMap.values()));
|
|
|
|
List<Recycler> recyclerList = recyclerService.getRecyclerByIds(recyclerIds);
|
|
|
|
List<Recycler> recyclerList = recyclerService.getRecyclerByIds(recyclerIds);
|
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(recyclerList)) {
|
|
|
|
List<RecyclerSimpleVO> recyclerSimpleVOList = BeanUtils.copyList(recyclerList, RecyclerSimpleVO.class);
|
|
|
|
List<RecyclerSimpleVO> recyclerSimpleVOList = BeanUtils.copyList(recyclerList, RecyclerSimpleVO.class);
|
|
|
|
Map<String, RecyclerSimpleVO> recyclerMap = recyclerSimpleVOList.stream().collect(
|
|
|
|
Map<String, RecyclerSimpleVO> recyclerMap = recyclerSimpleVOList.stream().collect(
|
|
|
|
Collectors.toMap(RecyclerSimpleVO::getId, v -> v, (k1, k2) -> k1));
|
|
|
|
Collectors.toMap(RecyclerSimpleVO::getId, v -> v, (k1, k2) -> k1));
|
|
|
@ -320,6 +325,7 @@ public class RecycleOrderController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -335,6 +341,7 @@ public class RecycleOrderController {
|
|
|
|
}, (k1, k2) -> k1));
|
|
|
|
}, (k1, k2) -> k1));
|
|
|
|
Set<String> housingEstateIds = new HashSet<>(CollUtils.removeEmpty(orderHousingEstateMap.values()));
|
|
|
|
Set<String> housingEstateIds = new HashSet<>(CollUtils.removeEmpty(orderHousingEstateMap.values()));
|
|
|
|
List<HousingEstate> housingEstateList = housingEstateService.getHousingListByIds(housingEstateIds);
|
|
|
|
List<HousingEstate> housingEstateList = housingEstateService.getHousingListByIds(housingEstateIds);
|
|
|
|
|
|
|
|
if (CollUtils.isNotEmpty(housingEstateList)) {
|
|
|
|
List<HousingEstateSimpleVO> housingSimpleVOList = BeanUtils.copyList(housingEstateList, HousingEstateSimpleVO.class);
|
|
|
|
List<HousingEstateSimpleVO> housingSimpleVOList = BeanUtils.copyList(housingEstateList, HousingEstateSimpleVO.class);
|
|
|
|
Map<String, HousingEstateSimpleVO> housingEstateMap = housingSimpleVOList.stream().collect(
|
|
|
|
Map<String, HousingEstateSimpleVO> housingEstateMap = housingSimpleVOList.stream().collect(
|
|
|
|
Collectors.toMap(HousingEstateSimpleVO::getId, v -> v, (k1, k2) -> k1));
|
|
|
|
Collectors.toMap(HousingEstateSimpleVO::getId, v -> v, (k1, k2) -> k1));
|
|
|
@ -343,5 +350,6 @@ public class RecycleOrderController {
|
|
|
|
CommonUtil.assignField(v, "housingEstateInfo", housingEstateMap.get(housingEstateId));
|
|
|
|
CommonUtil.assignField(v, "housingEstateInfo", housingEstateMap.get(housingEstateId));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|