修复bug
This commit is contained in:
parent
332d77a208
commit
59e3bb0a05
@ -2,7 +2,7 @@
|
||||
<project version="4">
|
||||
<component name="dataSourceStorageLocal">
|
||||
<data-source name="@10.39.0.86" uuid="18e54f09-a43b-4c32-8386-8d030a8f8277">
|
||||
<database-info product="Oracle" version="Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options" jdbc-version="4.0" driver-name="Oracle JDBC driver" driver-version="12.1.0.2.0">
|
||||
<database-info product="Oracle" version="Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options" jdbc-version="4.0" driver-name="Oracle JDBC driver" driver-version="12.1.0.2.0" family="ORACLE" exact-version="0.0">
|
||||
<extra-name-characters>$#</extra-name-characters>
|
||||
<identifier-quote-string>"</identifier-quote-string>
|
||||
</database-info>
|
||||
@ -14,7 +14,7 @@
|
||||
<unqualified-resolve-schemas>*:IDST0,PUBLIC</unqualified-resolve-schemas>
|
||||
</data-source>
|
||||
<data-source name="jdbc:oracle:thin:@" uuid="755f1bc0-dca9-4b58-9b4e-412602f82e74">
|
||||
<database-info product="Oracle" version="Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options" jdbc-version="4.0" driver-name="Oracle JDBC driver" driver-version="12.1.0.2.0">
|
||||
<database-info product="Oracle" version="Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options" jdbc-version="4.0" driver-name="Oracle JDBC driver" driver-version="12.1.0.2.0" family="ORACLE" exact-version="0.0">
|
||||
<extra-name-characters>$#</extra-name-characters>
|
||||
<identifier-quote-string>"</identifier-quote-string>
|
||||
</database-info>
|
||||
|
1
代码/jsp/telsale_import/.idea/vcs.xml
generated
1
代码/jsp/telsale_import/.idea/vcs.xml
generated
@ -2,5 +2,6 @@
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -160,6 +160,9 @@ public class DataImport
|
||||
|
||||
ifxStmt.execute();
|
||||
|
||||
//成功写入提示
|
||||
importResult = importResult + "第" + rowIndex + "行,保单号" + policyNo + ",转介绍信息入成功!<br>";
|
||||
|
||||
successCount++;
|
||||
}
|
||||
catch( StaffCodeNotExistException error )
|
||||
@ -175,8 +178,18 @@ public class DataImport
|
||||
}
|
||||
catch( SQLException error )
|
||||
{
|
||||
//写入错误
|
||||
importResult = importResult + "第" + rowIndex + "行,保单号" + policyNo + ",数据库写入错误,错误信息:" + error.getMessage() + "。<br>";
|
||||
int errorCode = error.getErrorCode();
|
||||
|
||||
switch ( errorCode )
|
||||
{
|
||||
case -268: //保单号重复
|
||||
importResult = importResult + "第" + rowIndex + "行,保单号" + policyNo + ",已录入过转介绍信息!" + error.getCause() + "。<br>";
|
||||
break;
|
||||
|
||||
default: //写入错误
|
||||
importResult = importResult + "第" + rowIndex + "行,保单号" + policyNo + ",数据库写入错误,错误信息:" + error.getCause() + "。<br>";
|
||||
break;
|
||||
}
|
||||
|
||||
//标志位
|
||||
isSuccess = false;
|
||||
@ -195,6 +208,10 @@ public class DataImport
|
||||
//计数
|
||||
failCount++;
|
||||
}
|
||||
finally
|
||||
{
|
||||
ifxConn.commit();
|
||||
}
|
||||
}
|
||||
|
||||
rowIndex++;
|
||||
@ -202,15 +219,15 @@ public class DataImport
|
||||
}
|
||||
|
||||
//判断标志位,如果为false,则说明在保存过程中出现了错误,放弃所有过程,进行回滚。
|
||||
if ( isSuccess == true )
|
||||
{
|
||||
//oracleConn.commit();
|
||||
ifxConn.commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
ifxConn.rollback();
|
||||
}
|
||||
// if ( isSuccess == true )
|
||||
// {
|
||||
// //oracleConn.commit();
|
||||
// ifxConn.commit();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// ifxConn.rollback();
|
||||
// }
|
||||
|
||||
//清理
|
||||
xlsFile.close();
|
||||
@ -218,19 +235,19 @@ public class DataImport
|
||||
|
||||
//日志
|
||||
importMessage = "读取记录数量:" + (rowIndex - 1) +
|
||||
"<br>正确记录数量:" + successCount +
|
||||
"<br>错误记录数量:" + failCount;
|
||||
"<br>写入记录数量:" + successCount +
|
||||
"<br>错误记录数量:" + failCount + "<br>";
|
||||
|
||||
if ( failCount != 0 )
|
||||
{
|
||||
//有错误的记录,输出提示
|
||||
importMessage += "<br>请根据错误提示修正后重新导入!<br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
//无错误的记录,输出成功提示
|
||||
importMessage += "<br>文件已成功导入!<br>";
|
||||
}
|
||||
// if ( failCount != 0 )
|
||||
// {
|
||||
// //有错误的记录,输出提示
|
||||
// importMessage += "<br>请根据错误提示修正后重新导入!<br>";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //无错误的记录,输出成功提示
|
||||
// importMessage += "<br>文件已成功导入!<br>";
|
||||
// }
|
||||
|
||||
//追加导入记录
|
||||
importMessage += importResult;
|
||||
@ -242,6 +259,11 @@ public class DataImport
|
||||
{
|
||||
String value = null;
|
||||
|
||||
if ( cell == null )
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
switch ( cell.getCellType() )
|
||||
{
|
||||
case HSSFCell.CELL_TYPE_NUMERIC:
|
||||
|
@ -19,9 +19,9 @@ import com.cpic.telsale.DataImport.*;
|
||||
public class uploadDataProcessor extends HttpServlet
|
||||
{
|
||||
private String tempPathRoot; //临时文件目录
|
||||
// private String oracleURL;
|
||||
// private String oracleUserName;
|
||||
// private String oraclePassword;
|
||||
private String oracleURL;
|
||||
private String oracleUserName;
|
||||
private String oraclePassword;
|
||||
private String informixURL;
|
||||
private String telsalePolicyOperatorListTableName; //informix库电销转介绍表名
|
||||
|
||||
@ -29,9 +29,9 @@ public class uploadDataProcessor extends HttpServlet
|
||||
public void init( ServletConfig config ) throws ServletException
|
||||
{
|
||||
//获取参数
|
||||
// oracleURL = ( String )config.getServletContext().getInitParameter( "oracleURL" );
|
||||
// oracleUserName = ( String )config.getServletContext().getInitParameter( "oracleUserName" );
|
||||
// oraclePassword = ( String )config.getServletContext().getInitParameter( "oraclePassword" );
|
||||
oracleURL = ( String )config.getServletContext().getInitParameter( "oracleURL" );
|
||||
oracleUserName = ( String )config.getServletContext().getInitParameter( "oracleUserName" );
|
||||
oraclePassword = ( String )config.getServletContext().getInitParameter( "oraclePassword" );
|
||||
|
||||
//informix
|
||||
informixURL = ( String )config.getServletContext().getInitParameter( "informixURL" );
|
||||
|
@ -35,6 +35,14 @@
|
||||
<param-name>informixURL</param-name>
|
||||
<param-value>jdbc:informix-sqli://10.187.11.163:9096/ywgl_xm:INFORMIXSERVER=pxmcx2;newcodeset=GBK,8859-1,819;user=ccx99;password=ct0IT17!</param-value>
|
||||
</context-param>
|
||||
<context-param>
|
||||
<param-name>ora_xmcx1_url</param-name>
|
||||
<param-value>jdbc:oracle:thin:@10.39.0.86:1521:xmcx1;user=ywglxt;password=ywglxt";</param-value>
|
||||
</context-param>
|
||||
<context-param>
|
||||
<param-name>ora_jgy_url</param-name>
|
||||
<param-value>jdbc:oracle:thin:@10.187.11.164:1521:xmcx1;user=ywglxt;password=ywglxt";</param-value>
|
||||
</context-param>
|
||||
<context-param>
|
||||
<param-name>telsalePolicyOperatorListTableName</param-name>
|
||||
<param-value>w_dxbd_i</param-value>
|
||||
|
Loading…
x
Reference in New Issue
Block a user