mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-15 19:45:06 +08:00
[feat] 新增项目信息管理模块
This commit is contained in:
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.framework.excel.core.convert;
|
||||
|
||||
import com.alibaba.excel.converters.Converter;
|
||||
import com.alibaba.excel.enums.CellDataTypeEnum;
|
||||
import com.alibaba.excel.metadata.GlobalConfiguration;
|
||||
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||
import com.alibaba.excel.metadata.property.ExcelContentProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hhyykk
|
||||
* @description
|
||||
* @date 2024/7/6
|
||||
*/
|
||||
public class ListToStringConvert implements Converter<Object> {
|
||||
@Override
|
||||
public Class<?> supportJavaTypeKey() {
|
||||
return List.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CellDataTypeEnum supportExcelTypeKey() {
|
||||
return CellDataTypeEnum.STRING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WriteCellData<?> convertToExcelData(Object object, ExcelContentProperty contentProperty,
|
||||
GlobalConfiguration globalConfiguration) throws Exception {
|
||||
if (object == null) {
|
||||
return new WriteCellData<>("");
|
||||
}
|
||||
String value = String.valueOf(object);
|
||||
// 拼接字符串,逗号隔开
|
||||
// String result = value.replace("[", "").replace("]", "").replace(" ", "");
|
||||
return new WriteCellData<>(value);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user