刘韬 2 éve
szülő
commit
ea29165cf2

+ 25 - 1
DataFusion/src/com/zskk/control/ViewController.java

@@ -349,7 +349,7 @@ public class ViewController extends Controller {
 				annex_params.put("institution_id", PropKit.get("institution_id"));
 				annex_params.put("type", "2");
 				annex_params.put("code", record.getStr("CHECKID"));
-				annex_params.put("print_time", record.getStr("ADDTIME"));
+				annex_params.put("print_time", parseStringToDate3(record.getStr("ADDTIME")));
 				dService.savePrint(annex_params);
 			} catch (Exception e) {
 				// TODO: handle exception
@@ -360,6 +360,30 @@ public class ViewController extends Controller {
 		renderText(records.toString());
 	}
 	
+	/**
+	 * 日期字符串格式转换
+	 * @param dateStr
+	 * @return
+	 */
+	private String parseStringToDate3(String dateStr) {
+		if (dateStr == null) {
+			return "";
+		}
+		SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.fff");
+	    Date date = null;
+	    String timeString = null;
+		try {
+			date = sdf.parse(dateStr);
+			SimpleDateFormat sdf2= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+			timeString = sdf2.format(date);
+		} catch (ParseException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+        return timeString;
+	}
+	
 	/**
 	 * 日期字符串格式转换
 	 * 

+ 3 - 3
DataFusion/src/com/zskk/task/PrintNumTask.java

@@ -34,7 +34,7 @@ public class PrintNumTask implements ITask {
 				annex_params.put("institution_id", PropKit.get("institution_id"));
 				annex_params.put("type", "2");
 				annex_params.put("code", record.getStr("CHECKID"));
-				annex_params.put("print_time", record.getStr("ADDTIME"));
+				annex_params.put("print_time", parseStringToDate(record.getStr("ADDTIME")));
 	      		ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
 				tService.execute(() -> {
 		      		dService.savePrint(annex_params);
@@ -63,12 +63,12 @@ public class PrintNumTask implements ITask {
 		if (dateStr == null) {
 			return "";
 		}
-		SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.fff");
 	    Date date = null;
 	    String timeString = null;
 		try {
 			date = sdf.parse(dateStr);
-			SimpleDateFormat sdf2= new SimpleDateFormat("yyyyMMdd");
+			SimpleDateFormat sdf2= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
 			timeString = sdf2.format(date);
 		} catch (ParseException e) {