| | |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.text.Convert; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.domain.PeopleSea; |
| | | import com.ruoyi.service.EsService; |
| | | import com.ruoyi.service.ZfEconomyService; |
| | | import com.ruoyi.service.impl.InterfaceBasedSearchRouter; |
| | |
| | | import javax.websocket.server.PathParam; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM; |
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE; |
| | | |
| | | /** |
| | | * @Author Jinquan_Ou |
| | |
| | | } |
| | | |
| | | @GetMapping("/companion/{moduleCode}") |
| | | public AjaxResult getAllbyCAY( @PathVariable("moduleCode") String moduleCode,@RequestParam(value = "companion", required = false) String companion, |
| | | @RequestParam(value = "happenStartTime", required = false) |
| | | 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){ |
| | | @RequestParam(value = "happenEndTime", required = false) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") Date happenEndTime, PeopleSea peopleSea){ |
| | | System.out.println("[[[[[["+moduleCode); |
| | | System.out.println("[[[[[["+companion); |
| | | |
| | | |
| | | System.out.println("[[[[[["+happenStartTime); |
| | | System.out.println("[[[[[["+happenEndTime); |
| | | |
| | | Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); |
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); |
| | | zfEconomyService.clearAllCache(); |
| | | return interfaceBasedSearchRouter.routeSearch(moduleCode,companion,happenStartTime,happenEndTime); |
| | | return interfaceBasedSearchRouter.routeSearch(peopleSea,pageNum,pageSize); |
| | | } |
| | | /** |
| | | * 新增全模块搜索接口(不指定moduleCode) |
| | |
| | | @RequestParam(value = "happenStartTime", required = false) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") Date happenStartTime, |
| | | @RequestParam(value = "happenEndTime", required = false) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") Date happenEndTime) { |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") Date happenEndTime, PeopleSea peopleSea) { |
| | | |
| | | System.out.println("全模块搜索 - 同伴: " + companion); |
| | | System.out.println("全模块搜索 - 开始时间: " + happenStartTime); |
| | | System.out.println("全模块搜索 - 结束时间: " + happenEndTime); |
| | | zfEconomyService.clearAllCache(); |
| | | // 使用null或空字符串表示全模块搜索 |
| | | return interfaceBasedSearchRouter.routeSearch(null, companion, happenStartTime, happenEndTime); |
| | | Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); |
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); |
| | | return interfaceBasedSearchRouter.routeSearch(peopleSea,pageNum,pageSize); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 支持单个、多个、全模块搜索 |
| | | */ |
| | | @PostMapping("/universal") |
| | | public AjaxResult universalSearch( |
| | | @RequestParam(value = "moduleCode",required = false) String modules, // 模块代码,支持单个、多个、全模块 |
| | | @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); |
| | | } |
| | | public AjaxResult universalSearch(@RequestBody PeopleSea peopleSea) { |
| | | Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); |
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); |
| | | |
| | | System.out.println("全模块搜索 - 同伴: " + peopleSea.getPeoples()); |
| | | System.out.println("全模块搜索 - 开始时间: " + peopleSea.getStartTime()); |
| | | System.out.println("全模块搜索 - 结束时间: " + peopleSea.getEndTime()); |
| | | return interfaceBasedSearchRouter.routeSearch(peopleSea,pageNum,pageSize); |
| | | } |
| | | |
| | | } |