Browse Source

实体类字段优化

zyh
zhanyunjiu 3 years ago
parent
commit
04814bbd89
  1. 6
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/annotation/FarmMsgAspect.java
  2. 3
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/crop/vo/CropBaseVO.java
  3. 3
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/crop/vo/CropExcelVO.java
  4. 3
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/crop/vo/CropExportReqVO.java
  5. 15
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/crop/vo/CropPageReqVO.java
  6. 9
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/dto/ProjectListDTO.java
  7. 8
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectBaseVO.java
  8. 9
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectExcelVO.java
  9. 19
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectExportReqVO.java
  10. 8
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectPageReqVO.java
  11. 11
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectSearchPageReqVO.java
  12. 2
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/resource/dto/ResourceDTO.java
  13. 7
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/vo/TaskBaseVO.java
  14. 17
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/vo/TaskExcelVO.java
  15. 16
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/vo/TaskExportReqVO.java
  16. 6
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/vo/TaskPageReqVO.java
  17. 7
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/vo/TaskPageSearchReqVO.java
  18. 3
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/dataobject/crop/CropDO.java
  19. 10
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/dataobject/project/ProjectDO.java
  20. 23
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/dataobject/task/TaskDO.java
  21. 14
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java
  22. 10
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/task/TaskServiceImpl.java

6
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/annotation/FarmMsgAspect.java

