Commit 1d2273a4 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.6.7' into MVP1.6.7

parents bbe4fb7a 333eb914
...@@ -368,4 +368,36 @@ public class InsuredListVo implements Serializable { ...@@ -368,4 +368,36 @@ public class InsuredListVo implements Serializable {
@Schema(description = "被替换人项目名称") @Schema(description = "被替换人项目名称")
@ExcelIgnore @ExcelIgnore
private String coverProjectNo; private String coverProjectNo;
/**
* 替换人姓名
*/
@Schema(description = "替换人姓名")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "替换人姓名")
private String replaceEmpName;
/**
* 替换人身份证号
*/
@Schema(description = "替换人身份证号)")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "替换人身份证号")
private String replaceEmpIdcardNo;
/**
* 替换人项目名称
*/
@Schema(description = "替换人项目名称")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "替换人项目名称")
private String replaceProjectName;
/**
* 替换人封面抬头
*/
@Schema(description = "替换人封面抬头")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "替换人封面抬头")
private String replaceInvoiceTitle;
} }
...@@ -4433,37 +4433,34 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -4433,37 +4433,34 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , "UTF-8")); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, InsuredListVo.class).build(); ExcelWriter excelWriter = EasyExcel.write(out, InsuredListVo.class).build();
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT){ if (count > CommonConstants.ZERO_INT){
Field[] allFields = InsuredListVo.class.getDeclaredFields(); Field[] allFields = InsuredListVo.class.getDeclaredFields();
WriteSheet writeSheet; WriteSheet writeSheet;
ExcelUtil<InsuredListVo> util; ExcelUtil<InsuredListVo> util;
for (int i = 0; i <= count; ) {
// 获取实际记录
param.setLimitStart(i);
param.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = this.baseMapper.getInsuredList(param);
if (Common.isNotNull(list)){
//处理封面抬头 //处理封面抬头
//根据项目编码获取项目名称 //获取所有项目信息
Map<String, ProjectSetInfoVo> data = null; Map<String, ProjectSetInfoVo> data = null;
try { try {
List<String> collect = list.stream().map(InsuredListVo::getDeptNo).distinct().collect(Collectors.toList()); R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(new ArrayList<>());
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) { if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
data = setInfoByCodes.getData().getProjectSetInfoVoMap(); data = setInfoByCodes.getData().getProjectSetInfoVoMap();
} }
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
data = null;
} }
for (int i = 0; i <= count; ) {
// 获取实际记录
param.setLimitStart(i);
param.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = this.baseMapper.getInsuredList(param);
if (Common.isNotNull(list)){
util = new ExcelUtil<>(InsuredListVo.class); util = new ExcelUtil<>(InsuredListVo.class);
TInsuranceReplace one; TInsuranceReplace one;
TInsuranceReplace fromOne;
TInsuranceDetail byId; TInsuranceDetail byId;
ProjectSetInfoVo coverObject = null; ProjectSetInfoVo coverObject;
for (InsuredListVo vo:list){ for (InsuredListVo vo:list){
//被替换人 //被替换人
one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda() one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
...@@ -4472,40 +4469,42 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -4472,40 +4469,42 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (Optional.ofNullable(one).isPresent()) { if (Optional.ofNullable(one).isPresent()) {
byId = this.getById(one.getFromInsuranceDetailId()); byId = this.getById(one.getFromInsuranceDetailId());
if (Optional.ofNullable(byId).isPresent()) { if (Optional.ofNullable(byId).isPresent()) {
//根据项目编码获取项目名称
Map<String, ProjectSetInfoVo> dataReplace = null;
try {
List<String> collect = new ArrayList<>();
collect.add(byId.getDeptNo());
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
dataReplace = setInfoByCodes.getData().getProjectSetInfoVoMap();
}
}catch (Exception e){
e.printStackTrace();
dataReplace = null;
}
vo.setCoverEmpName(byId.getEmpName()); vo.setCoverEmpName(byId.getEmpName());
vo.setCoverEmpIdcardNo(byId.getEmpIdcardNo()); vo.setCoverEmpIdcardNo(byId.getEmpIdcardNo());
vo.setCoverProjectName(byId.getDeptName()); vo.setCoverProjectName(byId.getDeptName());
coverObject = null; if (Common.isNotNull(data) && Common.isNotNull(data.get(byId.getDeptNo()))){
if (Common.isNotNull(dataReplace)){ coverObject = data.get(byId.getDeptNo());
coverObject = dataReplace.get(byId.getDeptNo());
}
if (null != coverObject) {
vo.setCoverInvoiceTitle(Optional.ofNullable(coverObject.getInvoiceTitleInsurance()).orElse("")); vo.setCoverInvoiceTitle(Optional.ofNullable(coverObject.getInvoiceTitleInsurance()).orElse(""));
}else { }else {
vo.setCoverInvoiceTitle("未获取到对应项目信息"); vo.setCoverInvoiceTitle("未获取到对应项目信息");
} }
} }
} }
//替换人
fromOne = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getFromInsuranceDetailId, vo.getId())
.last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(fromOne).isPresent()) {
byId = this.getById(fromOne.getToInsuranceDetailId());
if (Optional.ofNullable(byId).isPresent()) {
vo.setReplaceEmpName(byId.getEmpName());
vo.setReplaceEmpIdcardNo(byId.getEmpIdcardNo());
vo.setReplaceProjectName(byId.getDeptName());
if (Common.isNotNull(data) && Common.isNotNull(data.get(byId.getDeptNo()))){
coverObject = data.get(byId.getDeptNo());
vo.setReplaceInvoiceTitle(Optional.ofNullable(coverObject.getInvoiceTitleInsurance()).orElse(""));
}else {
vo.setReplaceInvoiceTitle("未获取到对应项目信息");
}
}
}
//购买月数 //购买月数
vo.setBuyMonth(LocalDateUtil.betweenMonth(vo.getPolicyStart().toString(), vo.getPolicyEnd().toString())); vo.setBuyMonth(LocalDateUtil.betweenMonth(vo.getPolicyStart().toString(), vo.getPolicyEnd().toString()));
if (Objects.nonNull(data)) {
ProjectSetInfoVo jsonObject = data.get(vo.getDeptNo()); if (Common.isNotNull(data) && Common.isNotNull(data.get(vo.getDeptNo()))) {
if (null != jsonObject) { coverObject = data.get(vo.getDeptNo());
vo.setInvoiceTitle(Optional.ofNullable(jsonObject.getInvoiceTitleInsurance()).orElse("")); vo.setInvoiceTitle(Optional.ofNullable(coverObject.getInvoiceTitleInsurance()).orElse(""));
}
} }
util.convertEntityAsso(vo,null,null,null,allFields); util.convertEntityAsso(vo,null,null,null,allFields);
} }
......
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