| | |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.tax.TaxtUtils; |
| | | import com.ruoyi.common.utils.bean.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.project.domain.*; |
| | |
| | | // addReiSharedDatd(serviceFundVO, 1); |
| | | // } |
| | | List<ServiceFunddetail> serviceFunddetails = serviceFundVO.getServiceFunddetails(); |
| | | serviceFunddetails.forEach(item -> item.setFundid(id)); |
| | | // serviceFunddetails.forEach(item -> item.setFundid(id)); |
| | | for (ServiceFunddetail serviceFunddetail : serviceFunddetails) { |
| | | serviceFunddetail.setFundid(id); |
| | | if (!serviceFunddetail.getTaxedamount().equals(Double.NaN) && !serviceFunddetail.getAmount().equals(Double.NaN)) { |
| | | // 税前税后都不为空 |
| | | continue; |
| | | } else if (!serviceFunddetail.getTaxedamount().equals(Double.NaN)) { |
| | | // 税后求税前 |
| | | Double taxationBefore = Double.valueOf(TaxtUtils.getTaxationBefore(BigDecimal.valueOf(serviceFunddetail.getTaxedamount()))); |
| | | // 税金 |
| | | String taxation = TaxtUtils.getTaxation(BigDecimal.valueOf(taxationBefore)); |
| | | serviceFunddetail.setAmount(Double.valueOf(taxationBefore)); |
| | | serviceFunddetail.setTaxamount(Double.parseDouble(taxation)); |
| | | } else if (!serviceFunddetail.getAmount().equals(Double.NaN)) { |
| | | // 税前求税后 |
| | | double tax = Double.parseDouble(TaxtUtils.getTaxation(BigDecimal.valueOf(serviceFunddetail.getAmount()))); |
| | | BigDecimal taxAfterMoney = BigDecimal.valueOf(serviceFunddetail.getAmount()).subtract(BigDecimal.valueOf(tax)); |
| | | serviceFunddetail.setTaxamount(tax); |
| | | serviceFunddetail.setTaxedamount(taxAfterMoney.doubleValue()); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | serviceFunddetailService.saveBatch(serviceFunddetails); |
| | | return AjaxResult.success(id); |
| | | } |
| | |
| | | @PutMapping |
| | | @RepeatSubmit |
| | | public AjaxResult edit(@RequestBody ServiceFund serviceFund) { |
| | | List<ServiceFund> infoByInfoIdList = serviceFundService.getInfoByInfoId(serviceFund.getId()); |
| | | List<ServiceFund> infoByInfoIdList = serviceFundService.getInfoByInfoId(serviceFund.getInfoid()); |
| | | for (ServiceFund sf : infoByInfoIdList) { |
| | | //如果等于100,说明已经走到医院财务那边了;财务那边取数据是从分享表取,所以,这里直接往分享表里添加数据就行了 |
| | | if (sf.getBackflowlevel() == 100 || sf.getBackflowlevel() == 199) { |