| | |
| | | import com.ruoyi.bussiness.service.*; |
| | | import com.ruoyi.bussiness.utils.BatchNumberUtils; |
| | | import com.ruoyi.bussiness.utils.PaymentCycleHelper; |
| | | 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; |
| | |
| | | FileUtils.setExcelResponseHeader(response, "问题数据.xlsx"); |
| | | //资金表 |
| | | if (request.getType() == 1) { |
| | | ExcelWriterBuilder write = EasyExcelFactory.write(response.getOutputStream(), AssetExportResponse.class); |
| | | Map<String, String> warnFieldToTarget = new HashMap<>(); |
| | | warnFieldToTarget.put("householdHeadWarn","householdHead"); |
| | | warnFieldToTarget.put("idCardWarn","idCard"); |
| | | warnFieldToTarget.put("twoPriceWarn","priceNewAmount"); |
| | | warnFieldToTarget.put("priceAmountWarn","priceNewAmount"); |
| | | warnFieldToTarget.put("compensationSumWarn","compensationAmount"); |
| | | warnFieldToTarget.put("downPaymentAmountWarn","downPaymentAmount"); |
| | | warnFieldToTarget.put("quarterPayAmountWarn","quarterPayAmount"); |
| | | warnFieldToTarget.put("subsidyAmountWarn","subsidyAmount"); |
| | | |
| | | Map<String, String> warnMessages = new HashMap<>(); |
| | | warnMessages.put("householdHeadWarn","户主未通过安置申请提示"); |
| | | warnMessages.put("idCardWarn","身份证不存在安置库"); |
| | | warnMessages.put("twoPriceWarn","多个购房情况警告"); |
| | | warnMessages.put("priceAmountWarn","补偿标准数据异常"); |
| | | warnMessages.put("compensationSumWarn","补偿总价异常"); |
| | | warnMessages.put("downPaymentAmountWarn","首付款警告"); |
| | | warnMessages.put("quarterPayAmountWarn","每季度需支付款项警告"); |
| | | warnMessages.put("subsidyAmountWarn","过渡补贴异常"); |
| | | |
| | | List<PlacementBatchAsset> assets = placementBatchAssetService.problemList(request); |
| | | List<AssetExportResponse> data = BeanUtil.copyToList(assets, AssetExportResponse.class); |
| | | |
| | | ExcelWriterBuilder write = EasyExcelFactory. |
| | | write(response.getOutputStream(), AssetExportResponse.class) |
| | | .registerWriteHandler(new CommentWriteHandler<>(data,warnFieldToTarget,warnMessages)); |
| | | write.sheet("sheet").doWrite(data); |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | } else { |
| | | ExcelWriterBuilder write = EasyExcelFactory.write(response.getOutputStream(), HouseholdExportResponse.class); |
| | | Map<String, String> warnFieldToTarget = new HashMap<>(); |
| | | warnFieldToTarget.put("householdHeadWarn","householdHead"); |
| | | warnFieldToTarget.put("idCardWarn","idCard"); |
| | | warnFieldToTarget.put("waitFamilyNamesWarn","waitFamilyNames"); |
| | | warnFieldToTarget.put("waitFamilyNamesNoWarn","waitFamilyNames"); |
| | | warnFieldToTarget.put("waitFamilyAreaWarn","waitFamilyArea"); |
| | | warnFieldToTarget.put("compensationAmountWarn","compensationNewAmount"); |
| | | warnFieldToTarget.put("compensationSumWarn","compensationSum"); |
| | | warnFieldToTarget.put("downPaymentAmountWarn","downPaymentAmount"); |
| | | warnFieldToTarget.put("quarterPayAmountWarn","quarterPayAmount"); |
| | | warnFieldToTarget.put("subsidyAmountWarn","subsidyAmount"); |
| | | |
| | | Map<String, String> warnMessages = new HashMap<>(); |
| | | warnMessages.put("householdHeadWarn","未通过安置申请警告"); |
| | | warnMessages.put("idCardWarn","身份证不存在安置库警告"); |
| | | warnMessages.put("waitFamilyNamesWarn","家庭成员重复"); |
| | | warnMessages.put("waitFamilyNamesNoWarn","待安置家庭成员不在安置库"); |
| | | warnMessages.put("waitFamilyAreaWarn","待安置人员应安置面积警告"); |
| | | warnMessages.put("compensationAmountWarn","多个购房情况警告"); |
| | | warnMessages.put("compensationSumWarn","补偿金额异常"); |
| | | warnMessages.put("downPaymentAmountWarn","首付款警告"); |
| | | warnMessages.put("quarterPayAmountWarn","每季度需支付款项"); |
| | | warnMessages.put("subsidyAmountWarn","过渡补贴异常"); |
| | | |
| | | //购房表 |
| | | List<PlacementBatchHousehold> households = placementBatchHouseholdService.problemList(request); |
| | | List<HouseholdExportResponse> data = BeanUtil.copyToList(households, HouseholdExportResponse.class); |
| | | |
| | | ExcelWriterBuilder write = EasyExcelFactory |
| | | .write(response.getOutputStream(), HouseholdExportResponse.class) |
| | | .registerWriteHandler(new CommentWriteHandler<>(data,warnFieldToTarget,warnMessages)); |
| | | write.sheet("sheet").doWrite(data); |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | } |