From 6063523f3012c4d41c9d1deb33d133c77119855c 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, 23 Jun 2022 16:58:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E9=A1=B9=E7=9B=AE=E6=90=9C?= =?UTF-8?q?=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/project/ProjectController.java | 8 --- .../admin/project/vo/ProjectPageReqVO.java | 6 ++ .../admin/task/vo/TaskSearchVO.java | 69 ------------------- .../farm/dal/mysql/project/ProjectMapper.java | 19 +++-- .../farm/service/project/ProjectService.java | 5 -- .../service/project/ProjectServiceImpl.java | 10 --- .../mapper/project/ProjectMapper.xml | 34 --------- 7 files changed, 21 insertions(+), 130 deletions(-) delete mode 100644 zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/vo/TaskSearchVO.java diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/ProjectController.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/ProjectController.java index c7a4991c..02e79bb5 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/ProjectController.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/ProjectController.java @@ -94,14 +94,6 @@ public class ProjectController { return success(ProjectConvert.INSTANCE.convertPage(pageResult)); } - @GetMapping("/pageSearch") - @ApiOperation("获得农场项目搜索分页") - public CommonResult> getProjectSearchPage(@Valid ProjectSearchPageReqVO pageVO) { - System.out.println("进入搜索分页"); - PageResult resultPage = projectService.getProjectSearchPage(pageVO); - return success(ProjectConvert.INSTANCE.convertPage(resultPage)); - } - @GetMapping("/export-excel") @ApiOperation("导出农场项目 Excel") @PreAuthorize("@ss.hasPermission('farm:project:export')") diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectPageReqVO.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectPageReqVO.java index 7d0b16e5..7cf42a45 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectPageReqVO.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectPageReqVO.java @@ -65,4 +65,10 @@ public class ProjectPageReqVO extends PageParam { private Boolean pretendDelete = false; + @ApiModelProperty("后台搜索区域id") + private Long areaId; + + @ApiModelProperty("后台区域搜索成员") + private Long executorName; + } diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/vo/TaskSearchVO.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/vo/TaskSearchVO.java deleted file mode 100644 index 5a0911e6..00000000 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/vo/TaskSearchVO.java +++ /dev/null @@ -1,69 +0,0 @@ -package cn.iocoder.yudao.module.farm.controller.admin.task.vo; - -import cn.iocoder.yudao.framework.common.pojo.PageParam; -import com.alibaba.fastjson.JSONArray; -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.List; - -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 TaskSearchVO extends PageParam { - - - @ApiModelProperty("草稿") - private Boolean draft = false; - - @ApiModelProperty("项目名") - private String projectId; - - @ApiModelProperty("区域名") - private String areaId; - - @ApiModelProperty("任务父级名") - private Long taskCateId; - - @ApiModelProperty("任务子级名") - private Long taskCateName; - - @ApiModelProperty("资源名") - private Long resourceId; - - @ApiModelProperty(value = "优先级") - private Integer weight; - - @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; - - @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/project/ProjectMapper.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/project/ProjectMapper.java index 98840a27..6b2a505c 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/project/ProjectMapper.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/project/ProjectMapper.java @@ -2,11 +2,13 @@ package cn.iocoder.yudao.module.farm.dal.mysql.project; import java.util.*; +import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.module.farm.controller.admin.project.dto.ProjectPageDTO; import cn.iocoder.yudao.module.farm.dal.dataobject.project.ProjectDO; +import cn.iocoder.yudao.module.farm.dal.dataobject.task.TaskDO; import org.apache.ibatis.annotations.Mapper; import cn.iocoder.yudao.module.farm.controller.admin.project.vo.*; @@ -19,8 +21,16 @@ import cn.iocoder.yudao.module.farm.controller.admin.project.vo.*; public interface ProjectMapper extends BaseMapperX { default PageResult selectPage(ProjectPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .likeIfPresent(ProjectDO::getName, reqVO.getName()) + LambdaQueryWrapperX lambdaQueryWrapperX = new LambdaQueryWrapperX(); + //搜索执行人 + if (ObjectUtil.isNotEmpty(reqVO.getExecutorName())){ + lambdaQueryWrapperX.apply("JSON_CONTAINS(members, '"+ reqVO.getExecutorName()+"')"); + } + //区域 + if (ObjectUtil.isNotEmpty(reqVO.getAreaId())){ + lambdaQueryWrapperX.apply("JSON_CONTAINS(areas, '"+ reqVO.getAreaId()+"')"); + } + lambdaQueryWrapperX.likeIfPresent(ProjectDO::getName, reqVO.getName()) .eqIfPresent(ProjectDO::getContent, reqVO.getContent()) .eqIfPresent(ProjectDO::getAreas, reqVO.getAreas()) .eqIfPresent(ProjectDO::getCropId, reqVO.getCropId()) @@ -32,7 +42,9 @@ public interface ProjectMapper extends BaseMapperX { .betweenIfPresent(ProjectDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) .eqIfPresent(ProjectDO::getPretendDelete, reqVO.getPretendDelete()) .eqIfPresent(ProjectDO::getDraft, reqVO.getDraft()) - .orderByDesc(ProjectDO::getId)); + .orderByDesc(ProjectDO::getId); + + return selectPage(reqVO,lambdaQueryWrapperX); } default List selectList(ProjectExportReqVO reqVO) { @@ -52,6 +64,5 @@ public interface ProjectMapper extends BaseMapperX { .orderByDesc(ProjectDO::getId)); } - List getProjectSearchPage(ProjectSearchPageReqVO reqVO); } diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectService.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectService.java index b2e4911a..d5631495 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectService.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectService.java @@ -64,11 +64,6 @@ public interface ProjectService { */ PageResult getProjectPage(ProjectPageReqVO pageReqVO); - /** - * 搜索条件农场项目分页 - **/ - PageResult getProjectSearchPage(ProjectSearchPageReqVO pageReqVO); - /** * 获得农场项目列表, 用于 Excel 导出 * diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java index 3458a0fd..cbce2ec4 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java @@ -127,16 +127,6 @@ public class ProjectServiceImpl implements ProjectService { return projectMapper.selectPage(pageReqVO); } - @Override - public PageResult getProjectSearchPage(ProjectSearchPageReqVO pageReqVO){ - pageReqVO.setPageNo(pageReqVO.getPageNo() - 1); - List list = projectMapper.getProjectSearchPage(pageReqVO); - PageResult result = new PageResult<>(); - result.setList(list); - result.setTotal(Long.valueOf(list.size())); - return result; - } - @Override public List getProjectList(ProjectExportReqVO exportReqVO) { return projectMapper.selectList(exportReqVO); diff --git a/zsw-farm/zsw-farm-impl/src/main/resources/mapper/project/ProjectMapper.xml b/zsw-farm/zsw-farm-impl/src/main/resources/mapper/project/ProjectMapper.xml index ec0d2044..cc658b0c 100644 --- a/zsw-farm/zsw-farm-impl/src/main/resources/mapper/project/ProjectMapper.xml +++ b/zsw-farm/zsw-farm-impl/src/main/resources/mapper/project/ProjectMapper.xml @@ -9,38 +9,4 @@ 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ --> -