|
@@ -9,6 +9,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.exception.JeecgBootException;
|
|
|
+import org.jeecg.common.util.DictAnnotationUtil;
|
|
|
import org.jeecg.common.util.idCard.ChineseIdCard18Utils;
|
|
|
import org.jeecg.common.util.idCard.Gender;
|
|
|
import org.jeecg.modules.system.app.dto.insureOrder.FindInsureOrderPageRequestDTO;
|
|
@@ -48,6 +49,7 @@ public class InsureOrderInfoServiceImpl extends ServiceImpl<InsureOrderInfoMappe
|
|
|
@Override
|
|
|
public Result<IPage<FindInsureOrderPageResponseDTO>> findPage(FindInsureOrderPageRequestDTO findInsureOrderPageRequestDTO) {
|
|
|
getFindInsureOrderPageRequestDTO(findInsureOrderPageRequestDTO);
|
|
|
+ DictAnnotationUtil.translateDict(findInsureOrderPageRequestDTO);
|
|
|
Page<FindInsureOrderPageResponseDTO> page = new Page<FindInsureOrderPageResponseDTO>(findInsureOrderPageRequestDTO.getPageNo(), findInsureOrderPageRequestDTO.getPageSize());
|
|
|
IPage<FindInsureOrderPageResponseDTO> findInsureOrderPageResponseDTOIPage = insureOrderInfoMapper.findPage(page, findInsureOrderPageRequestDTO);
|
|
|
if (findInsureOrderPageResponseDTOIPage!=null&&findInsureOrderPageResponseDTOIPage.getRecords()!=null){
|
|
@@ -56,7 +58,7 @@ public class InsureOrderInfoServiceImpl extends ServiceImpl<InsureOrderInfoMappe
|
|
|
record.setIdentityCard(desensitization);
|
|
|
}
|
|
|
}
|
|
|
- return Result.ok();
|
|
|
+ return Result.ok(findInsureOrderPageResponseDTOIPage);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -74,11 +76,12 @@ public class InsureOrderInfoServiceImpl extends ServiceImpl<InsureOrderInfoMappe
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void exportXls(HttpServletRequest request, HttpServletResponse response, FindInsureOrderPageRequestDTO findInsureOrderPageRequestDTO, String fileName) {
|
|
|
+ public void exportXls(HttpServletRequest request, HttpServletResponse response, FindInsureOrderPageRequestDTO findInsureOrderPageRequestDTO) {
|
|
|
String timestamp = String.valueOf(System.currentTimeMillis());
|
|
|
- String outputFilename = "被保险人清单_" + timestamp ;
|
|
|
+ DictAnnotationUtil.translateDict(findInsureOrderPageRequestDTO);
|
|
|
+ String outputFilename = findInsureOrderPageRequestDTO.getInsureCompany_dictText() +"保险订单_被保险人清单_" + timestamp ;
|
|
|
List<FindInsureOrderPageResponseDTO> byList = insureOrderInfoMapper.findByList(findInsureOrderPageRequestDTO);
|
|
|
- writeToExcel(byList,response,outputFilename);
|
|
|
+ writeToExcel(byList,response,outputFilename,findInsureOrderPageRequestDTO.getInsureCompany());
|
|
|
}
|
|
|
|
|
|
|
|
@@ -91,7 +94,7 @@ public class InsureOrderInfoServiceImpl extends ServiceImpl<InsureOrderInfoMappe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void writeToExcel(List<FindInsureOrderPageResponseDTO> persons,HttpServletResponse response, String outputFilename ) throws JeecgBootException {
|
|
|
+ public void writeToExcel(List<FindInsureOrderPageResponseDTO> persons,HttpServletResponse response, String outputFilename,Integer insureCompany ) throws JeecgBootException {
|
|
|
|
|
|
setResponseHeaders(response, outputFilename);
|
|
|
// 参数校验
|
|
@@ -112,7 +115,14 @@ public class InsureOrderInfoServiceImpl extends ServiceImpl<InsureOrderInfoMappe
|
|
|
FindInsureOrderPageResponseDTO person = persons.get(i);
|
|
|
validatePersonData(person);
|
|
|
Row row = sheet.createRow( startRowNum+ i);
|
|
|
- writePersonRow(row, person, i + 1,cellStyles); // 序号从1开始
|
|
|
+ if (insureCompany==1){
|
|
|
+ writePersonRow(row, person, i + 1,cellStyles); // 序号从1开始
|
|
|
+ } else if (false) {
|
|
|
+
|
|
|
+ }else {
|
|
|
+ writePersonRow(row, person, i + 1,cellStyles); // 序号从1开始
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
workbook.write(out);
|
|
|
out.flush();
|