From b1279ce060bb1f5c4961090d1484916de797713e Mon Sep 17 00:00:00 2001 From: clunt Date: Tue, 17 May 2022 12:38:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9C=81=E5=B8=82=E5=8C=BA=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ghy-custom/pom.xml | 6 ++++++ .../com/ghy/customer/domain/CustomerAddress.java | 6 ++++++ .../service/impl/CustomerAddressServiceImpl.java | 12 +++++++++++- .../mapper/customer/CustomerAddressMapper.xml | 3 +++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/ghy-custom/pom.xml b/ghy-custom/pom.xml index 7d34add3..fe94441f 100644 --- a/ghy-custom/pom.xml +++ b/ghy-custom/pom.xml @@ -23,6 +23,12 @@ ghy-common + + + com.ghy + ghy-system + + \ No newline at end of file diff --git a/ghy-custom/src/main/java/com/ghy/customer/domain/CustomerAddress.java b/ghy-custom/src/main/java/com/ghy/customer/domain/CustomerAddress.java index e30a8b9a..78812212 100644 --- a/ghy-custom/src/main/java/com/ghy/customer/domain/CustomerAddress.java +++ b/ghy-custom/src/main/java/com/ghy/customer/domain/CustomerAddress.java @@ -26,6 +26,12 @@ public class CustomerAddress extends BaseEntity { @Excel(name = "省", cellType = Excel.ColumnType.NUMERIC) private Long provinceId; + private String provinceName; + + private String cityName; + + private String countryName; + @Excel(name = "市", cellType = Excel.ColumnType.NUMERIC) private Long cityId; diff --git a/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerAddressServiceImpl.java b/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerAddressServiceImpl.java index 799847b7..f6b94e6c 100644 --- a/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerAddressServiceImpl.java +++ b/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerAddressServiceImpl.java @@ -3,6 +3,7 @@ package com.ghy.customer.service.impl; import com.ghy.customer.domain.CustomerAddress; import com.ghy.customer.mapper.CustomerAddressMapper; import com.ghy.customer.service.CustomerAddressService; +import com.ghy.system.service.ISysAreaService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -16,9 +17,18 @@ public class CustomerAddressServiceImpl implements CustomerAddressService { @Resource private CustomerAddressMapper customerAddressMapper; + @Resource + private ISysAreaService iSysAreaService; + @Override public List getCustomerAddressList(CustomerAddress customerAddress) { - return customerAddressMapper.getCustomerAddressList(customerAddress); + List addressList = customerAddressMapper.getCustomerAddressList(customerAddress); + for (CustomerAddress address : addressList) { + address.setCountryName(iSysAreaService.selectById(address.getCountryId()).getAreaName()); + address.setCityName(iSysAreaService.selectById(address.getCityId()).getAreaName()); + address.setProvinceName(iSysAreaService.selectById(address.getProvinceId()).getAreaName()); + } + return addressList; } @Override diff --git a/ghy-custom/src/main/resources/mapper/customer/CustomerAddressMapper.xml b/ghy-custom/src/main/resources/mapper/customer/CustomerAddressMapper.xml index e8d423bb..f0587292 100644 --- a/ghy-custom/src/main/resources/mapper/customer/CustomerAddressMapper.xml +++ b/ghy-custom/src/main/resources/mapper/customer/CustomerAddressMapper.xml @@ -12,6 +12,7 @@ + @@ -67,6 +68,7 @@ city_id, country_id, status, + address, is_default, create_by, remark, @@ -79,6 +81,7 @@ #{cityId}, #{countryId}, #{status}, + #{address}, #{isDefault}, #{createBy}, #{remark},