|
@@ -0,0 +1,29 @@
|
|
|
+package com.dayou.service.impl;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.dayou.entity.HouseGuarantyArea;
|
|
|
+import com.dayou.mapper.HouseGuarantyAreaMapper;
|
|
|
+import com.dayou.service.HouseGuarantyAreaService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+@Service
|
|
|
+public class HouseGuarantyAreaServiceImpl extends ServiceImpl<HouseGuarantyAreaMapper, HouseGuarantyArea> implements HouseGuarantyAreaService {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private HouseGuarantyAreaMapper houseGuarantyAreaMapper;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public HouseGuarantyArea getByLngLat(String lngLat) {
|
|
|
+ List<BigDecimal> lngLats = Arrays.stream(lngLat.split(","))
|
|
|
+ .map(BigDecimal::new).collect(Collectors.toList());
|
|
|
+ BigDecimal lng = lngLats.get(0);
|
|
|
+ BigDecimal lat = lngLats.get(1);
|
|
|
+ return houseGuarantyAreaMapper.getByLngLat(lng,lat);
|
|
|
+ }
|
|
|
+}
|