|
|
@@ -1,5 +1,6 @@
|
|
|
package com.goafanti.common.service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
@@ -9,6 +10,9 @@ import org.springframework.cache.annotation.CacheEvict;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import com.goafanti.common.bo.AreaBo;
|
|
|
+import com.goafanti.common.bo.CityBo;
|
|
|
+import com.goafanti.common.bo.ProvinceBo;
|
|
|
import com.goafanti.common.dao.DistrictGlossoryMapper;
|
|
|
import com.goafanti.common.model.DistrictGlossory;
|
|
|
import com.goafanti.common.utils.LoggerUtils;
|
|
|
@@ -37,4 +41,31 @@ public class DistrictGlossoryService {
|
|
|
public String selectNameById(Integer id) {
|
|
|
return districtGlossoryMapper.selectNameById(id);
|
|
|
}
|
|
|
+
|
|
|
+ public List<ProvinceBo> getProvince(){
|
|
|
+ List<ProvinceBo> provinces=districtGlossoryMapper.getProvince();
|
|
|
+ List<CityBo> city=districtGlossoryMapper.getCity();
|
|
|
+ List<AreaBo> Area=districtGlossoryMapper.getArea();
|
|
|
+ for(ProvinceBo one:provinces){
|
|
|
+ List <CityBo> cc=new ArrayList<CityBo>();
|
|
|
+ int pbid = one.getId();
|
|
|
+ for(CityBo two:city){
|
|
|
+ List <AreaBo> aa=new ArrayList<AreaBo>();
|
|
|
+ int cbid=two.getId();
|
|
|
+ int cbpid=two.getPid();
|
|
|
+ if(cbpid==pbid){
|
|
|
+ for(AreaBo three:Area){
|
|
|
+ int abpid=three.getPid();
|
|
|
+ if(abpid==cbid){
|
|
|
+ aa.add(three);
|
|
|
+ two.setAreaList(aa);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ cc.add(two);
|
|
|
+ one.setCityList(cc);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return provinces;
|
|
|
+ }
|
|
|
}
|