| | |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.CompanyMapper; |
| | | import com.doumee.dao.business.SolutionsMapper; |
| | | import com.doumee.dao.business.TaxDetialMapper; |
| | | import com.doumee.dao.business.TaxesMapper; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dto.DirectInvoicingDTO; |
| | | import com.doumee.dao.business.dto.DirectInvoicingDetailDTO; |
| | | import com.doumee.dao.business.dto.EntrustInvoicingDTO; |
| | |
| | | private ApplyChangeJoinMapper applyChangeJoinMapper; |
| | | @Autowired |
| | | private SolutionsMapper solutionsMapper; |
| | | |
| | | @Autowired |
| | | private NoticesMapper noticesMapper; |
| | | @Override |
| | | public Integer create(Taxes taxes) { |
| | | taxesMapper.insert(taxes); |
| | |
| | | } |
| | | } |
| | | } |
| | | //存储待办信息 |
| | | Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.TAXES; |
| | | //删除其他待办 |
| | | noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()).eq(Notices::getObjId,model.getId())); |
| | | } |
| | | |
| | | private List<TaxDetial> getDetailListById(Integer id) { |
| | |
| | | queryWrapper.leftJoin(ApplyChange.class,ApplyChange::getId,TaxDetial::getApplyChangeId); |
| | | queryWrapper.leftJoin(Taxes.class,Taxes::getId,TaxDetial::getDelTaxId); |
| | | List<TaxDetial> detialList = taxDetailJoinMapper.selectJoinList(TaxDetial.class,queryWrapper.orderByAsc(TaxDetial::getType)); |
| | | |
| | | |
| | | return detialList; |
| | | } |
| | | |
| | |
| | | update.setDoneDate(update.getEditDate()); |
| | | update.setImgurl(taxes.getImgurl()); |
| | | taxesMapper.updateById(update); |
| | | |
| | | //存储待办信息 |
| | | Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.TAXES; |
| | | //删除其他待办 |
| | | noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()).eq(Notices::getObjId,taxes.getId())); |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | taxDetial.setType(Constants.ZERO); |
| | | } |
| | | taxDetailJoinMapper.insertBatchSomeColumn(taxDetialList); |
| | | |
| | | |
| | | //存储待办信息 |
| | | Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.TAXES; |
| | | //删除其他待办 |
| | | noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()).eq(Notices::getObjId,taxes.getId())); |
| | | Notices notices = new Notices(noticeObjectType,Constants.ZERO,taxes.getId(),taxes.getPrice().toString(), |
| | | taxes.getCompanyId(), Constants.NoticeType.ZERO); |
| | | noticesMapper.insert(notices); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | .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); |
| | | } |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"无可开票数据,操作失败"); |
| | | } |
| | | |
| | | //存储待办信息 |
| | | Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.TAXES; |
| | | //删除其他待办 |
| | | noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()).eq(Notices::getObjId,taxes.getId())); |
| | | Notices notices = new Notices(noticeObjectType,Constants.ZERO,taxes.getId(),taxes.getPrice().toString(), |
| | | taxes.getCompanyId(), Constants.NoticeType.ZERO); |
| | | noticesMapper.insert(notices); |
| | | |
| | | // List<DirectInvoicingDetailDTO> directInvoicingDetailDTOList = directInvoicingDTO.getDirectInvoicingDetailDTOList(); |
| | | // for (DirectInvoicingDetailDTO directInvoicingDetailDTO:directInvoicingDetailDTOList) { |
| | | // if(Objects.isNull(directInvoicingDetailDTO) |
| | | // || Objects.isNull(directInvoicingDetailDTO.getId()) |
| | | // || Objects.isNull(directInvoicingDetailDTO.getType()) |
| | | // || Objects.isNull(directInvoicingDetailDTO.getFee()) |
| | | // ){ |
| | | // throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | // } |
| | | // |
| | | // if(directInvoicingDetailDTO.getType().equals(Constants.ZERO)){ |
| | | // //保单 |
| | | // InsuranceApply insuranceApply = insuranceApplyJoinMapper.selectJoinOne(InsuranceApply.class, |
| | | // new MPJLambdaWrapper<InsuranceApply>() |
| | | // .selectAll(InsuranceApply.class) |
| | | // .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | // .select(" ( select count(1) from apply_detail ad where ad.apply_id = t.id ) as insureNum") |
| | | // .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,directInvoicingDetailDTO.getId()) |
| | | // ); |
| | | // if(Objects.isNull(insuranceApply)){ |
| | | // throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"保单号【"+insuranceApply.getCode()+"】未查询到保单信息"); |
| | | // } |
| | | // |
| | | // |
| | | // |
| | | // }else if(directInvoicingDetailDTO.getType().equals(Constants.ZERO)){ |
| | | // //加减保 |
| | | // }else{ |
| | | // //冲红单 |
| | | // } |
| | | // |
| | | // |
| | | // } |
| | | // taxDetailJoinMapper.insertBatchSomeColumn(taxDetialList); |
| | | } |
| | | |
| | | |