| | |
| | | Template t = null; |
| | | try { |
| | | //捐献表.ftl为要装载的模板 |
| | | t = configuration.getTemplate("医学成本费用申请单.ftl"); |
| | | // t = configuration.getTemplate("医学成本费用申请单.ftl"); |
| | | t = configuration.getTemplate("办公费用申请单.ftl"); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | String newTime = String.valueOf(Calendar.getInstance().getTimeInMillis()); |
| | | String name = "医学成本费用申请单_" + dataMap.get("XM") + "_" + newTime; |
| | | // String name = "医学成本费用申请单_" + dataMap.get("XM") + "_" + newTime; |
| | | String name = "办公费用申请单_" + dataMap.get("XM") + "_" + newTime; |
| | | |
| | | //输出文档路径及名称 |
| | | File outFile = new File(RuoYiConfig.getProfile() + "/download/wordtemplate/" + name + ".doc"); |
| | |
| | | dataMap.put("BXDFJ", serviceFund.getAttachcount() == 0 ? " " : serviceFund.getAttachcount()); |
| | | dataMap.put("JXZXM", serviceFund.getDonorname() == null ? "" : serviceFund.getDonorname()); |
| | | dataMap.put("JSR", serviceFund.getUsername() == null ? "" : serviceFund.getUsername()); |
| | | dataMap.put("YWZ", serviceFund.getDeptmentname() == null ? "" : serviceFund.getDeptmentname()); |
| | | dataMap.put("ZHUZANG", serviceFund.getManagername() == null ? "" : serviceFund.getManagername()); |
| | | |
| | | for (ServiceFunddetail f : fd) { |
| | | seqno++; |
| | |
| | | map.put("FYXM", fyxm); |
| | | newList.add(map); |
| | | } |
| | | //合并单元格 |
| | | checkList(newList); |
| | | dataMap.put("items", newList); |
| | | |
| | | dataMap.put("JEXS", serviceFund.getPretaxcost()); |
| | |
| | | // dataMap.put("JEXS", serviceFund.getAmountrequested()); |
| | | // dataMap.put("JEDS", convert(serviceFund.getAmountrequested()) + "整"); |
| | | dataMap.put("BXBZ", serviceFund.getRemark() == null ? "" : serviceFund.getRemark()); |
| | | dataMap.put("YZ", serviceFund.getPresident() == null ? "" : serviceFund.getPresident()); |
| | | dataMap.put("CWFYZ", serviceFund.getFinvicepresident() == null ? "" : serviceFund.getFinvicepresident()); |
| | | dataMap.put("YWFYZ", serviceFund.getBusvicepresident() == null ? "" : serviceFund.getBusvicepresident()); |
| | | dataMap.put("BGSZR", serviceFund.getOfficedirector() == null ? "" : serviceFund.getOfficedirector()); |
| | | dataMap.put("CWBZR", serviceFund.getFinancedirector() == null ? "" : serviceFund.getFinancedirector()); |
| | | dataMap.put("CWSH", serviceFund.getFinancechecher() == null ? "" : serviceFund.getFinancechecher()); |
| | | |
| | | dataMap.put("YYMMDD", time); |
| | | dataMap.put("XM", serviceFund.getDonorname() == null ? "" : serviceFund.getDonorname()); |
| | |
| | | |
| | | } |
| | | |
| | | public List<Map<String, Object>> checkList(List<Map<String, Object>> list) { |
| | | String start = "<w:vMerge w:val='restart'/>"; |
| | | String end = "<w:vMerge/>"; |
| | | list.get(0).put("start", start); |
| | | for (int i = 1; i < list.size(); i++) { |
| | | list.get(i).put("end", end); |
| | | } |
| | | return list; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 下载费用报销单 |
| | | */ |