Commit f17218990b36ba448d97d1fa16aac433844ed986

Authored by fengliang
1 parent 7137c661

update:地址增加

etrade-order/src/main/java/com/diligrp/etrade/order/api/OrderContactPersonController.java
@@ -82,8 +82,13 @@ public class OrderContactPersonController { @@ -82,8 +82,13 @@ public class OrderContactPersonController {
82 return orderContactPersonService.page(co); 82 return orderContactPersonService.page(co);
83 } 83 }
84 84
  85 + /**
  86 + * 获取默认地址
  87 + * @param co
  88 + * @return
  89 + */
85 @PostMapping(value = "/baseRegion") 90 @PostMapping(value = "/baseRegion")
86 - public Message<List<BaseRegionNextVo>> setDefault(@RequestBody BaseRegionCo co) { 91 + public Message<List<BaseRegionNextVo>> getDefaultRegion(@RequestBody BaseRegionCo co) {
87 List<BaseRegionNextVo> baseRegionNextVoList = baseRegionService.getNextList(co); 92 List<BaseRegionNextVo> baseRegionNextVoList = baseRegionService.getNextList(co);
88 return Message.success(baseRegionNextVoList); 93 return Message.success(baseRegionNextVoList);
89 } 94 }
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/BaseRegionServiceImpl.java
@@ -63,10 +63,12 @@ public class BaseRegionServiceImpl implements BaseRegionService { @@ -63,10 +63,12 @@ public class BaseRegionServiceImpl implements BaseRegionService {
63 if(lastBaseRegion!=null&&!lastBaseRegion.getDistrictId().equals(baseRegion.getDistrictId())){ 63 if(lastBaseRegion!=null&&!lastBaseRegion.getDistrictId().equals(baseRegion.getDistrictId())){
64 baseDistrict = new BaseRegionNextVo(lastBaseRegion.getDistrictId(), lastBaseRegion.getDistrictName(),3); 64 baseDistrict = new BaseRegionNextVo(lastBaseRegion.getDistrictId(), lastBaseRegion.getDistrictName(),3);
65 baseDistrict.setChildren(streetList); 65 baseDistrict.setChildren(streetList);
  66 + districtsMap.put(baseDistrict.getId(),baseDistrict);
66 streetList = new ArrayList<>(); 67 streetList = new ArrayList<>();
67 if(lastBaseRegion!=null && !lastBaseRegion.getCityId().equals(baseRegion.getCityId())){ 68 if(lastBaseRegion!=null && !lastBaseRegion.getCityId().equals(baseRegion.getCityId())){
68 baseCity = new BaseRegionNextVo(lastBaseRegion.getCityId(), lastBaseRegion.getCityName(),2); 69 baseCity = new BaseRegionNextVo(lastBaseRegion.getCityId(), lastBaseRegion.getCityName(),2);
69 baseCity.setChildren(new ArrayList<>(districtsMap.values())); 70 baseCity.setChildren(new ArrayList<>(districtsMap.values()));
  71 + citiesMap.put(baseCity.getId(),baseCity);
70 districtsMap = new HashMap<>(); 72 districtsMap = new HashMap<>();
71 if(lastBaseRegion!=null && !lastBaseRegion.getProvinceId().equals(baseRegion.getProvinceId())){ 73 if(lastBaseRegion!=null && !lastBaseRegion.getProvinceId().equals(baseRegion.getProvinceId())){
72 baseProvince = new BaseRegionNextVo(lastBaseRegion.getProvinceId(), lastBaseRegion.getProvinceName(),1); 74 baseProvince = new BaseRegionNextVo(lastBaseRegion.getProvinceId(), lastBaseRegion.getProvinceName(),1);
@@ -74,16 +76,16 @@ public class BaseRegionServiceImpl implements BaseRegionService { @@ -74,16 +76,16 @@ public class BaseRegionServiceImpl implements BaseRegionService {
74 citiesMap = new HashMap<>(); 76 citiesMap = new HashMap<>();
75 provinces.add(baseProvince); 77 provinces.add(baseProvince);
76 } 78 }
77 - BaseRegionNextVo city = new BaseRegionNextVo(baseRegion.getCityId(), baseRegion.getCityName(),2);  
78 - citiesMap.put(baseRegion.getCityId(),city); 79 +// BaseRegionNextVo city = new BaseRegionNextVo(baseRegion.getCityId(), baseRegion.getCityName(),2);
  80 +// citiesMap.put(baseRegion.getCityId(),city);
79 }/*else{ 81 }/*else{
80 if(citiesMap.get(baseRegion.getCityId())==null){ 82 if(citiesMap.get(baseRegion.getCityId())==null){
81 BaseRegionNextVo city = new BaseRegionNextVo(baseRegion.getCityId(), baseRegion.getCityName(),2); 83 BaseRegionNextVo city = new BaseRegionNextVo(baseRegion.getCityId(), baseRegion.getCityName(),2);
82 citiesMap.put(baseRegion.getCityId(),city); 84 citiesMap.put(baseRegion.getCityId(),city);
83 } 85 }
84 }*/ 86 }*/
85 - BaseRegionNextVo district = new BaseRegionNextVo(baseRegion.getDistrictId(), baseRegion.getDistrictName(),3);  
86 - districtsMap.put(district.getId(),district); 87 +// BaseRegionNextVo district = new BaseRegionNextVo(baseRegion.getDistrictId(), baseRegion.getDistrictName(),3);
  88 +// districtsMap.put(district.getId(),district);
87 }/*else{ 89 }/*else{
88 if(districtsMap.get(baseRegion.getDistrictId())==null){ 90 if(districtsMap.get(baseRegion.getDistrictId())==null){
89 BaseRegionNextVo district = new BaseRegionNextVo(baseRegion.getDistrictId(), baseRegion.getDistrictName(),3); 91 BaseRegionNextVo district = new BaseRegionNextVo(baseRegion.getDistrictId(), baseRegion.getDistrictName(),3);
@@ -91,7 +93,7 @@ public class BaseRegionServiceImpl implements BaseRegionService { @@ -91,7 +93,7 @@ public class BaseRegionServiceImpl implements BaseRegionService {
91 } 93 }
92 94
93 }*/ 95 }*/
94 - BaseRegionNextVo street = new BaseRegionNextVo(lastBaseRegion.getStreetId(), lastBaseRegion.getStreetName(),4); 96 + BaseRegionNextVo street = new BaseRegionNextVo(baseRegion.getStreetId(), baseRegion.getStreetName(),4);
95 streetList.add(street); 97 streetList.add(street);
96 lastBaseRegion = baseRegion; 98 lastBaseRegion = baseRegion;
97 } 99 }