Index: ssts-maintain/src/main/java/com/forgon/disinfectsystem/maintain/basic/service/MaintainManagerImpl.java =================================================================== diff -u -r25127 -r25190 --- ssts-maintain/src/main/java/com/forgon/disinfectsystem/maintain/basic/service/MaintainManagerImpl.java (.../MaintainManagerImpl.java) (revision 25127) +++ ssts-maintain/src/main/java/com/forgon/disinfectsystem/maintain/basic/service/MaintainManagerImpl.java (.../MaintainManagerImpl.java) (revision 25190) @@ -2151,6 +2151,56 @@ } } } + //////////////////////////// + // ForeignTousseApplication的下划线处理 + sql = String + .format(" select fta.id,fta.tousseName from %s fta where fta.tousseName like '%%__%%' escape '_' ", + ForeignTousseApplication.class.getSimpleName()); + resultSet = objectDao.executeSql(sql); + if (resultSet != null) { + try { + while (resultSet.next()) { + Long id = resultSet.getLong("id"); + String tousseName = resultSet.getString("tousseName"); + String rawTousseName = null; + if (tousseName == null) { + tousseName = ""; + } + int _index = tousseName.lastIndexOf("_"); + Long appID = null; + if (_index != -1) { + rawTousseName = tousseName.substring(0, _index); + if (_index < tousseName.length() - 1) { + String appIDStr = tousseName.substring(_index + 1); + appID = NumberUtils.toLong(appIDStr); + } + } + String updateSqlFormat = null; + if (!DatabaseUtil.isPoIdValid(appID)) { +// updateSqlFormat = String.format( +// " update %s set name='%s' where id=%s", +// ClassifiedItem.class.getSimpleName(), +// tousseName, id); + } else { + updateSqlFormat = String + .format(" update %s set tousseName='%s' where id=%s", + ForeignTousseApplication.class.getSimpleName(), + rawTousseName, id); + objectDao.excuteSQL(updateSqlFormat); + } + } + } catch (SQLException e) { + dataUpdater.logInfo(e.getMessage()); + e.printStackTrace(); + throw new RuntimeException(e.getMessage()); + } finally { + try { + resultSet.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + } dataUpdater.logInfo(msg); } @@ -2314,6 +2364,14 @@ e.printStackTrace(); } } + if(conn != null){ + try { + conn.close(); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } } }