zhanyunjiu 3 years ago
parent
commit
126251e113
  1. 18
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/area/vo/AreaExcelVO.java
  2. 2
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/crop/vo/CropExcelVO.java
  3. 11
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/cropRecord/vo/CropRecordExcelVO.java
  4. 16
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/discuss/vo/DiscussExcelVO.java
  5. 8
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/logMsg/vo/LogMsgExcelVO.java
  6. 6
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/dto/ProjectPageDTO.java
  7. 19
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectExcelVO.java
  8. 14
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectRespVO.java
  9. 17
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/resource/vo/ResourceExcelVO.java
  10. 13
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/resourceType/vo/ResourceTypeExcelVO.java
  11. 32
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/vo/TaskExcelVO.java
  12. 3
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/vo/TaskPageReqVO.java
  13. 11
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/taskCate/vo/TaskCateExcelVO.java
  14. 20
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/workHour/vo/WorkHourExcelVO.java
  15. 42
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/project/ProjectMapper.java
  16. 7
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/area/AreaService.java
  17. 31
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/area/AreaServiceImpl.java
  18. 46
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java
  19. 15
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/task/TaskServiceImpl.java
  20. 18
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/taskCate/TaskCateService.java
  21. 29
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/taskCate/TaskCateServiceImpl.java

18
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/area/vo/AreaExcelVO.java

