Commit 13c9c6a6 by jianan

Fna接口23

parent 246eb490
......@@ -48,7 +48,7 @@ public class CustomerAddRequest implements Serializable {
/**
* 名字拼音
*/
@Schema(description = "名字拼音")
@Schema(description = "名字-英文", requiredMode = Schema.RequiredMode.REQUIRED)
private String firstNamePinyin;
/**
......@@ -60,7 +60,7 @@ public class CustomerAddRequest implements Serializable {
/**
* 称谓
*/
@Schema(description = "称谓 字典值: csf_customer_title")
@Schema(description = "称谓 字典值: csf_customer_title", requiredMode = Schema.RequiredMode.REQUIRED)
private String title;
/**
......@@ -90,7 +90,7 @@ public class CustomerAddRequest implements Serializable {
/**
* 年龄
*/
@Schema(description = "年龄")
@Schema(description = "年龄", requiredMode = Schema.RequiredMode.REQUIRED)
private String age;
/**
......@@ -102,13 +102,13 @@ public class CustomerAddRequest implements Serializable {
/**
* 电话号码
*/
@Schema(description = "电话号码")
@Schema(description = "电话号码", requiredMode = Schema.RequiredMode.REQUIRED)
private String phone;
/**
* 电子邮箱
*/
@Schema(description = "电子邮箱")
@Schema(description = "电子邮箱", requiredMode = Schema.RequiredMode.REQUIRED)
private String email;
/**
......@@ -124,9 +124,9 @@ public class CustomerAddRequest implements Serializable {
private String smokeQuantity;
/**
* 公司类型
* 行业
*/
@Schema(description = "公司类型")
@Schema(description = "行业", requiredMode = Schema.RequiredMode.REQUIRED)
private String companyType;
/**
......@@ -162,7 +162,7 @@ public class CustomerAddRequest implements Serializable {
/**
* 婚姻状况
*/
@Schema(description = "婚姻状况 字典值: csf_marriage")
@Schema(description = "婚姻状况 字典值: csf_marriage", requiredMode = Schema.RequiredMode.REQUIRED)
private Object marriage;
/**
......@@ -174,13 +174,13 @@ public class CustomerAddRequest implements Serializable {
/**
* 教育程度
*/
@Schema(description = "教育程度 字典值: csf_education")
@Schema(description = "教育程度 字典值: csf_education", requiredMode = Schema.RequiredMode.REQUIRED)
private Object education;
/**
* 国
* 国籍 (国家/地区)
*/
@Schema(description = "国家")
@Schema(description = "国籍 (国家/地区)", requiredMode = Schema.RequiredMode.REQUIRED)
private String country;
// region 客户扩展信息
......
......@@ -15,7 +15,7 @@ public class FnaUpdateRequest implements Serializable {
/**
* fna唯一业务ID
*/
@Schema(description = "fna唯一业务ID", nullable = true)
@Schema(description = "fna唯一业务ID", requiredMode = Schema.RequiredMode.REQUIRED)
private String fnaBizId;
/**
......
......@@ -5,25 +5,25 @@ import lombok.Data;
@Data
public class PersonalData {
@Schema(description = "陪同顾问姓名")
@Schema(description = "陪同顾问姓名", requiredMode = Schema.RequiredMode.REQUIRED)
private String accountName;
@Schema(description = "陪同顾问手机号")
private String accountPhone;
@Schema(description = "理财顾问注册编号")
@Schema(description = "理财顾问注册编号", requiredMode = Schema.RequiredMode.REQUIRED)
private String registrationNumber;
@Schema(description = "理财顾问内部编码")
private String number;
@Schema(description = "客户姓名")
@Schema(description = "客户姓名", requiredMode = Schema.RequiredMode.REQUIRED)
private String customerName;
@Schema(description = "税务国家")
@Schema(description = "税务国家", requiredMode = Schema.RequiredMode.REQUIRED)
private String taxCountry;
@Schema(description = "就业情况")
@Schema(description = "就业情况", requiredMode = Schema.RequiredMode.REQUIRED)
private String employment;
@Schema(description = "其他就业情况")
......
......@@ -57,7 +57,7 @@ public class Customer implements Serializable {
private String lastNamePinyin;
/**
* 名字拼音
* 名字-英文
*/
private String firstNamePinyin;
......
......@@ -138,10 +138,12 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
if (ValidateUtil.isAllFieldsNull(customerAddRequest)) {
throw new BusinessException(ErrorCode.PARAMS_ERROR.getCode(), ErrorCode.PARAMS_ERROR.getMessage());
}
// 客户主表信息
Customer customer = new Customer();
BeanUtils.copyProperties(customerAddRequest, customer);
// 校验客户主表信息
validCustomer(customer);
// 客户扩展表信息
CustomerExpand customerExpand = customerService.getCustomerExpand(customerAddRequest);
......@@ -178,6 +180,41 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
return map;
}
private void validCustomer(Customer customer) {
String firstNamePinyin = customer.getFirstNamePinyin();
if (StringUtils.isBlank(firstNamePinyin)) {
throw new BusinessException(ErrorCode.PARAMS_ERROR.getCode(), "名字-英文不能为空");
}
String phone = customer.getPhone();
if (StringUtils.isBlank(phone)) {
throw new BusinessException(ErrorCode.PARAMS_ERROR.getCode(), "客户手机号不能为空");
}
String title = customer.getTitle();
if (StringUtils.isBlank(title)) {
throw new BusinessException(ErrorCode.PARAMS_ERROR.getCode(), "称谓不能为空");
}
String age = customer.getAge();
if (StringUtils.isBlank(age)) {
throw new BusinessException(ErrorCode.PARAMS_ERROR.getCode(), "年龄不能为空");
}
String companyType = customer.getCompanyType();
if (StringUtils.isBlank(companyType)) {
throw new BusinessException(ErrorCode.PARAMS_ERROR.getCode(), "行业不能为空");
}
Object marriage = customer.getMarriage();
if (marriage == null) {
throw new BusinessException(ErrorCode.PARAMS_ERROR.getCode(), "婚姻状况不能为空");
}
String country = customer.getCountry();
if (StringUtils.isBlank(country)) {
throw new BusinessException(ErrorCode.PARAMS_ERROR.getCode(), "国籍不能为空");
}
Object education = customer.getEducation();
if (education == null) {
throw new BusinessException(ErrorCode.PARAMS_ERROR.getCode(), "教育程度不能为空");
}
}
}
......
......@@ -5,12 +5,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.csf.service.common.ErrorCode;
import com.yd.csf.service.dao.FnaFormMapper;
import com.yd.csf.service.dto.*;
import com.yd.csf.service.model.FnaForm;
import com.yd.csf.service.service.FnaFormService;
import com.yd.csf.service.utils.ValidateUtil;
import com.yd.csf.service.vo.FnaFormVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
......@@ -125,19 +127,23 @@ public class FnaFormServiceImpl extends ServiceImpl<FnaFormMapper, FnaForm> impl
}
Object familyMembers = fnaForm.getFamilyMembers();
if (familyMembers != null) {
fnaFormVO.setFamilyMembers(GSON.fromJson(familyMembers.toString(), FamilyMembers.class));
fnaFormVO.setFamilyMembers(GSON.fromJson(familyMembers.toString(), new TypeToken<List<FamilyMember>>() {
}.getType()));
}
Object existingSecurityOwner = fnaForm.getExistingSecurityOwner();
if (existingSecurityOwner != null) {
fnaFormVO.setExistingSecurityOwner(GSON.fromJson(existingSecurityOwner.toString(), ExistingSecuritys.class));
fnaFormVO.setExistingSecurityOwner(GSON.fromJson(existingSecurityOwner.toString(), new TypeToken<List<ExistingSecurity>>() {
}.getType()));
}
Object existingSecurityInsured = fnaForm.getExistingSecurityInsured();
if (existingSecurityInsured != null) {
fnaFormVO.setExistingSecurityInsured(GSON.fromJson(existingSecurityInsured.toString(), ExistingSecuritys.class));
fnaFormVO.setExistingSecurityInsured(GSON.fromJson(existingSecurityInsured.toString(), new TypeToken<List<ExistingSecurity>>() {
}.getType()));
}
Object ownerAssets = fnaForm.getOwnerAssets();
if (ownerAssets != null) {
fnaFormVO.setOwnerAssets(GSON.fromJson(ownerAssets.toString(), OwnerAssets.class));
fnaFormVO.setOwnerAssets(GSON.fromJson(ownerAssets.toString(), new TypeToken<OwnerAssets>() {
}.getType()));
}
Object monthlyIncome = fnaForm.getCompanyBusinessData();
if (monthlyIncome != null) {
......@@ -176,6 +182,11 @@ public class FnaFormServiceImpl extends ServiceImpl<FnaFormMapper, FnaForm> impl
if (fnaFormAddRequest == null) {
throw new BusinessException(ErrorCode.PARAMS_ERROR.getCode(), ErrorCode.PARAMS_ERROR.getMessage());
}
PersonalData personalData = fnaFormAddRequest.getPersonalData();
if (personalData == null || ValidateUtil.isAllFieldsNull(personalData)) {
throw new BusinessException(ErrorCode.PARAMS_ERROR.getCode(), "个人资料不能为空");
}
}
@Override
......
......@@ -47,19 +47,19 @@ public class FnaFormVO implements Serializable {
* 家庭状况
*/
@Schema(description = "家庭状况")
private FamilyMembers familyMembers;
private List<FamilyMember> familyMembers;
/**
* 保单持有人个人已有保障
*/
@Schema(description = "保单持有人个人已有保障")
private ExistingSecuritys existingSecurityOwner;
private List<ExistingSecurity> existingSecurityOwner;
/**
* 受保人个人已有保障
*/
@Schema(description = "受保人个人已有保障")
private ExistingSecuritys existingSecurityInsured;
private List<ExistingSecurity> existingSecurityInsured;
/**
* 平均月收入
......
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