Commit da4966db by lal Committed by chenzg

提交

parent ebba5975
...@@ -33,7 +33,7 @@ public class ClockInTool { ...@@ -33,7 +33,7 @@ public class ClockInTool {
// 用StringBuffer来存放数组中的非空元素,用“;”分隔 // 用StringBuffer来存放数组中的非空元素,用“;”分隔
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
for (int i = 0; i < str.length; i++) { for (int i = 0; i < str.length; i++) {
if ("".equals(str[i])) { if ("null".equals(str[i])) {
continue; continue;
} }
sb.append(str[i]); sb.append(str[i]);
......
package cn.timer.api.controller.kqgl.atttimer; package cn.timer.api.controller.kqgl.atttimer;
import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -7,6 +8,7 @@ import java.util.Arrays; ...@@ -7,6 +8,7 @@ import java.util.Arrays;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Locale;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
...@@ -293,11 +295,14 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -293,11 +295,14 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
} }
} }
}else if(attgro.getPbfs() == 2){ //自由排班 }else if(attgro.getPbfs() == 2){ //自由排班
DateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US);
List<Schedule> ycqs = schedulemapper.getAttendanceShouldList(user.getEmpnum(),startDate,endDate); List<Schedule> ycqs = schedulemapper.getAttendanceShouldList(user.getEmpnum(),startDate,endDate);
int xiuxi = 0,shangban = 0,z=0; int xiuxi = 0,shangban = 0,z=0;
String[] ziyoupb = new String[ycqs.size()]; String[] ziyoupb = new String[ycqs.size()];
for(Schedule sc : ycqs){ for(Schedule sc : ycqs){
ziyoupb[z] = String.valueOf(sc.getData()); String data = new SimpleDateFormat("yyyy-MM-dd").format(df.parse(String.valueOf(sc.getData())));// 获得格式化后的日期字符串
ziyoupb[z] = data;
z++; z++;
if(sc.getBcid().equals(0)){ if(sc.getBcid().equals(0)){
xiuxi++; xiuxi++;
...@@ -314,6 +319,7 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -314,6 +319,7 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
KqglAssoPbmx pbx = KqglAssoPbmx.builder().build().selectOne(new QueryWrapper<KqglAssoPbmx>().lambda().eq(KqglAssoPbmx::getUserid, user.getEmpnum()).eq(KqglAssoPbmx::getData, num).eq(KqglAssoPbmx::getKqzid, attgro.getId())); KqglAssoPbmx pbx = KqglAssoPbmx.builder().build().selectOne(new QueryWrapper<KqglAssoPbmx>().lambda().eq(KqglAssoPbmx::getUserid, user.getEmpnum()).eq(KqglAssoPbmx::getData, num).eq(KqglAssoPbmx::getKqzid, attgro.getId()));
if(pbx!=null && pbx.getBcid()!=0) { if(pbx!=null && pbx.getBcid()!=0) {
ycqts[y] = num; ycqts[y] = num;
y++;
zjgzts++; zjgzts++;
}else { }else {
xxts[x] = num; xxts[x] = num;
...@@ -350,6 +356,7 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -350,6 +356,7 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
for(String num : range) { for(String num : range) {
if(Arrays.binarySearch(ziyoupb, String.valueOf(ClockInTool.dateToWeek(num))) >= 0) {//对比排班应打卡时间 if(Arrays.binarySearch(ziyoupb, String.valueOf(ClockInTool.dateToWeek(num))) >= 0) {//对比排班应打卡时间
ycqts[g] = num; ycqts[g] = num;
g++;
zjgzts++; zjgzts++;
}else { }else {
xxts[x] = num; xxts[x] = num;
...@@ -446,16 +453,18 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -446,16 +453,18 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
//遍历目前为止所有日期 结合该用户发起的审批进行结合 //遍历目前为止所有日期 结合该用户发起的审批进行结合
//1:加班 2:请假 3:出差 4:外出 5:补卡 //1:加班 2:请假 3:出差 4:外出 5:补卡
for(String num : range) { for(String num : range) {
if(Arrays.binarySearch(ClockInTool.replaceNull(xxts), num) >= 0 && Arrays.binarySearch(ClockInTool.replaceNull(dkjtts),num) >= 0) { if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(xxts),"null"), num) >= 0 && Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(dkjtts),"null"),num) >= 0) {
rowData.add("休息并打卡"); rowData.add("休息并打卡");
}else if(Arrays.binarySearch(ClockInTool.replaceNull(xxts), num) >= 0){ }else if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(xxts),"null"), num) >= 0){
rowData.add("休息"); rowData.add("休息");
}else { }else {
if(Arrays.binarySearch(ClockInTool.replaceNull(ycqts), num) < 0 && Arrays.binarySearch(ClockInTool.replaceNull(leaves), num) < 0 && Arrays.binarySearch(ClockInTool.replaceNull(travels), num) < 0 && Arrays.binarySearch(ClockInTool.replaceNull(goouts), num) < 0 && Arrays.binarySearch(ClockInTool.replaceNull(cards), num) < 0) { if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(ycqts),"null"), num) >= 0 && Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(dkjtts),"null"), num) < 0 && Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(leaves),"null"), num) < 0 && Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(travels),"null"), num) < 0 && Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(goouts),"null"), num) < 0 && Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(cards),"null"), num) < 0) {
rowData.add("旷工"); rowData.add("旷工");
}else if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(ycqts),"null"), num) < 0 && Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(xxts),"null"), num) < 0) {//日期不在上班也不在休息里面即为未排班
rowData.add("未排班");
}else if(sdf1.parse(beginTime).getTime() < sdf1.parse(num).getTime()) { }else if(sdf1.parse(beginTime).getTime() < sdf1.parse(num).getTime()) {
rowData.add("未到班期"); rowData.add("未到班期");
}else if(Arrays.binarySearch(ClockInTool.replaceNull(leaves), num) >= 0) {//请假 }else if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(leaves),"null"), num) >= 0) {//请假
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 2)); KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 2));
String leavetype = "未知";//请假类型 String leavetype = "未知";//请假类型
String company = "未知";//请假单位 String company = "未知";//请假单位
...@@ -471,16 +480,16 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -471,16 +480,16 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
} }
rowData.add(lea.getStartTime() +"到"+ lea.getEndTime()+"请"+leavetype+lea.getDuration()+company); rowData.add(lea.getStartTime() +"到"+ lea.getEndTime()+"请"+leavetype+lea.getDuration()+company);
}else if(Arrays.binarySearch(ClockInTool.replaceNull(travels), num) >= 0) {//出差 }else if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(travels),"null"), num) >= 0) {//出差
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 3)); KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 3));
rowData.add(lea.getStartTime() +"到"+ lea.getEndTime()+"出差"+lea.getDuration()+"天"); rowData.add(lea.getStartTime() +"到"+ lea.getEndTime()+"出差"+lea.getDuration()+"天");
}else if(Arrays.binarySearch(ClockInTool.replaceNull(goouts), num) >= 0){//外出 }else if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(goouts),"null"), num) >= 0){//外出
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 4)); KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 4));
rowData.add(lea.getStartTime() +"到"+ lea.getEndTime()+"外出"+lea.getDuration()+"天"); rowData.add(lea.getStartTime() +"到"+ lea.getEndTime()+"外出"+lea.getDuration()+"天");
}else if(Arrays.binarySearch(ClockInTool.replaceNull(cards), num) >= 0){//补卡 }else if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(cards),"null"), num) >= 0){//补卡
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 5)); KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 5));
rowData.add("已补卡:"+lea.getStartTime()); rowData.add("已补卡:"+lea.getStartTime());
}else if(Arrays.binarySearch(ClockInTool.replaceNull(overtimes), num) >= 0) {//加班 }else if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(overtimes),"null"), num) >= 0) {//加班
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 1)); KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 1));
String company = "未知",method = "无";//加班单位、加班补偿方式 String company = "未知",method = "无";//加班单位、加班补偿方式
...@@ -498,7 +507,7 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -498,7 +507,7 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
rowData.add(lea.getStartTime() +"到"+ lea.getEndTime()+"加班"+lea.getDuration()+company+"["+method+"]"); rowData.add(lea.getStartTime() +"到"+ lea.getEndTime()+"加班"+lea.getDuration()+company+"["+method+"]");
//加班补偿方式 1:转调休;2:转加班费;3:转调休或加班费 //加班补偿方式 1:转调休;2:转加班费;3:转调休或加班费
//工作日 //工作日
if(Arrays.binarySearch(ClockInTool.replaceNull(ycqts), num) >= 0) { if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(ycqts),"null"), num) >= 0) {
if(lea.getCompensateId() == 1) { if(lea.getCompensateId() == 1) {
workingturncompenleave++; workingturncompenleave++;
}else if(lea.getCompensateId() == 2) { }else if(lea.getCompensateId() == 2) {
...@@ -506,14 +515,14 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -506,14 +515,14 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
} }
} }
//休息日 //休息日
if(Arrays.binarySearch(ClockInTool.replaceNull(xxts), num) >= 0) { if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(xxts),"null"), num) >= 0) {
if(lea.getCompensateId() == 1) { if(lea.getCompensateId() == 1) {
restturncompenleave++; restturncompenleave++;
}else if(lea.getCompensateId() == 2) { }else if(lea.getCompensateId() == 2) {
resttransferovertime++; resttransferovertime++;
} }
} }
if(Arrays.binarySearch(ClockInTool.replaceNull(ycqts), num) < 0 && Arrays.binarySearch(ClockInTool.replaceNull(xxts), num) < 0) { if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(ycqts),"null"), num) < 0 && Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(xxts),"null"), num) < 0) {
if(lea.getCompensateId() == 1) { if(lea.getCompensateId() == 1) {
holidayturncompenleave++; holidayturncompenleave++;
}else if(lea.getCompensateId() == 2) { }else if(lea.getCompensateId() == 2) {
...@@ -521,19 +530,19 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -521,19 +530,19 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
} }
} }
}else{ }else{
if(Arrays.binarySearch(ClockInTool.replaceNull(sblacks), num) >= 0) { if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(sblacks),"null"), num) >= 0) {
rowData.add("上班缺卡"); rowData.add("上班缺卡");
}else if(Arrays.binarySearch(ClockInTool.replaceNull(sblacks), num) >= 0 && Arrays.binarySearch(ClockInTool.replaceNull(ztts), num) >= 0) { }else if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(sblacks),"null"), num) >= 0 && Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(ztts),"null"), num) >= 0) {
rowData.add("上班缺卡,下班早退"); rowData.add("上班缺卡,下班早退");
}else if(Arrays.binarySearch(ClockInTool.replaceNull(cdts), num) >= 0) { }else if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(cdts),"null"), num) >= 0) {
rowData.add("上班迟到"); rowData.add("上班迟到");
}else if(Arrays.binarySearch(ClockInTool.replaceNull(cdts), num) >= 0 && Arrays.binarySearch(ClockInTool.replaceNull(xblacks), num) >= 0) { }else if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(cdts),"null"), num) >= 0 && Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(xblacks),"null"), num) >= 0) {
rowData.add("上班迟到,下班缺卡"); rowData.add("上班迟到,下班缺卡");
}else if(Arrays.binarySearch(ClockInTool.replaceNull(cdts), num) >= 0 && Arrays.binarySearch(ClockInTool.replaceNull(ztts), num) >= 0) { }else if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(cdts),"null"), num) >= 0 && Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(ztts),"null"), num) >= 0) {
rowData.add("上班迟到,下班早退"); rowData.add("上班迟到,下班早退");
}else if(Arrays.binarySearch(ClockInTool.replaceNull(xblacks), num) >= 0) { }else if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(xblacks),"null"), num) >= 0) {
rowData.add("下班缺卡"); rowData.add("下班缺卡");
}else if(Arrays.binarySearch(ClockInTool.replaceNull(ztts), num) >= 0) { }else if(Arrays.binarySearch(ClockInTool.doChinFilters(ClockInTool.replaceNull(ztts),"null"), num) >= 0) {
rowData.add("下班早退"); rowData.add("下班早退");
}else { }else {
rowData.add("正常"); rowData.add("正常");
......
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