@ -197,16 +197,16 @@ public class FarmMsgAspect {
List<Long> idList = new ArrayList<>();
if (farmMsgType.equals(FarmMsgTypeEnum.PROJECT)){
ProjectDO project = projectMapper.selectOne(ProjectDO::getId, id);
idList.addAll(project.getMembers().toJavaList(Long.class));
idList.addAll(project.getMembers());
}else if (farmMsgType.equals(FarmMsgTypeEnum.TASK)){
TaskDO task = taskMapper.selectOne(TaskDO::getId, id);
idList.add(task.getMainPerson());
idList.addAll(task.getExecutorPerson().toJavaList(Long.class));
idList.addAll(task.getExecutorPerson());
}else if (farmMsgType.equals(FarmMsgTypeEnum.DISCUSS)){
DiscussDO discuss = discussMapper.selectOne(DiscussDO::getId, id);
TaskDO task = taskMapper.selectOne(TaskDO::getId, discuss.getId());
idList.add(task.getMainPerson());
idList.addAll(task.getExecutorPerson().toJavaList(Long.class));
idList.addAll(task.getExecutorPerson());
}
StringBuilder builder = new StringBuilder();

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

@ -17,6 +17,9 @@ public class CropBaseVO {
@NotNull(message = "物料名不能为空")
private String name;
@ApiModelProperty("品种")
private String variety;
@ApiModelProperty(value = "物料图片")
private JSONArray images;

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

@ -20,6 +20,9 @@ public class CropExcelVO {
@ExcelProperty("物料名")
private String name;
@ExcelProperty("品种")
private String variety;
@ExcelProperty("物料图片")
private JSONArray images;

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

@ -17,6 +17,9 @@ public class CropExportReqVO {
@ApiModelProperty(value = "物料名")
private String name;
@ApiModelProperty("品种")
private String variety;
@ApiModelProperty(value = "物料图片")
private JSONArray images;

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

@ -1,12 +1,16 @@
package cn.iocoder.yudao.module.farm.controller.admin.crop.vo;
import com.alibaba.fastjson.JSONArray;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
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.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("管理后台 - 分页 Request VO")
@ -18,6 +22,9 @@ public class CropPageReqVO extends PageParam {
@ApiModelProperty(value = "物料名")
private String name;
@ApiModelProperty("品种")
private String variety;
@ApiModelProperty(value = "物料图片")
private JSONArray images;

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

@ -1,12 +1,12 @@
package cn.iocoder.yudao.module.farm.controller.admin.project.dto;
import cn.iocoder.yudao.module.farm.dal.dataobject.project.ProjectDO;
import cn.iocoder.yudao.module.system.dal.dataobject.CpUser.CpUserDO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
@ -18,6 +18,9 @@ public class ProjectListDTO extends ProjectDO {
List<String> areaName;
//主要负责人名字
String mainPersonName;
List<String> executorName;
List<CpUserDO> memberList;

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

@ -8,7 +8,6 @@ import cn.iocoder.yudao.module.farm.dal.dataobject.project.ProjectDO;
import cn.iocoder.yudao.module.farm.enums.ProjectStateEnum;
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
import cn.iocoder.yudao.module.system.service.permission.RoleService;
import com.alibaba.fastjson.JSONArray;
import com.google.common.collect.Maps;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -47,11 +46,14 @@ ProjectBaseVO extends ProjectDO {
private Long cropId;
@ApiModelProperty("项目负责人")
private Long mainPerson;
@ApiModelProperty("成员选择")
private JSONArray members;
private List<Long> members;
@ApiModelProperty(value = "项目图片")
private JSONArray images;
private List<String> images;
@ApiModelProperty(value = "育苗日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)

9
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 com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.fastjson.JSONArray;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -34,12 +33,16 @@ public class ProjectExcelVO {
@ApiModelProperty("种植面积")
private Double plantArea;
private JSONArray members;
@ApiModelProperty("项目负责人")
private Long mainPerson;
@ApiModelProperty("项目成员")
private List<Long> members;
private Long cropId;
@ExcelProperty("项目图片")
private JSONArray images;
private List<String> images;
@ExcelProperty("育苗日期")
private Date growSeedTime;

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

@ -1,14 +1,14 @@
package cn.iocoder.yudao.module.farm.controller.admin.project.vo;
import cn.hutool.json.JSON;
import cn.iocoder.yudao.module.farm.enums.ProjectStateEnum;
import com.alibaba.fastjson.JSONArray;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel(value = "管理后台 - 农场项目 Excel 导出 Request VO", description = "参数和 ProjectPageReqVO 是一致的")
@ -27,10 +27,13 @@ public class ProjectExportReqVO {
private Long cropId;
private JSONArray members;
@ApiModelProperty("项目负责人")
private Long mainPerson;
private List<Long> members;
@ApiModelProperty(value = "项目图片")
private JSONArray images;
private List<String> images;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始")

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

@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.farm.controller.admin.project.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.module.farm.enums.ProjectStateEnum;
import com.alibaba.fastjson.JSONArray;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -34,12 +33,15 @@ public class ProjectPageReqVO extends PageParam {
@ApiModelProperty("种植面积")
private Double plantArea;
private JSONArray members;
@ApiModelProperty("项目负责人")
private Long mainPerson;
private List<Long> members;
private Long cropId;
@ApiModelProperty(value = "项目图片")
private JSONArray images;
private List<String> images;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "育苗开始日期")

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

@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.farm.controller.admin.project.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.module.farm.enums.ProjectStateEnum;
import com.alibaba.fastjson.JSONArray;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -37,10 +36,14 @@ public class ProjectSearchPageReqVO extends PageParam {
private Long cropId;
private JSONArray members;
@ApiModelProperty("项目负责人")
private Long mainPerson;
@ApiModelProperty(value = "")
private JSONArray images;
@ApiModelProperty(value = "项目成员")
private List<Long> members;
@ApiModelProperty(value = "图片")
private List<String> images;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "育苗开始日期")

2
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/resource/dto/ResourceDTO.java

@ -12,8 +12,6 @@ public class ResourceDTO {
Integer num;
Long reource;
List<Long> resourceId;
}

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

@ -35,18 +35,19 @@ public class TaskBaseVO extends BaseDO {
private Long taskCateId;
private Long taskCateName;
@ApiModelProperty(value = "")
@ApiModelProperty(value = "任务所需资源")
private JSONArray resources;
@ApiModelProperty("子区域列表")
private List<Long> areas;
private Long mainPerson;
private JSONArray executorPerson;
@ApiModelProperty("执行人")
private List<Long> executorPerson;
private Integer workingHours;
@ApiModelProperty(value = "")
private JSONArray images;
private List<String> images;
@ApiModelProperty(value = "")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)

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

@ -1,11 +1,12 @@
package cn.iocoder.yudao.module.farm.controller.admin.task.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.fastjson.JSONArray;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import com.alibaba.excel.annotation.ExcelProperty;
import java.util.Date;
import java.util.List;
/**
* 农场项目 Excel VO
@ -28,18 +29,18 @@ public class TaskExcelVO {
private Long taskCateId;
private Long taskCateName;
@ExcelProperty("")
@ExcelProperty(value = "任务所需资源")
private JSONArray resources;
@ApiModelProperty("子区域列表")
@ExcelProperty("子区域列表")
private List<Long> areas;
private Long mainPerson;
private JSONArray executorPerson;
private List<Long> executorPerson;
private Integer workingHours;
@ExcelProperty("")
private JSONArray images;
private List<String> images;
@ExcelProperty("")
private Date planStartTime;

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

@ -1,12 +1,14 @@
package cn.iocoder.yudao.module.farm.controller.admin.task.vo;
import com.alibaba.fastjson.JSONArray;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel(value = "管理后台 - 农场项目 Excel 导出 Request VO", description = "参数和 TaskPageReqVO 是一致的")
@ -20,16 +22,16 @@ public class TaskExportReqVO {
private Long taskCateId;
private Long taskCateName;
@ApiModelProperty(value = "")
@ApiModelProperty(value = "任务所需资源")
private JSONArray resources;
private List<Long> areas;
private Long mainPerson;
private JSONArray executorPerson;
private List<Long> executorPerson;
private Integer workingHours;
@ApiModelProperty(value = "")
private JSONArray images;
private List<String> images;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始")

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

@ -29,16 +29,16 @@ public class TaskPageReqVO extends PageParam {
private Long taskCateId;
private Long taskCateName;
@ApiModelProperty(value = "")
@ApiModelProperty(value = "任务所需资源")
private JSONArray resources;
private List<Long> areas;
private Long mainPerson;
private JSONArray executorPerson;
private List<String> executorPerson;
private Integer workingHours;
@ApiModelProperty(value = "")
private JSONArray images;
private List<String> images;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始")

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

@ -10,7 +10,6 @@ import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -28,17 +27,17 @@ public class TaskPageSearchReqVO extends PageParam {
private Long taskCateId;
private Long taskCateName;
@ApiModelProperty(value = "")
@ApiModelProperty(value = "任务所需资源")
private JSONArray resources;
@ApiModelProperty("子区域列表")
private List<Long> areas;
private Long mainPerson;
private JSONArray executorPerson;
private List<Long> executorPerson;
private Integer workingHours;
@ApiModelProperty(value = "")
private JSONArray images;
private List<String> images;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始")

3
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/dataobject/crop/CropDO.java

@ -32,6 +32,9 @@ public class CropDO extends BaseDO {
* 物料名
*/
private String name;
@ApiModelProperty("品种")
private String variety;
/**
* 物料图片
*/

10
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/dataobject/project/ProjectDO.java

@ -9,7 +9,6 @@ import cn.iocoder.yudao.module.farm.enums.ProjectStateEnum;
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
import cn.iocoder.yudao.module.system.dict.Dict;
import cn.iocoder.yudao.module.system.service.permission.RoleService;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
@ -63,14 +62,17 @@ public class ProjectDO extends BaseDO {
private Long cropId;
@ApiModelProperty("项目负责人")
private Long mainPerson;
@ApiModelProperty("成员选择")
@TableField(typeHandler = JacksonTypeHandler.class)
private JSONArray members;
@TableField(typeHandler = ListIntToListLongTypeHandler.class)
private List<Long> members;
/**
*
*/
@TableField(typeHandler = JacksonTypeHandler.class)
private JSONArray images;
private List<String> images;
/**
* 育苗日期
*/

23
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/dataobject/task/TaskDO.java

@ -1,26 +1,27 @@
package cn.iocoder.yudao.module.farm.dal.dataobject.task;
import cn.hutool.extra.spring.SpringUtil;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.framework.mybatis.core.handler.ListIntToListLongTypeHandler;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.farm.enums.TaskStatus;
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
import cn.iocoder.yudao.module.system.dict.Dict;
import cn.iocoder.yudao.module.system.service.permission.RoleService;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.google.common.collect.Maps;
import io.swagger.annotations.ApiModelProperty;
import cn.iocoder.yudao.module.farm.enums.TaskStatus;
import lombok.*;
import java.sql.JDBCType;
import java.sql.Types;
import java.util.*;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import org.apache.ibatis.type.JdbcType;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;
/**
* 农场项目 DO
@ -50,8 +51,8 @@ public class TaskDO extends BaseDO {
private Long mainPerson;
@ApiModelProperty("执行人idList")
@TableField(typeHandler = JacksonTypeHandler.class)
private JSONArray executorPerson;
@TableField(typeHandler = ListIntToListLongTypeHandler.class)
private List<Long> executorPerson;
@ApiModelProperty("工时")
private Integer workingHours;
@ -70,7 +71,7 @@ public class TaskDO extends BaseDO {
@ApiModelProperty("任务图片")
@TableField(typeHandler = JacksonTypeHandler.class)
private JSONArray images;
private List<String> images;
/**
*
*/

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

@ -178,19 +178,27 @@ public class ProjectServiceImpl implements ProjectService {
//组装 项目成员信息
List<Long> memberIDList = new ArrayList<>();
projectListDTOList.forEach(item ->{
if (ObjectUtil.isNotEmpty(item.getMainPerson())){
memberIDList.add(item.getMainPerson());
}
if (ObjectUtil.isNotEmpty(item.getMembers())){
memberIDList.addAll(item.getMembers().toJavaList(Long.class));
memberIDList.addAll(item.getMembers());
}
});
memberIDList.stream().distinct().collect(Collectors.toList());
if (ObjectUtil.isNotEmpty(memberIDList)){
List<CpUserDO> cpUserList = cpUserMapper.selectList(Wrappers.<CpUserDO>lambdaQuery().in(CpUserDO::getId, memberIDList));
projectListDTOList.forEach(item ->{
if (ObjectUtil.isNotEmpty(item.getMainPerson())){
Optional<CpUserDO> mainPerson = cpUserList.stream().filter(user -> user.getId().equals(item.getMainPerson())).findFirst();
if (mainPerson.isPresent()){
item.setMainPersonName(mainPerson.get().getName());
}
}
List<CpUserDO> memberList = new ArrayList<>();
if (ObjectUtil.isNotEmpty(item.getMembers())){
List<Long> projectMember = item.getMembers().toJavaList(Long.class);
cpUserList.forEach(user ->{
if (projectMember.contains(user.getId())){
if (item.getMembers().contains(user.getId())){
memberList.add(user);
}
});

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

@ -210,8 +210,7 @@ public class TaskServiceImpl implements TaskService {
TaskDetailDTO taskMsg = new TaskDetailDTO();
BeanUtil.copyProperties(taskDO, taskMsg);
if (ObjectUtil.isNotEmpty(taskDO.getExecutorPerson())){
List<Long> userIdList = taskDO.getExecutorPerson().toJavaList(Long.class);
List<CpUserDO> userList = cpUserMapper.selectList(Wrappers.<CpUserDO>lambdaQuery().in(CpUserDO::getId, userIdList));
List<CpUserDO> userList = cpUserMapper.selectList(Wrappers.<CpUserDO>lambdaQuery().in(CpUserDO::getId, taskDO.getExecutorPerson()));
//执行人
taskMsg.setApiExecutor(userList);
}
@ -246,8 +245,7 @@ public class TaskServiceImpl implements TaskService {
taskMsg.setApiProjectName(projectDO.getName());
}
if (ObjectUtil.isNotEmpty(projectDO.getMembers())){
List<Long> projectMemberId = projectDO.getMembers().toJavaList(Long.class);
List<CpUserDO> projectMember = cpUserMapper.selectList(CpUserDO::getId,projectMemberId);
List<CpUserDO> projectMember = cpUserMapper.selectList(CpUserDO::getId, projectDO.getMembers());
taskMsg.setProjectMemberList(projectMember);
}
}
@ -281,7 +279,7 @@ public class TaskServiceImpl implements TaskService {
areaIdList.addAll(taskDO.getAreas());
}
if (ObjectUtil.isNotEmpty(taskDO.getExecutorPerson())){
executorIdList.addAll(taskDO.getExecutorPerson().toJavaList(Long.class));
executorIdList.addAll(taskDO.getExecutorPerson());
}
if (ObjectUtil.isNotEmpty(taskDO.getResources())){
resourceMap.put(taskDO.getId(), taskDO.getResources().toJavaList(ResourceDTO.class));
@ -395,7 +393,7 @@ public class TaskServiceImpl implements TaskService {
List<String> executorNameList = new ArrayList<>();
preAssemblyDTO.getExecutorList().forEach(executor ->{
if (ObjectUtil.isNotEmpty(taskDO.getExecutorPerson())){
taskDO.getExecutorPerson().toJavaList(Long.class).forEach(item ->{
taskDO.getExecutorPerson().forEach(item ->{
if (executor.getId().equals(item)){
executorNameList.add( executor.getName());
}

Loading…
Cancel
Save