打卡调整

This commit is contained in:
andy 2025-06-17 09:53:49 +08:00
parent deb4b535ec
commit d3dc294b37
4 changed files with 17 additions and 5 deletions

View File

@ -5,6 +5,9 @@ import com.evo.attendance.domain.vo.RzAttendanceData;
import com.evo.attendance.domain.vo.RzAttendanceVo;
import com.evo.common.constant.Constants;
import com.evo.common.utils.StringUtils;
import com.evo.common.utils.spring.SpringUtils;
import com.evo.personnelMatters.domain.EqOverStaff;
import com.evo.personnelMatters.mapper.EqOverStaffMapper;
import com.evo.system.domain.SysStaff;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -59,7 +62,12 @@ public interface PunchTheClockStrategyExchangeProcessor {
if(StringUtils.isEmpty(sysStaff.getTimeClock())){
return "当前人员未注册打卡机";
}
if(!sn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE) && !sn.equals(sysStaff.getTimeClock())){
//不是特殊打卡, 并且不是公共打卡, 并且当前打卡设备不是人员绑定设备
if(!sn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_OVER_TIME_CODE) && !sn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE) && !sn.equals(sysStaff.getTimeClock())){
return "未设置当前考勤机打卡权限";
}
//是特殊打卡 并且 特殊打卡人员中, 不包含当前人员
if(sn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_OVER_TIME_CODE) && StringUtils.isNull(SpringUtils.getBean(EqOverStaffMapper.class).selectEqOverStaffByUserId(sysStaff.getUserId()))){
return "未设置当前考勤机打卡权限";
}
return "";

View File

@ -9,6 +9,7 @@ import com.evo.common.utils.Collections;
import com.evo.common.utils.StringUtils;
import com.evo.equipment.domain.EqButton;
import com.evo.equipment.mapper.EqButtonMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
@ -22,6 +23,7 @@ import java.util.Map;
@Service
@Slf4j
public class PunchTheClockServiceImpl implements PunchTheClockService {
@Resource
@ -52,6 +54,7 @@ public class PunchTheClockServiceImpl implements PunchTheClockService {
public String returnMessage(String json){
//解析收到的数据
JSONObject jsonObject = JSONObject.parseObject(json);
log.info("获取打卡按钮信息{}", jsonObject.toString());
String userId = jsonObject.getString("user_id");
//需要推送的数据
String sn = jsonObject.getString("sn");
@ -216,7 +219,7 @@ public class PunchTheClockServiceImpl implements PunchTheClockService {
//根据顺序获取打卡规则
EqButton eqButton = bt_list.get(Integer.parseInt(button)-1);
String rules = eqButton.getName(); //打卡规则
log.info("获取打卡信息{}", jsonObject.toString());
Map<String, PunchTheClockStrategyExchangeProcessor> mqttRequestExchangeProcessorMap = applicationContext.getBeansOfType(PunchTheClockStrategyExchangeProcessor.class);
for (PunchTheClockStrategyExchangeProcessor processor : mqttRequestExchangeProcessorMap.values()) {
if(processor.accept(sn)){

View File

@ -192,9 +192,10 @@ public class EqSnDetailServiceImpl extends ServiceImpl<EqSnDetailMapper, EqSnDet
if(snList.size() ==1 && tsSn.contains(snList.get(0))){
snUserPhotoList.putAll(initTsDkDevice(snList.get(0)));
}else{
List<String> tsDeviceSn = Collections.findDuplicatesList(snList, tsSn);
List<String> allSnList = new ArrayList<String>(){{addAll(snList);}};
List<String> tsDeviceSn = Collections.findDuplicatesList(allSnList, tsSn);
//所有所有不是特殊打卡机人员信息
snList.remove(tsDeviceSn);
snList.stream().filter(sn-> !tsSn.contains(sn)).forEach(sn ->{
//获取所有未删除的, 没有离职的员工信息
List<SysStaff> userList = sysStaffMapper.selectList((new LambdaQueryWrapper<SysStaff>().eq(SysStaff::getTimeClock, sn).eq(SysStaff::getDelFlag, Constants.DELETE_FLAG_0).ne(SysStaff::getStatus,Constants.JOB_STATIS_11).select(SysStaff::getUserId, SysStaff::getName)));

View File

@ -202,7 +202,7 @@ public class SysStaff extends BaseEntity
private List<Long> subsidyList;
public List<Long> getSubsidyList() {
if(StringUtils.isNotEmpty(subsidys)){
if(Collections.isEmpty(subsidyList) && StringUtils.isNotEmpty(subsidys)){
subsidyList = Collections.asList(subsidys.split(",")).stream().map(Long::valueOf).collect(Collectors.toList());
}
return subsidyList;