| | |
| | | if (CollectionUtils.isEmpty(serviceFunddetails)) { |
| | | throw new BaseException("算税条件为空,请检查后,再进行计算"); |
| | | } |
| | | // 用于临时保存已经算好的"费用详情数据" |
| | | List<ServiceFunddetail> temporarySave = new ArrayList<>(); |
| | | // 用于记录序号 |
| | | Map<String, Long> xhMap = new HashMap<>(); |
| | | |
| | | // 先对serviceFunddetails排序 |
| | | Comparator<ServiceFunddetail> customComparator = Comparator.comparing(obj -> { |
| | | if (ObjectUtils.isEmpty(obj.getTaxTime())) { |
| | |
| | | log.info("算税的fundid的值为:{}", fundid); |
| | | ServiceFund serviceFund1 = serviceFundMapper.selectById(fundid); |
| | | log.info("fund表的fundtextime值为:{}", serviceFund1.getFundtaxtime()); |
| | | |
| | | // //用于临时保存已经算好的"费用详情数据" |
| | | List<ServiceFunddetail> temporarySave = new ArrayList<>(); |
| | | //保存总税前金额(用于更新fund表里的) |
| | | BigDecimal pretaxcost = BigDecimal.valueOf(0.00); |
| | | BigDecimal taxedcost = BigDecimal.valueOf(0.00); |
| | | for (ServiceFunddetail serviceFunddetail : serviceFunddetails) { |
| | | if (serviceFunddetail.getBeneficiaryname().equals("吴康松")) { |
| | | System.out.println(serviceFunddetail); |
| | | } |
| | | if (StringUtils.isEmpty(serviceFunddetail.getIdcardno())) { |
| | | logger.info("serviceFunddetail数据入参 : {}", serviceFunddetail); |
| | | //如果身份证号为空,就不用查了,可能是医院的记录 |
| | |
| | | taxMoneyByItemEO.setFirstDay(firstDay); |
| | | taxMoneyByItemEO.setIDCard(serviceFunddetail.getIdcardno()); |
| | | taxMoneyByItemEO.setTaxTime(new Date()); |
| | | //根据条件获取表中该条数据的”序号“最大值 |
| | | Long maxXH = serviceFunddetailMapper.getMaxXH(taxMoneyByItemEO); |
| | | if (maxXH == null) { |
| | | maxXH = 0L; |
| | | maxXH = 1L; |
| | | } else { |
| | | maxXH = maxXH + 1; |
| | | } |
| | | //序号Map与数据库表里的xh同时不为空,那就以map里的为准 |
| | | if (ObjectUtils.isNotEmpty(xhMap)) { |
| | | Long xhValue = xhMap.get(serviceFunddetail.getIdcardno()); |
| | | if (xhValue != null) maxXH = xhValue + 1; |
| | | } |
| | | |
| | | TaxMoneyByItemEO taxMoneyVO = new TaxMoneyByItemEO(); |
| | |
| | | if (serviceFunddetail.getXh() != null) { |
| | | taxMoneyVO.setXh(serviceFunddetail.getXh()); |
| | | } else { |
| | | taxMoneyVO.setXh(maxXH + 1); |
| | | taxMoneyVO.setXh(maxXH); |
| | | xhMap.put(serviceFunddetail.getIdcardno(), maxXH); |
| | | } |
| | | //查出税前、税、税后的总额(不包含本次) |
| | | TaxMoneySumEO taxSum = serviceFunddetailMapper.getTaxSum(taxMoneyVO); |
| | |
| | | } |
| | | } |
| | | if (serviceFunddetail.getXh() == null) { |
| | | serviceFunddetail.setXh(maxXH + 1); |
| | | serviceFunddetail.setXh(maxXH); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(serviceFunddetail.getServicesscopename()) || !serviceFunddetail.getServicesscopename().contains("税后")) { |