Commit c703082c by lal

提交

parent c7884a30
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -51,13 +51,13 @@ import cn.timer.api.utils.DateUtil; ...@@ -51,13 +51,13 @@ import cn.timer.api.utils.DateUtil;
/** /**
* @author lal * @author lal
* * 考勤报表汇总数据
*/ */
@Component @Component
@Lazy @Lazy
public class AttendanceTaskTiming implements SchedulingConfigurer { public class AttendanceTaskTiming implements SchedulingConfigurer {
private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss"); // private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
static String tablename = null; static String tablename = null;
@Autowired @Autowired
...@@ -125,7 +125,7 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -125,7 +125,7 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
//逻辑 //逻辑
if(implement) { if(implement) {
System.err.println("当前时间:" + dateFormat.format(new Date())); // System.err.println("时间:" + dateFormat.format(new Date()));
Calendar c = Calendar.getInstance(); Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH, 0); c.add(Calendar.MONTH, 0);
...@@ -148,8 +148,8 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -148,8 +148,8 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
KqglAssoMonthPunchSummary.builder().build().delete(new QueryWrapper<KqglAssoMonthPunchSummary>().lambda().eq(KqglAssoMonthPunchSummary::getBelongYear, year).eq(KqglAssoMonthPunchSummary::getBelongMonth, month)); KqglAssoMonthPunchSummary.builder().build().delete(new QueryWrapper<KqglAssoMonthPunchSummary>().lambda().eq(KqglAssoMonthPunchSummary::getBelongYear, year).eq(KqglAssoMonthPunchSummary::getBelongMonth, month));
// for(int t = 0;t<orgcodelist.size();t++){ for(int t = 0;t<orgcodelist.size();t++){
int org_code = 117;//orgcodelist.get(t).getId();//企业组织代码 int org_code = orgcodelist.get(t).getId();//企业组织代码
List<AdditionalDto> userlist = kqglassoleavebalancemapper.selectAdditionalList(org_code); List<AdditionalDto> userlist = kqglassoleavebalancemapper.selectAdditionalList(org_code);
for(AdditionalDto user : userlist) { for(AdditionalDto user : userlist) {
double traveltotal = 0,egresstotal = 0,overtimetotal = 0; double traveltotal = 0,egresstotal = 0,overtimetotal = 0;
...@@ -193,7 +193,6 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -193,7 +193,6 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
//具体打卡时间入汇总表(打卡成功才会录入汇总表) //具体打卡时间入汇总表(打卡成功才会录入汇总表)
// KqglAssoMonthPunchSummary isyessum = KqglAssoMonthPunchSummary.builder().build().selectOne(new QueryWrapper<KqglAssoMonthPunchSummary>().lambda() // KqglAssoMonthPunchSummary isyessum = KqglAssoMonthPunchSummary.builder().build().selectOne(new QueryWrapper<KqglAssoMonthPunchSummary>().lambda()
// .eq(KqglAssoMonthPunchSummary::getNum, user.getEmpnum()).eq(KqglAssoMonthPunchSummary::getOrgCode, org_code)); // .eq(KqglAssoMonthPunchSummary::getNum, user.getEmpnum()).eq(KqglAssoMonthPunchSummary::getOrgCode, org_code));
String[] ycqts = new String[31];//应上班的具体天数(yyyy-MM-dd) String[] ycqts = new String[31];//应上班的具体天数(yyyy-MM-dd)
String[] xxts = new String[31];//休息的具体天数(yyyy-MM-dd) String[] xxts = new String[31];//休息的具体天数(yyyy-MM-dd)
List<String> rowData = new ArrayList<String>(); List<String> rowData = new ArrayList<String>();
...@@ -204,16 +203,12 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -204,16 +203,12 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
double workinghours = 0,seriouslatetimes = 0,seriouslatehours = 0,absenlatetimes = 0; double workinghours = 0,seriouslatetimes = 0,seriouslatehours = 0,absenlatetimes = 0;
// 迟到次数 迟到时长 早退次数 早退时长 // 迟到次数 迟到时长 早退次数 早退时长
int latenum = 0,latehours = 0,leanum = 0,leahours = 0;// 迟到次数 int latenum = 0,latehours = 0,leanum = 0,leahours = 0;// 迟到次数
int answer =0;//班次ID
double workingturncompenleave = 0;//工作日(转调休) //工作日(转调休)、休息日(转调休)、节假日(转调休)
double restturncompenleave = 0;//休息日(转调休) double workingturncompenleave = 0,restturncompenleave = 0,holidayturncompenleave = 0;//工作日(转调休)
double holidayturncompenleave = 0;//节假日(转调休) //工作日(转加班费)、休息日(转加班费)、节假日(转加班费)
double workingtransferovertime = 0;//工作日(转加班费) double workingtransferovertime = 0,resttransferovertime = 0,holidaytransferovertime = 0;
double resttransferovertime = 0;//休息日(转加班费)
double holidaytransferovertime = 0;//节假日(转加班费)
int attgroid = 0; int attgroid = 0;
if(attgro != null){//该员工是否加入到考勤组 排班方式 1:固定排班;2:自由排班;3:自由工时 计算出应出勤,实际出勤,休息天数 if(attgro != null){//该员工是否加入到考勤组 排班方式 1:固定排班;2:自由排班;3:自由工时 计算出应出勤,实际出勤,休息天数
attgroid = attgro.getId(); attgroid = attgro.getId();
// KqglAssoBcsz shif = KqglAssoBcsz.builder().build(); // KqglAssoBcsz shif = KqglAssoBcsz.builder().build();
...@@ -221,7 +216,6 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -221,7 +216,6 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
// double daysOff = 0,daysOnDuty = 0;//,actualAttDays = 0; // double daysOff = 0,daysOnDuty = 0;//,actualAttDays = 0;
// int zjgzts = 0;//目前为止应该出勤的天数 // int zjgzts = 0;//目前为止应该出勤的天数
if(attgro.getPbfs() == 1){ //固定排班 if(attgro.getPbfs() == 1){ //固定排班
List<KqglAssoTeshu> bxdklist = kqglassoteshumapper.ShouldSpecialDatessetByKqzid(attgro.getId(), ttstr,1);//当前月 必须打卡日期 List<KqglAssoTeshu> bxdklist = kqglassoteshumapper.ShouldSpecialDatessetByKqzid(attgro.getId(), ttstr,1);//当前月 必须打卡日期
int bxdk = bxdklist.size(); int bxdk = bxdklist.size();
String[] bxdkss = new String[bxdk];////特殊-必须打卡天数(工作日) String[] bxdkss = new String[bxdk];////特殊-必须打卡天数(工作日)
...@@ -237,8 +231,6 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -237,8 +231,6 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
appmaps[d1] = spe.getTsrq(); appmaps[d1] = spe.getTsrq();
d1++; d1++;
} }
List<AttendanceWeeklySch> atwek = attendanceweeklyschmapper.selectAttendanceMadeByUserid(user.getEmpnum()); List<AttendanceWeeklySch> atwek = attendanceweeklyschmapper.selectAttendanceMadeByUserid(user.getEmpnum());
String[] week= new String[atwek.size()]; String[] week= new String[atwek.size()];
String[] needfig = new String[atwek.size()];//应打卡周期时间 String[] needfig = new String[atwek.size()];//应打卡周期时间
...@@ -296,7 +288,6 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -296,7 +288,6 @@ 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); 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()];
...@@ -445,9 +436,7 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -445,9 +436,7 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
//排查请假是否在最后一次打卡范围内 //排查请假是否在最后一次打卡范围内
List<KqglAssoRelationSummary> leainv = kqglassorelationsummarymapper.LeaveInvestigation(user.getEmpnum(), 2, ttstr); List<KqglAssoRelationSummary> leainv = kqglassorelationsummarymapper.LeaveInvestigation(user.getEmpnum(), 2, ttstr);
KqglAssoBcsz shif = KqglAssoBcsz.builder().build(); KqglAssoBcsz shif = KqglAssoBcsz.builder().build();
String beginTime = sdf1.format(new Date()); String beginTime = sdf1.format(new Date());
// List<String> rowData = new ArrayList<String>(); // List<String> rowData = new ArrayList<String>();
//遍历目前为止所有日期 结合该用户发起的审批进行结合 //遍历目前为止所有日期 结合该用户发起的审批进行结合
...@@ -479,7 +468,6 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -479,7 +468,6 @@ 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.doChinFilters(ClockInTool.replaceNull(travels),"null"), 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()+"天");
...@@ -490,7 +478,6 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -490,7 +478,6 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
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.doChinFilters(ClockInTool.replaceNull(overtimes),"null"), 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 = "无";//加班单位、加班补偿方式
//最小加班单位 1:按分钟加班、2:按半小时加班、3:按小时加班、4:按半天加班、5:按天加班 //最小加班单位 1:按分钟加班、2:按半小时加班、3:按小时加班、4:按半天加班、5:按天加班
...@@ -550,8 +537,6 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -550,8 +537,6 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
} }
} }
/****************************************/
if(attgro.getPbfs() == 1){ if(attgro.getPbfs() == 1){
int several = Integer.valueOf(ClockInTool.dateToWeek(num));// int several = Integer.valueOf(ClockInTool.dateToWeek(num));//
KqglAssoTeshu tesu = KqglAssoTeshu.builder().build().selectOne(new QueryWrapper<KqglAssoTeshu>().lambda().eq(KqglAssoTeshu::getKqzid, attgro.getId()).eq(KqglAssoTeshu::getTsrq, num)); KqglAssoTeshu tesu = KqglAssoTeshu.builder().build().selectOne(new QueryWrapper<KqglAssoTeshu>().lambda().eq(KqglAssoTeshu::getKqzid, attgro.getId()).eq(KqglAssoTeshu::getTsrq, num));
...@@ -580,8 +565,7 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -580,8 +565,7 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
if(shif != null && shif.getSxbcs() != null) { if(shif != null && shif.getSxbcs() != null) {
System.out.println(shif.getSxbcs()); System.out.println(shif.getSxbcs());
int answer = shif.getSxbcs();//1=2次 2=4次 3=6次 answer = shif.getSxbcs();//1=2次 2=4次 3=6次
//未打最后一次卡的时候 判断最后一次打卡时间是否在请假范围内 相对应减少下班缺卡次数 //未打最后一次卡的时候 判断最后一次打卡时间是否在请假范围内 相对应减少下班缺卡次数
//最后一次应打卡时间 //最后一次应打卡时间
String latimeclock = ""; String latimeclock = "";
...@@ -611,7 +595,6 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -611,7 +595,6 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
System.err.print("该员工未加入考勤组"); System.err.print("该员工未加入考勤组");
} }
String[] range1=ClockInTool.listToString(rowData).split(";"); String[] range1=ClockInTool.listToString(rowData).split(";");
String[] noticesArray=range1[0].split(","); String[] noticesArray=range1[0].split(",");
noticesArray = ClockInTool.arrycopy(noticesArray); noticesArray = ClockInTool.arrycopy(noticesArray);
...@@ -630,8 +613,7 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -630,8 +613,7 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
} }
KqglAssoMonthPunchSummary summary = KqglAssoMonthPunchSummary.builder().name(user.getEmpname()).num(user.getEmpnum()).dept(department) KqglAssoMonthPunchSummary summary = KqglAssoMonthPunchSummary.builder().name(user.getEmpname()).num(user.getEmpnum()).dept(department)
.post(position).attGroup(attgroid).build(); .post(position).attGroup(attgroid).shift(answer).build();
summary.setDaysOnDuty(daysOnDuty);//应出勤天数 summary.setDaysOnDuty(daysOnDuty);//应出勤天数
summary.setActualAttDays(Double.valueOf(dkjl));//实际出勤天数 summary.setActualAttDays(Double.valueOf(dkjl));//实际出勤天数
summary.setDaysOff(daysOff);//休息天数 summary.setDaysOff(daysOff);//休息天数
...@@ -663,7 +645,6 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -663,7 +645,6 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
summary.setWorkingTransferOvertime(workingtransferovertime);//工作日(转加班费) summary.setWorkingTransferOvertime(workingtransferovertime);//工作日(转加班费)
summary.setRestTransferOvertime(resttransferovertime);//休息日(转加班费) summary.setRestTransferOvertime(resttransferovertime);//休息日(转加班费)
summary.setHolidayTransferOvertime(holidaytransferovertime);//节假日(转加班费) summary.setHolidayTransferOvertime(holidaytransferovertime);//节假日(转加班费)
summary.setDay1(noticesArray[0]); summary.setDay1(noticesArray[0]);
summary.setDay2(noticesArray[1]); summary.setDay2(noticesArray[1]);
summary.setDay3(noticesArray[2]); summary.setDay3(noticesArray[2]);
...@@ -697,8 +678,7 @@ public class AttendanceTaskTiming implements SchedulingConfigurer { ...@@ -697,8 +678,7 @@ public class AttendanceTaskTiming implements SchedulingConfigurer {
summary.setDay31(noticesArray[30]); summary.setDay31(noticesArray[30]);
summary.insert(); summary.insert();
} }
// } }
// KqglTaskTiming.builder().task("AttendanceTask").id(sockid).executionStatus(0).lastExecutionTime(new Date().getTime()).build().updateById(); // KqglTaskTiming.builder().task("AttendanceTask").id(sockid).executionStatus(0).lastExecutionTime(new Date().getTime()).build().updateById();
return new Exception().getStackTrace()[0].getMethodName(); return new Exception().getStackTrace()[0].getMethodName();
......
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