code: public static Cell setCellValue(Cell cell, Object value, String dateFormat) {
          SimpleDateFormat format =
                  new SimpleDateFormat(StringUtils.isNotBlank(dateFormat) ? dateFormat : DATE_PATTERN);
          if (value == null) {
              cell.setCellValue("");
          } else if (value instanceof String) {
              cell.setCellValue((String) value);
          } else if (value instanceof Integer) {
              cell.setCellValue((Integer) value);
          } else if (value instanceof Date) {
              cell.setCellValue(format.format(value));
          } else if (value instanceof Calendar) {
              cell.setCellValue(format.format(((Calendar) value).getTime()));
          } else if (value instanceof Boolean) {
              cell.setCellValue((Boolean) value);
          } else if (value instanceof Float) {
              cell.setCellValue((Float) value);
          } else if (value instanceof Double) {
              cell.setCellValue((Double) value);
          } else if (value instanceof Byte) {
              cell.setCellValue((Byte) value);
          } else if (value instanceof Short) {
              cell.setCellValue((Short) value);
          } else if (value instanceof Long) {
              cell.setCellValue((Long) value);
          } else if (value instanceof Character) {
              cell.setCellValue(((Character) value).toString());
          } else {
              cell.setCellValue(value.toString());
          }
          return cell;
      }
docs: 给一个Cell赋值,若为空则视为"",若不为基本类型及其包装类(日期类型除外),则其值通过toString()获取
  
  @param cell       一个单元格
  @param value      值
  @param dateFormat 日期格式
  @return 返回传入的Cell