Commit 429d0c76 by lal

提交BUG

parent 5cbf737c
......@@ -55,10 +55,10 @@ public class KqglAssoRelationSummary extends Model<KqglAssoRelationSummary> {
@ApiModelProperty(value = "假期类型id", example = "101")
private Integer leaveTypeId;
@ApiModelProperty(value = "加班类型id", example = "101")
@ApiModelProperty(value = "加班类型id 1:工作日加班;2:休息日加班;3:节假日加班", example = "101")
private Integer overtimeTypeId;
@ApiModelProperty(value = "加班补偿方式 1:转调休;2:转加班费;3:转调休或加班费", example = "101")
@ApiModelProperty(value = "加班补偿方式 1:转调休;2:转加班费;(3:转调休 4:加班费)", example = "101")
private Integer compensateId;
@ApiModelProperty(value = "开始时间 ", example = "开始时间")
......
......@@ -107,8 +107,9 @@ public class AttendanceTaskTiming{
//3.添加定时任务 每四小时执行一次
// @Scheduled(cron = "0 0 */4 * * ?")
// @Scheduled(cron = "0 02 12 * * ?") // 测试:5秒执行一次 0 0 19 * * ?
// @Scheduled(cron = "0 22 15 * * ?") // 测试:5秒执行一次 0 0 19 * * ?
// @Scheduled(cron = "0 */5 * * * ?")
@Scheduled(cron = "0 0 19 * * ?")
public void AttendanceTask() throws ParseException {
// boolean implement = false;
......@@ -499,88 +500,7 @@ public class AttendanceTaskTiming{
}
// if(Arrays.binarySearch(ClockInTool.deleteArrayNull(leaves), num) >= 0) {//请假
if(ClockInTool.contains(ClockInTool.deleteArrayNull(leaves),num)) {
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 company = "未知";//请假单位
if(lea != null) {
KqglAssoLeaveRules rul = KqglAssoLeaveRules.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getId, lea.getLeaveTypeId()));
if(rul != null) {
leavetype = rul.getName();
//1:按天请假;2:按半天;3:按小时
if(rul.getCompany() == 1) { company = "天"; }
else if(rul.getCompany() == 2) { company = "半天"; }
else { company = "小时"; }
}
}
rowData.add(lea.getStartTime() +"到"+ lea.getEndTime()+"请"+leavetype+lea.getDuration()+company);
}
// if(Arrays.binarySearch(ClockInTool.deleteArrayNull(travels), num) >= 0) {//出差
if(ClockInTool.contains(ClockInTool.deleteArrayNull(travels),num)) {
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()+"天");
}
// if(Arrays.binarySearch(ClockInTool.deleteArrayNull(goouts), num) >= 0){//外出
if(ClockInTool.contains(ClockInTool.deleteArrayNull(goouts),num)) {
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()+"天");
}
// if(Arrays.binarySearch(ClockInTool.deleteArrayNull(cards), num) >= 0){//补卡
if(ClockInTool.contains(ClockInTool.deleteArrayNull(cards),num)) {
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());
}
// if(Arrays.binarySearch(ClockInTool.deleteArrayNull(overtimes), num) >= 0) {//加班
if(ClockInTool.contains(ClockInTool.deleteArrayNull(overtimes),num)) {
// 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 = "无";//加班单位、加班补偿方式
List<KqglAssoRelationSummary> leas = KqglAssoRelationSummary.builder().build().selectList(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 1));
for(KqglAssoRelationSummary lea : leas) {
//最小加班单位 1:按分钟加班、2:按半小时加班、3:按小时加班、4:按半天加班、5:按天加班
KqglAssoOvertimeBasics basics = KqglAssoOvertimeBasics.builder().build().selectOne(new QueryWrapper<KqglAssoOvertimeBasics>().lambda().eq(KqglAssoOvertimeBasics::getOrgCode, org_code));
if(basics.getMinimumUnit() == 1) { company = "分钟"; }
else if(basics.getMinimumUnit() == 2) { company = "半小时";}
else if(basics.getMinimumUnit() == 3) { company = "小时";}
else if(basics.getMinimumUnit() == 4) { company = "半天";}
else if(basics.getMinimumUnit() == 5) { company = "天";}
//1:转调休;2:转加班费;3:转调休或加班费
if(lea.getCompensateId() == 1) { method="转调休"; }
else if(lea.getCompensateId() == 2) { method="转加班费"; }
else {method="转调休或加班费";}
rowData.add(lea.getStartTime() +"到"+ lea.getEndTime()+"加班"+lea.getDuration()+company+"["+method+"]");
//加班补偿方式 1:转调休;2:转加班费;3:转调休或加班费
//工作日
// if(Arrays.binarySearch(ClockInTool.deleteArrayNull(ycqts), num) >= 0) {
if(ClockInTool.contains(ClockInTool.deleteArrayNull(ycqts),num)) {
if(lea.getCompensateId() == 1) {
workingturncompenleave++;
}else if(lea.getCompensateId() == 2) {
workingtransferovertime++;
}
}
//休息日
// if(Arrays.binarySearch(ClockInTool.deleteArrayNull(xxts), num) >= 0) {
if(ClockInTool.contains(ClockInTool.deleteArrayNull(xxts),num)) {
if(lea.getCompensateId() == 1) {
restturncompenleave++;
}else if(lea.getCompensateId() == 2) {
resttransferovertime++;
}
}
// if(Arrays.binarySearch(ClockInTool.deleteArrayNull(ycqts), num) < 0 && Arrays.binarySearch(ClockInTool.deleteArrayNull(xxts), num) < 0) {
if(!ClockInTool.contains(ClockInTool.deleteArrayNull(ycqts),num) && !ClockInTool.contains(ClockInTool.deleteArrayNull(xxts),num)) {
if(lea.getCompensateId() == 1) {
holidayturncompenleave++;
}else if(lea.getCompensateId() == 2) {
holidaytransferovertime++;
}
}
}
}
/*
* else{ if(Arrays.binarySearch(ClockInTool.deleteArrayNull(sblacks), num) >= 0)
* { rowData.add("上班缺卡"); }else
......@@ -602,6 +522,91 @@ public class AttendanceTaskTiming{
*/
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(leaves),num)) {
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 company = "未知";//请假单位
if(lea != null) {
KqglAssoLeaveRules rul = KqglAssoLeaveRules.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getId, lea.getLeaveTypeId()));
if(rul != null) {
leavetype = rul.getName();
//1:按天请假;2:按半天;3:按小时
if(rul.getCompany() == 1) { company = "天"; }
else if(rul.getCompany() == 2) { company = "半天"; }
else { company = "小时"; }
}
}
rowData.add(lea.getStartTime() +"到"+ lea.getEndTime()+"请"+leavetype+lea.getDuration()+company);
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(travels),num)) {
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()+"天");
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(goouts),num)) {
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()+"天");
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(cards),num)) {
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());
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(overtimes),num)) {
String company = "未知",method = "无";//加班单位、加班补偿方式
List<KqglAssoRelationSummary> leas = KqglAssoRelationSummary.builder().build().selectList(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 1));
for(KqglAssoRelationSummary lea : leas) {
//最小加班单位 1:按分钟加班、2:按半小时加班、3:按小时加班、4:按半天加班、5:按天加班
KqglAssoOvertimeBasics basics = KqglAssoOvertimeBasics.builder().build().selectOne(new QueryWrapper<KqglAssoOvertimeBasics>().lambda().eq(KqglAssoOvertimeBasics::getOrgCode, org_code));
if(basics.getMinimumUnit() == 1) { company = "分钟"; }
else if(basics.getMinimumUnit() == 2) { company = "半小时";}
else if(basics.getMinimumUnit() == 3) { company = "小时";}
else if(basics.getMinimumUnit() == 4) { company = "半天";}
else if(basics.getMinimumUnit() == 5) { company = "天";}
//1:转调休;2:转加班费;3:转调休或加班费
if(lea.getCompensateId() == 1) { method="转调休"; }
else if(lea.getCompensateId() == 2) { method="转加班费"; }
else {method="转调休或加班费";}
rowData.add(lea.getStartTime() +"到"+ lea.getEndTime()+"加班"+lea.getDuration()+company+"["+method+"]");
//加班补偿方式 1:转调休;2:转加班费;3:转调休或加班费
//工作日
if(ClockInTool.contains(ClockInTool.deleteArrayNull(ycqts),num)) {
if(lea.getOvertimeTypeId() == 1) {
if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) {
workingturncompenleave = workingturncompenleave + lea.getDuration();
}else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) {
workingtransferovertime = workingtransferovertime + + lea.getDuration();
}
}
}
//休息日
if(ClockInTool.contains(ClockInTool.deleteArrayNull(xxts),num)) {
if(lea.getOvertimeTypeId() == 2) {
if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) {
restturncompenleave = restturncompenleave + lea.getDuration();
}else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) {
resttransferovertime = resttransferovertime + lea.getDuration();
}
}
}
if(!ClockInTool.contains(ClockInTool.deleteArrayNull(ycqts),num) && !ClockInTool.contains(ClockInTool.deleteArrayNull(xxts),num)) {
if(lea.getOvertimeTypeId() == 3) {
if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) {
// holidayturncompenleave++;
holidayturncompenleave = holidayturncompenleave + lea.getDuration();
}else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) {
// holidaytransferovertime++;
holidaytransferovertime = holidaytransferovertime + lea.getDuration();
}
}
}
}
}
////////
KqglAssoBcsz shif = KqglAssoBcsz.builder().build();
if(attgro.getPbfs() == 1){
......
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