1. 月薪调整为第二天凌晨3点之前可打下班卡
2. 日薪取消最大4小时加班限制
This commit is contained in:
parent
eb31b29f1b
commit
4482d05ff4
@ -109,7 +109,20 @@ public class KQDeviceExchangeProcessor implements PunchTheClockStrategyExchangeP
|
||||
}
|
||||
|
||||
public Boolean showButton(SysStaffDetail detail){
|
||||
return (detail.getBasicSalary() != null && detail.getBasicSalary().compareTo(new BigDecimal(0)) > 0) && (detail.getJobsSalary() != null && detail.getJobsSalary().compareTo(new BigDecimal(0)) > 0) && (!checkToDayCard(String.valueOf(detail.getStaffId()), "上班") && !checkToDayCard(String.valueOf(detail.getStaffId()),"加班"));
|
||||
//return (detail.getBasicSalary() != null && detail.getBasicSalary().compareTo(new BigDecimal(0)) > 0) && (detail.getJobsSalary() != null && detail.getJobsSalary().compareTo(new BigDecimal(0)) > 0) && (!checkToDayCard(String.valueOf(detail.getStaffId()), "上班") && !checkToDayCard(String.valueOf(detail.getStaffId()),"加班"));
|
||||
//首先得是月薪
|
||||
if((detail.getBasicSalary() != null && detail.getBasicSalary().compareTo(new BigDecimal(0)) > 0) && (detail.getJobsSalary() != null && detail.getJobsSalary().compareTo(new BigDecimal(0)) > 0)){
|
||||
//其次, 判断当前时间是否<限定时间
|
||||
Date date = new Date();
|
||||
//获取当前小时
|
||||
if(date.getHours() <= ParamUtils.getLimitMonthOffDutyHour()){
|
||||
//获取当前时间的前一天的情况
|
||||
return ((!checkToDayCard(String.valueOf(detail.getStaffId()), "上班", DateUtils.addDays(date, -1)) && !checkToDayCard(String.valueOf(detail.getStaffId()),"加班", DateUtils.addDays(date, -1))));
|
||||
}else{
|
||||
return ((!checkToDayCard(String.valueOf(detail.getStaffId()), "上班", date) && !checkToDayCard(String.valueOf(detail.getStaffId()),"加班", date)));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -128,11 +141,11 @@ public class KQDeviceExchangeProcessor implements PunchTheClockStrategyExchangeP
|
||||
* 2.考勤出现漏打卡,次日可以正常打卡(8小时制员工)】 其中8小时制员工 为单班制打卡
|
||||
*/
|
||||
//上班卡
|
||||
if(rules.contains("上班") && checkToDayCard(userId, "上班")){
|
||||
if(rules.contains("上班") && checkToDayCard(userId, "上班", date)){
|
||||
return initMessage(1, "当天已经打过上班卡");
|
||||
}
|
||||
//上班卡
|
||||
if(rules.contains("加班") && checkToDayCard(userId, "加班")){
|
||||
if(rules.contains("加班") && checkToDayCard(userId, "加班", date)){
|
||||
return initMessage(1, "当天已经打过加班卡");
|
||||
}
|
||||
|
||||
@ -196,12 +209,12 @@ public class KQDeviceExchangeProcessor implements PunchTheClockStrategyExchangeP
|
||||
return initMessage(1, "打卡失败");
|
||||
}
|
||||
|
||||
public Boolean checkToDayCard(String userId, String rules){
|
||||
public Boolean checkToDayCard(String userId, String rules, Date date){
|
||||
return ObjectUtils.isNotEmpty(rzAttendanceDetailService.getOne(new LambdaQueryWrapper<RzAttendanceDetail>()
|
||||
.like(RzAttendanceDetail::getButtonType,"%"+rules+"%")
|
||||
.eq(RzAttendanceDetail::getStaffId, Long.valueOf(userId))
|
||||
.eq(RzAttendanceDetail::getDelFlag, Constants.DELETE_FLAG_0)
|
||||
.apply(" date_format(date_time,'%Y%m%d') = date_format({0},'%Y%m%d') ", new Date())));
|
||||
.apply(" date_format(date_time,'%Y%m%d') = date_format({0},'%Y%m%d') ", date)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -137,7 +137,6 @@ public class RzAttendanceDetailServiceImpl extends ServiceImpl<RzAttendanceDetai
|
||||
//用户Id
|
||||
Integer userId = Integer.valueOf(String.valueOf(threeDayNotCheck.get("userId")));
|
||||
//最后打卡时间
|
||||
System.out.println(threeDayNotCheck.get("lastDate"));
|
||||
Date lastDateTme = DateUtils.parseDate(String.valueOf(threeDayNotCheck.get("lastDate")), "yyyy-MM-dd");
|
||||
//首先获取最后打卡时间到今天的所有天数
|
||||
List<String> holidayDates = Collections.emptyList();
|
||||
|
||||
@ -129,7 +129,7 @@ public class ParamUtils {
|
||||
}
|
||||
|
||||
/***
|
||||
* 获取日薪全勤天数
|
||||
* 段休扣减时长
|
||||
* @return
|
||||
*/
|
||||
public static String getShortBreakDeductionMinutes(String type){
|
||||
@ -210,7 +210,12 @@ public class ParamUtils {
|
||||
RzSysParam param= paramService.getRzSysParam("特殊加班的考勤规则", "device_over_time_rules","{\"ET74336\":{\"minHour\":2, \"maxHour\":3,\"endMealTime\":\"19:00\"}}","特殊加班的考勤规则, minHour:最小加班时长. maxHour: 最大加班时长, endMealTime: 餐厅闭厅时间");
|
||||
JSONObject jsonObject = JSONObject.parseObject(param.getParamValue());
|
||||
JSONObject rules = jsonObject.getJSONObject(sn);
|
||||
return (ObjectUtils.isEmpty(rules) ? JSONObject.parseObject("{\"maxHour\":4}") : rules);
|
||||
return (ObjectUtils.isEmpty(rules) ? getDefaultMaxOverTime(): rules);
|
||||
}
|
||||
|
||||
private static JSONObject getDefaultMaxOverTime(){
|
||||
RzSysParam param= paramService.getRzSysParam("默认最大加班时长", "default_max_over_time_rules","{\"maxHour\":12}","最大加班时长");
|
||||
return JSONObject.parseObject(param.getParamValue());
|
||||
}
|
||||
|
||||
/***
|
||||
@ -355,6 +360,15 @@ public class ParamUtils {
|
||||
return Boolean.valueOf(param.getParamValue());
|
||||
}
|
||||
|
||||
/***
|
||||
* 获取月薪下班卡截止时间
|
||||
* @return
|
||||
*/
|
||||
public static Integer getLimitMonthOffDutyHour(){
|
||||
RzSysParam param= paramService.getRzSysParam("月薪下班卡截止时间", "limit_month_off_duty_hour","3","月薪下班卡截止时间");
|
||||
return Integer.valueOf(param.getParamValue());
|
||||
}
|
||||
|
||||
public static RzSysParam getRzSysParam(String code){
|
||||
return paramService.getRzSysParam(code);
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ spring:
|
||||
# 热部署开关
|
||||
redis:
|
||||
# 地址
|
||||
host: 192.168.16.128
|
||||
host: 192.168.5.112
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
|
||||
@ -7,7 +7,7 @@ spring:
|
||||
# 热部署开关
|
||||
redis:
|
||||
# 地址
|
||||
host: 192.168.16.128
|
||||
host: 192.168.5.112
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#??ID-PROD
|
||||
X-KDApi-AcctID = 670768a85463de
|
||||
#X-KDApi-AcctID = 670768a85463de
|
||||
X-KDApi-AcctID = 695f86f96090b2
|
||||
#X-KDApi-AcctID = 6723465a38c722
|
||||
X-KDApi-UserName = Administrator
|
||||
#??IDID
|
||||
|
||||
Loading…
Reference in New Issue
Block a user