From 22655ad10d386f0fc3c38389f519d3d188b46f19 Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期五, 13 十月 2023 16:29:54 +0800 Subject: [PATCH] 代码提交 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java | 36 ++++++++++++++++++++++++++---------- 1 files changed, 26 insertions(+), 10 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java index 90cf6dd..cf2d34f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java @@ -75,6 +75,9 @@ private IServiceFundService serviceFundService; @Autowired + private IBaseOnlyvalueService baseOnlyvalueService; + + @Autowired private ISysPostService postService; @Autowired @@ -132,6 +135,7 @@ String APPLICATIONENDTIME = spFinancialExpensesIn.getAPPLICATIONENDTIME(); Integer CHECKFLAG = spFinancialExpensesIn.getCHECKFLAG(); Integer APPLYTYPE = spFinancialExpensesIn.getAPPLYTYPE(); + Integer checkstatus = spFinancialExpensesIn.getCheckstatus(); Integer pageNum = spFinancialExpensesIn.getPageNum(); Integer pageSize = spFinancialExpensesIn.getPageSize(); @@ -155,15 +159,21 @@ APPLICATIONENDTIME = ""; } //startPage(); - List<SpFinancialExpensesReimbursementOut> list = serviceReimbursementService.getListBypower(loginUser.getUsername(), 1, APPLICANT, APPLICATIONBEGTIME, APPLICATIONENDTIME, loginUser.getDeptId().toString(), CHECKFLAG, APPLYTYPE); + List<SpFinancialExpensesReimbursementOut> list = serviceReimbursementService.getListBypower(loginUser.getUsername(), 1, APPLICANT, APPLICATIONBEGTIME, APPLICATIONENDTIME, loginUser.getDeptId().toString(), CHECKFLAG, APPLYTYPE,checkstatus); + //鏍规嵁缁忓姙浜虹瓫閫� if (StringUtils.isNotBlank(spFinancialExpensesIn.getUsername())) { list = list.stream().filter(reimbursementOut -> reimbursementOut.getUsername().contains(spFinancialExpensesIn.getUsername())).collect(Collectors.toList()); // 鎸塶ame瀛楁杩囨护 } + //鏍规嵁閲戦绛涢�� + if (spFinancialExpensesIn.getMoney() != null) { + list = list.stream().filter(reimbursementOut -> new BigDecimal(reimbursementOut.getAmountrequested()).compareTo(new BigDecimal(spFinancialExpensesIn.getMoney())) == 0).collect(Collectors.toList()); + } + //鏍规嵁鍒涘缓鏃堕棿鎺掑簭 Collections.sort(list, new Comparator<SpFinancialExpensesReimbursementOut>() { @Override public int compare(SpFinancialExpensesReimbursementOut o1, SpFinancialExpensesReimbursementOut o2) { - return o2.getCreateTime().compareTo(o1.getCreateTime()); + return o1.getCreateTime().compareTo(o2.getCreateTime()); } }); return getCustomDataTable(list, pageNum, pageSize); @@ -212,13 +222,13 @@ @RepeatSubmit @Options(useGeneratedKeys = true, keyProperty = "id") public AjaxResult add(@RequestBody ServiceReimbursement serviceReimbursement) { - - boolean b = serviceReimbursementService.save(serviceReimbursement); -// if (b) { -// addReiSharedDatd(serviceReimbursement, 1); -// } - Long id = serviceReimbursement.getId(); - return AjaxResult.success(id); + if (!Objects.isNull(serviceReimbursement)) { + serviceReimbursement.setCheckstatus(serviceReimbursement.getCheckstatus() == null ? 1 : serviceReimbursement.getCheckstatus()); + boolean b = serviceReimbursementService.save(serviceReimbursement); + Long id = serviceReimbursement.getId(); + return AjaxResult.success(id); + } + return error(); } // public int addReiSharedDatd(ServiceReimbursement serviceReimbursement, int nType) { @@ -623,6 +633,10 @@ } } + //001瀹℃壒閫氳繃涔嬪悗锛屽氨闇�瑕佹妸鈥滃姙鍏涓讳换鈥濈殑鍚嶅瓧濉笂 + if (checkFundVO.getFlowconclusion() == 1 && user.getUserName().equals("001")) { + serviceReimbursement.setOfficedirector(user.getNickName()); + } serviceReimbursementService.updateById(serviceReimbursement); @@ -711,6 +725,7 @@ Map dataMap = new HashMap(); getData(dataMap, id); String filePath = getClass().getResource("/template/").getPath(); + log.info("涓嬭浇鍦板潃鏄暐锛燂紵锛焮}", filePath); System.out.println(filePath); //璁剧疆妯℃湰瑁呯疆鏂规硶鍜岃矾寰�,FreeMarker鏀寔澶氱妯℃澘瑁呰浇鏂规硶銆傚彲浠ラ噸servlet锛宑lasspath锛屾暟鎹簱鏁欑▼瑁呰浇锛� configuration.setDirectoryForTemplateLoading(new File(filePath)); @@ -723,7 +738,7 @@ 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"); @@ -890,6 +905,7 @@ String date = formatter.format(dt); String time = date.substring(0, 10); + dataMap.put("ZB", rdInfoByItem.get(0).getDeptmentname() == null ? "" : rdInfoByItem.get(0).getDeptmentname()); dataMap.put("XZBH", rdInfoByItem.get(0).getBh() == null ? "" : rdInfoByItem.get(0).getBh()); dataMap.put("TBYYMMDD", time); dataMap.put("BXDFJ", rdInfoByItem.get(0).getAttachcount() == null ? " " : "" + rdInfoByItem.get(0).getAttachcount()); -- Gitblit v1.9.3