@ -1,10 +1,9 @@
package cn.iocoder.yudao.module.farm.controller.admin.area.vo; package cn.iocoder.yudao.module.farm.controller.admin.area.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.util.Date;
/** /**
* Excel VO * Excel VO
@ -14,22 +13,25 @@ import com.alibaba.excel.annotation.ExcelProperty;
@Data @Data
public class AreaExcelVO { public class AreaExcelVO {
@ExcelProperty("") @ExcelProperty("ID")
private Long id; private Long id;
@ExcelProperty("") @ExcelProperty("区域名")
private String name; private String name;
@ExcelProperty("父级")
private Long parentId; private Long parentId;
@ExcelProperty("面积")
private Double area; private Double area;
@ExcelProperty("") @ExcelProperty("创建时间")
private Date createTime; private Date createTime;
@ExcelProperty
private Boolean pretendDelete; private Boolean pretendDelete;
@ApiModelProperty("是否占用") @ExcelProperty("是否占用")
private Boolean occupied; private Boolean occupied;
} }

2
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/crop/vo/CropExcelVO.java

@ -29,7 +29,7 @@ public class CropExcelVO {
@ExcelProperty("当前库存") @ExcelProperty("当前库存")
private Integer stock; private Integer stock;
@ExcelProperty("") @ExcelProperty("创建时间")
private Date createTime; private Date createTime;
private Boolean pretendDelete; private Boolean pretendDelete;

11
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/cropRecord/vo/CropRecordExcelVO.java

@ -1,10 +1,9 @@
package cn.iocoder.yudao.module.farm.controller.admin.cropRecord.vo; package cn.iocoder.yudao.module.farm.controller.admin.cropRecord.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.util.Date;
/** /**
* Excel VO * Excel VO
@ -14,7 +13,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
@Data @Data
public class CropRecordExcelVO { public class CropRecordExcelVO {
@ExcelProperty("") @ExcelProperty("ID")
private Long id; private Long id;
@ExcelProperty("物料id") @ExcelProperty("物料id")
@ -29,7 +28,7 @@ public class CropRecordExcelVO {
@ExcelProperty("剩余数量") @ExcelProperty("剩余数量")
private Integer afterStock; private Integer afterStock;
@ExcelProperty("") @ExcelProperty("创建时间")
private Date createTime; private Date createTime;
private Boolean pretendDelete; private Boolean pretendDelete;

16
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/discuss/vo/DiscussExcelVO.java

@ -15,29 +15,31 @@ import java.util.List;
@Data @Data
public class DiscussExcelVO { public class DiscussExcelVO {
@ExcelProperty("") @ExcelProperty("ID")
private Long id; private Long id;
@ExcelProperty("") @ExcelProperty("项目ID")
private Long projectId; private Long projectId;
@ExcelProperty("") @ExcelProperty("任务ID")
private Long taskId; private Long taskId;
@ExcelProperty("") @ExcelProperty("内容")
private String content; private String content;
@ExcelProperty("") @ExcelProperty("图片")
private List<String> images; private List<String> images;
@ExcelProperty("区域")
private List<Long> areas; private List<Long> areas;
@ExcelProperty("作物数量")
private Double cropNum; private Double cropNum;
@ExcelProperty("") @ExcelProperty("创建时间")
private Date createTime; private Date createTime;
@ExcelProperty("") @ExcelProperty("工时记录")
private List<WorkHourBaseVO> workHourList; private List<WorkHourBaseVO> workHourList;
private Boolean pretendDelete; private Boolean pretendDelete;

8
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/logMsg/vo/LogMsgExcelVO.java

@ -1,10 +1,9 @@
package cn.iocoder.yudao.module.farm.controller.admin.logMsg.vo; package cn.iocoder.yudao.module.farm.controller.admin.logMsg.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.util.Date;
/** /**
* Excel VO * Excel VO
@ -25,6 +24,7 @@ public class LogMsgExcelVO {
@ExcelProperty("标题") @ExcelProperty("标题")
private String title; private String title;
@ExcelProperty("内容")
private String msg; private String msg;
@ExcelProperty("用户id") @ExcelProperty("用户id")

6
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/dto/ProjectPageDTO.java

@ -1,12 +1,9 @@
package cn.iocoder.yudao.module.farm.controller.admin.project.dto; package cn.iocoder.yudao.module.farm.controller.admin.project.dto;
import cn.iocoder.yudao.framework.common.page.PageDTO; import cn.iocoder.yudao.framework.common.page.PageDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
@Data @Data
public class ProjectPageDTO extends PageDTO { public class ProjectPageDTO extends PageDTO {
@ -25,4 +22,7 @@ public class ProjectPageDTO extends PageDTO {
@ApiModelProperty("true查看我参与的项目") @ApiModelProperty("true查看我参与的项目")
private Boolean myProject; private Boolean myProject;
@ApiModelProperty("一级区域的id")
private Long areaId;
} }

19
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectExcelVO.java

@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.farm.controller.admin.project.vo;
import cn.iocoder.yudao.module.farm.enums.ProjectStateEnum; import cn.iocoder.yudao.module.farm.enums.ProjectStateEnum;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@ -16,29 +15,31 @@ import java.util.List;
@Data @Data
public class ProjectExcelVO { public class ProjectExcelVO {
@ExcelProperty("") @ExcelProperty("ID")
private Long id; private Long id;
@ExcelProperty("") @ExcelProperty("项目名")
private String name; private String name;
@ExcelProperty("") @ExcelProperty("内容")
private String content; private String content;
@ExcelProperty("") @ExcelProperty("状态")
private ProjectStateEnum state; private ProjectStateEnum state;
@ExcelProperty("区域")
private List<Long> areas; private List<Long> areas;
@ApiModelProperty("种植面积") @ExcelProperty("种植面积")
private Double plantArea; private Double plantArea;
@ApiModelProperty("项目负责人") @ExcelProperty("项目负责人")
private Long mainPerson; private Long mainPerson;
@ApiModelProperty("项目成员") @ExcelProperty("项目成员")
private List<Long> members; private List<Long> members;
@ExcelProperty("作物ID")
private Long cropId; private Long cropId;
@ExcelProperty("项目图片") @ExcelProperty("项目图片")
@ -62,7 +63,7 @@ public class ProjectExcelVO {
@ExcelProperty("") @ExcelProperty("")
private Date createTime; private Date createTime;
@ApiModelProperty("草稿") @ExcelProperty("草稿")
private Boolean draft; private Boolean draft;
private Boolean pretendDelete; private Boolean pretendDelete;

14
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectRespVO.java

@ -1,9 +1,14 @@
package cn.iocoder.yudao.module.farm.controller.admin.project.vo; package cn.iocoder.yudao.module.farm.controller.admin.project.vo;
import cn.iocoder.yudao.module.system.dal.dataobject.CpUser.CpUserDO; import cn.iocoder.yudao.module.system.dal.dataobject.CpUser.CpUserDO;
import lombok.*; import io.swagger.annotations.ApiModel;
import java.util.*; import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*; import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.util.Date;
import java.util.List;
@ApiModel("管理后台 - 农场项目 Response VO") @ApiModel("管理后台 - 农场项目 Response VO")
@Data @Data
@ -20,4 +25,7 @@ public class ProjectRespVO extends ProjectBaseVO {
@ApiModelProperty("项目的成员") @ApiModelProperty("项目的成员")
private List<CpUserDO> userList; private List<CpUserDO> userList;
@ApiModelProperty("项目负责人信息")
private CpUserDO mainPersonMsg;
} }

17
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/resource/vo/ResourceExcelVO.java

@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.farm.controller.admin.resource.vo;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@ -15,22 +14,22 @@ import java.util.Date;
@Data @Data
public class ResourceExcelVO { public class ResourceExcelVO {
@ExcelProperty("") @ExcelProperty("ID")
private Long id; private Long id;
@ExcelProperty("") @ExcelProperty("资源父级Id")
private Long resourceType; private Long resourceType;
@ExcelProperty("") @ExcelProperty("资源名")
private String name; private String name;
@ApiModelProperty(value = "保管人id") @ExcelProperty(value = "保管人id")
private Long custodianId; private Long custodianId;
@ExcelProperty("") @ExcelProperty("内容")
private String content; private String content;
@ExcelProperty("") @ExcelProperty("图片")
private JSONArray images; private JSONArray images;
@ExcelProperty("") @ExcelProperty("")
@ -42,7 +41,7 @@ public class ResourceExcelVO {
@ExcelProperty("唯一占用标识") @ExcelProperty("唯一占用标识")
private Boolean solo; private Boolean solo;
@ExcelProperty("") @ExcelProperty("创建时间")
private Date createTime; private Date createTime;
private Boolean pretendDelete; private Boolean pretendDelete;
@ -51,7 +50,7 @@ public class ResourceExcelVO {
private Integer number; private Integer number;
@ApiModelProperty("是否占用") @ExcelProperty("是否占用")
private Boolean occupied; private Boolean occupied;
} }

13
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/resourceType/vo/ResourceTypeExcelVO.java

@ -1,10 +1,9 @@
package cn.iocoder.yudao.module.farm.controller.admin.resourceType.vo; package cn.iocoder.yudao.module.farm.controller.admin.resourceType.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.util.Date;
/** /**
* 农场资源分类 Excel VO * 农场资源分类 Excel VO
@ -14,13 +13,13 @@ import com.alibaba.excel.annotation.ExcelProperty;
@Data @Data
public class ResourceTypeExcelVO { public class ResourceTypeExcelVO {
@ExcelProperty("") @ExcelProperty("ID")
private Long id; private Long id;
@ExcelProperty("") @ExcelProperty("类型名")
private String name; private String name;
@ExcelProperty("") @ExcelProperty("创建时间")
private Date createTime; private Date createTime;
private Boolean pretendDelete; private Boolean pretendDelete;

32
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/vo/TaskExcelVO.java

@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.farm.controller.admin.task.vo;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@ -16,47 +15,40 @@ import java.util.List;
@Data @Data
public class TaskExcelVO { public class TaskExcelVO {
@ExcelProperty("") @ExcelProperty("ID")
private Long id; private Long id;
@ExcelProperty("项目id")
@ExcelProperty("")
private Long projectId; private Long projectId;
@ExcelProperty("") @ExcelProperty("作物id")
private Long cropId; private Long cropId;
@ExcelProperty("") @ExcelProperty("作物数量")
private Integer cropNum; private Integer cropNum;
@ExcelProperty("任务类型")
private Long taskCateId; private Long taskCateId;
@ExcelProperty("任务内容")
private Long taskCateName; private Long taskCateName;
@ExcelProperty(value = "任务所需资源") @ExcelProperty(value = "任务所需资源")
private JSONArray resources; private JSONArray resources;
@ExcelProperty("子区域列表") @ExcelProperty("子区域列表")
private List<Long> areas; private List<Long> areas;
@ExcelProperty("负责人")
private Long mainPerson; private Long mainPerson;
@ExcelProperty("执行人")
private List<Long> executorPerson; private List<Long> executorPerson;
@ExcelProperty("工时")
private Integer workingHours; private Integer workingHours;
@ExcelProperty("图片")
@ExcelProperty("")
private List<String> images; private List<String> images;
@ExcelProperty("") @ExcelProperty("")
private Date planStartTime; private Date planStartTime;
@ExcelProperty("") @ExcelProperty("")
private Date planEndTime; private Date planEndTime;
@ExcelProperty("优先级") @ExcelProperty("优先级")
private Integer weight; private Integer weight;
@ExcelProperty("创建时间")
@ExcelProperty("")
private Date createTime; private Date createTime;
@ExcelProperty("草稿")
@ApiModelProperty("草稿")
private Boolean draft; private Boolean draft;
private Boolean pretendDelete; private Boolean pretendDelete;
} }

3
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/vo/TaskPageReqVO.java

@ -88,4 +88,7 @@ public class TaskPageReqVO extends PageParam {
@ApiModelProperty("后台搜索执行人") @ApiModelProperty("后台搜索执行人")
private Long executorName; private Long executorName;
@ApiModelProperty("查看采收类型")
private Boolean recovery;
} }

11
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/taskCate/vo/TaskCateExcelVO.java

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.farm.controller.admin.taskCate.vo; package cn.iocoder.yudao.module.farm.controller.admin.taskCate.vo;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@ -14,19 +13,21 @@ import java.util.Date;
@Data @Data
public class TaskCateExcelVO { public class TaskCateExcelVO {
@ExcelProperty("") @ExcelProperty("父级id")
private Long parentId; private Long parentId;
@ExcelProperty("") @ExcelProperty("任务名")
private String name; private String name;
@ExcelProperty("") @ExcelProperty("创建时间")
private Date createTime; private Date createTime;
@ExcelProperty("是否删除")
private Boolean pretendDelete; private Boolean pretendDelete;
@ExcelProperty("任务单位")
private String unit; private String unit;
@ApiModelProperty("同步到erp") @ExcelProperty("同步到erp")
private Boolean synchronizeErp; private Boolean synchronizeErp;
} }

20
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/workHour/vo/WorkHourExcelVO.java

@ -1,10 +1,9 @@
package cn.iocoder.yudao.module.farm.controller.admin.workHour.vo; package cn.iocoder.yudao.module.farm.controller.admin.workHour.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.util.Date;
/** /**
* Excel VO * Excel VO
@ -14,24 +13,25 @@ import com.alibaba.excel.annotation.ExcelProperty;
@Data @Data
public class WorkHourExcelVO { public class WorkHourExcelVO {
@ExcelProperty("") @ExcelProperty("ID")
private Long id; private Long id;
@ExcelProperty("") @ExcelProperty("用户ID")
private Integer userId; private Integer userId;
@ExcelProperty("活动ID")
private Long discussId; private Long discussId;
@ExcelProperty("") @ExcelProperty("项目ID")
private Integer projectId; private Integer projectId;
@ExcelProperty("") @ExcelProperty("任务Id")
private Integer taskId; private Integer taskId;
@ExcelProperty("") @ExcelProperty("工时")
private Integer hour; private Integer hour;
@ExcelProperty("") @ExcelProperty("创建时间")
private Date createTime; private Date createTime;
private Boolean pretendDelete; private Boolean pretendDelete;

42
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/project/ProjectMapper.java

@ -1,16 +1,12 @@
package cn.iocoder.yudao.module.farm.dal.mysql.project; 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.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.farm.controller.admin.project.dto.ProjectPageDTO; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.farm.controller.admin.project.vo.ProjectExportReqVO;
import cn.iocoder.yudao.module.farm.dal.dataobject.project.ProjectDO; 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 org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.farm.controller.admin.project.vo.*;
import java.util.List;
/** /**
* 农场项目 Mapper * 农场项目 Mapper
@ -20,32 +16,6 @@ import cn.iocoder.yudao.module.farm.controller.admin.project.vo.*;
@Mapper @Mapper
public interface ProjectMapper extends BaseMapperX<ProjectDO> { public interface ProjectMapper extends BaseMapperX<ProjectDO> {
default PageResult<ProjectDO> selectPage(ProjectPageReqVO reqVO) {
LambdaQueryWrapperX<ProjectDO> lambdaQueryWrapperX = new LambdaQueryWrapperX<ProjectDO>();
//搜索执行人
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())
.eqIfPresent(ProjectDO::getState, reqVO.getState())
.eqIfPresent(ProjectDO::getImages, reqVO.getImages())
.betweenIfPresent(ProjectDO::getPlanStartTime, reqVO.getBeginPlanStartTime(), reqVO.getEndPlanStartTime())
.betweenIfPresent(ProjectDO::getPlanEndTime, reqVO.getBeginPlanEndTime(), reqVO.getEndPlanEndTime())
.eqIfPresent(ProjectDO::getWeight, reqVO.getWeight())
.betweenIfPresent(ProjectDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
.eqIfPresent(ProjectDO::getPretendDelete, reqVO.getPretendDelete())
.eqIfPresent(ProjectDO::getDraft, reqVO.getDraft())
.orderByDesc(ProjectDO::getId);
return selectPage(reqVO,lambdaQueryWrapperX);
}
default List<ProjectDO> selectList(ProjectExportReqVO reqVO) { default List<ProjectDO> selectList(ProjectExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<ProjectDO>() return selectList(new LambdaQueryWrapperX<ProjectDO>()
@ -59,8 +29,8 @@ public interface ProjectMapper extends BaseMapperX<ProjectDO> {
.betweenIfPresent(ProjectDO::getPlanEndTime, reqVO.getBeginPlanEndTime(), reqVO.getEndPlanEndTime()) .betweenIfPresent(ProjectDO::getPlanEndTime, reqVO.getBeginPlanEndTime(), reqVO.getEndPlanEndTime())
.eqIfPresent(ProjectDO::getWeight, reqVO.getWeight()) .eqIfPresent(ProjectDO::getWeight, reqVO.getWeight())
.betweenIfPresent(ProjectDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) .betweenIfPresent(ProjectDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
.eqIfPresent(ProjectDO::getPretendDelete, reqVO.getPretendDelete()) .ne(ProjectDO::getPretendDelete, true)
.eqIfPresent(ProjectDO::getDraft, reqVO.getDraft()) .ne(ProjectDO::getDraft, true)
.orderByDesc(ProjectDO::getId)); .orderByDesc(ProjectDO::getId));
} }

7
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/area/AreaService.java

@ -83,4 +83,11 @@ public interface AreaService {
*/ */
void checkAreaOccupied(); void checkAreaOccupied();
/**
* 根据区域id 获得本级及子集区域
* eg 传一级 返回一级及对应的二级三级区域
* 传二级 返回二级及对应的三级区域
*/
List<AreaDO> getAreaAndSubArea(Long id);
} }

