koul 5 years ago
parent
commit
fb8c730be4

+ 25 - 0
.idea/artifacts/yhnd_attach_jar.xml

@@ -0,0 +1,25 @@
+<component name="ArtifactManager">
+  <artifact type="jar" name="yhnd-attach:jar">
+    <output-path>$PROJECT_DIR$/classes/artifacts/yhnd_attach_jar</output-path>
+    <root id="archive" name="yhnd-attach.jar">
+      <element id="directory" name="META-INF">
+        <element id="file-copy" path="$PROJECT_DIR$/META-INF/MANIFEST.MF" />
+      </element>
+      <element id="module-output" name="yhnd-attach" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/lib/org.springframework.core-3.2.2.RELEASE.jar" path-in-jar="/" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/lib/log4j-1.2.15.jar" path-in-jar="/" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/lib/spring-test-5.1.6.RELEASE.jar" path-in-jar="/" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/lib/jackson-core-asl-1.9.13.jar" path-in-jar="/" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/lib/dom4j-1.6.1.jar" path-in-jar="/" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/lib/flexjson-2.1.jar" path-in-jar="/" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/lib/junit.jar" path-in-jar="/" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/lib/httpcore-4.4.10.jar" path-in-jar="/" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/lib/commons-io-2.4.jar" path-in-jar="/" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/lib/spring-web-5.1.5.RELEASE.jar" path-in-jar="/" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/lib/ojdbc6-11.2.0.jar" path-in-jar="/" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/lib/jackson-mapper-asl-1.9.13.jar" path-in-jar="/" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/lib/commons-csv-1.4.jar" path-in-jar="/" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/lib/commons-net-3.6.jar" path-in-jar="/" />
+    </root>
+  </artifact>
+</component>

+ 6 - 0
.idea/google-java-format.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="GoogleJavaFormatSettings">
+    <option name="enabled" value="false" />
+  </component>
+</project>

+ 36 - 0
.idea/inspectionProfiles/Project_Default.xml

@@ -0,0 +1,36 @@
+<component name="InspectionProjectProfileManager">
+  <profile version="1.0">
+    <option name="myName" value="Project Default" />
+    <inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="TOP_LEVEL_CLASS_OPTIONS">
+        <value>
+          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+          <option name="REQUIRED_TAGS" value="" />
+        </value>
+      </option>
+      <option name="INNER_CLASS_OPTIONS">
+        <value>
+          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+          <option name="REQUIRED_TAGS" value="" />
+        </value>
+      </option>
+      <option name="METHOD_OPTIONS">
+        <value>
+          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+          <option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
+        </value>
+      </option>
+      <option name="FIELD_OPTIONS">
+        <value>
+          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+          <option name="REQUIRED_TAGS" value="" />
+        </value>
+      </option>
+      <option name="IGNORE_DEPRECATED" value="false" />
+      <option name="IGNORE_JAVADOC_PERIOD" value="true" />
+      <option name="IGNORE_DUPLICATED_THROWS" value="false" />
+      <option name="IGNORE_POINT_TO_ITSELF" value="false" />
+      <option name="myAdditionalJavadocTags" value="date" />
+    </inspection_tool>
+  </profile>
+</component>

+ 9 - 0
.idea/libraries/commons_io_2_4.xml

@@ -0,0 +1,9 @@
+<component name="libraryTable">
+  <library name="commons-io-2.4">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/lib/commons-io-2.4.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES />
+  </library>
+</component>

+ 0 - 9
.idea/libraries/httpclient_4_5_6.xml

@@ -1,9 +0,0 @@
-<component name="libraryTable">
-  <library name="httpclient-4.5.6">
-    <CLASSES>
-      <root url="jar://$PROJECT_DIR$/lib/httpclient-4.5.6.jar!/" />
-    </CLASSES>
-    <JAVADOC />
-    <SOURCES />
-  </library>
-</component>

+ 0 - 9
.idea/libraries/httpmime_4_5_6.xml

@@ -1,9 +0,0 @@
-<component name="libraryTable">
-  <library name="httpmime-4.5.6">
-    <CLASSES>
-      <root url="jar://$PROJECT_DIR$/lib/httpmime-4.5.6.jar!/" />
-    </CLASSES>
-    <JAVADOC />
-    <SOURCES />
-  </library>
-</component>

+ 0 - 9
.idea/libraries/org_springframework_beans_3_1_2_RELEASE.xml

@@ -1,9 +0,0 @@
-<component name="libraryTable">
-  <library name="org.springframework.beans-3.1.2.RELEASE">
-    <CLASSES>
-      <root url="jar://$PROJECT_DIR$/lib/org.springframework.beans-3.1.2.RELEASE.jar!/" />
-    </CLASSES>
-    <JAVADOC />
-    <SOURCES />
-  </library>
-</component>

+ 0 - 9
.idea/libraries/spring_context_5_1_5_RELEASE.xml

@@ -1,9 +0,0 @@
-<component name="libraryTable">
-  <library name="spring-context-5.1.5.RELEASE">
-    <CLASSES>
-      <root url="jar://$PROJECT_DIR$/lib/spring-context-5.1.5.RELEASE.jar!/" />
-    </CLASSES>
-    <JAVADOC />
-    <SOURCES />
-  </library>
-</component>

+ 1 - 1
.idea/modules.xml

@@ -2,7 +2,7 @@
 <project version="4">
   <component name="ProjectModuleManager">
     <modules>
-      <module fileurl="file://$PROJECT_DIR$/yhnd.iml" filepath="$PROJECT_DIR$/yhnd.iml" />
+      <module fileurl="file://$PROJECT_DIR$/yhnd-attach.iml" filepath="$PROJECT_DIR$/yhnd-attach.iml" />
     </modules>
   </component>
 </project>

+ 124 - 0
.idea/uiDesigner.xml

@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Palette2">
+    <group name="Swing">
+      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
+      </item>
+      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
+        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
+        <initial-values>
+          <property name="text" value="Button" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="RadioButton" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="CheckBox" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="Label" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
+          <preferred-size width="-1" height="20" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
+      </item>
+    </group>
+  </component>
+</project>

+ 3 - 0
META-INF/MANIFEST.MF

@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Main-Class: com.uas.main.Main
+

BIN
lib/org.springframework.core-3.2.2.RELEASE.jar


BIN
lib/spring-test-5.1.6.RELEASE.jar


BIN
lib/spring-web-5.1.5.RELEASE.jar


+ 267 - 0
src/com/uas/fileUtil/FileUtil.java

