Commit 2e7d01f7 by lal

提交

parent 8ec1ce59
...@@ -2148,17 +2148,22 @@ public class ClockInController { ...@@ -2148,17 +2148,22 @@ public class ClockInController {
//打卡记录 //打卡记录
// List<KqglAssoDkjl> dajllist = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum()); // List<KqglAssoDkjl> dajllist = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum());
// attdate.setAttpr(dajllist); // attdate.setAttpr(dajllist);
if(attdate.getAttgrouptype() != 3) {
List<AttSchedule> attsch = attdate.getAttsch(); List<AttSchedule> attsch = attdate.getAttsch();
int r = 1; if(EmptyUtil.isNotEmpty(attdate.getAttsch())) {//班次不为空
int bccs = attdate.getAttsch().size();
int r = 1,bc = 0;
int bsz = 0;
for(AttSchedule ash : attsch) { for(AttSchedule ash : attsch) {
if(attdate.getAttsch().size() == 2) { if(attdate.getAttsch().size() == 2) {
//有范围 //有范围
if(ash.getStarttime() != 0 && ash.getEndtime() != 0) { if(ash.getStarttime() != 0 && ash.getEndtime() != 0) {
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) {
bsz = 1;
ash.setIsdk(0); ash.setIsdk(0);
}else { }else {
bc++;
ash.setIsdk(1); ash.setIsdk(1);
} }
}else { }else {
...@@ -2171,8 +2176,11 @@ public class ClockInController { ...@@ -2171,8 +2176,11 @@ public class ClockInController {
Timestamp c = Timestamp.valueOf(sbdk1); Timestamp c = Timestamp.valueOf(sbdk1);
if(r == 1) { if(r == 1) {
if (b.after(a)) {// 当前时间大于下班打卡时间 if (b.after(a) && b.after(c)) {// 当前时间大于下班打卡时间
bc++;
ash.setIsdk(1); ash.setIsdk(1);
}else {
bsz = 1;
} }
} }
if(r == 2) { if(r == 2) {
...@@ -2180,42 +2188,67 @@ public class ClockInController { ...@@ -2180,42 +2188,67 @@ public class ClockInController {
String stampToDate = ClockInTool.stampToDate(String.valueOf(endDate)); String stampToDate = ClockInTool.stampToDate(String.valueOf(endDate));
Timestamp d = Timestamp.valueOf(stampToDate); Timestamp d = Timestamp.valueOf(stampToDate);
if (b.after(a) && b.after(c)) { // if (b.after(a) && b.after(c)) {
ash.setIsdk(1); // ash.setIsdk(1);
} // }
if(b.after(a) && b.before(d)) { if(b.after(a) && b.before(d)) {
bsz = 1;
ash.setIsdk(0); ash.setIsdk(0);
} }
if(b.before(a) || b.after(c)) {
bc++;
ash.setIsdk(1);
}
} }
r++; 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) {
bsz = 1;
ash.setIsdk(0); ash.setIsdk(0);
}else { }else {
bc++;
ash.setIsdk(1); ash.setIsdk(1);
} }
} }
//自由工时
if(attdate.getAttgrouptype() == 3) {
}else {
List<KqglAssoDkjl> dajllist_ = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum()); List<KqglAssoDkjl> dajllist_ = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum());
KqglAssoDkjl dkjl = KqglAssoDkjl.builder().build(); KqglAssoDkjl dkjl = KqglAssoDkjl.builder().build();
for(KqglAssoDkjl daj : dajllist_) { for(KqglAssoDkjl daj : dajllist_) {
if(ash.getId() == daj.getBcid() && ash.getSort() == daj.getSort()) {//班次id和打卡顺序对应 if(ash.getId() == daj.getBcid() && ash.getSort() == daj.getSort()) {//班次id和打卡顺序对应
BeanUtil.copyProperties(daj, dkjl,"attdate","bcid","remarks","userId","attime","dkmxid","commentary","punchequipment","punchmode"); BeanUtil.copyProperties(daj, dkjl,"attdate","bcid","remarks","userId","attime","dkmxid","commentary","punchequipment","punchmode");
if(bsz == 1) {
bc++;
ash.setIsdk(1);
}else {
ash.setIsdk(1); ash.setIsdk(1);
} }
} }
}
ash.setDajl(dkjl); ash.setDajl(dkjl);
} }
//全部为 1 时
if(bccs == bc) {
KqglAssoDkjl dk = KqglAssoDkjl.builder().build().selectOne(new QueryWrapper<KqglAssoDkjl>().lambda().eq(KqglAssoDkjl::getQyid, userBean.getOrgCode())
.eq(KqglAssoDkjl::getUserId, userBean.getEmpNum()).ge(KqglAssoDkjl::getDktime, startDate).le(KqglAssoDkjl::getDktime, endDate).orderByDesc(KqglAssoDkjl::getSort).last("LIMIT 1"));
if(dk != null && attdate.getAttsch().size() != dk.getSort()) {
AttSchedule att = attsch.get(dk.getSort());
att.setIsdk(0);
}
}
} }
}else {
//自由工时
List<AttSchedule> attsch = new ArrayList<AttSchedule>();
List<KqglAssoDkjl> dajllist_ = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum());
KqglAssoDkjl dkjl = KqglAssoDkjl.builder().build();
}
//外勤 true:开 false:关 //外勤 true:开 false:关
if(attgro.getIsWq() == 1) { if(attgro.getIsWq() == 1) {
...@@ -2280,6 +2313,7 @@ public class ClockInController { ...@@ -2280,6 +2313,7 @@ public class ClockInController {
double latetime_ = 0;//前天晚走时长(分钟) double latetime_ = 0;//前天晚走时长(分钟)
Long changed_time = 0l;//晚到后应打卡时间 Long changed_time = 0l;//晚到后应打卡时间
if(attdate.getAttgrouptype() != 3) {
List<AttSchedule> ash = attdate.getAttsch(); List<AttSchedule> ash = attdate.getAttsch();
KqglAssoBcsz shif = KqglAssoBcsz.builder().build().selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, ash.get(0).getId())); KqglAssoBcsz shif = KqglAssoBcsz.builder().build().selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, ash.get(0).getId()));
...@@ -2354,6 +2388,8 @@ public class ClockInController { ...@@ -2354,6 +2388,8 @@ public class ClockInController {
attdate.setLatetime(latetime_); attdate.setLatetime(latetime_);
attdate.setChanged_time(changed_time); attdate.setChanged_time(changed_time);
} }
}
return ResultUtil.data(attdate); return ResultUtil.data(attdate);
}else { }else {
......
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