| | |
| | | import com.ruoyi.common.tax.TaxtUtils; |
| | | import com.ruoyi.project.domain.*; |
| | | import com.ruoyi.project.domain.vo.TaxMoneyVO; |
| | | import com.ruoyi.project.domain.vo.TaxedMoneyVO; |
| | | import com.ruoyi.project.mapper.ServiceFundMapper; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | return dataBybeneficiaryNo; |
| | | } |
| | | |
| | | /** |
| | | * 根据受益人编号获取税费金额 |
| | | * |
| | | * @param taxMoneyVo |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Double getTaxBeforeByBeneFiciaryNo(TaxMoneyVO taxMoneyVo) { |
| | | Double sum = 0.00; |
| | | Double totalScore = 0.00; |
| | | List<ServiceFunddetail> taxationByBeneFiciaryNo = serviceFunddetailMapper.getTaxBeforeByBeneFiciaryNo(taxMoneyVo); |
| | | if (CollectionUtils.isEmpty(taxationByBeneFiciaryNo) && taxMoneyVo.getMoney() == 0) { |
| | | //都为0了,就没有必要再计算了 |
| | | return 0.00; |
| | | if (CollectionUtils.isNotEmpty(taxationByBeneFiciaryNo)) { |
| | | //计算申请金额总和,不包括当前传进来的 |
| | | sum = taxationByBeneFiciaryNo.stream().mapToDouble(ServiceFunddetail::getAmount).sum(); |
| | | //不加本次薪酬的个税 |
| | | totalScore = taxationByBeneFiciaryNo.stream().mapToDouble(ServiceFunddetail::getTaxamount).sum(); |
| | | } |
| | | double sum = taxationByBeneFiciaryNo.stream().mapToDouble(ServiceFunddetail::getAmount).sum(); |
| | | |
| | | sum = sum + new Double(taxMoneyVo.getMoney()); |
| | | //加上本次薪酬的个税 |
| | | //加上本次薪酬的总个税 |
| | | String taxation = TaxtUtils.getTaxation(new BigDecimal(sum)); |
| | | //不加本次薪酬的个税 |
| | | Double totalScore = taxationByBeneFiciaryNo.stream().mapToDouble(ServiceFunddetail::getTaxamount).sum(); |
| | | |
| | | Double tax = Double.valueOf(taxation) - totalScore; |
| | | return tax; |
| | | } |
| | | |
| | | /** |
| | | * 根据税后工资,算出税前工资 |
| | | * |
| | | * @param money |
| | | * @return |
| | | */ |
| | | @Override |
| | | public TaxedMoneyVO getTaxBeforeByAfterMoney(TaxMoneyVO taxMoneyVo) { |
| | | TaxedMoneyVO taxedMoneyVO = new TaxedMoneyVO(); |
| | | Double sum = 0.00; |
| | | Double totalScore = 0.00; |
| | | List<ServiceFunddetail> taxationByBeneFiciaryNo = serviceFunddetailMapper.getTaxBeforeByBeneFiciaryNo(taxMoneyVo); |
| | | if (CollectionUtils.isNotEmpty(taxationByBeneFiciaryNo)) { |
| | | //计算出税后总金额(不包含本次) |
| | | sum = taxationByBeneFiciaryNo.stream().mapToDouble(ServiceFunddetail::getTaxedamount).sum(); |
| | | //求出之前的总的个税 |
| | | totalScore = taxationByBeneFiciaryNo.stream().mapToDouble(ServiceFunddetail::getTaxamount).sum(); |
| | | } |
| | | //计算出总的税后薪酬(包含本次) |
| | | sum = sum + taxMoneyVo.getMoney(); |
| | | //税前总金额 |
| | | String taxationBefore = TaxtUtils.getTaxationBefore(new BigDecimal(sum)); |
| | | //总个税 |
| | | BigDecimal tax = new BigDecimal(taxationBefore).subtract(new BigDecimal(sum)); |
| | | |
| | | //本次的税前金额 |
| | | String nowTaxMoney = TaxtUtils.getTaxationBefore(new BigDecimal(taxMoneyVo.getMoney())); |
| | | //本次的税费 |
| | | BigDecimal subtract = new BigDecimal(nowTaxMoney).subtract(new BigDecimal(taxMoneyVo.getMoney())); |
| | | |
| | | taxedMoneyVO.setAllTax(tax.toString()); |
| | | taxedMoneyVO.setAllTaxbeforeMoney(taxationBefore); |
| | | taxedMoneyVO.setAllAaxAfterMoney(sum.toString()); |
| | | taxedMoneyVO.setNowTaxBeforeMoney(nowTaxMoney); |
| | | taxedMoneyVO.setNowTax(subtract.toString()); |
| | | |
| | | return taxedMoneyVO; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<ServiceFunddetail> getAllDetailsByFDIDLW(Long id) { |