添加人员考勤记录获取

This commit is contained in:
haozq 2025-12-31 09:30:41 +08:00
parent b9ee5aef43
commit 16293941c2
3 changed files with 111 additions and 2 deletions

View File

@ -79,7 +79,7 @@ public interface UrkSendService {
/**
* 获取设备配置
* 获取设备配置
* @param deviceCode
* @throws Exception
*/
@ -92,4 +92,28 @@ public interface UrkSendService {
*/
void setDeviceConfig(DeviceConfigVo vo) throws Exception;
/**
* 获取设备考勤机内考勤打卡记录-自动同步到考勤表不会同步到记录表
* @param
* @throws Exception
*/
void getDevAttr(String deviceCode,String startTime,String endTime) throws Exception;
/**
* 考勤机上考勤记录重新上传
* @param deviceCode
* @param startTime
* @param endTime
* @throws Exception
*/
void setAttrUpload(String deviceCode,String startTime,String endTime) throws Exception;
/**
* 清除考情机上全部日志记录
* @param deviceCode
* @throws Exception
*/
void clearLogs(String deviceCode) throws Exception;
}

View File

@ -377,6 +377,91 @@ public class UrkSendServiceImpl implements UrkSendService {
}
}
/**
* 开始时间-结束时间
* @param deviceCode
* @param startTime
* @param endTime
* @throws Exception
*/
@Override
public void getDevAttr(String deviceCode, String startTime, String endTime) throws Exception {
try{
try{
String createTime= DateUtils.getTime();
BmwKqCmdTaskVo taskVo=new BmwKqCmdTaskVo();
taskVo.setDeviceCode(deviceCode);
taskVo.setCreateTime(createTime);
taskVo.setCmdCode("GET_LOG_DATA");
//等待执行
taskVo.setTransStatus(TaskStatusEnum.WAIT.ordinal());
taskVo.setCmdParam("{\"startTime\":\""+startTime+"\",\"endTime\":\""+endTime+"\"}");
//添加任务
mapper.insertCmdTask(taskVo);
//添加历史记录
mapper.insertCmdTaskHistory(taskVo);
}catch (Exception e){
log.error(e.toString(),e);
throw new Exception("获取考勤信息下发失败");
}
}catch (Exception e){
log.error(e.toString(),e);
throw new RuntimeException("获取考勤信息下发失败");
}
}
@Override
public void setAttrUpload(String deviceCode, String startTime, String endTime) throws Exception {
try{
try{
String createTime= DateUtils.getTime();
BmwKqCmdTaskVo taskVo=new BmwKqCmdTaskVo();
taskVo.setDeviceCode(deviceCode);
taskVo.setCreateTime(createTime);
taskVo.setCmdCode("RESET_LOG_MARK");
//等待执行
taskVo.setTransStatus(TaskStatusEnum.WAIT.ordinal());
taskVo.setCmdParam("{\"startTime\":\""+startTime+"\",\"endTime\":\""+endTime+"\"}");
//添加任务
mapper.insertCmdTask(taskVo);
//添加历史记录
mapper.insertCmdTaskHistory(taskVo);
}catch (Exception e){
log.error(e.toString(),e);
throw new Exception("重置考勤记录上传失败");
}
}catch (Exception e){
log.error(e.toString(),e);
throw new RuntimeException("考勤记录上传下发失败");
}
}
@Override
public void clearLogs(String deviceCode) throws Exception {
try{
try{
String createTime= DateUtils.getTime();
BmwKqCmdTaskVo taskVo=new BmwKqCmdTaskVo();
taskVo.setDeviceCode(deviceCode);
taskVo.setCreateTime(createTime);
taskVo.setCmdCode("CLEAR_LOG_DATA");
//等待执行
taskVo.setTransStatus(TaskStatusEnum.WAIT.ordinal());
taskVo.setCmdParam("{}");
//添加任务
mapper.insertCmdTask(taskVo);
//添加历史记录
mapper.insertCmdTaskHistory(taskVo);
}catch (Exception e){
log.error(e.toString(),e);
throw new Exception("获取配置添加失败");
}
}catch (Exception e){
log.error(e.toString(),e);
throw new RuntimeException("获取考勤信息下发失败");
}
}
public void sendUserToDeviceList(List<Integer> userId,String key,int pageNum, int type,BmwKqCmdTaskVo taskVo){
List<BmwDeviceVo> list ;

View File

@ -37,9 +37,9 @@ public class ResultHandle {
String isok = req.getHeader("cmd_return_code");
try{
KqCmdTaskVo taskVo=service.getTaskVoById(asTransId);
taskVo.setDeviceName(deviceVo.getDeviceName());
//存在任务
if(taskVo!=null){
taskVo.setDeviceName(deviceVo.getDeviceName());
//任务失败了
if (!isok.equals(Constant.OK)) {
//执行失败