log-slf4j
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.peanut.modules.book.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.peanut.modules.book.entity.City;
|
||||
import com.peanut.modules.book.entity.County;
|
||||
import com.peanut.modules.book.entity.Province;
|
||||
@@ -53,21 +54,31 @@ public class UserAddressServiceImpl extends ServiceImpl<UserAddressDao, UserAddr
|
||||
return null;
|
||||
}
|
||||
vo.setCounty(county.getCountyName());
|
||||
String cityRegionCode;
|
||||
if (regionCode.startsWith("11") || regionCode.startsWith("12") || regionCode.startsWith("31") || regionCode.startsWith("50")) {
|
||||
cityRegionCode = regionCode.substring(0, 2).concat("0000");
|
||||
} else {
|
||||
cityRegionCode = regionCode.substring(0, 4).concat("00");
|
||||
}
|
||||
QueryWrapper<City> cityQueryWrapper = new QueryWrapper<>();
|
||||
cityQueryWrapper.eq("region_code", cityRegionCode);
|
||||
City city = cityService.getOne(cityQueryWrapper);
|
||||
LambdaQueryWrapper<City> cityLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
cityLambdaQueryWrapper.eq(City::getCityId,county.getCityId());
|
||||
City city = cityService.getOne(cityLambdaQueryWrapper);
|
||||
vo.setCity(city.getCityName());
|
||||
String provinceRegionCode = regionCode.substring(0, 2).concat("0000");
|
||||
QueryWrapper<Province> provinceQueryWrapper = new QueryWrapper<>();
|
||||
provinceQueryWrapper.eq("region_code", provinceRegionCode);
|
||||
Province province = provinceService.getOne(provinceQueryWrapper);
|
||||
vo.setProvince(province.getProvName());
|
||||
LambdaQueryWrapper<Province> provinceLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
provinceLambdaQueryWrapper.eq(Province::getProvId,city.getProvId());
|
||||
Province province = provinceService.getOne(provinceLambdaQueryWrapper);
|
||||
vo.setProvince((province.getProvName()));
|
||||
|
||||
// String cityRegionCode;
|
||||
// if (regionCode.startsWith("11") || regionCode.startsWith("12") || regionCode.startsWith("31") || regionCode.startsWith("50")) {
|
||||
// cityRegionCode = regionCode.substring(0, 2).concat("0000");
|
||||
// } else {
|
||||
// cityRegionCode = regionCode.substring(0, 4).concat("00");
|
||||
// }
|
||||
// QueryWrapper<City> cityQueryWrapper = new QueryWrapper<>();
|
||||
// System.out.println(cityRegionCode);
|
||||
// cityQueryWrapper.eq("region_code", cityRegionCode);
|
||||
// City city = cityService.getOne(cityQueryWrapper);
|
||||
// vo.setCity(city.getCityName());
|
||||
// String provinceRegionCode = regionCode.substring(0, 2).concat("0000");
|
||||
// QueryWrapper<Province> provinceQueryWrapper = new QueryWrapper<>();
|
||||
// provinceQueryWrapper.eq("region_code", provinceRegionCode);
|
||||
// Province province = provinceService.getOne(provinceQueryWrapper);
|
||||
// vo.setProvince(province.getProvName());
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user