|  |  |  | 
|---|
|  |  |  | queryWrapper.eq(Taxes::getCompanyId,-1);//设置无效访问 | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | queryWrapper.in(Taxes::getCompanyId,user.getCompanyIdList()); | 
|---|
|  |  |  | queryWrapper.ge(pageWrap.getModel().getStartDate() != null,Taxes::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getStartDate())); | 
|---|
|  |  |  | queryWrapper.le(SignRecord::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getEndDate())); | 
|---|
|  |  |  | queryWrapper.ge(pageWrap.getModel().getStartDate() != null,Taxes::getCreateDate, pageWrap.getModel().getStartDate()); | 
|---|
|  |  |  | queryWrapper.le(pageWrap.getModel().getEndDate() != null,Taxes::getCreateDate, pageWrap.getModel().getEndDate()); | 
|---|
|  |  |  | queryWrapper.eq(pageWrap.getModel().getTaxBank() != null,Taxes::getTaxBank, pageWrap.getModel().getTaxBank()); | 
|---|
|  |  |  | queryWrapper.eq(pageWrap.getModel().getTaxBank() != null,Taxes::getTaxBank, pageWrap.getModel().getTaxBank()); | 
|---|
|  |  |  | queryWrapper.eq(pageWrap.getModel().getRemark() != null,Taxes::getRemark, pageWrap.getModel().getRemark()); | 
|---|
|  |  |  | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业用户无法进行该业务查询"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(!Objects.isNull(queryModel)){ | 
|---|
|  |  |  | queryWrapper.ge(pageWrap.getModel().getStartDate() != null,Taxes::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getStartDate())); | 
|---|
|  |  |  | queryWrapper.le(SignRecord::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getEndDate())); | 
|---|
|  |  |  | queryWrapper.ge(pageWrap.getModel().getStartDate() != null,Taxes::getCreateDate, (pageWrap.getModel().getStartDate())); | 
|---|
|  |  |  | queryWrapper.le(pageWrap.getModel().getEndDate() != null,Taxes::getCreateDate,  (pageWrap.getModel().getEndDate())); | 
|---|
|  |  |  | queryWrapper.eq(!Objects.isNull(queryModel.getInsuranceApplyId()),Taxes::getInsuranceApplyId,queryModel.getInsuranceApplyId()); | 
|---|
|  |  |  | queryWrapper.eq(!Objects.isNull(queryModel.getStatus()),Taxes::getStatus,queryModel.getStatus()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | .selectAll(InsuranceApply.class) | 
|---|
|  |  |  | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) | 
|---|
|  |  |  | .select(" ( select count(1) from apply_detail ad  where ad.apply_id = t.id ) as insureNum") | 
|---|
|  |  |  | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) | 
|---|
|  |  |  | .notExists(" select 1 from taxes t1 inner join tax_detial t2 on t1.id  = t2.tax_id where t2.type = 0 and t1.status != 2 and t.id = t2.INSURANCE_APPLY_ID  ") | 
|---|
|  |  |  | .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()) | 
|---|
|  |  |  | .eq(InsuranceApply::getId,id) | 
|---|
|  |  |  | 
|---|
|  |  |  | if(CollectionUtils.isNotEmpty(applyChangeList)){ | 
|---|
|  |  |  | for (ApplyChange applyChange:applyChangeList) { | 
|---|
|  |  |  | insuranceApply.setFee(insuranceApply.getFee().subtract(applyChange.getFee())); | 
|---|
|  |  |  | TaxesInvoicingVO taxesInvoicingVO = applyChange.getTaxesInvoicingVO(); | 
|---|
|  |  |  | TaxesInvoicingVO taxesInvoicingVO = applyChange.toTaxesInvoicingVO(); | 
|---|
|  |  |  | if(!Objects.isNull(insuranceApply)){ | 
|---|
|  |  |  | taxesInvoicingVO.setAmount(BigDecimal.ZERO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | || Objects.isNull(directInvoicingDTO.getInvoicingMoney()) | 
|---|
|  |  |  | || Objects.isNull(directInvoicingDTO.getType()) | 
|---|
|  |  |  | || Objects.isNull(directInvoicingDTO.getInvoicingDetailDTOList()) | 
|---|
|  |  |  | || StringUtils.isNotBlank(directInvoicingDTO.getAddress()) | 
|---|
|  |  |  | || StringUtils.isBlank(directInvoicingDTO.getAddress()) | 
|---|
|  |  |  | ){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.BAD_REQUEST); | 
|---|
|  |  |  | } | 
|---|