31
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/area/AreaServiceImpl.java

@ -16,9 +16,7 @@ import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
@ -157,4 +155,31 @@ public class AreaServiceImpl implements AreaService {
} }
/**
* 根据区域id 获得本级及子集区域
* eg 传一级 返回一级及对应的二级三级区域
* 传二级 返回二级及对应的三级区域
*/
public List<AreaDO> getAreaAndSubArea(Long id){
List<AreaDO> allList = areaMapper.selectList();
Optional<AreaDO> parentArea = allList.stream().filter(item -> item.getId().equals(id)).findFirst();
List<AreaDO> list = new ArrayList<>();
if (parentArea.isPresent()){
AreaDO areaDO = parentArea.get();
//装入一级
list.add(areaDO);
List<AreaDO> sonList = allList.stream().filter(item -> item.getParentId().equals(areaDO.getId())).collect(Collectors.toList());
if (ObjectUtil.isNotEmpty(sonList)){
//装入二级
list.addAll(sonList);
sonList.forEach(item ->{
//转入三级
list.addAll(allList.stream().filter(son -> son.getParentId().equals(item.getId())).collect(Collectors.toList()));
});
}
return list;
}
return null;
}
} }

46
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java

@ -28,6 +28,7 @@ import cn.iocoder.yudao.module.system.dal.mysql.CpUser.CpUserMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zsw.base.R; import com.zsw.base.R;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@ -116,6 +117,8 @@ public class ProjectServiceImpl implements ProjectService {
public ProjectRespVO getProject(Long id) { public ProjectRespVO getProject(Long id) {
ProjectDO projectDO = projectMapper.selectById(id); ProjectDO projectDO = projectMapper.selectById(id);
ProjectRespVO respVO = BeanUtil.copyProperties(projectDO, ProjectRespVO.class); ProjectRespVO respVO = BeanUtil.copyProperties(projectDO, ProjectRespVO.class);
CpUserDO mainUser = ObjectUtil.isEmpty(projectDO.getMainPerson()) ? null : cpUserMapper.selectById(projectDO.getMainPerson());
respVO.setMainPersonMsg(mainUser);
List<CpUserDO> userList = ObjectUtil.isEmpty(projectDO.getMembers()) ? new ArrayList<>() : cpUserMapper.selectList(CpUserDO::getId, projectDO.getMembers()); List<CpUserDO> userList = ObjectUtil.isEmpty(projectDO.getMembers()) ? new ArrayList<>() : cpUserMapper.selectList(CpUserDO::getId, projectDO.getMembers());
respVO.setUserList(userList); respVO.setUserList(userList);
return respVO; return respVO;
@ -129,7 +132,31 @@ public class ProjectServiceImpl implements ProjectService {
@Override @Override
public PageResult<ProjectDO> getProjectPage(ProjectPageReqVO pageReqVO) { public PageResult<ProjectDO> getProjectPage(ProjectPageReqVO pageReqVO) {
return projectMapper.selectPage(pageReqVO); LambdaQueryWrapperX<ProjectDO> lambdaQueryWrapperX = new LambdaQueryWrapperX<ProjectDO>();
//搜索执行人
if (ObjectUtil.isNotEmpty(pageReqVO.getExecutorName())){
lambdaQueryWrapperX.apply("JSON_CONTAINS(members, '"+ pageReqVO.getExecutorName()+"')");
}
//区域
if (ObjectUtil.isNotEmpty(pageReqVO.getAreaId())){
List<AreaDO> allAreaList = areaService.getAreaAndSubArea(pageReqVO.getAreaId());
List<Long> allIdList = allAreaList.stream().map(AreaDO::getId).collect(Collectors.toList());
lambdaQueryWrapperX.apply("JSON_OVERLAPS(areas, '"+ allIdList+"') = 1" );
}
lambdaQueryWrapperX.likeIfPresent(ProjectDO::getName, pageReqVO.getName())
.eqIfPresent(ProjectDO::getContent, pageReqVO.getContent())
.eqIfPresent(ProjectDO::getAreas, pageReqVO.getAreas())
.eqIfPresent(ProjectDO::getCropId, pageReqVO.getCropId())
.eqIfPresent(ProjectDO::getState, pageReqVO.getState())
.eqIfPresent(ProjectDO::getImages, pageReqVO.getImages())
.betweenIfPresent(ProjectDO::getPlanStartTime, pageReqVO.getBeginPlanStartTime(), pageReqVO.getEndPlanStartTime())
.betweenIfPresent(ProjectDO::getPlanEndTime, pageReqVO.getBeginPlanEndTime(), pageReqVO.getEndPlanEndTime())
.eqIfPresent(ProjectDO::getWeight, pageReqVO.getWeight())
.betweenIfPresent(ProjectDO::getCreateTime, pageReqVO.getBeginCreateTime(), pageReqVO.getEndCreateTime())
.eqIfPresent(ProjectDO::getPretendDelete, pageReqVO.getPretendDelete())
.eqIfPresent(ProjectDO::getDraft, pageReqVO.getDraft())
.orderByDesc(ProjectDO::getId);
return projectMapper.selectPage(pageReqVO, lambdaQueryWrapperX);
} }
@Override @Override
@ -154,7 +181,6 @@ public class ProjectServiceImpl implements ProjectService {
//查看自己的草稿 //查看自己的草稿
queryWrapperX.eqIfPresent(ProjectDO::getCreator, getLoginUserId()); queryWrapperX.eqIfPresent(ProjectDO::getCreator, getLoginUserId());
} }
if (ObjectUtil.isNotEmpty(pageDTO.getMyProject()) && pageDTO.getMyProject()){ if (ObjectUtil.isNotEmpty(pageDTO.getMyProject()) && pageDTO.getMyProject()){
CpUserDO user = cpUserMapper.selectOne(CpUserDO::getUserId, getLoginUser().getUsername()); CpUserDO user = cpUserMapper.selectOne(CpUserDO::getUserId, getLoginUser().getUsername());
if (ObjectUtil.isNotEmpty(user)){ if (ObjectUtil.isNotEmpty(user)){
@ -162,6 +188,13 @@ public class ProjectServiceImpl implements ProjectService {
queryWrapperX.apply(" ((JSON_CONTAINS(members, '"+ user.getId()+"') or creator = " + getLoginUserId() +"))"); queryWrapperX.apply(" ((JSON_CONTAINS(members, '"+ user.getId()+"') or creator = " + getLoginUserId() +"))");
} }
} }
//根据区域id展示
if (ObjectUtil.isNotEmpty(pageDTO.getAreaId())){
List<AreaDO> allAreaList = areaService.getAreaAndSubArea(pageDTO.getAreaId());
List<Long> allIdList = allAreaList.stream().map(AreaDO::getId).collect(Collectors.toList());
queryWrapperX.apply("JSON_OVERLAPS(areas, '"+ allIdList+"') = 1" );
}
queryWrapperX.orderByDesc(ProjectDO::getId); queryWrapperX.orderByDesc(ProjectDO::getId);
PageParam pageParam = new PageParam(); PageParam pageParam = new PageParam();
@ -263,6 +296,13 @@ public class ProjectServiceImpl implements ProjectService {
*/ */
public void checkProjectAreas(ProjectDO projectDO){ public void checkProjectAreas(ProjectDO projectDO){
if (projectDO.getState().equals(ProjectStateEnum.STARTING)){ if (projectDO.getState().equals(ProjectStateEnum.STARTING)){
ProjectDO old = projectMapper.selectById(projectDO.getId());
//区域没修改 跳过下面的检查
if (CollectionUtils.isEqualCollection(projectDO.getAreas(), old.getAreas())){
return;
}
//检查项目所选区域是否占用 //检查项目所选区域是否占用
List<AreaDO> areaList = areaService.getAreaList(projectDO.getAreas()); List<AreaDO> areaList = areaService.getAreaList(projectDO.getAreas());
List<AreaDO> occupiedList = areaList.stream().filter(item -> item.getOccupied()).collect(Collectors.toList()); List<AreaDO> occupiedList = areaList.stream().filter(item -> item.getOccupied()).collect(Collectors.toList());
@ -288,7 +328,7 @@ public class ProjectServiceImpl implements ProjectService {
//项目更改失败, 进行中的项目不可修改作物 //项目更改失败, 进行中的项目不可修改作物
throw exception(PROJECT_STARTING_CANT_CHANGE_CROP); throw exception(PROJECT_STARTING_CANT_CHANGE_CROP);
} }
if (!project.getAreas().equals(updateProject.getAreas())){ if (!CollectionUtils.isEqualCollection(project.getAreas(), updateProject.getAreas())){
//项目更改失败, 进行中的项目不可修改区域 //项目更改失败, 进行中的项目不可修改区域
throw exception(PROJECT_STARTING_CANT_CHANGE_AREA); throw exception(PROJECT_STARTING_CANT_CHANGE_AREA);
} }

15
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/task/TaskServiceImpl.java

@ -35,6 +35,7 @@ import cn.iocoder.yudao.module.farm.dal.mysql.taskCate.TaskCateMapper;
import cn.iocoder.yudao.module.farm.enums.ProjectStateEnum; import cn.iocoder.yudao.module.farm.enums.ProjectStateEnum;
import cn.iocoder.yudao.module.farm.enums.TaskMemberEnum; import cn.iocoder.yudao.module.farm.enums.TaskMemberEnum;
import cn.iocoder.yudao.module.farm.enums.TaskStatus; import cn.iocoder.yudao.module.farm.enums.TaskStatus;
import cn.iocoder.yudao.module.farm.service.taskCate.TaskCateService;
import cn.iocoder.yudao.module.system.dal.dataobject.CpUser.CpUserDO; import cn.iocoder.yudao.module.system.dal.dataobject.CpUser.CpUserDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.dal.mysql.CpUser.CpUserMapper; import cn.iocoder.yudao.module.system.dal.mysql.CpUser.CpUserMapper;
@ -73,6 +74,8 @@ public class TaskServiceImpl implements TaskService {
@Resource @Resource
private TaskCateMapper taskCateMapper; private TaskCateMapper taskCateMapper;
@Resource @Resource
private TaskCateService taskCateService;
@Resource
private CpUserService cpUserService; private CpUserService cpUserService;
@Resource @Resource
private ProjectMapper projectMapper; private ProjectMapper projectMapper;
@ -161,6 +164,15 @@ public class TaskServiceImpl implements TaskService {
} }
} }
//查看采收类型任务
if (ObjectUtil.isNotEmpty(pageReqVO.getRecovery()) && pageReqVO.getRecovery()){
List<TaskCateDO> taskCateList = taskCateService.getTaskRecovery();
if (ObjectUtil.isNotEmpty(taskCateList)){
List<Long> taskCateIdList = taskCateList.stream().map(TaskCateDO::getId).collect(Collectors.toList());
queryWrapperX.inIfPresent(TaskDO::getTaskCateId, taskCateIdList);
}
}
queryWrapperX.eqIfPresent(TaskDO::getProjectId, pageReqVO.getProjectId()) queryWrapperX.eqIfPresent(TaskDO::getProjectId, pageReqVO.getProjectId())
.eqIfPresent(TaskDO::getCropId, pageReqVO.getCropId()) .eqIfPresent(TaskDO::getCropId, pageReqVO.getCropId())
.eqIfPresent(TaskDO::getCropNum, pageReqVO.getCropNum()) .eqIfPresent(TaskDO::getCropNum, pageReqVO.getCropNum())
@ -476,9 +488,10 @@ public class TaskServiceImpl implements TaskService {
* 新增或修改检查任务所需资源数量 * 新增或修改检查任务所需资源数量
*/ */
public void checkTaskResourceNumber(TaskDO taskDO){ public void checkTaskResourceNumber(TaskDO taskDO){
List<ResourceDTO> resourceList = taskDO.getResources().toJavaList(ResourceDTO.class); // List<ResourceDTO> resourceList = taskDO.getResources().toJavaList(ResourceDTO.class);
//任务状态更改成进行中 或 任务状态更改成完成 //任务状态更改成进行中 或 任务状态更改成完成
if (taskDO.getStatus().equals(TaskStatus.STARTED) || taskDO.getStatus().equals(TaskStatus.COMPLETE)){ if (taskDO.getStatus().equals(TaskStatus.STARTED) || taskDO.getStatus().equals(TaskStatus.COMPLETE)){
List<ResourceDTO> resourceList = taskDO.getResources().toJavaList(ResourceDTO.class);
for (ResourceDTO resourceDTO : resourceList) { for (ResourceDTO resourceDTO : resourceList) {
ResourceDO resourceDO = resourceMapper.selectById(resourceDTO.getResourceId().get(1)); ResourceDO resourceDO = resourceMapper.selectById(resourceDTO.getResourceId().get(1));
//更改成进行中 //更改成进行中

18
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/taskCate/TaskCateService.java

@ -1,10 +1,15 @@
package cn.iocoder.yudao.module.farm.service.taskCate; package cn.iocoder.yudao.module.farm.service.taskCate;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.farm.controller.admin.taskCate.vo.*;
import cn.iocoder.yudao.module.farm.dal.dataobject.taskCate.TaskCateDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.farm.controller.admin.taskCate.vo.TaskCateCreateReqVO;
import cn.iocoder.yudao.module.farm.controller.admin.taskCate.vo.TaskCateExportReqVO;
import cn.iocoder.yudao.module.farm.controller.admin.taskCate.vo.TaskCatePageReqVO;
import cn.iocoder.yudao.module.farm.controller.admin.taskCate.vo.TaskCateUpdateReqVO;
import cn.iocoder.yudao.module.farm.dal.dataobject.taskCate.TaskCateDO;
import javax.validation.Valid;
import java.util.Collection;
import java.util.List;
/** /**
* 任务类型 Service 接口 * 任务类型 Service 接口
@ -67,4 +72,9 @@ public interface TaskCateService {
*/ */
List<TaskCateDO> getTaskCateList(TaskCateExportReqVO exportReqVO); List<TaskCateDO> getTaskCateList(TaskCateExportReqVO exportReqVO);
/**
* 获取所有采收类型任务类别
*/
List<TaskCateDO> getTaskRecovery();
} }

29
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/taskCate/TaskCateServiceImpl.java

@ -1,19 +1,23 @@
package cn.iocoder.yudao.module.farm.service.taskCate; package cn.iocoder.yudao.module.farm.service.taskCate;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import cn.iocoder.yudao.module.farm.controller.admin.taskCate.vo.*;
import cn.iocoder.yudao.module.farm.dal.dataobject.taskCate.TaskCateDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.farm.controller.admin.taskCate.vo.TaskCateCreateReqVO;
import cn.iocoder.yudao.module.farm.controller.admin.taskCate.vo.TaskCateExportReqVO;
import cn.iocoder.yudao.module.farm.controller.admin.taskCate.vo.TaskCatePageReqVO;
import cn.iocoder.yudao.module.farm.controller.admin.taskCate.vo.TaskCateUpdateReqVO;
import cn.iocoder.yudao.module.farm.convert.taskCate.TaskCateConvert; import cn.iocoder.yudao.module.farm.convert.taskCate.TaskCateConvert;
import cn.iocoder.yudao.module.farm.dal.dataobject.taskCate.TaskCateDO;
import cn.iocoder.yudao.module.farm.dal.mysql.taskCate.TaskCateMapper; import cn.iocoder.yudao.module.farm.dal.mysql.taskCate.TaskCateMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.farm.enums.ErrorCodeConstants.*; import static cn.iocoder.yudao.module.farm.enums.ErrorCodeConstants.TASK_CATE_NOT_EXISTS;
/** /**
* 任务类型 Service 实现类 * 任务类型 Service 实现类
@ -82,4 +86,11 @@ public class TaskCateServiceImpl implements TaskCateService {
return taskCateMapper.selectList(exportReqVO); return taskCateMapper.selectList(exportReqVO);
} }
/**
* 获取所有采收类型任务类别
*/
public List<TaskCateDO> getTaskRecovery(){
return taskCateMapper.selectList(new LambdaQueryWrapper<TaskCateDO>().eq(TaskCateDO::getSynchronizeErp, true));
}
} }

Loading…
Cancel
Save