刘韬 пре 2 година
родитељ
комит
0f5d48c60f

+ 1 - 1
DataFusion/src/com/zskk/config/ZskkConfig.java

@@ -118,7 +118,7 @@ public class ZskkConfig extends JFinalConfig {
 		
 		//统计打印数量
 	    Cron4jPlugin pnData = new Cron4jPlugin();
-	    pnData.addTask("*/59 * * * *", new PrintNumTask());
+	    pnData.addTask("0 */2 * * *", new PrintNumTask());
 		me.add(pnData);
 	}
 

+ 2 - 2
DataFusion/src/com/zskk/control/ViewController.java

@@ -339,7 +339,7 @@ public class ViewController extends Controller {
 	
 	public void cspp() {
 		DataService dService = ServiceFactory.getService(DataService.class);
-		List<Record> records = Db.use("print").find("select * from IMAGEVIEW where ADDTIME >? and PRINTED=?",this.getPara("time"),"true");
+		List<Record> records = Db.use("print").find("select * from IMAGEVIEW where PRINTED=? and PRINTTIME >?","true",this.getPara("time"));
 		for (Record record : records) {
 			try {
 				if (record == null) {
@@ -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", parseStringToDate3(record.getStr("ADDTIME")));
+				annex_params.put("print_time", parseStringToDate3(record.getStr("PRINTTIME")));
 				dService.savePrint(annex_params);
 			} catch (Exception e) {
 				// TODO: handle exception

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

@@ -24,7 +24,7 @@ public class PrintNumTask implements ITask {
 	public void run() {
 		// TODO Auto-generated method stub
 		DataService dService = ServiceFactory.getService(DataService.class);
-		List<Record> records = Db.use("print").find("select * from IMAGEVIEW where ADDTIME >? and PRINTED=?",parseStringToDate1(),"true");
+		List<Record> records = Db.use("print").find("select * from IMAGEVIEW where PRINTED=? and PRINTTIME >?", "true", parseStringToDate1());
 		for (Record record : records) {
 			try {
 				if (record == null) {
@@ -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", parseStringToDate(record.getStr("ADDTIME")));
+				annex_params.put("print_time", parseStringToDate(record.getStr("PRINTTIME")));
 	      		ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
 				tService.execute(() -> {
 		      		dService.savePrint(annex_params);
@@ -89,7 +89,7 @@ public class PrintNumTask implements ITask {
 		Date date = new Date();
 		String timeString = null;
 		Long i = date.getTime();
-		Long j = i - 172800000;
+		Long j = i - 21600000;
 		Date newdate = new Date(j);
 		timeString = sdf.format(newdate);
 		return timeString;