@@ -0,0 +1,267 @@
+package com.uas.fileUtil;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.http.entity.ContentType;
+import org.springframework.mock.web.MockMultipartFile;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.*;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.UUID;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+import java.util.zip.ZipOutputStream;
+
+/**
+ * @author yingp
+ *
+ */
+public class FileUtil {
+
+	/**
+	 * 压缩文件
+	 * 
+	 * @param srcFiles
+	 *            待压缩文件
+	 * @param zipFile
+	 *            压缩后保存的文件
+	 * @return
+	 */
+	public static boolean zip(String[] srcFiles, String zipFile) {
+		String[] fileNames = new String[srcFiles.length];
+		for (int i = 0; i < srcFiles.length; i++) {
+			fileNames[i] = getFileName(srcFiles[i]);
+		}
+		try {
+			BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(zipFile));
+			ZipOutputStream zos = new ZipOutputStream(bos);
+			String entryName = null;
+			for (int i = 0; i < fileNames.length; i++) {
+				entryName = fileNames[i];
+				ZipEntry entry = new ZipEntry(entryName);
+				zos.putNextEntry(entry);
+				BufferedInputStream bis = new BufferedInputStream(new FileInputStream(srcFiles[i]));
+				byte[] b = new byte[1024];
+				while (bis.read(b, 0, 1024) != -1) {
+					zos.write(b, 0, 1024);
+				}
+				bis.close();
+				zos.closeEntry();
+			}
+			zos.flush();
+			zos.close();
+			return true;
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		return false;
+	}
+
+	/**
+	 * 解析文件名
+	 * 
+	 * @param filePath
+	 * @return
+	 */
+	public static String getFileName(String filePath) {
+		int location = filePath.lastIndexOf(File.separator);
+		String fileName = filePath.substring(location + 1);
+		return fileName;
+	}
+
+	/**
+	 * 解压文件
+	 * 
+	 * @param zipFile
+	 *            压缩文件
+	 * @param parentDir
+	 *            解压到的路径
+	 * @return
+	 */
+	public static boolean unzip(String zipFile, String parentDir) {
+		try {
+			BufferedInputStream bis = new BufferedInputStream(new FileInputStream(zipFile));
+			ZipInputStream zis = new ZipInputStream(bis);
+			BufferedOutputStream bos = null;
+			ZipEntry entry = null;
+			while ((entry = zis.getNextEntry()) != null) {
+				String entryName = entry.getName();
+				bos = new BufferedOutputStream(new FileOutputStream(parentDir + entryName));
+				int b = 0;
+				while ((b = zis.read()) != -1) {
+					bos.write(b);
+				}
+				bos.flush();
+				bos.close();
+			}
+			zis.close();
+			return true;
+		} catch (IOException e) {
+
+		}
+		return false;
+	}
+
+	/**
+	 * 保存文件
+	 * 
+	 * <pre>
+	 * 优先判断是否设置了指定的文件系统,否则保存到本地
+	 * </pre>
+	 * 
+	 * @param file
+	 * @return
+	 */
+	public static String saveFile(MultipartFile file, String em_code) {
+		String path = uploadToLocal(file, em_code);
+		if(path.contains("\\")){//上传到本地返回路径修改
+			path=path.replace("\\", "/");
+		}
+		return path;
+	}
+
+	/**
+	 * 上传到文件系统
+	 * 
+	 * <pre>
+	 * rest接口
+	 * Post: http://10.10.100.200:9999/file/upload
+	 * Return: {"path": "http://dfs.ubtoc.com/group1/M00/00/32/CgpkyFc6OBiALiQ4ABetuG5lVxw921.pdf"}
+	 * </pre>
+	 * 
+	 * <pre>
+	 * 基于dubbo的hessian方式调用服务已经测试通过,下个版本saas系统建议采用
+	 * </pre>
+	 * 
+	 * @return
+	 */
+	private static String uploadToFs(MultipartFile file) {
+		return null;
+	}
+
+	/**
+	 * 上传到本地磁盘
+	 * 
+	 * @return
+	 */
+	private static String uploadToLocal(MultipartFile file, String em_code) {
+		String path =getFilePath(file.getOriginalFilename(), em_code);
+		try {
+			FileUtils.copyInputStreamToFile(file.getInputStream(), new File(path));
+			return path;
+		} catch (IOException e1) {
+			e1.printStackTrace();
+		}
+		return null;
+	}
+
+	/**
+	 * 生成文件实际存放的硬盘唯一路径
+	 * 
+	 * @param fileName
+	 * @return
+	 */
+	private static String getFilePath(String fileName, String em_code) {
+		String uuid = UUID.randomUUID().toString().replaceAll("\\-", "");
+		String suffix = fileName.indexOf(".") != -1 ? fileName.substring(fileName.lastIndexOf("."), fileName.length()) : "";
+		String path = "/home/uas/program/uas/1/webapps/postattach";
+		File file = new File(path);
+		if (!file.isDirectory()) {
+			file.mkdir();
+			path = path + File.separator + em_code;
+			new File(path).mkdir();
+		} else {
+			path = path + File.separator + em_code;
+			file = new File(path);
+			if (!file.isDirectory()) {
+				file.mkdir();
+			}
+		}
+		return path + File.separator + uuid + suffix;
+	}
+	
+	/** 
+	 * 删除单个文件 
+	 * @param   sPath 被删除文件path 
+	 * @return 删除成功返回true,否则返回false 
+	 */  
+	public static boolean deleteFile(String sPath) {  
+	    boolean flag = false;  
+	    if (sPath.startsWith("http:") || sPath.startsWith("https:") || sPath.startsWith("ftp:") || 
+	    		sPath.startsWith("sftp:") || sPath.startsWith("B2B://")) {
+	    	return false;
+		}
+	    File file = new File(sPath);  
+	    // 路径为文件且不为空则进行删除  
+	    if (file.isFile() && file.exists()) {  
+	        file.delete();  
+	        flag = true;  
+	    }  
+	    return flag;  
+	}
+
+	public static Boolean fileUp(Connection connection,MultipartFile file,String sob){
+		boolean result = false;
+		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		String path = saveFile(file, "ADMIN");
+		String filename = file.getOriginalFilename().replaceAll(",", ",");
+		int size = (int) file.getSize();
+		if(size>0) {
+			Statement statement = null;
+			try {
+				statement = connection.createStatement();
+				String sql = "select " + sob + ".EMAILFILEPATH.nextval from dual";
+				ResultSet resultSet = statement.executeQuery(sql);
+				if (resultSet.next()) {
+					int id = resultSet.getInt(1);
+					String sql1 =
+							"INSERT INTO " + sob + ".filepath(fp_id,fp_path,fp_size,fp_man,fp_date,fp_name) values(" + id + ",'" + path +
+									"'," + size + ",'" + "管理员" + "'," + "to_date('" + format.format(new Date()) + "','yyyy-mm-dd HH24:mi:ss')" + ",'" + filename + "')";
+					int i = statement.executeUpdate(sql1);
+					if (i > 0) {
+						String substring = null;
+						if (filename.indexOf("-") != -1) {
+							substring = filename.substring(0, filename.indexOf("-"));
+						} else
+							substring = filename.substring(0, filename.indexOf("."));
+						//String sql2 = "select " + sob + ".FTPATTCHTEMP_SEQ.nextval from dual";
+						//ResultSet resultSet2 = statement.executeQuery(sql2);
+						String sql3 = "INSERT INTO " + sob + ".FTPATTCHTEMP(FT_ID,FT_ATTCH,FT_PIINOUTNO,FT_STATUS,FT_INSERTDATE,FT_FILENAME,FT_SOB)values(" + sob + ".FTPATTCHTEMP_SEQ.nextval,'" + id + ";','" + substring + "','GET',to_date('" + format.format(new Date()) + "','yyyy-mm-dd HH24:mi:ss')" + ",'" + filename + "','" + sob + "')";
+						int i1 = statement.executeUpdate(sql3);
+						if (i1 > 0) {
+							result = true;
+						}
+					}
+
+				/*String sql2 =
+						"update " + sob + ".prodinout set pi_attach = '" + id + ";' where pi_inoutno ='" + substring+"'";
+					int i = statement.executeUpdate(sql2);
+					if (i > 0) {
+						result = true;
+					}*/
+				}
+				statement.close();
+				return result;
+			} catch (SQLException e) {
+				e.printStackTrace();
+			}
+		}
+		return result;
+	}
+
+	public static MultipartFile FileToMultipartFile(File file){
+		try {
+			FileInputStream fileInputStream = new FileInputStream(file);
+			MultipartFile multipartFile = new MockMultipartFile(file.getName(), file.getName(),
+					ContentType.APPLICATION_OCTET_STREAM.toString(), fileInputStream);
+			return multipartFile;
+		} catch (Exception e) {
+			return null;
+		}
+	}
+}

+ 215 - 48
src/com/uas/main/Download.java

@@ -1,46 +1,218 @@
 package com.uas.main;
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.sql.Connection;
 import java.sql.SQLException;
+import java.sql.Statement;
+import java.text.SimpleDateFormat;
 import java.util.*;
 
+import com.uas.fileUtil.FileUtil;
 import org.apache.commons.net.ftp.FTPClient;
 
 import com.uas.util.BaseUtil;
 import com.uas.util.FtpUtil;
 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;
-		List<String> sqls = new ArrayList<String>();	
-		String content = BaseUtil.getStringByFile(file);
-		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());
-		bool = JdbcUtil.executeSqls(connection, sqls);
-		return bool;
-	}
+import org.apache.http.entity.ContentType;
+import org.springframework.mock.web.MockMultipartFile;
+import org.springframework.web.multipart.MultipartFile;
 
