| | |
| | | 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; |
| | |
| | | import com.ruoyi.system.service.ISysNoticeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.security.core.parameters.P; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | return; |
| | | } |
| | | for (PlacementApplyRecord record : records) { |
| | | if(record.getChecks() == 1){ |
| | | if (record.getChecks() == 1) { |
| | | //已核对直接跳过 |
| | | continue; |
| | | } |
| | |
| | | if (count == 0) { |
| | | //安置表户主信息不存在 |
| | | record.setIdCardExistsWarn(1); |
| | | }else{ |
| | | } else { |
| | | record.setIdCardExistsWarn(0); |
| | | } |
| | | //判断户主是否重名 |
| | |
| | | BigDecimal waitFamilyArea = record.getWaitFamilyArea(); |
| | | // Integer currentCollectiveNum = record.getCurrentCollectiveNum(); |
| | | // Integer currentNoCollectiveNum = record.getCurrentNoCollectiveNum(); |
| | | boolean warn = compensateService.compensateSettleAreaCalculate(record.getOrgArea(),record.getNoOrgArea(), waitFamilyArea); |
| | | boolean warn = compensateService.compensateSettleAreaCalculate(record.getOrgArea(), record.getNoOrgArea(), waitFamilyArea); |
| | | if (warn) { |
| | | record.setWaitFamilyAreaWarn(0); |
| | | }else{ |
| | | } else { |
| | | record.setWaitFamilyAreaWarn(1); |
| | | } |
| | | |
| | | //赔偿金额(判断新购房还是二手房,这两个只能存在一个) |
| | | if (record.getCompensationNewAmount().compareTo(BigDecimal.ZERO) == 0 && |
| | | record.getCompensationOldAmount().compareTo(BigDecimal.ZERO) == 0) { |
| | | if (ObjUtil.isEmpty(record.getCompensationNewAmount()) && |
| | | ObjUtil.isEmpty(record.getCompensationOldAmount())) { |
| | | record.setCompensationAmountWarn(1); |
| | | }else{ |
| | | record.setCompensationAmountWarn(0); |
| | | } |
| | | if (record.getCompensationNewAmount().compareTo(BigDecimal.ZERO) > 0 && |
| | | record.getCompensationOldAmount().compareTo(BigDecimal.ZERO) > 0) { |
| | | } else if (ObjUtil.isNotEmpty(record.getCompensationNewAmount()) && |
| | | ObjUtil.isNotEmpty(record.getCompensationOldAmount())) { |
| | | record.setCompensationAmountWarn(1); |
| | | }else{ |
| | | record.setCompensationAmountWarn(0); |
| | |
| | | //过渡补贴 |
| | | if (compensateService.compensateSubsidyCalculate(record.getCurrentCount(), record.getSubsidyAmount())) { |
| | | record.setSubsidyAmountWarn(0); |
| | | }else{ |
| | | } else { |
| | | record.setSubsidyAmountWarn(1); |
| | | } |
| | | } |
| | |
| | | BigDecimal quarterPayAmount = (record.getCompensationSum().subtract(pay)).divide(new BigDecimal("20"), 10, RoundingMode.DOWN); |
| | | if (quarterPayAmount.compareTo(record.getQuarterPayAmount()) != 0) { |
| | | record.setQuarterPayAmountWarn(1); |
| | | }else{ |
| | | } else { |
| | | record.setQuarterPayAmountWarn(0); |
| | | } |
| | | |
| | | //首付款警告 |
| | | boolean downPaymentAmountWarn = true; |
| | | BigDecimal cateAmount = record.getCompensationSum().multiply(new BigDecimal("0.25")); |
| | | if(cateAmount.compareTo(record.getDownPaymentAmount()) == 0){ |
| | | if (cateAmount.compareTo(record.getDownPaymentAmount()) == 0) { |
| | | downPaymentAmountWarn = false; |
| | | } |
| | | record.setDownPaymentAmountWarn(downPaymentAmountWarn ? 1 : 0); |
| | |
| | | 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) { |