Pre Merge pull request !394 from 呼叫彩虹/N/A

This commit is contained in:
呼叫彩虹 2022-05-01 12:24:11 +00:00 committed by Gitee
commit 9a14143c07
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 8 additions and 1 deletions

View File

@ -53,6 +53,11 @@ public @interface Excel
*/
public int scale() default -1;
/**
* index 下标 默认:-1(默认不开启下标)
*/
public int index() default -1;
/**
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
*/

View File

@ -24,7 +24,7 @@ public class SysUser extends BaseEntity
private static final long serialVersionUID = 1L;
/** 用户ID */
@Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
@Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号", index = 0)
private Long userId;
/** 部门ID */

View File

@ -284,6 +284,8 @@ public class ExcelUtil<T>
if (column != null)
{
fieldsMap.put(column, objects);
} else if(attr.index != -1){
fieldsMap.put(attr.index, objects);
}
}
for (int i = titleNum + 1; i <= rows; i++)