Commit f11e0b65 by lal

提交

parent f46d98e3
...@@ -475,6 +475,13 @@ public class ClockInController { ...@@ -475,6 +475,13 @@ public class ClockInController {
int dkcs_ = shif.getSxbcs();//上下班打卡次数 int dkcs_ = shif.getSxbcs();//上下班打卡次数
int iswzwd = shif.getIsWzwd();//是否开启晚走晚到(0:否;1:是) int iswzwd = shif.getIsWzwd();//是否开启晚走晚到(0:否;1:是)
long rest_time = 0;
if(shif.getStartTime() != null && shif.getEndTime() != null) {
long kaishixiuxi = Long.valueOf(ClockInTool.dateToStamp(putime + " " +shif.getStartTime()+":00"));
long jieshuxiuxi = Long.valueOf(ClockInTool.dateToStamp(putime + " " +shif.getEndTime()+":00"));
rest_time = (jieshuxiuxi - kaishixiuxi)/1000/60;//休息时间
}
double xbwz1 = 0,xbwz2=0,xbwz3=0; double xbwz1 = 0,xbwz2=0,xbwz3=0;
int sbwd1=0,sbwd2=0,sbwd3=0; int sbwd1=0,sbwd2=0,sbwd3=0;
...@@ -620,7 +627,7 @@ public class ClockInController { ...@@ -620,7 +627,7 @@ public class ClockInController {
} }
} }
if(dkmc.getSbdk1() != null){ if(dkmc.getSbdk1() != null){
Long time = (time_ - dkmc.getSbdk1())/1000/60; Long time = (time_ - dkmc.getSbdk1())/1000/60 - rest_time;
pcd.setGzsc(Math.abs(Double.valueOf(time.toString())));//只打一次卡时计算工作时长 pcd.setGzsc(Math.abs(Double.valueOf(time.toString())));//只打一次卡时计算工作时长
} }
kqglassodkmxmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录 kqglassodkmxmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录
...@@ -661,7 +668,12 @@ public class ClockInController { ...@@ -661,7 +668,12 @@ public class ClockInController {
Long time = (time_ - dkmc.getSbdk2())/1000/60; Long time = (time_ - dkmc.getSbdk2())/1000/60;
BigDecimal om = new BigDecimal(dkmc.getGzsc()); BigDecimal om = new BigDecimal(dkmc.getGzsc());
BigDecimal on = new BigDecimal(time); BigDecimal on = new BigDecimal(time);
double worktime = Math.abs(om.add(on).doubleValue()); BigDecimal worktime_ = new BigDecimal(Math.abs(om.add(on).doubleValue()));
BigDecimal xx = new BigDecimal(rest_time);
double worktime = Math.abs(worktime_.subtract(xx).doubleValue());
pcd.setGzsc(worktime); pcd.setGzsc(worktime);
} }
kqglassodkmxmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录 kqglassodkmxmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录
...@@ -699,7 +711,12 @@ public class ClockInController { ...@@ -699,7 +711,12 @@ public class ClockInController {
Long time = (time_ - dkmc.getSbdk3())/1000/60; Long time = (time_ - dkmc.getSbdk3())/1000/60;
BigDecimal om = new BigDecimal(dkmc.getGzsc());//第二次 BigDecimal om = new BigDecimal(dkmc.getGzsc());//第二次
BigDecimal on = new BigDecimal(time); BigDecimal on = new BigDecimal(time);
double worktime = Math.abs(om.add(on).doubleValue()); BigDecimal worktime_ = new BigDecimal(Math.abs(om.add(on).doubleValue()));
BigDecimal xx = new BigDecimal(rest_time);
double worktime = Math.abs(worktime_.subtract(xx).doubleValue());
pcd.setGzsc(worktime); pcd.setGzsc(worktime);
} }
} }
......
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