+public class Download {
 	public static void run(){
-		downloadByDepotAndSob("YHND_SZ");
-		downloadByDepotAndSob("YHND_HK");
-		downloadByDepotAndSob("YITOA_ZX");
+		downloadBySob();
 	}
-	
-	@SuppressWarnings("unchecked")
-	public static void downloadByDepotAndSob(String sob){
-		Map<String,Object> servMap = JdbcUtil.getFtpConfigs();
-		Set<String> set = servMap.keySet();
-		Map<String, Object> map = null;
-		Connection con = null;
-		con = JdbcUtil.getConnectBySob(sob);
-		boolean bol = false;
-		if(con==null) return;
-		for(String key:set){
+    public static void downloadBySob(){
+        Map<String,Object> servMap = JdbcUtil.getFtpConfigs();
+        Set<String> set = servMap.keySet();
+        boolean bol = false;
+        Connection consz ;
+        Connection conhk ;
+        Connection conzx ;
+        for(String key:set){
+            if("12".equals(key)||"13".equals(key)){
+                Map<String,Object> ftpMap = (Map<String,Object>)servMap.get(key);
+                FTPClient client = null;
+                try {
+                    client = FtpUtil.connect(ftpMap);
+                    if(client!=null){
+						String directory = ftpMap.get("downloadpath").toString();
+						List<File> files = FtpUtil.downloadAllFile(client,directory);
+						List<File> fileListSZ = new ArrayList<>();
+						List<File> fileListHK = new ArrayList<>();
+						List<File> fileListZX = new ArrayList<>();
+						List<File> fileListERROR = new ArrayList<>();
+						List<File> fileListMove = new ArrayList<>();
+						if(files!=null&&files.size()>0){
+							for(File file:files){
+								String s = file.getName().substring(0, 4);
+								if ("SZCK".equals(s)){
+									fileListSZ.add(file);
+								}else if ("HKCK".equals(s)){
+									fileListHK.add(file);
+								}else if("YTCK".equals(s)){
+									fileListZX.add(file);
+								}else {
+									fileListERROR.add(file);
+								}
+							}
+						}
+						String fileName = "";
+						if (fileListSZ!=null&&fileListSZ.size()>0){
+							String sob = "YHND_SZ";
+							consz = JdbcUtil.getConnectBySob(sob);
+							for (File file:fileListSZ) {
+								fileName += "," + file.getName();
+								MultipartFile multipartFile = FileUtil.FileToMultipartFile(file);
+								if (multipartFile!=null && (int)multipartFile.getSize()>0){
+									bol =FileUtil.fileUp(consz,multipartFile,sob);
+									if (bol){
+										fileListMove.add(file);
+									}
+								}
+							}
+							consz.close();
+						}
+						if (fileListHK!=null&&fileListHK.size()>0){
+							String sob = "YHND_HK";
+							conhk = JdbcUtil.getConnectBySob(sob);
+							for (File file:fileListHK) {
+								fileName += "," + file.getName();
+								MultipartFile multipartFile = FileUtil.FileToMultipartFile(file);
+								if (multipartFile!=null && (int)multipartFile.getSize()>0){
+									bol =FileUtil.fileUp(conhk,multipartFile,sob);
+									if (bol){
+										fileListMove.add(file);
+									}
+								}
+							}
+							conhk.close();
+						}
+						if (fileListZX!=null&&fileListZX.size()>0){
+							String sob = "YITOA_ZX";
+							conzx = JdbcUtil.getConnectBySob(sob);
+							for (File file:fileListZX) {
+								fileName += "," + file.getName();
+								MultipartFile multipartFile = FileUtil.FileToMultipartFile(file);
+								if (multipartFile!=null && (int)multipartFile.getSize()>0){
+									bol =FileUtil.fileUp(conzx,multipartFile,sob);
+									if (bol){
+										fileListMove.add(file);
+									}
+								}
+							}
+							conzx.close();
+						}
+						if (fileListMove!=null&&fileListMove.size()>0){
+							for (File file:fileListMove) {
+								client.rename(file.getName(), "/PakingL_bak/PL_" + file.getName()+"_"+new Date().getTime());
+							}
+						}
+						if (fileListERROR!=null&&fileListERROR.size()>0){
+							for (File file:fileListERROR) {
+								client.rename(file.getName(),"/PakingL_error/" + file.getName()+"_"+new Date().getTime());
+							}
+						}
+
+						String directory1 = ftpMap.get("out").toString();
+						List<File> files1 = FtpUtil.downloadAllFile(client,directory1);
+						List<File> fileRTSZ = new ArrayList<>();
+						List<File> fileRTHK = new ArrayList<>();
+						List<File> fileRTZX = new ArrayList<>();
+						List<File> fileRTERROR = new ArrayList<>();
+						List<File> fileRTMove = new ArrayList<>();
+						if(files1!=null&&files1.size()>0){
+							for(File file:files1){
+								String s = file.getName().substring(0, 4);
+								if ("SZCK".equals(s)){
+									fileRTSZ.add(file);
+								}else if ("HKCK".equals(s)){
+									fileRTHK.add(file);
+								}else if("YTCK".equals(s)){
+									fileRTZX.add(file);
+								}else {
+									fileRTERROR.add(file);
+								}
+							}
+						}
+						if (fileRTSZ!=null&&fileRTSZ.size()>0){
+							String sob = "YHND_SZ";
+							consz = JdbcUtil.getConnectBySob(sob);
+                            //Statement statement = consz.createStatement();
+							for (File file:fileRTSZ) {
+								fileName += "," + file.getName();
+								MultipartFile multipartFile = FileUtil.FileToMultipartFile(file);
+								if (multipartFile!=null && (int)multipartFile.getSize()>0){
+                                    bol =FileUtil.fileUp(consz,multipartFile,sob);
+									if (bol){
+										fileRTMove.add(file);
+									}
+								}
+							}
+							consz.close();
+						}
+						if (fileRTHK!=null&&fileRTHK.size()>0){
+							String sob = "YHND_HK";
+							conhk = JdbcUtil.getConnectBySob(sob);
+                            //Statement statement = conhk.createStatement();
+							for (File file:fileRTHK) {
+								fileName += "," + file.getName();
+								MultipartFile multipartFile = FileUtil.FileToMultipartFile(file);
+								if (multipartFile!=null && (int)multipartFile.getSize()>0){
+									bol =FileUtil.fileUp(conhk,multipartFile,sob);
+									if (bol){
+										fileRTMove.add(file);
+									}
+								}
+							}
+							conhk.close();
+						}
+						if (fileRTZX!=null&&fileRTZX.size()>0){
+							String sob = "YITOA_ZX";
+							conzx = JdbcUtil.getConnectBySob(sob);
+                            //Statement statement = conzx.createStatement();
+							for (File file:fileRTZX) {
+								fileName += "," + file.getName();
+								MultipartFile multipartFile = FileUtil.FileToMultipartFile(file);
+								if (multipartFile!=null && (int)multipartFile.getSize()>0){
+									bol =FileUtil.fileUp(conzx,multipartFile,sob);
+									if (bol){
+										fileRTMove.add(file);
+									}
+								}
+							}
+							conzx.close();
+						}
+						if (fileRTMove!=null&&fileRTMove.size()>0){
+							for (File file:fileRTMove) {
+                                client.rename(file.getName(), "/RT_bak/RT_" + file.getName()+"_"+new Date().getTime());
+							}
+						}
+						if (fileRTERROR!=null&&fileRTERROR.size()>0){
+							for (File file:fileRTERROR) {
+                                client.rename(file.getName(), "/RT_error/" + file.getName()+"_"+new Date().getTime());
+							}
+						}
+                        if(!"".equals(fileName)){
+                            System.out.println("download " + fileName.substring(1) + " from " + ftpMap.get("ip") + " path:" + ftpMap.get("downloadpath"));
+                            BaseUtil.getLogger().info("download " + fileName.substring(1) + " from " + ftpMap.get("ip") + " path:" + ftpMap.get("downloadpath"));
+                        }
+
+                    }
+                } catch (Exception e) {
+                    BaseUtil.getLogger().error(e.toString());
+                    e.printStackTrace();
+                }finally{
+                    if(client!=null){
+                        FtpUtil.closeFtpClient(client);
+                    }
+                }
+            }else if("14".equals(key)){
 				Map<String,Object> ftpMap = (Map<String,Object>)servMap.get(key);
 				FTPClient client = null;
+				Map<String, Object> map = null;
+				Connection con = null;
+				con = JdbcUtil.getConnectBySob("YHND_SZ");
 				try {
 					client = FtpUtil.connect(ftpMap);
 					if(client!=null){
@@ -50,47 +222,42 @@ public class Download {
 							for(File file:files){
 								try{
 									fileName += "," + file.getName();
-									map = BaseUtil.getDataAndSqlByXml(file);
-									bol = updateAndLog(con,map,key,file);
+									bol = BaseUtil.getDataAndSqlByXml(con,file);
 									if(bol){
-										if("1".equals(key)||"2".equals(key)||"3".equals(key)){
-											client.rename(file.getName(),"/reply_bak/"+file.getName());
-										}else{
-											client.rename(file.getName(),"/reply_bak/"+file.getName());
-											//FtpUtil.deleteFile(client,file.getName());
-										}
+										client.rename(file.getName(),"/stock_bak/"+file.getName());
 									}
-									
+
 								}catch(Exception e){
 									e.printStackTrace();
 									BaseUtil.getLogger().error(e.toString());
 									continue;
 								}
 								System.out.println("download " + file.getName() + " from " + ftpMap.get("ip") + " path:" + ftpMap.get("downloadpath"));
-							}				
+							}
 						}
 						if(!"".equals(fileName)){
 							System.out.println("download " + fileName.substring(1) + " from " + ftpMap.get("ip") + " path:" + ftpMap.get("downloadpath"));
 							BaseUtil.getLogger().info("download " + fileName.substring(1) + " from " + ftpMap.get("ip") + " path:" + ftpMap.get("downloadpath"));
-						}					
+						}
 					}
 				} catch (Exception e) {
 					BaseUtil.getLogger().error(e.toString());
 					e.printStackTrace();
 				}finally{
+					try{
+						if(con!=null){
+							con.close();
+						}
+					}catch(SQLException e){
+						BaseUtil.getLogger().error(e.toString());
+					}finally{
+						con = null;
+					}
 					if(client!=null){
-						FtpUtil.closeFtpClient(client);					
+						FtpUtil.closeFtpClient(client);
 					}
 				}
-		}
-		try{
-			if(con!=null){
-				con.close();
 			}
-		}catch(SQLException e){
-			BaseUtil.getLogger().error(e.toString());
-		}finally{
-			con = null;
-		}
-	}
+        }
+    }
 }

