| | |
| | | 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.StringUtils; |
| | | import com.ruoyi.common.utils.bean.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.project.domain.*; |
| | |
| | | import freemarker.template.TemplateException; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.ibatis.annotations.Options; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.*; |
| | |
| | | * @author ruoyi |
| | | * @date 2022-01-24 |
| | | */ |
| | | @Slf4j |
| | | @Api("费用申请主") |
| | | @RestController |
| | | @RequestMapping("/project/fund") |
| | |
| | | */ |
| | | @ApiOperation("新增费用汇总") |
| | | @Log(title = "新增费用汇总", businessType = BusinessType.INSERT) |
| | | @PostMapping("/addnew") |
| | | @PostMapping("/addOrUpdateNew") |
| | | @RepeatSubmit |
| | | @Options(useGeneratedKeys = true, keyProperty = "id") |
| | | public AjaxResult addnew(@RequestBody ServiceFundVO serviceFundVO) { |
| | | boolean b = serviceFundService.save(serviceFundVO); |
| | | Long id = serviceFundVO.getId(); |
| | | // if (b) { |
| | | // addReiSharedDatd(serviceFundVO, 1); |
| | | // } |
| | | List<ServiceFunddetail> serviceFunddetails = serviceFundVO.getServiceFunddetails(); |
| | | serviceFunddetails.forEach(item -> item.setFundid(id)); |
| | | serviceFunddetailService.saveBatch(serviceFunddetails); |
| | | return AjaxResult.success(id); |
| | | public AjaxResult addOrUpdateNew(@RequestBody ServiceFundVO serviceFundVO) { |
| | | |
| | | return AjaxResult.success(serviceFundService.addOrUpdateNew(serviceFundVO)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 审核费用 |
| | |
| | | |
| | | |
| | | /** |
| | | * 修改费用申请主 |
| | | * 修改费用申请 |
| | | */ |
| | | @ApiOperation("修改费用申请主") |
| | | //@PreAuthorize("@ss.hasPermi('project:fund:edit')") |
| | | @ApiOperation("修改费用申请") |
| | | @Log(title = "费用申请主", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | @PostMapping("/fundEdit") |
| | | @RepeatSubmit |
| | | public AjaxResult edit(@RequestBody ServiceFund serviceFund) { |
| | | List<ServiceFund> infoByInfoIdList = serviceFundService.getInfoByInfoId(serviceFund.getId()); |
| | | public AjaxResult fundEdit(@RequestBody ServiceFund serviceFund) { |
| | | log.info("修改费用申请入参:{}", serviceFund); |
| | | List<ServiceFund> infoByInfoIdList = serviceFundService.queryInfoById(serviceFund); |
| | | log.info("修改费用申请,通过入参查询 serviceFundService.queryInfoById数据为空,入参:{}", infoByInfoIdList.size()); |
| | | if (CollectionUtils.isEmpty(infoByInfoIdList)) { |
| | | return toAjax(false); |
| | | } |
| | | for (ServiceFund sf : infoByInfoIdList) { |
| | | //如果等于100,说明已经走到医院财务那边了;财务那边取数据是从分享表取,所以,这里直接往分享表里添加数据就行了 |
| | | if (sf.getBackflowlevel() == 100 || sf.getBackflowlevel() == 199) { |
| | |
| | | } else { |
| | | serviceFund.setFlowlevel(sf.getBackflowlevel()); |
| | | boolean bret = serviceFundService.updateById(serviceFund); |
| | | log.info("serviceFundService.updateById返参:{}", bret); |
| | | // if (bret) { |
| | | // addReiSharedDatd(serviceFund, 2); |
| | | // } |
| | |
| | | dataMap.put("JXZXM", serviceFund.getDonorname() == null ? "" : serviceFund.getDonorname()); |
| | | dataMap.put("JSR", serviceFund.getUsername() == null ? "" : serviceFund.getUsername()); |
| | | // dataMap.put("FYXM1", "支付专家费用,其中税前金额" + serviceFund.getPretaxcost() + "元,税后金额" + serviceFund.getTaxedcost() + "元。"); |
| | | dataMap.put("FYXM1", "人体器官捐献专家劳务费:" + serviceFund.getTaxedcost() + "元 (其中税后费用由中心承担税费)。"); |
| | | dataMap.put("FYXM1", "人体器官捐献专家劳务费:" + serviceFund.getPretaxcost() + "元 (其中税后费用由中心承担税费)。"); |
| | | dataMap.put("FYXM2", ""); |
| | | dataMap.put("FYXM3", ""); |
| | | dataMap.put("JEXS", serviceFund.getAmountrequested()); |
| | | dataMap.put("JEDS", convert(serviceFund.getAmountrequested()) + "整"); |
| | | dataMap.put("JEXS", serviceFund.getPretaxcost()); |
| | | dataMap.put("JEDS", convert(serviceFund.getPretaxcost()) + "整"); |
| | | dataMap.put("BXBZ", serviceFund.getRemark() == null ? "" : serviceFund.getRemark()); |
| | | |
| | | |
| | |
| | | List<Double> sqljList = new ArrayList<>(); |
| | | List<Double> ksljList = new ArrayList<>(); |
| | | List<Double> shljList = new ArrayList<>(); |
| | | Map<String, Optional<ServiceFunddetailAssort>> result = fd.stream().collect(Collectors.groupingBy(ServiceFunddetail::getSubjecttypename, Collectors.mapping(obj -> new ServiceFunddetailAssort(obj.getAmount(), obj.getTaxamount(), obj.getTaxedamount()), Collectors.reducing(ServiceFunddetailAssort::add)))); |
| | | result.forEach((FWFL, serviceFunddetailAssort) -> { |
| | | |
| | | //根据”科目类型名称“,来计算税前总和,税金总和,税后总和 |
| | | Map<String, ServiceFunddetailAssort> funddetailMap = new HashMap<>(); |
| | | for (ServiceFunddetail serviceFunddetail : fd) { |
| | | boolean b = funddetailMap.containsKey(serviceFunddetail.getSubjecttypename()); |
| | | if (b == true) { |
| | | ServiceFunddetailAssort serviceFunddetailAssort = funddetailMap.get(serviceFunddetail.getSubjecttypename()); |
| | | serviceFunddetailAssort.setKSXJ(serviceFunddetailAssort.getKSXJ() + serviceFunddetail.getTaxamount()); |
| | | serviceFunddetailAssort.setSQXJ(serviceFunddetailAssort.getSQXJ() + serviceFunddetail.getAmount()); |
| | | serviceFunddetailAssort.setSHXJ(serviceFunddetailAssort.getSHXJ() + serviceFunddetail.getTaxedamount()); |
| | | } else { |
| | | funddetailMap.put(serviceFunddetail.getSubjecttypename(), new ServiceFunddetailAssort()); |
| | | ServiceFunddetailAssort serviceFunddetailAssort = funddetailMap.get(serviceFunddetail.getSubjecttypename()); |
| | | serviceFunddetailAssort.setKSXJ(serviceFunddetailAssort.getKSXJ() + serviceFunddetail.getTaxamount()); |
| | | serviceFunddetailAssort.setSQXJ(serviceFunddetailAssort.getSQXJ() + serviceFunddetail.getAmount()); |
| | | serviceFunddetailAssort.setSHXJ(serviceFunddetailAssort.getSHXJ() + serviceFunddetail.getTaxedamount()); |
| | | } |
| | | } |
| | | |
| | | funddetailMap.forEach((FWFL, serviceFunddetailAssort) -> { |
| | | Map<String, Object> map1 = new HashMap<String, Object>(); |
| | | map1.put("FWFL", FWFL); |
| | | map1.put("SQXJ", serviceFunddetailAssort.get().getSQXJ()); |
| | | map1.put("KSXJ", serviceFunddetailAssort.get().getKSXJ()); |
| | | map1.put("SHXJ", serviceFunddetailAssort.get().getSHXJ()); |
| | | sqljList.add(serviceFunddetailAssort.get().getSQXJ()); |
| | | ksljList.add(serviceFunddetailAssort.get().getKSXJ()); |
| | | shljList.add(serviceFunddetailAssort.get().getSHXJ()); |
| | | map1.put("SQXJ", serviceFunddetailAssort.getSQXJ()); |
| | | map1.put("KSXJ", serviceFunddetailAssort.getKSXJ()); |
| | | map1.put("SHXJ", serviceFunddetailAssort.getSHXJ()); |
| | | sqljList.add(serviceFunddetailAssort.getSQXJ()); |
| | | ksljList.add(serviceFunddetailAssort.getKSXJ()); |
| | | shljList.add(serviceFunddetailAssort.getSHXJ()); |
| | | lists.add(map1); |
| | | }); |
| | | |
| | |
| | | dataMap.put("list", newsList); |
| | | for (int i = 0; i < lists.size(); i++) { |
| | | Map<String, Object> map = lists.get(i); |
| | | map.put("XH", i+1); |
| | | map.put("XH", i + 1); |
| | | } |
| | | |
| | | dataMap.put("item", lists); |