| | |
| | | private IServiceReimbursementService serviceReimbursementService; |
| | | |
| | | @Autowired |
| | | private IServiceSystemmessageService ServiceSystemmessage; |
| | | private IServiceSystemmessageService iServiceSystemmessageService; |
| | | |
| | | @Autowired |
| | | private IServiceExternalpersonService externalpersonService; |
| | |
| | | * 查询费用申请主列表 |
| | | */ |
| | | @ApiOperation("查询费用申请主列表") |
| | | //@PreAuthorize("@ss.hasPermi('project:fund:list')") |
| | | //// @PreAuthorize("@ss.hasPermi('project:fund:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ServiceFund serviceFund) { |
| | | startPage(); |
| | |
| | | Collections.sort(list, new Comparator<SpFinancialExpensesFundOut>() { |
| | | @Override |
| | | public int compare(SpFinancialExpensesFundOut o1, SpFinancialExpensesFundOut o2) { |
| | | return o1.getCreateTime().compareTo(o2.getCreateTime()); |
| | | return o1.getApplyTime().compareTo(o2.getApplyTime()); |
| | | } |
| | | }); |
| | | return getCustomDataTable(list, pageNum, pageSize); |
| | |
| | | } |
| | | |
| | | @ApiOperation("查询费用申请主列表") |
| | | //@PreAuthorize("@ss.hasPermi('project:fund:list')") |
| | | //// @PreAuthorize("@ss.hasPermi('project:fund:list')") |
| | | @GetMapping(value = "/getInfo/{infoid}") |
| | | public AjaxResult getInfoByInfoId(@PathVariable("infoid") Long infoid) { |
| | | return AjaxResult.success(serviceFundService.getInfoByInfoId(infoid)); |
| | |
| | | * 导出费用申请主列表 |
| | | */ |
| | | @ApiOperation("导出费用申请主列表") |
| | | //@PreAuthorize("@ss.hasPermi('project:fund:export')") |
| | | //// @PreAuthorize("@ss.hasPermi('project:fund:export')") |
| | | @Log(title = "费用申请主", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export") |
| | | public AjaxResult export(ServiceFund serviceFund) { |
| | |
| | | * 获取费用申请主详细信息 |
| | | */ |
| | | @ApiOperation("获取费用申请主详细信息") |
| | | //@PreAuthorize("@ss.hasPermi('project:fund:query')") |
| | | //// @PreAuthorize("@ss.hasPermi('project:fund:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | return AjaxResult.success(serviceFundService.getById(id)); |
| | |
| | | * 新增费用申请主 |
| | | */ |
| | | @ApiOperation("新增费用申请主") |
| | | //@PreAuthorize("@ss.hasPermi('project:fund:add')") |
| | | //// @PreAuthorize("@ss.hasPermi('project:fund:add')") |
| | | @Log(title = "费用申请主", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @RepeatSubmit |
| | |
| | | Boolean aBoolean = serviceFundflowService.saveData(serviceFundflow); |
| | | log.info("sserviceFund保存的的值是-------- :{}", aBoolean); |
| | | |
| | | //001审批通过之后,就需要把“办公室主任”的名字填上 |
| | | if (checkFundVO.getFlowconclusion() == 1 && user.getUserName().equals("001")) { |
| | | //053审批通过之后,就需要把“办公室主任”的名字填上 |
| | | if (checkFundVO.getFlowconclusion() == 1 && user.getUserName().equals("053")) { |
| | | serviceFund.setOfficedirector(user.getNickName()); |
| | | serviceFund.setUploadStates(1); |
| | | } |
| | |
| | | serviceSystemmessage.setMessagecontent("您" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceFund.getCreateTime()) + "提交的绩效申请已驳回,原因: " + checkFundVO.getFlowcontent() + ""); |
| | | } |
| | | } |
| | | ServiceSystemmessage.save(serviceSystemmessage); |
| | | iServiceSystemmessageService.save(serviceSystemmessage); |
| | | return AjaxResult.success(); |
| | | } else { |
| | | return AjaxResult.error(HttpStatus.NO_CONTENT, "费用编号不正确"); |
| | |
| | | * 删除费用申请主 |
| | | */ |
| | | @ApiOperation("删除费用申请主") |
| | | //@PreAuthorize("@ss.hasPermi('project:fund:remove')") |
| | | //// @PreAuthorize("@ss.hasPermi('project:fund:remove')") |
| | | @Log(title = "费用申请主", businessType = BusinessType.DELETE) |
| | | @GetMapping("/remove/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) { |
| | |
| | | @GetMapping(value = "/downloadLW/{id}") |
| | | public Map downloadInfoLW(@PathVariable("id") Long id) throws IOException { |
| | | Map dataMap = new HashMap(); |
| | | getDataLW(dataMap, id); |
| | | String dataLW = getDataLW(dataMap, id); |
| | | String filePath = getClass().getResource("/template/").getPath(); |
| | | System.out.println(filePath); |
| | | //设置模本装置方法和路径,FreeMarker支持多种模板装载方法。可以重servlet,classpath,数据库教程装载, |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | String newTime = String.valueOf(Calendar.getInstance().getTimeInMillis()); |
| | | |
| | | String name = "专家劳务费发放申请单_" + dataMap.get("XM") + "_" + newTime; |
| | | if (dataLW.equals("4")) { |
| | | name = "办公费用申请单_" + dataMap.get("XM") + "_" + newTime; |
| | | } |
| | | |
| | | //输出文档路径及名称 |
| | | File outFile = new File(RuoYiConfig.getProfile() + "/download/wordtemplate/" + name + ".doc"); |
| | |
| | | return map; |
| | | } |
| | | |
| | | private void getDataLW(Map dataMap, Long id) { |
| | | private String getDataLW(Map dataMap, Long id) { |
| | | ServiceFund serviceFund = serviceFundService.getById(id); |
| | | if (serviceFund == null) { |
| | | throw new ServiceException("下载失败,用户信息出错", HttpStatus.NO_CONTENT); |
| | |
| | | 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.getPretaxcost() + "元 (其中税后费用由中心承担税费)。"); |
| | | if (serviceFund.getApplytype().equals("1")) { |
| | | dataMap.put("FYXM1", "人体器官捐献专家劳务费:" + serviceFund.getPretaxcost() + "元 (其中税后费用由中心承担税费)。"); |
| | | } else if (serviceFund.getApplytype().equals("4")) { |
| | | dataMap.put("FYXM1", "办公费用:" + serviceFund.getPretaxcost()); |
| | | } |
| | | dataMap.put("FYXM2", ""); |
| | | dataMap.put("FYXM3", ""); |
| | | dataMap.put("JEXS", serviceFund.getPretaxcost()); |
| | |
| | | dataMap.put("KSLJ", kslj); |
| | | dataMap.put("SHLJ", shlj); |
| | | |
| | | return serviceFund.getApplytype(); |
| | | } |
| | | |
| | | |
| | |
| | | Map dataMap = new HashMap(); |
| | | String dataYX = getDataYX(dataMap, id); |
| | | String filePath = getClass().getResource("/template/").getPath(); |
| | | log.info("filePath的值为:{}", filePath); |
| | | System.out.println(filePath); |
| | | //设置模本装置方法和路径,FreeMarker支持多种模板装载方法。可以重servlet,classpath,数据库教程装载, |
| | | configuration.setDirectoryForTemplateLoading(new File(filePath)); |
| | |
| | | //输出文档路径及名称 |
| | | File outFile = new File(RuoYiConfig.getProfile() + "/download/wordtemplate/" + name + ".doc"); |
| | | Writer out = null; |
| | | |
| | | try { |
| | | out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8")); |
| | | |
| | | } catch (FileNotFoundException e1) { |
| | | e1.printStackTrace(); |
| | | log.error("FileNotFoundException报错信息是:{}", e1.getMessage()); |
| | | // e1.printStackTrace(); |
| | | } |
| | | try { |
| | | |
| | | t.process(dataMap, out); |
| | | } catch (TemplateException e) { |
| | | e.printStackTrace(); |
| | | log.error("TemplateException报错信自是:{}", e.getMessage()); |
| | | e.getMessage(); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("downloadUrl", "/profile/download/wordtemplate/" + name + ".doc"); |
| | |
| | | throw new ServiceException("下载失败,用户信息出错", HttpStatus.NO_CONTENT); |
| | | } |
| | | ServiceExternalperson infoByUserNo = null; |
| | | if (StringUtils.isNotBlank(serviceFund.getUserno())) { |
| | | if (StringUtils.isNotBlank(serviceFund.getUserno()) && serviceFund.getApplytype().equals("5")) { |
| | | infoByUserNo = externalpersonService.getInfoByUserNo(serviceFund.getUserno()); |
| | | } |
| | | |
| | |
| | | dataMap.put("CWSH", serviceFund.getFinancechecher() == null ? "" : serviceFund.getFinancechecher()); |
| | | |
| | | dataMap.put("YYMMDD", time); |
| | | dataMap.put("XM", serviceFund.getDonorname() == null ? "" : serviceFund.getDonorname()); |
| | | dataMap.put("XM", serviceFund.getDonorname() == null ? "" : serviceFund.getDonorname().trim()); |
| | | dataMap.put("GZRY", serviceFund.getUsername() == null ? "" : serviceFund.getUsername()); |
| | | dataMap.put("ZZ", serviceFund.getManagername() == null ? "" : serviceFund.getManagername()); |
| | | |