| | |
| | | TaxMoneyByItemEO taxMoneyVO = new TaxMoneyByItemEO(); |
| | | taxMoneyVO.setFirstDay(firstDay); |
| | | taxMoneyVO.setTaxTime(taxTime); |
| | | // 当前口径版本(v3):用于拦截同一月份内的其它口径记录,避免混算 |
| | | taxMoneyVO.setTaxVersion(VatTaxUtils.TAX_VERSION_CURRENT); |
| | | Map<String, TaxMoneySumEO> tempTaxSumMap = new HashMap<>(); |
| | | List<TaxMoneySumEO> taxSum = serviceFunddetailMapper.getTaxSum(taxMoneyVO); |
| | | if (CollectionUtils.isNotEmpty(taxSum)) { |
| | | for (TaxMoneySumEO taxMoneySumEO : taxSum) { |
| | | tempTaxSumMap.put(taxMoneySumEO.getIDCardNo(), taxMoneySumEO); |
| | | // 6. 当月已存在的历史口径(v1)记录会让累计基数新旧混算,直接阻止 |
| | | if (taxMoneySumEO.getV1Count() != null && taxMoneySumEO.getV1Count() > 0) { |
| | | throw new BaseException("当月已存在旧口径(v1)算税记录,为避免新旧口径混算," |
| | | + "本月请继续使用旧口径或从下个月起再按新口径算税。人员身份证号:" |
| | | // 6. 当月已存在其它口径(v1/v2…)的记录会让累计基数混算,直接阻止 |
| | | if (taxMoneySumEO.getOtherVersionCount() != null && taxMoneySumEO.getOtherVersionCount() > 0) { |
| | | throw new BaseException("当月已存在其它口径(" |
| | | + (taxMoneySumEO.getOtherVersion() == null ? "旧版本" : taxMoneySumEO.getOtherVersion()) |
| | | + ")的算税记录,为避免新旧口径混算,本月请继续使用原口径或从下个月起再按新口径算税。人员身份证号:" |
| | | + taxMoneySumEO.getIDCardNo()); |
| | | } |
| | | } |
| | |
| | | updateFundtax.setTaxamount(VatTaxUtils.roundMoney(taxTotal)); |
| | | updateFundtax.setTaxMoney(VatTaxUtils.roundMoney(taxTotal)); |
| | | updateFundtax.setTaxedamount(VatTaxUtils.roundMoney(taxedTotal)); |
| | | updateFundtax.setTaxVersion(VatTaxUtils.TAX_VERSION_V2); |
| | | updateFundtax.setTaxVersion(VatTaxUtils.TAX_VERSION_CURRENT); |
| | | updateFundtax.setIstax(1); |
| | | updateFundtax.setTaxedtime(taxTime); |
| | | serviceFundtaxMapper.updateById(updateFundtax); |