|
@ -29,7 +29,6 @@ import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.dao.CustomerRelationDao; |
|
|
import com.epmet.dao.CustomerRelationDao; |
|
|
import com.epmet.dto.CustomerAgencyDTO; |
|
|
|
|
|
import com.epmet.dto.CustomerDTO; |
|
|
import com.epmet.dto.CustomerDTO; |
|
|
import com.epmet.dto.CustomerRelationDTO; |
|
|
import com.epmet.dto.CustomerRelationDTO; |
|
|
import com.epmet.dto.form.AreaCodeDetailFormDTO; |
|
|
import com.epmet.dto.form.AreaCodeDetailFormDTO; |
|
@ -185,18 +184,7 @@ public class CustomerRelationServiceImpl extends BaseServiceImpl<CustomerRelatio |
|
|
String customerId = "78e2b2227c07de1fe54da14e2b2d9eb6"; |
|
|
String customerId = "78e2b2227c07de1fe54da14e2b2d9eb6"; |
|
|
List<CustomerRelationTreeDTO> rootList = baseDao.selectRootCustomerByCustomerId(customerId); |
|
|
List<CustomerRelationTreeDTO> rootList = baseDao.selectRootCustomerByCustomerId(customerId); |
|
|
if (!rootList.isEmpty()) { |
|
|
if (!rootList.isEmpty()) { |
|
|
rootList.forEach(item -> { |
|
|
rootList.forEach(this::getSubCustomer); |
|
|
AreaCodeDetailFormDTO formDTO = new AreaCodeDetailFormDTO(); |
|
|
|
|
|
formDTO.setAreaCode(item.getAreaCode()); |
|
|
|
|
|
formDTO.setLevel(item.getLevel()); |
|
|
|
|
|
Result<AreaCodeResultDTO> area = epmetCommonServiceOpenFeignClient.areaCodeDetail(formDTO); |
|
|
|
|
|
if (area.success()) { |
|
|
|
|
|
if (area.getData() != null) { |
|
|
|
|
|
item.setAreaName(area.getData().getAreaName()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
getSubCustomer(item); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
return rootList; |
|
|
return rootList; |
|
|
} |
|
|
} |
|
@ -210,21 +198,19 @@ public class CustomerRelationServiceImpl extends BaseServiceImpl<CustomerRelatio |
|
|
* @date 2022/7/6 13:54 |
|
|
* @date 2022/7/6 13:54 |
|
|
*/ |
|
|
*/ |
|
|
private CustomerRelationTreeDTO getSubCustomer(CustomerRelationTreeDTO customer) { |
|
|
private CustomerRelationTreeDTO getSubCustomer(CustomerRelationTreeDTO customer) { |
|
|
|
|
|
AreaCodeDetailFormDTO formDTO = new AreaCodeDetailFormDTO(); |
|
|
|
|
|
formDTO.setAreaCode(customer.getAreaCode()); |
|
|
|
|
|
formDTO.setLevel(customer.getLevel()); |
|
|
|
|
|
Result<AreaCodeResultDTO> area = epmetCommonServiceOpenFeignClient.areaCodeDetail(formDTO); |
|
|
|
|
|
if (area.success()) { |
|
|
|
|
|
if (area.getData() != null) { |
|
|
|
|
|
customer.setAreaName(area.getData().getAreaName()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
List<CustomerRelationTreeDTO> children = baseDao.selectSubCustomerByPid(customer.getCustomerId()); |
|
|
List<CustomerRelationTreeDTO> children = baseDao.selectSubCustomerByPid(customer.getCustomerId()); |
|
|
customer.setChildren(children); |
|
|
customer.setChildren(children); |
|
|
if (!children.isEmpty()) { |
|
|
if (!children.isEmpty()) { |
|
|
children.forEach(item -> { |
|
|
children.forEach(this::getSubCustomer); |
|
|
AreaCodeDetailFormDTO formDTO = new AreaCodeDetailFormDTO(); |
|
|
|
|
|
formDTO.setAreaCode(item.getAreaCode()); |
|
|
|
|
|
formDTO.setLevel(item.getLevel()); |
|
|
|
|
|
Result<AreaCodeResultDTO> area = epmetCommonServiceOpenFeignClient.areaCodeDetail(formDTO); |
|
|
|
|
|
if (area.success()) { |
|
|
|
|
|
if (area.getData() != null) { |
|
|
|
|
|
item.setAreaName(area.getData().getAreaName()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
getSubCustomer(item); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
return customer; |
|
|
return customer; |
|
|
} |
|
|
} |
|
|