Commit ab1c89e5 by lal Committed by chenzg

提交

parent 6b0dcc31
......@@ -531,6 +531,7 @@ public class ClockInController {
}
}
if(isRange) {
int yxcd = shif.getYxcdfzs();//允许迟到
int yzcd = shif.getYzcdfzs();//严重迟到分钟数
int kgcdfzs = shif.getKgcdfzs();//旷工迟到分钟数
......@@ -648,6 +649,10 @@ public class ClockInController {
}
}
//允许迟到范围
if(sbdkjg <= yxcd) {
sbdkjg = 0;
}
if(atttype == 1) {
pcd.setSbdk1(time_);
......@@ -669,16 +674,25 @@ public class ClockInController {
pcd.setXbdk3jg(sbdkjg);
}
int ydkcs = 0;
if(shif != null){ydkcs = shif.getSxbcs()*2;}//应打卡次数
if(sbdkjg > yzcd && yzcd>0) {
if(shif != null){
ydkcs = shif.getSxbcs()*2;
}//应打卡次数
pcd.setYdkcs(ydkcs);
//严重迟到范围
if(sbdkjg>yzcd && sbdkjg < kgcdfzs && yzcd>0) {
yzcdcs++;
yzcdsc = sbdkjg - yzcd;
yzcdsc = sbdkjg;
}
if(sbdkjg > kgcdfzs && kgcdfzs>0) {kgcdcs++;}
pcd.setYdkcs(ydkcs);
pcd.setYzcdcs(yzcdcs);
pcd.setYzcdsc(Double.valueOf(yzcdsc));
pcd.setKgcdfzs(kgcdcs);
//旷工迟到
if(sbdkjg>kgcdfzs && kgcdfzs>0) {
kgcdcs++;
}
pcd.setYzcdcs(yzcdcs);//严重迟到次数
pcd.setYzcdsc(Double.valueOf(yzcdsc));//严重迟到时长(分钟)
pcd.setKgcdfzs(kgcdcs);//旷工迟到次数
if (!pcd.insert()) {
throw new CustomException("打卡明细-新增异常-1");
}
......@@ -710,15 +724,26 @@ public class ClockInController {
Long time = (time_ - punchcardtime)/1000/60;
if(time > 0){sbdk2jg = Math.abs(Integer.valueOf(time.toString()));}
}
if(sbdk2jg > yzcd&& yzcd>0) {
//允许迟到范围
if(sbdk2jg <= yxcd) {
sbdk2jg = 0;
}
//严重迟到范围
if(sbdk2jg>yzcd && sbdk2jg < kgcdfzs && yzcd>0) {
yzcdcs = dkmc.getYzcdcs()+1;
yzcdsc = sbdk2jg - yzcd;
yzcdsc = sbdk2jg;
}
//旷工迟到
if(sbdk2jg>kgcdfzs && kgcdfzs>0) {
kgcdcs++;
}
if(sbdk2jg > kgcdfzs&& kgcdfzs>0) {kgcdcs++;}
pcd.setId(dkmc.getId());
pcd.setSbdk2(time_);//上班1打卡时间
pcd.setSbdk2jg(sbdk2jg);
pcd.setYzcdcs(yzcdcs);
pcd.setYzcdsc(Double.valueOf(yzcdsc));
pcd.setKgcdfzs(kgcdcs);
......@@ -754,11 +779,21 @@ public class ClockInController {
Long time = (time_ - punchcardtime)/1000/60;
if(time > 0){sbdk3jg = Math.abs(Integer.valueOf(time.toString()));}
}
if(sbdk3jg > yzcd&& yzcd>0) {
//允许迟到范围
if(sbdk3jg <= yxcd) {
sbdk3jg = 0;
}
//严重迟到范围
if(sbdk3jg>yzcd && sbdk3jg < kgcdfzs && yzcd>0) {
yzcdcs = dkmc.getYzcdcs()+1;
yzcdsc = sbdk3jg - yzcd;
yzcdsc = sbdk3jg;
}
if(sbdk3jg > kgcdfzs&& kgcdfzs>0) {kgcdcs++;}
//旷工迟到
if(sbdk3jg>kgcdfzs && kgcdfzs>0) {
kgcdcs++;
}
pcd.setId(dkmc.getId());
pcd.setSbdk3(time_);//上班1打卡时间
pcd.setSbdk3jg(sbdk3jg);
......
......@@ -117,7 +117,7 @@ public class AttendanceTaskTiming{
// @Scheduled(cron = "0 22 15 * * ?") // 测试:5秒执行一次 0 0 19 * * ?
// @Scheduled(cron = "0 */5 * * * ?")
// @Scheduled(cron = "0 24 10 * * ?")
@Scheduled(cron = "0 30 19 * * ?")
public void AttendanceTask() throws ParseException {
// boolean implement = false;
......@@ -154,9 +154,14 @@ public class AttendanceTaskTiming{
String str = new SimpleDateFormat("yyyy-MM-dd").format(new Date()).toString();//
String ttstr = new SimpleDateFormat("yyyy-MM").format(new Date()).toString();//
String[] rangeArray=ClockInTool.listToString(ClockInTool.getDays(sdf1.format(c.getTime()),str)).split(";");//目前为止所有日期
String yesterday = ClockInTool.requires_extra_times(str,-1,3,1);//前一天
String[] rangeArray=ClockInTool.listToString(ClockInTool.getDays(sdf1.format(c.getTime()),yesterday)).split(";");//目前为止所有日期
String[] range=rangeArray[0].split(",");
Long endDateyesterday = DateUtil.getnowEndTime(23,DateUtil.getStringTime(yesterday,"yyyy-MM-dd")).getTime();
int year = Calendar.getInstance().get(Calendar.YEAR);
int month = Calendar.getInstance().get(Calendar.MONTH) + 1;
......@@ -181,7 +186,7 @@ public class AttendanceTaskTiming{
//考勤组信息
KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(user.getEmpnum(),org_code);
//目前为止打卡记录
List<PunchCardDetails> attendance = punchcarddetailsmapper.selectAttendanceDays(user.getEmpnum(), startDate, new Date().getTime());
List<PunchCardDetails> attendance = punchcarddetailsmapper.selectAttendanceDays(user.getEmpnum(), startDate, endDateyesterday);
int dkjl = 0;//目前为止打卡次数
int sbqkcs = 0,xbqkcs = 0,dk=0;
String[] sblacks = new String[31];//上班缺卡天数
......@@ -423,7 +428,7 @@ public class AttendanceTaskTiming{
}
}
}
List<PunchRecord> initial = punchrecordmapper.getMaintenancePunchCardList(startDate,new Date().getTime(),user.getEmpnum());
List<PunchRecord> initial = punchrecordmapper.getMaintenancePunchCardList(startDate,endDateyesterday,user.getEmpnum());
// // 迟到次数 迟到时长 早退次数 早退时长
// int latenum = 0,latehours = 0,leanum = 0,leahours = 0;// 迟到次数
String[] cdts = new String[31];//迟到的具体天数
......
......@@ -242,12 +242,21 @@
</select>
<select id="MonthlySummaryLeave" resultMap="BalanceSheetDataMap">
select res.leave_type_id as leaverulesid,res.duration as balancedays from kqgl_asso_relation_summary res
<!-- select res.leave_type_id as leaverulesid,res.duration as balancedays from kqgl_asso_relation_summary res
where res.user_id = #{userid}
and res.approval_type = 2
and res.org_code = #{orgcode}
and SUBSTR(res.app_time,1,7) = #{apptime}
GROUP BY res.leave_type_id,res.duration
GROUP BY res.leave_type_id,res.duration -->
select aa.leaverulesid,SUM(aa.balancedays) as balancedays from (
select res.leave_type_id as leaverulesid,res.duration as balancedays from kqgl_asso_relation_summary res
where res.user_id = #{userid}
and res.approval_type = 2
and res.org_code = #{orgcode}
and SUBSTR(res.app_time,1,7) = #{apptime}
GROUP BY res.leave_type_id,res.duration) as aa
GROUP BY aa.leaverulesid
</select>
<select id="FormMonthlySummaryLeave" resultMap="BalanceSheetDataMap">
......
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