From 1971f3031c38d4be4419a8e0087aae5340cd5ac7 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 17:44:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=9C=E5=9C=BA=E4=BB=BB=E5=8A=A1=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/task/TaskController.java | 8 +++ .../admin/task/vo/TaskPageSearchReqVO.java | 61 +++++++++++++++++++ .../farm/dal/mysql/task/TaskMapper.java | 2 + .../module/farm/service/task/TaskService.java | 8 +++ .../farm/service/task/TaskServiceImpl.java | 11 ++++ .../main/resources/mapper/task/TaskMapper.xml | 39 ++++++++++++ 6 files changed, 129 insertions(+) create mode 100644 zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/vo/TaskPageSearchReqVO.java create mode 100644 zsw-farm/zsw-farm-impl/src/main/resources/mapper/task/TaskMapper.xml diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/TaskController.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/TaskController.java index 99ade9fd..b74d3dcb 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/TaskController.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/TaskController.java @@ -85,6 +85,14 @@ public class TaskController { return success(TaskConvert.INSTANCE.convertPage(pageResult)); } + @GetMapping("/pageSearch") + @ApiOperation("搜索条件获得农场项目分页") + public CommonResult> getTaskSearchPage(@Valid TaskPageSearchReqVO pageVO) { + PageResult pageResult = taskService.getTaskSearchPage(pageVO); + return success(TaskConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") @ApiOperation("导出农场项目 Excel") @PreAuthorize("@ss.hasPermission('farm:task:export')") diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/vo/TaskPageSearchReqVO.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/vo/TaskPageSearchReqVO.java new file mode 100644 index 00000000..d21b6b9d --- /dev/null +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/vo/TaskPageSearchReqVO.java @@ -0,0 +1,61 @@ +package cn.iocoder.yudao.module.farm.controller.admin.task.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 TaskPageSearchReqVO extends PageParam { + + @ApiModelProperty(value = "") + private String name; + + @ApiModelProperty(value = "") + private String content; + + @ApiModelProperty(value = "") + private String resources; + + @ApiModelProperty(value = "") + private Object images; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始") + private LocalDateTime beginPlanStartTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束") + private LocalDateTime endPlanStartTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始") + private LocalDateTime beginPlanEndTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束") + private LocalDateTime endPlanEndTime; + + @ApiModelProperty(value = "优先级") + private Integer weight; + + @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/task/TaskMapper.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/task/TaskMapper.java index 0ab6cceb..f65f266e 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/task/TaskMapper.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/task/TaskMapper.java @@ -43,4 +43,6 @@ public interface TaskMapper extends BaseMapperX { .orderByDesc(TaskDO::getId)); } + List getTaskSearchPage(TaskPageSearchReqVO reqVO); + } diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/task/TaskService.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/task/TaskService.java index 7c652bf7..64b326da 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/task/TaskService.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/task/TaskService.java @@ -59,6 +59,14 @@ public interface TaskService { */ PageResult getTaskPage(TaskPageReqVO pageReqVO); + /** + * 搜索条件获得农场项目分页 + * + * @param pageReqVO 分页查询 + * @return 农场项目分页 + */ + PageResult getTaskSearchPage(TaskPageSearchReqVO pageReqVO); + /** * 获得农场项目列表, 用于 Excel 导出 * diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/task/TaskServiceImpl.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/task/TaskServiceImpl.java index cb06db3b..7483d200 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/task/TaskServiceImpl.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/task/TaskServiceImpl.java @@ -74,6 +74,17 @@ public class TaskServiceImpl implements TaskService { return taskMapper.selectPage(pageReqVO); } + @Override + public PageResult getTaskSearchPage(TaskPageSearchReqVO pageVO){ + pageVO.setPageNo(pageVO.getPageNo() - 1); + List list = taskMapper.getTaskSearchPage(pageVO); + PageResult result = new PageResult<>(); + result.setList(list); + result.setTotal(Long.valueOf(list.size())); + return result; + + } + @Override public List getTaskList(TaskExportReqVO exportReqVO) { return taskMapper.selectList(exportReqVO); diff --git a/zsw-farm/zsw-farm-impl/src/main/resources/mapper/task/TaskMapper.xml b/zsw-farm/zsw-farm-impl/src/main/resources/mapper/task/TaskMapper.xml new file mode 100644 index 00000000..1d477e19 --- /dev/null +++ b/zsw-farm/zsw-farm-impl/src/main/resources/mapper/task/TaskMapper.xml @@ -0,0 +1,39 @@ + + + + + + + + +