Commit ad457f7d by lal

提交

parent c5b8c3cd
...@@ -344,6 +344,7 @@ public class ClockInController { ...@@ -344,6 +344,7 @@ public class ClockInController {
} }
execution_status = 1; execution_status = 1;
}else { }else {
boolean getinto2 = true;
execution_status = 2; execution_status = 2;
if(attdate.getAttsch().size() == 2) { //下班1 if(attdate.getAttsch().size() == 2) { //下班1
if(dkmc.getSbdk1() != null && dkmc.getXbdk1() == null){ if(dkmc.getSbdk1() != null && dkmc.getXbdk1() == null){
...@@ -351,11 +352,11 @@ public class ClockInController { ...@@ -351,11 +352,11 @@ public class ClockInController {
Date sd1=df1.parse(ClockInTool.stampToDate(String.valueOf(starttime1)));//应打卡时间 Date sd1=df1.parse(ClockInTool.stampToDate(String.valueOf(starttime1)));//应打卡时间
Date sd2=df1.parse(sStdIoTime);//打卡时间 Date sd2=df1.parse(sStdIoTime);//打卡时间
if(sd1.after(sd2)) { if(sd1.after(sd2)) {
sbdkkd = true;// sbdkkd = true;//打卡无效
atttype = 1; // atttype = 1;
}else { }else {
kskd = false; kskd = false;
atttype = 2; // atttype = 2;
} }
}else { }else {
//最后一次卡的时候 再继续打视为更新最后一次打卡 //最后一次卡的时候 再继续打视为更新最后一次打卡
...@@ -368,66 +369,97 @@ public class ClockInController { ...@@ -368,66 +369,97 @@ public class ClockInController {
if (effectiveDate1) {//在范围内就打卡 if (effectiveDate1) {//在范围内就打卡
if(dkmc.getSbdk1() != null) { if(dkmc.getSbdk1() != null) {
sbdkkd = true;//打卡无效 sbdkkd = true;//打卡无效
atttype = 1; // atttype = 1;
}else { }else {
atttype = 1; atttype = 1;
getinto2 = false;
isRange = true;//在范围
} }
}else { }else {
if(getinto2) {
isRange = false; isRange = false;
} }
}
boolean effectiveDate2 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime1ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime1js),"yyyy-MM-dd HH:mm"); boolean effectiveDate2 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime1ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime1js),"yyyy-MM-dd HH:mm");
if (effectiveDate2) {//在范围内就打卡 if (effectiveDate2) {//在范围内就打卡
if(dkmc.getXbdk1() != null) { if(dkmc.getXbdk1() != null) {
kskd = true; kskd = true;
atttype = 2;
}else { }else {
kskd = false; kskd = false;
atttype = 2; // atttype = 2;
getinto2 = false;
isRange = true;//在范围
} }
}else { }else {
if(getinto2) {
isRange = false; isRange = false;
} }
}
boolean effectiveDate3 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime2ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime2js),"yyyy-MM-dd HH:mm"); boolean effectiveDate3 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime2ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime2js),"yyyy-MM-dd HH:mm");
if (effectiveDate3) {//在范围内就打卡 if (effectiveDate3) {//在范围内就打卡
if(dkmc.getSbdk2() != null) { if(dkmc.getSbdk2() != null) {
sbdkkd = true;// sbdkkd = true;//
atttype = 3; // atttype = 3;
}else { }else {
atttype = 3; atttype = 3;
getinto2 = false;
isRange = true;//在范围
} }
}else { }else {
if(getinto2) {
isRange = false; isRange = false;
} }
}
boolean effectiveDate4 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime2ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime2js),"yyyy-MM-dd HH:mm"); boolean effectiveDate4 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime2ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime2js),"yyyy-MM-dd HH:mm");
if (effectiveDate4) {//在范围内就打卡 if (effectiveDate4) {//在范围内就打卡
if(dkmc.getXbdk2() != null) { if(dkmc.getXbdk2() != null) {
kskd = true; kskd = true;//更新最后一次打卡
atttype = 4;
}else { }else {
kskd = false; kskd = false;
atttype = 4; // atttype = 4;
getinto2 = false;
isRange = true;//在范围
} }
}else { }else {
if(getinto2) {
isRange = false; isRange = false;
} }
} }
}
if(attdate.getAttsch().size() == 6) { if(attdate.getAttsch().size() == 6) {
boolean effectiveDate5 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime3ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime3js),"yyyy-MM-dd HH:mm"); boolean effectiveDate5 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime3ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime3js),"yyyy-MM-dd HH:mm");
if (effectiveDate5) {//在范围内就打卡 if (effectiveDate5) {//在范围内就打卡
if(dkmc.getSbdk2() != null) { if(dkmc.getSbdk2() != null) {
sbdkkd = true;// sbdkkd = true;//
atttype = 5; // atttype = 5;
}else { }else {
atttype = 5; atttype = 5;
getinto2 = false;
isRange = true;//在范围
}
}else {
if(getinto2) {
isRange = false;
}
} }
}else { isRange = false; }
boolean effectiveDate6 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime3ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime3js),"yyyy-MM-dd HH:mm"); boolean effectiveDate6 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime3ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime3js),"yyyy-MM-dd HH:mm");
if (effectiveDate6) {//在范围内就打卡 if (effectiveDate6) {//在范围内就打卡
if(dkmc.getXbdk2() != null) { if(dkmc.getXbdk2() != null) {
kskd = true; kskd = true;////更新最后一次打卡
atttype = 6;
}else { }else {
kskd = false; kskd = false;
atttype = 6; // atttype = 6;
getinto2 = false;
isRange = true;//在范围
}
}else {
if(getinto2) {
isRange = false;
}
} }
}else { isRange = false; }
} }
} }
} }
...@@ -884,6 +916,8 @@ public class ClockInController { ...@@ -884,6 +916,8 @@ public class ClockInController {
.eq(KqglAssoDkjl::getSort, atttype).eq(KqglAssoDkjl::getQyid, qyid).eq(KqglAssoDkjl::getAttdate, attdate_+" "+ClockInTool.dateToWeek2(toweek))); .eq(KqglAssoDkjl::getSort, atttype).eq(KqglAssoDkjl::getQyid, qyid).eq(KqglAssoDkjl::getAttdate, attdate_+" "+ClockInTool.dateToWeek2(toweek)));
KqglAssoDkjl.builder().id(dkjj.getId()).status(0).sort(0).build().updateById(); KqglAssoDkjl.builder().id(dkjj.getId()).status(0).sort(0).build().updateById();
msg = "打卡已更新数据";
sbyf = 0;
} }
int results = 0; int results = 0;
...@@ -964,6 +998,7 @@ public class ClockInController { ...@@ -964,6 +998,7 @@ public class ClockInController {
//第二次未超过应上班打卡时间 打卡为无效 //第二次未超过应上班打卡时间 打卡为无效
if(sbdkkd) { if(sbdkkd) {
sbyf = 0;
status = 2; status = 2;
atttype = 0; atttype = 0;
msg = "已有最优的打卡记录存在"; msg = "已有最优的打卡记录存在";
...@@ -1526,6 +1561,7 @@ public class ClockInController { ...@@ -1526,6 +1561,7 @@ public class ClockInController {
} }
execution_status = 1; execution_status = 1;
}else { }else {
boolean getinto2 = true;
execution_status = 2; execution_status = 2;
if(attdate.getAttsch().size() == 2) { //下班1 if(attdate.getAttsch().size() == 2) { //下班1
if(clock.getType() == 1) { if(clock.getType() == 1) {
...@@ -1535,7 +1571,7 @@ public class ClockInController { ...@@ -1535,7 +1571,7 @@ public class ClockInController {
Date sd2=df1.parse(sStdIoTime);//打卡时间 Date sd2=df1.parse(sStdIoTime);//打卡时间
if(sd1.after(sd2)) { if(sd1.after(sd2)) {
sbdkkd = true;//打卡无效 sbdkkd = true;//打卡无效
atttype = 1; // atttype = 1;
} }
} }
}else if(clock.getType() == 2){ }else if(clock.getType() == 2){
...@@ -1543,10 +1579,11 @@ public class ClockInController { ...@@ -1543,10 +1579,11 @@ public class ClockInController {
kskd = false; kskd = false;
}else { }else {
//最后一次卡的时候 再继续打视为更新最后一次打卡 //最后一次卡的时候 再继续打视为更新最后一次打卡
kskd = true; kskd = true;//更新最后一次打卡
}
atttype = clock.getType(); atttype = clock.getType();
} }
}
} }
if(attdate.getAttsch().size() == 4 || attdate.getAttsch().size() == 6) { if(attdate.getAttsch().size() == 4 || attdate.getAttsch().size() == 6) {
if(clock.getType() == 1) { if(clock.getType() == 1) {
...@@ -1554,66 +1591,97 @@ public class ClockInController { ...@@ -1554,66 +1591,97 @@ public class ClockInController {
if (effectiveDate1) {//在范围内就打卡 if (effectiveDate1) {//在范围内就打卡
if(dkmc.getSbdk1() != null) { if(dkmc.getSbdk1() != null) {
sbdkkd = true;//打卡无效 sbdkkd = true;//打卡无效
} }else {
atttype = clock.getType(); atttype = clock.getType();
isRange = true;//在范围
getinto2 = false;
}
}else { }else {
if(getinto2) {
isRange = false; isRange = false;
} }
}
}else if(clock.getType() == 2) { }else if(clock.getType() == 2) {
boolean effectiveDate2 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime1ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime1js),"yyyy-MM-dd HH:mm"); boolean effectiveDate2 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime1ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime1js),"yyyy-MM-dd HH:mm");
if (effectiveDate2) {//在范围内就打卡 if (effectiveDate2) {//在范围内就打卡
if(dkmc.getXbdk1() != null) { if(dkmc.getXbdk1() != null) {
kskd = true; kskd = true;////更新最后一次打卡
}else {
kskd = false;
atttype = clock.getType(); atttype = clock.getType();
isRange = true;//在范围
getinto2 = false;
}else {
kskd = false;//更新最后一次打卡
} }
}else { }else {
if(getinto2) {
isRange = false; isRange = false;
} }
}
}else if(clock.getType() == 3) { }else if(clock.getType() == 3) {
boolean effectiveDate3 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime2ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime2js),"yyyy-MM-dd HH:mm"); boolean effectiveDate3 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime2ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime2js),"yyyy-MM-dd HH:mm");
if (effectiveDate3) {//在范围内就打卡 if (effectiveDate3) {//在范围内就打卡
if(dkmc.getSbdk2() != null) { if(dkmc.getSbdk2() != null) {
sbdkkd = true;// sbdkkd = true;//打卡无效
} }else {
atttype = clock.getType(); atttype = clock.getType();
isRange = true;//在范围
getinto2 = false;
}
}else { }else {
if(getinto2) {
isRange = false; isRange = false;
} }
}
}else if(clock.getType() == 4) { }else if(clock.getType() == 4) {
boolean effectiveDate4 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime2ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime2js),"yyyy-MM-dd HH:mm"); boolean effectiveDate4 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime2ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime2js),"yyyy-MM-dd HH:mm");
if (effectiveDate4) {//在范围内就打卡 if (effectiveDate4) {//在范围内就打卡
if(dkmc.getXbdk2() != null) { if(dkmc.getXbdk2() != null) {
kskd = true; kskd = true;////更新最后一次打卡
atttype = clock.getType();
isRange = true;//在范围
getinto2 = false;
}else { }else {
kskd = false; kskd = false;
atttype = clock.getType();
} }
}else { }else {
if(getinto2) {
isRange = false; isRange = false;
} }
} }
} }
}
if(attdate.getAttsch().size() == 6) { if(attdate.getAttsch().size() == 6) {
if(clock.getType() == 5) { if(clock.getType() == 5) {
boolean effectiveDate5 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime3ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime3js),"yyyy-MM-dd HH:mm"); boolean effectiveDate5 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime3ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime3js),"yyyy-MM-dd HH:mm");
if (effectiveDate5) {//在范围内就打卡 if (effectiveDate5) {//在范围内就打卡
if(dkmc.getSbdk2() != null) { if(dkmc.getSbdk2() != null) {
sbdkkd = true;// sbdkkd = true;//打卡无效
} }else {
atttype = clock.getType(); atttype = clock.getType();
}else { isRange = false; } isRange = true;//在范围
getinto2 = false;
}
}else {
if(getinto2) {
isRange = false;
}
}
}else if(clock.getType() == 6) { }else if(clock.getType() == 6) {
boolean effectiveDate6 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime3ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime3js),"yyyy-MM-dd HH:mm"); boolean effectiveDate6 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime3ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime3js),"yyyy-MM-dd HH:mm");
if (effectiveDate6) {//在范围内就打卡 if (effectiveDate6) {//在范围内就打卡
if(dkmc.getXbdk2() != null) { if(dkmc.getXbdk2() != null) {
kskd = true; kskd = true;//更新最后一次打卡
atttype = clock.getType();
isRange = true;//在范围
getinto2 = false;
}else { }else {
kskd = false; kskd = false;
atttype = clock.getType();
} }
}else { isRange = false; } }else {
if(getinto2) {
isRange = false;
}
}
} }
} }
} }
...@@ -1646,7 +1714,7 @@ public class ClockInController { ...@@ -1646,7 +1714,7 @@ public class ClockInController {
String DKputime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_);//打卡时间 String DKputime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_);//打卡时间
boolean effectiveDate = ClockInTool.hourMinuteBetween(DKputime, staputime, entputime,"yyyy-MM-dd HH:mm"); boolean effectiveDate = ClockInTool.hourMinuteBetween(DKputime, staputime, entputime,"yyyy-MM-dd HH:mm");
if (!effectiveDate) { if (!effectiveDate) {
System.out.println("当前打卡时间不在范围内"); // System.out.println("当前打卡时间不在范围内");
isRange = false; isRange = false;
} }
} }
...@@ -1962,6 +2030,8 @@ public class ClockInController { ...@@ -1962,6 +2030,8 @@ public class ClockInController {
.eq(KqglAssoDkjl::getSort, atttype).eq(KqglAssoDkjl::getQyid, qyid).eq(KqglAssoDkjl::getAttdate, attdate_+" "+ClockInTool.dateToWeek2(toweek))); .eq(KqglAssoDkjl::getSort, atttype).eq(KqglAssoDkjl::getQyid, qyid).eq(KqglAssoDkjl::getAttdate, attdate_+" "+ClockInTool.dateToWeek2(toweek)));
KqglAssoDkjl.builder().id(dkjj.getId()).status(0).sort(0).build().updateById(); KqglAssoDkjl.builder().id(dkjj.getId()).status(0).sort(0).build().updateById();
msg = "打卡已更新数据";
sbyf = 0;
} }
int results = 0; int results = 0;
...@@ -2042,6 +2112,7 @@ public class ClockInController { ...@@ -2042,6 +2112,7 @@ public class ClockInController {
//第二次未超过应上班打卡时间 打卡为无效 //第二次未超过应上班打卡时间 打卡为无效
if(sbdkkd) { if(sbdkkd) {
sbyf = 0;
status = 2; status = 2;
atttype = 0; atttype = 0;
msg = "已有最优的打卡记录存在"; msg = "已有最优的打卡记录存在";
...@@ -2140,6 +2211,9 @@ public class ClockInController { ...@@ -2140,6 +2211,9 @@ public class ClockInController {
Long startDate = DateUtil.getStartTime(0,DateUtil.getStringTime(str,"yyyy-MM-dd")).getTime(); Long startDate = DateUtil.getStartTime(0,DateUtil.getStringTime(str,"yyyy-MM-dd")).getTime();
Long endDate = DateUtil.getnowEndTime(23,DateUtil.getStringTime(str,"yyyy-MM-dd")).getTime(); Long endDate = DateUtil.getnowEndTime(23,DateUtil.getStringTime(str,"yyyy-MM-dd")).getTime();
String stampToDate = ClockInTool.stampToDate(String.valueOf(endDate));//当天打卡的最后时间
Timestamp d = Timestamp.valueOf(stampToDate);
KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(userBean.getEmpNum(),userBean.getOrgCode()); //考勤组信息 KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(userBean.getEmpNum(),userBean.getOrgCode()); //考勤组信息
if(attgro != null) { if(attgro != null) {
...@@ -2179,24 +2253,18 @@ public class ClockInController { ...@@ -2179,24 +2253,18 @@ public class ClockInController {
if (b.after(a) && b.after(c)) {// 当前时间大于下班打卡时间 if (b.after(a) && b.after(c)) {// 当前时间大于下班打卡时间
bc++; bc++;
ash.setIsdk(1); ash.setIsdk(1);
if(b.before(d)) {
ash.setIsupdate(1);
}
}else { }else {
bsz = 1; bsz = 1;
} }
} }
if(r == 2) { if(r == 2) {
if(b.after(a) && b.after(c) && b.before(d)) {
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)) {
bsz = 1; bsz = 1;
ash.setIsdk(0); ash.setIsdk(0);
} }else {
if(b.before(a) || b.after(c)) {
bc++;
ash.setIsdk(1); ash.setIsdk(1);
} }
} }
......
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