Sfoglia il codice sorgente

更新文件导出功能

liuxinglong 6 anni fa
parent
commit
bd20f86a71

+ 1 - 1
.idea/misc.xml

@@ -7,7 +7,7 @@
       </list>
     </option>
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/out" />
   </component>
 </project>

+ 0 - 0
exe.path_IS_UNDEFINED/logs/log_debug.log


+ 0 - 0
exe.path_IS_UNDEFINED/logs/log_error.log


File diff suppressed because it is too large
+ 0 - 466
exe.path_IS_UNDEFINED/logs/log_info.log


File diff suppressed because it is too large
+ 0 - 466
exe.path_IS_UNDEFINED/logs/log_run.log


+ 0 - 1
pom.xml

@@ -158,7 +158,6 @@
             <artifactId>mina-core</artifactId>
             <version>2.0.9</version>
         </dependency>
-
         <dependency>
             <groupId>org.apache.mina</groupId>
             <artifactId>mina-transport-serial</artifactId>

+ 4 - 4
src/main/java/co/dc/aptiv/MaterielFrame.java

@@ -401,9 +401,9 @@ public class MaterielFrame extends JFrame {
 //                    int typei = AptivApp.materielService.isExistByParam("type", typeVal, 2, 0);
                     if (dpni == 1) {
                         JOptionPane.showMessageDialog(MaterielFrame.this, "DPN已存在,请重新填写DPN", "提示", JOptionPane.ERROR_MESSAGE);
-                    } else if (dpni == 2) {
+                    } /*else if (dpni == 2) {
                         JOptionPane.showMessageDialog(MaterielFrame.this, "DPN的位数不等于8位", "提示", JOptionPane.ERROR_MESSAGE);
-                    } else if (cpni == 1) {
+                    }*/ else if (cpni == 1) {
                         JOptionPane.showMessageDialog(MaterielFrame.this, "CPN已存在,请重新填写CPN", "提示", JOptionPane.ERROR_MESSAGE);
                     } else if (cpni == 2) {
                         JOptionPane.showMessageDialog(MaterielFrame.this, "CPN的位数不等于10位", "提示", JOptionPane.ERROR_MESSAGE);
@@ -522,9 +522,9 @@ public class MaterielFrame extends JFrame {
 //                    int typei = AptivApp.materielService.isExistByParam("type", typeVal, 2, materiel.getId());
                     if (dpni == 1) {
                         JOptionPane.showMessageDialog(MaterielFrame.this, "DPN已存在,请重新填写DPN", "提示", JOptionPane.ERROR_MESSAGE);
-                    } else if (dpni == 2) {
+                    } /*else if (dpni == 2) {
                         JOptionPane.showMessageDialog(MaterielFrame.this, "DPN的位数不等于8位", "提示", JOptionPane.ERROR_MESSAGE);
-                    } else if (cpni == 1) {
+                    }*/ else if (cpni == 1) {
                         JOptionPane.showMessageDialog(MaterielFrame.this, "CPN已存在,请重新填写CPN", "提示", JOptionPane.ERROR_MESSAGE);
                     } else if (cpni == 2) {
                         JOptionPane.showMessageDialog(MaterielFrame.this, "CPN的位数不等于10位", "提示", JOptionPane.ERROR_MESSAGE);

+ 7 - 6
src/main/java/co/dc/aptiv/common/XLSService.java

@@ -20,7 +20,7 @@ public class XLSService {
 	// private static short XLS_ENCODING = HSSFWorkbook.ENCODING_UTF_16;
 
 	// 定制日期格式
-	private static String DATE_FORMAT = "yyyy/mm/dd hh:mm:ss"; // "m/d/yy h:mm"
+	private static String DATE_FORMAT = "yyyy/mm/dd hh:mm:ss";
 
 	// 定制浮点数格式
 	private static String NUMBER_FORMAT = "#,##0.00";
@@ -90,7 +90,6 @@ public class XLSService {
 	public void setStringCell(int index, String value) {
 		HSSFCell cell = this.row.createCell((short) index);
 		cell.setCellType(HSSFCell.CELL_TYPE_STRING);
-		// cell.setEncoding(XLS_ENCODING);
 		cell.setCellValue(value);
 	}
 
@@ -104,11 +103,13 @@ public class XLSService {
 	 */
 	public void setCalendarCell(int index, Calendar value) {
 		HSSFCell cell = this.row.createCell((short) index);
-		// cell.setEncoding(XLS_ENCODING);
 		cell.setCellValue(value.getTime());
-		HSSFCellStyle cellStyle = workbook.createCellStyle(); // 建立新的cell样式
-		cellStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat(DATE_FORMAT)); // 设置cell样式为定制的日期格式
-		cell.setCellStyle(cellStyle); // 设置该cell日期的显示格式
+		// 建立新的cell样式
+		HSSFCellStyle cellStyle = workbook.createCellStyle();
+		// 设置cell样式为定制的日期格式
+		cellStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat(DATE_FORMAT));
+		// 设置该cell日期的显示格式
+		cell.setCellStyle(cellStyle);
 	}
 
 	/**