+ 0 - 3
src/com/uas/main/Main.java

@@ -4,11 +4,8 @@ import com.uas.util.BaseUtil;
 
 public class Main {
 	public static void main(String[] args) {
-		System.out.println("run start!");
 		BaseUtil.getLogger().info("run start!");
-		Upload.run();
 		Download.run();
-		System.out.println("run over!");
 		BaseUtil.getLogger().info("run over!");
 	}
 }

+ 0 - 240
src/com/uas/main/Upload.java

@@ -1,240 +0,0 @@
-package com.uas.main;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.OutputStreamWriter;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.commons.net.ftp.FTPClient;
-import org.codehaus.jackson.map.ObjectMapper;
-
-import com.uas.util.BaseUtil;
-import com.uas.util.FtpUtil;
-import com.uas.util.JdbcUtil;
-
-public class Upload {
-	public static Pattern pat = Pattern.compile("\\{(.*?)\\}");	
-	
-	public static String getHeader(String xmltemp){ //获取Header
-		return xmltemp.substring(xmltemp.indexOf("<?xml"),xmltemp.indexOf("<Item>"));
-	}
-	
-	public static String getDetailItem(String xmltemp){ //获取Item
-		return xmltemp.substring(xmltemp.indexOf("<Item>"),xmltemp.indexOf("</Detail"));
-	}
-	
-	public static String replaceFieldByData(String str,Map<String,Object> data){ //替换xml字段为具体数据
-		Matcher mat = pat.matcher(str);
-		String res = str;
-		while(mat.find()){
-			if(data.get(mat.group(1).toUpperCase())!=null){
-				res = res.replace("{" + mat.group(1).toUpperCase() + "}", replaceXmlSpecialSymbol(data.get(mat.group(1).toUpperCase()).toString()));				
-			}else{
-				res = res.replace("{" + mat.group(1).toUpperCase() + "}", "");					
-			}
-		}	
-		return res;
-	}
-	
-	public static String replaceXmlSpecialSymbol(String data){
-		return data.replace("&", "&amp;")
-				.replace("<", "&lt;")
-				.replace(">", "&gt;")
-				.replace("'", "&apos;")
-				.replace("\"", "&quot;");
-	}
-	
-	public static String getCurrentdate(String format){ //获致当时日期
-		DateFormat df = new SimpleDateFormat(format);
-		Date today = Calendar.getInstance().getTime();	
-		return df.format(today);
-	}
-	
-	
-	public static File createXmlFile(String header,String items,String template,String id,String type){ //生成xml文件
-		File xmlFile = null;
-		try{
-			String xml = header + items + "</Detail>" + template.toString().substring(template.toString().indexOf("</Detail>")+9);
-			xmlFile = new File(System.getProperty("java.io.tmpdir")+File.separator + type + "-" + getCurrentdate("yyyyMMdd") + id+".xml");
-			if(!xmlFile.exists()){
-				xmlFile.createNewFile();
-			}
-			FileWriter fw = new FileWriter(xmlFile.getAbsoluteFile());
-            OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(xmlFile.getAbsoluteFile()),"UTF-8");
-            out.write(xml);
-            out.flush();
-            out.close();
-			//fw.write(xml);
-			fw.close();				
-		}catch(Exception e){
-			BaseUtil.getLogger().error(e.toString());
-			e.printStackTrace();
-		}
-		return xmlFile;
-	}
-	
-	@SuppressWarnings("unchecked")
-	public static File decodeAndGenerateXml(String template,String datastr,String xlid,String type) throws Exception{
-		String header = getHeader(template.toString());
-		String detailItem = getDetailItem(template.toString());
-		String currentDate = getCurrentdate("yyyyMMddHHmm");
-		/*System.err.println(datastr);
-		System.err.println(datastr.substring(5400,5450));*/
-		Map<String,Object> data = new ObjectMapper().readValue(datastr, HashMap.class);
-		data.put("FILENAME", type + "-" + data.get("FILENAME"));
-		data.put("CURRENTDATE", currentDate);
-		header = replaceFieldByData(header,data);
-		
-		StringBuffer sb = new StringBuffer();
-		List<Map<String,Object>> detailData = (List<Map<String,Object>>)data.get("DETAIL");
-		for(Map<String,Object> detail:detailData){
-			sb.append(replaceFieldByData(detailItem,detail));
-		}
-		
-		File file = createXmlFile(header,sb.toString(),template.toString(),xlid,type);	
-		return file;
-	}
-	
-	public static void turnToFormal(Connection connection,String id,File file,String sob){ //临时表数据转入正式
-		Statement statement = null;
-		try{
-			connection.setAutoCommit(false);
-			statement = connection.createStatement();
-			statement.execute("insert into "+sob + "."+"xmldatalog(xl_id,xl_data,xl_date,xl_depot,xl_caller,xl_code,xl_from,xl_status,xl_sourceid,xl_filename) "
-					+ "select "+sob + "."+"XMLDATALOG_SEQ.NEXTVAL,xl_data,sysdate,xl_depot,xl_caller,xl_code,'upload','success',xl_sourceid,'"+file.getName()+"' from xmldatalogtemp where xl_id=" + id);
-			statement.execute("delete from "+sob + "."+"xmldatalogtemp where xl_id=" + id);
-			connection.commit();
-			BaseUtil.getLogger().info("trun to formal success!");	
-		}catch(Exception e){
-			try {
-				connection.rollback();
-			} catch (SQLException e1) {
-				BaseUtil.getLogger().error(e1.toString());
-				e1.printStackTrace();
-			}
-			BaseUtil.getLogger().error(e.toString());
-			e.printStackTrace();
-		}finally{
-			try{
-				if(statement!=null){
-					statement.close();
-				}			
-			}catch(Exception e){
-				BaseUtil.getLogger().error(e.toString());
-			}
-			statement = null;
-		}
-	}
-	
-	public static boolean upload(FTPClient client,String ip,String folder,File file){
-		boolean flag = false;
-		if(client!=null){
-			flag = FtpUtil.uploadFile(client, folder,file);
-		}
-		System.out.println("upload " + file.getName() + " to " + ip + ":" + folder + " " + (flag?"success":"fail")+"");
-		BaseUtil.getLogger().info("upload " + file.getName() + " to " + ip + ":" + folder + " " + (flag?"success":"fail")+"");	
-		return flag;
-	}
-	
-	public static void run() {
-		uploadBySob("YHND_SZ");
-		uploadBySob("YHND_HK");
-		uploadBySob("YITOA_ZX");
-	}
-	
-	@SuppressWarnings("unchecked")
-	public static void uploadBySob(String sob) {		
-		Statement statement = null;
-		FTPClient client = null;
-		
-		Connection con = null;
-		con = JdbcUtil.getConnectBySob(sob);
-		
-		try{
-			statement = con.createStatement();
-			ResultSet rs = statement.executeQuery("select * from "+sob+"."+"xmldatalogtemp where xl_depot is not null order by xl_depot desc");	
-			String depot = "";				
-			while(rs.next()){
-				try{
-					String xldepot = rs.getString("xl_depot");
-					String type = rs.getString("xl_type");
-					if(!"null".equals(xldepot)&&xldepot!=null&&!"null".equals(type)&&type!=null){
-						Object template = JdbcUtil.getXmlTemplate(con,sob).get(rs.getString("xl_caller")+"_" + xldepot);
-						if(template!=null){							
-							Map<String,Object> ftpConfig = JdbcUtil.getFtpConfigs();			
-							Map<String,Object> config = (Map<String,Object>)ftpConfig.get(xldepot);
-							String folder = config.get(type).toString();
-							
-							if(!depot.equals(xldepot)){ //连接ftp站点
-								if(client!=null){
-									FtpUtil.closeFtpClient(client);
-								}
-								depot = xldepot;
-								client = FtpUtil.connect(config,config.get(type).toString());
-							}
-							
-							File file = decodeAndGenerateXml(template.toString(),rs.getString("xl_data"),rs.getString("xl_id"),folder); //生成文件
-							boolean uploadSuccess = upload(client,config.get("ip").toString(),folder,file);
-							if(uploadSuccess){ //如果文件上传成功,则转入正式数据记录表
-								turnToFormal(con,rs.getString("xl_id"),file,sob); //转入正式
-							}														
-							file.delete();
-						}else{
-							BaseUtil.getLogger().info("caller:"+rs.getString("xl_caller")+" depot:"+xldepot+" template is null");
-						}
-					}else{
-						BaseUtil.getLogger().info("warehouse ftpdepot is null");
-					}
-				}catch(Exception e){
-					e.printStackTrace();
-					BaseUtil.getLogger().error(e.toString());
-					continue;
-				}
-			}
-			if(client!=null){
-				FtpUtil.closeFtpClient(client);
-				client = null;
-			}
-			try{
-				JdbcUtil.clearXmlTemplate();
-				con.close();
-			}catch(SQLException e){
-				e.printStackTrace();
-				BaseUtil.getLogger().error(e.toString());
-			}finally{
-				con = null;
-			}
-				
-
-		}catch(Exception e){
-			BaseUtil.getLogger().error(e.toString());
-			e.printStackTrace();
-		}finally{
-			if(statement!=null){
-				try {
-					statement.close();
-				} catch (SQLException e1) {
-					BaseUtil.getLogger().error(e1.toString());
-					e1.printStackTrace();
-				}
-				statement = null;				
-			}
-			if(client!=null){
-				FtpUtil.closeFtpClient(client);
-			}
-		}
-	}
-}

+ 148 - 70
src/com/uas/util/BaseUtil.java

@@ -5,12 +5,9 @@ import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Scanner;
+import java.sql.Connection;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 import org.apache.log4j.Logger;
 import org.apache.log4j.PropertyConfigurator;
@@ -20,6 +17,10 @@ import org.dom4j.io.SAXReader;
 
 
 public class BaseUtil {
+
+	public final static String REG_D = "\\d{4}-\\d{2}-\\d{2}";
+	public final static String REG_DT = "\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}";
+	public final static String REG_TS = "\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d{1}";
 	public static Logger logger;
 	
 	/**
@@ -40,22 +41,17 @@ public class BaseUtil {
 		}
 		return logger;
 	}
-	
+
 	/**
 	 * 解析xml文件,生成数据
 	 * @param file xml文件
 	 * @return
 	 */
 	@SuppressWarnings("unchecked")
-    public static Map<String,Object> getDataAndSqlByXml(File file){
-		Map<String,Object> map = new HashMap<String,Object>();
-		String json = "";
-		String sql = "";
-		String condition = "";
-		String code = "";
+	public static boolean getDataAndSqlByXml(Connection con , File file){
+		boolean bool = false;
+		List<String> sqls = new ArrayList<String>();
 		InputStream in = null;
-		String hkSob =null;
-		
 		try {
 			in = new FileInputStream(file);
 		} catch (FileNotFoundException e1) {
@@ -68,63 +64,121 @@ public class BaseUtil {
 			in.close();
 		} catch (Exception e1) {
 			e1.printStackTrace();
-		}  
+		}
 		Element root = doc.getRootElement();
-
 		List<Element> e = root.elements();
-    	for(Element el:e){
-        	 String name = el.getName();
-        	 if(name=="DocumentNumber"){
-        		 json += ",\"FILENAME:\":\"" + el.getData() + "\"";
-        	 }else if(name=="DocumentANSDateTime"){
-        		 json += ",\"RESPONSEDATE:\":\"" + el.getData() + "\"";
-        		 sql += "PI_LOGISTICSDATE=to_date('" + el.getData() + "','yyyymmddHH24:mi'),";
-        	 }else if(name=="Status"){
-        		 json += ",\"PI_LOGISTICSSTATUS:\":\"" + el.getData() + "\"";
-        		 sql += "PI_LOGISTICSSTATUS='" + el.getData() + "',";
-        	 }else if(name=="TrackingNo"){
-        		 json += ",\"PI_LISTCODE:\":\"" + el.getData() + "\"";
-        		 sql += "PI_LISTCODE='" + el.getData() + "',";
-        	 }else if(name=="FreightCost"){
-        		 json += ",\"PI_FREIGHT:\":\"" + el.getData() + "\"";
-        		 sql += "PI_FREIGHT='" + el.getData() + "',";
-        	 }else if(name=="RefNo"){
-        		 code = el.getData().toString();
-        		 if(code.trim().toUpperCase().startsWith("HK")){
-        			 hkSob = "YHND_HK.";
-        		 }else if (code.trim().toUpperCase().startsWith("YT")){
-        			 hkSob = "YITOA_ZX.";
-        		 }else {
-					 hkSob = "YHND_SZ.";
-				 }
-        		 json += ",\"PI_INOUTNO:\":\"" + code + "\"";
-        		 condition = "PI_INOUTNO='"+code+"'";
-        	 }else if (name == "ExType"){
-				 json += ",\"PI_TRANSPORT:\":\"" + el.getData() + "\"";
-				 sql += "PI_TRANSPORT='" + el.getData() + "',";
-			 }else if(name == "ExNumber"){
-				 json += ",\"PI_LOGISTICSCODE:\":\"" + el.getData() + "\"";
-				 sql += "PI_LOGISTICSCODE='" + el.getData() + "',";
-			 }else if(name == "ExTime"){
-				 json += ",\"PI_GOODSDATE:\":\"" + el.getData() + "\"";
-				 sql += "PI_GOODSDATE=to_date('" + el.getData() + "','yyyymmddHH24:mi'),";
-			 }
-    	}
-    	if(!"".equals(json)){
-    		json = "{" + json.substring(1) + "}";
-    	}
-    	if(!"".equals(sql)&&hkSob != null){
-    		sql = "update " + hkSob + "prodinout set " + sql.substring(0, sql.lastIndexOf(",")) + " where " + condition;
-    	}
-    	map.put("json", json);
-    	map.put("sql", sql);
-    	map.put("code",code);
-    	map.put("hk",hkSob);
-    	return map;		
+		List<Map<String, Object>> maps = new ArrayList<>();
+		Object DocumentANSDateTime =null;
+		Object DocumentNumber = null;
+		for(Element el:e){
+			String name = el.getName();
+			if(name=="Header"){
+				List<Element> elements = el.elements();
+				for (Element ee:elements) {
+					String name1 = ee.getName();
+					if(name1=="DocumentNumber"){
+						DocumentNumber=ee.getData();
+					}else if(name1=="DocumentANSDateTime"){
+						DocumentANSDateTime=ee.getData();
+					}
+				}
+			}else if(name=="Detail"){
+				List<Element> elements = el.elements();
+				for (Element ee:elements) {
+					List<Element> elements1 = ee.elements();
+					String name1 = ee.getName();
+					if (name1=="Item") {
+						Map<String, Object> detailMap = new HashMap<>();
+						for (Element eel : elements1) {
+							String name2 = eel.getName();
+							if (name2 == "LineNo") {
+								detailMap.put("WDX_LineNo",eel.getData());
+							} else if (name2 == "WhouseType") {
+								detailMap.put("WDX_WhouseType",eel.getData());
+							} else if (name2 == "PrProdCode") {
+								detailMap.put("WDX_PrProdCode",eel.getData());
+							} else if (name2 == "PrDetail") {
+								detailMap.put("WDX_PrDetail",eel.getData());
+							} else if (name2 == "StcockDate") {
+								detailMap.put("WDX_StcockDate",eel.getData());
+							} else if (name2 == "StcockQty") {
+								detailMap.put("WDX_StcockQty",eel.getData());
+							} else if (name2 == "DC") {
+								detailMap.put("WDX_DC",eel.getData());
+							} else if (name2 == "ProductionDate") {
+								detailMap.put("WDX_ProductionDate",eel.getData());
+							} else if (name2 == "ProductionWeek") {
+								detailMap.put("WDX_ProductionWeek",eel.getData());
+							} else if (name2 == "LotNo") {
+								detailMap.put("WDX_LotNo",eel.getData());
+							} else if (name2 == "Brand") {
+								detailMap.put("WDX_Brand",eel.getData());
+							} else if (name2 == "Vender") {
+								detailMap.put("WDX_Vender",eel.getData());
+							} else if (name2 == "Origin") {
+								detailMap.put("WDX_Origin",eel.getData());
+							} else if (name2 == "WhouseName") {
+								detailMap.put("WDX_WhouseName",eel.getData());
+							}
+
+						}
+						detailMap.put("WDX_DocumentNumber",DocumentNumber);
+						detailMap.put("WDX_DocumentANSDateTime",DocumentANSDateTime);
+						maps.add(detailMap);
+					}
+				}
+			}
+		}
+		if (maps!=null&&maps.size()>0){
+			sqls = getInsertSqlbyMaps(maps, "YHND_SZ.WAREHOUSE_DETAILS_XML");
+			bool = JdbcUtil.executeSqls(con, sqls);
+		}
+		return bool;
+	}
+
+	public static List<String> getInsertSqlbyMaps(List<Map<String, Object>> maps, String table) {
+		List<String> sqls = new ArrayList<String>();
+		StringBuffer sb1 = null;
+		StringBuffer sb2 = null;
+		for (Map<String, Object> map : maps) {
+			Set<String> keys = map.keySet();
+			sb1 = new StringBuffer("INSERT into " + table + " (");
+			sb2 = new StringBuffer(" ");
+			for (Object key : keys) {
+				String field = (String) key;
+				Object value = map.get(key);
+				sb1.append(field);
+				sb1.append(",");
+				if (value != null) {
+					String val = value.toString();
+					if (val.matches(REG_D)) {// 判断是否是形如yyyy-mm-dd格式的日期类型数据
+						sb2.append(parseDateToOracleString("yyyy-MM-dd", val));
+					} else if (val.matches(REG_DT)) {
+						sb2.append(parseDateToOracleString("yyyy-MM-dd HH:mm", val));
+					} else if (val.matches(REG_TS)) {
+						sb2.append(parseDateToOracleString("yyyy-MM-dd HH:mm:ss", val.substring(0, val.lastIndexOf("."))));
+					} else if ("null".equals(val)) {
+						sb2.append("null");
+					} else if ("".equals(val.trim())) {
+						sb2.append("''");
+					} else if (val.contains("%n")) {
+						sb2.append("'" + val.replaceAll("%n", "\n") + "'");
+					} else if (val.contains("'")) {
+						sb2.append("'" + value.toString().replaceAll("'", "''") + "'");
+					} else {
+						sb2.append("'" + value + "'");
+					}
+				} else {
+					sb2.append("null");
+				}
+				sb2.append(",");
+			}
+			sqls.add(sb1.substring(0, sb1.length() - 1) + ") VALUES (" + sb2.substring(0, sb2.length() - 1) + ")");
+		}
+		return sqls;
 	}
-	
 	public static String getStringByFile(File file){
-    	String content = "";
+		String content = "";
 		try {
 			content = new Scanner(file).useDelimiter("\\Z").next();
 			content.replace("'", "''");
@@ -135,10 +189,10 @@ public class BaseUtil {
 		} catch (FileNotFoundException e) {
 			e.printStackTrace();
 			BaseUtil.getLogger().error(e.toString());
-		}		
+		}
 		return content;
 	}
-	
+
 	public static String splitAndConcat(String str, int length, String prevStr, String subStr, String concatStr) {
 		int strLen = str.length();
 		int len = (int) Math.ceil((double) strLen / length);
@@ -150,4 +204,28 @@ public class BaseUtil {
 		}
 		return buffer.toString();
 	}
+
+	/**
+	 * 日期转化成oracle格式to_date('2012-12-12', 'yyyy-MM-dd')
+	 *
+	 * @param format
+	 *            format type,for example: 'yyyy-MM-dd', 'yyyy-MM-dd HH:mm:ss'
+	 * @param dateString
+	 *            date{type=string}
+	 */
+	public static String parseDateToOracleString(String format, String dateString) {
+		if (format == null) {
+			format = "yyyy-MM-dd";
+		}
+		if (dateString == null || "".equals(dateString) || "null".equals(dateString)) {
+			SimpleDateFormat sdf = new SimpleDateFormat(format);
+			dateString = sdf.format(new Date());
+		}
+		if ("yyyy-MM-dd HH:mm".toUpperCase().equals(format.toUpperCase())) {
+			format = "yyyy-MM-dd HH24:mi";
+		} else {
+			format = "yyyy-MM-dd";
+		}
+		return "to_date('" + dateString + "','" + format + "')";
+	}
 }

+ 41 - 37
src/com/uas/util/FtpUtil.java

@@ -6,9 +6,14 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.util.*;
+import java.net.SocketException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
 
 import org.apache.commons.net.ftp.FTPClient;
+import org.apache.commons.net.ftp.FTPClientConfig;
 import org.apache.commons.net.ftp.FTPFile;
 import org.apache.commons.net.ftp.FTPReply;
 
@@ -43,7 +48,7 @@ public class FtpUtil {
 	
 	/**
 	 * 获取ftp连接,该连接指向ftp配置中的downloadpath文件夹
-	 * @param map //包含ftp连接配置的map
+	 * @param
 	 */
 	public static FTPClient connect(Map<String,Object> map) throws Exception {
 		return connect(map,map.get("downloadpath").toString());
@@ -51,7 +56,7 @@ public class FtpUtil {
 
 	/**
 	 * 获取ftp连接,该连接指向ftp配置中的downloadpath文件夹
-	 * @param map  //包含ftp连接配置的map
+	 * @param
 	 */
 	public static FTPClient connect(Map<String,Object> map,String path){
 		FTPClient ftp = null;
@@ -152,30 +157,13 @@ public class FtpUtil {
 		try {
 			ftpClient.enterLocalPassiveMode();
 			FTPFile[] ftpFiles = ftpClient.listFiles();
-			if (ftpFiles != null && ftpFiles.length > 0) {
-				ArrayList<FTPFile> list = new ArrayList<FTPFile>(Arrays.asList(ftpFiles)) ;
-				Collections.sort(list, new Comparator<FTPFile>() {
-					@Override
-					public int compare(FTPFile o1, FTPFile o2) {
-						long time = o1.getTimestamp().getTime().getTime();
-						long time1 = o2.getTimestamp().getTime().getTime();
-						if ( time>time1 ) {
-							return 1;
-						}
-						if (time == time1) {
-							return 0;
-						}
-						return -1;
-					}
-				});
-				for (FTPFile file : list) {
-					if(file.getName().toUpperCase().endsWith("." + fileType)){
-						File localFile = new File(System.getProperty("java.io.tmpdir") + File.separator + file.getName());
-						OutputStream os = new FileOutputStream(localFile);
-						ftpClient.retrieveFile(file.getName(), os);
-						os.close();
-						files.add(localFile);
-					}
+			for (FTPFile file : ftpFiles) {
+				if(file.getName().toUpperCase().endsWith("." + fileType)){
+					File localFile = new File(System.getProperty("java.io.tmpdir") + File.separator + file.getName());
+					OutputStream os = new FileOutputStream(localFile);
+					ftpClient.retrieveFile(file.getName(), os);
+					os.close();
+					files.add(localFile);					
 				}
 			}
 		} catch (Exception e) {
@@ -199,16 +187,32 @@ public class FtpUtil {
 			ftpClient.changeWorkingDirectory("/"+directory);// 转移到FTP服务器目录
 			FTPFile[] ftpFiles = ftpClient.listFiles();
 			//FTPFile[] newFtpFiles = ftpClient.listFiles("/re/");
-            for (FTPFile file : ftpFiles) {
-            	if (!".".equals(file.getName())&&!"..".equals(file.getName())){
-                File localFile = new File(System.getProperty("java.io.tmpdir") +File.separator + file.getName());
-                //
-                OutputStream os = new FileOutputStream(localFile);
-                ftpClient.retrieveFile(file.getName(), os);
-                os.close();
-                files.add(localFile);
-            	}
-            }
+			if (ftpFiles!=null && ftpFiles.length>0) {
+				if (ftpFiles.length>50){
+					for (int i = 0; i < 50; i++) {
+						FTPFile file = ftpFiles[i];
+						if (!".".equals(file.getName())&&!"..".equals(file.getName())){
+							File localFile = new File(System.getProperty("java.io.tmpdir") +File.separator + file.getName());
+							//
+							OutputStream os = new FileOutputStream(localFile);
+							ftpClient.retrieveFile(file.getName(), os);
+							os.close();
+							files.add(localFile);
+						}
+					}
+				}else {
+					for (FTPFile file : ftpFiles) {
+						if (!".".equals(file.getName())&&!"..".equals(file.getName())){
+							File localFile = new File(System.getProperty("java.io.tmpdir") +File.separator + file.getName());
+							//
+							OutputStream os = new FileOutputStream(localFile);
+							ftpClient.retrieveFile(file.getName(), os);
+							os.close();
+							files.add(localFile);
+						}
+					}
+				}
+			}
         } catch (Exception e) {
             BaseUtil.getLogger().error(e.toString());
             e.printStackTrace();

+ 0 - 2
src/com/uas/util/JdbcUtil.java

@@ -1,6 +1,5 @@
 package com.uas.util;
 
-import java.io.IOException;
 import java.io.InputStream;
 import java.sql.Connection;
 import java.sql.DriverManager;
@@ -12,7 +11,6 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Properties;
 import java.util.Set;
 
 import org.codehaus.jackson.map.ObjectMapper;

+ 3 - 3
src/properties/dbconfig.properties

@@ -1,16 +1,16 @@
 {
 	"YHND_SZ":{
-		"url":"jdbc:oracle:thin:@sz.hi-mantech.com:1521:orcl",
+		"url":"jdbc:oracle:thin:@127.0.0.1:1521:orcl",
 		"user":"YHND_SZ",
 		"password":"select!#%*("
 	},
 	"YHND_HK":{
-		"url":"jdbc:oracle:thin:@sz.hi-mantech.com:1521:orcl",
+		"url":"jdbc:oracle:thin:@127.0.0.1:1521:orcl",
 		"user":"YHND_HK",
 		"password":"select!#%*("
 	},
 	"YITOA_ZX":{
-		"url":"jdbc:oracle:thin:@sz.hi-mantech.com:1521:orcl",
+		"url":"jdbc:oracle:thin:@127.0.0.1:1521:orcl",
 		"user":"YITOA_ZX",
 		"password":"select!#%*("
 }

+ 28 - 150
src/properties/ftpconfig.properties

@@ -6,154 +6,32 @@
 		"password":"342521",
 		"downloadpath":"TEST"
 	},
-	"1":{
-		"ip":"ftp.eascs.com",
-		"port":21,
-		"user":"hi-mantech",
-		"password":"Ders8744",
-		"downloadpath":"HND_RECWMSRELS_2",
-		"in":"HND_WMSRECV",
-		"out":"HND_WMSRELS",
-		"remark":"怡亚通"
-	},
-	"2":{
-		"ip":"sz.hi-mantech.com",
-		"port":46688,
-		"user":"user",
-		"password":"user_123456",
-		"downloadpath":"WMSANS",
-		"in":"WMSRECV",
-		"out":"WMSRELS",
-		"remark":"上海仓库"
-	},
-	"3":{
-		"ip":"sz.hi-mantech.com",
-		"port":46688,
-		"user":"userzx",
-		"password":"user_123456",
-		"downloadpath":"WMSANS",
-		"in":"WMSRECV",
-		"out":"WMSRELS",
-		"remark":"上海仓库"
-	},
-	"4":{
-		"ip":"omsftp.icorebuy.com",
-		"port":21,
-		"user":"YHND04",
-		"password":"Yhnd#$%2019",
-		"downloadpath":"reply",
-		"in":"appointment_in",
-		"out":"distribute_in",
-		"remark":"旗丰"
-	},
-	"5":{
-		"ip":"omsftp.icorebuy.com",
-		"port":21,
-		"user":"YHND05",
-		"password":"Yhnd#$%2019",
-		"downloadpath":"reply",
-		"in":"appointment_in",
-		"out":"distribute_in",
-		"remark":"旗丰"
-	},
-	"6":{
-		"ip":"omsftp.icorebuy.com",
-		"port":21,
-		"user":"YHND03",
-		"password":"Yhnd@#$2018",
-		"downloadpath":"reply",
-		"in":"appointment_in",
-		"out":"distribute_in",
-		"remark":"\u65D7\u4E30-Megafone"
-	},
-	"7":{
-		"ip":"omsftp.icorebuy.com",
-		"port":21,
-		"user":"YHND02",
-		"password":"Yhnd*$@2017",
-		"downloadpath":"reply",
-		"in":"appointment_in",
-		"out":"distribute_in",
-		"remark":"旗丰"
-	},
-	"8":{
-		"ip":"sz.hi-mantech.com",
-		"port":46688,
-		"user":"userLY",
-		"password":"user_123456",
-		"downloadpath":"WMSANS",
-		"in":"WMSRECV",
-		"out":"WMSRELS",
-		"remark":"YHND_LY"
-	},
-	"9":{
-		"ip":"omsftp.icorebuy.com",
-		"port":21,
-		"user":"YHND06",
-		"password":"Yhnd#$%2019",
-		"downloadpath":"reply",
-		"in":"appointment_in",
-		"out":"distribute_in",
-		"remark":"YHND_Hunan"
-	},
-	"10":{
-		"ip":"omsftp.icorebuy.com",
-		"port":21,
-		"user":"YHND07",
-		"password":"Yhnd#$%2019",
-		"downloadpath":"reply",
-		"in":"appointment_in",
-		"out":"distribute_in",
-		"remark":"YHND_Wingtech"
-	},
-	"11":{
-		"ip":"omsftp.icorebuy.com",
-		"port":21,
-		"user":"YTZX02",
-		"password":"Yhnd#$%2019",
-		"downloadpath":"reply",
-		"in":"appointment_in",
-		"out":"distribute_in",
-		"remark":"YHND_Wingtech"
-	},
-	"12":{
-		"ip":"omsftp.icorebuy.com",
-		"port":21,
-		"user":"YHND09",
-		"password":"Yhnd#$%2019",
-		"downloadpath":"reply",
-		"in":"appointment_in",
-		"out":"distribute_in",
-		"remark":"YHND Tesla"
-	},
-	"13":{
-		"ip":"sz.hi-mantech.com",
-		"port":46688,
-		"user":"userDCL",
-		"password":"user_123456",
-		"downloadpath":"WMSANS",
-		"in":"WMSRECV",
-		"out":"WMSRELS",
-		"remark":"上海WGQ新仓库DCL"
-	},
-	"14":{
-		"ip":"ftp.roadsimple.net",
-		"port":13321,
-		"user":"yhnd",
-		"password":"442t78Mw",
-		"downloadpath":"reply",
-		"in":"appointment_in",
-		"out":"distribute_in",
-		"remark":"测试仓库"
-	},
-	"2_old":{
-		"ip":"218.255.13.107",
-		"port":21,
-		"user":"mantech",
-		"password":"mantech",
-		"downloadpath":"WMSANS",
-		"in":"WMSRECV",
-		"out":"WMSRELS",
-		"remark":"上海WGQ"
-	}
+    "12":{
+        "ip":"sz.hi-mantech.com",
+        "port":46688,
+        "user":"userHC",
+        "password":"user_123456",
+        "downloadpath":"PakingL",
+        "out":"RT",
+        "remark":"YHND_Wingtech"
+    },
+    "13":{
+        "ip":"omsftp.icorebuy.com",
+        "port":21,
+        "user":"YHND08",
+        "password":"Yhnd#$%2019",
+        "downloadpath":"PakingL",
+        "out":"RT",
+        "remark":"YHND_Wingtech"
+    },
+    "14":{
+        "ip":"ftp.roadsimple.net",
+        "port":13321,
+        "user":"yhnd",
+        "password":"442t78Mw",
+        "downloadpath":"stock",
+        "in":"appointment_in",
+        "out":"distribute_in",
+        "remark":"测试仓库"
+    }
 }

+ 0 - 69
src/properties/ftpconfig.properties.mine

@@ -1,69 +0,0 @@
-{
-	"local":{
-		"ip":"192.168.253.97",
-		"port":21,
-		"user":"luhg",
-		"password":"342521",
-		"downloadpath":"TEST"
-	},
-	"1":{
-		"ip":"ftp.eascs.com",
-		"port":21,
-		"user":"hi-mantech",
-		"password":"Ders8744",
-		"downloadpath":"HND_RECWMSRELS_2",
-		"in":"HND_WMSRECV",
-		"out":"HND_WMSRELS",
-		"remark":"怡亚通"
-	},
-	"2":{
-		"ip":"sz.hi-mantech.com",
-		"port":46688,
-		"user":"user",
-		"password":"user_123456",
-		"downloadpath":"WMSANS",
-		"in":"WMSRECV",
-		"out":"WMSRELS",
-		"remark":"上海仓库"
-	},
-	"3":{
-		"ip":"sz.hi-mantech.com",
-		"port":46688,
-		"user":"userzx",
-		"password":"userzx_123456",
-		"downloadpath":"WMSANS",
-		"in":"WMSRECV",
-		"out":"WMSRELS",
-		"remark":"上海仓库"
-	},
-	"6":{
-		"ip":"112.74.205.182",
-		"port":21,
-		"user":"YHND03",
-		"password":"Yhnd@#$2018",
-		"downloadpath":"reply",
-		"in":"appointment_in",
-		"out":"distribute_in",
-		"remark":"\u65D7\u4E30-Megafone"
-	},
-	"7":{
-		"ip":"112.74.205.182",
-		"port":21,
-		"user":"YHND02",
-		"password":"Yhnd*$@2017",
-		"downloadpath":"reply",
-		"in":"appointment_in",
-		"out":"distribute_in",
-		"remark":"旗丰"
-	},
-	"2_old":{
-		"ip":"218.255.13.107",
-		"port":21,
-		"user":"mantech",
-		"password":"mantech",
-		"downloadpath":"WMSANS",
-		"in":"WMSRECV",
-		"out":"WMSRELS",
-		"remark":"上海WGQ"
-	}
-}

+ 0 - 49
src/properties/ftpconfig.properties.r22716

@@ -1,49 +0,0 @@
-{
-	"local":{
-		"ip":"192.168.253.97",
-		"port":21,
-		"user":"luhg",
-		"password":"342521",
-		"downloadpath":"TEST"
-	},
-	"1":{
-		"ip":"ftp.eascs.com",
-		"port":21,
-		"user":"hi-mantech",
-		"password":"Ders8744",
-		"downloadpath":"HND_RECWMSRELS_2",
-		"in":"HND_WMSRECV",
-		"out":"HND_WMSRELS",
-		"remark":"怡亚通"
-	},
-	"2":{
-		"ip":"sz.hi-mantech.com",
-		"port":46688,
-		"user":"user",
-		"password":"user_123456",
-		"downloadpath":"WMSANS",
-		"in":"WMSRECV",
-		"out":"WMSRELS",
-		"remark":"上海仓库"
-	},
-	"7":{
-		"ip":"112.74.205.182",
-		"port":21,
-		"user":"YHND02",
-		"password":"Yhnd*$@2017",
-		"downloadpath":"reply",
-		"in":"appointment_in",
-		"out":"distribute_in",
-		"remark":"旗丰"
-	},
-	"2_old":{
-		"ip":"218.255.13.107",
-		"port":21,
-		"user":"mantech",
-		"password":"mantech",
-		"downloadpath":"WMSANS",
-		"in":"WMSRECV",
-		"out":"WMSRELS",
-		"remark":"上海WGQ"
-	}
-}

+ 0 - 89
src/properties/ftpconfig.properties.r25751

@@ -1,89 +0,0 @@
-{
-	"local":{
-		"ip":"192.168.253.97",
-		"port":21,
-		"user":"luhg",
-		"password":"342521",
-		"downloadpath":"TEST"
-	},
-	"1":{
-		"ip":"ftp.eascs.com",
-		"port":21,
-		"user":"hi-mantech",
-		"password":"Ders8744",
-		"downloadpath":"HND_RECWMSRELS_2",
-		"in":"HND_WMSRECV",
-		"out":"HND_WMSRELS",
-		"remark":"怡亚通"
-	},
-	"2":{
-		"ip":"sz.hi-mantech.com",
-		"port":46688,
-		"user":"user",
-		"password":"user_123456",
-		"downloadpath":"WMSANS",
-		"in":"WMSRECV",
-		"out":"WMSRELS",
-		"remark":"上海仓库"
-	},
-	"3":{
-		"ip":"sz.hi-mantech.com",
-		"port":46688,
-		"user":"userzx",
-		"password":"userzx_123456",
-		"downloadpath":"WMSANS",
-		"in":"WMSRECV",
-		"out":"WMSRELS",
-		"remark":"上海仓库"
-	},
-	"4":{
-		"ip":"112.74.205.182",
-		"port":21,
-		"user":"YHND04",
-		"password":"Yhnd#$%2019",
-		"downloadpath":"reply",
-		"in":"appointment_in",
-		"out":"distribute_in",
-		"remark":"旗丰"
-	},
-	"5":{
-		"ip":"112.74.205.182",
-		"port":21,
-		"user":"YHND05",
-		"password":"Yhnd#$%2019",
-		"downloadpath":"reply",
-		"in":"appointment_in",
-		"out":"distribute_in",
-		"remark":"旗丰"
-	},
-	"6":{
-		"ip":"112.74.205.182",
-		"port":21,
-		"user":"YHND03",
-		"password":"Yhnd@#$2018",
-		"downloadpath":"reply",
-		"in":"appointment_in",
-		"out":"distribute_in",
-		"remark":"\u65D7\u4E30-Megafone"
-	},
-	"7":{
-		"ip":"112.74.205.182",
-		"port":21,
-		"user":"YHND02",
-		"password":"Yhnd*$@2017",
-		"downloadpath":"reply",
-		"in":"appointment_in",
-		"out":"distribute_in",
-		"remark":"旗丰"
-	},
-	"2_old":{
-		"ip":"218.255.13.107",
-		"port":21,
-		"user":"mantech",
-		"password":"mantech",
-		"downloadpath":"WMSANS",
-		"in":"WMSRECV",
-		"out":"WMSRELS",
-		"remark":"上海WGQ"
-	}
-}

+ 2 - 7
yhnd.iml → yhnd-attach.iml

@@ -103,15 +103,10 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="library" name="httpclient-4.5.6" level="project" />
-    <orderEntry type="library" name="httpcore-4.4.10" level="project" />
-    <orderEntry type="library" name="spring-web-5.1.5.RELEASE" level="project" />
-    <orderEntry type="library" name="commons-io-1.3.2" level="project" />
     <orderEntry type="library" name="commons-io-2.4" level="project" />
-    <orderEntry type="library" name="spring-context-5.1.5.RELEASE" level="project" />
-    <orderEntry type="library" name="httpmime-4.5.6" level="project" />
+    <orderEntry type="library" name="httpcore-4.4.10" level="project" />
     <orderEntry type="library" name="org.springframework.core-3.2.2.RELEASE" level="project" />
-    <orderEntry type="library" name="org.springframework.beans-3.1.2.RELEASE" level="project" />
     <orderEntry type="library" name="spring-test-5.1.6.RELEASE" level="project" />
+    <orderEntry type="library" name="spring-web-5.1.5.RELEASE" level="project" />
   </component>
 </module>