liupeng hace 5 años
padre
commit
35bf830dcd

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

@@ -45,6 +45,9 @@ public class WXCpOaUtil {
 	}
 
 	public static void main(String[] args) throws ParseException {
-		System.out.println(getCheckinOption(Lists.newArrayList(DateUtil.sdfTime.parse("2020-04-09 00:00:00")), Lists.newArrayList("500008")));
+		List<WxCpCheckinData> checkinDatas = WXCpOaUtil.getCheckinData(
+				DateUtil.sdfTime.parse("2020-04-01 00:00:00"), DateUtil.sdfTime.parse("2020-04-30 23:59:59"),
+				Lists.newArrayList("500017"));
+		System.out.println(checkinDatas);
 	}
 }

+ 1 - 1
code/sapparent/sapservice/src/main/java/org/fouram/core/plugin/weixin/cp/util/WXCpUserUtil.java

@@ -162,6 +162,6 @@ public class WXCpUserUtil {
 	}
 
 	public static void main(String[] args) {
-		System.out.println(getByIdOrEmail("1044", "weilong.jia@cmcinc.cn"));
+		System.out.println(getByIdOrEmail("1029", "weilong.jia@cmcinc.cn"));
 	}
 }

+ 4 - 0
code/sapparent/sapservice/src/main/java/org/fouram/mapper/SapCheckMapper.xml

@@ -28,6 +28,10 @@
 		values (#{userId},#{workSec},#{offWorkSec},#{workTime},#{offWorkTime})
 	</insert>
 	
+	<update id="updateHrsdWorkTime">
+		update sap_check_report set workTime = '10:00' where groupName like '%华人时代%'
+	</update>
+
 	<update id="updateAllExceptionResult">
 		update sap_check_report set result = '异常' 
 		where (LENGTH(checkinException) > 0 or LENGTH(checkoffException) > 0) and result = '正常'

+ 7 - 13
code/sapparent/sapservice/src/main/java/org/fouram/service/SapCheckService.java

@@ -82,7 +82,7 @@ public class SapCheckService extends BaseService {
 			System.out.println(count);
 		}
 	}
-	
+
 	public void saveAllUserCheckOption() throws Exception {
 		List<SapUser> users = userService.selectSuccessList();
 		Map<String, List<String>> map = groupList(users);
@@ -133,6 +133,8 @@ public class SapCheckService extends BaseService {
 
 	@SuppressWarnings("unchecked")
 	public void updateReportData() throws Exception {
+		// 更新华人时代人员上班时间可以推迟30分钟
+		update("SapCheckMapper.updateHrsdWorkTime", null);
 		// 更新所有异常事件的数据为异常数据
 		update("SapCheckMapper.updateAllExceptionResult", null);
 		// 查询有请假情况的数据
@@ -158,12 +160,8 @@ public class SapCheckService extends BaseService {
 
 	// 是不是正确的上班时间
 	private boolean isOkWorkTime(SapCheckReport checkReport) throws Exception {
-		if (StringUtils.isBlank(checkReport.getCheckinException())
-				&& StringUtils.isNotBlank(checkReport.getCheckinDate())) {
-			if (DateUtil.sdfTime.parse(checkReport.getCheckinDate()).getTime() <= DateUtil.sdfsTime
-					.parse(checkReport.getCheckinDay() + " " + checkReport.getWorkTime()).getTime()) {
-				return true;
-			}
+		if (StringUtils.isBlank(checkReport.getCheckinException())) {
+			return true;
 		}
 		if (StringUtils.isNotBlank(checkReport.getCheckoutDate1())) {
 			if (DateUtil.sdfTime.parse(checkReport.getCheckoutDate1()).getTime() <= DateUtil.sdfsTime
@@ -182,12 +180,8 @@ public class SapCheckService extends BaseService {
 
 	// 是不是正确的下班时间
 	private boolean isOkOffWorkTime(SapCheckReport checkReport) throws Exception {
-		if (StringUtils.isBlank(checkReport.getCheckoffException())
-				&& StringUtils.isNotBlank(checkReport.getCheckoffDate())) {
-			if (DateUtil.sdfTime.parse(checkReport.getCheckoffDate()).getTime() >= DateUtil.sdfsTime
-					.parse(checkReport.getCheckinDay() + " " + checkReport.getOffWorkTime()).getTime()) {
-				return true;
-			}
+		if (StringUtils.isBlank(checkReport.getCheckoffException())) {
+			return true;
 		}
 		if (StringUtils.isNotBlank(checkReport.getCheckoutDate1())) {
 			if (DateUtil.sdfTime.parse(checkReport.getCheckoutDate1()).getTime() >= DateUtil.sdfsTime