RuoYi
2020-08-05 3b61ed56b03df91c7f3967eb19d370d7df84b1dd
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
@@ -17,7 +17,6 @@
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.Cell;
@@ -41,7 +40,6 @@
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.annotation.Excel.Type;
@@ -201,8 +199,9 @@
                    // 设置类的私有字段属性可访问.
                    field.setAccessible(true);
                    Integer column = cellMap.get(attr.name());
                    if(column !=null ) { // 字段在excel 中没有,那么就不需要设置值
                       fieldsMap.put(column, field);
                    if (column != null)
                    {
                        fieldsMap.put(column, field);
                    }
                }
            }
@@ -477,7 +476,7 @@
    {
        if (ColumnType.STRING == attr.cellType())
        {
            cell.setCellType(CellType.NUMERIC);
            cell.setCellType(CellType.STRING);
            cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix());
        }
        else if (ColumnType.NUMERIC == attr.cellType())
@@ -695,7 +694,7 @@
        }
        return StringUtils.stripEnd(propertyString.toString(), separator);
    }
    /**
     * 解析字典值
     * 
@@ -897,15 +896,7 @@
                    }
                    else
                    {
                  /* if ((Double) val % 1 > 0)
                  {
                      val = new DecimalFormat("0.00").format(val);
                  }
                  else
                  {
                      val = new DecimalFormat("0").format(val);
                  }*/
                       val = new BigDecimal(val.toString()); // 导入的数据保证原汁原味,不做处理
                        val = new BigDecimal(val.toString()); // 浮点格式处理
                    }
                }
                else if (cell.getCellTypeEnum() == CellType.STRING)