Commit b7891caa by zhangxingmin

push

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