|
@@ -18,12 +18,9 @@ import com.uas.util.JdbcUtil;
|
|
|
public class Download {
|
|
|
public static boolean updateAndLog(Connection connection,Map<String,Object> map,String depot,File file){
|
|
|
boolean bool = false;
|
|
|
- String hk = "";
|
|
|
List<String> sqls = new ArrayList<String>();
|
|
|
String content = BaseUtil.getStringByFile(file);
|
|
|
- if("true".equals(map.get("hk"))){
|
|
|
- hk = "YHND_HK.";
|
|
|
- }
|
|
|
+ String hk = (String) map.get("hk");
|
|
|
sqls.add("insert into "+hk+"xmldatalog (xl_id,xl_data,xl_date,xl_depot,xl_code,xl_from,xl_status,xl_filename)"
|
|
|
+ " values("+hk+"XMLDATALOG_SEQ.NEXTVAL,'"+content+"',sysdate,'"+depot+"','"+map.get("code")+"','download','success','"+file.getName()+"')");
|
|
|
sqls.add(map.get("sql").toString());
|
|
@@ -63,10 +60,11 @@ public class Download {
|
|
|
map = BaseUtil.getDataAndSqlByXml(file);
|
|
|
bol = updateAndLog(con,map,key,file);
|
|
|
if(bol){
|
|
|
- if("1".equals(key)||"2".equals(key)|"3".equals(key)){
|
|
|
+ if("1".equals(key)||"2".equals(key)||"3".equals(key)){
|
|
|
client.rename(file.getName(),".."+ File.separator + "reply_bak"+ File.separator + file.getName());
|
|
|
}else{
|
|
|
- FtpUtil.deleteFile(client,file.getName());
|
|
|
+ client.rename(file.getName(),".."+ File.separator + "reply_bak"+ File.separator + file.getName());
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|