|
@@ -1,19 +1,19 @@
|
|
|
package com.slibra.business.service.impl;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import com.slibra.business.domain.City;
|
|
|
import com.slibra.business.domain.TNeighborhoodBuilding;
|
|
|
import com.slibra.business.domain.TPumpingStationNeighbourhoodNumber;
|
|
|
+import com.slibra.business.mapper.CityMapper;
|
|
|
import com.slibra.business.mapper.TNeighborhoodBuildingMapper;
|
|
|
import com.slibra.business.mapper.TPumpingStationNeighbourhoodNumberMapper;
|
|
|
import com.slibra.business.req.NeighbourhoodNumberAndAddFlagReq;
|
|
|
import com.slibra.business.res.*;
|
|
|
import com.slibra.common.exception.ServiceException;
|
|
|
import com.slibra.common.utils.DateUtils;
|
|
|
+import com.slibra.common.utils.StringUtils;
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -41,6 +41,9 @@ public class TPumpingStationServiceImpl implements ITPumpingStationService
|
|
|
@Autowired
|
|
|
private TPumpingStationNeighbourhoodNumberMapper tPumpingStationNeighbourhoodNumberMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CityMapper cityMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 查询泵站
|
|
|
*
|
|
@@ -67,11 +70,43 @@ public class TPumpingStationServiceImpl implements ITPumpingStationService
|
|
|
if(!CollectionUtils.isEmpty(pumpingStations)){
|
|
|
for (TPumpingStation pumpingStation : pumpingStations) {
|
|
|
this.addNeighbourhoodAndBuildings(pumpingStation);
|
|
|
+ this.addExtraAddress(pumpingStation);
|
|
|
}
|
|
|
}
|
|
|
return pumpingStations;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 额外处理省市区的名字
|
|
|
+ * @param pumpingStation
|
|
|
+ */
|
|
|
+ private void addExtraAddress(TPumpingStation pumpingStation) {
|
|
|
+ String provinceId = pumpingStation.getProvinceId();
|
|
|
+ String cityId = pumpingStation.getCityId();
|
|
|
+ String countryId = pumpingStation.getCountryId();
|
|
|
+ //省
|
|
|
+ if(StringUtils.isNotBlank(provinceId)){
|
|
|
+ City city = this.cityMapper.selectCityById(provinceId);
|
|
|
+ if(!Objects.isNull(city)){
|
|
|
+ pumpingStation.setProvinceName(city.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //市
|
|
|
+ if(StringUtils.isNotBlank(cityId)){
|
|
|
+ City city = this.cityMapper.selectCityById(cityId);
|
|
|
+ if(!Objects.isNull(city)){
|
|
|
+ pumpingStation.setCityName(city.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //区县
|
|
|
+ if(StringUtils.isNotBlank(countryId)){
|
|
|
+ City city = this.cityMapper.selectCityById(countryId);
|
|
|
+ if(!Objects.isNull(city)){
|
|
|
+ pumpingStation.setCountryName(city.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 查询泵站关联的小区信息
|
|
|
* @param pumpingStation
|