From 211afafeafb079c46a05efd2383df20e84ff09cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E4=B9=85=E5=93=A5?= <787952492@qq.com> Date: Thu, 21 Apr 2022 18:43:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=9C=E5=9C=BA=E4=BB=BB=E5=8A=A1=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/event/EventController.java | 9 ++++ .../admin/event/vo/EventSearchPageReqVO.java | 45 +++++++++++++++++++ .../farm/dal/mysql/event/EventMapper.java | 2 + .../farm/service/event/EventService.java | 8 ++++ .../farm/service/event/EventServiceImpl.java | 12 +++++ .../resources/mapper/event/EventMapper.xml | 23 ++++++++++ 6 files changed, 99 insertions(+) create mode 100644 zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/event/vo/EventSearchPageReqVO.java diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/event/EventController.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/event/EventController.java index 3916de41..339ee002 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/event/EventController.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/event/EventController.java @@ -9,8 +9,10 @@ import io.swagger.annotations.*; import javax.validation.constraints.*; import javax.validation.*; import javax.servlet.http.*; +import java.awt.*; import java.util.*; import java.io.IOException; +import java.util.List; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult; @@ -85,6 +87,13 @@ public class EventController { return success(EventConvert.INSTANCE.convertPage(pageResult)); } + @GetMapping("/pageSearch") + @ApiOperation("搜索获得农场任务事件分页") + public CommonResult> getEventPage(@Valid EventSearchPageReqVO pageVO) { + PageResult pageResult = eventService.getEventSearchPage(pageVO); + return success(EventConvert.INSTANCE.convertPage(pageResult)); + } + @GetMapping("/export-excel") @ApiOperation("导出农场任务事件 Excel") @PreAuthorize("@ss.hasPermission('farm:event:export')") diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/event/vo/EventSearchPageReqVO.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/event/vo/EventSearchPageReqVO.java new file mode 100644 index 00000000..a591344c --- /dev/null +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/event/vo/EventSearchPageReqVO.java @@ -0,0 +1,45 @@ +package cn.iocoder.yudao.module.farm.controller.admin.event.vo; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; +import java.util.Date; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@ApiModel("管理后台 - 农场任务事件分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class EventSearchPageReqVO extends PageParam { + + @ApiModelProperty(value = "") + private String projectId; + + @ApiModelProperty(value = "") + private String taskId; + + @ApiModelProperty(value = "") + private String name; + + @ApiModelProperty(value = "") + private String content; + + @ApiModelProperty(value = "") + private String images; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始") + private LocalDateTime beginCreateTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束") + private LocalDateTime endCreateTime; + +} diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/event/EventMapper.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/event/EventMapper.java index b5a93f6d..facca987 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/event/EventMapper.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/event/EventMapper.java @@ -39,4 +39,6 @@ public interface EventMapper extends BaseMapperX { .orderByDesc(EventDO::getId)); } + List getEventSearchPage(EventSearchPageReqVO reqVO); + } diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/event/EventService.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/event/EventService.java index 6dac19f1..7e9238c3 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/event/EventService.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/event/EventService.java @@ -59,6 +59,14 @@ public interface EventService { */ PageResult getEventPage(EventPageReqVO pageReqVO); + /** + * 搜索条件获得农场任务事件分页 + * + * @param pageVO 分页查询 + * @return 农场任务事件分页 + */ + PageResult getEventSearchPage(EventSearchPageReqVO pageVO); + /** * 获得农场任务事件列表, 用于 Excel 导出 * diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/event/EventServiceImpl.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/event/EventServiceImpl.java index 51a50649..7360c81b 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/event/EventServiceImpl.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/event/EventServiceImpl.java @@ -1,5 +1,7 @@ package cn.iocoder.yudao.module.farm.service.event; +import cn.iocoder.yudao.module.farm.controller.admin.task.vo.TaskPageSearchReqVO; +import cn.iocoder.yudao.module.farm.dal.dataobject.task.TaskDO; import org.springframework.stereotype.Service; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -74,6 +76,16 @@ public class EventServiceImpl implements EventService { return eventMapper.selectPage(pageReqVO); } + @Override + public PageResult getEventSearchPage(EventSearchPageReqVO pageVO){ + pageVO.setPageNo(pageVO.getPageNo() - 1); + List list = eventMapper.getEventSearchPage(pageVO); + PageResult result = new PageResult<>(); + result.setList(list); + result.setTotal(Long.valueOf(list.size())); + return result; + } + @Override public List getEventList(EventExportReqVO exportReqVO) { return eventMapper.selectList(exportReqVO); diff --git a/zsw-farm/zsw-farm-impl/src/main/resources/mapper/event/EventMapper.xml b/zsw-farm/zsw-farm-impl/src/main/resources/mapper/event/EventMapper.xml index 7c6c2492..70bfd616 100644 --- a/zsw-farm/zsw-farm-impl/src/main/resources/mapper/event/EventMapper.xml +++ b/zsw-farm/zsw-farm-impl/src/main/resources/mapper/event/EventMapper.xml @@ -9,4 +9,27 @@ 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ --> + +