|
@@ -945,7 +945,6 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
HttpEntity<String> requestEntity = new HttpEntity<String>(reqParam.toJSONString(), headers);
|
|
HttpEntity<String> requestEntity = new HttpEntity<String>(reqParam.toJSONString(), headers);
|
|
ResponseEntity<String> responseEntity = this.restTemplate.exchange(url,
|
|
ResponseEntity<String> responseEntity = this.restTemplate.exchange(url,
|
|
HttpMethod.POST, requestEntity, String.class);
|
|
HttpMethod.POST, requestEntity, String.class);
|
|
-
|
|
|
|
if (responseEntity.getStatusCode() == HttpStatus.OK) {
|
|
if (responseEntity.getStatusCode() == HttpStatus.OK) {
|
|
String resp = responseEntity.getBody();
|
|
String resp = responseEntity.getBody();
|
|
if (showLog) System.out.println(resp);
|
|
if (showLog) System.out.println(resp);
|
|
@@ -984,10 +983,20 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
baseMorningEnd = workRules.size() <= 1 ? "12:00" : DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(0).getIntValue("off_work_sec"));
|
|
baseMorningEnd = workRules.size() <= 1 ? "12:00" : DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(0).getIntValue("off_work_sec"));
|
|
baseAfternoonStart = workRules.size() <= 1 ? "13:00" : DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(1).getIntValue("work_sec"));
|
|
baseAfternoonStart = workRules.size() <= 1 ? "13:00" : DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(1).getIntValue("work_sec"));
|
|
baseAfternoonEnd = workRules.size() <= 1 ? "18:00" : DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(1).getIntValue("off_work_sec"));
|
|
baseAfternoonEnd = workRules.size() <= 1 ? "18:00" : DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(1).getIntValue("off_work_sec"));
|
|
- if (workRules.size() == 1) {
|
|
|
|
- baseMorningStart = DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(0).getIntValue("work_sec"));
|
|
|
|
|
|
+ if (workRules.size() == 0) {
|
|
|
|
+ baseMorningStart = "09:00";
|
|
baseMorningEnd = "12:00";
|
|
baseMorningEnd = "12:00";
|
|
baseAfternoonStart = "13:00";
|
|
baseAfternoonStart = "13:00";
|
|
|
|
+ baseAfternoonEnd = "18:00";
|
|
|
|
+ } else if (workRules.size() == 1) {
|
|
|
|
+ baseMorningStart = DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(0).getIntValue("work_sec"));
|
|
|
|
+ baseMorningEnd = "12:00";
|
|
|
|
+ //针对雷电,下午是12:30上班
|
|
|
|
+ if (corpInfo.getCompanyId() == 7030) {
|
|
|
|
+ baseAfternoonStart = "12:30";
|
|
|
|
+ } else {
|
|
|
|
+ baseAfternoonStart = "13:00";
|
|
|
|
+ }
|
|
baseAfternoonEnd = DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(0).getIntValue("off_work_sec"));
|
|
baseAfternoonEnd = DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(0).getIntValue("off_work_sec"));
|
|
} else {
|
|
} else {
|
|
baseMorningStart = DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(0).getIntValue("work_sec"));
|
|
baseMorningStart = DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(0).getIntValue("work_sec"));
|
|
@@ -996,7 +1005,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
baseAfternoonEnd = DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(1).getIntValue("off_work_sec"));
|
|
baseAfternoonEnd = DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(1).getIntValue("off_work_sec"));
|
|
}
|
|
}
|
|
if (workRules.size() <= 1) {
|
|
if (workRules.size() <= 1) {
|
|
- restTime = 1.0;//一个小时午休
|
|
|
|
|
|
+ restTime = corpInfo.getCompanyId() == 7030?0.5:1.0;
|
|
} else {
|
|
} else {
|
|
restTime = 1.0 * (workRules.getJSONObject(1).getIntValue("work_sec") - workRules.getJSONObject(0).getIntValue("off_work_sec")) / 3600;
|
|
restTime = 1.0 * (workRules.getJSONObject(1).getIntValue("work_sec") - workRules.getJSONObject(0).getIntValue("off_work_sec")) / 3600;
|
|
}
|
|
}
|
|
@@ -1197,6 +1206,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
String baseMorningEnd = workRules.size() <= 1 ? "12:00" : DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(0).getIntValue("off_work_sec"));
|
|
String baseMorningEnd = workRules.size() <= 1 ? "12:00" : DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(0).getIntValue("off_work_sec"));
|
|
String baseAfternoonStart = workRules.size() <= 1 ? "13:00" : DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(1).getIntValue("work_sec"));
|
|
String baseAfternoonStart = workRules.size() <= 1 ? "13:00" : DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(1).getIntValue("work_sec"));
|
|
String baseAfternoonEnd = workRules.size() <= 1 ? "18:00" : DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(1).getIntValue("off_work_sec"));
|
|
String baseAfternoonEnd = workRules.size() <= 1 ? "18:00" : DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(1).getIntValue("off_work_sec"));
|
|
|
|
+
|
|
//获取上下午考勤规则中的工作时长
|
|
//获取上下午考勤规则中的工作时长
|
|
double baseMorningWorkTime = 0;
|
|
double baseMorningWorkTime = 0;
|
|
double baseAfternoonWorkTime = 0;
|
|
double baseAfternoonWorkTime = 0;
|
|
@@ -1222,7 +1232,12 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
} else if (workRules.size() == 1) {
|
|
} else if (workRules.size() == 1) {
|
|
baseMorningStart = DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(0).getIntValue("work_sec"));
|
|
baseMorningStart = DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(0).getIntValue("work_sec"));
|
|
baseMorningEnd = "12:00";
|
|
baseMorningEnd = "12:00";
|
|
- baseAfternoonStart = "13:00";
|
|
|
|
|
|
+ //针对雷电,下午是12:30上班
|
|
|
|
+ if (corpInfo.getCompanyId() == 7030) {
|
|
|
|
+ baseAfternoonStart = "12:30";
|
|
|
|
+ } else {
|
|
|
|
+ baseAfternoonStart = "13:00";
|
|
|
|
+ }
|
|
baseAfternoonEnd = DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(0).getIntValue("off_work_sec"));
|
|
baseAfternoonEnd = DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(0).getIntValue("off_work_sec"));
|
|
} else {
|
|
} else {
|
|
baseMorningStart = DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(0).getIntValue("work_sec"));
|
|
baseMorningStart = DateTimeUtil.getTimeFromSeconds(workRules.getJSONObject(0).getIntValue("work_sec"));
|
|
@@ -1232,7 +1247,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
}
|
|
}
|
|
double restTime = 0.0;//小时为单位
|
|
double restTime = 0.0;//小时为单位
|
|
if (workRules.size() <= 1) {
|
|
if (workRules.size() <= 1) {
|
|
- restTime = 1.0;//一个小时午休
|
|
|
|
|
|
+ restTime = corpInfo.getCompanyId() == 7030?0.5:1.0;
|
|
} else {
|
|
} else {
|
|
restTime = 1.0 * (workRules.getJSONObject(1).getIntValue("work_sec") - workRules.getJSONObject(0).getIntValue("off_work_sec")) / 3600;
|
|
restTime = 1.0 * (workRules.getJSONObject(1).getIntValue("work_sec") - workRules.getJSONObject(0).getIntValue("off_work_sec")) / 3600;
|
|
}
|
|
}
|
|
@@ -1646,6 +1661,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
ct.setEndTime(baseAfternoonEnd);
|
|
ct.setEndTime(baseAfternoonEnd);
|
|
//重新计算时长
|
|
//重新计算时长
|
|
double workTime = DateTimeUtil.getHoursFromSeconds(DateTimeUtil.getSecondsFromTime(ct.getEndTime()) - DateTimeUtil.getSecondsFromTime(ct.getStartTime()));
|
|
double workTime = DateTimeUtil.getHoursFromSeconds(DateTimeUtil.getSecondsFromTime(ct.getEndTime()) - DateTimeUtil.getSecondsFromTime(ct.getStartTime()));
|
|
|
|
+ if(showLog) System.out.println("workTime======="+workTime+", restTime="+restTime);
|
|
if (ct.getStartTime().compareTo(baseMorningEnd) <= 0) {
|
|
if (ct.getStartTime().compareTo(baseMorningEnd) <= 0) {
|
|
//重新计算打卡工时时,需要减去中间午休时间
|
|
//重新计算打卡工时时,需要减去中间午休时间
|
|
workTime -= restTime;
|
|
workTime -= restTime;
|