|
@@ -5,13 +5,11 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
import org.fouram.core.base.service.BaseService;
|
|
|
import org.fouram.core.plugin.weixin.cp.util.WXCpOaUtil;
|
|
|
import org.fouram.core.util.BeanUtils;
|
|
|
import org.fouram.core.util.DateUtil;
|
|
|
import org.fouram.entity.SapCheck;
|
|
|
-import org.fouram.entity.SapCheckReport;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -139,7 +137,6 @@ public class WxCheckService extends BaseService {
|
|
|
update("SapCheckMapper.saveCheckReport", param);
|
|
|
}
|
|
|
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
public void updateReportResultData(String startDay, String endDay, String hour) throws Exception {
|
|
|
Map<String, String> param = Maps.newHashMap();
|
|
|
param.put("hour", hour);
|
|
@@ -157,25 +154,10 @@ public class WxCheckService extends BaseService {
|
|
|
// 更新时间为空的为后台更新未打卡
|
|
|
update("SapCheckMapper.updateCheckinNullException", param);
|
|
|
update("SapCheckMapper.updateCheckoffNullException", param);
|
|
|
- // 更新所有异常事件的数据为异常数据
|
|
|
- update("SapCheckMapper.updateAllExceptionResult", param);
|
|
|
- // 查询有请假情况的数据-更新为正常
|
|
|
- List<SapCheckReport> checkReports = (List<SapCheckReport>) findList("SapCheckMapper.selectLeaveDayList", param);
|
|
|
- for (SapCheckReport checkReport : checkReports) {
|
|
|
- update("SapCheckMapper.updateResultOk", checkReport.getId());
|
|
|
- }
|
|
|
- // 上班和下班正常打卡一次或者有补卡符合一个条件-更新为正常
|
|
|
- checkReports = (List<SapCheckReport>) findList("SapCheckMapper.selectExceptionList", param);
|
|
|
- for (SapCheckReport checkReport : checkReports) {
|
|
|
- if (isOkWorkTime(checkReport) || isOkOffWorkTime(checkReport)
|
|
|
- || StringUtils.isNotBlank(checkReport.getBukaDay())) {
|
|
|
- update("SapCheckMapper.updateResultOk", checkReport.getId());
|
|
|
- }
|
|
|
- }
|
|
|
- // 更新所有有补卡日期的记录为正常
|
|
|
- update("SapCheckMapper.updateResultOkByAllBuKa", null);
|
|
|
- // 查询有请假情况的数据-更新为正常
|
|
|
- update("SapCheckMapper.updateResultOkByAllLeave", null);
|
|
|
+ // 更新补卡日期
|
|
|
+ update("SapCheckMapper.updateBuKaDay", param);
|
|
|
+ // 查询请假日期
|
|
|
+ update("SapCheckMapper.updateLeaveTime", param);
|
|
|
// 更新hour字段
|
|
|
update("SapCheckMapper.updateAllHour", param);
|
|
|
// 新增列:上班时间
|
|
@@ -206,44 +188,4 @@ public class WxCheckService extends BaseService {
|
|
|
update("SapCheckMapper.updateWorkMinsZero", null);
|
|
|
update("SapCheckMapper.updateWorkHours", null);
|
|
|
}
|
|
|
-
|
|
|
- // 是不是正确的上班时间
|
|
|
- private boolean isOkWorkTime(SapCheckReport checkReport) throws Exception {
|
|
|
- if (StringUtils.isBlank(checkReport.getCheckinException())) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(checkReport.getCheckoutDate1())) {
|
|
|
- if (DateUtil.sdfTime.parse(checkReport.getCheckoutDate1()).getTime() <= DateUtil.sdfsTime
|
|
|
- .parse(checkReport.getCheckinDay() + " " + checkReport.getWorkTime()).getTime()) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(checkReport.getCheckoutDate2())) {
|
|
|
- if (DateUtil.sdfTime.parse(checkReport.getCheckoutDate2()).getTime() <= DateUtil.sdfsTime
|
|
|
- .parse(checkReport.getCheckinDay() + " " + checkReport.getWorkTime()).getTime()) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- // 是不是正确的下班时间
|
|
|
- private boolean isOkOffWorkTime(SapCheckReport checkReport) throws Exception {
|
|
|
- if (StringUtils.isBlank(checkReport.getCheckoffException())) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(checkReport.getCheckoutDate1())) {
|
|
|
- if (DateUtil.sdfTime.parse(checkReport.getCheckoutDate1()).getTime() >= DateUtil.sdfsTime
|
|
|
- .parse(checkReport.getCheckinDay() + " " + checkReport.getWorkTime()).getTime()) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(checkReport.getCheckoutDate2())) {
|
|
|
- if (DateUtil.sdfTime.parse(checkReport.getCheckoutDate2()).getTime() >= DateUtil.sdfsTime
|
|
|
- .parse(checkReport.getCheckinDay() + " " + checkReport.getOffWorkTime()).getTime()) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
}
|