<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                /** * 復制sour里屬性不為空的值到obje為空的屬性 * * @param obje * 目標實體類 * @param sour * 源實體類 * @param isCover * 是否保留obje類里不為null的屬性值(true為保留源值,屬性為null則賦值) * @return obje */ public static Object Copy(Object obje, Object sour, boolean isCover) { Field[] fields = sour.getClass().getDeclaredFields(); for (int i = 0, j = fields.length; i < j; i++) { String propertyName = fields[i].getName(); Object propertyValue = getProperty(sour, propertyName); if (isCover) { if (getProperty(obje, propertyName) == null && propertyValue != null) { Object setProperty = setProperty(obje, propertyName, propertyValue); } } else { Object setProperty = setProperty(obje, propertyName, propertyValue); } } return obje; } /** * 給bean賦值 * * @param bean * @param propertyName * @param value * @return */ private static Object setProperty(Object bean, String propertyName, Object value) { Class clazz = bean.getClass(); try { Field field = clazz.getDeclaredField(propertyName); Method method = clazz.getDeclaredMethod( getSetterName(field.getName()), new Class[] { field.getType() }); return method.invoke(bean, new Object[] { value }); } catch (Exception e) { } return null; } /** * 得到值 * * @param bean * @param propertyName * @return */ private static Object getProperty(Object bean, String propertyName) { Class clazz = bean.getClass(); try { Field field = clazz.getDeclaredField(propertyName); Method method = clazz.getDeclaredMethod( getGetterName(field.getName()), new Class[] {}); return method.invoke(bean, new Object[] {}); } catch (Exception e) { } return null; } /** * 得到setter方法 * * @param propertyName * 變量名 * @return */ private static String getSetterName(String propertyName) { // String method = "set" + propertyName.substring(0, 1).toUpperCase() + // propertyName.substring(1); String method; if (propertyName.length() > 1 && Character.isUpperCase(propertyName.charAt(1))) { method = "set" + propertyName; } else { method = "set" + propertyName.substring(0, 1).toUpperCase() + propertyName.substring(1); } return method; } /** * 根據變量名得到get方法 * * @param propertyName * @return */ private static String getGetterName(String propertyName) { String method; if (propertyName.length() > 1 && Character.isUpperCase(propertyName.charAt(1))) { method = "get" + propertyName; } else { method = "get" + propertyName.substring(0, 1).toUpperCase() + propertyName.substring(1); } return method; } public static Object getCellFormatValue(Cell cell) { Object cellValue = null; if (cell != null) { // 判斷cell類型 switch (cell.getCellType()) { case NUMERIC: { cellValue = String.valueOf(cell.getNumericCellValue()); break; } case FORMULA: { // 判斷cell是否為日期格式 if (DateUtil.isCellDateFormatted(cell)) { // 轉換為日期格式YYYY-mm-dd // cellValue = cell.getDateCellValue(); cellValue = new SimpleDateFormat("yyyy-MM-dd").format(cell .getDateCellValue()); } else { // 數字 cellValue = String.valueOf(cell.getNumericCellValue()); } break; } case STRING: { cellValue = cell.getRichStringCellValue().getString(); break; } default: cellValue = ""; } } else { cellValue = ""; } return cellValue; } /** * 獲得取值位置單元格。 * * @param sh * @param point * @param labColIndex * @param labRowIndex * @param currentrow * @return */ private static Cell getCell(Sheet sh, String point, int labColIndex, int labRowIndex, int currentrow) { int colIndex = -1; int rowIndex = -1; if (point.equalsIgnoreCase("N")) { colIndex = labColIndex; rowIndex = currentrow; } if (point.equalsIgnoreCase("U")) { colIndex = labColIndex; rowIndex = labRowIndex - 2; } if (point.equalsIgnoreCase("D")) { colIndex = labColIndex; rowIndex = labRowIndex; } if (point.equalsIgnoreCase("L")) { colIndex = labColIndex - 1; rowIndex = labRowIndex - 1; } if (point.equalsIgnoreCase("R")) { colIndex = labColIndex + 1; rowIndex = labRowIndex - 1; } if (point.equalsIgnoreCase("C")) { colIndex = labColIndex; rowIndex = labRowIndex - 1; } Row row = sh.getRow(rowIndex); if (row != null) { return row.getCell(colIndex); } return null; } public static Object getMergedRegionValue(Sheet sheet, int row, int column) { int sheetMergeCount = sheet.getNumMergedRegions(); for (int i = 0; i < sheetMergeCount; i++) { CellRangeAddress ca = sheet.getMergedRegion(i); int firstColumn = ca.getFirstColumn(); int lastColumn = ca.getLastColumn(); int firstRow = ca.getFirstRow(); int lastRow = ca.getLastRow(); if (row >= firstRow && row <= lastRow) { if (column >= firstColumn && column <= lastColumn) { Row fRow = sheet.getRow(firstRow); Cell fCell = fRow.getCell(firstColumn); return CellUtil.getCellValue(fCell, true); } } } return null; }
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看