From b10524103480a6834a2e8d5662f009c745143cc4 Mon Sep 17 00:00:00 2001
From: zqy <2522236926@qq.com>
Date: 星期五, 26 十二月 2025 09:22:31 +0800
Subject: [PATCH] 个人信息 修改时 新增一个最新更新时间

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/EsSearchController.java |   71 ++++++++++++++++++++++++++++++++---
 1 files changed, 65 insertions(+), 6 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/EsSearchController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/EsSearchController.java
index 1a57cd7..5a3fe14 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/EsSearchController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/EsSearchController.java
@@ -3,13 +3,17 @@
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.EsModel;
 import com.ruoyi.service.EsService;
-import org.springframework.data.elasticsearch.core.SearchHits;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.service.ZfEconomyService;
+import com.ruoyi.service.impl.InterfaceBasedSearchRouter;
+import com.ruoyi.service.impl.ZfEconomyServiceImpl;
+import com.ruoyi.system.service.ISysMenuService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import javax.websocket.server.PathParam;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -25,8 +29,14 @@
     @Resource
     EsService esService;
 
+    @Resource
+    InterfaceBasedSearchRouter interfaceBasedSearchRouter;
+
+    @Resource
+    ZfEconomyServiceImpl zfEconomyService;
+
     @GetMapping()
-    public AjaxResult search(String keyword){
+    public AjaxResult search(@PathParam("keyword") String keyword){
         List<EsModel> byCondition = esService.findByCondition(keyword);
         return AjaxResult.success(byCondition);
     }
@@ -42,4 +52,53 @@
         List<EsModel> modelList = esService.getAll();
         return AjaxResult.success(modelList);
     }
+
+    @GetMapping("/companion/{moduleCode}")
+    public AjaxResult getAllbyCAY( @PathVariable("moduleCode") String moduleCode,@RequestParam(value = "companion", required = false) String companion,
+                                   @RequestParam(value = "happenStartTime", required = false)
+                                   @DateTimeFormat(pattern = "yyyy-MM-dd") Date happenStartTime,
+                                   @RequestParam(value = "happenEndTime", required = false)
+                                       @DateTimeFormat(pattern = "yyyy-MM-dd") Date happenEndTime){
+        System.out.println("[[[[[["+moduleCode);
+        System.out.println("[[[[[["+companion);
+
+
+        System.out.println("[[[[[["+happenStartTime);
+        System.out.println("[[[[[["+happenEndTime);
+        zfEconomyService.clearAllCache();
+    return interfaceBasedSearchRouter.routeSearch(moduleCode,companion,happenStartTime,happenEndTime);
+    }
+    /**
+     * 鏂板鍏ㄦā鍧楁悳绱㈡帴鍙o紙涓嶆寚瀹歮oduleCode锛�
+     */
+    @GetMapping("/companion")
+    public AjaxResult getAllModulesByCompanion(@RequestParam(value = "companion", required = false) String companion,
+                                               @RequestParam(value = "happenStartTime", required = false)
+                                               @DateTimeFormat(pattern = "yyyy-MM-dd") Date happenStartTime,
+                                               @RequestParam(value = "happenEndTime", required = false)
+                                               @DateTimeFormat(pattern = "yyyy-MM-dd") Date happenEndTime) {
+
+        System.out.println("鍏ㄦā鍧楁悳绱� - 鍚屼即: " + companion);
+        System.out.println("鍏ㄦā鍧楁悳绱� - 寮�濮嬫椂闂�: " + happenStartTime);
+        System.out.println("鍏ㄦā鍧楁悳绱� - 缁撴潫鏃堕棿: " + happenEndTime);
+        zfEconomyService.clearAllCache();
+        // 浣跨敤null鎴栫┖瀛楃涓茶〃绀哄叏妯″潡鎼滅储
+        return interfaceBasedSearchRouter.routeSearch(null, companion, happenStartTime, happenEndTime);
+    }
+
+    /**
+     * 閫氱敤鎼滅储鎺ュ彛
+     * 鏀寔鍗曚釜銆佸涓�佸叏妯″潡鎼滅储
+     */
+    @PostMapping("/universal")
+    public AjaxResult universalSearch(
+        @RequestParam(value = "moduleCode",required = false) String modules,  // 妯″潡浠g爜锛屾敮鎸佸崟涓�佸涓�佸叏妯″潡
+        @RequestParam(required = false) String companion,
+        @RequestParam(required = false) String hasAttachment,
+        @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime,
+        @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
+        return interfaceBasedSearchRouter.routeSearch(modules, companion, startTime, endTime,hasAttachment);
+    }
+
+
 }

--
Gitblit v1.9.1