Commit 5873f140 by leialin

Merge branch 'lal' into 'develop'

Lal

See merge request 8timerv2/8timerapiv200!320
parents 1311f2fb 5c79f12a
......@@ -2148,17 +2148,22 @@ public class ClockInController {
//打卡记录
// List<KqglAssoDkjl> dajllist = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum());
// attdate.setAttpr(dajllist);
if(attdate.getAttgrouptype() != 3) {
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) {
if(attdate.getAttsch().size() == 2) {
//有范围
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");
if(ectivedate) {
bsz = 1;
ash.setIsdk(0);
}else {
bc++;
ash.setIsdk(1);
}
}else {
......@@ -2171,8 +2176,11 @@ public class ClockInController {
Timestamp c = Timestamp.valueOf(sbdk1);
if(r == 1) {
if (b.after(a)) {// 当前时间大于下班打卡时间
if (b.after(a) && b.after(c)) {// 当前时间大于下班打卡时间
bc++;
ash.setIsdk(1);
}else {
bsz = 1;
}
}
if(r == 2) {
......@@ -2180,42 +2188,67 @@ public class ClockInController {
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.after(c)) {
// ash.setIsdk(1);
// }
if(b.after(a) && b.before(d)) {
bsz = 1;
ash.setIsdk(0);
}
if(b.before(a) || b.after(c)) {
bc++;
ash.setIsdk(1);
}
}
r++;
}
}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");
if(ectivedate) {
bsz = 1;
ash.setIsdk(0);
}else {
bc++;
ash.setIsdk(1);
}
}
//自由工时
if(attdate.getAttgrouptype() == 3) {
}else {
List<KqglAssoDkjl> dajllist_ = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum());
KqglAssoDkjl dkjl = KqglAssoDkjl.builder().build();
for(KqglAssoDkjl daj : dajllist_) {
if(ash.getId() == daj.getBcid() && ash.getSort() == daj.getSort()) {//班次id和打卡顺序对应
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.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:关
if(attgro.getIsWq() == 1) {
......@@ -2280,6 +2313,7 @@ public class ClockInController {
double latetime_ = 0;//前天晚走时长(分钟)
Long changed_time = 0l;//晚到后应打卡时间
if(attdate.getAttgrouptype() != 3) {
List<AttSchedule> ash = attdate.getAttsch();
KqglAssoBcsz shif = KqglAssoBcsz.builder().build().selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, ash.get(0).getId()));
......@@ -2354,6 +2388,8 @@ public class ClockInController {
attdate.setLatetime(latetime_);
attdate.setChanged_time(changed_time);
}
}
return ResultUtil.data(attdate);
}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