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 82 return orderContactPersonService.page(co);
83 83 }
84 84  
  85 + /**
  86 + * 获取默认地址
  87 + * @param co
  88 + * @return
  89 + */
85 90 @PostMapping(value = "/baseRegion")
86   - public Message<List<BaseRegionNextVo>> setDefault(@RequestBody BaseRegionCo co) {
  91 + public Message<List<BaseRegionNextVo>> getDefaultRegion(@RequestBody BaseRegionCo co) {
87 92 List<BaseRegionNextVo> baseRegionNextVoList = baseRegionService.getNextList(co);
88 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 63 if(lastBaseRegion!=null&&!lastBaseRegion.getDistrictId().equals(baseRegion.getDistrictId())){
64 64 baseDistrict = new BaseRegionNextVo(lastBaseRegion.getDistrictId(), lastBaseRegion.getDistrictName(),3);
65 65 baseDistrict.setChildren(streetList);
  66 + districtsMap.put(baseDistrict.getId(),baseDistrict);
66 67 streetList = new ArrayList<>();
67 68 if(lastBaseRegion!=null && !lastBaseRegion.getCityId().equals(baseRegion.getCityId())){
68 69 baseCity = new BaseRegionNextVo(lastBaseRegion.getCityId(), lastBaseRegion.getCityName(),2);
69 70 baseCity.setChildren(new ArrayList<>(districtsMap.values()));
  71 + citiesMap.put(baseCity.getId(),baseCity);
70 72 districtsMap = new HashMap<>();
71 73 if(lastBaseRegion!=null && !lastBaseRegion.getProvinceId().equals(baseRegion.getProvinceId())){
72 74 baseProvince = new BaseRegionNextVo(lastBaseRegion.getProvinceId(), lastBaseRegion.getProvinceName(),1);
... ... @@ -74,16 +76,16 @@ public class BaseRegionServiceImpl implements BaseRegionService {
74 76 citiesMap = new HashMap<>();
75 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 81 }/*else{
80 82 if(citiesMap.get(baseRegion.getCityId())==null){
81 83 BaseRegionNextVo city = new BaseRegionNextVo(baseRegion.getCityId(), baseRegion.getCityName(),2);
82 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 89 }/*else{
88 90 if(districtsMap.get(baseRegion.getDistrictId())==null){
89 91 BaseRegionNextVo district = new BaseRegionNextVo(baseRegion.getDistrictId(), baseRegion.getDistrictName(),3);
... ... @@ -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 97 streetList.add(street);
96 98 lastBaseRegion = baseRegion;
97 99 }
... ...