Commit 0733ad4e by jianan

Fna接口19

parent 98c06e72
......@@ -8,11 +8,9 @@ import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
* 查询fna请求
*
*/
@EqualsAndHashCode(callSuper = true)
@Data
......@@ -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")
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")
private LocalDateTime endTime;
......
......@@ -55,24 +55,9 @@ public class CustomerExpand implements Serializable {
private String longtimeAbroad;
/**
* 居住地址
* 地址信息
*/
private String residenceAddress;
/**
* 住宅地址
*/
private String residentialAddress;
/**
* 邮寄地址
*/
private String mailingAddress;
/**
* 公司地址
*/
private String companyAddress;
private String addressList;
/**
* 公司名称
......
......@@ -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.service.impl.ServiceImpl;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.yd.common.exception.BusinessException;
import com.yd.common.result.Result;
import com.yd.common.utils.RandomStringGenerator;
......@@ -23,6 +24,7 @@ import com.yd.csf.service.vo.AddressVO;
import com.yd.csf.service.vo.CustomerExpandVO;
import com.yd.csf.service.vo.CustomerVO;
import com.yd.csf.service.vo.FnaVO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -62,29 +64,11 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
if (customerExpand != null) {
CustomerExpandVO customerExpandVO = CustomerExpandVO.objToVo(customerExpand);
List<AddressVO> addressList = new ArrayList<>();
if (customerExpand.getResidenceAddress() != null) {
AddressVO addressVO = GSON.fromJson(customerExpand.getResidenceAddress(), AddressVO.class);
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 (StringUtils.isNotBlank(customerExpand.getAddressList())) {
List<AddressVO> addressList = GSON.fromJson(customerExpand.getAddressList(), new TypeToken<List<AddressVO>>() {
}.getType());
customerExpandVO.setAddressList(addressList);
}
if (customerExpand.getCompanyAddress() != null) {
AddressVO addressVO = GSON.fromJson(customerExpand.getCompanyAddress(), AddressVO.class);
addressVO.setType("companyAddress");
addressList.add(addressVO);
}
customerExpandVO.setAddressList(addressList);
customerVO.setCustomerExpand(customerExpandVO);
}
return customerVO;
......@@ -101,20 +85,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
BeanUtils.copyProperties(customerAddRequest, customerExpand);
List<AddressVO> addressList = customerAddRequest.getAddressList();
if (CollUtil.isNotEmpty(addressList)) {
for (AddressVO addressVO : 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));
}
}
customerExpand.setAddressList(GSON.toJson(addressList));
}
return customerExpand;
......@@ -142,7 +113,15 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
if (customerBizIdCustomerExpandListMap.containsKey(customerBizId)) {
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
......
......@@ -53,6 +53,10 @@ public class CustomerExpandVO implements Serializable {
@Schema(description = "是否长期出国")
private String longtimeAbroad;
/**
* 地址信息
*/
@Schema(description = "地址信息")
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