Commit 0733ad4e by jianan

Fna接口19

parent 98c06e72
...@@ -8,11 +8,9 @@ import lombok.EqualsAndHashCode; ...@@ -8,11 +8,9 @@ import lombok.EqualsAndHashCode;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
/** /**
* 查询fna请求 * 查询fna请求
*
*/ */
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Data @Data
...@@ -21,14 +19,14 @@ public class FnaQueryRequest extends PageDto implements Serializable { ...@@ -21,14 +19,14 @@ public class FnaQueryRequest extends PageDto implements Serializable {
/** /**
* 创建时间开始 * 创建时间开始
*/ */
@Schema(description = "创建时间开始") @Schema(description = "创建时间开始", example = "2025-07-31 00:00:00")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime startTime; private LocalDateTime startTime;
/** /**
* 创建时间结束 * 创建时间结束
*/ */
@Schema(description = "创建时间结束") @Schema(description = "创建时间结束", example = "2025-07-31 23:59:59")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime endTime; private LocalDateTime endTime;
......
...@@ -55,24 +55,9 @@ public class CustomerExpand implements Serializable { ...@@ -55,24 +55,9 @@ public class CustomerExpand implements Serializable {
private String longtimeAbroad; private String longtimeAbroad;
/** /**
* 居住地址 * 地址信息
*/ */
private String residenceAddress; private String addressList;
/**
* 住宅地址
*/
private String residentialAddress;
/**
* 邮寄地址
*/
private String mailingAddress;
/**
* 公司地址
*/
private String companyAddress;
/** /**
* 公司名称 * 公司名称
......
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.yd.common.exception.BusinessException; import com.yd.common.exception.BusinessException;
import com.yd.common.result.Result; import com.yd.common.result.Result;
import com.yd.common.utils.RandomStringGenerator; import com.yd.common.utils.RandomStringGenerator;
...@@ -23,6 +24,7 @@ import com.yd.csf.service.vo.AddressVO; ...@@ -23,6 +24,7 @@ import com.yd.csf.service.vo.AddressVO;
import com.yd.csf.service.vo.CustomerExpandVO; import com.yd.csf.service.vo.CustomerExpandVO;
import com.yd.csf.service.vo.CustomerVO; import com.yd.csf.service.vo.CustomerVO;
import com.yd.csf.service.vo.FnaVO; import com.yd.csf.service.vo.FnaVO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -62,29 +64,11 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> ...@@ -62,29 +64,11 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
if (customerExpand != null) { if (customerExpand != null) {
CustomerExpandVO customerExpandVO = CustomerExpandVO.objToVo(customerExpand); CustomerExpandVO customerExpandVO = CustomerExpandVO.objToVo(customerExpand);
List<AddressVO> addressList = new ArrayList<>(); if (StringUtils.isNotBlank(customerExpand.getAddressList())) {
List<AddressVO> addressList = GSON.fromJson(customerExpand.getAddressList(), new TypeToken<List<AddressVO>>() {
if (customerExpand.getResidenceAddress() != null) { }.getType());
AddressVO addressVO = GSON.fromJson(customerExpand.getResidenceAddress(), AddressVO.class); customerExpandVO.setAddressList(addressList);
addressVO.setType("residenceAddress");
addressList.add(addressVO);
}
if (customerExpand.getResidentialAddress() != null) {
AddressVO addressVO = GSON.fromJson(customerExpand.getResidentialAddress(), AddressVO.class);
addressVO.setType("residentialAddress");
addressList.add(addressVO);
}
if (customerExpand.getMailingAddress() != null) {
AddressVO addressVO = GSON.fromJson(customerExpand.getMailingAddress(), AddressVO.class);
addressVO.setType("mailingAddress");
addressList.add(addressVO);
} }
if (customerExpand.getCompanyAddress() != null) {
AddressVO addressVO = GSON.fromJson(customerExpand.getCompanyAddress(), AddressVO.class);
addressVO.setType("companyAddress");
addressList.add(addressVO);
}
customerExpandVO.setAddressList(addressList);
customerVO.setCustomerExpand(customerExpandVO); customerVO.setCustomerExpand(customerExpandVO);
} }
return customerVO; return customerVO;
...@@ -101,20 +85,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> ...@@ -101,20 +85,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
BeanUtils.copyProperties(customerAddRequest, customerExpand); BeanUtils.copyProperties(customerAddRequest, customerExpand);
List<AddressVO> addressList = customerAddRequest.getAddressList(); List<AddressVO> addressList = customerAddRequest.getAddressList();
if (CollUtil.isNotEmpty(addressList)) { if (CollUtil.isNotEmpty(addressList)) {
for (AddressVO addressVO : addressList) { customerExpand.setAddressList(GSON.toJson(addressList));
if ("residenceAddress".equals(addressVO.getType())) {
customerExpand.setResidenceAddress(GSON.toJson(addressVO));
}
if ("residentialAddress".equals(addressVO.getType())) {
customerExpand.setResidentialAddress(GSON.toJson(addressVO));
}
if ("mailingAddress".equals(addressVO.getType())) {
customerExpand.setMailingAddress(GSON.toJson(addressVO));
}
if ("companyAddress".equals(addressVO.getType())) {
customerExpand.setCompanyAddress(GSON.toJson(addressVO));
}
}
} }
return customerExpand; return customerExpand;
...@@ -142,7 +113,15 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> ...@@ -142,7 +113,15 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
if (customerBizIdCustomerExpandListMap.containsKey(customerBizId)) { if (customerBizIdCustomerExpandListMap.containsKey(customerBizId)) {
customerExpand = customerBizIdCustomerExpandListMap.get(customerBizId).get(0); customerExpand = customerBizIdCustomerExpandListMap.get(customerBizId).get(0);
} }
customerVO.setCustomerExpand(CustomerExpandVO.objToVo(customerExpand)); if (customerExpand != null) {
CustomerExpandVO customerExpandVO = CustomerExpandVO.objToVo(customerExpand);
if ( StringUtils.isNotBlank(customerExpand.getAddressList())) {
List<AddressVO> addressList = GSON.fromJson(customerExpand.getAddressList(), new TypeToken<List<AddressVO>>() {
}.getType());
customerExpandVO.setAddressList(addressList);
}
customerVO.setCustomerExpand(customerExpandVO);
}
}); });
// endregion // endregion
......
...@@ -53,6 +53,10 @@ public class CustomerExpandVO implements Serializable { ...@@ -53,6 +53,10 @@ public class CustomerExpandVO implements Serializable {
@Schema(description = "是否长期出国") @Schema(description = "是否长期出国")
private String longtimeAbroad; private String longtimeAbroad;
/**
* 地址信息
*/
@Schema(description = "地址信息")
private List<AddressVO> addressList; private List<AddressVO> addressList;
/** /**
......
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