|
@@ -908,9 +908,12 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
|
needRecaculate = true;
|
|
|
}
|
|
|
} else if (leaveText.startsWith("外出")) {
|
|
|
-
|
|
|
+ //格式 "10/17 09:00 / 10/19 18:00"
|
|
|
String string = holiday.getJSONObject("sp_description").getJSONArray("data").getJSONObject(m).getString("text");
|
|
|
- String[] s = string.split(" |\\~");
|
|
|
+ String[] s = string.split(" \\/ | |\\~");
|
|
|
+ for (String ss : s) {
|
|
|
+ System.out.println(ss);
|
|
|
+ }
|
|
|
//获取到外出的开始时间和结束时间
|
|
|
boolean isOldFormat = false;
|
|
|
if (s.length < 5) {
|
|
@@ -921,13 +924,11 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
|
String dateEnd = localDate.getYear() + "/" + (isOldFormat ? s[2] : s[3]);
|
|
|
LocalDate sDate = LocalDate.parse(dateStart, mdFormat);
|
|
|
LocalDate eDate = LocalDate.parse(dateEnd, mdFormat);
|
|
|
- String outEnd = "";
|
|
|
- String outStart = "";
|
|
|
-
|
|
|
+ String outEnd = isOldFormat ? s[3] : s[4];
|
|
|
+ String outStart = s[1];
|
|
|
if (sDate.isEqual(eDate)) {
|
|
|
//外出在一天内
|
|
|
- outEnd = isOldFormat ? s[3] : s[4];
|
|
|
- outStart = s[1];
|
|
|
+
|
|
|
} else {
|
|
|
if (showLog) System.out.println("跨天外出===");
|
|
|
if (showLog)
|
|
@@ -1116,7 +1117,11 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
|
workTime -= restTime;
|
|
|
}
|
|
|
ct.setCardTime(workTime);
|
|
|
- ct.setWorkHours(DateTimeUtil.getHoursFromDouble(workTime) - ct.getAskLeaveTime() + ct.getOutdoorTime());
|
|
|
+ double calTime = DateTimeUtil.getHoursFromDouble(workTime) - ct.getAskLeaveTime();
|
|
|
+ if (calTime < 8.0 && ct.getOutdoorTime() > 0) {
|
|
|
+ calTime += ct.getOutdoorTime();
|
|
|
+ }
|
|
|
+ ct.setWorkHours(calTime);
|
|
|
if (showLog) System.out.println("workTime="+workTime+", 二次校正后workHours="+ct.getWorkHours());
|
|
|
}
|
|
|
}
|