Ver código fonte

Merge branch 'master' of https://git.jiinfo.cn/cmc-project/cmc_weixin_sap

liupeng 3 anos atrás
pai
commit
9235eec3ed

+ 5 - 9
code/sapparent/sapservice/src/main/java/org/fouram/core/plugin/weixin/cp/util/WXCpOaUtil.java

@@ -19,7 +19,6 @@ import me.chanjar.weixin.cp.bean.oa.WxCpApprovalInfoQueryFilter;
 import me.chanjar.weixin.cp.bean.oa.WxCpApprovalInfoQueryFilter.KEY;
 import me.chanjar.weixin.cp.bean.oa.WxCpCheckinData;
 import me.chanjar.weixin.cp.bean.oa.WxCpCheckinOption;
-import me.chanjar.weixin.cp.bean.oa.WxCpCheckinOption.CheckinTime;
 import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
 
 /**
@@ -92,13 +91,10 @@ public class WXCpOaUtil {
 	}
 
 	public static void main(String[] args) throws Exception {
-		List<Date> datetimes = Lists.newArrayList();
-		datetimes.add(DateUtil.sdfTime.parse("2020-12-29 00:00:00"));
-		for (WxCpCheckinOption option : getCheckinOption(datetimes, Lists.newArrayList("1245", "1242"))) {
-			if (option.getGroup() != null && !option.getGroup().getCheckinDate().isEmpty()) {
-				CheckinTime checkinTime = option.getGroup().getCheckinDate().get(0).getCheckinTime()[0];
-				System.out.println(checkinTime);
-			}
-		}
+		Date startDate = DateUtil.sdfTime.parse("2021-04-01 00:00:00");
+		Date endDate = DateUtil.sdfTime.parse("2021-04-01 23:59:59");
+		List<WxCpCheckinData> checkinDatas = WXCpOaUtil.getCheckinData(startDate, endDate, Lists.newArrayList("1230"));
+		System.out.println(checkinDatas);
+		System.out.println(new Date(1617284825000L));
 	}
 }

+ 10 - 2
code/sapparent/sapservice/src/main/java/org/fouram/job/CheckTaskSchedule.java

@@ -39,12 +39,20 @@ public class CheckTaskSchedule {
 	public void taskBiz() throws Exception {
 		LoggerUtil.info(DateUtil.getTime());
 		try {
-			if (DateUtil.getHour().equals("10") || DateUtil.getHour().equals("20")) {
+			// 8点重新生成下昨天数据
+			if (DateUtil.getHour().equals("08")) {
+				String lastDay = DateUtil.getAfterDay(-1);
+				LoggerUtil.info(lastDay + "执行开始:" + DateUtil.getTime());
+				executeBiz(lastDay);
+				LoggerUtil.info(lastDay + "执行结束:" + DateUtil.getTime());
+			}
+			// 10点、22点生成今天数据
+			if (DateUtil.getHour().equals("10") || DateUtil.getHour().equals("22")) {
 				LoggerUtil.info(DateUtil.getDay() + "执行开始:" + DateUtil.getTime());
 				executeBiz(DateUtil.getDay());
 				LoggerUtil.info(DateUtil.getDay() + "执行结束:" + DateUtil.getTime());
 			}
-			// 重新执行最近30天
+			// 11点重新执行最近30天
 			if (DateUtil.getHour().equals("11")) {
 				for (String day : DateUtil.getSubDateList(DateUtil.getAfterDay(-30), DateUtil.getDay())) {
 					LoggerUtil.info(day + "执行开始:" + DateUtil.getTime());