Commit bad8b7e3 by zhangxingmin

redis缓存字典

parent d315e2fe
...@@ -2,6 +2,7 @@ package com.yd.csf.api.service.impl; ...@@ -2,6 +2,7 @@ package com.yd.csf.api.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yd.common.constant.RedisConstants;
import com.yd.common.enums.CommonEnum; import com.yd.common.enums.CommonEnum;
import com.yd.common.exception.BusinessException; import com.yd.common.exception.BusinessException;
import com.yd.common.result.Result; import com.yd.common.result.Result;
...@@ -32,6 +33,7 @@ import com.yd.oss.feign.request.ApiOssExportAppointmentExcelRequest; ...@@ -32,6 +33,7 @@ import com.yd.oss.feign.request.ApiOssExportAppointmentExcelRequest;
import com.yd.oss.feign.response.ApiGeneratePdfResponse; import com.yd.oss.feign.response.ApiGeneratePdfResponse;
import com.yd.oss.feign.response.ApiOssExcelParseResponse; import com.yd.oss.feign.response.ApiOssExcelParseResponse;
import com.yd.oss.feign.response.ApiOssExportAppointmentExcelResponse; import com.yd.oss.feign.response.ApiOssExportAppointmentExcelResponse;
import com.yd.user.feign.response.sysdict.GetDictItemListByDictTypeResponse;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -197,7 +199,7 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService ...@@ -197,7 +199,7 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService
Map<String, Object> data = new HashMap<>(); Map<String, Object> data = new HashMap<>();
try { try {
//查询redis缓存的字典列表信息 //查询redis缓存的字典列表信息
// redisUtil.getCacheList() List<GetDictItemListByDictTypeResponse> dictTypeResponses = redisUtil.getCacheObject(RedisConstants.DICT_LIST);
//预约信息 //预约信息
Result<Appointment> result = apiAppointmentService.checkAppointmentIsExist(appointmentBizId); Result<Appointment> result = apiAppointmentService.checkAppointmentIsExist(appointmentBizId);
Appointment appointment = result.getData(); Appointment appointment = result.getData();
...@@ -215,7 +217,7 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService ...@@ -215,7 +217,7 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService
if (!Objects.isNull(productPlan)) { if (!Objects.isNull(productPlan)) {
ApiExcelAppointmentPlanDto planDto = new ApiExcelAppointmentPlanDto(); ApiExcelAppointmentPlanDto planDto = new ApiExcelAppointmentPlanDto();
BeanUtils.copyProperties(productPlan,planDto); BeanUtils.copyProperties(productPlan,planDto);
planDto = ApiExcelAppointmentPlanDto.setApiExcelAppointmentPlanDto(planDto); planDto = ApiExcelAppointmentPlanDto.setApiExcelAppointmentPlanDto(planDto,dictTypeResponses);
//对象转成map.方便excel做占位符字段替换 //对象转成map.方便excel做占位符字段替换
Map<String, Object> planMap = BeanMapUtils.convertToMapSafely(planDto); Map<String, Object> planMap = BeanMapUtils.convertToMapSafely(planDto);
data.putAll(planMap); data.putAll(planMap);
...@@ -251,7 +253,7 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService ...@@ -251,7 +253,7 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService
BeanUtils.copyProperties(dto,beneficiaryDto); BeanUtils.copyProperties(dto,beneficiaryDto);
return beneficiaryDto; return beneficiaryDto;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
apiExcelBeneficiaryDtoList = ApiExcelBeneficiaryDto.setApiExcelBeneficiaryDtoList(apiExcelBeneficiaryDtoList); apiExcelBeneficiaryDtoList = ApiExcelBeneficiaryDto.setApiExcelBeneficiaryDtoList(apiExcelBeneficiaryDtoList,dictTypeResponses);
List<Map<String, Object>> mapList1 = BeanMapUtils.convertListToMapListSafelyWithEmpty(apiExcelBeneficiaryDtoList); List<Map<String, Object>> mapList1 = BeanMapUtils.convertListToMapListSafelyWithEmpty(apiExcelBeneficiaryDtoList);
data.put("beneficiaryList", mapList1); data.put("beneficiaryList", mapList1);
} }
...@@ -259,7 +261,7 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService ...@@ -259,7 +261,7 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService
//Excel-客戶在港/澳停留時間信息 //Excel-客戶在港/澳停留時間信息
ApiExcelHkStayDto stayDto = new ApiExcelHkStayDto(); ApiExcelHkStayDto stayDto = new ApiExcelHkStayDto();
BeanUtils.copyProperties(appointment,stayDto); BeanUtils.copyProperties(appointment,stayDto);
stayDto = ApiExcelHkStayDto.setApiExcelHkStayDto(stayDto); stayDto = ApiExcelHkStayDto.setApiExcelHkStayDto(stayDto,dictTypeResponses);
Map<String, Object> stayMap = BeanMapUtils.convertToMapSafely(stayDto); Map<String, Object> stayMap = BeanMapUtils.convertToMapSafely(stayDto);
data.putAll(stayMap); data.putAll(stayMap);
...@@ -268,7 +270,7 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService ...@@ -268,7 +270,7 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService
if (!Objects.isNull(insurant)) { if (!Objects.isNull(insurant)) {
ApiExcelInsurantDto insurantDto = new ApiExcelInsurantDto(); ApiExcelInsurantDto insurantDto = new ApiExcelInsurantDto();
BeanUtils.copyProperties(insurant,insurantDto); BeanUtils.copyProperties(insurant,insurantDto);
insurantDto = ApiExcelInsurantDto.setApiExcelInsurantDto(insurantDto); insurantDto = ApiExcelInsurantDto.setApiExcelInsurantDto(insurantDto,dictTypeResponses);
//对象转成map.方便excel做占位符字段替换 //对象转成map.方便excel做占位符字段替换
Map<String, Object> insurantMap = BeanMapUtils.convertToMapSafely(insurantDto); Map<String, Object> insurantMap = BeanMapUtils.convertToMapSafely(insurantDto);
data.putAll(insurantMap); data.putAll(insurantMap);
...@@ -279,7 +281,7 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService ...@@ -279,7 +281,7 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService
if (!Objects.isNull(policyholder)) { if (!Objects.isNull(policyholder)) {
ApiExcelPolicyholderDto policyholderDto = new ApiExcelPolicyholderDto(); ApiExcelPolicyholderDto policyholderDto = new ApiExcelPolicyholderDto();
BeanUtils.copyProperties(policyholder,policyholderDto); BeanUtils.copyProperties(policyholder,policyholderDto);
policyholderDto = ApiExcelPolicyholderDto.setApiExcelPolicyholderDto(policyholderDto); policyholderDto = ApiExcelPolicyholderDto.setApiExcelPolicyholderDto(policyholderDto,dictTypeResponses);
//对象转成map.方便excel做占位符字段替换 //对象转成map.方便excel做占位符字段替换
Map<String, Object> policyholderMap = BeanMapUtils.convertToMapSafely(policyholderDto); Map<String, Object> policyholderMap = BeanMapUtils.convertToMapSafely(policyholderDto);
data.putAll(policyholderMap); data.putAll(policyholderMap);
...@@ -290,7 +292,7 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService ...@@ -290,7 +292,7 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService
if (!Objects.isNull(secondHolder)) { if (!Objects.isNull(secondHolder)) {
ApiExcelSecondHolderDto secondHolderDto = new ApiExcelSecondHolderDto(); ApiExcelSecondHolderDto secondHolderDto = new ApiExcelSecondHolderDto();
BeanUtils.copyProperties(secondHolder,secondHolderDto); BeanUtils.copyProperties(secondHolder,secondHolderDto);
secondHolderDto = ApiExcelSecondHolderDto.setApiExcelSecondHolderDto(secondHolderDto); secondHolderDto = ApiExcelSecondHolderDto.setApiExcelSecondHolderDto(secondHolderDto,dictTypeResponses);
//对象转成map.方便excel做占位符字段替换 //对象转成map.方便excel做占位符字段替换
Map<String, Object> secondHolderMap = BeanMapUtils.convertToMapSafely(secondHolderDto); Map<String, Object> secondHolderMap = BeanMapUtils.convertToMapSafely(secondHolderDto);
data.putAll(secondHolderMap); data.putAll(secondHolderMap);
......
...@@ -36,5 +36,10 @@ ...@@ -36,5 +36,10 @@
<artifactId>yd-question-feign</artifactId> <artifactId>yd-question-feign</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.yd</groupId>
<artifactId>yd-user-feign</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
package com.yd.csf.feign.dto.excel; package com.yd.csf.feign.dto.excel;
import com.yd.common.enums.DictTypeEnum;
import com.yd.common.enums.NoYesEnum; import com.yd.common.enums.NoYesEnum;
import com.yd.common.utils.DateUtil; import com.yd.common.utils.DateUtil;
import com.yd.user.feign.response.sysdict.GetDictItemListByDictTypeResponse;
import lombok.Data; import lombok.Data;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -171,7 +173,8 @@ public class ApiExcelAppointmentPlanDto { ...@@ -171,7 +173,8 @@ public class ApiExcelAppointmentPlanDto {
* @param dto * @param dto
* @return * @return
*/ */
public static ApiExcelAppointmentPlanDto setApiExcelAppointmentPlanDto(ApiExcelAppointmentPlanDto dto) { public static ApiExcelAppointmentPlanDto setApiExcelAppointmentPlanDto(ApiExcelAppointmentPlanDto dto,
List<GetDictItemListByDictTypeResponse> dictTypeResponses) {
ApiExcelAppointmentPlanDto mainDto = new ApiExcelAppointmentPlanDto(); ApiExcelAppointmentPlanDto mainDto = new ApiExcelAppointmentPlanDto();
BeanUtils.copyProperties(dto,mainDto); BeanUtils.copyProperties(dto,mainDto);
mainDto.setPlanCompanyName(dto.getCompanyName()); mainDto.setPlanCompanyName(dto.getCompanyName());
...@@ -181,14 +184,16 @@ public class ApiExcelAppointmentPlanDto { ...@@ -181,14 +184,16 @@ public class ApiExcelAppointmentPlanDto {
mainDto.setPlanInitialPaymentMethod(dto.getInitialPaymentMethod()); mainDto.setPlanInitialPaymentMethod(dto.getInitialPaymentMethod());
mainDto.setPlanIsJoin(dto.getIsJoin()); mainDto.setPlanIsJoin(dto.getIsJoin());
mainDto.setPlanIsPrepay(NoYesEnum.getLabelByValue(dto.getIsPrepay())); mainDto.setPlanIsPrepay(NoYesEnum.getLabelByValue(dto.getIsPrepay()));
//付款频率(字典)(产品计划信息表)TODO //付款频率(字典)(产品计划信息表)
mainDto.setPlanPaymentFrequency(dto.getPaymentFrequency()); mainDto.setPlanPaymentFrequency(GetDictItemListByDictTypeResponse.getItemLabel(dictTypeResponses,
DictTypeEnum.CSF_AP_FREQUENCY.getItemValue(),dto.getPaymentFrequency()));
mainDto.setPlanPaymentTerm(dto.getPaymentTerm()); mainDto.setPlanPaymentTerm(dto.getPaymentTerm());
//保单生效日(产品计划信息表)TODO //保单生效日(产品计划信息表)
mainDto.setPlanPolicyEffectiveDate(DateUtil.getyyyyMMdd(dto.getPolicyEffectiveDate())); mainDto.setPlanPolicyEffectiveDate(DateUtil.getyyyyMMdd(dto.getPolicyEffectiveDate()));
mainDto.setPlanProductName(dto.getProductName()); mainDto.setPlanProductName(dto.getProductName());
//续期保费缴付方式(字典)(产品计划信息表)TODO //续期保费缴付方式(字典)(产品计划信息表)
mainDto.setPlanRenewalPaymentMethod(dto.getRenewalPaymentMethod()); mainDto.setPlanRenewalPaymentMethod(GetDictItemListByDictTypeResponse.getItemLabel(dictTypeResponses,
DictTypeEnum.CSF_AP_FIRST_ISSUE.getItemValue(),dto.getRenewalPaymentMethod()));
mainDto.setPlanSumInsured(dto.getSumInsured()); mainDto.setPlanSumInsured(dto.getSumInsured());
return mainDto; return mainDto;
} }
......
package com.yd.csf.feign.dto.excel; package com.yd.csf.feign.dto.excel;
import com.yd.common.enums.DictTypeEnum;
import com.yd.common.utils.DateUtil; import com.yd.common.utils.DateUtil;
import com.yd.user.feign.response.sysdict.GetDictItemListByDictTypeResponse;
import lombok.Data; import lombok.Data;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -85,7 +87,8 @@ public class ApiExcelBeneficiaryDto { ...@@ -85,7 +87,8 @@ public class ApiExcelBeneficiaryDto {
* @param list * @param list
* @return * @return
*/ */
public static List<ApiExcelBeneficiaryDto> setApiExcelBeneficiaryDtoList(List<ApiExcelBeneficiaryDto> list) { public static List<ApiExcelBeneficiaryDto> setApiExcelBeneficiaryDtoList(List<ApiExcelBeneficiaryDto> list,
List<GetDictItemListByDictTypeResponse> dictTypeResponses) {
List<ApiExcelBeneficiaryDto> newList = new ArrayList<>(); List<ApiExcelBeneficiaryDto> newList = new ArrayList<>();
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
newList = list.stream().map(dto -> { newList = list.stream().map(dto -> {
...@@ -94,8 +97,9 @@ public class ApiExcelBeneficiaryDto { ...@@ -94,8 +97,9 @@ public class ApiExcelBeneficiaryDto {
newDto.setBeneficiaryBenefitRatio(dto.getBeneficiaryBenefitRatio()); newDto.setBeneficiaryBenefitRatio(dto.getBeneficiaryBenefitRatio());
newDto.setBeneficiaryBirthTime(DateUtil.getyyyyMMdd(dto.getBirthTime())); newDto.setBeneficiaryBirthTime(DateUtil.getyyyyMMdd(dto.getBirthTime()));
newDto.setBeneficiaryIdNumber(newDto.getIdNumber()); newDto.setBeneficiaryIdNumber(newDto.getIdNumber());
//與受保人關係(受益人信息表:与受保人关系(字典)) TODO //與受保人關係(受益人信息表:与受保人关系(字典))
newDto.setBeneficiaryInsurantRel(newDto.getInsurantRel()); newDto.setBeneficiaryInsurantRel(GetDictItemListByDictTypeResponse.getItemLabel(dictTypeResponses,
DictTypeEnum.CSF_AP_REL.getItemValue(),newDto.getInsurantRel()));
newDto.setBeneficiaryName(newDto.getName()); newDto.setBeneficiaryName(newDto.getName());
newDto.setBeneficiaryNameEn(newDto.getNameEn()); newDto.setBeneficiaryNameEn(newDto.getNameEn());
return newDto; return newDto;
......
...@@ -2,10 +2,12 @@ package com.yd.csf.feign.dto.excel; ...@@ -2,10 +2,12 @@ package com.yd.csf.feign.dto.excel;
import com.yd.common.utils.DateUtil; import com.yd.common.utils.DateUtil;
import com.yd.csf.feign.dto.appointment.ApiAppointmentInfoDto; import com.yd.csf.feign.dto.appointment.ApiAppointmentInfoDto;
import com.yd.user.feign.response.sysdict.GetDictItemListByDictTypeResponse;
import lombok.Data; import lombok.Data;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
/** /**
* Excel-客戶在港/澳停留時間信息 * Excel-客戶在港/澳停留時間信息
...@@ -90,14 +92,15 @@ public class ApiExcelHkStayDto { ...@@ -90,14 +92,15 @@ public class ApiExcelHkStayDto {
* @param dto * @param dto
* @return * @return
*/ */
public static ApiExcelHkStayDto setApiExcelHkStayDto(ApiExcelHkStayDto dto) { public static ApiExcelHkStayDto setApiExcelHkStayDto(ApiExcelHkStayDto dto,
List<GetDictItemListByDictTypeResponse> dictTypeResponses) {
ApiExcelHkStayDto stayDto = new ApiExcelHkStayDto(); ApiExcelHkStayDto stayDto = new ApiExcelHkStayDto();
BeanUtils.copyProperties(dto,stayDto); BeanUtils.copyProperties(dto,stayDto);
stayDto.setHkAccompanyMobile(dto.getAccompanyMobileCode() + "-" + dto.getAccompanyMobile()); stayDto.setHkAccompanyMobile(dto.getAccompanyMobileCode() + "-" + dto.getAccompanyMobile());
stayDto.setHkAccompanyName(dto.getAccompanyName()); stayDto.setHkAccompanyName(dto.getAccompanyName());
//抵港(澳)日期及时间(到港时间)(预约信息主表)年-月-日 时:分 TODO //抵港(澳)日期及时间(到港时间)(预约信息主表)年-月-日 时:分
stayDto.setHkArrivalTime(DateUtil.getyyyyMMddHHmm(dto.getArrivalTime())); stayDto.setHkArrivalTime(DateUtil.getyyyyMMddHHmm(dto.getArrivalTime()));
//离港(澳)日期及时间(离港时间)(预约信息主表)年-月-日 时:分 TODO //离港(澳)日期及时间(离港时间)(预约信息主表)年-月-日 时:分
stayDto.setHkDepartureTime(DateUtil.getyyyyMMddHHmm(dto.getDepartureTime())); stayDto.setHkDepartureTime(DateUtil.getyyyyMMddHHmm(dto.getDepartureTime()));
stayDto.setHkHkMobile(dto.getHkMobileCode() + "-" + dto.getHkMobile()); stayDto.setHkHkMobile(dto.getHkMobileCode() + "-" + dto.getHkMobile());
stayDto.setHkMeetingPoint(dto.getMeetingPoint()); stayDto.setHkMeetingPoint(dto.getMeetingPoint());
......
package com.yd.csf.feign.dto.excel; package com.yd.csf.feign.dto.excel;
import com.yd.common.enums.DictTypeEnum;
import com.yd.common.utils.DateUtil; import com.yd.common.utils.DateUtil;
import com.yd.user.feign.response.sysdict.GetDictItemListByDictTypeResponse;
import lombok.Data; import lombok.Data;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
/** /**
* 受保人资料 (如與保單持有人為同一人無須填寫) * 受保人资料 (如與保單持有人為同一人無須填寫)
...@@ -257,7 +260,8 @@ public class ApiExcelInsurantDto { ...@@ -257,7 +260,8 @@ public class ApiExcelInsurantDto {
* @param dto * @param dto
* @return * @return
*/ */
public static ApiExcelInsurantDto setApiExcelInsurantDto(ApiExcelInsurantDto dto) { public static ApiExcelInsurantDto setApiExcelInsurantDto(ApiExcelInsurantDto dto,
List<GetDictItemListByDictTypeResponse> dictTypeResponses) {
ApiExcelInsurantDto insurantDto = new ApiExcelInsurantDto(); ApiExcelInsurantDto insurantDto = new ApiExcelInsurantDto();
BeanUtils.copyProperties(dto,insurantDto); BeanUtils.copyProperties(dto,insurantDto);
insurantDto.setInsurantBirthday(DateUtil.getyyyyMMdd(dto.getBirthday())); insurantDto.setInsurantBirthday(DateUtil.getyyyyMMdd(dto.getBirthday()));
...@@ -266,15 +270,17 @@ public class ApiExcelInsurantDto { ...@@ -266,15 +270,17 @@ public class ApiExcelInsurantDto {
insurantDto.setInsurantCompanyAddress(dto.getCompanyAddress()); insurantDto.setInsurantCompanyAddress(dto.getCompanyAddress());
insurantDto.setInsurantCompanyName(dto.getCompanyName()); insurantDto.setInsurantCompanyName(dto.getCompanyName());
insurantDto.setInsurantCurrentMonthlyIncome(dto.getCurrentMonthlyIncome()); insurantDto.setInsurantCurrentMonthlyIncome(dto.getCurrentMonthlyIncome());
//教育程度 (大學或以上/大專/中學/小學或以下)(受保人信息表:教育程度(字典))TODO //教育程度 (大學或以上/大專/中學/小學或以下)(受保人信息表:教育程度(字典))
insurantDto.setInsurantEducationLevel(dto.getEducationLevel()); insurantDto.setInsurantEducationLevel(GetDictItemListByDictTypeResponse.getItemLabel(dictTypeResponses,
DictTypeEnum.CSF_EDUCATION.getItemValue(),dto.getEducationLevel()));
insurantDto.setInsurantEmail(dto.getEmail()); insurantDto.setInsurantEmail(dto.getEmail());
//性别(受保人信息表:性别 字典)TODO //性别(受保人信息表:性别 字典)
insurantDto.setInsurantGender(dto.getGender()); insurantDto.setInsurantGender(dto.getGender());
insurantDto.setInsurantIdNumber(dto.getIdNumber()); insurantDto.setInsurantIdNumber(dto.getIdNumber());
insurantDto.setInsurantMailingAddress(dto.getMailingAddress()); insurantDto.setInsurantMailingAddress(dto.getMailingAddress());
//婚姻状况 (單身 / 已婚 / 離異/ 喪偶)(受保人信息表:婚姻状况(字典))TODO //婚姻状况 (單身 / 已婚 / 離異/ 喪偶)(受保人信息表:婚姻状况(字典))
insurantDto.setInsurantMaritalStatus(dto.getMaritalStatus()); insurantDto.setInsurantMaritalStatus(GetDictItemListByDictTypeResponse.getItemLabel(dictTypeResponses,
DictTypeEnum.CSF_MARRIAGE.getItemValue(),dto.getMaritalStatus()));
insurantDto.setInsurantMobile(dto.getMobileCode() + "-" + dto.getMobile()); insurantDto.setInsurantMobile(dto.getMobileCode() + "-" + dto.getMobile());
insurantDto.setInsurantName(dto.getName()); insurantDto.setInsurantName(dto.getName());
insurantDto.setInsurantNameEn(dto.getNameEn()); insurantDto.setInsurantNameEn(dto.getNameEn());
...@@ -282,8 +288,9 @@ public class ApiExcelInsurantDto { ...@@ -282,8 +288,9 @@ public class ApiExcelInsurantDto {
insurantDto.setInsurantNationality(dto.getNationality()); insurantDto.setInsurantNationality(dto.getNationality());
insurantDto.setInsurantPassNo(dto.getPassNo()); insurantDto.setInsurantPassNo(dto.getPassNo());
insurantDto.setInsurantPassportNo(dto.getPassportNo()); insurantDto.setInsurantPassportNo(dto.getPassportNo());
//與投保人關系(受保人信息表:与投保人关系(字典)) TODO //與投保人關系(受保人信息表:与投保人关系(字典))
insurantDto.setInsurantPolicyholderRel(dto.getPolicyholderRel()); insurantDto.setInsurantPolicyholderRel(GetDictItemListByDictTypeResponse.getItemLabel(dictTypeResponses,
DictTypeEnum.CSF_AP_REL.getItemValue(),dto.getPolicyholderRel()));
//公司业务性质(受保人信息表:TODO) //公司业务性质(受保人信息表:TODO)
insurantDto.setInsurantPompanyNature(dto.getInsurantPompanyNature()); insurantDto.setInsurantPompanyNature(dto.getInsurantPompanyNature());
insurantDto.setInsurantPosition(dto.getPosition()); insurantDto.setInsurantPosition(dto.getPosition());
......
package com.yd.csf.feign.dto.excel; package com.yd.csf.feign.dto.excel;
import com.yd.common.enums.DictTypeEnum;
import com.yd.common.utils.DateUtil; import com.yd.common.utils.DateUtil;
import com.yd.user.feign.response.sysdict.GetDictItemListByDictTypeResponse;
import lombok.Data; import lombok.Data;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
/** /**
* 保单持有人资料(投保人信息) * 保单持有人资料(投保人信息)
...@@ -247,7 +250,8 @@ public class ApiExcelPolicyholderDto { ...@@ -247,7 +250,8 @@ public class ApiExcelPolicyholderDto {
* @param dto * @param dto
* @return * @return
*/ */
public static ApiExcelPolicyholderDto setApiExcelPolicyholderDto(ApiExcelPolicyholderDto dto) { public static ApiExcelPolicyholderDto setApiExcelPolicyholderDto(ApiExcelPolicyholderDto dto,
List<GetDictItemListByDictTypeResponse> dictTypeResponses) {
ApiExcelPolicyholderDto insurantDto = new ApiExcelPolicyholderDto(); ApiExcelPolicyholderDto insurantDto = new ApiExcelPolicyholderDto();
BeanUtils.copyProperties(dto,insurantDto); BeanUtils.copyProperties(dto,insurantDto);
insurantDto.setPolicyholderBirthday(DateUtil.getyyyyMMdd(dto.getBirthday())); insurantDto.setPolicyholderBirthday(DateUtil.getyyyyMMdd(dto.getBirthday()));
...@@ -256,15 +260,18 @@ public class ApiExcelPolicyholderDto { ...@@ -256,15 +260,18 @@ public class ApiExcelPolicyholderDto {
insurantDto.setPolicyholderCompanyAddress(dto.getCompanyAddress()); insurantDto.setPolicyholderCompanyAddress(dto.getCompanyAddress());
insurantDto.setPolicyholderCompanyName(dto.getCompanyName()); insurantDto.setPolicyholderCompanyName(dto.getCompanyName());
insurantDto.setPolicyholderCurrentMonthlyIncome(dto.getCurrentMonthlyIncome()); insurantDto.setPolicyholderCurrentMonthlyIncome(dto.getCurrentMonthlyIncome());
//教育程度 (大學或以上/大專/中學/小學或以下)(投保人信息表:教育程度(字典))TODO //教育程度 (大學或以上/大專/中學/小學或以下)(投保人信息表:教育程度(字典))
insurantDto.setPolicyholderEducationLevel(dto.getEducationLevel()); insurantDto.setPolicyholderEducationLevel(GetDictItemListByDictTypeResponse.getItemLabel(dictTypeResponses,
DictTypeEnum.CSF_EDUCATION.getItemValue(),dto.getEducationLevel()));
insurantDto.setPolicyholderEmail(dto.getEmail()); insurantDto.setPolicyholderEmail(dto.getEmail());
//性别(投保人信息表:性别 字典)TODO //性别(投保人信息表:性别 字典)
insurantDto.setPolicyholderGender(dto.getGender()); insurantDto.setPolicyholderGender(GetDictItemListByDictTypeResponse.getItemLabel(dictTypeResponses,
DictTypeEnum.SYS_GENDER.getItemValue(),dto.getGender()));
insurantDto.setPolicyholderIdNumber(dto.getIdNumber()); insurantDto.setPolicyholderIdNumber(dto.getIdNumber());
insurantDto.setPolicyholderMailingAddress(dto.getMailingAddress()); insurantDto.setPolicyholderMailingAddress(dto.getMailingAddress());
//婚姻状况 (單身 / 已婚 / 離異/ 喪偶)(投保人信息表:婚姻状况(字典))TODO //婚姻状况 (單身 / 已婚 / 離異/ 喪偶)(投保人信息表:婚姻状况(字典))
insurantDto.setPolicyholderMaritalStatus(dto.getMaritalStatus()); insurantDto.setPolicyholderMaritalStatus(GetDictItemListByDictTypeResponse.getItemLabel(dictTypeResponses,
DictTypeEnum.CSF_MARRIAGE.getItemValue(),dto.getMaritalStatus()));
insurantDto.setPolicyholderMobile(dto.getMobileCode() + "-" + dto.getMobile()); insurantDto.setPolicyholderMobile(dto.getMobileCode() + "-" + dto.getMobile());
insurantDto.setPolicyholderName(dto.getName()); insurantDto.setPolicyholderName(dto.getName());
insurantDto.setPolicyholderNameEn(dto.getNameEn()); insurantDto.setPolicyholderNameEn(dto.getNameEn());
......
package com.yd.csf.feign.dto.excel; package com.yd.csf.feign.dto.excel;
import com.yd.common.enums.DictTypeEnum;
import com.yd.common.utils.DateUtil; import com.yd.common.utils.DateUtil;
import com.yd.user.feign.response.sysdict.GetDictItemListByDictTypeResponse;
import lombok.Data; import lombok.Data;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
/** /**
* 第二持有人资料 * 第二持有人资料
...@@ -80,15 +83,18 @@ public class ApiExcelSecondHolderDto { ...@@ -80,15 +83,18 @@ public class ApiExcelSecondHolderDto {
* @param dto * @param dto
* @return * @return
*/ */
public static ApiExcelSecondHolderDto setApiExcelSecondHolderDto(ApiExcelSecondHolderDto dto) { public static ApiExcelSecondHolderDto setApiExcelSecondHolderDto(ApiExcelSecondHolderDto dto,
List<GetDictItemListByDictTypeResponse> dictTypeResponses) {
ApiExcelSecondHolderDto secondHolderDto = new ApiExcelSecondHolderDto(); ApiExcelSecondHolderDto secondHolderDto = new ApiExcelSecondHolderDto();
BeanUtils.copyProperties(dto,secondHolderDto); BeanUtils.copyProperties(dto,secondHolderDto);
secondHolderDto.setSecondHolderBirthTime(DateUtil.getyyyyMMdd(dto.getBirthTime())); secondHolderDto.setSecondHolderBirthTime(DateUtil.getyyyyMMdd(dto.getBirthTime()));
//性別(第二持有人信息表:性别)字典 TODO //性別(第二持有人信息表:性别)字典
secondHolderDto.setSecondHolderGender(dto.getGender()); secondHolderDto.setSecondHolderGender(GetDictItemListByDictTypeResponse.getItemLabel(dictTypeResponses,
DictTypeEnum.SYS_GENDER.getItemValue(),dto.getGender()));
secondHolderDto.setSecondHolderIdNumber(dto.getIdNumber()); secondHolderDto.setSecondHolderIdNumber(dto.getIdNumber());
//與受保人關係(第二持有人信息表:与受保人关系(字典)) TODO //與受保人關係(第二持有人信息表:与受保人关系(字典))
secondHolderDto.setSecondHolderInsurantRel(dto.getInsurantRel()); secondHolderDto.setSecondHolderInsurantRel(GetDictItemListByDictTypeResponse.getItemLabel(dictTypeResponses,
DictTypeEnum.CSF_AP_REL.getItemValue(),dto.getInsurantRel()));
secondHolderDto.setSecondHolderName(dto.getName()); secondHolderDto.setSecondHolderName(dto.getName());
secondHolderDto.setSecondHolderNameEn(dto.getNameEn()); secondHolderDto.setSecondHolderNameEn(dto.getNameEn());
return secondHolderDto; return secondHolderDto;
......
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