Commit 9377a733 by zhangxingmin

push

parent ad72a12d
package com.yd.csf.service.vo;
import cn.hutool.core.collection.CollUtil;
import com.google.gson.reflect.TypeToken;
import com.yd.base.feign.dto.ApiCertificateDto;
import com.yd.csf.service.dto.TaxCountry;
......@@ -8,6 +9,7 @@ import com.yd.csf.service.utils.GSONUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import java.io.Serializable;
......@@ -397,20 +399,31 @@ public class CustomerVO implements Serializable {
}
CustomerVO customerVO = new CustomerVO();
BeanUtils.copyProperties(customer, customerVO);
// 解析地址列表(保持不变)
if (ObjectUtils.isNotEmpty(customer.getAddressList())) {
List<AddressVO> addressList = GSONUtil.fromJson(customer.getAddressList(), new TypeToken<List<AddressVO>>() {
}.getType());
List<AddressVO> addressList = GSONUtil.fromJson(customer.getAddressList(), new TypeToken<List<AddressVO>>() {}.getType());
customerVO.setAddressList(addressList);
}
// 解析税务列表(保持不变)
if (ObjectUtils.isNotEmpty(customer.getTaxList())) {
List<TaxCountry> taxList = GSONUtil.fromJson((String) customer.getTaxList(), new TypeToken<List<TaxCountry>>() {
}.getType());
List<TaxCountry> taxList = GSONUtil.fromJson((String) customer.getTaxList(), new TypeToken<List<TaxCountry>>() {}.getType());
customerVO.setApiTaxationDtoList(taxList);
}
// 解析证件列表
if (ObjectUtils.isNotEmpty(customer.getCertificateList())) {
List<ApiCertificateDto> certificateList = GSONUtil.fromJson((String) customer.getCertificateList(), new TypeToken<List<ApiCertificateDto>>() {
}.getType());
List<ApiCertificateDto> certificateList = GSONUtil.fromJson((String) customer.getCertificateList(), new TypeToken<List<ApiCertificateDto>>() {}.getType());
customerVO.setApiCertificateDtoList(certificateList);
if (CollUtil.isNotEmpty(certificateList)) {
ApiCertificateDto firstCert = certificateList.get(0);
if (StringUtils.isBlank(customerVO.getDocumentType())) {
customerVO.setDocumentType(firstCert.getDocumentType());
}
if (StringUtils.isBlank(customerVO.getIdNumber())) {
customerVO.setIdNumber(firstCert.getIdNumber());
}
}
}
return customerVO;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment