| | |
| | | import com.ruoyi.bussiness.object.response.placementApply.*; |
| | | import com.ruoyi.bussiness.service.*; |
| | | import com.ruoyi.bussiness.utils.BatchNumberUtils; |
| | | import com.ruoyi.common.easyExcel.CommentWriteHandler; |
| | | import com.ruoyi.common.exception.GlobalException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | |
| | | List<PlacementApplyRecord> applyRecords = placementApplyRecordService.problemList(request); |
| | | List<ProblemExportResponse> data = BeanUtil.copyToList(applyRecords, ProblemExportResponse.class); |
| | | |
| | | Map<String, String> warnFieldToTarget = new HashMap<>(); |
| | | warnFieldToTarget.put("idCardExistsWarn","idCard"); |
| | | warnFieldToTarget.put("idCardNoWarn","idCard"); |
| | | warnFieldToTarget.put("waitFamilyNamesWarn","waitFamilyNames"); |
| | | warnFieldToTarget.put("waitFamilyNamesNoWarn","waitFamilyNames"); |
| | | warnFieldToTarget.put("waitFamilyAreaWarn","waitFamilyArea"); |
| | | warnFieldToTarget.put("compensationAmountWarn","compensationNewAmount"); |
| | | warnFieldToTarget.put("compensationSumWarn","compensationSum"); |
| | | warnFieldToTarget.put("quarterPayAmountWarn","quarterPayAmount"); |
| | | warnFieldToTarget.put("subsidyAmountWarn","subsidyAmount"); |
| | | |
| | | |
| | | |
| | | Map<String, String> warnMessages = new HashMap<>(); |
| | | warnMessages.put("idCardExistsWarn","身份证不在安置库警告"); |
| | | warnMessages.put("idCardNoWarn","身份证重复提醒警告"); |
| | | warnMessages.put("waitFamilyNamesWarn","待安置家庭成员重复"); |
| | | warnMessages.put("waitFamilyNamesNoWarn","待安置家庭成员不在安置库"); |
| | | warnMessages.put("waitFamilyAreaWarn","应补偿面积数据异常警告"); |
| | | warnMessages.put("compensationAmountWarn","多个购房活动警告"); |
| | | warnMessages.put("compensationSumWarn","补偿金额异常"); |
| | | warnMessages.put("downPaymentAmountWarn","首付款警告"); |
| | | warnMessages.put("quarterPayAmountWarn","每季度需支付款项"); |
| | | warnMessages.put("subsidyAmountWarn","过渡补贴异常"); |
| | | |
| | | FileUtils.setExcelResponseHeader(response, "问题数据.xlsx"); |
| | | ExcelWriterBuilder write = EasyExcelFactory.write(response.getOutputStream(), ProblemExportResponse.class); |
| | | ExcelWriterBuilder write = EasyExcelFactory.write(response.getOutputStream(), |
| | | ProblemExportResponse.class) |
| | | .registerWriteHandler(new CommentWriteHandler<>(data,warnFieldToTarget,warnMessages)); |
| | | write.sheet("sheet").doWrite(data); |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | } catch (Exception e) { |