| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package com.dk.finance.infrastructure.convert.fia;
- import com.dk.finance.model.vo.fia.AssetClearItemVO;
- import com.dk.finance.model.pojo.fia.AssetClearItem;
- import org.mapstruct.Mapper;
- import org.mapstruct.Mapping;
- import java.util.List;
- import java.util.stream.Collectors;
- /**
- * @desc : 资产清理单明细实体转换类
- * @author : 常皓宁
- * @date : 2025/05/26 15:41
- */
- @Mapper(componentModel = "spring")
- public interface AssetClearItemConvert{
- /**
- * @desc : VO转换为POJO
- * @author : 常皓宁
- * @date : 2025/05/26 15:41
- */
- AssetClearItem assetClearItemVO2PO(AssetClearItemVO assetClearItemVO);
- /**
- * @desc : VO转换为POJO,重载方法,用于明细类实体转换时自动设置总单id
- 注意:需要自行修改@Mapping中对应的总单id字段
- * @author : 常皓宁
- * @date : 2025/05/26 15:41
- */
- @Mapping(target = "docId", source="id")
- AssetClearItem assetClearItemVO2PO(AssetClearItemVO assetClearItemVO,String id);
- /**
- * @desc : VOList转换为POJOList,用于明细类实体转换时自动设置总单id
- * @author : 常皓宁
- * @date : 2025/05/26 15:41
- * @param id 总单id的值
- */
- default List<AssetClearItem> assetClearItemVOList2POList(List<AssetClearItemVO> assetClearItemVOList,String id){
- return assetClearItemVOList.stream().map(it->assetClearItemVO2PO(it,id)).collect(Collectors.toList());
- }
- }
|