Commit c557bdec by lal Committed by chenzg

提交BUG

parent 30710e29
...@@ -2118,7 +2118,7 @@ public class ClockInController { ...@@ -2118,7 +2118,7 @@ public class ClockInController {
public Result<Object> getAttClockData(@CurrentUser UserBean userBean,@RequestBody AttConditions attconditions) throws ParseException { public Result<Object> getAttClockData(@CurrentUser UserBean userBean,@RequestBody AttConditions attconditions) throws ParseException {
long nowdate = new Date().getTime(); long nowdate = new Date().getTime();
String current = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); // String current = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
String str = null; String str = null;
if(!("").equals(attconditions.getDate())){ if(!("").equals(attconditions.getDate())){
...@@ -2134,26 +2134,19 @@ public class ClockInController { ...@@ -2134,26 +2134,19 @@ public class ClockInController {
Long startDateyesterday = DateUtil.getStartTime(0,DateUtil.getStringTime(yesterday,"yyyy-MM-dd")).getTime(); Long startDateyesterday = DateUtil.getStartTime(0,DateUtil.getStringTime(yesterday,"yyyy-MM-dd")).getTime();
Long endDateyesterday = DateUtil.getnowEndTime(23,DateUtil.getStringTime(yesterday,"yyyy-MM-dd")).getTime(); Long endDateyesterday = DateUtil.getnowEndTime(23,DateUtil.getStringTime(yesterday,"yyyy-MM-dd")).getTime();
Long startDate = 0l; Long startDate = DateUtil.getStartTime(0,DateUtil.getStringTime(str,"yyyy-MM-dd")).getTime();
Long endDate = 0l; Long endDate = DateUtil.getnowEndTime(23,DateUtil.getStringTime(str,"yyyy-MM-dd")).getTime();
try {
startDate = DateUtil.getStartTime(0,DateUtil.getStringTime(str,"yyyy-MM-dd")).getTime();
endDate = DateUtil.getnowEndTime(23,DateUtil.getStringTime(str,"yyyy-MM-dd")).getTime();
} catch (ParseException e) {
e.printStackTrace();
}
KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(userBean.getEmpNum(),userBean.getOrgCode()); //考勤组信息 KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(userBean.getEmpNum(),userBean.getOrgCode()); //考勤组信息
if(attgro != null) { if(attgro != null) {
//APP获取当前天的考勤信息 //APP获取当前天的考勤信息
AttendanceCardListDto attdate = MethodCall(userBean.getOrgCode(),userBean.getEmpNum(),attconditions.getDate()); AttendanceCardListDto attdate = MethodCall(userBean.getOrgCode(),userBean.getEmpNum(),attconditions.getDate());
//打卡记录 //打卡记录
// List<KqglAssoDkjl> dajllist = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum()); // List<KqglAssoDkjl> dajllist = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum());
// attdate.setAttpr(dajllist); // attdate.setAttpr(dajllist);
List<AttSchedule> attsch = attdate.getAttsch(); List<AttSchedule> attsch = attdate.getAttsch();
int r = 1;
for(AttSchedule ash : attsch) { for(AttSchedule ash : attsch) {
if(attdate.getAttsch().size() == 2) { if(attdate.getAttsch().size() == 2) {
...@@ -2167,15 +2160,33 @@ public class ClockInController { ...@@ -2167,15 +2160,33 @@ public class ClockInController {
} }
}else { }else {
KqglAssoBcsz shif = KqglAssoBcsz.builder().build().selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, ash.getId())); KqglAssoBcsz shif = KqglAssoBcsz.builder().build().selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, ash.getId()));
String xbdk1 = (current+" "+shif.getXbdk1()+":00").replaceAll("\r|\n", "");
Timestamp b = Timestamp.valueOf(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));// Timestamp b = Timestamp.valueOf(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));//
String xbdk1 = (str+" "+shif.getXbdk1()+":00").replaceAll("\r|\n", "");
Timestamp a = Timestamp.valueOf(xbdk1); Timestamp a = Timestamp.valueOf(xbdk1);
if (b.after(a)) {// > String sbdk1 = (str+" "+shif.getSbdk1()+":00").replaceAll("\r|\n", "");
Timestamp c = Timestamp.valueOf(sbdk1);
if(r == 1) {
if (b.after(a)) {// 当前时间大于下班打卡时间
ash.setIsdk(1); ash.setIsdk(1);
} }
}
if(r == 2) {
String stampToDate = ClockInTool.stampToDate(String.valueOf(endDate));
Timestamp d = Timestamp.valueOf(stampToDate);
if (b.after(a) && b.after(c)) {
ash.setIsdk(1);
}
if(b.after(a) && b.before(d)) {
ash.setIsdk(0);
}
} }
r++;
}
}else { }else {
boolean ectivedate = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(nowdate), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(ash.getStarttime()), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(ash.getEndtime()),"yyyy-MM-dd HH:mm"); boolean ectivedate = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(nowdate), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(ash.getStarttime()), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(ash.getEndtime()),"yyyy-MM-dd HH:mm");
if(ectivedate) { if(ectivedate) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment