|
|
@@ -40,7 +40,6 @@ public class Download{
|
|
|
*/
|
|
|
public static List<String> parseXmlFileToSqls(File file,Statement statement){
|
|
|
List<String> sqls = new ArrayList<String>();
|
|
|
- Statement stm=statement;
|
|
|
String mainTableUpdateSql = null;
|
|
|
String updateDetailConditon = null;
|
|
|
List<Map<String,String>> detailXmlConfig = null;
|
|
|
@@ -98,7 +97,7 @@ public class Download{
|
|
|
logSql = getLogXmlDataAndInterceptorSql(mainData,detailData,xmlConfig,statement,fileName);
|
|
|
sqls.addAll(logSql);
|
|
|
try {
|
|
|
- stm.close();
|
|
|
+ statement.close();
|
|
|
} catch (SQLException e1) {
|
|
|
e1.printStackTrace();
|
|
|
}
|
|
|
@@ -460,7 +459,7 @@ public class Download{
|
|
|
try {
|
|
|
Map<String,Object> servMap = JdbcUtil.getFtpConfigs();
|
|
|
Map<String,Object> ftpMap = (Map<String,Object>)servMap.get(depot);
|
|
|
- if ("N_YITOA_LHCT-SF".equals(depot)||"N_YITOA_LHCT-ZX".equals(depot)){
|
|
|
+ if ("N_YITOA_LHCT-SF".equals(depot)){
|
|
|
sftp = new SFTPUtil(ftpMap.get("user").toString(),ftpMap.get("password").toString(),
|
|
|
ftpMap.get("ip").toString(),
|
|
|
Integer.parseInt(ftpMap.get("port").toString()));
|
|
|
@@ -474,7 +473,7 @@ public class Download{
|
|
|
}
|
|
|
if(client!=null||sftp!=null) {
|
|
|
List<File> files = null;
|
|
|
- if ("N_YITOA_LHCT-SF".equals(depot)||"N_YITOA_LHCT-ZX".equals(depot)) {
|
|
|
+ if ("N_YITOA_LHCT-SF".equals(depot)) {
|
|
|
files = sftp.download(ftpMap.get("downloadpath").toString());
|
|
|
|
|
|
}else if("N_YITOA_LHCT-SLC".equals(depot)){
|
|
|
@@ -486,7 +485,6 @@ public class Download{
|
|
|
String fileName = "";
|
|
|
if (files != null && files.size() > 0) {
|
|
|
connect = JdbcUtil.getConnectBySob(sob);
|
|
|
- Statement statement = connect.createStatement();
|
|
|
if (connect != null) {
|
|
|
for (File file : files) {
|
|
|
try {
|
|
|
@@ -495,6 +493,7 @@ public class Download{
|
|
|
if (!checkXmlFileToSqlToEnterprise(file, enterprise)) {
|
|
|
continue;
|
|
|
}
|
|
|
+ Statement statement = connect.createStatement();
|
|
|
sqls = parseXmlFileToSqls(file, statement);
|
|
|
if (sqls == null) {
|
|
|
continue;
|
|
|
@@ -506,9 +505,6 @@ public class Download{
|
|
|
if ("N_YITOA_LHCT-SF".equals(depot)) {
|
|
|
String s = file.getName().substring(0, file.getName().indexOf(".")) + ".xml";
|
|
|
Boolean rename = sftp.rename(ftpMap.get("downloadpath").toString() + "/" + s, "goodsreceipt/backup/" + s);
|
|
|
- }else if("N_YITOA_LHCT-ZX".equals(depot)){
|
|
|
- String s = file.getName().substring(0, file.getName().indexOf(".")) + ".xml";
|
|
|
- Boolean rename = sftp.rename(ftpMap.get("downloadpath").toString() + "/" + s,ftpMap.get("downloadpath").toString() + "/bak/" + s);
|
|
|
} else {
|
|
|
//移动处理完的文件到bak文件夹下
|
|
|
client.rename(file.getName(), "bak/" + file.getName());
|