Commit b7891caa by zhangxingmin

push

parent b0a64047
......@@ -117,7 +117,7 @@ public class ApiAppointmentFileController implements ApiAppointmentFileFeignClie
}
/**
* Excel导入-预约信息
* Excel导入-解析Excel预约信息
* @return
*/
@Override
......
......@@ -349,7 +349,7 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService
/**
* Excel导入-预约信息
* Excel导入-解析Excel预约信息
* @param file
* @param request
* @return
......@@ -357,22 +357,17 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService
@Override
public Result<ApiAppointmentImportExcelResponse> appointmentImportExcel(MultipartFile file,
ApiAppointmentImportExcelRequest request) {
//校验预约信息是否存在
Result<Appointment> appointmentResult = apiAppointmentService.checkAppointmentIsExist(request.getAppointmentBizId());
Appointment appointment = appointmentResult.getData();
ApiAppointmentImportExcelResponse response = new ApiAppointmentImportExcelResponse();
String s = "com.yd.csf.feign.dto.excel.ApiExcelImportAppointmentDto,com.yd.csf.feign.dto.excel.ApiExcelImportHealthDto";
//Feign调用-oss服务,通用-Excel解析(支持多sheet页解析)
Result<ApiOssExcelParseResponse> result = apiExcelFeignClient.parse(file, s);
if (Objects.isNull(result.getData()) ||
(!Objects.isNull(result.getData()) && Objects.isNull(result.getData().getMap()))){
throw new BusinessException("导入数据不能为空!");
}
//Excel解析出的信息
Map<Integer, Object> data = (Map<Integer, Object>) result.getData().getMap();
ObjectMapper objectMapper = new ObjectMapper();
try {
......@@ -382,83 +377,44 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService
LinkedHashMap<String, Object> appointmentData = (LinkedHashMap<String, Object>) data.get(0);
ApiExcelImportAppointmentDto appointmentDto = objectMapper.convertValue(appointmentData, ApiExcelImportAppointmentDto.class);
// 获取第二个Sheet页的解析结果并转换为 DTO
// LinkedHashMap<String, Object> healthData = (LinkedHashMap<String, Object>) data.get(1);
// ApiExcelImportHealthDto healthDto = objectMapper.convertValue(healthData, ApiExcelImportHealthDto.class);
//编辑更新预约主体信息
//设置预约主体信息
ApiAppointmentInfoDto apiAppointmentInfoDto = new ApiAppointmentInfoDto();
BeanUtils.copyProperties(appointment,apiAppointmentInfoDto);
apiAppointmentInfoDto = ApiExcelImportAppointmentDto.buildApiAppointmentInfoDto(appointmentDto,apiAppointmentInfoDto,dictTypeResponses);
BeanUtils.copyProperties(apiAppointmentInfoDto,appointment);
iAppointmentService.saveOrUpdate(appointment);
response.setApiAppointmentInfoDto(apiAppointmentInfoDto);
//编辑更新产品计划主信息
//查询产品计划主信息
ProductPlan productPlan = iProductPlanService.queryOne(request.getAppointmentBizId(),"");
//设置产品计划主信息
ApiProductPlanInfoDto apiProductPlanInfoDto = new ApiProductPlanInfoDto();
ApiProductPlanMainInfoDto apiProductPlanMainInfoDto = new ApiProductPlanMainInfoDto();
if (!Objects.isNull(productPlan)) {
BeanUtils.copyProperties(productPlan,apiProductPlanMainInfoDto);
apiProductPlanMainInfoDto = ApiExcelImportAppointmentDto.buildApiProductPlanMainInfoDto(appointmentDto,apiProductPlanMainInfoDto,dictTypeResponses);
BeanUtils.copyProperties(apiProductPlanMainInfoDto,productPlan);
iProductPlanService.saveOrUpdate(productPlan);
//新增附加计划(附加险列表)
List<ApiProductPlanAdditionalInfoDto> apiBeneficiaryInfoDtoList = ApiExcelImportAppointmentDto.buildApiProductPlanAdditionalInfoDto(appointmentDto.getAdditionalDtoList(),dictTypeResponses,productPlan.getPlanBizId());
if (!CollectionUtils.isEmpty(apiBeneficiaryInfoDtoList)) {
List<Additional> saveList = apiBeneficiaryInfoDtoList.stream().map(dto -> {
Additional additional = new Additional();
BeanUtils.copyProperties(dto,additional);
return additional;
}).collect(Collectors.toList());
iAdditionalService.saveOrUpdateBatch(saveList);
}
}
//编辑更新投保人信息
//查询投保人信息
Policyholder policyholder = iPolicyholderService.queryOne(request.getAppointmentBizId(),"");
apiProductPlanMainInfoDto = ApiExcelImportAppointmentDto.buildApiProductPlanMainInfoDto(appointmentDto,apiProductPlanMainInfoDto,dictTypeResponses);
apiProductPlanInfoDto.setApiProductPlanMainInfoDto(apiProductPlanMainInfoDto);
//设置产品附加计划(附加险列表)
List<ApiProductPlanAdditionalInfoDto> apiProductPlanAdditionalInfoDtoList = ApiExcelImportAppointmentDto.buildApiProductPlanAdditionalInfoDto(appointmentDto.getAdditionalDtoList(),dictTypeResponses);
apiProductPlanInfoDto.setApiProductPlanAdditionalInfoDtoList(apiProductPlanAdditionalInfoDtoList);
response.setApiProductPlanInfoDto(apiProductPlanInfoDto);
//设置投保人信息
ApiPolicyholderInfoDto apiPolicyholderInfoDto = new ApiPolicyholderInfoDto();
if (!Objects.isNull(policyholder)) {
BeanUtils.copyProperties(policyholder,apiPolicyholderInfoDto);
apiPolicyholderInfoDto = ApiExcelImportAppointmentDto.buildApiPolicyholderInfoDto(appointmentDto,apiPolicyholderInfoDto,dictTypeResponses);
BeanUtils.copyProperties(apiPolicyholderInfoDto,policyholder);
iPolicyholderService.saveOrUpdate(policyholder);
}
apiPolicyholderInfoDto = ApiExcelImportAppointmentDto.buildApiPolicyholderInfoDto(appointmentDto,apiPolicyholderInfoDto,dictTypeResponses);
response.setApiPolicyholderInfoDto(apiPolicyholderInfoDto);
//编辑更新受保人信息
//查询受保人信息
Insurant insurant = iInsurantService.queryOne(request.getAppointmentBizId(),"");
//设置受保人信息
ApiInsurantInfoDto apiInsurantInfoDto = new ApiInsurantInfoDto();
if (!Objects.isNull(insurant)) {
BeanUtils.copyProperties(insurant,apiInsurantInfoDto);
apiInsurantInfoDto = ApiExcelImportAppointmentDto.buildApiInsurantInfoDto(appointmentDto,apiInsurantInfoDto,dictTypeResponses);
BeanUtils.copyProperties(apiInsurantInfoDto,insurant);
iInsurantService.saveOrUpdate(insurant);
}
apiInsurantInfoDto = ApiExcelImportAppointmentDto.buildApiInsurantInfoDto(appointmentDto,apiInsurantInfoDto,dictTypeResponses);
response.setApiInsurantInfoDto(apiInsurantInfoDto);
//编辑更新第二持有人信息
//查询第二持有人信息
SecondHolder secondHolder = iSecondHolderService.queryOne(request.getAppointmentBizId(),"");
ApiSecondHolderInfoDto apiSecondHolderInfoDto = new ApiSecondHolderInfoDto();
if (!Objects.isNull(secondHolder)) {
BeanUtils.copyProperties(secondHolder,apiSecondHolderInfoDto);
apiSecondHolderInfoDto = ApiExcelImportAppointmentDto.buildApiSecondHolderInfoDto(appointmentDto,apiSecondHolderInfoDto,dictTypeResponses);
BeanUtils.copyProperties(apiSecondHolderInfoDto,secondHolder);
iSecondHolderService.saveOrUpdate(secondHolder);
}
apiSecondHolderInfoDto = ApiExcelImportAppointmentDto.buildApiSecondHolderInfoDto(appointmentDto,apiSecondHolderInfoDto,dictTypeResponses);
response.setApiSecondHolderInfoDto(apiSecondHolderInfoDto);
//新增受益人列表
List<ApiBeneficiaryInfoDto> apiBeneficiaryInfoDtoList = ApiExcelImportAppointmentDto.buildApiBeneficiaryInfoDtoList(appointmentDto.getBeneficiaryDtoList(),dictTypeResponses,request.getAppointmentBizId());
if (!CollectionUtils.isEmpty(apiBeneficiaryInfoDtoList)) {
List<Beneficiary> saveList = apiBeneficiaryInfoDtoList.stream().map(dto -> {
Beneficiary beneficiary = new Beneficiary();
BeanUtils.copyProperties(dto,beneficiary);
return beneficiary;
}).collect(Collectors.toList());
iBeneficiaryService.saveOrUpdateBatch(saveList);
}
List<ApiBeneficiaryInfoDto> apiBeneficiaryInfoDtoList = ApiExcelImportAppointmentDto.buildApiBeneficiaryInfoDtoList(appointmentDto.getBeneficiaryDtoList(),dictTypeResponses);
ApiBeneficiaryInfoFzDto fzDto = new ApiBeneficiaryInfoFzDto();
fzDto.setApiBeneficiaryInfoDtoList(apiBeneficiaryInfoDtoList);
response.setApiBeneficiaryInfoFzDto(fzDto);
return Result.success();
return Result.success(response);
} catch (Exception e) {
log.error("Excel数据转换异常", e);
......
......@@ -87,7 +87,7 @@ public interface ApiAppointmentFileFeignClient {
Result<ApiAppointmentExportExcelResponse> appointmentExportExcel(@NotBlank(message = "预约信息主表唯一业务ID不能为空") @RequestParam(value = "appointmentBizId") String appointmentBizId);
/**
* Excel导入-预约信息
* Excel导入-解析Excel预约信息
* @return
*/
@PostMapping(value = "/excel/import/appointment")
......
......@@ -552,31 +552,30 @@ public class ApiExcelImportAppointmentDto {
infoDto.setPolicyCurrency(dto.getPlanCurrency());
//供款频率 -> 付款频率(字典)
infoDto.setPaymentFrequency(dto.getPlanPaymentFrequency());
//预付额 TODO
// infoDto.setDeductibles();
//红利分配方式(字典)
infoDto.setDividendDistributionMethod(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.CSF_AP_DIVIDEND.getItemValue(),dto.getPlanDividendDistributionMethod()));
//投保额 ——> 保单额度(重疾)
infoDto.setSumInsured(dto.getPlanSumInsured());
//供款年期
infoDto.setIssueNumber(dto.getPlanPaymentTerm());
//每期保费->主險每期保费金额(每期保费)(产品计划信息表)
infoDto.setEachIssuePremium(dto.getPlanEachIssuePremium());
//首期付款方式->首期保费缴付方式
infoDto.setInitialPaymentMethod(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.CSF_AP_FIRST_ISSUE.getItemValue(),dto.getPlanInitialPaymentMethod()));
//是否参加递增保障权益->是否參加遞增保障權益/通脹加保權益
infoDto.setIsJoin(Integer.parseInt(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.SYS_NO_YES.getItemValue(),dto.getPlanIsJoin())));
//是否预缴保费->是否預繳保費 (如是,請填寫首期保費以外的剩餘保費)(是否预缴保费: 0-否, 1-是(字典)(产品计划信息表))
infoDto.setIsPrepay(Integer.parseInt(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.SYS_NO_YES.getItemValue(),dto.getPlanIsPrepay())));
//供款年期
infoDto.setIssueNumber(dto.getPlanPaymentTerm());
//首期付款方式->首期保费缴付方式
infoDto.setInitialPaymentMethod(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.CSF_AP_FIRST_ISSUE.getItemValue(),dto.getPlanInitialPaymentMethod()));
//续期付款方式
infoDto.setRenewalPaymentMethod(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.CSF_AP_FIRST_ISSUE.getItemValue(),dto.getPlanRenewalPaymentMethod()));
//保额
infoDto.setSumInsured(dto.getPlanSumInsured());
//是否参加递增保障权益->是否參加遞增保障權益/通脹加保權益
infoDto.setIsJoin(Integer.parseInt(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.SYS_NO_YES.getItemValue(),dto.getPlanIsJoin())));
//红利分配方式(字典)
infoDto.setDividendDistributionMethod(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.CSF_AP_DIVIDEND.getItemValue(),dto.getPlanDividendDistributionMethod()));
//是否需提前保单生效日 TODO
//预付额 TODO
// infoDto.setDeductibles();
return infoDto;
}
......@@ -589,50 +588,57 @@ public class ApiExcelImportAppointmentDto {
public static ApiPolicyholderInfoDto buildApiPolicyholderInfoDto(ApiExcelImportAppointmentDto dto,
ApiPolicyholderInfoDto infoDto,
List<GetDictItemListByDictTypeResponse> dictTypeResponses) {
//出生日期->出生日期 (西元 年/月/日)(投保人信息表:出生日期)
infoDto.setBirthday(DateUtil.getYMDLocalDateTime(dto.getPolicyholderBirthday()));
//出生地
infoDto.setBirthplace(dto.getPolicyholderBirthplace());
//公司地址
infoDto.setCompanyAddress(dto.getPolicyholderCompanyAddress());
//现时每月收入->现时每月收入 (HKD)(投保人信息表:现时每月收入)
infoDto.setCurrentMonthlyIncome(dto.getPolicyholderCurrentMonthlyIncome());
//受雇于现职年期->工作年期(僅限數字)(投保人信息表:总工作年期)
infoDto.setCurrentTenure(dto.getPolicyholderTotalWorkingYears());
//教育程度(字典)-> 教育程度 (大學或以上/大專/中學/小學或以下)(投保人信息表:教育程度(字典))
infoDto.setEducationLevel(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.CSF_EDUCATION.getItemValue(),ChineseTextConverter.traditionalToSimplified(dto.getPolicyholderEducationLevel())));
//邮箱
infoDto.setEmail(dto.getPolicyholderEmail());
//性别(字典)
//中文姓名->中文姓名
infoDto.setNameCn(dto.getPolicyholderName());
//姓名-(拼音/英文,通过中文自动加载全部大写的拼音)——> 英文姓名 (同护照)
infoDto.setNamePyEn(dto.getPolicyholderNameEn());
//性别(字典,如果是身份证,自动获取性别和生日)——> 性别(字典)
infoDto.setGender(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.SYS_GENDER.getItemValue(),dto.getPolicyholderGender()));
//证件号码->身份证号码
infoDto.setIdNumber(dto.getPolicyholderIdNumber());
//过往一年是否所属国家以外地区居住超过182日 TODO
// infoDto.setIsExceed();
//通讯地址
infoDto.setMailingAddress(dto.getPolicyholderMailingAddress());
//婚姻状况(字典)
//婚姻情况(字典)——> 婚姻状况 (單身 / 已婚 / 離異/ 喪偶)
infoDto.setMaritalStatus(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.CSF_MARRIAGE.getItemValue(),ChineseTextConverter.traditionalToSimplified(dto.getPolicyholderMaritalStatus())));
infoDto.setMobile(StringUtil.getSplitStr(dto.getPolicyholderMobile(),"-",1));
infoDto.setMobileCode(StringUtil.getSplitStr(dto.getPolicyholderMobile(),"-",0));
//名字->中文姓名(投保人信息表:名字)
infoDto.setNameCn(dto.getPolicyholderName());
//名字-英文->英文姓名 (同护照)(投保人信息表:名字-英文)
infoDto.setNamePyEn(dto.getPolicyholderNameEn());
//出生日期(生日,如果是身份证,自动获取性别和生日)——> 出生日期 (西元 年/月/日)
infoDto.setBirthday(DateUtil.getYMDLocalDateTime(dto.getPolicyholderBirthday()));
//出生地 ——> 出生地 (省/市)
infoDto.setBirthplace(dto.getPolicyholderBirthplace());
//国籍
infoDto.setNationality(dto.getPolicyholderNationality());
//通行证号码->港澳通行证号码(投保人信息表:通行证号码)
// infoDto.setPassNo(dto.getPolicyholderPassNo());
// infoDto.setPassportNo(dto.getPolicyholderPassportNo());
//职位
infoDto.setPosition(dto.getPolicyholderPosition());
//证件号码->身份证号码
infoDto.setIdNumber(dto.getPolicyholderIdNumber());
//護照號碼 TODO
//通行证号码->港澳通行证号码(投保人信息表:通行证号码)TODO
//infoDto.setPassNo(dto.getPolicyholderPassNo());
//infoDto.setPassportNo(dto.getPolicyholderPassportNo());
//居住地址->永久(住宅)地址(投保人信息表:居住地址)
infoDto.setResidentialAddress(dto.getPolicyholderResidentialAddress());
//通讯地址
infoDto.setMailingAddress(dto.getPolicyholderMailingAddress());
//移动电话 -> 聯絡電話(手機)
infoDto.setMobile(StringUtil.getSplitStr(dto.getPolicyholderMobile(),"-",1));
infoDto.setMobileCode(StringUtil.getSplitStr(dto.getPolicyholderMobile(),"-",0));
//聯絡電話(住宅) -> 住宅电话
infoDto.setResidenceMobile(StringUtil.getSplitStr(dto.getPolicyholderResidenceMobile(),"-",1));
infoDto.setResidenceMobileCode(StringUtil.getSplitStr(dto.getPolicyholderResidenceMobile(),"-",0));
//电邮地址 ——> 邮箱
infoDto.setEmail(dto.getPolicyholderEmail());
//教育程度(字典)-> 教育程度 (大學或以上/大專/中學/小學或以下)(投保人信息表:教育程度(字典))
infoDto.setEducationLevel(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.CSF_EDUCATION.getItemValue(),ChineseTextConverter.traditionalToSimplified(dto.getPolicyholderEducationLevel())));
//公司/学校名称 ——> 公司名称
infoDto.setCsName(dto.getPolicyholderCompanyName());
//总工作年期
infoDto.setTotalWorkingYears(dto.getPolicyholderTotalWorkingYears());
//职位 ——> 职位及日常职务
infoDto.setPosition(dto.getPolicyholderPosition());
//公司地址
infoDto.setCompanyAddress(dto.getPolicyholderCompanyAddress());
//现时每月收入->现时每月收入 (HKD)(投保人信息表:现时每月收入)
infoDto.setCurrentMonthlyIncome(dto.getPolicyholderCurrentMonthlyIncome());
//受雇于现职年期->工作年期(僅限數字)(投保人信息表:总工作年期)
infoDto.setCurrentTenure(dto.getPolicyholderTotalWorkingYears());
//过往一年是否所属国家以外地区居住超过182日 TODO
// infoDto.setIsExceed();
return infoDto;
}
......@@ -645,50 +651,60 @@ public class ApiExcelImportAppointmentDto {
public static ApiInsurantInfoDto buildApiInsurantInfoDto(ApiExcelImportAppointmentDto dto,
ApiInsurantInfoDto infoDto,
List<GetDictItemListByDictTypeResponse> dictTypeResponses) {
//出生日期->出生日期 (西元 年/月/日)(投保人信息表:出生日期)
//与投保人关系 ——> 與投保人關系
infoDto.setPolicyholderRel(dto.getInsurantPolicyholderRel());
//姓名-中文 -> 中文姓名
infoDto.setNameCn(dto.getInsurantName());
//姓名-(拼音/英文,通过中文自动加载全部大写的拼音)-> 英文姓名 (同护照)
infoDto.setNamePyEn(dto.getInsurantNameEn());
//性别(字典)
infoDto.setGender(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.SYS_GENDER.getItemValue(),dto.getInsurantGender()));
//婚姻情况(字典) ——> 婚姻状况 (單身 / 已婚 / 離異/ 喪偶)
infoDto.setMaritalStatus(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.CSF_MARRIAGE.getItemValue(),ChineseTextConverter.traditionalToSimplified(dto.getInsurantMaritalStatus())));
//出生日期 -> 出生日期 (西元 年/月/日)
infoDto.setBirthday(DateUtil.getYMDLocalDateTime(dto.getInsurantBirthday()));
//出生地
//出生地 ——> 出生地 (省/市)
infoDto.setBirthplace(dto.getInsurantBirthplace());
//国籍
infoDto.setNationality(dto.getInsurantNationality());
//证件号码 -> 身份证号码
infoDto.setIdNumber(dto.getInsurantIdNumber());
//護照號碼 TODO
//通行证号码->港澳通行证号码(投保人信息表:通行证号码)TODO
//infoDto.setPassNo(dto.getInsurantPassNo());
//infoDto.setPassportNo(dto.getInsurantPassportNo());
//永久(住宅)地址-> 永久(住宅)地址(受保人信息表:居住地址)
infoDto.setResidentialAddress(dto.getInsurantResidentialAddress());
//通讯地址
infoDto.setMailingAddress(dto.getInsurantMailingAddress());
//移动电话 ——> 聯絡電話(手機)
infoDto.setMobile(StringUtil.getSplitStr(dto.getInsurantMobile(),"-",1));
infoDto.setMobileCode(StringUtil.getSplitStr(dto.getInsurantMobile(),"-",0));
//住宅电话 ——> 聯絡電話(住宅)
infoDto.setResidenceMobile(StringUtil.getSplitStr(dto.getInsurantResidenceMobile(),"-",1));
infoDto.setResidenceMobileCode(StringUtil.getSplitStr(dto.getInsurantResidenceMobile(),"-",0));
//邮箱 ——> 电邮地址
infoDto.setEmail(dto.getInsurantEmail());
//教育程度(字典)-> 教育程度 (大學或以上/大專/中學/小學或以下)
infoDto.setEducationLevel(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.CSF_EDUCATION.getItemValue(),ChineseTextConverter.traditionalToSimplified(dto.getInsurantEducationLevel())));
//公司/学校名称 ——> 公司名称
infoDto.setCsName(dto.getInsurantCompanyName());
//总工作年期 ——> 工作年期(僅限數字)
infoDto.setTotalWorkingYears(dto.getInsurantTotalWorkingYears());
//职位 ——> 职位及日常职务
infoDto.setPosition(dto.getInsurantPosition());
//公司业务性质 TODO
//公司地址
infoDto.setCompanyAddress(dto.getInsurantCompanyAddress());
//现时每月收入->现时每月收入 (HKD)(投保人信息表:现时每月收入)
infoDto.setCurrentMonthlyIncome(dto.getInsurantCurrentMonthlyIncome());
//受雇于现职年期->工作年期(僅限數字)(投保人信息表:总工作年期)
infoDto.setCurrentTenure(dto.getInsurantTotalWorkingYears());
//教育程度(字典)-> 教育程度 (大學或以上/大專/中學/小學或以下)(投保人信息表:教育程度(字典))
infoDto.setEducationLevel(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.CSF_EDUCATION.getItemValue(),ChineseTextConverter.traditionalToSimplified(dto.getInsurantEducationLevel())));
//邮箱
infoDto.setEmail(dto.getInsurantEmail());
//性别(字典)
infoDto.setGender(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.SYS_GENDER.getItemValue(),dto.getInsurantGender()));
//证件号码->身份证号码
infoDto.setIdNumber(dto.getInsurantIdNumber());
//过往一年是否所属国家以外地区居住超过182日 TODO
// infoDto.setIsExceed();
//通讯地址
infoDto.setMailingAddress(dto.getInsurantMailingAddress());
//婚姻状况(字典)
infoDto.setMaritalStatus(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.CSF_MARRIAGE.getItemValue(),ChineseTextConverter.traditionalToSimplified(dto.getInsurantMaritalStatus())));
infoDto.setMobile(StringUtil.getSplitStr(dto.getInsurantMobile(),"-",1));
infoDto.setMobileCode(StringUtil.getSplitStr(dto.getInsurantMobile(),"-",0));
//名字->中文姓名(投保人信息表:名字)
infoDto.setNameCn(dto.getInsurantName());
//名字-英文->英文姓名 (同护照)(投保人信息表:名字-英文)
infoDto.setNamePyEn(dto.getInsurantNameEn());
//国籍
infoDto.setNationality(dto.getInsurantNationality());
//通行证号码->港澳通行证号码(投保人信息表:通行证号码)
// infoDto.setPassNo(dto.getInsurantPassNo());
// infoDto.setPassportNo(dto.getInsurantPassportNo());
//职位
infoDto.setPosition(dto.getInsurantPosition());
//居住地址->永久(住宅)地址(投保人信息表:居住地址)
infoDto.setResidentialAddress(dto.getInsurantResidentialAddress());
//总工作年期
infoDto.setTotalWorkingYears(dto.getInsurantTotalWorkingYears());
return infoDto;
}
......@@ -701,20 +717,20 @@ public class ApiExcelImportAppointmentDto {
public static ApiSecondHolderInfoDto buildApiSecondHolderInfoDto(ApiExcelImportAppointmentDto dto,
ApiSecondHolderInfoDto infoDto,
List<GetDictItemListByDictTypeResponse> dictTypeResponses) {
//出生日期
//姓名-中文 ——> 中文姓名
infoDto.setNameCn(dto.getSecondHolderName());
//姓名-(拼音/英文,通过中文自动加载全部大写的拼音) ——> 英文姓名 (同护照)
infoDto.setNamePyEn(dto.getSecondHolderNameEn());
//出生日期 ——> 出生日期 (西元 年/月/日)
infoDto.setBirthday(DateUtil.getYMDLocalDateTime(dto.getSecondHolderBirthTime()));
//身份证号码
infoDto.setIdNumber(dto.getSecondHolderIdNumber());
//性别(字典)
infoDto.setGender(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.SYS_GENDER.getItemValue(),dto.getSecondHolderGender()));
//身份证号码
infoDto.setIdNumber(dto.getSecondHolderIdNumber());
//与受保人关系(字典)
infoDto.setInsurantRel(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
DictTypeEnum.CSF_AP_REL.getItemValue(),ChineseTextConverter.traditionalToSimplified(dto.getSecondHolderInsurantRel())));
//名字
infoDto.setNameCn(dto.getSecondHolderName());
//名字-英文
infoDto.setNamePyEn(dto.getSecondHolderNameEn());
return infoDto;
}
......@@ -725,14 +741,11 @@ public class ApiExcelImportAppointmentDto {
* @return
*/
public static List<ApiBeneficiaryInfoDto> buildApiBeneficiaryInfoDtoList(List<ApiExcelImportBeneficiaryDto> dtoList,
List<GetDictItemListByDictTypeResponse> dictTypeResponses,
String appointmentBizId) {
List<GetDictItemListByDictTypeResponse> dictTypeResponses) {
List<ApiBeneficiaryInfoDto> infoDtoList = new ArrayList<>();
if (!CollectionUtils.isEmpty(dtoList)) {
infoDtoList = dtoList.stream().map(dto -> {
ApiBeneficiaryInfoDto infoDto = new ApiBeneficiaryInfoDto();
infoDto.setBeneficiaryBizId(RandomStringGenerator.generateBizId16(CommonEnum.UID_TYPE_BENEFICIARY.getCode()));
infoDto.setAppointmentBizId(appointmentBizId);
//受益比例
infoDto.setBenefitRatio(dto.getBeneficiaryBenefitRatio());
//出生日期
......@@ -756,18 +769,15 @@ public class ApiExcelImportAppointmentDto {
* 构造附加计划(附加险)列表
* @param dtoList
* @param dictTypeResponses
* @param planBizId
* @return
*/
public static List<ApiProductPlanAdditionalInfoDto> buildApiProductPlanAdditionalInfoDto(List<ApiExcelImportAdditionalDto> dtoList,
List<GetDictItemListByDictTypeResponse> dictTypeResponses,
String planBizId) {
List<GetDictItemListByDictTypeResponse> dictTypeResponses) {
List<ApiProductPlanAdditionalInfoDto> infoDtoList = new ArrayList<>();
if (!CollectionUtils.isEmpty(dtoList)) {
infoDtoList = dtoList.stream().map(dto -> {
ApiProductPlanAdditionalInfoDto infoDto = new ApiProductPlanAdditionalInfoDto();
infoDto.setAdditionalBizId(RandomStringGenerator.generateBizId16(CommonEnum.UID_TYPE_ADDITIONAL.getCode()));
infoDto.setPlanBizId(planBizId);
//产品上架信息表唯一业务ID TODO
//保险附加产品名称
infoDto.setProductLaunchName(dto.getAddProductName());
//保费
......
package com.yd.csf.feign.response.appointmentfile;
import com.yd.csf.feign.dto.appointment.*;
import lombok.Data;
@Data
public class ApiAppointmentImportExcelResponse {
/**
* 预约信息(包含签约信息)
*/
private ApiAppointmentInfoDto apiAppointmentInfoDto;
/**
* 产品计划信息
*/
private ApiProductPlanInfoDto apiProductPlanInfoDto;
/**
* 投保人信息
*/
private ApiPolicyholderInfoDto apiPolicyholderInfoDto;
/**
* 受保人信息
*/
private ApiInsurantInfoDto apiInsurantInfoDto;
/**
* 受益人封装对象
*/
private ApiBeneficiaryInfoFzDto apiBeneficiaryInfoFzDto;
/**
* 第二持有人信息
*/
private ApiSecondHolderInfoDto apiSecondHolderInfoDto;
}
......@@ -83,8 +83,8 @@ public class ProductPlan implements Serializable {
/**
* 产品上架信息表名称(标题)
*/
@TableField("product_launch_name")
private String productLaunchName;
@TableField("product_launch_main_name")
private String productLaunchMainName;
/**
* 供款期数
......
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