From 6892c31200a7ed1b0e60ee5aff794b1fcecc7ef6 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 01 十一月 2023 16:28:06 +0800
Subject: [PATCH] 解决文件上传时,文件名重复问题

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java |   29 ++++++++++++++++++-----------
 1 files changed, 18 insertions(+), 11 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 0a759dd..1a1ff24 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,8 +135,10 @@
         String APPLICATIONENDTIME = spFinancialExpensesIn.getAPPLICATIONENDTIME();
         Integer CHECKFLAG = spFinancialExpensesIn.getCHECKFLAG();
         Integer APPLYTYPE = spFinancialExpensesIn.getAPPLYTYPE();
+        Integer checkstatus = spFinancialExpensesIn.getCheckstatus();
         Integer pageNum = spFinancialExpensesIn.getPageNum();
         Integer pageSize = spFinancialExpensesIn.getPageSize();
+        String donorname = spFinancialExpensesIn.getDonorname();
 
         if (pageNum == null) {
             pageNum = 1;
@@ -155,20 +160,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,donorname);
         //鏍规嵁缁忓姙浜虹瓫閫�
         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()) == new BigDecimal(spFinancialExpensesIn.getMoney())).collect(Collectors.toList());
+            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);
@@ -217,13 +223,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) {
@@ -629,7 +635,7 @@
 
             }
             //001瀹℃壒閫氳繃涔嬪悗锛屽氨闇�瑕佹妸鈥滃姙鍏涓讳换鈥濈殑鍚嶅瓧濉笂
-            if (checkFundVO.getFlowconclusion() == 1 && user.getUserId().equals("001")) {
+            if (checkFundVO.getFlowconclusion() == 1 && user.getUserName().equals("001")) {
                 serviceReimbursement.setOfficedirector(user.getNickName());
             }
 
@@ -900,6 +906,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