|
@@ -639,7 +639,6 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
|
|
|
|
//获取企业AccessToken
|
|
//获取企业AccessToken
|
|
private String getCorpAccessToken(WxCorpInfo corpInfo) throws Exception {
|
|
private String getCorpAccessToken(WxCorpInfo corpInfo) throws Exception {
|
|
- System.out.println("in getCorpAccessToken=== ");
|
|
|
|
if (corpInfo.getExpireTime().isBefore(LocalDateTime.now())) {
|
|
if (corpInfo.getExpireTime().isBefore(LocalDateTime.now())) {
|
|
String url = WeiXinCorpController.GET_CORP_ACCESSTOKEN_URL.replace("SUITE_ACCESS_TOKEN", getSuiteAccessToken());
|
|
String url = WeiXinCorpController.GET_CORP_ACCESSTOKEN_URL.replace("SUITE_ACCESS_TOKEN", getSuiteAccessToken());
|
|
HttpHeaders headers = new HttpHeaders();
|
|
HttpHeaders headers = new HttpHeaders();
|
|
@@ -738,6 +737,10 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
msg.setError(MessageUtils.message("wx.dockError"));
|
|
msg.setError(MessageUtils.message("wx.dockError"));
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
+ if (companyId == 469 && endDateTime.isBefore(LocalDateTime.of(2025, 4, 1, 0, 0, 0))) {
|
|
|
|
+ System.out.println("赛元刷新每日打卡,skip");
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
String url = null;
|
|
String url = null;
|
|
try {
|
|
try {
|
|
startDateTime = startDateTime.withHour(0).withMinute(0).withSecond(0).withNano(0);
|
|
startDateTime = startDateTime.withHour(0).withMinute(0).withSecond(0).withNano(0);
|
|
@@ -1356,7 +1359,6 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
ct.setStartTime(DateTimeUtil.getTimeFromSeconds(sTime));
|
|
ct.setStartTime(DateTimeUtil.getTimeFromSeconds(sTime));
|
|
ct.setEndTime(DateTimeUtil.getTimeFromSeconds(eTime));
|
|
ct.setEndTime(DateTimeUtil.getTimeFromSeconds(eTime));
|
|
boolean isCrossDay = eTime >= 24 * 3600;//加班至第二天
|
|
boolean isCrossDay = eTime >= 24 * 3600;//加班至第二天
|
|
- if (showLog) System.out.println("初始startTime="+ct.getStartTime()+", endTime="+ct.getEndTime());
|
|
|
|
//下班时间和上班时间不一样,正常应该有regular_work_sec,但是企业微信存在问题,传过来的是0,需要校正
|
|
//下班时间和上班时间不一样,正常应该有regular_work_sec,但是企业微信存在问题,传过来的是0,需要校正
|
|
if (regular_work_sec == 0 && ct.getEndTime() != null && !ct.getEndTime().equals(ct.getStartTime())) {
|
|
if (regular_work_sec == 0 && ct.getEndTime() != null && !ct.getEndTime().equals(ct.getStartTime())) {
|
|
ct.setEndTime(ct.getStartTime());
|
|
ct.setEndTime(ct.getStartTime());
|
|
@@ -1625,7 +1627,6 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
double timeDelta = 0;
|
|
double timeDelta = 0;
|
|
//时间有变化,需要重新计算
|
|
//时间有变化,需要重新计算
|
|
if (needRecaculate) {
|
|
if (needRecaculate) {
|
|
- System.out.println("corpwxUserId=="+ct.getCorpwxUserid()+", name=="+ct.getName()+"s=="+ct.getStartTime()+", e=="+ct.getEndTime());
|
|
|
|
timeDelta = DateTimeUtil.getHoursFromSeconds(DateTimeUtil.getSecondsFromTime(ct.getEndTime()) - DateTimeUtil.getSecondsFromTime(ct.getStartTime()));
|
|
timeDelta = DateTimeUtil.getHoursFromSeconds(DateTimeUtil.getSecondsFromTime(ct.getEndTime()) - DateTimeUtil.getSecondsFromTime(ct.getStartTime()));
|
|
//超过下午上班的开始时间,需要减去午休的时间
|
|
//超过下午上班的开始时间,需要减去午休的时间
|
|
if (ct.getEndTime().compareTo(baseAfternoonStart) >= 0) {
|
|
if (ct.getEndTime().compareTo(baseAfternoonStart) >= 0) {
|
|
@@ -1635,7 +1636,6 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
} else {
|
|
} else {
|
|
timeDelta = ct.getCardTime();
|
|
timeDelta = ct.getCardTime();
|
|
}
|
|
}
|
|
- if (showLog) System.out.println("上下班间隔时长为==" + timeDelta);
|
|
|
|
ct.setName(name);
|
|
ct.setName(name);
|
|
//解析请假和外出的情况
|
|
//解析请假和外出的情况
|
|
JSONArray sp_items = jsonObject.getJSONArray("sp_items");
|
|
JSONArray sp_items = jsonObject.getJSONArray("sp_items");
|
|
@@ -1654,7 +1654,6 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
outdoorTime = 0.0;
|
|
outdoorTime = 0.0;
|
|
}
|
|
}
|
|
double otTime = convertDayTimeToHours(DateTimeUtil.getHoursFromSeconds(spItem.getInteger("duration")));
|
|
double otTime = convertDayTimeToHours(DateTimeUtil.getHoursFromSeconds(spItem.getInteger("duration")));
|
|
- if (showLog) System.out.println("补的时长:"+otTime);
|
|
|
|
if (otTime > 8.0) {
|
|
if (otTime > 8.0) {
|
|
otTime = 8.0;
|
|
otTime = 8.0;
|
|
}
|
|
}
|
|
@@ -1729,7 +1728,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
if (ct.getAskLeaveTime() > 8.0) {
|
|
if (ct.getAskLeaveTime() > 8.0) {
|
|
ct.setAskLeaveTime(8.0);//超过8小时都以8小时计算
|
|
ct.setAskLeaveTime(8.0);//超过8小时都以8小时计算
|
|
}
|
|
}
|
|
- if (showLog) System.out.println("校正后请假时长=" + ct.getAskLeaveTime());
|
|
|
|
|
|
+// if (showLog) System.out.println("校正后请假时长=" + ct.getAskLeaveTime());
|
|
//如果有出差的,但是没有打卡,则用出差的时间作为timeDelta
|
|
//如果有出差的,但是没有打卡,则用出差的时间作为timeDelta
|
|
if (timeDelta < 7.5 && ct.getOutdoorTime() > 0) {
|
|
if (timeDelta < 7.5 && ct.getOutdoorTime() > 0) {
|
|
timeDelta += ct.getOutdoorTime();
|
|
timeDelta += ct.getOutdoorTime();
|
|
@@ -1753,12 +1752,12 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
if (showLog) System.out.println("工作时长==" + workHours);
|
|
if (showLog) System.out.println("工作时长==" + workHours);
|
|
|
|
|
|
if (corpInfo.getCompanyId() == 481) {
|
|
if (corpInfo.getCompanyId() == 481) {
|
|
- //给盛立安元和赛元微电子0.5单位进位
|
|
|
|
|
|
+ //给盛立安元0.5单位进位
|
|
ct.setWorkHours(DateTimeUtil.getHalfHoursFromDouble(workHours));
|
|
ct.setWorkHours(DateTimeUtil.getHalfHoursFromDouble(workHours));
|
|
} else {
|
|
} else {
|
|
ct.setWorkHours(DateTimeUtil.getHoursFromDouble(workHours));
|
|
ct.setWorkHours(DateTimeUtil.getHoursFromDouble(workHours));
|
|
}
|
|
}
|
|
- if (showLog) System.out.println("ct.getStartTime()==" + ct.getStartTime()+", ct.getEndTime()="+ct.getEndTime());
|
|
|
|
|
|
+// if (showLog) System.out.println("ct.getStartTime()==" + ct.getStartTime()+", ct.getEndTime()="+ct.getEndTime());
|
|
|
|
|
|
//针对赛元微电子,请半天假的情况下。重新校正打卡和工作时长
|
|
//针对赛元微电子,请半天假的情况下。重新校正打卡和工作时长
|
|
if (corpInfo.getCorpid().equals("wpy9TkCAAAgNp4jvqxKTpXrhvwFvyFHg")) {
|
|
if (corpInfo.getCorpid().equals("wpy9TkCAAAgNp4jvqxKTpXrhvwFvyFHg")) {
|
|
@@ -1866,6 +1865,11 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
.eq("create_date", localDate));
|
|
.eq("create_date", localDate));
|
|
//有工作时长或者打卡时长或者请假时长,外出时长,都算有效时间
|
|
//有工作时长或者打卡时长或者请假时长,外出时长,都算有效时间
|
|
boolean hasTimeRecord = ct.getWorkHours() > 0 || ct.getCardTime() >= 1.0 || ct.getAskLeaveTime() > 0 || ct.getOutdoorTime() > 0;
|
|
boolean hasTimeRecord = ct.getWorkHours() > 0 || ct.getCardTime() >= 1.0 || ct.getAskLeaveTime() > 0 || ct.getOutdoorTime() > 0;
|
|
|
|
+ //对于赛元微电子,2025年4月1日之前的都不做处理,防止把数据覆盖掉
|
|
|
|
+ if(corpInfo.getCompanyId() == 469 && ct.getCreateDate().isBefore(LocalDate.of(2025, 4, 1))) {
|
|
|
|
+ System.out.println("赛元微电子Skip");
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
if (itemList.size() > 0) {
|
|
if (itemList.size() > 0) {
|
|
UserCorpwxTime item = itemList.get(0);
|
|
UserCorpwxTime item = itemList.get(0);
|
|
if (itemList.size() > 1) {
|
|
if (itemList.size() > 1) {
|