Commit 6cb618ed by leialin

Merge branch 'lal' into 'develop'

Lal

See merge request 8timerv2/8timerapiv200!322
parents de3d1321 6971be31
...@@ -2150,7 +2150,7 @@ public class ClockInController { ...@@ -2150,7 +2150,7 @@ public class ClockInController {
// attdate.setAttpr(dajllist); // attdate.setAttpr(dajllist);
if(attdate.getAttgrouptype() != 3) { if(attdate.getAttgrouptype() != 3) {
List<AttSchedule> attsch = attdate.getAttsch(); List<AttSchedule> attsch = attdate.getAttsch();
if(EmptyUtil.isNotEmpty(attdate.getAttsch())) {//班次不为空 if(EmptyUtil.isNotEmpty(attdate.getAttsch()) && attsch.get(0).getId() != 0) {//班次不为空
int bccs = attdate.getAttsch().size(); int bccs = attdate.getAttsch().size();
int r = 1,bc = 0; int r = 1,bc = 0;
int bsz = 0; int bsz = 0;
...@@ -2236,9 +2236,21 @@ public class ClockInController { ...@@ -2236,9 +2236,21 @@ public class ClockInController {
if(dk != null && attdate.getAttsch().size() != dk.getSort()) { if(dk != null && attdate.getAttsch().size() != dk.getSort()) {
AttSchedule att = attsch.get(dk.getSort()); AttSchedule att = attsch.get(dk.getSort());
att.setIsdk(0); att.setIsdk(0);
AttSchedule attw = attsch.get(dk.getSort()-1);
attw.setIsupdate(1);
}else {
AttSchedule attc = attsch.get(0);
attc.setIsdk(0);
} }
} }
}else {
//休息的时候
List<AttSchedule> attsch_ = new ArrayList<AttSchedule>();
attdate.setAttsch(attsch_);
} }
}else { }else {
//自由工时 //自由工时
List<AttSchedule> attsch = new ArrayList<AttSchedule>(); List<AttSchedule> attsch = new ArrayList<AttSchedule>();
...@@ -2246,18 +2258,9 @@ public class ClockInController { ...@@ -2246,18 +2258,9 @@ public class ClockInController {
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();
if(dajllist_.size() == 0) { if(dajllist_.size() > 0) {
KqglAssoDkjl dkjj = KqglAssoDkjl.builder().build();
AttSchedule ast = AttSchedule.builder().build();
ast.setId(0);
ast.setIsdk(0);
ast.setDajl(dkjj);
attsch.add(ast);
attdate.setAttsch(attsch);
}else {
for(KqglAssoDkjl ddk : dajllist_) { for(KqglAssoDkjl ddk : dajllist_) {
BeanUtil.copyProperties(ddk, dkjl,"attdate","bcid","remarks","userId","attime","dkmxid","commentary","punchequipment","punchmode"); BeanUtil.copyProperties(ddk, dkjl,"attdate","bcid","remarks","userId","attime","dkmxid","commentary","punchequipment","punchmode");
} }
AttSchedule ast = AttSchedule.builder().build(); AttSchedule ast = AttSchedule.builder().build();
ast.setId(0); ast.setId(0);
...@@ -2267,6 +2270,13 @@ public class ClockInController { ...@@ -2267,6 +2270,13 @@ public class ClockInController {
attdate.setAttsch(attsch); attdate.setAttsch(attsch);
} }
KqglAssoDkjl dkjj = KqglAssoDkjl.builder().build();
AttSchedule ast = AttSchedule.builder().build();
ast.setId(0);
ast.setIsdk(0);
ast.setDajl(dkjj);
attsch.add(ast);
attdate.setAttsch(attsch);
} }
...@@ -2335,79 +2345,82 @@ public class ClockInController { ...@@ -2335,79 +2345,82 @@ public class ClockInController {
if(attdate.getAttgrouptype() != 3) { 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())); if(EmptyUtil.isNotEmpty(attdate.getAttsch()) && ash.get(0).getId() != 0) {
KqglAssoBcsz shif = KqglAssoBcsz.builder().build().selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, ash.get(0).getId()));
if(shif != null) {
int dkcs_ = shif.getSxbcs();//上下班打卡次数 if(shif != null) {
int iswzwd = shif.getIsWzwd();//是否开启晚走晚到(0:否;1:是) int dkcs_ = shif.getSxbcs();//上下班打卡次数
int iswzwd = shif.getIsWzwd();//是否开启晚走晚到(0:否;1:是)
//统一分钟数
double xbwz1 = 0,xbwz2=0,xbwz3=0;
int sbwd1=0,sbwd2=0,sbwd3=0;
int arrive_late = 0;//晚到时间
String clock_date = "";//应打卡时间
Long latetime = 0l;//前天晚走时长(分钟)
KqglAssoDkmx yesterdaymx = KqglAssoDkmx.builder().build();
AttendanceCardListDto attdateyesterday;
long yesendtime1=0,yesendtime2=0,yesendtime3=0;
//存在晚走玩到
if(iswzwd > 0) {
//统一分钟数 //统一分钟数
xbwz1 = Double.valueOf(shif.getXbwz1()) * 60;//下班晚走1 double xbwz1 = 0,xbwz2=0,xbwz3=0;
sbwd1 = Integer.valueOf(String.valueOf(Double.valueOf(shif.getSbwd1()) * 60));//上班晚到1 int sbwd1=0,sbwd2=0,sbwd3=0;
xbwz2 = Double.valueOf(shif.getXbwz2()) * 60;//下班晚走2
sbwd2 = Integer.valueOf(String.valueOf(Double.valueOf(shif.getSbwd2()) * 60));//上班晚到2 int arrive_late = 0;//晚到时间
xbwz3 = Double.valueOf(shif.getXbwz3()) * 60;//下班晚走3 String clock_date = "";//应打卡时间
sbwd3 = Integer.valueOf(String.valueOf(Double.valueOf(shif.getSbwd3()) * 60));//上班晚到3 Long latetime = 0l;//前天晚走时长(分钟)
//获取前一天最后下班的时间 KqglAssoDkmx yesterdaymx = KqglAssoDkmx.builder().build();
yesterdaymx = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userBean.getEmpNum()) AttendanceCardListDto attdateyesterday;
.ge(KqglAssoDkmx::getDksj, startDateyesterday).le(KqglAssoDkmx::getDksj, endDateyesterday)); long yesendtime1=0,yesendtime2=0,yesendtime3=0;
attdateyesterday = MethodCall(userBean.getOrgCode(),userBean.getEmpNum(),yesterday); //存在晚走玩到
if(iswzwd > 0) {
List<AttSchedule> ashyes = attdateyesterday.getAttsch(); //统一分钟数
if(attdateyesterday.getAttsch().size() == 2 || attdateyesterday.getAttsch().size() == 4 || attdateyesterday.getAttsch().size() == 6) { xbwz1 = Double.valueOf(shif.getXbwz1()) * 60;//下班晚走1
yesendtime1 = ashyes.get(1).getTime(); sbwd1 = Integer.valueOf(String.valueOf(Double.valueOf(shif.getSbwd1()) * 60));//上班晚到1
} xbwz2 = Double.valueOf(shif.getXbwz2()) * 60;//下班晚走2
if(attdateyesterday.getAttsch().size() == 4 || attdateyesterday.getAttsch().size() == 6) { sbwd2 = Integer.valueOf(String.valueOf(Double.valueOf(shif.getSbwd2()) * 60));//上班晚到2
yesendtime2 = ashyes.get(3).getTime(); xbwz3 = Double.valueOf(shif.getXbwz3()) * 60;//下班晚走3
} sbwd3 = Integer.valueOf(String.valueOf(Double.valueOf(shif.getSbwd3()) * 60));//上班晚到3
if(attdateyesterday.getAttsch().size() == 6) {
yesendtime3 = ashyes.get(5).getTime(); //获取前一天最后下班的时间
} yesterdaymx = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userBean.getEmpNum())
.ge(KqglAssoDkmx::getDksj, startDateyesterday).le(KqglAssoDkmx::getDksj, endDateyesterday));
if(dkcs_ == 1) { attdateyesterday = MethodCall(userBean.getOrgCode(),userBean.getEmpNum(),yesterday);
if(yesterdaymx.getXbdk1() != null && yesterdaymx.getXbdk1jg() == 0) {
latetime = (yesterdaymx.getXbdk1() - yesendtime1)/1000/60; List<AttSchedule> ashyes = attdateyesterday.getAttsch();
if(attdateyesterday.getAttsch().size() == 2 || attdateyesterday.getAttsch().size() == 4 || attdateyesterday.getAttsch().size() == 6) {
yesendtime1 = ashyes.get(1).getTime();
} }
}else if(dkcs_ == 2){ if(attdateyesterday.getAttsch().size() == 4 || attdateyesterday.getAttsch().size() == 6) {
if(yesterdaymx.getXbdk2() != null && yesterdaymx.getXbdk2jg() == 0) { yesendtime2 = ashyes.get(3).getTime();
latetime = (yesterdaymx.getXbdk2() - yesendtime2)/1000/60;
} }
}else { if(attdateyesterday.getAttsch().size() == 6) {
if(yesterdaymx.getXbdk3() != null && yesterdaymx.getXbdk3jg() == 0) { yesendtime3 = ashyes.get(5).getTime();
latetime = (yesterdaymx.getXbdk3() - yesendtime3)/1000/60; }
if(dkcs_ == 1) {
if(yesterdaymx.getXbdk1() != null && yesterdaymx.getXbdk1jg() == 0) {
latetime = (yesterdaymx.getXbdk1() - yesendtime1)/1000/60;
}
}else if(dkcs_ == 2){
if(yesterdaymx.getXbdk2() != null && yesterdaymx.getXbdk2jg() == 0) {
latetime = (yesterdaymx.getXbdk2() - yesendtime2)/1000/60;
}
}else {
if(yesterdaymx.getXbdk3() != null && yesterdaymx.getXbdk3jg() == 0) {
latetime = (yesterdaymx.getXbdk3() - yesendtime3)/1000/60;
}
} }
} if(latetime != 0) {
if(latetime != 0) { latetime_ = Double.valueOf(String.valueOf(latetime));//前天晚走时长(分钟)
latetime_ = Double.valueOf(String.valueOf(latetime));//前天晚走时长(分钟) if(latetime_ > xbwz1 && latetime_ < xbwz2) {
if(latetime_ > xbwz1 && latetime_ < xbwz2) { arrive_late = sbwd1;
arrive_late = sbwd1; }else if(latetime_ > xbwz2 && latetime_ < xbwz3) {
}else if(latetime_ > xbwz2 && latetime_ < xbwz3) { arrive_late = sbwd2;
arrive_late = sbwd2; }else if(latetime_ > xbwz3) {
}else if(latetime_ > xbwz3) { arrive_late = sbwd3;
arrive_late = sbwd3; }
//ash.get(0).getTime():当天第一次应打卡时间
clock_date = ClockInTool.stampToDate(String.valueOf(ash.get(0).getTime()));
changed_time = Long.valueOf(ClockInTool.dateToStamp(ClockInTool.addtime(clock_date, "+"+arrive_late)));//晚到后应打卡时间
} }
//ash.get(0).getTime():当天第一次应打卡时间
clock_date = ClockInTool.stampToDate(String.valueOf(ash.get(0).getTime()));
changed_time = Long.valueOf(ClockInTool.dateToStamp(ClockInTool.addtime(clock_date, "+"+arrive_late)));//晚到后应打卡时间
} }
} attdate.setLatetime(latetime_);
attdate.setLatetime(latetime_); attdate.setChanged_time(changed_time);
attdate.setChanged_time(changed_time); }
} }
} }
return ResultUtil.data(attdate); return ResultUtil.data(attdate);
......
...@@ -26,6 +26,7 @@ public class AttSchedule implements Serializable{ ...@@ -26,6 +26,7 @@ public class AttSchedule implements Serializable{
private Long starttime; private Long starttime;
private Long endtime; private Long endtime;
private int isupdate;//是否跟新打卡
private int isdk;//0:当前打卡 1:已过打卡 private int isdk;//0:当前打卡 1:已过打卡
private KqglAssoDkjl dajl; private KqglAssoDkjl dajl;
} }
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