[feat] 新增项目信息管理模块

This commit is contained in:
2024-07-06 20:15:10 +08:00
parent 2632866955
commit 8bfc2a8ef8
24 changed files with 1154 additions and 4 deletions

View File

@ -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);
}
}