外勤转考勤格式化前一天日报和处理加班

dev-zm
zhangming 10 months ago
parent efbbff75c1
commit 95b6eaa319

@ -429,10 +429,10 @@ public class PunchOutButtonCmd extends AbstractCommonCommand<Map<String, Object>
new KQFormatBiz().formatDate(""+userId,DateUtil.getYesterday());
}
bb.writeLog("PunchOutButtonCmd:userId:"+userId+":belongdate:"+(belongdate.length() == 0 ? DateUtil.getCurrentDate() : belongdate));
if(belongdate.length()==0){
// if(belongdate.length()==0){
//外勤签到没有归属日期,遇到跨天班次打卡可能归属前一天,需要格式化前一天考勤
new KQFormatBiz().formatDate(""+userId,DateUtil.getYesterday());
}
// }
new KQFormatBiz().formatDate(""+userId,(belongdate.length() == 0 ? DateUtil.getCurrentDate() : belongdate));
//外勤签到转的考勤 处理加班规则
SplitActionUtil.pushOverTimeTasksAll(belongdate,belongdate,""+userId);

@ -11,9 +11,12 @@ import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.Property;
import weaver.soa.workflow.request.RequestInfo;
import java.text.SimpleDateFormat;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -95,6 +98,8 @@ public class OutSignSyncAction implements Action {
LocalTime oldkssj = LocalTime.parse(kssj, formatter);
LocalTime minKssj = LocalTime.parse("01:00:00", formatter);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (String inf : infos) {
if (StringUtils.isNotEmpty(inf)) {
Map<String, Object> in = mapStringToMap(inf);
@ -140,9 +145,20 @@ public class OutSignSyncAction implements Action {
new KQFormatBiz().formatDate(userId, DateUtil.getYesterday());
}
// new KQFormatBiz().formatDate(userId, (belongdate.length() == 0 ? DateUtil.getCurrentDate() : belongdate));
Date date = dateFormat.parse(signDate);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DATE, -1); // 减去一天
Date previousDay = calendar.getTime();
String previousDayString = dateFormat.format(previousDay);
new KQFormatBiz().formatDate(userId, signDate);
new KQFormatBiz().formatDate(userId, previousDayString);
//外勤签到转的考勤 处理加班规则
SplitActionUtil.pushOverTimeTasksAll(signDate, signDate, userId);
if (belongdate.length() != 0) {
new KQFormatBiz().formatDate(userId, belongdate);
SplitActionUtil.pushOverTimeTasksAll(belongdate, belongdate, userId);
}
}
}

Loading…
Cancel
Save