| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- package com.persagy.fm.department.model;
- import com.persagy.fm.department.jms.model.GroupCreateMsg;
- import com.persagy.fm.department.model.dto.AddDepartmentDTO;
- import com.persagy.fm.department.model.dto.UpdateDepartmentDTO;
- import com.persagy.fm.department.model.vo.ResponseDepartmentItemVO;
- import com.persagy.fm.department.model.vo.ResponseDepartmentListItemVO;
- import com.persagy.fm.department.model.vo.ResponseDepartmentTreeItemVO;
- import org.mapstruct.*;
- import org.mapstruct.factory.Mappers;
- import java.util.List;
- /**
- * 部门(Department) dto、vo、do转换工具类
- *
- * @author lixing
- * @version V1.0 2021-03-11 15:09:19 2021-03-11 15:09:19
- */
- @Mapper(nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT,
- nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
- public interface ConvertDepartmentTool {
- ConvertDepartmentTool INSTANCE = Mappers.getMapper(ConvertDepartmentTool.class);
- /**
- * 实体转换为ResponseItemVO
- *
- * @param department do对象
- * @return ResponseItemVO
- * @author lixing
- * @version V1.0 2021-03-11 15:09:19
- */
- @Mapping(source = "managers", target = "managers", ignore = true)
- ResponseDepartmentItemVO convert2ResponseItemDTO(Department department);
- /**
- * 实体转换为ResponseListItemVO
- *
- * @param department do对象
- * @return ResponseListItemVO
- * @author lixing
- * @version V1.0 2021-03-11 15:09:19
- */
- ResponseDepartmentListItemVO convert2ResponseListItemDTO(Department department);
- /**
- * 实体列表转换为ResponseListItemVO列表
- *
- * @param departmentList do列表
- * @return ResponseListItemVO列表
- * @author lixing
- * @version V1.0 2021-03-11 15:09:19
- */
- List<ResponseDepartmentListItemVO> convert2List(List<Department> departmentList);
- /**
- * addDTO转换为实体
- *
- * @param addDepartmentDTO addDTO
- * @return do对象
- * @author lixing
- * @version V1.0 2021-03-11 15:09:19
- */
- Department convertAddDto2Entity(AddDepartmentDTO addDepartmentDTO);
- /**
- * updateDTO转换为实体
- *
- * @param department 更新前的do对象
- * @param updateDepartmentDTO updateDTO
- * @return do对象
- * @author lixing
- * @version V1.0 2021-03-11 15:09:19
- */
- Department convertUpdateDto2Entity(@MappingTarget Department department, UpdateDepartmentDTO updateDepartmentDTO);
- /**
- * 实体列表换为ResponseTreeItemVO列表
- *
- * @param depList 部门实体列表
- * @return ResponseTreeItemVO列表
- * @author lixing
- * @version V1.0 2021/3/12 3:09 下午
- */
- List<ResponseDepartmentTreeItemVO> convert2Tree(List<Department> depList);
- /**
- * 实体转换为树节点对象
- *
- * @param department do对象
- * @return 树节点对象
- * @author lixing
- * @version V1.0 2021/3/12 4:40 下午
- */
- ResponseDepartmentTreeItemVO convert2TreeItemVO(Department department);
- /**
- * 集团创建消息转换为创建部门入参
- *
- * @param groupCreateMsg 集团创建消息
- * @return 创建部门入参
- * @author lixing
- * @version V1.0 2021/3/18 6:38 下午
- */
- AddDepartmentDTO convert2AddDto(GroupCreateMsg groupCreateMsg);
- }
|