| | |
| | | import org.apache.commons.lang.StringUtils; |
| | | 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.*; |
| | |
| | | public TableDataInfo list(ServiceReimbursement serviceReimbursement) { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | serviceReimbursement.setCreateBy(user.getUserName()); |
| | | serviceReimbursement.setUsername(user.getNickName()); |
| | | startPage(); |
| | | List<ServiceReimbursement> list = serviceReimbursementService.queryList(serviceReimbursement); |
| | | return getDataTable(list); |
| | |
| | | } |
| | | //startPage(); |
| | | List<SpFinancialExpensesReimbursementOut> list = serviceReimbursementService.getListBypower(loginUser.getUsername(), 1, APPLICANT, APPLICATIONBEGTIME, APPLICATIONENDTIME, loginUser.getDeptId().toString(), CHECKFLAG, APPLYTYPE); |
| | | //根据经办人筛选 |
| | | if (StringUtils.isNotBlank(spFinancialExpensesIn.getUsername())) { |
| | | list = list.stream().filter(reimbursementOut -> reimbursementOut.getUsername().contains(spFinancialExpensesIn.getUsername())).collect(Collectors.toList()); // 按name字段过滤 |
| | | } |
| | | //根据金额筛选 |
| | | if (spFinancialExpensesIn.getMoney() != null) { |
| | | list = list.stream().filter(reimbursementOut -> new BigDecimal(reimbursementOut.getAmountrequested()) == new BigDecimal(spFinancialExpensesIn.getMoney())).collect(Collectors.toList()); |
| | | } |
| | | //根据创建时间排序 |
| | | Collections.sort(list, new Comparator<SpFinancialExpensesReimbursementOut>() { |
| | | @Override |
| | | public int compare(SpFinancialExpensesReimbursementOut o1, SpFinancialExpensesReimbursementOut o2) { |
| | |
| | | } |
| | | |
| | | } |
| | | //001审批通过之后,就需要把“办公室主任”的名字填上 |
| | | if (checkFundVO.getFlowconclusion() == 1 && user.getUserId().equals("001")) { |
| | | serviceReimbursement.setOfficedirector(user.getNickName()); |
| | | } |
| | | |
| | | serviceReimbursementService.updateById(serviceReimbursement); |
| | | |
| | |
| | | Map dataMap = new HashMap(); |
| | | getData(dataMap, id); |
| | | String filePath = getClass().getResource("/template/").getPath(); |
| | | log.info("下载地址是啥???{}", filePath); |
| | | System.out.println(filePath); |
| | | //设置模本装置方法和路径,FreeMarker支持多种模板装载方法。可以重servlet,classpath,数据库教程装载, |
| | | configuration.setDirectoryForTemplateLoading(new File(filePath)); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | String newTime = String.valueOf(Calendar.getInstance().getTimeInMillis()); |
| | | String name = "差旅费报销申请单_" + dataMap.get("XM") + "_" + newTime; |
| | | String name = "差旅费报销申请单_" + dataMap.get("JSR") + "_" + newTime; |
| | | |
| | | //输出文档路径及名称 |
| | | File outFile = new File(RuoYiConfig.getProfile() + "/download/wordtemplate/" + name + ".doc"); |
| | |
| | | ServiceReimbursementEo serviceReimbursementEo = new ServiceReimbursementEo(); |
| | | serviceReimbursementEo.setId(id); |
| | | List<ServiceReimbursementEo> rdInfoByItem = serviceReimbursementService.getRDInfoByItem(serviceReimbursementEo); |
| | | log.info("rdInfoByItem是否为空 :{}", CollectionUtils.isEmpty(rdInfoByItem) ? null : rdInfoByItem.size()); |
| | | for (int i = 0; i < rdInfoByItem.size(); i++) { |
| | | ServiceReimbursementEo serviceReimbursementEo1 = rdInfoByItem.get(i); |
| | | String codeByInfo = PersonType.getCodeByInfo(serviceReimbursementEo1.getPersontype()); |
| | | serviceReimbursementEo1.setPersontype(codeByInfo); |
| | | } |
| | | //获取报销支付信息 |
| | | List<ServiceReimbursementpayee> reimbursementpayeeInfo = reimbursementpayeeService.getReimbursementpayeeInfo(serviceReimbursementEo); |
| | | |
| | | log.info("reimbursementpayeeInfo是否为空 :{}", CollectionUtils.isEmpty(reimbursementpayeeInfo) ? null : reimbursementpayeeInfo.size()); |
| | | Map<String, List<ServiceReimbursementEo>> listMap = rdInfoByItem.stream().collect(Collectors.groupingBy(ServiceReimbursementEo::getPersontype)); |
| | | List<Map<String, BigDecimal>> list = new ArrayList<>(); |
| | | StringBuffer FYXM1 = new StringBuffer(); |
| | |
| | | BigDecimal keyOneMoney = new BigDecimal(0.00); |
| | | BigDecimal keyTwoMoney = new BigDecimal(0.00); |
| | | for (ServiceReimbursementEo serviceReimbursementEo1 : values) { |
| | | otherMoney = otherMoney.add(serviceReimbursementEo1.getTrafficexpense()).add(serviceReimbursementEo1.getHotelexpense()).add(serviceReimbursementEo1.getFoodexpenses()).add(serviceReimbursementEo1.getFoodallowance()).add(serviceReimbursementEo1.getOtherexpense()).add(serviceReimbursementEo1.getOtherfeeamount()); |
| | | otherMoney = otherMoney.add(serviceReimbursementEo1.getTrafficexpense()).add(serviceReimbursementEo1.getHotelexpense()).add(serviceReimbursementEo1.getCityfee()).add(serviceReimbursementEo1.getFoodexpenses()).add(serviceReimbursementEo1.getFoodallowance()).add(serviceReimbursementEo1.getOtherexpense()).add(serviceReimbursementEo1.getOtherfeeamount()); |
| | | } |
| | | map.put(key, otherMoney); |
| | | list.add(map); |
| | |
| | | } |
| | | dataMap.put("BXBZ", remark); |
| | | |
| | | dataMap.put("ZXFZR", StringUtils.isEmpty(rdInfoByItem.get(0).getOpochecker()) ? "" : rdInfoByItem.get(0).getOpochecker()); |
| | | // |
| | | dataMap.put("CWFYZ", StringUtils.isEmpty(rdInfoByItem.get(0).getFinvicepresident()) ? "" : rdInfoByItem.get(0).getFinvicepresident()); |
| | | dataMap.put("YWFYZ", StringUtils.isEmpty(rdInfoByItem.get(0).getBusvicepresident()) ? "" : rdInfoByItem.get(0).getBusvicepresident()); |
| | | dataMap.put("BGSZR", StringUtils.isEmpty(rdInfoByItem.get(0).getOfficedirector()) ? "" : rdInfoByItem.get(0).getOfficedirector()); |
| | | dataMap.put("CWBZR", StringUtils.isEmpty(rdInfoByItem.get(0).getFinancedirector()) ? "" : rdInfoByItem.get(0).getFinancedirector()); |
| | | dataMap.put("CWSH", StringUtils.isEmpty(rdInfoByItem.get(0).getFinancechecher()) ? "" : rdInfoByItem.get(0).getFinancechecher()); |
| | | |
| | | |
| | | dataMap.put("YYMMDD", time); |
| | | |