Java 代码示例:根据ownerId获取项目报告文件列表并转换为PicItem对象
// 根据ownerId(place_id, statment_id)获取项目报告文件列表
List
// 遍历项目报告文件列表 for (TProjectreportFile pic : pics) { PicItem it = new PicItem(); // 创建PicItem对象 it.setId(pic.getId()); // 设置PicItem的ID属性 it.setTime(pic.getCreateat() != null ? format.format(pic.getCreateat()) : ""); // 设置PicItem的时间属性(格式化日期) it.setRemark(pic.getRemark()); // 设置PicItem的备注属性
try {
it.setPath(pic.getPath() != null ? FilePathUtil.getQYPath(pic.getPath()) : ""); // 设置PicItem的路径属性(获取文件路径)
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
items.add(it); // 将PicItem对象添加到列表中
}
return items; // 返回PicItem列表
原文地址: https://www.cveoy.top/t/topic/p2qG 著作权归作者所有。请勿转载和采集!