Commit 9c9af52a by lal Committed by chenzg

提交

parent fb038aad
......@@ -2150,7 +2150,7 @@ public class ClockInController {
// attdate.setAttpr(dajllist);
if(attdate.getAttgrouptype() != 3) {
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 r = 1,bc = 0;
int bsz = 0;
......@@ -2236,9 +2236,21 @@ public class ClockInController {
if(dk != null && attdate.getAttsch().size() != dk.getSort()) {
AttSchedule att = attsch.get(dk.getSort());
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 {
//自由工时
List<AttSchedule> attsch = new ArrayList<AttSchedule>();
......@@ -2246,18 +2258,9 @@ public class ClockInController {
List<KqglAssoDkjl> dajllist_ = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum());
KqglAssoDkjl dkjl = KqglAssoDkjl.builder().build();
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 {
if(dajllist_.size() > 0) {
for(KqglAssoDkjl ddk : dajllist_) {
BeanUtil.copyProperties(ddk, dkjl,"attdate","bcid","remarks","userId","attime","dkmxid","commentary","punchequipment","punchmode");
}
AttSchedule ast = AttSchedule.builder().build();
ast.setId(0);
......@@ -2267,6 +2270,13 @@ public class ClockInController {
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 {
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()));
if(shif != null) {
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) {
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();//上下班打卡次数
int iswzwd = shif.getIsWzwd();//是否开启晚走晚到(0:否;1:是)
//统一分钟数
xbwz1 = Double.valueOf(shif.getXbwz1()) * 60;//下班晚走1
sbwd1 = Integer.valueOf(String.valueOf(Double.valueOf(shif.getSbwd1()) * 60));//上班晚到1
xbwz2 = Double.valueOf(shif.getXbwz2()) * 60;//下班晚走2
sbwd2 = Integer.valueOf(String.valueOf(Double.valueOf(shif.getSbwd2()) * 60));//上班晚到2
xbwz3 = Double.valueOf(shif.getXbwz3()) * 60;//下班晚走3
sbwd3 = Integer.valueOf(String.valueOf(Double.valueOf(shif.getSbwd3()) * 60));//上班晚到3
//获取前一天最后下班的时间
yesterdaymx = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userBean.getEmpNum())
.ge(KqglAssoDkmx::getDksj, startDateyesterday).le(KqglAssoDkmx::getDksj, endDateyesterday));
attdateyesterday = MethodCall(userBean.getOrgCode(),userBean.getEmpNum(),yesterday);
List<AttSchedule> ashyes = attdateyesterday.getAttsch();
if(attdateyesterday.getAttsch().size() == 2 || attdateyesterday.getAttsch().size() == 4 || attdateyesterday.getAttsch().size() == 6) {
yesendtime1 = ashyes.get(1).getTime();
}
if(attdateyesterday.getAttsch().size() == 4 || attdateyesterday.getAttsch().size() == 6) {
yesendtime2 = ashyes.get(3).getTime();
}
if(attdateyesterday.getAttsch().size() == 6) {
yesendtime3 = ashyes.get(5).getTime();
}
if(dkcs_ == 1) {
if(yesterdaymx.getXbdk1() != null && yesterdaymx.getXbdk1jg() == 0) {
latetime = (yesterdaymx.getXbdk1() - yesendtime1)/1000/60;
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
sbwd1 = Integer.valueOf(String.valueOf(Double.valueOf(shif.getSbwd1()) * 60));//上班晚到1
xbwz2 = Double.valueOf(shif.getXbwz2()) * 60;//下班晚走2
sbwd2 = Integer.valueOf(String.valueOf(Double.valueOf(shif.getSbwd2()) * 60));//上班晚到2
xbwz3 = Double.valueOf(shif.getXbwz3()) * 60;//下班晚走3
sbwd3 = Integer.valueOf(String.valueOf(Double.valueOf(shif.getSbwd3()) * 60));//上班晚到3
//获取前一天最后下班的时间
yesterdaymx = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userBean.getEmpNum())
.ge(KqglAssoDkmx::getDksj, startDateyesterday).le(KqglAssoDkmx::getDksj, endDateyesterday));
attdateyesterday = MethodCall(userBean.getOrgCode(),userBean.getEmpNum(),yesterday);
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(yesterdaymx.getXbdk2() != null && yesterdaymx.getXbdk2jg() == 0) {
latetime = (yesterdaymx.getXbdk2() - yesendtime2)/1000/60;
if(attdateyesterday.getAttsch().size() == 4 || attdateyesterday.getAttsch().size() == 6) {
yesendtime2 = ashyes.get(3).getTime();
}
}else {
if(yesterdaymx.getXbdk3() != null && yesterdaymx.getXbdk3jg() == 0) {
latetime = (yesterdaymx.getXbdk3() - yesendtime3)/1000/60;
if(attdateyesterday.getAttsch().size() == 6) {
yesendtime3 = ashyes.get(5).getTime();
}
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) {
latetime_ = Double.valueOf(String.valueOf(latetime));//前天晚走时长(分钟)
if(latetime_ > xbwz1 && latetime_ < xbwz2) {
arrive_late = sbwd1;
}else if(latetime_ > xbwz2 && latetime_ < xbwz3) {
arrive_late = sbwd2;
}else if(latetime_ > xbwz3) {
arrive_late = sbwd3;
if(latetime != 0) {
latetime_ = Double.valueOf(String.valueOf(latetime));//前天晚走时长(分钟)
if(latetime_ > xbwz1 && latetime_ < xbwz2) {
arrive_late = sbwd1;
}else if(latetime_ > xbwz2 && latetime_ < xbwz3) {
arrive_late = sbwd2;
}else if(latetime_ > xbwz3) {
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.setChanged_time(changed_time);
}
attdate.setLatetime(latetime_);
attdate.setChanged_time(changed_time);
}
}
}
return ResultUtil.data(attdate);
......
......@@ -26,6 +26,7 @@ public class AttSchedule implements Serializable{
private Long starttime;
private Long endtime;
private int isupdate;//是否跟新打卡
private int isdk;//0:当前打卡 1:已过打卡
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